text
stringlengths 2
1.05M
|
|---|
import ViewerConfigurator from './Viewer.Configurator'
export default ViewerConfigurator
|
/**
* Description:
* Created by Xiaocheng Zuo on 2017-03-05 15:14:08
* @flow
*/
import React from 'react';
import {
View,
Text,
StyleSheet
} from 'react-native';
import Icon from 'react-native-vector-icons/Ionicons';
export default class TabIcon extends React.Component {
render() {
return (
<View style={styles.container}>
<Icon
color={this.props.selected ? '#3e9ce9' : '#999999'}
name={this.props.iconName}
size={25}
/>
<Text style={[styles.title, { color: this.props.selected ? '#3e9ce9' : '#999999' }]}>
{this.props.title}
</Text>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flexDirection: 'column',
alignItems: 'center'
},
title: {
fontSize: 14
}
});
|
import React from "react"
import { Link, graphql, StaticQuery } from "gatsby"
import IMG from 'gatsby-image'
const ProduktsItem = ({ data }) => (
<StaticQuery
query={ graphql`
query IndexQuery {
allStrapiProdukts {
edges {
node {
id
title
cost
slug
specification
img_produkt {
childImageSharp {
fluid {
...GatsbyImageSharpFluid
}
}
}
}
}
}
}
`}
render={data => (
<section className='produkt_wrapper'>
<h2>Мы предлагаем :</h2>
<div className='produkt_conteiner'>
{
data.allStrapiProdukts.edges.map(({ node }) =>(
<div className='produkt_item' key={node.id}>
<h3>{node.title}</h3>
<figure className='produkt_item-figure' >
<IMG fluid={ node.img_produkt.childImageSharp.fluid} alt={node.title} title={node.title}/>
<Link to={`/${node.slug}`}>
<button className="to_produkt">
Подробнее
</button>
</Link>
<figcaption className='cost'>Цена: { node.cost }$</figcaption>
</figure>
<ul dangerouslySetInnerHTML={ { __html: node.specification } } />
</div>
) )
}
</div>
</section>
)}
/>
)
export default ProduktsItem;
|
!function(y){"function"==typeof define&&define.amd?define(["kendo.core"],y):y()}(function(){kendo.cultures.bg={name:"bg",numberFormat:{pattern:["-n"],decimals:2,",":" ",".":",",groupSize:[3],percent:{pattern:["-n%","n%"],decimals:2,",":" ",".":",",groupSize:[3],symbol:"%"},currency:{name:"",abbr:"",pattern:["-n $","n $"],decimals:2,",":" ",".":",",groupSize:[3],symbol:"лв."}},calendars:{standard:{days:{names:["неделя","понеделник","вторник","сряда","четвъртък","петък","събота"],namesAbbr:["нед","пон","вт","ср","четв","пет","съб"],namesShort:["нд","пн","вт","ср","чт","пт","сб"]},months:{names:["януари","февруари","март","април","май","юни","юли","август","септември","октомври","ноември","декември"],namesAbbr:["яну","фев","мар","апр","май","юни","юли","авг","сеп","окт","ное","дек"]},AM:[""],PM:[""],patterns:{d:"d.M.yyyy 'г.'",D:"dd MMMM yyyy 'г.'",F:"dd MMMM yyyy 'г.' H:mm:ss",g:"d.M.yyyy 'г.' H:mm",G:"d.M.yyyy 'г.' H:mm:ss",m:"d MMMM",M:"d MMMM",s:"yyyy'-'MM'-'dd'T'HH':'mm':'ss",t:"H:mm",T:"H:mm:ss",u:"yyyy'-'MM'-'dd HH':'mm':'ss'Z'",y:"MMMM yyyy 'г.'",Y:"MMMM yyyy 'г.'"},"/":".",":":":",firstDay:1}}}});
|
import session from '@/api/session'
import {
ACCOUNT,
CHANGE_PASSWORD,
LOGIN,
LOGOUT,
RESET_PASSWORD,
SEND_RESET_PASSWORD_EMAIL
} from './endpoints'
export default {
login(username, password) {
return session.post(LOGIN, { username, password })
},
logout() {
return session.post(LOGOUT, {})
},
changeAccountPassword(password1, password2) {
return session.post(CHANGE_PASSWORD, {
password1,
password2
})
},
sendAccountPasswordResetEmail(email) {
return session.post(SEND_RESET_PASSWORD_EMAIL, { email })
},
resetAccountPassword(uid, token, new_password1, new_password2) {
return session.post(RESET_PASSWORD, {
uid,
token,
new_password1,
new_password2
})
},
getAccountDetails() {
return session.get(ACCOUNT)
},
updateAccountDetails(data) {
return session.patch(ACCOUNT, data)
}
}
|
/**
* <p>Project: MIT Liberal Project</p>
* <p>Description: config</p>
* <p>Copyright: Copyright (c) 2016</p>
* <p>Company: MIT Liberal Co., Ltd.</p>
*
* @author <cendey@126.com>
* @since 12/28/2016
* @version 1.0
*/
"use strict";
function metaForOracle() {
let dbMeta = Object.create(null);
//Oracle database instance access user with authorization
dbMeta.user = process.env.NODE_ORACLEDB_USER || "kerry_sb1_20140208";
// Instead of hard coding the password, consider prompting for it,
// passing it in an environment variable via process.env, or using
// External Authentication.
dbMeta.password = process.env.NODE_ORACLEDB_PASSWORD || "kerry_sb1_20140208";
// For information on connection strings see:
// https://github.com/oracle/node-oracledb/blob/master/doc/api.md#connectionstrings
dbMeta.connectString = process.env.NODE_ORACLEDB_CONNECTIONSTRING || "10.104.46.205:1523/orcl11g";
// Setting externalAuth is optional. It defaults to false. See:
// https://github.com/oracle/node-oracledb/blob/master/doc/api.md#extauth
dbMeta.externalAuth = !!process.env.NODE_ORACLEDB_EXTERNALAUTH;
return dbMeta;
}
function metaForMongodb() {
let dbMeta = Object.create(null);
//Database provider
dbMeta.provider = "mongodb";
//Mongodb authorization user to access database instance
dbMeta.user = "cendey";
//Mongodb authorized user's password
dbMeta.password = "practice_1216";
//Binding IP address
dbMeta.ip = "127.0.0.1";
//Access port
dbMeta.port = "27017";
//Database instance to access
dbMeta.database = "contacts";
//Database Url to access
dbMeta.url = dbMeta.provider + "://" + dbMeta.user + ":" + dbMeta.password + "@" + dbMeta.ip + ":" + dbMeta.port + "/" + dbMeta.database;
return dbMeta;
}
exports = module.exports = {metaForOracle, metaForMongodb};
|
'use strict';
(function(module) {
try {
module = angular.module('tink.popover');
} catch (e) {
module = angular.module('tink.popover', []);
}
module.directive( 'tinkPopover', ['$q','$templateCache','$http','$compile','$timeout','$window','$rootScope',function ($q,$templateCache,$http,$compile,$timeout,$window,$rootScope) {
return {
restrict:'EA',
scope: true,
compile: function compile( tElement, attrs ) {
var fetchPromises = {};
//to retrieve a template;
function getTemplate(template) {
// --- if the template already is in our app cache return it. //
if (fetchPromises[template]){
return fetchPromises[template];
}
// --- If not get the template from templatecache or http. //
return (fetchPromises[template] = $q.when($templateCache.get(template) || $http.get(template))
.then(function (res) {
// --- When the template is retrieved return it. //
if (angular.isObject(res)) {
$templateCache.put(template, res.data);
return res.data;
}
return res;
}));
}
var theTemplate = null;
if(attrs.tinkPopoverTemplate){
theTemplate = getTemplate(attrs.tinkPopoverTemplate);
}
return {
post: function postLink(scope, element, attributes) {
scope.$on('$destroy', function() {
element.off('click');
element.off('mouseenter');
element.off('mouseleave');
$(document).off('click');
$window.removeEventListener('resize', onresizefunc);
$window.removeEventListener('scroll', onscrollfunc);
});
var timeoutResize = null;
var onresizefunc = function () {
if (isOpen !== null) {
$timeout.cancel(timeoutResize);
timeoutResize = $timeout(function () {
// setPos(isOpen,placement,align,spacing);
calcPos(element, isOpen, placement, align, spacing);
}, 250);
}
};
var onscrollfunc = function () {
if (isOpen !== null) {
$timeout.cancel(timeoutResize);
timeoutResize = $timeout(function () {
// setPos(isOpen,placement,align,spacing);
calcPos(element, isOpen, placement, align, spacing);
}, 450);
}
};
var placement = attributes.tinkPopoverPlace;
var align = attributes.tinkPopoverAlign;
var arrow = attributes.tinkArrow;
var trigger = 'click';
var spacing = 2;
var isOpen = null;
if(trigger === 'click'){
element.bind('click',function(){
scope.$apply(function(){
if(isOpen === null){
show();
}else{
hide();
}
});
});
}else if(trigger === 'hover'){
element.bind('mouseenter',function(){
show();
});
element.bind('mouseleave',function(){
hide();
});
}
function popoverHtml(){
var html = '<div class="popover {{arrowPlacement}}">'+
'<span class="arrow"></span>'+
'</div>';
return html;
}
function childOf(c,p){ //returns boolean
while((c=c.parentNode)&&c!==p){
}
return !!c;
}
$(document).bind('click',function(e){
var clicked = $(e.target).parents('.popover').last();
var group = $(e.target).attr('tink-popover-group');
if(isOpen && !childOf($(e.target).get(0),element.get(0)) && ($(e.target).get(0) !== element.get(0) || clicked.length > 0)){
if(isOpen.get(0) !== clicked.get(0) && $(e.target).get(0) !== isOpen.get(0) && attributes.tinkPopoverGroup !== group){
hide();
}
}
});
if(attributes.tinkPopoverGroup){
scope.$on('popover-open', function(event, args) {
var group = args.group;
if(group !== attributes.tinkPopoverGroup && isOpen && $(args.el).get(0) !== isOpen.get(0)){
hide();
}
});
}
function show (){
if(theTemplate !== null){
theTemplate.then(function(data){
if(isOpen === null){
var elContent =$($compile('<div>'+data+'</div>')(scope));
var el =$($compile(popoverHtml())(scope));
el.css('position','absolute');
el.css('visibility','hidden');
elContent.insertAfter(el.find('span'));
if(placement === 'top'){
element.before(el);
}else{
element.after(el);
}
el.css('top',-100);
el.css('left',-10);
calcPos(element,el,placement,align,spacing);
if(attributes.tinkPopoverGroup){
$rootScope.$broadcast('popover-open', { group: attributes.tinkPopoverGroup,el:el });
}
isOpen = el;
}
});
}
}
$window.addEventListener('resize', onresizefunc, true);
$window.addEventListener('scroll', onscrollfunc, true);
function hide(){
if(isOpen !== null){
isOpen.remove();
isOpen = null;
}
}
//The function that will be called to position the tooltip;
function getPos(el,placement,align,spacing){
var porcent = {right:0.85,left:0.15,top:0.15,bottom:0.85};
// Default offset of the popover
var arrowHeight = 0;
var arrowWidth = 0;
// If the popover has an arrow, change the default offset
if (typeof arrow === 'undefined' || arrow === 'true') {
arrowHeight = 10;
arrowWidth = 10;
}
var alignLeft = 0;
var alignTop = 0;
if(align === 'center'){
alignLeft = (el.outerWidth(true) / 2)-(element.outerWidth(true)/2);
alignTop = 0;
}else if(align === 'left' || align === 'right'){
alignLeft = (el.outerWidth(true)*porcent[align]) -(element.outerWidth(true)/2);
}else if(align === 'top' || align === 'bottom'){
alignTop = 0;
}
var left = element.position().left - alignLeft;
var top = null;
if(placement === 'top'){
top = element.position().top - (el.outerHeight() + arrowHeight +spacing);
}else if(placement === 'bottom'){
top = element.position().top + element.outerHeight() + arrowHeight +spacing;
}else if(placement === 'right'){
left = element.position().left + element.outerWidth(true) + arrowWidth + spacing;
}else if(placement === 'left'){
left = element.position().left - el.outerWidth(true)- arrowWidth - spacing;
}
if(align === 'right'){
left = element.position().left + (element.outerWidth(true) - el.outerWidth(true));
}else if(align === 'left'){
left = element.position().left;
}else if(align === 'top'){
top = element.position().top;
}else if(align === 'bottom'){
top = element.position().top - el.outerHeight(true) + element.outerHeight(true);
}else if(align === 'center'){
if(placement === 'top' || placement === 'bottom'){
left = element.position().left - ((el.outerWidth(true) / 2)-(element.outerWidth(true)/2));
}else if(placement === 'left' || placement === 'right'){
top = element.position().top - ((el.outerHeight(true) / 2)-(element.outerHeight(true)/2));
}
}
return {top:top,left:left,place:placement,align:align};
}
function arrowCal(placement,align){
// show or don't show arrow
if (typeof arrow === 'undefined' || arrow === 'true') {
var arrowCss = 'arrow-';
switch(placement){
case 'left':
arrowCss = arrowCss + 'right';
break;
case 'right':
arrowCss = arrowCss + 'left';
break;
case 'top':
arrowCss = arrowCss + 'bottom';
break;
case 'bottom':
arrowCss = arrowCss + 'top';
break;
}
switch(align){
case 'center':
break;
case 'top':
case 'bottom':
if(placement === 'right' || placement === 'left'){
arrowCss = arrowCss + '-' + align;
}
break;
case 'left':
case 'right':
if(placement === 'top' || placement === 'bottom'){
arrowCss = arrowCss + '-' + align;
}
}
scope.arrowPlacement = arrowCss;
}
}
arrowCal(placement,align);
//calculate the position
function calcPos(element,el,place,align,spacing){
var pageScrollY = ($window.scrollY || $window.pageYOffset);
var pageScrollX = ($window.scrollX || $window.pageXOffset);
var w1 = element.offset().left - pageScrollX;
var w2 = $window.innerWidth - (w1+element.outerWidth(true));
var h1 = element.offset().top - Math.ceil(parseFloat($('body').css('padding-top'))) - pageScrollY;
var h2 = $window.innerHeight - (h1+element.outerHeight(true));
if(place){
if(place==='top'){
if(el.outerHeight(true) + spacing + 10 > h1){
place = undefined;
align = undefined;
}
}else if (place === 'bottom'){
if(el.outerHeight(true) + spacing + 10 > h2){
place = undefined;
align = undefined;
}
}else if(place === 'left'){
if((el.outerWidth(true) - element.outerWidth(true)) > w1){
place = undefined;
align = undefined;
}
}else if(place === 'right'){
if((el.outerWidth(true) - element.outerWidth(true)) > w2){
place = undefined;
align = undefined;
}
}else{
place = undefined;
align = undefined;
}
}
if(!place){
if(h1 > element.outerHeight() || h2 > element.outerHeight()){
if(h1 > h2){
place = 'top';
}else{
place = 'bottom';
}
}else if(w1 > element.outerWidth() || w2 > element.outerWidth()){
if(w1 > w2){
place = 'left';
}else {
place = ' right';
}
}else{
place = 'bottom';
}
}
var val;
if(align){
if(place === 'left' || place === 'right'){
if(align === 'top'){
if((el.outerHeight(true) - element.outerHeight(true))> h2){
align = undefined;
}
}else if(align === 'bottom'){
if((el.outerHeight(true) - element.outerHeight(true))> h1){
align = undefined;
}
}else if(align === 'center'){
val = (el.outerHeight(true) - element.outerHeight(true)) / 2;
if(val > h1 || val > h2){
align = undefined;
}
}
}else if(place === 'top' || place === 'bottom'){
if(align === 'left'){
if((el.outerWidth(true) - element.outerWidth(true))> w2){
align = undefined;
}
}else if(align === 'right'){
if((el.outerWidth(true) - element.outerWidth(true))> w1){
align = undefined;
}
}else if(align === 'center'){
val = (el.outerWidth(true) - element.outerWidth(true))/2;
if(val > w1 || val > w2){
align = undefined;
}
}
}
}
if(!align){
if(place === 'left' || place === 'right'){
if(h1 > h2){
align = 'bottom';
}else {
align = 'top';
}
}else if(place === 'top' || place === 'bottom'){
if(w1 > w2){
align = 'right';
}else{
align = 'left';
}
}
}
function calcPostInside(){
var data = getPos(el,place,align,spacing);
el.css('top',data.top);
el.css('left',data.left);
arrowCal(data.place,data.align);
}
// calcPostInside();
$timeout(function(){
calcPostInside();
el.css('visibility','visible');
},20);
// Fix an early transition
$timeout(function(){
el.addClass('popover-transition');
},250);
}
}
};
}
};
}]);
})();
;;
|
const {contextUid, uid, callbacks} = context.params;
const doc = callbacks.getDocument().current.contentDocument;
const win = callbacks.getDocument().current.contentWindow;
if (!doc || !win) return;
function isInViewport(element) {
const rect = element.getBoundingClientRect();
return (
rect.top >= 0 &&
rect.left >= 0 &&
rect.bottom <= (win.innerHeight || doc.documentElement.clientHeight) &&
rect.right <= (win.innerWidth || doc.documentElement.clientWidth)
);
}
const getPercent = () => {
let height = Math.max(
doc.body.scrollHeight,
doc.body.offsetHeight,
doc.documentElement.clientHeight,
doc.documentElement.scrollHeight,
doc.documentElement.offsetHeight
);
let scrollFromTop = (doc.documentElement.scrollTop || doc.body.scrollTop);
if (scrollFromTop + doc.documentElement.clientHeight >= height) return 100;
return parseInt((scrollFromTop / height) * 100);
};
const all = doc.body.querySelectorAll("*");
let progress = false;
let percent = 0;
for (let i=0, max=all.length; i < max; i++) {
let curr = all[i];
if (i !== 0 && typeof curr.textContent === "string" && curr.textContent !== "" && isInViewport(curr)) {
progress = [all[i-1].outerHTML, all[i].outerHTML, all[i+1].outerHTML];
percent = getPercent();
break;
}
}
if (progress) {
// Now we can add it to reading progress!
let obj = {
item: {uid: uid},
context: {uid: contextUid},
progress: JSON.stringify(progress),
percent
};
//console.log(obj);
setTimeout(async () => {
const uids = await unigraph.addObject(obj, '$/schema/incremental_reader_item');
await unigraph.runExecutable("$/executable/add-item-to-list", {where: "$/entity/read_later", item: uids[0]});
}, 0)
callbacks.closeTab();
}
|
const mix = require('laravel-mix');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel applications. By default, we are compiling the CSS
| file for the application as well as bundling up all the JS files.
|
*/
mix.js('resources/js/app.js', 'public/js')
/*.postCss('resources/css/app.css', 'public/css', [
require('postcss-import'),
require('tailwindcss'),
require('autoprefixer'),
])*/
// .js('resources/js/tabler.js', 'public/js')
// .sass('resources/sass/tabler.scss', 'public/css')
.disableNotifications()
.browserSync({
notify: false,
ghostMode: false,
proxy: 'http://localhost:8000',
host: '192.168.0.113',
});
|
var searchData=
[
['ijk',['ijk',['../structedda_1_1Cell.html#a751450b94f6ae7d56f1df6e8320269a2',1,'edda::Cell']]],
['incell',['inCell',['../structedda_1_1PointInfo.html#a13dba4966a4b7d7e4e552e9010e7963f',1,'edda::PointInfo']]],
['indent',['indent',['../classeddaRandomProbeFilter.html#ac38d146802cd315d7581a237b2deb183',1,'eddaRandomProbeFilter::indent()'],['../classeddaRandomSampleField.html#aa4a51806545d1361a752d2b71a2f3b16',1,'eddaRandomSampleField::indent()'],['../classeddaThreshold.html#a357e9ccf6a6db4f7e4c03c3da2fe2a16',1,'eddaThreshold::indent()'],['../classeddaUncertainIsocontour.html#aff0c0464cef279618d1126b3c6ef0ec1',1,'eddaUncertainIsocontour::indent()']]],
['interpolant',['interpolant',['../structedda_1_1PointInfo.html#a4c998e4aae508e07f67824248763dbfd',1,'edda::PointInfo']]],
['isov',['Isov',['../classeddaRandomSampleField.html#a781625f8263388cd304a6d34dd072be3',1,'eddaRandomSampleField::Isov()'],['../classeddaUncertainIsocontour.html#ac39cde59b4de5e912bcad2df35be2593',1,'eddaUncertainIsocontour::Isov()']]]
];
|
function llenarEspacioNav() {
const divEspacioNav = document.getElementById("espacio-nav");
let alturaNav = document.querySelector("nav").offsetHeight;
console.log(alturaNav);
divEspacioNav.style.height = alturaNav + "px";
}
window.onload = llenarEspacioNav;
window.addEventListener('resize', llenarEspacioNav);
llenarEspacioNav();
|
/* eslint-disable no-console */
/* eslint-disable no-unused-vars */
import {
beforeCall,
afterCall,
aroundCall,
afterFulfillment,
afterRejection,
whilePending,
beforeGet,
afterGet,
aroundGet,
beforeSet,
afterSet,
aroundSet,
onCatch,
meta,
targetClass,
onFinally
} from "aopla";
import {
Tag1,
Tag2,
ClassTag1,
PropTag1,
PropTag2,
Tag7,
Tag9,
StaticPropTag1,
PropTag3,
Tag13,
Tag14,
Tag17,
Tag18,
Tag20,
Tag22,
Tag23,
Tag25,
Tag27,
PropTag5,
PropTag7,
PropTag4,
PropTag8,
Tag28,
Tag29,
PropTag9,
PropTag10,
PropTag11,
Tag32
} from "../tags";
// eslint-disable-next-line no-console
console.log("importing SomeAspect");
class SomeAspect {
@afterCall(Tag1)
afterCallingMethodWithTag1(paramsObj) {
console.warn("SomeAspect.afterCallingMethodWithTag1()", paramsObj);
// ...
}
@afterCall(Tag2)
afterCallingMethodWithTag2(paramsObj) {
console.warn("SomeAspect.afterCallingMethodWithTag2()", paramsObj);
// ...
}
@afterFulfillment(Tag7)
afterFulfillingPromiseReturnedByAMethodWithTag7(paramsObj) {
console.warn(
"SomeAspect.afterFulfillingPromiseReturnedByAMethodWithTag7()",
paramsObj
);
// ...
}
@afterGet(PropTag1)
afterGettingPropertyWithTagPropTag1(paramsObj) {
console.warn("SomeAspect.afterGettingPropertyWithPropTag1()", paramsObj);
// ...
}
@afterGet(PropTag2)
afterGettingPropertyWithTagPropTag2(paramsObj) {
console.warn("SomeAspect.afterGettingPropertyWithPropTag2()", paramsObj);
// ...
}
@afterRejection(Tag9)
afterRejectingPromiseReturnedByAMethodWithTag9(paramsObj) {
console.warn(
"SomeAspect.afterRejectingPromiseReturnedByAMethodWithTag9()",
paramsObj
);
// ...
}
@afterSet(StaticPropTag1)
afterSettingPropertyWithStaticPropTag1(paramsObj) {
console.warn(
"SomeAspect.afterSettingPropertyWithStaticPropTag1()",
paramsObj
);
// ...
}
@afterSet(PropTag2)
afterSettingPropertyWithPropTag2(paramsObj) {
console.warn("SomeAspect.afterSettingPropertyWithPropTag2()", paramsObj);
// ...
}
@afterSet(PropTag3)
afterSettingPropertyWithPropTag3(paramsObj) {
console.warn("SomeAspect.afterSettingPropertyWithPropTag3()", paramsObj);
// ...
}
@onCatch(Tag13)
onCatchingFromMethodWithTag13(paramsObj) {
console.warn("SomeAspect.onCatchingFromMethodWithTag13()", paramsObj);
// ...
throw paramsObj.e;
}
@Tag13()
@afterCall(Tag14)
afterCallingMethodWithTag14(paramsObj) {
console.warn("SomeAspect.afterCallingMethodWithTag14()", paramsObj);
// ...
throw new Error("SomeAspect.afterCallingMethodWithTag14() error");
}
@onFinally(Tag17, { afterCall })
onFinallyFromMethodWithTag17(paramsObj) {
console.warn("SomeAspect.onFinallyFromMethodWithTag17()", paramsObj);
// ...
return (
paramsObj.returnValue ||
paramsObj.value ||
"SomeAspect.onFinallyFromMethodWithTag17() return value"
);
}
@onFinally(Tag17, { afterCall })
anotherOnFinallyFromMethodWithTag17(paramsObj) {
console.warn("SomeAspect.anotherOnFinallyFromMethodWithTag17()", paramsObj);
// ...
return (
paramsObj.returnValue ||
paramsObj.value ||
"SomeAspect.anotherOnFinallyFromMethodWithTag17() return value"
);
}
@onFinally(Tag18, { afterCall })
onFinallyFromMethodWithTag18(paramsObj) {
console.warn("SomeAspect.onFinallyFromMethodWithTag18()", paramsObj);
// ...
return (
paramsObj.returnValue ||
paramsObj.value ||
"SomeAspect.onFinallyFromMethodWithTag18() return value"
);
}
@onFinally(Tag20, { aroundCall })
onFinallyAfterCallingMethodWithTag20(paramsObj) {
console.warn(
"SomeAspect.onFinallyAfterCallingMethodWithTag20()",
paramsObj
);
// ...
return void 0; // This is considered as if the finally block didn't return anything.
// return null; // This would override the return value.
}
@aroundCall(Tag22)
aroundCallingMethodWithTag22(paramsObj) {
{
// around before
console.warn(
"SomeAspect.aroundCallingMethodWithTag22() around before",
paramsObj
);
// ...
}
const returnValue = paramsObj.proceed();
{
const {
argumentsList,
effectiveArgumentsList,
hasPerformedUnderlyingOperation,
hasEffectivelyPerformedUnderlyingOperation,
...rest
} = paramsObj;
// around after
console.warn(
"SomeAspect.aroundCallingMethodWithTag22() around after",
paramsObj,
{
argumentsList,
effectiveArgumentsList,
hasPerformedUnderlyingOperation,
hasEffectivelyPerformedUnderlyingOperation,
...rest
},
{
returnValue
}
);
// ...
}
return returnValue;
}
@aroundCall(Tag23)
aroundCallingMethodWithTag23(paramsObj) {
{
// around before
console.warn(
"SomeAspect.aroundCallingMethodWithTag23() around before",
paramsObj
);
// ...
}
const returnValue = paramsObj.proceed();
{
const {
argumentsList,
effectiveArgumentsList,
hasPerformedUnderlyingOperation,
hasEffectivelyPerformedUnderlyingOperation,
...rest
} = paramsObj;
// around after
console.warn(
"SomeAspect.aroundCallingMethodWithTag23() around after",
paramsObj,
{
argumentsList,
effectiveArgumentsList,
hasPerformedUnderlyingOperation,
hasEffectivelyPerformedUnderlyingOperation,
...rest
},
{
returnValue
}
);
// ...
}
return returnValue;
}
@aroundCall(Tag25)
aroundCallingMethodWithTag25(paramsObj) {
{
// around before
console.warn(
"SomeAspect.aroundCallingMethodWithTag25() around before",
paramsObj
);
// ...
}
const returnValue = paramsObj.proceed();
{
const {
argumentsList,
effectiveArgumentsList,
hasPerformedUnderlyingOperation,
hasEffectivelyPerformedUnderlyingOperation,
...rest
} = paramsObj;
// around after
console.warn(
"SomeAspect.aroundCallingMethodWithTag25() around after",
paramsObj,
{
argumentsList,
effectiveArgumentsList,
hasPerformedUnderlyingOperation,
hasEffectivelyPerformedUnderlyingOperation,
...rest
},
{
returnValue
}
);
// ...
}
return returnValue;
}
@aroundCall(Tag27)
aroundCallingMethodWithTag27(paramsObj) {
{
// around before
console.warn(
"SomeAspect.aroundCallingMethodWithTag27() around before",
paramsObj
);
// ...
}
const returnValue = paramsObj.proceed();
{
const {
argumentsList,
effectiveArgumentsList,
hasPerformedUnderlyingOperation,
hasEffectivelyPerformedUnderlyingOperation,
...rest
} = paramsObj;
// around after
console.warn(
"SomeAspect.aroundCallingMethodWithTag27() around after",
paramsObj,
{
argumentsList,
effectiveArgumentsList,
hasPerformedUnderlyingOperation,
hasEffectivelyPerformedUnderlyingOperation,
...rest
},
{
returnValue
}
);
// ...
}
return returnValue;
}
@aroundGet(PropTag5)
aroundGettingPropertyWithPropTag5(paramsObj) {
console.warn(
"SomeAspect.aroundGettingPropertyWithPropTag5() around before",
paramsObj
);
const value = paramsObj.proceed();
const {
hasPerformedUnderlyingOperation,
hasEffectivelyPerformedUnderlyingOperation,
...rest
} = paramsObj;
console.warn(
"SomeAspect.aroundGettingPropertyWithPropTag5() around after",
paramsObj,
{
hasPerformedUnderlyingOperation,
hasEffectivelyPerformedUnderlyingOperation,
value,
...rest
}
);
return value;
}
@aroundGet(PropTag5)
anotherAroundGettingPropertyWithPropTag5(paramsObj) {
console.warn(
"SomeAspect.anotherAroundGettingPropertyWithPropTag5() around before",
paramsObj
);
const value = paramsObj.proceed();
const {
hasPerformedUnderlyingOperation,
hasEffectivelyPerformedUnderlyingOperation,
...rest
} = paramsObj;
console.warn(
"SomeAspect.anotherAroundGettingPropertyWithPropTag5() around after",
paramsObj,
{
hasPerformedUnderlyingOperation,
hasEffectivelyPerformedUnderlyingOperation,
value,
...rest
}
);
return value;
}
@aroundGet(PropTag5)
yetAnotherAroundGettingPropertyWithPropTag5(paramsObj) {
console.warn(
"SomeAspect.yetAnotherAroundGettingPropertyWithPropTag5() around before",
paramsObj
);
const value = paramsObj.proceed();
console.log(value);
return 890;
// const {
// hasPerformedUnderlyingOperation,
// hasEffectivelyPerformedUnderlyingOperation,
// ...rest
// } = paramsObj;
// console.warn(
// "SomeAspect.yetAnotherAroundGettingPropertyWithPropTag5() around after",
// paramsObj,
// {
// hasPerformedUnderlyingOperation,
// hasEffectivelyPerformedUnderlyingOperation,
// ...rest
// }
// );
// return value;
}
@aroundGet(PropTag7)
aroundGettingPropertyWithPropTag7(paramsObj) {
console.warn(
"SomeAspect.aroundGettingPropertyWithPropTag7() around before",
paramsObj
);
const value = paramsObj.proceed();
const {
hasPerformedUnderlyingOperation,
hasEffectivelyPerformedUnderlyingOperation
} = paramsObj;
console.warn(
"SomeAspect.aroundGettingPropertyWithPropTag7() around after",
paramsObj,
{
hasPerformedUnderlyingOperation,
hasEffectivelyPerformedUnderlyingOperation,
value
}
);
return value;
}
@aroundSet(PropTag4)
aroundSettingPropertyWithPropTag4(paramsObj) {
{
const {
hasPerformedUnderlyingOperation,
hasEffectivelyPerformedUnderlyingOperation
} = paramsObj;
console.warn(
"SomeAspect.aroundSettingPropertyWithPropTag4() around before",
paramsObj,
{
hasPerformedUnderlyingOperation,
hasEffectivelyPerformedUnderlyingOperation,
previousValue: paramsObj.previousValue,
value: paramsObj.value,
effectiveValue: paramsObj.effectiveValue,
effectiveUnderlyingValue: paramsObj.effectiveUnderlyingValue
}
);
}
paramsObj.proceed(444);
{
const {
hasPerformedUnderlyingOperation,
hasEffectivelyPerformedUnderlyingOperation
} = paramsObj;
console.warn(
"SomeAspect.aroundSettingPropertyWithPropTag4() around after",
paramsObj,
{
hasPerformedUnderlyingOperation,
hasEffectivelyPerformedUnderlyingOperation,
previousValue: paramsObj.previousValue,
value: paramsObj.value,
effectiveValue: paramsObj.effectiveValue,
effectiveUnderlyingValue: paramsObj.effectiveUnderlyingValue
}
);
}
}
@aroundSet(PropTag4)
anotherAroundSettingPropertyWithPropTag4(paramsObj) {
{
const {
hasPerformedUnderlyingOperation,
hasEffectivelyPerformedUnderlyingOperation
} = paramsObj;
console.warn(
"SomeAspect.anotherAroundSettingPropertyWithPropTag4() around before",
paramsObj,
{
hasPerformedUnderlyingOperation,
hasEffectivelyPerformedUnderlyingOperation,
previousValue: paramsObj.previousValue,
value: paramsObj.value,
effectiveValue: paramsObj.effectiveValue,
effectiveUnderlyingValue: paramsObj.effectiveUnderlyingValue
}
);
}
// paramsObj.proceed(333);
paramsObj.proceed([333]); // Same as above.
{
const {
hasPerformedUnderlyingOperation,
hasEffectivelyPerformedUnderlyingOperation
} = paramsObj;
console.warn(
"SomeAspect.anotherAroundSettingPropertyWithPropTag4() around after",
paramsObj,
{
hasPerformedUnderlyingOperation,
hasEffectivelyPerformedUnderlyingOperation,
previousValue: paramsObj.previousValue,
value: paramsObj.value,
effectiveValue: paramsObj.effectiveValue,
effectiveUnderlyingValue: paramsObj.effectiveUnderlyingValue
}
);
}
}
@aroundSet(PropTag8)
aroundSettingPropertyWithPropTag8(paramsObj) {
{
const {
hasPerformedUnderlyingOperation,
hasEffectivelyPerformedUnderlyingOperation
} = paramsObj;
console.warn(
"SomeAspect.aroundSettingPropertyWithPropTag8() around before",
paramsObj,
{
hasPerformedUnderlyingOperation,
hasEffectivelyPerformedUnderlyingOperation,
// previousValue: paramsObj.previousValue,
value: paramsObj.value,
effectiveValue: paramsObj.effectiveValue,
effectiveUnderlyingValue: paramsObj.effectiveUnderlyingValue
}
);
}
paramsObj.proceed();
{
const {
hasPerformedUnderlyingOperation,
hasEffectivelyPerformedUnderlyingOperation
} = paramsObj;
console.warn(
"SomeAspect.aroundSettingPropertyWithPropTag8() around after",
paramsObj,
{
hasPerformedUnderlyingOperation,
hasEffectivelyPerformedUnderlyingOperation,
previousValue: paramsObj.previousValue,
value: paramsObj.value,
effectiveValue: paramsObj.effectiveValue
// effectiveUnderlyingValue: paramsObj.effectiveUnderlyingValue
}
);
}
}
@beforeCall(Tag28)
beforeCallingMethodWithTag28(paramsObj) {
console.warn("SomeAspect.beforeCallingMethodWithTag28()", paramsObj);
// ...
}
@beforeCall(Tag29)
beforeCallingMethodWithTag29(paramsObj) {
console.warn("SomeAspect.beforeCallingMethodWithTag29()", paramsObj);
// ...
}
@beforeGet(PropTag9)
beforeGettingPropertyWithPropTag9(paramsObj) {
console.warn("SomeAspect.beforeGettingPropertyWithPropTag9()", paramsObj);
// ...
}
@beforeGet(PropTag10)
beforeGettingPropertyWithPropTag10(paramsObj) {
console.warn("SomeAspect.beforeGettingPropertyWithPropTag10()", paramsObj);
// ...
}
@beforeGet(PropTag10)
anotherBeforeGettingPropertyWithPropTag10(paramsObj) {
console.warn(
"SomeAspect.anotherBeforeGettingPropertyWithPropTag10()",
paramsObj
);
// ...
}
@beforeGet(PropTag11)
beforeGettingPropertyWithPropTag11(paramsObj) {
console.warn("SomeAspect.beforeGettingPropertyWithPropTag11()", paramsObj);
// ...
}
// @meta(Tag1)
// metaForPropertyDescriptorWithTag1(paramsObj) {
// console.warn("SomeAspect.metaForPropertyDescriptorWithTag1()", paramsObj);
// // ...
// return {
// enumerable: true
// };
// }
@targetClass(ClassTag1)
targetClassTag1({ Class }) {
const SubClass = class extends Class {};
SubClass.prototype.prototypeProp = 123;
return SubClass;
}
@whilePending(Tag32, { interval: 300 })
whilePendingPromiseReturnedByMethodWithTag32(paramsObj) {
console.warn(
"SomeAspect.whilePendingPromiseReturnedByMethodWithTag32()",
paramsObj
);
}
@whilePending(Tag32, { interval: 1500 })
anotherWhilePendingPromiseReturnedByMethodWithTag32(paramsObj) {
console.warn(
"SomeAspect.anotherWhilePendingPromiseReturnedByMethodWithTag32()",
paramsObj
);
}
}
export default SomeAspect;
|
// @flow
import { chunk, pipe } from 'capture-core-utils';
import { getContext } from '../context';
import { queryProgramsOutline } from './queries';
import {
storePrograms,
storeOrganisationUnitsByProgram,
} from './quickStoreOperations';
import { loadRulesCentricMetadata } from './loadRulesCentricMetadata';
const getCachedProgramsOutline = () => {
const { storageController, storeNames } = getContext();
return storageController
.getAll(storeNames.PROGRAMS, {
project: program => ({
id: program.id,
version: program.version,
}),
});
};
/**
* Remove programs from the cache that wasn't retrieved from the api.
* The reason for doing this is that every program that is available to the user is retrieved from the api and
* therefore programs in the cache that wasn't retrieved are programs the user don't have access to any more.
*/
const removeUnavailablePrograms = async (apiPrograms, cachedPrograms) => {
const apiProgramsAsObject = apiPrograms
.reduce((acc, apiProgram) => {
acc[apiProgram.id] = apiProgram;
return acc;
}, {});
const unavailableProgramIds = cachedPrograms
.filter(cachedProgram => !apiProgramsAsObject[cachedProgram.id])
.map(unavailableProgram => unavailableProgram.id);
if (unavailableProgramIds.length > 0) {
const { storageController, storeNames } = getContext();
await storageController.remove(storeNames.PROGRAMS, unavailableProgramIds);
await storageController.remove(storeNames.ORGANISATION_UNITS_BY_PROGRAM, unavailableProgramIds);
}
};
/**
* Retrieve the program ids for the programs that have an updated program version
* If the program has an updated version we would like to update the program in the cache
*/
const getStaleProgramIds = (apiPrograms, cachedPrograms) => {
const cachedProgramsAsObject = cachedPrograms
.reduce((acc, cachedProgram) => {
acc[cachedProgram.id] = cachedProgram;
return acc;
}, {});
return apiPrograms
.filter((program) => {
const cachedProgram = cachedProgramsAsObject[program.id];
return !cachedProgram || cachedProgram.version !== program.version;
})
.map(program => program.id);
};
/**
* Update the cache for the program ids passed in.
* The program ids that are passed in are ids of programs that needs updating (meaning the version retrieved from the api is different from the one in the cache)
* The returned data is needed for building the side effects of trackedEntityAttributeIds, categories and trackedEntityTypeIds.
* The side effects data is used later when determining what other metadata to load.
*/
const loadProgramBatch = async (programIds) => {
await storeOrganisationUnitsByProgram(programIds);
const { convertedData: programs = [] } = await storePrograms(programIds);
await loadRulesCentricMetadata(programIds);
return programs
.map(({ programTrackedEntityAttributes, categoryCombo, trackedEntityTypeId }) => ({
programTrackedEntityAttributes,
categoryCombo,
trackedEntityTypeId,
}));
};
/**
* Self executing function to scope the side effect helper functions
* We're scoping these because they don't directly relate to the actual program loading
*/
const getSideEffects = (() => {
const getOptionSetsOutline = (() => {
const getDataElementOptionSets = programStages =>
(programStages || [])
.flatMap(programStage => (programStage.programStageDataElements || [])
.map(psda => psda.dataElement && psda.dataElement.optionSet)
.filter(optionSet => optionSet),
);
const getTrackedEntityAttributeOptionSets = programTrackedEntityAttributes =>
(programTrackedEntityAttributes || [])
.map(ptea => ptea.trackedEntityAttribute && ptea.trackedEntityAttribute.optionSet)
.filter(optionSet => optionSet);
const getProgramOptionSets = program => [
...getDataElementOptionSets(program.programStages),
...getTrackedEntityAttributeOptionSets(program.programTrackedEntityAttributes),
];
return (programsOutline): Array<Object> =>
programsOutline
.flatMap(program => getProgramOptionSets(program));
})();
const getTrackedEntityAttributeIds = stalePrograms =>
pipe(
() => stalePrograms
.flatMap(program =>
(program.programTrackedEntityAttributes || [])
.map(programAttribute => programAttribute.trackedEntityAttributeId)
.filter(TEAId => TEAId),
),
attributeIds => [...new Set(attributeIds).values()],
)();
const getCategories = stalePrograms =>
pipe(
() => stalePrograms
.flatMap(program =>
((program.categoryCombo &&
program.categoryCombo.categories) || []),
),
categories => [
...new Map(
categories.map(ic => [ic.id, ic]),
).values(),
],
)();
const getTrackedEntityTypes = stalePrograms =>
pipe(
() => stalePrograms
.reduce((acc, program) => {
program.trackedEntityTypeId && acc.add(program.trackedEntityTypeId);
return acc;
}, new Set()),
trackedEntityTypeIdSet => [...trackedEntityTypeIdSet.values()],
)();
/**
* Builds the side effects based on the programsOutline (contains some data for all programs) and the stale programs (the programs where the version has changed).
* The side effects are used later to determine what other metadata to load.
*/
return (programsOutline, stalePrograms) => ({
optionSetsOutline: getOptionSetsOutline(programsOutline),
trackedEntityAttributeIds: getTrackedEntityAttributeIds(stalePrograms),
categories: getCategories(stalePrograms),
trackedEntityTypeIds: getTrackedEntityTypes(stalePrograms),
changesDetected: stalePrograms.length > 0,
});
})();
export const loadPrograms = async () => {
const apiProgramsOutline = await queryProgramsOutline();
const cachedProgramsOutline = await getCachedProgramsOutline();
await removeUnavailablePrograms(apiProgramsOutline, cachedProgramsOutline);
const staleProgramIds = getStaleProgramIds(apiProgramsOutline, cachedProgramsOutline);
const programBatches = chunk(staleProgramIds, 50);
const programsDataForSideEffects: Array<Object> = (await Promise.all(
programBatches
.map(loadProgramBatch),
)).flat(1);
return getSideEffects(apiProgramsOutline, programsDataForSideEffects);
};
|
import EditFormRoute from 'ember-flexberry/routes/edit-form';
import EditFormRouteOperationsIndicationMixin from 'ember-flexberry/mixins/edit-form-route-operations-indication';
export default EditFormRoute.extend(EditFormRouteOperationsIndicationMixin, {
/**
Name of model projection to be used as record's properties limitation.
@property modelProjection
@type String
@default 'SuggestionFileE'
*/
modelProjection: 'SuggestionFileE',
/**
Name of model to be used as form's record type.
@property modelName
@type String
@default 'ember-flexberry-dummy-suggestion-file'
*/
modelName: 'ember-flexberry-dummy-suggestion-file',
});
|
import $ from 'jquery';
import Immutable from 'immutable';
import immutablediff from 'immutablediff';
import '../utils/jquery-utils';
let FormLoadState = {};
const DOMBehaviors = {
attach() {
this.preventUnload();
this.preventClickAway();
},
preventUnload() {
if ($._data(window, 'events') && ($._data(window, 'events').beforeunload || []).filter((event) => event.namespace === '_grav')) {
return;
}
// Catch browser uri change / refresh attempt and stop it if the form state is dirty
$(global).on('beforeunload._grav', () => {
if (Instance.equals() === false) {
return 'You have made changes on this page that you have not yet confirmed. If you navigate away from this page you will lose your unsaved changes.';
}
});
},
preventClickAway() {
let selector = 'a[href]:not([href^="#"])';
if ($._data($(selector).get(0), 'events') && ($._data($(selector).get(0), 'events').click || []).filter((event) => event.namespace === '_grav')) {
return;
}
// Prevent clicking away if the form state is dirty
// instead, display a confirmation before continuing
$(selector).on('click._grav', function(event) {
let isClean = Instance.equals();
if (isClean === null || isClean) { return true; }
event.preventDefault();
let destination = $(this).attr('href');
let modal = $('[data-remodal-id="changes"]');
let lookup = $.remodal.lookup[modal.data('remodal')];
let buttons = $('a.button', modal);
let handler = function(event) {
event.preventDefault();
let action = $(this).data('leave-action');
buttons.off('click', handler);
lookup.close();
if (action === 'continue') {
$(global).off('beforeunload');
global.location.href = destination;
}
};
buttons.on('click', handler);
lookup.open();
});
}
};
export default class FormState {
constructor(options = {
ignore: [],
form_id: 'blueprints'
}) {
this.options = options;
this.refresh();
if (!this.form || !this.fields.length) { return; }
FormLoadState = this.collect();
this.loadState = FormLoadState;
DOMBehaviors.attach();
}
refresh() {
this.form = $(`form#${this.options.form_id}`).filter(':noparents(.remodal)');
this.fields = $(`form#${this.options.form_id} *, [form="${this.options.form_id}"]`).filter(':input:not(.no-form)').filter(':noparents(.remodal)');
return this;
}
collect() {
if (!this.form || !this.fields.length) { return; }
let values = {};
this.refresh().fields.each((index, field) => {
field = $(field);
let name = field.prop('name');
let type = field.prop('type');
let tag = field.prop('tagName').toLowerCase();
let value;
switch (type) {
case 'checkbox':
value = field.is(':checked');
break;
case 'radio':
if (!field.is(':checked')) { return; }
value = field.val();
break;
default:
value = field.val();
}
if (tag === 'select' && value === null) {
value = '';
}
if (name && !~this.options.ignore.indexOf(name)) {
values[name] = value;
}
});
return Immutable.OrderedMap(values);
}
diff() {
return immutablediff(FormLoadState, this.collect());
}
// When the form doesn't exist or there are no fields, `equals` returns `null`
// for this reason, _NEVER_ check with !Instance.equals(), use Instance.equals() === false
equals() {
if (!this.form || !this.fields.length) { return null; }
return Immutable.is(FormLoadState, this.collect());
}
};
export let Instance = new FormState();
export { DOMBehaviors };
|
'use strict'
function corruptionChecksum (inputMatrix) {
let sum = 0
const rows = inputMatrix.split('\n')
rows.map(row => {
const cols = row.trim().replace(/\t/g, ' ').split(' ').map(cell => +cell)
const diff = Math.max(...cols) - Math.min(...cols)
sum += diff
})
return sum
}
function corruptionChecksumEvens (inputMatrix) {
let sum = 0
const rows = inputMatrix.split('\n')
rows.map(row => {
const cols = row.trim().replace(/\t/g, ' ').split(' ').map(cell => +cell).sort((a, b) => a - b)
for (let i = 0; i < cols.length; i++) {
for (let j = i; j < cols.length; j++) {
if (j === i) continue
if (cols[j] % cols[i] === 0) {
sum += (cols[j] / cols[i])
break
}
}
}
})
return sum
}
module.exports = {
corruptionChecksum, corruptionChecksumEvens
}
|
// Copyright (c) 2017 Intel Corporation. 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.
'use strict';
const exec = require('child_process').exec;
const cmd = 'wget -nc ';
const cpplintUrl =
'https://raw.githubusercontent.com/google/styleguide' +
'/gh-pages/cpplint/cpplint.py';
const root = `${__dirname}/../src`;
const args = `--extensions=cpp,h,hpp,cc ${root}/*`;
console.log('Downloading the cpplint...');
exec(cmd + cpplintUrl, (err, stdout, stderr) => {
if (err) {
console.log(`Downloading failed: ${stderr}`);
} else {
console.log('Running the cpplint...');
exec('python cpplint.py ' + args, (err, stdout, stderr) => {
console.log(stdout);
if (err) {
console.log(stderr);
throw Error('cpplint failed.');
}
});
}
});
|
import React, { Component } from 'react';
import { Link, Redirect } from 'react-router-dom';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import { register } from '../../actions/auth';
import { createMessage } from '../../actions/messages';
export class Register extends Component {
state = {
username: '',
email: '',
password: '',
password2: '',
};
onSubmit = e => {
e.preventDefault();
const { username, email, password, password2 } = this.state;
if (password !== password2) {
this.props.createMessage({ passwordNotMatch: 'Passwords do not match' });
} else {
const newUser = {
username,
password,
email,
};
this.props.register(newUser);
}
}
static propTypes = {
register: PropTypes.func.isRequired,
isAuthenticated: PropTypes.bool,
};
onChange = e => this.setState({ [e.target.name]: e.target.value });
render() {
const { username, email, password, password2 } = this.state;
return (
<div className="card-md-6 m-auto">
<div className="card card-body mt-5">
<h2 className="text-center">Register</h2>
<form onSubmit={this.onSubmit}>
<div className="form-group">
<label>Username</label>
<input type="text" className="form-control" name="username" onChange={this.onChange} value={username}>
</input>
</div>
<div className="form-group">
<label>Email</label>
<input type="email" className="form-control" name="email" onChange={this.onChange} value={email} />
</div>
<div className="form-group">
<label>Password</label>
<input type="password" className="form-control" name="password" onChange={this.onChange} value={password} />
</div>
<div className="form-group">
<label>Confirm Password</label>
<input type="password" className="form-control" name="password2" onChange={this.onChange} value={password2} />
</div>
<div className="form-group">
<button type="submit" className="btn btn-primary">Register</button>
</div>
<p>
Already have an account? <Link to="/login">Login</Link>
</p>
</form>
</div>
</div>
)
}
}
const mapStateToProps = (state) => ({
isAuthenticated: state.auth.isAuthenticated,
});
export default connect(mapStateToProps, { register, createMessage })(Register);
|
/**
* @license Copyright (c) 2014-2021, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
import DecoupledDocumentEditor from '@ckeditor/ckeditor5-editor-decoupled/src/decouplededitor.js';
import Alignment from '@ckeditor/ckeditor5-alignment/src/alignment.js';
import AutoImage from '@ckeditor/ckeditor5-image/src/autoimage.js';
import Autoformat from '@ckeditor/ckeditor5-autoformat/src/autoformat.js';
import Autolink from '@ckeditor/ckeditor5-link/src/autolink.js';
import Autosave from '@ckeditor/ckeditor5-autosave/src/autosave.js';
import BlockQuote from '@ckeditor/ckeditor5-block-quote/src/blockquote.js';
import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold.js';
import CKFinder from '@ckeditor/ckeditor5-ckfinder/src/ckfinder.js';
import Code from '@ckeditor/ckeditor5-basic-styles/src/code.js';
import CodeBlock from '@ckeditor/ckeditor5-code-block/src/codeblock.js';
import Essentials from '@ckeditor/ckeditor5-essentials/src/essentials.js';
import ExportToPDF from '@ckeditor/ckeditor5-export-pdf/src/exportpdf.js';
import ExportToWord from '@ckeditor/ckeditor5-export-word/src/exportword.js';
import FontBackgroundColor from '@ckeditor/ckeditor5-font/src/fontbackgroundcolor.js';
import FontColor from '@ckeditor/ckeditor5-font/src/fontcolor.js';
import FontFamily from '@ckeditor/ckeditor5-font/src/fontfamily.js';
import FontSize from '@ckeditor/ckeditor5-font/src/fontsize.js';
import Heading from '@ckeditor/ckeditor5-heading/src/heading.js';
import Highlight from '@ckeditor/ckeditor5-highlight/src/highlight.js';
import HorizontalLine from '@ckeditor/ckeditor5-horizontal-line/src/horizontalline.js';
import HtmlEmbed from '@ckeditor/ckeditor5-html-embed/src/htmlembed.js';
import Image from '@ckeditor/ckeditor5-image/src/image.js';
import ImageCaption from '@ckeditor/ckeditor5-image/src/imagecaption.js';
import ImageInsert from '@ckeditor/ckeditor5-image/src/imageinsert.js';
import ImageResize from '@ckeditor/ckeditor5-image/src/imageresize.js';
import ImageStyle from '@ckeditor/ckeditor5-image/src/imagestyle.js';
import ImageToolbar from '@ckeditor/ckeditor5-image/src/imagetoolbar.js';
import ImageUpload from '@ckeditor/ckeditor5-image/src/imageupload.js';
import Indent from '@ckeditor/ckeditor5-indent/src/indent.js';
import IndentBlock from '@ckeditor/ckeditor5-indent/src/indentblock.js';
import Italic from '@ckeditor/ckeditor5-basic-styles/src/italic.js';
import Link from '@ckeditor/ckeditor5-link/src/link.js';
import LinkImage from '@ckeditor/ckeditor5-link/src/linkimage.js';
import List from '@ckeditor/ckeditor5-list/src/list.js';
import ListStyle from '@ckeditor/ckeditor5-list/src/liststyle.js';
import Markdown from '@ckeditor/ckeditor5-markdown-gfm/src/markdown.js';
import Mention from '@ckeditor/ckeditor5-mention/src/mention.js';
import PageBreak from '@ckeditor/ckeditor5-page-break/src/pagebreak.js';
import Pagination from '@ckeditor/ckeditor5-pagination/src/pagination.js';
import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph.js';
import PasteFromOffice from '@ckeditor/ckeditor5-paste-from-office/src/pastefromoffice';
import RemoveFormat from '@ckeditor/ckeditor5-remove-format/src/removeformat.js';
import SimpleUploadAdapter from '@ckeditor/ckeditor5-upload/src/adapters/simpleuploadadapter.js';
import SpecialCharacters from '@ckeditor/ckeditor5-special-characters/src/specialcharacters.js';
import SpecialCharactersArrows from '@ckeditor/ckeditor5-special-characters/src/specialcharactersarrows.js';
import SpecialCharactersCurrency from '@ckeditor/ckeditor5-special-characters/src/specialcharacterscurrency.js';
import SpecialCharactersEssentials from '@ckeditor/ckeditor5-special-characters/src/specialcharactersessentials.js';
import SpecialCharactersLatin from '@ckeditor/ckeditor5-special-characters/src/specialcharacterslatin.js';
import SpecialCharactersMathematical from '@ckeditor/ckeditor5-special-characters/src/specialcharactersmathematical.js';
import SpecialCharactersText from '@ckeditor/ckeditor5-special-characters/src/specialcharacterstext.js';
import Strikethrough from '@ckeditor/ckeditor5-basic-styles/src/strikethrough.js';
import Subscript from '@ckeditor/ckeditor5-basic-styles/src/subscript.js';
import Superscript from '@ckeditor/ckeditor5-basic-styles/src/superscript.js';
import Table from '@ckeditor/ckeditor5-table/src/table.js';
import TableCellProperties from '@ckeditor/ckeditor5-table/src/tablecellproperties';
import TableProperties from '@ckeditor/ckeditor5-table/src/tableproperties';
import TableToolbar from '@ckeditor/ckeditor5-table/src/tabletoolbar.js';
import TextTransformation from '@ckeditor/ckeditor5-typing/src/texttransformation.js';
import TodoList from '@ckeditor/ckeditor5-list/src/todolist';
import Underline from '@ckeditor/ckeditor5-basic-styles/src/underline.js';
import WordCount from '@ckeditor/ckeditor5-word-count/src/wordcount.js';
class Editor extends DecoupledDocumentEditor {}
// Plugins to include in the build.
Editor.builtinPlugins = [
Alignment,
AutoImage,
Autoformat,
Autolink,
Autosave,
BlockQuote,
Bold,
CKFinder,
Code,
CodeBlock,
Essentials,
ExportToPDF,
ExportToWord,
FontBackgroundColor,
FontColor,
FontFamily,
FontSize,
Heading,
Highlight,
HorizontalLine,
HtmlEmbed,
Image,
ImageCaption,
ImageInsert,
ImageResize,
ImageStyle,
ImageToolbar,
ImageUpload,
Indent,
IndentBlock,
Italic,
Link,
LinkImage,
List,
ListStyle,
Markdown,
Mention,
PageBreak,
Pagination,
Paragraph,
PasteFromOffice,
RemoveFormat,
SimpleUploadAdapter,
SpecialCharacters,
SpecialCharactersArrows,
SpecialCharactersCurrency,
SpecialCharactersEssentials,
SpecialCharactersLatin,
SpecialCharactersMathematical,
SpecialCharactersText,
Strikethrough,
Subscript,
Superscript,
Table,
TableCellProperties,
TableProperties,
TableToolbar,
TextTransformation,
TodoList,
Underline,
WordCount
];
export default Editor;
|
var fs = require('fs');
var path = require('path');
function Module (id) {
// Class
this.id = id;
this.exports = {};
}
var _cached = {};
function _getAbsolutePath(pathname) {
if (path.isAbsolute(pathname)) {
return pathname;
} else if (pathname[0] === '.') {
return path.resolve(__dirname, pathname);
} else {
return path.resolve('/node_modules', pathname);
}
return '';
}
function _getRealPath(pathname) {
var extList = ['.js', '.json', '.node'];
var statObj;
try {
statObj = fs.lstatSync(pathname);
} catch (e) {}
if (statObj) {
if (statObj.isFile()) {
return pathname;
} else if (statObj.isDirectory()) {
pathname = path.join(pathname, 'index');
}
}
for (var i = 0; i < extList.length; i++) {
var fullName = pathname + extList[i];
try {
fs.lstatSync(fullName);
return fullName
} catch (e) {
// dosth
};
}
throw new Error(`${pathname} not found`);
}
function _require(path) {
var sourceCode = fs.readFileSync(path, 'utf8')
var moduleExportsFunc = new Function('module', 'exports', `${sourceCode}; return module.exports;`)
var module = new Module(path);
// Self execting
var res = moduleExportsFunc(module, module.exports)
return res
}
function $require (pathname) {
if (!pathname) {
throw new Error(`file path or name is required`);
}
var modulePath = _getAbsolutePath(pathname);
if (!modulePath) {
throw new Error(`${pathname} not found`);
}
modulePath = _getRealPath(modulePath);
if (_cached[modulePath]) {
return _cached[modulePath];
}
_cached[modulePath] = _require(modulePath);
return _cached[modulePath];
}
|
/**
* Created by reube on 27/07/2017.
*/
export const FETCH_WEATHER = 'FETCH_WEATHER';
|
var React = require('react');
var PropTypes = require('prop-types');
import _ from 'lodash';
var ProgressBar = require('react-progressbar.js')
var Circle = ProgressBar.Circle;
const calcPercentage = (item) => {
// If the votes against are 0/falsey, it's 100% in favour.
var overallPercent = (item.votesAgainst) ? ((item.votesFor) / (item.votesFor + item.votesAgainst)) : 1;
// ...except if there's also 0 votes in favour.
if ((!item.votesFor && !item.votesAgainst) || (!item.votesFor)) {
overallPercent = 0;
}
return overallPercent;
}
const calcAllMatchups = (item) => {
if (!item.pairsFor && item.pairsAgainst) return Object.keys(item.pairsAgainst).length;
else if (item.pairsFor && !item.pairsAgainst) return Object.keys(item.pairsFor).length;
else if (!item.pairsFor && !item.pairsAgainst) return 0;
else {
var For = Object.keys(item.pairsFor);
var Against = Object.keys(item.pairsAgainst);
// now count union number of keys
return _.union(For, Against).length;
}
}
const calcWinningMatchups = (item) => {
if (!item.pairsFor) return 0;
else if (item.pairsFor && !item.pairsAgainst) return Object.keys(item.pairsFor).length;
else {
var For = Object.keys(item.pairsFor);
var Against = Object.keys(item.pairsAgainst);
// for matchups this is winning, count pairsFor that don't exist in pairsAgainst,
// and ones that exist in both but are higher in pairsFor.
var totalFor = 0;
_.forEach(For, (key) => {
if (!item.pairsAgainst[key]) totalFor++;
else if (item.pairsFor[key] > item.pairsAgainst[key]) totalFor++;
})
return totalFor;
}
}
const ItemGrid = (props) => {
var sortedItems = _.orderBy(props.items, (item) => {
return calcPercentage(item);
}, ['desc']); // TODO; multiple sorting options.
// take only first 100 items from sorted list.
sortedItems = _.take(sortedItems, 100);
return (
<ul className='popular-list'>
{sortedItems.map(function (item, index) {
return (
<li key={item.name} className='popular-item'>
<div className='popular-rank'>#{index + 1}</div>
<ul className='space-list-items'>
<li><b>{item.name}</b></li>
<li>{"Winning in " + calcWinningMatchups(item) +
" of " + calcAllMatchups(item) + " matchups so far"}</li>
<li>{(calcPercentage(item) * 100).toFixed(1)}% success rate</li>
<li><Circle progress={calcPercentage(item)}
initialAnimate={true}
text={(calcPercentage(item) * 100).toFixed(1) + "%"}
options={{strokeWidth: 7, trailColor: '#e32020', trailWidth: 2, easing: 'easeInOut',
from: {color: '#e32020'}, to: {color: '#2269ab'}, step: (state, circle) => {
circle.path.setAttribute('stroke', state.color);
}}}
containerStyle={{height: "55px", width: "55px", display: "inline-block"}}/></li>
</ul>
</li>
)
})}
</ul>
)
}
ItemGrid.propTypes = {
items: PropTypes.array.isRequired,
}
class Browse extends React.Component {
render() {
return (
<div>
{!this.props.items
? <p>LOADING!</p>
: <ItemGrid items={this.props.items} />}
</div>
)
}
}
Browse.propTypes = {
items: PropTypes.array
}
module.exports = Browse;
|
/*
* gameish
* (c) 2020 dragonwocky <thedragonring.bod@gmail.com> (https://dragonwocky.me/)
* (c) 2020 u/LVL100ShrekCultist
* under the MIT license
*/
'use strict';
module.exports = {
id: 'ad923617-e76e-408e-9f23-490738a3223f',
tags: ['theme', 'dark'],
name: 'gameish',
desc: 'a purple, "gamer-styled" theme with a blocky-font.',
version: '0.1.4',
author: {
name: 'LVL100ShrekCultist',
link: 'https://www.reddit.com/user/LVL100ShrekCultist/',
avatar:
'https://styles.redditmedia.com/t5_2js69j/styles/profileIcon_jvnzmo30fyq41.jpg',
},
fonts: [
'https://fonts.googleapis.com/css2?family=Baumans&family=Comfortaa&family=DM+Mono&family=Gruppo&family=Nova+Mono&family=Offside&family=Press+Start+2P&family=Righteous&display=swap',
],
};
|
'use script'
const assert = require('assert')
const Request = require('reserve/mock/Request')
const Response = require('reserve/mock/Response')
const cors = require('../../src/cors')
const origin = 'npmjs.com'
describe('src/cors', () => {
it('handles CORS attributes', async () => {
const request = new Request('GET', '/', { origin })
const response = new Response()
cors.custom(request, response)
assert.strictEqual(response.statusCode, undefined)
assert.strictEqual(response.headers['Access-Control-Allow-Origin'], origin)
assert.strictEqual(response.headers['Access-Control-Allow-Credentials'], 'true')
})
it('handles CORS preflight', async () => {
const request = new Request('OPTIONS', '/', { origin })
const response = new Response()
cors.custom(request, response)
assert.strictEqual(response.statusCode, 200)
assert.strictEqual(response.headers['Access-Control-Allow-Origin'], origin)
assert.strictEqual(response.headers['Access-Control-Allow-Headers'], 'content-type, content-length')
assert.strictEqual(response.headers['Access-Control-Allow-Methods'], 'GET, POST, PUT, DELETE, OPTIONS')
assert.strictEqual(response.headers['Access-Control-Allow-Credentials'], 'true')
})
})
|
module.exports = require('marko-widgets').defineComponent({
template: require.resolve('./template.marko'),
getInitialState: function(input) {
return {
buttonSize: input.buttonSize || 'normal'
};
},
getTemplateData: function(state, input) {
return {
buttonSize: state.buttonSize
};
},
setButtonSize: function(size) {
this.setState('buttonSize', size);
}
});
|
import Head from "next/head";
const ProfileDetails = () => {
return (
<>
<Head>
<title>User profile</title>
</Head>
<main>
</main>
</>
);
};
export default ProfileDetails;
|
(function () {
'use strict';
// Route Configuration
angular.module('app')
.config(function ($stateProvider, $urlRouterProvider) {
$stateProvider
.state('home', {
url: '/home',
templateUrl: 'home/home.html',
controller: 'HomeController as vm'
})
.state('tab.more', {
url: '/more',
templateUrl: 'more/more.html',
controller: 'MoreController as vm'
});
$urlRouterProvider.otherwise(function ($injector) {
var $state = $injector.get('$state');
$state.go('home');
});
});
})();
|
import React, { useState, useEffect } from 'react';
import MainPageLayout from '../components/MainPageLayout';
import { useShows } from '../misc/custom-hooks';
import { apiGet } from '../misc/config';
import ShowGrid from '../components/show/ShowGrid';
const Starred = () => {
const [starred] = useShows();
const [shows, setShows] = useState(null);
const [isLoading, setIsLoading] = useState(true);
const [error, setError] = useState(null);
useEffect(() => {
if (starred && starred.length > 0) {
const promises = starred.map(showId => apiGet(`/shows/${showId}`));
Promise.all(promises)
.then(apiData => apiData.map(show => ({ show })))
.then(results => {
setShows(results);
setIsLoading(false);
})
.catch(err => {
setError(err.message);
setIsLoading(false);
});
} else {
setIsLoading(false);
}
}, [starred]);
return (
<MainPageLayout>
{isLoading && <div>Shows are still loading</div>}
{error && <div>Error occured: {error}</div>}
{!isLoading && !shows && <div>No shows were added</div>}
{!isLoading && !error && shows && <ShowGrid data={shows} />}
</MainPageLayout>
);
};
export default Starred;
|
/**
* @license
* Copyright The Closure Library Authors.
* SPDX-License-Identifier: Apache-2.0
*/
goog.module('goog.dateTest');
goog.setTestOnly();
const DateDate = goog.require('goog.date.Date');
const DateTime = goog.require('goog.date.DateTime');
const Interval = goog.require('goog.date.Interval');
const googRequiredGoogDate = goog.require('goog.date');
const month = goog.require('goog.date.month');
const testSuite = goog.require('goog.testing.testSuite');
const weekDay = goog.require('goog.date.weekDay');
testSuite({
/** Unit test for Closure's 'googRequiredGoogDate'. */
testIsLeapYear() {
const f = googRequiredGoogDate.isLeapYear;
assertFalse('Year 1900 was not a leap year (the 100 rule)', f(1900));
assertFalse('Year 1901 was not a leap year (the 100 rule)', f(1901));
assertTrue('Year 1904 was a leap year', f(1904));
assertFalse('Year 1999 was not a leap year', f(1999));
assertTrue('Year 2000 was a leap year (the 400 rule)', f(2000));
assertTrue('Year 2004 was a leap year', f(2004));
assertFalse('Year 2006 was not a leap year', f(2006));
},
testIsLongIsoYear() {
const f = googRequiredGoogDate.isLongIsoYear;
// see http://en.wikipedia.org/wiki/ISO_week_date#The_leap_year_cycle
assertFalse('1902 was not an ISO leap year', f(1902));
assertTrue('1903 was an ISO leap year', f(1903));
assertFalse('1904 was not an ISO leap year', f(1904));
assertTrue('1981 was an ISO leap year', f(1981));
assertTrue('1987 was an ISO leap year', f(1987));
assertFalse('2000 was not an ISO leap year', f(2000));
},
/** @suppress {checkTypes} suppression added to enable type checking */
testGetNumberOfDaysInMonth() {
const f = googRequiredGoogDate.getNumberOfDaysInMonth;
assertEquals('January has 31 days', f(2006, month.JAN, 2000), 31);
assertEquals('February has 28 days', f(2006, month.FEB), 28);
assertEquals('February has 29 days (leap year)', f(2008, month.FEB), 29);
assertEquals('March has 31 days', f(2006, month.MAR), 31);
assertEquals('April has 30 days', f(2006, month.APR), 30);
assertEquals('May has 31 days', f(2006, month.MAY), 31);
assertEquals('June has 30 days', f(2006, month.JUN), 30);
assertEquals('July has 31 days', f(2006, month.JUL), 31);
assertEquals('August has 31 days', f(2006, month.AUG), 31);
assertEquals('September has 30 days', f(2006, month.SEP), 30);
assertEquals('October has 31 days', f(2006, month.OCT), 31);
assertEquals('November has 30 days', f(2006, month.NOV), 30);
assertEquals('December has 31 days', f(2006, month.DEC), 31);
},
testIsSameDay() {
assertTrue(
'Dates are on the same day',
googRequiredGoogDate.isSameDay(
new Date('2009/02/01 12:45:12'), new Date('2009/02/01 01:15:49')));
assertFalse(
'Days are different',
googRequiredGoogDate.isSameDay(
new Date('2009/02/01 12:45:12'), new Date('2009/02/02 01:15:49')));
assertFalse(
'Months are different',
googRequiredGoogDate.isSameDay(
new Date('2009/02/01 12:45:12'), new Date('2009/03/01 01:15:49')));
assertFalse(
'Years are different',
googRequiredGoogDate.isSameDay(
new Date('2009/02/01 12:45:12'), new Date('2010/02/01 01:15:49')));
assertFalse(
'Wrong millennium',
googRequiredGoogDate.isSameDay(
new Date('2009/02/01 12:45:12'), new Date('1009/02/01 01:15:49')));
},
testIsSameMonth() {
assertTrue(
'Dates are on the same day',
googRequiredGoogDate.isSameMonth(
new Date('2009/02/01 12:45:12'), new Date('2009/02/01 01:15:49')));
assertTrue(
'Dates are in the same month',
googRequiredGoogDate.isSameMonth(
new Date('2009/02/01 12:45:12'), new Date('2009/02/10 01:15:49')));
assertFalse(
'Month is different',
googRequiredGoogDate.isSameMonth(
new Date('2009/02/01 12:45:12'), new Date('2009/03/01 01:15:49')));
assertFalse(
'Year is different',
googRequiredGoogDate.isSameMonth(
new Date('2008/02/01 12:45:12'), new Date('2009/02/01 01:15:49')));
assertFalse(
'Wrong millennium',
googRequiredGoogDate.isSameMonth(
new Date('2009/02/01 12:45:12'), new Date('1009/02/01 01:15:49')));
},
testIsSameYear() {
assertTrue(
'Dates are on the same day',
googRequiredGoogDate.isSameYear(
new Date('2009/02/01 12:45:12'), new Date('2009/02/01 01:15:49')));
assertTrue(
'Only days are different',
googRequiredGoogDate.isSameYear(
new Date('2009/02/01 12:45:12'), new Date('2009/02/11 01:15:49')));
assertTrue(
'Only months are different',
googRequiredGoogDate.isSameYear(
new Date('2009/02/01 12:45:12'), new Date('2009/02/01 01:15:49')));
assertFalse(
'Years are different',
googRequiredGoogDate.isSameYear(
new Date('2009/02/01 12:45:12'), new Date('2010/02/01 01:15:49')));
assertFalse(
'Years are different',
googRequiredGoogDate.isSameYear(
new Date('2009/02/01 12:45:12'), new Date('2008/02/01 01:15:49')));
},
testGetWeekNumber() {
const f = googRequiredGoogDate.getWeekNumber;
// Test cases from http://en.wikipedia.org/wiki/ISO_week_date#Examples
assertEquals(
'2005-01-01 is the week 53 of the previous year', 53,
f(2005, month.JAN, 1));
assertEquals(
'2005-01-02 is the week 53 of the previous year', 53,
f(2005, month.JAN, 2));
assertEquals('2005-12-31 is the week 52', 52, f(2005, month.DEC, 31));
assertEquals('2007-01-01 is the week 1', 1, f(2007, month.JAN, 1));
assertEquals('2007-12-30 is the week 52', 52, f(2007, month.DEC, 30));
assertEquals(
'2007-12-31 is the week 1 of the following year', 1,
f(2007, month.DEC, 31));
assertEquals('2008-01-01 is the week 1', 1, f(2008, month.JAN, 1));
assertEquals('2008-12-28 is the week 52', 52, f(2008, month.DEC, 28));
assertEquals(
'2008-12-29 is the week 1 of the following year', 1,
f(2008, month.DEC, 29));
assertEquals(
'2008-12-31 is the week 1 of the following year', 1,
f(2008, month.DEC, 31));
assertEquals('2009-01-01 is the week 1', 1, f(2009, month.JAN, 1));
assertEquals(
'2009-12-31 is the week 53 of the previous year', 53,
f(2009, month.DEC, 31));
assertEquals(
'2010-01-01 is the week 53 of the previous year', 53,
f(2010, month.JAN, 1));
assertEquals(
'2010-01-03 is the week 53 of the previous year', 53,
f(2010, month.JAN, 3));
assertEquals('2010-01-04 is the week 1', 1, f(2010, month.JAN, 4));
assertEquals(
'2006-01-01 is in week 52 of the following year', 52,
f(2006, month.JAN, 1));
assertEquals('2006-01-02 is in week 1', 1, f(2006, month.JAN, 2));
assertEquals('2006-10-16 is in week 42', 42, f(2006, month.OCT, 16));
assertEquals('2006-10-19 is in week 42', 42, f(2006, month.OCT, 19));
assertEquals('2006-10-22 is in week 42', 42, f(2006, month.OCT, 22));
assertEquals('2006-10-23 is in week 43', 43, f(2006, month.OCT, 23));
assertEquals(
'2008-12-29 is in week 1 of the following year', 1,
f(2008, month.DEC, 29));
assertEquals(
'2010-01-03 is in week 53 of the previous year', 53,
f(2010, month.JAN, 3));
assertEquals('2008-02-01 is in week 5', 5, f(2008, month.FEB, 1));
assertEquals('2008-02-04 is in week 6', 6, f(2008, month.FEB, 4));
// Tests for different cutoff days.
assertEquals(
'2006-01-01 is in week 52 of the prev. year (cutoff=Monday)', 52,
f(2006, month.JAN, 1, weekDay.MON));
assertEquals(
'2006-01-01 is in week 1 (cutoff=Sunday)', 1,
f(2006, month.JAN, 1, weekDay.SUN));
assertEquals(
'2006-12-31 is in week 52 (cutoff=Monday)', 52,
f(2006, month.DEC, 31, weekDay.MON));
assertEquals(
'2006-12-31 is in week 53 (cutoff=Sunday)', 53,
f(2006, month.DEC, 31, weekDay.SUN));
assertEquals(
'2007-01-01 is in week 1 (cutoff=Monday)', 1,
f(2007, month.JAN, 1, weekDay.MON));
assertEquals(
'2007-01-01 is in week 1 (cutoff=Sunday)', 1,
f(2007, month.JAN, 1, weekDay.SUN));
assertEquals(
'2015-01-01 is in week 52 of the previous year (cutoff=Monday)', 52,
f(2015, month.JAN, 1, weekDay.MON));
// Tests for leap year 2000.
assertEquals('2000-02-27 is in week 8', 8, f(2000, month.FEB, 27));
assertEquals('2000-02-28 is in week 9', 9, f(2000, month.FEB, 28));
assertEquals('2000-02-29 is in week 9', 9, f(2000, month.FEB, 29));
assertEquals('2000-03-01 is in week 9', 9, f(2000, month.MAR, 1));
assertEquals('2000-03-05 is in week 9', 9, f(2000, month.MAR, 5));
assertEquals('2000-03-06 is in week 10', 10, f(2000, month.MAR, 6));
// Check that week number is strictly incremented by 1.
const dt = new DateDate(2008, month.JAN, 1);
for (let i = 0; i < 52; ++i) {
const expected_week = i + 1;
assertEquals(
dt.toUTCIsoString(true) + ' is in week ' + expected_week,
expected_week, dt.getWeekNumber());
dt.add(new Interval(Interval.DAYS, 7));
}
},
testGetYearOfWeek() {
const f = googRequiredGoogDate.getYearOfWeek;
// Test cases from http://en.wikipedia.org/wiki/ISO_week_date#Examples
assertEquals(
'2005-01-01 is the week 53 of the previous year', 2004,
f(2005, month.JAN, 1));
assertEquals(
'2005-01-02 is the week 53 of the previous year', 2004,
f(2005, month.JAN, 2));
assertEquals(
'2005-12-31 is the week 52 of current year', 2005,
f(2005, month.DEC, 31));
assertEquals(
'2007-01-01 is the week 1 of 2007', 2007, f(2007, month.JAN, 1));
assertEquals(
'2007-12-30 is the week 52 of 2007', 2007, f(2007, month.DEC, 30));
assertEquals(
'2007-12-31 is the week 1 of the following year', 2008,
f(2007, month.DEC, 31));
assertEquals(
'2008-01-01 is the week 1 of 2008', 2008, f(2008, month.JAN, 1));
assertEquals(
'2008-12-28 is the week 52 of 2008', 2008, f(2008, month.DEC, 28));
assertEquals(
'2008-12-29 is the week 1 of the following year', 2009,
f(2008, month.DEC, 29));
assertEquals(
'2008-12-31 is the week 1 of the following year', 2009,
f(2008, month.DEC, 31));
assertEquals(
'2009-01-01 is the week 1 of 2009', 2009, f(2009, month.JAN, 1));
assertEquals(
'2009-12-31 is the week 53 of the previous year', 2009,
f(2009, month.DEC, 31));
assertEquals(
'2010-01-01 is the week 53 of the previous year', 2009,
f(2010, month.JAN, 1));
assertEquals(
'2010-01-03 is the week 53 of the previous year', 2009,
f(2010, month.JAN, 3));
assertEquals(
'2010-01-04 is the week 1 of 2010', 2010, f(2010, month.JAN, 4));
assertEquals(
'2006-01-01 is in week 52 of the perv. year', 2005,
f(2006, month.JAN, 1));
assertEquals(
'2006-01-02 is in week 1 of 2006', 2006, f(2006, month.JAN, 2));
// Tests for different cutoff days.
assertEquals(
'2006-01-01 is in week 52 of the prev. year (cutoff=Monday)', 2005,
f(2006, month.JAN, 1, weekDay.MON));
assertEquals(
'2006-01-01 is in week 1 (cutoff=Sunday)', 2006,
f(2006, month.JAN, 1, weekDay.SUN));
assertEquals(
'2006-12-31 is in 2006 year of week (cutoff=Monday)', 2006,
f(2006, month.DEC, 31, weekDay.MON));
assertEquals(
'2006-12-31 is in 2006 year of week (cutoff=Sunday)', 2006,
f(2006, month.DEC, 31, weekDay.SUN));
assertEquals(
'2007-01-01 is in 2007 year of week (cutoff=Monday)', 2007,
f(2007, month.JAN, 1, weekDay.MON));
assertEquals(
'2007-01-01 is in 2007 year of week (cutoff=Sunday)', 2007,
f(2007, month.JAN, 1, weekDay.SUN));
assertEquals(
'2015-01-01 is in the previous year of week (cutoff=Monday)', 2014,
f(2015, month.JAN, 1, weekDay.MON));
},
testIsDateLikeWithGoogDate() {
const jsDate = new Date();
const googDate = new DateDate();
const string = 'foo';
const number = 1;
const nullVar = null;
let notDefined;
assertTrue('js Date should be date-like', goog.isDateLike(jsDate));
assertTrue('goog Date should be date-like', goog.isDateLike(googDate));
assertFalse('string should not be date-like', goog.isDateLike(string));
assertFalse('number should not be date-like', goog.isDateLike(number));
assertFalse('nullVar should not be date-like', goog.isDateLike(nullVar));
assertFalse(
'undefined should not be date-like', goog.isDateLike(notDefined));
},
testDateConstructor() {
let date = new DateDate(2001, 2, 3);
assertEquals(2001, date.getFullYear());
assertEquals(2, date.getMonth());
assertEquals(3, date.getDate());
date = new DateDate(2001);
assertEquals(2001, date.getFullYear());
assertEquals(0, date.getMonth());
assertEquals(1, date.getDate());
date = new DateDate(new Date(2001, 2, 3, 4, 5, 6, 7));
assertEquals(2001, date.getFullYear());
assertEquals(2, date.getMonth());
assertEquals(3, date.getDate());
assertEquals(new Date(2001, 2, 3).getTime(), date.getTime());
goog.now = () => new Date(2001, 2, 3, 4).getTime();
date = new DateDate();
assertEquals(2001, date.getFullYear());
assertEquals(2, date.getMonth());
assertEquals(3, date.getDate());
assertEquals(new Date(2001, 2, 3).getTime(), date.getTime());
},
testDateConstructor_yearBelow100() {
const date = new DateDate(14, 7, 19);
assertEquals(
'Date constructor should respect passed in full year', 14,
date.getFullYear());
const copied = new DateDate(date);
assertEquals(
'Copying a should return identical date', date.getTime(),
copied.getTime());
assertEquals(
'Full year should be left intact by copying', 14, copied.getFullYear());
// Test boundaries.
assertEquals(-1, new DateDate(-1, 0, 1).getFullYear());
assertEquals(
'There is no year zero, but JS dates accept it', 0,
new DateDate(0, 0, 1).getFullYear());
assertEquals(1, new DateDate(1, 0, 1).getFullYear());
assertEquals(99, new DateDate(99, 0, 1).getFullYear());
assertEquals(100, new DateDate(100, 0, 1).getFullYear());
},
testDateConstructor_flipOver() {
let date = new DateDate(2012, 12, 1);
assertEquals('20130101', date.toIsoString());
date = new DateDate(12, 12, 1);
assertEquals('130101', date.toIsoString());
},
testDateToIsoString() {
let d = new DateDate(2006, month.JAN, 1);
assertEquals('1 Jan 2006 is 20060101', d.toIsoString(), '20060101');
d = new DateDate(2007, month.JUN, 12);
assertEquals('12 Jun 2007 is 20070612', d.toIsoString(), '20070612');
d = new DateDate(2218, month.DEC, 31);
assertEquals('31 Dec 2218 is 22181231', d.toIsoString(), '22181231');
},
testDateTimeFromTimestamp() {
assertEquals(0, DateTime.fromTimestamp(0).getTime());
assertEquals(1234, DateTime.fromTimestamp(1234).getTime());
},
testRfc822StringToDate() {
let date = DateTime.fromRfc822String('October 2, 2002 8:00:00');
assertNotNull(date);
assertEquals(2002, date.getFullYear());
assertEquals(9, date.getMonth());
assertEquals(2, date.getDate());
assertEquals(8, date.getHours());
assertEquals(0, date.getMinutes());
assertEquals(0, date.getSeconds());
assertEquals(0, date.getMilliseconds());
assertEquals(new Date(2002, 9, 2, 8).getTime(), date.getTime());
date = DateTime.fromRfc822String('Sat, 02 Oct 2010 08:00:00 UTC');
assertEquals(2010, date.getFullYear());
assertEquals(9, date.getUTCMonth());
assertEquals(2, date.getUTCDate());
assertEquals(8, date.getUTCHours());
assertEquals(0, date.getUTCMinutes());
assertEquals(0, date.getUTCSeconds());
assertEquals(0, date.getUTCMilliseconds());
date = DateTime.fromRfc822String('');
assertEquals(null, date);
date = DateTime.fromRfc822String('Invalid Date String');
assertEquals(null, date);
date = DateTime.fromRfc822String('Sat, 02 Oct 2010');
assertEquals(2010, date.getFullYear());
assertEquals(9, date.getMonth());
assertEquals(2, date.getDate());
assertEquals(0, date.getHours());
assertEquals(0, date.getMinutes());
assertEquals(0, date.getSeconds());
assertEquals(0, date.getMilliseconds());
assertEquals(new Date(2010, 9, 2).getTime(), date.getTime());
},
testIsoStringToDate() {
let iso = '20060210T000000Z';
let date = DateTime.fromIsoString(iso);
assertEquals(`Got 2006 from ${iso}`, 2006, date.getFullYear());
assertEquals(`Got February from ${iso}`, 1, date.getMonth());
// use getUTCDate() here, since in 'iso' var we specified timezone
// as being a zero offset from GMT
assertEquals(`Got 10th from ${iso}`, 10, date.getUTCDate());
// YYYY-MM-DD
iso = '2005-02-22';
date = DateTime.fromIsoString(iso);
assertEquals(`Got 2005 from ${iso}`, 2005, date.getFullYear());
assertEquals(`Got February from ${iso}`, 1, date.getMonth());
assertEquals(`Got 22nd from ${iso}`, 22, date.getDate());
// YYYYMMDD
iso = '20050222';
date = DateTime.fromIsoString(iso);
assertEquals(`Got 2005 from ${iso}`, 2005, date.getFullYear());
assertEquals(`Got February from ${iso}`, 1, date.getMonth());
assertEquals(`Got 22nd from ${iso}`, 22, date.getDate());
// YYYY-MM
iso = '2005-08';
date = DateTime.fromIsoString(iso);
assertEquals(`Got 2005 from ${iso}`, 2005, date.getFullYear());
assertEquals(`Got August from ${iso}`, 7, date.getMonth());
// YYYYMM
iso = '200502';
date = DateTime.fromIsoString(iso);
assertEquals(`Got 2005 from ${iso}`, 2005, date.getFullYear());
assertEquals(`Got February from ${iso}`, 1, date.getMonth());
// YYYY
iso = '2005';
date = DateTime.fromIsoString(iso);
assertEquals(`Got 2005 from ${iso}`, 2005, date.getFullYear());
// 1997-W01 or 1997W01
iso = '2005-W22';
date = DateTime.fromIsoString(iso);
assertEquals(`Got 2005 from ${iso}`, 2005, date.getFullYear());
assertEquals(`Got May from ${iso}`, 4, date.getMonth());
assertEquals(`Got 30th from ${iso}`, 30, date.getDate());
iso = '2005W22';
date = DateTime.fromIsoString(iso);
assertEquals(`Got 2005 from ${iso}`, 2005, date.getFullYear());
assertEquals(`Got May from ${iso}`, 4, date.getMonth());
assertEquals(`Got 30th from ${iso}`, 30, date.getDate());
// 1997-W01-2 or 1997W012
iso = '2005-W22-4';
date = DateTime.fromIsoString(iso);
assertEquals(`Got 2005 from ${iso}`, 2005, date.getFullYear());
assertEquals(`Got June from ${iso}`, 5, date.getMonth());
assertEquals(`Got 2nd from ${iso}`, 2, date.getDate());
iso = '2005W224';
date = DateTime.fromIsoString(iso);
assertEquals(`Got 2005 from ${iso}`, 2005, date.getFullYear());
assertEquals(`Got June from ${iso}`, 5, date.getMonth());
assertEquals(`Got 2nd from ${iso}`, 2, date.getDate());
iso = '2004-W53-6';
date = DateTime.fromIsoString(iso);
assertEquals(`Got 2005 from ${iso}`, 2005, date.getFullYear());
assertEquals(`Got January from ${iso}`, 0, date.getMonth());
assertEquals(`Got 1st from ${iso}`, 1, date.getDate());
iso = '2004-W53-7';
date = DateTime.fromIsoString(iso);
assertEquals(`Got 2005 from ${iso}`, 2005, date.getFullYear());
assertEquals(`Got January from ${iso}`, 0, date.getMonth());
assertEquals(`Got 2nd from ${iso}`, 2, date.getDate());
iso = '2005-W52-6';
date = DateTime.fromIsoString(iso);
assertEquals(`Got 2005 from ${iso}`, 2005, date.getFullYear());
assertEquals(`Got December from ${iso}`, 11, date.getMonth());
assertEquals(`Got 31st from ${iso}`, 31, date.getDate());
// both years 2007 start with the same day
iso = '2007-W01-1';
date = DateTime.fromIsoString(iso);
assertEquals(`Got 2007 from ${iso}`, 2007, date.getFullYear());
assertEquals(`Got January from ${iso}`, 0, date.getMonth());
assertEquals(`Got 1st from ${iso}`, 1, date.getDate());
iso = '2007-W52-7';
date = DateTime.fromIsoString(iso);
assertEquals(`Got 2007 from ${iso}`, 2007, date.getFullYear());
assertEquals(`Got December from ${iso}`, 11, date.getMonth());
assertEquals(`Got 30th from ${iso}`, 30, date.getDate());
iso = '2008-W01-1';
date = DateTime.fromIsoString(iso);
assertEquals(`Got 2007 from ${iso}`, 2007, date.getFullYear());
assertEquals(`Got December from ${iso}`, 11, date.getMonth());
assertEquals(`Got 31st from ${iso}`, 31, date.getDate());
// Gregorian year 2008 is a leap year,
// ISO year 2008 is 2 days shorter:
// 1 day longer at the start, 3 days shorter at the end
iso = '2008-W01-2';
date = DateTime.fromIsoString(iso);
assertEquals(`Got 2008 from ${iso}`, 2008, date.getFullYear());
assertEquals(`Got Jan from ${iso}`, 0, date.getMonth());
assertEquals(`Got 1st from ${iso}`, 1, date.getDate());
// ISO year is three days into the previous gregorian year
iso = '2009-W01-1';
date = DateTime.fromIsoString(iso);
assertEquals(`Got 2008 from ${iso}`, 2008, date.getFullYear());
assertEquals(`Got December from ${iso}`, 11, date.getMonth());
assertEquals(`Got 29th from ${iso}`, 29, date.getDate());
iso = '2009-W01-3';
date = DateTime.fromIsoString(iso);
assertEquals(`Got 2008 from ${iso}`, 2008, date.getFullYear());
assertEquals(`Got December from ${iso}`, 11, date.getMonth());
assertEquals(`Got 31st from ${iso}`, 31, date.getDate());
iso = '2009-W01-4';
date = DateTime.fromIsoString(iso);
assertEquals(`Got 2009 from ${iso}`, 2009, date.getFullYear());
assertEquals(`Got January from ${iso}`, 0, date.getMonth());
assertEquals(`Got 1st from ${iso}`, 1, date.getDate());
// ISO year is three days into the next gregorian year
iso = '2009-W53-4';
date = DateTime.fromIsoString(iso);
assertEquals(`Got 2009 from ${iso}`, 2009, date.getFullYear());
assertEquals(`Got December from ${iso}`, 11, date.getMonth());
assertEquals(`Got 31st from ${iso}`, 31, date.getDate());
iso = '2009-W53-5';
date = DateTime.fromIsoString(iso);
assertEquals(`Got 2010 from ${iso}`, 2010, date.getFullYear());
assertEquals(`Got January from ${iso}`, 0, date.getMonth());
assertEquals(`Got 1st from ${iso}`, 1, date.getDate());
iso = '2009-W53-6';
date = DateTime.fromIsoString(iso);
assertEquals(`Got 2010 from ${iso}`, 2010, date.getFullYear());
assertEquals(`Got January from ${iso}`, 0, date.getMonth());
assertEquals(`Got 2nd from ${iso}`, 2, date.getDate());
iso = '2009-W53-7';
date = DateTime.fromIsoString(iso);
assertEquals(`Got 2010 from ${iso}`, 2010, date.getFullYear());
assertEquals(`Got January from ${iso}`, 0, date.getMonth());
assertEquals(`Got 3rd from ${iso}`, 3, date.getDate());
iso = '2010-W01-1';
date = DateTime.fromIsoString(iso);
assertEquals(`Got 2010 from ${iso}`, 2010, date.getFullYear());
assertEquals(`Got January from ${iso}`, 0, date.getMonth());
assertEquals(`Got 4th from ${iso}`, 4, date.getDate());
// Examples where the ISO year is three days into the previous gregorian
// year
// 1995-035 or 1995035
iso = '2005-146';
date = DateTime.fromIsoString(iso);
assertEquals(`Got 2005 from ${iso}`, 2005, date.getFullYear());
assertEquals(`Got May from ${iso}`, 4, date.getMonth());
assertEquals(`Got 26th from ${iso}`, 26, date.getDate());
iso = '2005146';
date = DateTime.fromIsoString(iso);
assertEquals(`Got 2005 from ${iso}`, 2005, date.getFullYear());
assertEquals(`Got May from ${iso}`, 4, date.getMonth());
assertEquals(`Got 26th from ${iso}`, 26, date.getDate());
},
testDate_fromIsoString() {
// YYYY-MM-DD
let iso = '2005-02-22';
let date = DateDate.fromIsoString(iso);
assertEquals(`Got 2005 from ${iso}`, 2005, date.getFullYear());
assertEquals(`Got February from ${iso}`, 1, date.getMonth());
assertEquals(`Got 22nd from ${iso}`, 22, date.getDate());
// YYYY-MM-DDTHH:MM:SS
iso = '2005-02-22T11:22:33';
date = DateDate.fromIsoString(iso);
assertNull(`Got null from ${iso}`, date);
},
testDateTime_fromIsoString() {
// YYYY-MM-DD
let iso = '2005-02-22';
let date = DateTime.fromIsoString(iso);
assertEquals(`Got 2005 from ${iso}`, 2005, date.getFullYear());
assertEquals(`Got February from ${iso}`, 1, date.getMonth());
assertEquals(`Got 22nd from ${iso}`, 22, date.getDate());
assertEquals(`Got 0 hours from ${iso}`, 0, date.getHours());
assertEquals(`Got 0 minutes from ${iso}`, 0, date.getMinutes());
assertEquals(`Got 0 seconds from ${iso}`, 0, date.getSeconds());
// YYYY-MM-DDTHH:MM:SS
iso = '2005-02-22T11:22:33';
date = DateTime.fromIsoString(iso);
assertEquals(`Got 2005 from ${iso}`, 2005, date.getFullYear());
assertEquals(`Got February from ${iso}`, 1, date.getMonth());
assertEquals(`Got 22nd from ${iso}`, 22, date.getDate());
assertEquals(`Got 11 hours from ${iso}`, 11, date.getHours());
assertEquals(`Got 22 minutes from ${iso}`, 22, date.getMinutes());
assertEquals(`Got 33 seconds from ${iso}`, 33, date.getSeconds());
// YYYY-MM-DDTHH:MM:SS+03:00
iso = '2005-02-22T11:22:33+03:00';
date = DateTime.fromIsoString(iso);
assertEquals(`Got 2005 from ${iso}`, 2005, date.getUTCFullYear());
assertEquals(`Got February from ${iso}`, 1, date.getUTCMonth());
assertEquals(`Got 22nd from ${iso}`, 22, date.getUTCDate());
assertEquals(`Got 08 hours from ${iso}`, 8, date.getUTCHours());
assertEquals(`Got 22 minutes from ${iso}`, 22, date.getUTCMinutes());
assertEquals(`Got 33 seconds from ${iso}`, 33, date.getUTCSeconds());
// On a DST boundary, using a UTC timestamp
iso = '2019-03-10T11:22:33Z';
date = DateTime.fromIsoString(iso);
assertEquals(`Got 2019 from ${iso}`, 2019, date.getUTCFullYear());
assertEquals(`Got March from ${iso}`, 2, date.getUTCMonth());
assertEquals(`Got 10th from ${iso}`, 10, date.getUTCDate());
assertEquals(`Got 11 hours from ${iso}`, 11, date.getUTCHours());
assertEquals(`Got 22 minutes from ${iso}`, 22, date.getUTCMinutes());
assertEquals(`Got 33 seconds from ${iso}`, 33, date.getUTCSeconds());
// Before a leap day in year 1 BC
iso = '0000-01-02T11:22:33Z';
date = DateTime.fromIsoString(iso);
assertEquals(`Got 0 from ${iso}`, 0, date.getUTCFullYear());
assertEquals(`Got January from ${iso}`, 0, date.getUTCMonth());
assertEquals(`Got 2nd from ${iso}`, 2, date.getUTCDate());
assertEquals(`Got 11 hours from ${iso}`, 11, date.getUTCHours());
assertEquals(`Got 22 minutes from ${iso}`, 22, date.getUTCMinutes());
assertEquals(`Got 33 seconds from ${iso}`, 33, date.getUTCSeconds());
// After a leap day in year 4 AD
iso = '0004-03-04T11:22:33Z';
date = DateTime.fromIsoString(iso);
assertEquals(`Got 4 from ${iso}`, 4, date.getUTCFullYear());
assertEquals(`Got March from ${iso}`, 2, date.getUTCMonth());
assertEquals(`Got 4th from ${iso}`, 4, date.getUTCDate());
assertEquals(`Got 11 hours from ${iso}`, 11, date.getUTCHours());
assertEquals(`Got 22 minutes from ${iso}`, 22, date.getUTCMinutes());
assertEquals(`Got 33 seconds from ${iso}`, 33, date.getUTCSeconds());
// Parsing ISO string in local time zone.
iso = '2019-04-01T01:00:00';
date = DateTime.fromIsoString(iso);
assertEquals(`Got 2019 from ${iso}`, 2019, date.getFullYear());
assertEquals(`Got April from ${iso}`, 3, date.getMonth());
assertEquals(`Got 1st from ${iso}`, 1, date.getDate());
assertEquals(`Got 01 hours from ${iso}`, 1, date.getHours());
assertEquals(`Got 00 minutes from ${iso}`, 0, date.getMinutes());
assertEquals(`Got 00 seconds from ${iso}`, 0, date.getSeconds());
// Parsing ISO string in local time zone.
iso = '2019-03-31T23:59:59';
date = DateTime.fromIsoString(iso);
assertEquals(`Got 2019 from ${iso}`, 2019, date.getFullYear());
assertEquals(`Got March from ${iso}`, 2, date.getMonth());
assertEquals(`Got 31st from ${iso}`, 31, date.getDate());
assertEquals(`Got 23 hours from ${iso}`, 23, date.getHours());
assertEquals(`Got 59 minutes from ${iso}`, 59, date.getMinutes());
assertEquals(`Got 59 seconds from ${iso}`, 59, date.getSeconds());
// Parsing ISO string at month boundary.
iso = '2019-04-01T00:00:01Z';
date = DateTime.fromIsoString(iso);
assertEquals(`Got 2019 from ${iso}`, 2019, date.getUTCFullYear());
assertEquals(`Got April from ${iso}`, 3, date.getUTCMonth());
assertEquals(`Got 1st from ${iso}`, 1, date.getUTCDate());
assertEquals(`Got 00 hours from ${iso}`, 0, date.getUTCHours());
assertEquals(`Got 00 minutes from ${iso}`, 0, date.getUTCMinutes());
assertEquals(`Got 01 seconds from ${iso}`, 1, date.getUTCSeconds());
// Parsing ISO string at month boundary.
iso = '2019-03-31T23:59:59Z';
date = DateTime.fromIsoString(iso);
assertEquals(`Got 2019 from ${iso}`, 2019, date.getUTCFullYear());
assertEquals(`Got March from ${iso}`, 2, date.getUTCMonth());
assertEquals(`Got 31st from ${iso}`, 31, date.getUTCDate());
assertEquals(`Got 23 hours from ${iso}`, 23, date.getUTCHours());
assertEquals(`Got 59 minutes from ${iso}`, 59, date.getUTCMinutes());
assertEquals(`Got 59 seconds from ${iso}`, 59, date.getUTCSeconds());
// Parsing ISO string with differing UTC date.
iso = '2019-03-31T23:00:00-02:00';
date = DateTime.fromIsoString(iso);
assertEquals(`Got 2019 from ${iso}`, 2019, date.getUTCFullYear());
assertEquals(`Got April from ${iso}`, 3, date.getUTCMonth());
assertEquals(`Got 1st from ${iso}`, 1, date.getUTCDate());
assertEquals(`Got 01 hours from ${iso}`, 1, date.getUTCHours());
assertEquals(`Got 00 minutes from ${iso}`, 0, date.getUTCMinutes());
assertEquals(`Got 00 seconds from ${iso}`, 0, date.getUTCSeconds());
},
/** @suppress {visibility} suppression added to enable type checking */
test_setIso8601TimeOnly_() {
// 23:59:59
let d = new DateTime(0, 0);
let iso = '18:46:39';
assertTrue(
`parsed ${iso}`, googRequiredGoogDate.setIso8601TimeOnly_(d, iso));
assertEquals(`Got 18 hours from ${iso}`, 18, d.getHours());
assertEquals(`Got 46 minutes from ${iso}`, 46, d.getMinutes());
assertEquals(`Got 39 seconds from ${iso}`, 39, d.getSeconds());
// 235959
d = new DateTime(0, 0);
iso = '184639';
assertTrue(
`parsed ${iso}`, googRequiredGoogDate.setIso8601TimeOnly_(d, iso));
assertEquals(`Got 18 hours from ${iso}`, 18, d.getHours());
assertEquals(`Got 46 minutes from ${iso}`, 46, d.getMinutes());
assertEquals(`Got 39 seconds from ${iso}`, 39, d.getSeconds());
// 23:59, 2359, or 23
d = new DateTime(0, 0);
iso = '18:46';
assertTrue(
`parsed ${iso}`, googRequiredGoogDate.setIso8601TimeOnly_(d, iso));
assertEquals(`Got 18 hours from ${iso}`, 18, d.getHours());
assertEquals(`Got 46 minutes from ${iso}`, 46, d.getMinutes());
d = new DateTime(0, 0);
iso = '1846';
assertTrue(
`parsed ${iso}`, googRequiredGoogDate.setIso8601TimeOnly_(d, iso));
assertEquals(`Got 18 hours from ${iso}`, 18, d.getHours());
assertEquals(`Got 46 minutes from ${iso}`, 46, d.getMinutes());
d = new DateTime(0, 0);
iso = '18';
assertTrue(
`parsed ${iso}`, googRequiredGoogDate.setIso8601TimeOnly_(d, iso));
assertEquals(`Got 18 hours from ${iso}`, 18, d.getHours());
d = new DateTime(0, 0);
iso = '18463';
assertFalse(
`failed to parse ${iso}`,
googRequiredGoogDate.setIso8601TimeOnly_(d, iso));
assertTrue('date did not change', d.equals(new DateTime(0, 0)));
// 23:59:59.9942 or 235959.9942
d = new DateTime(0, 0);
iso = '18:46:39.9942';
assertTrue(
`parsed ${iso}`, googRequiredGoogDate.setIso8601TimeOnly_(d, iso));
assertEquals(`Got 18 hours from ${iso}`, 18, d.getHours());
assertEquals(`Got 46 minutes from ${iso}`, 46, d.getMinutes());
assertEquals(`Got 39 seconds from ${iso}`, 39, d.getSeconds());
assertEquals(`Got 994 milliseconds from ${iso}`, 994, d.getMilliseconds());
d = new DateTime(0, 0);
iso = '184639.9942';
assertTrue(
`parsed ${iso}`, googRequiredGoogDate.setIso8601TimeOnly_(d, iso));
assertEquals(`Got 18 hours from ${iso}`, 18, d.getHours());
assertEquals(`Got 46 minutes from ${iso}`, 46, d.getMinutes());
assertEquals(`Got 39 seconds from ${iso}`, 39, d.getSeconds());
// Other browsers, including WebKit on Windows, return integers.
assertEquals(`Got 994 milliseconds from ${iso}`, 994, d.getMilliseconds());
// 1995-02-04 24:00 = 1995-02-05 00:00
// timezone tests
const offset = new Date().getTimezoneOffset() / 60;
d = new DateTime(0, 0);
iso = '18:46:39+07:00';
assertTrue(
`parsed ${iso}`, googRequiredGoogDate.setIso8601TimeOnly_(d, iso));
assertEquals(`Got an 11-hour GMT offset from ${iso}`, 11, d.getUTCHours());
d = new DateTime(0, 0);
iso = '18:46:39+00:00';
assertTrue(
`parsed ${iso}`, googRequiredGoogDate.setIso8601TimeOnly_(d, iso));
assertEquals(`Got an 18-hour GMT offset from ${iso}`, 18, d.getUTCHours());
d = new DateTime(0, 0);
iso = '16:46:39-07:00';
assertTrue(
`parsed ${iso}`, googRequiredGoogDate.setIso8601TimeOnly_(d, iso));
assertEquals(`Got a 23-hour GMT offset from ${iso}`, 23, d.getUTCHours());
},
testDateIntervalAdd() {
// -1m, cross year boundary
let d = new DateDate(2007, month.JAN, 1);
d.add(new Interval(Interval.MONTHS, -1));
assertEquals('2007-01-01 - 1m = 2006-12-01', '20061201', d.toIsoString());
// +1y2m3d
d = new DateDate(2006, month.JAN, 1);
d.add(new Interval(1, 2, 3));
assertEquals(
'2006-01-01 + 1y2m3d = 2007-03-04', '20070304', d.toIsoString());
// -1y2m3d (negative interval)
d = new DateDate(2007, month.MAR, 4);
d.add(new Interval(-1, -2, -3));
assertEquals(
'2007-03-04 - 1y2m3d = 2006-01-01', '20060101', d.toIsoString());
// 2007-12-30 + 3d (roll over to next year)
d = new DateDate(2007, month.DEC, 30);
d.add(new Interval(Interval.DAYS, 3));
assertEquals('2007-12-30 + 3d = 2008-01-02', '20080102', d.toIsoString());
// 2004-03-01 - 1d (handle leap year)
d = new DateDate(2004, month.MAR, 1);
d.add(new Interval(Interval.DAYS, -1));
assertEquals('2004-03-01 - 1d = 2004-02-29', '20040229', d.toIsoString());
// 2004-02-29 + 1y (stays at end of Feb, doesn't roll to Mar)
d = new DateDate(2004, month.FEB, 29);
d.add(new Interval(Interval.YEARS, 1));
assertEquals('2004-02-29 + 1y = 2005-02-28', '20050228', d.toIsoString());
// 2004-02-29 - 1y (stays at end of Feb, doesn't roll to Mar)
d = new DateDate(2004, month.FEB, 29);
d.add(new Interval(Interval.YEARS, -1));
assertEquals('2004-02-29 - 1y = 2003-02-28', '20030228', d.toIsoString());
// 2003-02-28 + 1y (stays at 28, doesn't go to leap year end of Feb)
d = new DateDate(2003, month.FEB, 28);
d.add(new Interval(Interval.YEARS, 1));
assertEquals('2003-02-28 + 1y = 2004-02-28', '20040228', d.toIsoString());
// 2005-02-28 - 1y (stays at 28, doesn't go to leap year end of Feb)
d = new DateDate(2005, month.FEB, 28);
d.add(new Interval(Interval.YEARS, -1));
assertEquals('2005-02-28 - 1y = 2004-02-28', '20040228', d.toIsoString());
// 2003-01-31 + 1y (stays at end of Jan, standard case)
d = new DateDate(2003, month.JAN, 31);
d.add(new Interval(Interval.YEARS, 1));
assertEquals('2003-01-31 + 1y = 2004-01-31', '20040131', d.toIsoString());
// 2005-01-31 - 1y (stays at end of Jan, standard case)
d = new DateDate(2005, month.JAN, 31);
d.add(new Interval(Interval.YEARS, -1));
assertEquals('2005-01-31 - 1y = 2004-01-31', '20040131', d.toIsoString());
// 2006-01-31 + 1m (stays at end of Feb, doesn't roll to Mar, non-leap-year)
d = new DateDate(2006, month.JAN, 31);
d.add(new Interval(Interval.MONTHS, 1));
assertEquals('2006-01-31 + 1m = 2006-02-28', '20060228', d.toIsoString());
// 2004-02-29 + 1m (stays at 29, standard case)
d = new DateDate(2004, month.FEB, 29);
d.add(new Interval(Interval.MONTHS, +1));
assertEquals('2004-02-29 + 1m = 2004-03-29', '20040329', d.toIsoString());
// 2004-02-29 - 1m (stays at 29, standard case)
d = new DateDate(2004, month.FEB, 29);
d.add(new Interval(Interval.MONTHS, -1));
assertEquals('2004-02-29 - 1m = 2004-01-29', '20040129', d.toIsoString());
// 2004-01-30 + 1m (snaps to Feb 29)
d = new DateDate(2004, month.JAN, 30);
d.add(new Interval(Interval.MONTHS, 1));
assertEquals('2004-01-30 + 1m = 2004-02-29', '20040229', d.toIsoString());
// 2004-03-30 - 1m (snaps to Feb 29)
d = new DateDate(2004, month.MAR, 30);
d.add(new Interval(Interval.MONTHS, -1));
assertEquals('2004-03-30 - 1m = 2004-02-29', '20040229', d.toIsoString());
// 2004-03-30 + 1m (stays at 30, standard case)
d = new DateDate(2004, month.MAR, 30);
d.add(new Interval(Interval.MONTHS, 1));
assertEquals('2004-03-30 + 1m = 2004-04-30', '20040430', d.toIsoString());
// 2008-10-30 + 1d (roll over to 31).
d = new DateDate(2008, month.OCT, 30);
d.add(new Interval(Interval.DAYS, 1));
assertEquals('2008-10-30 + 1d = 2008-10-31', '20081031', d.toIsoString());
// 2008-10-31 + 1d (roll over to November, not December).
d = new DateDate(2008, month.OCT, 31);
d.add(new Interval(Interval.DAYS, 1));
assertEquals('2008-10-31 + 1d = 2008-11-01', '20081101', d.toIsoString());
// 2008-10-17 + 1d (Brasilia dst).
d = new DateDate(2008, month.OCT, 17);
d.add(new Interval(Interval.DAYS, 1));
assertEquals('2008-10-17 + 1d = 2008-10-18', '20081018', d.toIsoString());
// 2008-10-18 + 1d (Brasilia dst).
d = new DateDate(2008, month.OCT, 18);
d.add(new Interval(Interval.DAYS, 1));
assertEquals('2008-10-18 + 1d = 2008-10-19', '20081019', d.toIsoString());
// 2008-10-19 + 1d (Brasilia dst).
d = new DateDate(2008, month.OCT, 19);
d.add(new Interval(Interval.DAYS, 1));
assertEquals('2008-10-19 + 1d = 2008-10-20', '20081020', d.toIsoString());
// 2008-02-16 + 1d (Brasilia dst).
d = new DateDate(2008, month.FEB, 16);
d.add(new Interval(Interval.DAYS, 1));
assertEquals('2008-02-16 + 1d = 2008-02-17', '20080217', d.toIsoString());
// 2008-02-17 + 1d (Brasilia dst).
d = new DateDate(2008, month.FEB, 17);
d.add(new Interval(Interval.DAYS, 1));
assertEquals('2008-02-17 + 1d = 2008-02-18', '20080218', d.toIsoString());
},
/** @suppress {checkTypes} suppression added to enable type checking */
testDateEquals() {
let d1 = new DateDate(2004, month.MAR, 1);
let d2 = new DateDate(2004, month.MAR, 1);
assertFalse('d1 != null', d1.equals(null));
assertFalse('d2 != undefined', d2.equals(undefined));
assertTrue('d1 == d2', d1.equals(d2));
assertTrue('d2 == d1', d2.equals(d1));
d1 = new DateDate(2005, month.MAR, 1);
d2 = new DateDate(2004, month.MAR, 1);
assertFalse('different year', d1.equals(d2));
d1 = new DateDate(2004, month.FEB, 1);
d2 = new DateDate(2004, month.MAR, 1);
assertFalse('different month', d1.equals(d2));
d1 = new DateDate(2004, month.MAR, 2);
d2 = new DateDate(2004, month.MAR, 1);
assertFalse('different date', d1.equals(d2));
// try passing in DateTime, time fields should be ignored
d1 = new DateDate(2004, month.MAR, 1);
d2 = new DateTime(2004, month.MAR, 1, 12, 30, 30);
assertTrue('using goog.date.DateTime, same date', d1.equals(d2));
},
testDateTimeConstructor() {
let date = new DateTime(2001, 2, 3, 4, 5, 6, 7);
assertEquals(2001, date.getFullYear());
assertEquals(2, date.getMonth());
assertEquals(3, date.getDate());
assertEquals(4, date.getHours());
assertEquals(5, date.getMinutes());
assertEquals(6, date.getSeconds());
assertEquals(7, date.getMilliseconds());
assertEquals(new Date(2001, 2, 3, 4, 5, 6, 7).getTime(), date.getTime());
date = new DateTime(2001);
assertEquals(2001, date.getFullYear());
assertEquals(0, date.getMonth());
assertEquals(1, date.getDate());
assertEquals(0, date.getHours());
assertEquals(0, date.getMinutes());
assertEquals(0, date.getSeconds());
assertEquals(0, date.getMilliseconds());
date = new DateTime(new Date(2001, 2, 3, 4, 5, 6, 7));
assertEquals(2001, date.getFullYear());
assertEquals(2, date.getMonth());
assertEquals(3, date.getDate());
assertEquals(4, date.getHours());
assertEquals(5, date.getMinutes());
assertEquals(6, date.getSeconds());
assertEquals(7, date.getMilliseconds());
assertEquals(new Date(2001, 2, 3, 4, 5, 6, 7).getTime(), date.getTime());
goog.now = () => new Date(2001, 2, 3, 4).getTime();
date = new DateTime();
assertEquals(2001, date.getFullYear());
assertEquals(2, date.getMonth());
assertEquals(3, date.getDate());
assertEquals(4, date.getHours());
assertEquals(0, date.getMinutes());
assertEquals(0, date.getSeconds());
assertEquals(0, date.getMilliseconds());
assertEquals(new Date(2001, 2, 3, 4).getTime(), date.getTime());
date = new DateTime(new Date('October 2, 2002 8:00:00'));
assertEquals(2002, date.getFullYear());
assertEquals(9, date.getMonth());
assertEquals(2, date.getDate());
assertEquals(8, date.getHours());
assertEquals(0, date.getMinutes());
assertEquals(0, date.getSeconds());
assertEquals(0, date.getMilliseconds());
assertEquals(new Date(2002, 9, 2, 8).getTime(), date.getTime());
},
/** @suppress {checkTypes} suppression added to enable type checking */
testDateTimeEquals() {
let d1 = new DateTime(2004, month.MAR, 1, 12, 30, 30);
let d2 = new DateTime(2004, month.MAR, 1, 12, 30, 30);
assertTrue('d1 == d2', d1.equals(d2));
assertTrue('d2 == d1', d2.equals(d1));
d1 = new DateTime(2007, month.JAN, 1);
d2 = new DateTime(); // today
assertFalse('different date', d1.equals(d2));
d1 = new DateTime(2004, month.MAR, 1);
d2 = new DateTime(2004, month.MAR, 1, 12);
assertFalse('different hours', d1.equals(d2));
d1 = new DateTime(2004, month.MAR, 1, 12, 29, 30);
d2 = new DateTime(2004, month.MAR, 1, 12, 30, 30);
assertFalse('different minutes', d1.equals(d2));
d1 = new DateTime(2004, month.MAR, 1, 12, 30, 29);
d2 = new DateTime(2004, month.MAR, 1, 12, 30, 30);
assertFalse('different seconds', d1.equals(d2));
d1 = new DateTime(2004, month.MAR, 1, 12, 30, 30, 500);
d2 = new DateTime(2004, month.MAR, 1, 12, 30, 30, 500);
assertTrue('same milliseconds', d1.equals(d2));
d1 = new DateTime(2004, month.MAR, 1, 12, 30, 30, 499);
d2 = new DateTime(2004, month.MAR, 1, 12, 30, 30, 500);
assertFalse('different milliseconds', d1.equals(d2));
// try milliseconds again, this time comparing against a native Date
d1 = new DateTime(2004, month.MAR, 1, 12, 30, 30);
d2 = new Date(2004, 2, 1, 12, 30, 30, 999);
assertFalse('different milliseconds, native Date', d1.equals(d2));
// pass in a goog.date.Date rather than a goog.date.DateTime
d1 = new DateTime(2004, month.MAR, 1, 12, 30, 30);
d2 = new DateDate(2004, month.MAR, 1);
assertFalse('using goog.date.Date, different times', d1.equals(d2));
d1 = new DateTime(2004, month.MAR, 1, 0, 0, 0);
d2 = new DateDate(2004, month.MAR, 1);
assertTrue('using goog.date.Date, same time (midnight)', d1.equals(d2));
},
testIntervalIsZero() {
assertTrue('zero interval', new Interval().isZero());
const i = new Interval(0, 0, 1, -24, 0, 0);
assertFalse('1 day minus 24 hours is not considered zero', i.isZero());
},
testIntervalGetInverse() {
let i1 = new Interval(Interval.DAYS, -1);
let i2 = i1.getInverse();
let d = new DateDate(2004, month.MAR, 1);
d.add(i1);
d.add(i2);
let label = '2004-03-01 - 1d + 1d = 2004-03-01';
assertEquals(label, d.toIsoString(), '20040301');
i1 = new Interval(1, 2, 3);
i2 = i1.getInverse();
d = new DateDate(2004, month.MAR, 1);
d.add(i1);
d.add(i2);
label = '2004-03-01 - 1y2m3d + 1y2m3d = 2004-03-01';
assertEquals(label, d.toIsoString(), '20040301');
},
testIntervalTimes() {
const i = new Interval(1, 2, 3, 4, 5, 6);
const expected = new Interval(2, 4, 6, 8, 10, 12);
assertTrue('double interval', expected.equals(i.times(2)));
},
testIntervalEquals() {
let i1 = new Interval(Interval.DAYS, -1);
let i2 = new Interval(Interval.DAYS, -1);
assertTrue('-1d == -1d, aka i1 == i2', i1.equals(i2));
assertTrue('-1d == -1d, aka i2 == i1', i2.equals(i1));
i1 = new Interval(Interval.DAYS, -1);
i2 = new Interval(Interval.DAYS, 1);
assertFalse('-1d != +1d, aka i1 == i2', i1.equals(i2));
assertFalse('-1d != +1d, aka i2 == i1', i2.equals(i1));
i1 = new Interval(0, 3); // Three months
i2 = new Interval(Interval.MONTHS, 3);
assertTrue('3m == 3m, aka i1 == i2', i1.equals(i2));
assertTrue('3m == 3m, aka i2 == i1', i2.equals(i1));
// 1 year, 6 months, 15 days, 12 hours, 30 minutes, 30 seconds
i1 = new Interval(1, 6, 15, 12, 30, 30);
i2 = new Interval(1, 6, 15, 12, 30, 30);
assertTrue('1y6m15d12h30M30s == 1y6m15d12h30M30s', i1.equals(i2));
assertTrue('1y6m15d12h30M30s == 1y6m15d12h30M30s', i2.equals(i1));
},
testIntervalIntervalAdd() {
let i1 = new Interval(1, 6, 15, 12, 30, 30);
let i2 = new Interval(0, 3, 20, 10, 50, -25);
i1.add(i2);
assertTrue('i1 + i2', i1.equals(new Interval(1, 9, 35, 22, 80, 5)));
i1 = new Interval(1, 6, 15, 12, 30, 30);
i2 = new Interval(0, 3, 20, 10, 50, -25);
i2.add(i1);
assertTrue('i2 + i1', i2.equals(new Interval(1, 9, 35, 22, 80, 5)));
i1 = new Interval(1, 6, 15, 12, 30, 30);
i2 = i1.getInverse();
i1.add(i2);
assertTrue('i1 + (-i1)', i1.equals(new Interval()));
i1 = new Interval(Interval.DAYS, 1);
i2 = new Interval(0, -2, -2);
i1.add(i2);
assertTrue('1d + (-2m-2d)', i1.equals(new Interval(0, -2, -1)));
},
testIsoDuration() {
const interval1 = new Interval(123, 456, 678, 11, 12, 455.5);
const duration1 = 'P123Y456M678DT11H12M455.5S';
assertTrue(
'parse full duration',
interval1.equals(Interval.fromIsoString(duration1)));
assertEquals('create full duration', duration1, interval1.toIsoString());
const interval2 = new Interval(123);
const duration2 = 'P123Y';
const duration2v = 'P123Y0M0DT0H0M0S';
assertTrue(
'parse year', interval2.equals(Interval.fromIsoString(duration2)));
assertEquals('create year', duration2, interval2.toIsoString());
assertEquals(
'create year, verbose', duration2v, interval2.toIsoString(true));
const interval3 = new Interval(0, 0, 0, 11, 12, 40);
const duration3 = 'PT11H12M40S';
const duration3v = 'P0Y0M0DT11H12M40S';
assertTrue(
'parse time duration',
interval3.equals(Interval.fromIsoString(duration3)));
assertEquals('create time duration', duration3, interval3.toIsoString());
assertEquals(
'create time duration, verbove', duration3v,
interval3.toIsoString(true));
const interval4 = new Interval(7, 8, 9, 1, 2, 4);
const duration4 = 'P7Y8M9DT1H2M4S';
assertTrue(
'parse one-digit duration',
interval4.equals(Interval.fromIsoString(duration4)));
assertEquals(
'create one-digit duration', duration4, interval4.toIsoString());
const interval5 = new Interval(-123, -456, -678, -11, -12, -455.5);
const duration5 = '-P123Y456M678DT11H12M455.5S';
assertTrue(
'parse full negative duration',
interval5.equals(Interval.fromIsoString(duration5)));
assertEquals(
'create full negative duration', duration5, interval5.toIsoString());
const interval6 = new Interval(0, 0, -1);
const duration6 = '-P1D';
const duration6v = '-P0Y0M1DT0H0M0S';
assertTrue(
'parse partial negative duration',
interval6.equals(Interval.fromIsoString(duration6)));
assertEquals(
'create partial negative duration', duration6, interval6.toIsoString());
assertEquals(
'create partial negative duration, verbose', duration6v,
interval6.toIsoString(true));
const interval7 = new Interval(0, 0, 9, 0, 0, 4);
const duration7 = 'P9DT4S';
const duration7v = 'P0Y0M9DT0H0M4S';
assertTrue(
'parse partial one-digit duration',
interval7.equals(Interval.fromIsoString(duration7)));
assertTrue(
'parse partial one-digit duration, verbose',
interval7.equals(Interval.fromIsoString(duration7v)));
assertEquals(
'create partial one-digit duration', duration7,
interval7.toIsoString());
assertEquals(
'create partial one-digit duration, verbose', duration7v,
interval7.toIsoString(true));
const interval8 = new Interval(1, -1, 1, -1, 1, -1);
assertNull('create mixed sign duration', interval8.toIsoString());
const duration9 = '1Y1M1DT1H1M1S';
assertNull('missing P', Interval.fromIsoString(duration9));
const duration10 = 'P1Y1M1D1H1M1S';
assertNull('missing T', Interval.fromIsoString(duration10));
const duration11 = 'P1Y1M1DT';
assertNull('extra T', Interval.fromIsoString(duration11));
const duration12 = 'PT.5S';
assertNull(
'invalid seconds, missing integer part',
Interval.fromIsoString(duration12));
const duration13 = 'PT1.S';
assertNull(
'invalid seconds, missing fractional part',
Interval.fromIsoString(duration13));
},
testGetTotalSeconds() {
const duration = new Interval(0, 0, 2, 3, 4, 5);
assertEquals(
'seconds in 2d3h4m5s', 2 * 86400 + 3 * 3600 + 4 * 60 + 5,
duration.getTotalSeconds());
},
testIsDateLikeWithGoogDateTime() {
const jsDate = new Date();
const googDate = new DateTime();
const string = 'foo';
const number = 1;
const nullVar = null;
let notDefined;
assertTrue('js Date should be date-like', goog.isDateLike(jsDate));
assertTrue('goog Date should be date-like', goog.isDateLike(googDate));
assertFalse('string should not be date-like', goog.isDateLike(string));
assertFalse('number should not be date-like', goog.isDateLike(number));
assertFalse('nullVar should not be date-like', goog.isDateLike(nullVar));
assertFalse(
'undefined should not be date-like', goog.isDateLike(notDefined));
},
testToUTCRfc3339String() {
let date = DateTime.fromIsoString('19850412T232050Z');
date.setUTCMilliseconds(52);
assertEquals('1985-04-12T23:20:50.052Z', date.toUTCRfc3339String());
assertNotEquals(
'Diverges from ISO 8601', date.toUTCRfc3339String(),
date.toUTCIsoString(true, true));
date = DateTime.fromIsoString('19901231T235959Z');
assertEquals('1990-12-31T23:59:59Z', date.toUTCRfc3339String());
date = DateTime.fromIsoString('19370101T120027Z');
date.setUTCMilliseconds(87);
assertEquals('1937-01-01T12:00:27.087Z', date.toUTCRfc3339String());
},
testDateTimezone() {
const d = new DateTime(2006, 1, 1, 12, 0, 0);
d.add(new Interval(Interval.MINUTES, d.getTimezoneOffset()));
const d2 = new DateTime(2006, 1, 1, 12, 0, 0);
assertEquals(
'Compensate for timezone and compare with UTC date/time',
d.toIsoString(true), d2.toUTCIsoString(true));
},
testToUsTimeString() {
const doPad = true;
const doShowPm = true;
const dontPad = false;
const dontShowPm = false;
// 12am
let d = new DateTime(2007, 1, 14);
assertEquals('12am test 1', '12:00 AM', d.toUsTimeString());
assertEquals('12am test 2', '12:00 AM', d.toUsTimeString(doPad));
assertEquals('12am test 3', '12:00 AM', d.toUsTimeString(dontPad));
assertEquals('12am test 4', '12:00 AM', d.toUsTimeString(doPad, doShowPm));
assertEquals('12am test 5', '00:00', d.toUsTimeString(doPad, dontShowPm));
assertEquals(
'12am test 6', '12:00 AM', d.toUsTimeString(dontPad, doShowPm));
assertEquals('12am test 7', '0:00', d.toUsTimeString(dontPad, dontShowPm));
// 9am
d = new DateTime(2007, 1, 14, 9);
assertEquals('9am test 1', '9:00 AM', d.toUsTimeString());
assertEquals('9am test 2', '09:00 AM', d.toUsTimeString(doPad));
assertEquals('9am test 3', '9:00 AM', d.toUsTimeString(dontPad));
assertEquals('9am test 4', '09:00 AM', d.toUsTimeString(doPad, doShowPm));
assertEquals('9am test 5', '09:00', d.toUsTimeString(doPad, dontShowPm));
assertEquals('9am test 6', '9:00 AM', d.toUsTimeString(dontPad, doShowPm));
assertEquals('9am test 7', '9:00', d.toUsTimeString(dontPad, dontShowPm));
// 12pm
d = new DateTime(2007, 1, 14, 12);
assertEquals('12pm test 1', '12:00 PM', d.toUsTimeString());
assertEquals('12pm test 2', '12:00 PM', d.toUsTimeString(doPad));
assertEquals('12pm test 3', '12:00 PM', d.toUsTimeString(dontPad));
assertEquals('12pm test 4', '12:00 PM', d.toUsTimeString(doPad, doShowPm));
assertEquals('12pm test 5', '12:00', d.toUsTimeString(doPad, dontShowPm));
assertEquals(
'12pm test 6', '12:00 PM', d.toUsTimeString(dontPad, doShowPm));
assertEquals('12pm test 7', '12:00', d.toUsTimeString(dontPad, dontShowPm));
// 6 PM
d = new DateTime(2007, 1, 14, 18);
assertEquals('6 PM test 1', '6:00 PM', d.toUsTimeString());
assertEquals('6 PM test 2', '06:00 PM', d.toUsTimeString(doPad));
assertEquals('6 PM test 3', '6:00 PM', d.toUsTimeString(dontPad));
assertEquals('6 PM test 4', '06:00 PM', d.toUsTimeString(doPad, doShowPm));
assertEquals('6 PM test 5', '06:00', d.toUsTimeString(doPad, dontShowPm));
assertEquals('6 PM test 6', '6:00 PM', d.toUsTimeString(dontPad, doShowPm));
assertEquals('6 PM test 7', '6:00', d.toUsTimeString(dontPad, dontShowPm));
// 6:01 PM
d = new DateTime(2007, 1, 14, 18, 1);
assertEquals('6:01 PM test 1', '6:01 PM', d.toUsTimeString());
assertEquals('6:01 PM test 2', '06:01 PM', d.toUsTimeString(doPad));
assertEquals('6:01 PM test 3', '6:01 PM', d.toUsTimeString(dontPad));
assertEquals(
'6:01 PM test 4', '06:01 PM', d.toUsTimeString(doPad, doShowPm));
assertEquals(
'6:01 PM test 5', '06:01', d.toUsTimeString(doPad, dontShowPm));
assertEquals(
'6:01 PM test 6', '6:01 PM', d.toUsTimeString(dontPad, doShowPm));
assertEquals(
'6:01 PM test 7', '6:01', d.toUsTimeString(dontPad, dontShowPm));
// 6:35 PM
d = new DateTime(2007, 1, 14, 18, 35);
assertEquals('6:35 PM test 1', '6:35 PM', d.toUsTimeString());
assertEquals('6:35 PM test 2', '06:35 PM', d.toUsTimeString(doPad));
assertEquals('6:35 PM test 3', '6:35 PM', d.toUsTimeString(dontPad));
assertEquals(
'6:35 PM test 4', '06:35 PM', d.toUsTimeString(doPad, doShowPm));
assertEquals(
'6:35 PM test 5', '06:35', d.toUsTimeString(doPad, dontShowPm));
assertEquals(
'6:35 PM test 6', '6:35 PM', d.toUsTimeString(dontPad, doShowPm));
assertEquals(
'6:35 PM test 7', '6:35', d.toUsTimeString(dontPad, dontShowPm));
// omit zero minutes
d = new DateTime(2007, 1, 14, 18);
assertEquals(
'omit zero 1', '6:00 PM', d.toUsTimeString(dontPad, doShowPm, false));
assertEquals(
'omit zero 2', '6 PM', d.toUsTimeString(dontPad, doShowPm, true));
// but don't omit zero minutes if not actually zero minutes
d = new DateTime(2007, 1, 14, 18, 1);
assertEquals(
'omit zero 3', '6:01 PM', d.toUsTimeString(dontPad, doShowPm, false));
assertEquals(
'omit zero 4', '6:01 PM', d.toUsTimeString(dontPad, doShowPm, true));
},
testToIsoTimeString() {
// 00:00
let d = new DateTime(2007, 1, 14);
assertEquals('00:00', '00:00:00', d.toIsoTimeString());
// 09:00
d = new DateTime(2007, 1, 14, 9);
assertEquals('09:00', '09:00:00', d.toIsoTimeString());
// 12:00
d = new DateTime(2007, 1, 14, 12);
assertEquals('12:00', '12:00:00', d.toIsoTimeString());
// 18:00
d = new DateTime(2007, 1, 14, 18);
assertEquals('18:00', '18:00:00', d.toIsoTimeString());
// 18:01
d = new DateTime(2007, 1, 14, 18, 1);
assertEquals('18:01', '18:01:00', d.toIsoTimeString());
// 18:35
d = new DateTime(2007, 1, 14, 18, 35);
assertEquals('18:35', '18:35:00', d.toIsoTimeString());
// 18:35:01
d = new DateTime(2007, 1, 14, 18, 35, 1);
assertEquals('18:35:01', '18:35:01', d.toIsoTimeString());
// 18:35:11
d = new DateTime(2007, 1, 14, 18, 35, 11);
assertEquals('18:35:11', '18:35:11', d.toIsoTimeString());
// 18:35:11 >> 18:35
d = new DateTime(2007, 1, 14, 18, 35, 11);
assertEquals('18:35:11 no secs', '18:35', d.toIsoTimeString(false));
},
testToXmlDateTimeString() {
let d = new DateTime(2007, 1, 14);
assertEquals('2007-02-14', '2007-02-14T00:00:00', d.toXmlDateTime());
d = new DateTime(2007, 1, 14, 18, 35, 1);
assertEquals(
'2007-02-14, 8:35:01, timezone==undefined', '2007-02-14T18:35:01',
d.toXmlDateTime());
d = new DateTime(2007, 1, 14, 18, 35, 1);
assertEquals(
'2007-02-14, 8:35:01, timezone==false', '2007-02-14T18:35:01',
d.toXmlDateTime(false));
d = new DateTime(2007, 1, 14, 18, 35, 1);
assertEquals(
'2007-02-14, 8:35:01, timezone==true',
'2007-02-14T18:35:01' + d.getTimezoneOffsetString(),
d.toXmlDateTime(true));
},
testClone() {
let d = new DateTime(2007, 1, 14, 18, 35, 1);
let d2 = d.clone();
assertTrue('datetimes equal', d.equals(d2));
d = new DateTime(2007, 1, 14, 18, 35, 1, 310);
d2 = d.clone();
assertTrue('datetimes with milliseconds equal', d.equals(d2));
d = new DateDate(2007, 1, 14);
d2 = d.clone();
assertTrue('dates equal', d.equals(d2));
// 1 year, 6 months, 15 days, 12 hours, 30 minutes, 30 seconds
let i = new Interval(1, 6, 15, 12, 30, 30);
let i2 = i.clone();
assertTrue('intervals equal', i.equals(i2));
i = new Interval(Interval.DAYS, -1);
i2 = i.clone();
assertTrue('day intervals equal', i.equals(i2));
// Brasilia dst
d = new DateDate(2008, month.OCT, 18);
d.add(new Interval(Interval.DAYS, 1));
d2 = d.clone();
assertTrue('dates equal', d.equals(d2));
},
testValueOf() {
const date1 = new DateTime(2008, 11, 26, 15, 40, 0);
const date2 = new DateDate(2008, 11, 27);
const date3 = new DateTime(2008, 11, 26, 15, 40, 1);
const nativeDate = new Date();
nativeDate.setFullYear(2008, 11, 26);
nativeDate.setHours(15, 40, 0, 0);
assertEquals(date1.valueOf(), nativeDate.valueOf());
assertFalse(date1 < date1);
assertTrue(date1 <= date1);
assertTrue(date1 < date2);
assertTrue(date2 > date3);
},
testDateCompare() {
// May 16th, 2011, 3:17:36.500
const date1 = new DateTime(2011, month.MAY, 16, 15, 17, 36, 500);
// May 16th, 2011, 3:17:36.501
const date2 = new DateTime(2011, month.MAY, 16, 15, 17, 36, 501);
// May 16th, 2011, 3:17:36.501
const date3 = new DateTime(2011, month.MAY, 16, 15, 17, 36, 502);
assertEquals(0, DateDate.compare(date1.clone(), date1.clone()));
assertEquals(-1, DateDate.compare(date1, date2));
assertEquals(1, DateDate.compare(date2, date1));
const dates = [date2, date3, date1];
dates.sort(DateDate.compare);
assertArrayEquals(
'Dates should be sorted in time.', [date1, date2, date3], dates);
// Assert a known millisecond difference between two points in time.
assertEquals(
-19129478,
DateDate.compare(
new DateTime(1982, month.MAR, 12, 6, 48, 32, 354),
new DateTime(1982, month.MAR, 12, 12, 7, 21, 832)));
// Test dates before the year 0. Dates are Talk Like a Pirate Day, and
// Towel Day, 300 B.C. (and before pirates).
const pirateDay = new DateDate(-300, month.SEP, 2);
const towelDay = new DateDate(-300, month.MAY, 12);
assertEquals(
'Dates should be 113 days apart.', 113 * 24 * 60 * 60 * 1000,
DateDate.compare(pirateDay, towelDay));
},
testDateCompareDateLikes() {
const nativeDate = new Date(2011, 4, 16, 15, 17, 36, 500);
const closureDate = new DateTime(2011, month.MAY, 16, 15, 17, 36, 500);
assertEquals(0, DateDate.compare(nativeDate, closureDate));
nativeDate.setMilliseconds(499);
assertEquals(-1, DateDate.compare(nativeDate, closureDate));
nativeDate.setMilliseconds(501);
assertEquals(1, DateDate.compare(nativeDate, closureDate));
},
testIsMidnight() {
assertTrue(new DateTime(2013, 0, 1).isMidnight());
assertFalse(new DateTime(2013, 0, 1, 1).isMidnight());
assertFalse(new DateTime(2013, 0, 1, 0, 1).isMidnight());
assertFalse(new DateTime(2013, 0, 1, 0, 0, 1).isMidnight());
assertFalse(new DateTime(2013, 0, 1, 0, 0, 0, 1).isMidnight());
},
testMinMax() {
// Comparison of two goog.date.DateTimes
const dateTime1 = new DateTime(2000, 0, 1);
const dateTime2 = new DateTime(2000, 0, 1, 0, 0, 0, 1);
assertEquals(dateTime1, googRequiredGoogDate.min(dateTime1, dateTime2));
assertEquals(dateTime1, googRequiredGoogDate.min(dateTime2, dateTime1));
assertEquals(dateTime2, googRequiredGoogDate.max(dateTime1, dateTime2));
assertEquals(dateTime2, googRequiredGoogDate.max(dateTime2, dateTime1));
// Comparison of two goog.date.Dates
const date1 = new DateDate(2000, 0, 1);
const date2 = new DateDate(2000, 0, 2);
assertEquals(date1, googRequiredGoogDate.min(date1, date2));
// Comparison of native Dates.
const jsDate1 = new Date(2000, 0, 1);
const jsDate2 = new Date(2000, 0, 2);
assertEquals(jsDate1, googRequiredGoogDate.min(jsDate1, jsDate2));
assertEquals(jsDate2, googRequiredGoogDate.max(jsDate1, jsDate2));
// Comparison of different types.
assertEquals(date1, googRequiredGoogDate.min(date1, dateTime2));
assertEquals(dateTime2, googRequiredGoogDate.min(date2, dateTime2));
assertEquals(date1, googRequiredGoogDate.min(date1, jsDate2));
assertEquals(jsDate2, googRequiredGoogDate.max(dateTime1, jsDate2));
},
testDateTimeIntervalAdd() {
// Add hours
let d = new DateTime(2007, month.JAN, 1, 10, 20, 30);
d.add(new Interval(Interval.HOURS, 10));
assertEquals(20, d.getHours());
// Add negative hours
d.add(new Interval(Interval.HOURS, -5));
assertEquals(15, d.getHours());
// Add hours to the next day
d.add(new Interval(Interval.HOURS, 10));
assertEquals(2, d.getDay());
assertEquals(1, d.getHours());
// Add minutes
d = new DateTime(2007, month.JAN, 1, 22, 20, 30);
d.add(new Interval(Interval.MINUTES, 10));
assertEquals(30, d.getMinutes());
// Add negative minutes
d.add(new Interval(Interval.MINUTES, -5));
assertEquals(25, d.getMinutes());
// Add minutes to the next day
d.add(new Interval(Interval.MINUTES, 130));
assertEquals(2, d.getDay());
assertEquals(0, d.getHours());
assertEquals(35, d.getMinutes());
// Add seconds
d = new DateTime(2007, month.JAN, 1, 23, 45, 30);
d.add(new Interval(Interval.SECONDS, 10));
assertEquals(40, d.getSeconds());
// Add negative seconds
d.add(new Interval(Interval.SECONDS, -5));
assertEquals(35, d.getSeconds());
// Add seconds to the next day
d.add(new Interval(Interval.SECONDS, 1200));
assertEquals(2, d.getDay());
assertEquals(0, d.getHours());
assertEquals(5, d.getMinutes());
assertEquals(35, d.getSeconds());
// Test daylight savings day 2015-11-1
d = new DateTime(2015, month.NOV, 1, 0, 50, 30);
d.add(new Interval(Interval.MINUTES, 15));
assertEquals(1, d.getHours());
assertEquals(5, d.getMinutes());
d.add(new Interval(Interval.HOURS, 1));
assertEquals(1, d.getHours());
// Test daylight savings day 2015-3-8
d = new DateTime(2015, month.MAR, 8, 0, 50, 30);
d.add(new Interval(Interval.MINUTES, 15));
assertEquals(1, d.getHours());
assertEquals(5, d.getMinutes());
d.add(new Interval(Interval.HOURS, 1));
assertEquals(3, d.getHours());
},
});
|
import axios from 'axios'
import { getAllNetworks } from 'util/masterConfig'
const nw = getAllNetworks()
export default function verifierWatcherAxiosInstance(masterSystemConfig){
let axiosInstance = null
if(masterSystemConfig === 'local') {
return null //does not make sense on local
}
else if (masterSystemConfig === 'rinkeby') {
if(nw.rinkeby.VERIFIER_WATCHER_URL === null) return
axiosInstance = axios.create({
baseURL: nw.rinkeby.VERIFIER_WATCHER_URL,
})
}
else if (masterSystemConfig === 'mainnet') {
if(nw.mainnet.VERIFIER_WATCHER_URL === null) return
axiosInstance = axios.create({
baseURL: nw.mainnet.VERIFIER_WATCHER_URL,
})
}
axiosInstance.interceptors.request.use((config) => {
config.headers['Accept'] = 'application/json'
config.headers['Content-Type'] = 'application/json'
return config
})
return axiosInstance
}
|
const request = require('supertest')
const app = require('../../app.js')
const cheerio = require('cheerio')
function countScriptTags(res) {
var $ = cheerio.load(res.text)
return $('script').length
}
const mockFn = jest
.fn((req, routePath, jsPath = null) => 'default')
.mockImplementationOnce(() => 'https://canada.ca')
.mockImplementationOnce(() => false)
jest.mock('../../utils/load.helpers.js', () => ({
getClientJs: () => {
return mockFn()
},
}))
test('User gets redirect when hitting /', async () => {
const response = await request(app).get('/')
expect(response.statusCode).toBe(302)
})
test('Can send get request to start route and have js src set', async () => {
const route = app.routes.get('start')
const response = await request(app).get(route.path.en)
expect(response.statusCode).toBe(200)
expect(response.text).toContain('canada.ca')
})
test('Can send get request to start route and have empty js src', async () => {
const route = app.routes.get('start')
const response = await request(app).get(route.path.en)
expect(response.statusCode).toBe(200)
// call to getClientJs should return false
// which means we should have X number of script tags
// i.e. whatever the amount is in the base view
expect(countScriptTags(response)).toBe(1)
})
|
export function serialize(
content, // text
meshStore, // meshStore
getMetrics // fn to get metrics of char
) {
const result = {
ascender: NaN,
descender: NaN,
chars: []
};
if (content.length) {
const { ascender, descender } = getMetrics(content[0]);
result.ascender = ascender;
result.descender = descender;
} else {
return result;
}
const names = new Set([...content]);
for (const name of names) {
// Ignore newline
if (name == '\n') {
continue;
}
// Handle "data" field
let data = null;
const { mesh } = meshStore.get(name);
if (mesh) {
data = mesh.geometry.serializeVerticeData();
delete data.id;
delete data.updatable;
}
// Handle "advanceWidth" field
const { advanceWidth } = getMetrics(name);
result.chars.push({ name, data, advanceWidth });
}
return result;
}
|
/* eslint-disable no-console */
import mongoose, { Schema, model } from 'mongoose';
import userSchema from './user';
import storeSchema from './store';
import env from '../utils/env';
const models = {
User: model('User', userSchema(Schema, env)),
Store: model('Store', storeSchema(Schema, env)),
};
mongoose.connect(env.databaseURL,
{
useNewUrlParser: true,
useUnifiedTopology: true,
useFindAndModify: false,
useCreateIndex: true,
});
const db = mongoose.connection;
const databaseSetup = async () => {
await db.once('open', () => console.log('connected to database'));
};
if (process.env.NODE_ENV === 'test' || process.env.NODE_ENV === 'production') {
databaseSetup();
} else {
databaseSetup();
Object.values(models).forEach(async (modelProp) => { await modelProp.deleteMany(); });
}
export default {
...models, db,
};
|
import React from "react"
import { Button } from "../components/style"
import styled, { css } from "styled-components"
import { mix } from "polished"
import slugify from "react-slugify"
import firebase from "gatsby-plugin-firebase"
import { useFormik } from "formik"
import LoadingOverlay from 'react-loading-overlay'
export function Form({ form }) {
const fields = Object.fromEntries(Object.entries(form.fields).map(([k, v]) => [v.key, '']));
const [hasSubmitCompleted, setHasSubmitCompleted] = React.useState(false);
const formik = useFormik({
initialValues: fields,
onSubmit: async (values, {setSubmitting, setErrors, resetForm}) => {
setSubmitting(true);
try {
await firebase.functions().httpsCallable('submitForm')({
form: form.formId,
data: values
});
setHasSubmitCompleted(true);
resetForm();
}
catch (err) {
setErrors(err.message.replace("data.", ""));
}
setSubmitting(false);
},
});
if (hasSubmitCompleted) {
return (
<p>{form.successText}</p>
);
}
return (
<LoadingOverlay
active={formik.isSubmitting}
spinner
text={form.loadingText}
>
{(formik.errors !== "" && Object.keys(formik.errors).length !== 0) &&
<StyledError>{formik.errors}</StyledError>}
<StyledForm
onSubmit={formik.handleSubmit}
>
{
form.fields.map(field => {
if (field.inputType === "textarea") {
return (
<FormField wide>
<label for={slugify(field.label)}>{field.label}</label>
<textarea
cols="40"
rows="5"
name={slugify(field.label)}
id={slugify(field.label)}
{...formik.getFieldProps(field.key)}
></textarea>
</FormField>
)
} else {
return (
<FormField>
<label for={slugify(field.label)}>{field.label}</label>
<input
id={slugify(field.label)}
name={slugify(field.label)}
type={field.inputType}
autocorrect="off"
autocomplete={field.autocomplete | ``}
{...formik.getFieldProps(field.key)}
/>
</FormField>
)
}
})
}
{
form.fields.length > 0 && (
<FormField wide>
<Button primary type="submit" value="Submit">
Submit
</Button>
</FormField>
)
}
</StyledForm >
</LoadingOverlay>
)
}
const base = {
name: "customInput",
key: "label",
component: "group",
fields: [
{ name: "label", label: "Label", component: "text" },
{ name: "key", label: "key", component: "text" },
{ name: "inputType", label: "Input Type", component: "text" },
{ name: "autocomplete", label: "Autocomplete", component: "text" },
],
}
export const customInputBlock = {
label: "Custom Input",
...base,
}
export const nameInputBlock = {
label: "Name Input",
defaultItem: {
label: "Name",
inputType: "text",
autocomplete: "name",
},
...base,
}
export const emailInputBlock = {
label: "Email Input",
defaultItem: {
label: "Email",
inputType: "text",
autocomplete: "email",
},
...base,
}
export const phoneInputBlock = {
label: "Phone Input",
defaultItem: {
label: "Phone",
inputType: "text",
autocomplete: "tel",
},
...base,
}
export const companyInputBlock = {
label: "Company Input",
defaultItem: {
label: "Company",
inputType: "text",
autocomplete: "organization",
},
...base,
}
export const messageInputBlock = {
label: "Message Input",
defaultItem: {
label: "Message",
inputType: "textarea",
autocomplete: "",
},
...base,
}
export const FormBlock = {
label: "Form",
key: "name",
name: "form",
component: "group",
defaultItem: {
name: "Form",
formId: "",
fields: [],
},
fields: [
{ name: "name", label: "Name", component: "text" },
{
name: "formId",
label: "Form ID",
description: "The Devs Do Good Form ID for this form",
component: "text",
},
{
name: "loadingText",
label: "Loading Text",
description: "This text will display while form submissions are being processed.",
component: "text",
},
{
name: "successText",
label: "Success Text",
description: "This text will be displayed after users submit the form.",
component: "text",
},
{
label: "Fields",
name: "fields",
component: "blocks",
templates: {
customInputBlock,
nameInputBlock,
emailInputBlock,
phoneInputBlock,
companyInputBlock,
messageInputBlock,
},
},
],
}
export const StyledForm = styled.form`
display: grid;
grid-template-columns: 1fr;
grid-template-rows: auto;
grid-gap: 1.5rem;
justify-items: stretch;
@media (min-width: ${props => props.theme.breakpoints.medium}) {
grid-template-columns: 1fr 1fr;
}
`
export const StyledError = styled.div`
color: #D8000C;
background-color: #FFD2D2;
margin-bottom: 5%;
padding: 2.5%;
`;
export const FormField = styled.div`
input,
textarea {
position: relative;
line-height: 2.25rem;
font-size: 1rem;
padding: 0 0.625rem;
border-radius: ${props => props.theme.radius.small};
border: none;
width: 100%;
transition: box-shadow 150ms ${props => props.theme.easing};
color: ${props => props.theme.color.foreground};
background-color: ${props =>
mix(0.95, props.theme.color.background, props.theme.color.foreground)};
&:focus {
outline: none;
box-shadow: 0 0 0 3px ${props => props.theme.color.secondary};
}
${props =>
props.theme.isDarkMode &&
css`
background-color: ${props => props.theme.color.background};
`};
}
textarea {
line-height: 1.5;
padding: 0.5rem 0.625rem;
resize: vertical;
}
label {
display: block;
margin-bottom: 0.25rem;
}
${p =>
p.wide &&
css`
@media (min-width: ${props => props.theme.breakpoints.medium}) {
grid-column-start: 1;
grid-column-end: 3;
}
`};
`
|
import { dew as _baseSortedUniqDewDew } from "./_baseSortedUniq.dew.js";
var exports = {},
_dewExec = false;
export function dew() {
if (_dewExec) return exports;
_dewExec = true;
var baseSortedUniq = _baseSortedUniqDewDew();
/**
* This method is like `_.uniq` except that it's designed and optimized
* for sorted arrays.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to inspect.
* @returns {Array} Returns the new duplicate free array.
* @example
*
* _.sortedUniq([1, 1, 2]);
* // => [1, 2]
*/
function sortedUniq(array) {
return array && array.length ? baseSortedUniq(array) : [];
}
exports = sortedUniq;
return exports;
}
|
import React, { Fragment } from 'react'
import { Box, Button, makeStyles } from '@material-ui/core'
import { Link } from 'react-router-dom'
import styles from '../../assets/jss/no-apps/NoAppsStyle'
import { ReactComponent as RoundedBoxs } from '../../assets/img/icons/roundedBoxs.svg'
import { userProfileDacTest } from '../../service/dac/userprofile-api'
import { useSelector } from "react-redux"
const useStyles = makeStyles(styles)
const NoApps = ({ pageTitle, heading, pharase, showTitle }) => {
// const NoApps = ({ btnText, pageType, msg, link }) => {
const classes = useStyles()
const stUserSession = useSelector((state) => state.userSession)
return (
<Fragment>
{ !showTitle ? <h1 className={classes.h1}> { pageTitle ? pageTitle : `My Apps`} </h1> : null }
<Box display="flex" alignItems="center" justifyContent="center" minHeight="calc(100vh - 200px)" flexDirection="column" paddingTop="1rem" paddingBottom="1rem">
<div className={classes.boxIcon}>
<RoundedBoxs />
</div>
<h2 className={classes.h2}>{ heading ? heading : `No apps installed`}</h2>
<p className={classes.p}>{pharase ? pharase : `Go to app store, Explore apps and install`}</p>
{/* <Button className={classes.button} onClick={() => userProfileDacTest(stUserSession)}> */}
<Button className={classes.button} >
Discover Apps
{/* <h2 className={classes.h2}>No apps {pageType}</h2>
<p className={classes.p}>{msg}</p>
<Button className={classes.button}>
{btnText}
<Link className="link" to={link}></Link> */}
</Button>
</Box>
</Fragment>
)
}
export default NoApps
|
import {
get, merge, pick, set,
} from 'lodash';
const META_KEYS = [
'info.browsertime.version',
'info.timestamp',
'info.url',
];
const METRICS_KEYS = [
'statistics.timings.firstPaint',
'statistics.timings.fullyLoaded',
'statistics.timings.pageTimings.backEndTime',
'statistics.timings.pageTimings.domContentLoadedTime',
'statistics.timings.pageTimings.domInteractiveTime',
'statistics.timings.pageTimings.domainLookupTime',
'statistics.timings.pageTimings.frontEndTime',
'statistics.timings.pageTimings.pageDownloadTime',
'statistics.timings.pageTimings.pageLoadTime',
'statistics.timings.pageTimings.redirectionTime',
'statistics.timings.pageTimings.serverConnectionTime',
'statistics.timings.pageTimings.serverResponseTime',
'statistics.timings.paintTiming.first-contentful-paint',
'statistics.timings.rumSpeedIndex',
'statistics.visualMetrics.FirstVisualChange',
'statistics.visualMetrics.LastVisualChange',
'statistics.visualMetrics.PerceptualSpeedIndex',
'statistics.visualMetrics.SpeedIndex',
'statistics.visualMetrics.VisualComplete85',
'statistics.visualMetrics.VisualComplete95',
'statistics.visualMetrics.VisualComplete99',
];
/**
* Filter Browsertime stats
*
* @param {Object} browsertimeSource
* @return {import("../../types").BrowsertimeSource}
*/
export const filter = (browsertimeSource) => {
const meta = META_KEYS.reduce((agg, key) => {
// Browsertime is proving an array of results
const metaData = get(browsertimeSource, [0, ...key.split('.')], '');
const filteredMetaData = set({}, key, metaData);
return merge({}, agg, filteredMetaData);
}, {});
const metrics = METRICS_KEYS.reduce((agg, key) => {
// Browsertime is proving an array of results
const metricData = pick(
get(browsertimeSource, [0, ...key.split('.')], {}),
['median'],
);
const filteredMetricData = set({}, key, metricData);
return merge({}, agg, filteredMetricData);
}, {});
return { ...meta, ...metrics };
};
|
import defaultValue from "../Core/defaultValue.js";
import defined from "../Core/defined.js";
import DeveloperError from "../Core/DeveloperError.js";
import Event from "../Core/Event.js";
import createMaterialPropertyDescriptor from "./createMaterialPropertyDescriptor.js";
import createPropertyDescriptor from "./createPropertyDescriptor.js";
/**
* @typedef {Object} RectangleSensorGraphics.ConstructorOptions
*
* Initialization options for the RectangleSensorGraphics constructor
*
* @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the rectangleSensor.
* @property {Property | number} [length] A numeric Property specifying the length of the rectangleSensor.
* @property {Property | number} [leftHalfAngle] A numeric Property specifying the left half angle of the rectangleSensor.
* @property {Property | number} [rightHalfAngle] A numeric Property specifying the right half angle of the rectangleSensor.
* @property {Property | number} [frontHalfAngle] A numeric Property specifying the front half angle of the rectangleSensor.
* @property {Property | number} [backHalfAngle] A numeric Property specifying the back half angle of the rectangleSensor.
* @property {Property | HeightReference} [heightReference=HeightReference.NONE] A Property specifying what the height from the entity position is relative to.
* @property {Property | boolean} [fill=true] A boolean Property specifying whether the rectangleSensor is filled with the provided material.
* @property {MaterialProperty | Color} [material=Color.WHITE] A Property specifying the material used to fill the rectangleSensor.
* @property {Property | boolean} [outline=false] A boolean Property specifying whether the rectangleSensor is outlined.
* @property {Property | Color} [outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline.
* @property {Property | number} [outlineWidth=1.0] A numeric Property specifying the width of the outline.
* @property {Property | number} [numberOfVerticalLines=16] A numeric Property specifying the number of vertical lines to draw along the perimeter for the outline.
* @property {Property | number} [slices=128] The number of edges around the perimeter of the rectangleSensor.
* @property {Property | ShadowMode} [shadows=ShadowMode.DISABLED] An enum Property specifying whether the rectangleSensor casts or receives shadows from light sources.
* @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this rectangleSensor will be displayed.
*/
/**
* Describes a rectangleSensor, truncated cone, or cone defined by a length, top radius, and bottom radius.
* The center position and orientation are determined by the containing {@link Entity}.
*
* @alias RectangleSensorGraphics
* @constructor
*
* @param {RectangleSensorGraphics.ConstructorOptions} [options] Object describing initialization options
*/
function RectangleSensorGraphics(options) {
this._definitionChanged = new Event();
this._show = undefined;
this._showSubscription = undefined;
this._length = undefined;
this._lengthSubscription = undefined;
this._leftHalfAngle = undefined;
this._leftHalfAngleSubscription = undefined;
this._rightHalfAngle = undefined;
this._rightHalfAngleSubscription = undefined;
this._frontHalfAngle = undefined;
this._frontHalfAngleSubscription = undefined;
this._backHalfAngle = undefined;
this._backHalfAngleSubscription = undefined;
this._heightReference = undefined;
this._heightReferenceSubscription = undefined;
this._fill = undefined;
this._fillSubscription = undefined;
this._material = undefined;
this._materialSubscription = undefined;
this._outline = undefined;
this._outlineSubscription = undefined;
this._outlineColor = undefined;
this._outlineColorSubscription = undefined;
this._outlineWidth = undefined;
this._outlineWidthSubscription = undefined;
this._numberOfVerticalLines = undefined;
this._numberOfVerticalLinesSubscription = undefined;
this._slices = undefined;
this._slicesSubscription = undefined;
this._shadows = undefined;
this._shadowsSubscription = undefined;
this._distanceDisplayCondition = undefined;
this._distanceDisplayConditionSubscription = undefined;
this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT));
}
Object.defineProperties(RectangleSensorGraphics.prototype, {
/**
* Gets the event that is raised whenever a property or sub-property is changed or modified.
* @memberof RectangleSensorGraphics.prototype
*
* @type {Event}
* @readonly
*/
definitionChanged: {
get: function () {
return this._definitionChanged;
},
},
/**
* Gets or sets the boolean Property specifying the visibility of the rectangleSensor.
* @memberof RectangleSensorGraphics.prototype
* @type {Property|undefined}
* @default true
*/
show: createPropertyDescriptor("show"),
/**
* Gets or sets the numeric Property specifying the length of the rectangleSensor.
* @memberof RectangleSensorGraphics.prototype
* @type {Property|undefined}
*/
length: createPropertyDescriptor("length"),
/**
* Gets or sets the numeric Property specifying the radius of the top of the rectangleSensor.
* @memberof RectangleSensorGraphics.prototype
* @type {Property|undefined}
*/
leftHalfAngle: createPropertyDescriptor("leftHalfAngle"),
/**
* Gets or sets the numeric Property specifying the radius of the bottom of the rectangleSensor.
* @memberof RectangleSensorGraphics.prototype
* @type {Property|undefined}
*/
rightHalfAngle: createPropertyDescriptor("rightHalfAngle"),
/**
* Gets or sets the numeric Property specifying the radius of the bottom of the rectangleSensor.
* @memberof RectangleSensorGraphics.prototype
* @type {Property|undefined}
*/
frontHalfAngle: createPropertyDescriptor("frontHalfAngle"),
/**
* Gets or sets the numeric Property specifying the radius of the bottom of the rectangleSensor.
* @memberof RectangleSensorGraphics.prototype
* @type {Property|undefined}
*/
backHalfAngle: createPropertyDescriptor("backHalfAngle"),
/**
* Gets or sets the Property specifying the {@link HeightReference}.
* @memberof RectangleSensorGraphics.prototype
* @type {Property|undefined}
* @default HeightReference.NONE
*/
heightReference: createPropertyDescriptor("heightReference"),
/**
* Gets or sets the boolean Property specifying whether the rectangleSensor is filled with the provided material.
* @memberof RectangleSensorGraphics.prototype
* @type {Property|undefined}
* @default true
*/
fill: createPropertyDescriptor("fill"),
/**
* Gets or sets the Property specifying the material used to fill the rectangleSensor.
* @memberof RectangleSensorGraphics.prototype
* @type {MaterialProperty|undefined}
* @default Color.WHITE
*/
material: createMaterialPropertyDescriptor("material"),
/**
* Gets or sets the boolean Property specifying whether the rectangleSensor is outlined.
* @memberof RectangleSensorGraphics.prototype
* @type {Property|undefined}
* @default false
*/
outline: createPropertyDescriptor("outline"),
/**
* Gets or sets the Property specifying the {@link Color} of the outline.
* @memberof RectangleSensorGraphics.prototype
* @type {Property|undefined}
* @default Color.BLACK
*/
outlineColor: createPropertyDescriptor("outlineColor"),
/**
* Gets or sets the numeric Property specifying the width of the outline.
* @memberof RectangleSensorGraphics.prototype
* @type {Property|undefined}
* @default 1.0
*/
outlineWidth: createPropertyDescriptor("outlineWidth"),
/**
* Gets or sets the Property specifying the number of vertical lines to draw along the perimeter for the outline.
* @memberof RectangleSensorGraphics.prototype
* @type {Property|undefined}
* @default 16
*/
numberOfVerticalLines: createPropertyDescriptor("numberOfVerticalLines"),
/**
* Gets or sets the Property specifying the number of edges around the perimeter of the rectangleSensor.
* @memberof RectangleSensorGraphics.prototype
* @type {Property|undefined}
* @default 128
*/
slices: createPropertyDescriptor("slices"),
/**
* Get or sets the enum Property specifying whether the rectangleSensor
* casts or receives shadows from light sources.
* @memberof RectangleSensorGraphics.prototype
* @type {Property|undefined}
* @default ShadowMode.DISABLED
*/
shadows: createPropertyDescriptor("shadows"),
/**
* Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this rectangleSensor will be displayed.
* @memberof RectangleSensorGraphics.prototype
* @type {Property|undefined}
*/
distanceDisplayCondition: createPropertyDescriptor(
"distanceDisplayCondition"
),
});
/**
* Duplicates this instance.
*
* @param {RectangleSensorGraphics} [result] The object onto which to store the result.
* @returns {RectangleSensorGraphics} The modified result parameter or a new instance if one was not provided.
*/
RectangleSensorGraphics.prototype.clone = function (result) {
if (!defined(result)) {
return new RectangleSensorGraphics(this);
}
result.show = this.show;
result.length = this.length;
result.leftHalfAngle = this.leftHalfAngle;
result.rightHalfAngle = this.rightHalfAngle;
result.frontHalfAngle = this.frontHalfAngle;
result.backHalfAngle = this.backHalfAngle;
result.heightReference = this.heightReference;
result.fill = this.fill;
result.material = this.material;
result.outline = this.outline;
result.outlineColor = this.outlineColor;
result.outlineWidth = this.outlineWidth;
result.numberOfVerticalLines = this.numberOfVerticalLines;
result.slices = this.slices;
result.shadows = this.shadows;
result.distanceDisplayCondition = this.distanceDisplayCondition;
return result;
};
/**
* Assigns each unassigned property on this object to the value
* of the same property on the provided source object.
*
* @param {RectangleSensorGraphics} source The object to be merged into this object.
*/
RectangleSensorGraphics.prototype.merge = function (source) {
//>>includeStart('debug', pragmas.debug);
if (!defined(source)) {
throw new DeveloperError("source is required.");
}
//>>includeEnd('debug');
this.show = defaultValue(this.show, source.show);
this.length = defaultValue(this.length, source.length);
this.leftHalfAngle = defaultValue(this.leftHalfAngle, source.leftHalfAngle);
this.rightHalfAngle = defaultValue(this.rightHalfAngle, source.rightHalfAngle);
this.frontHalfAngle = defaultValue(this.frontHalfAngle, source.frontHalfAngle);
this.backHalfAngle = defaultValue(this.backHalfAngle, source.backHalfAngle);
this.heightReference = defaultValue(
this.heightReference,
source.heightReference
);
this.fill = defaultValue(this.fill, source.fill);
this.material = defaultValue(this.material, source.material);
this.outline = defaultValue(this.outline, source.outline);
this.outlineColor = defaultValue(this.outlineColor, source.outlineColor);
this.outlineWidth = defaultValue(this.outlineWidth, source.outlineWidth);
this.numberOfVerticalLines = defaultValue(
this.numberOfVerticalLines,
source.numberOfVerticalLines
);
this.slices = defaultValue(this.slices, source.slices);
this.shadows = defaultValue(this.shadows, source.shadows);
this.distanceDisplayCondition = defaultValue(
this.distanceDisplayCondition,
source.distanceDisplayCondition
);
};
export default RectangleSensorGraphics;
|
import React from 'react'
export default () => (
<div>Say hi to the BioMediaLab Team!</div>
)
|
const tap = require('tap')
const Strings = require('./lib/index')
tap.test('normalizeLocale', t => {
t.strictEqual(Strings.normalizeLocale(), undefined)
t.strictEqual(Strings.normalizeLocale(null), undefined)
t.strictEqual(Strings.normalizeLocale(''), undefined)
t.strictEqual(Strings.normalizeLocale('en-US'), 'en-US')
t.strictEqual(Strings.normalizeLocale('en_US'), 'en-US')
t.strictEqual(Strings.normalizeLocale('fr-CH, fr;q=0.9, en;q=0.8, de;q=0.7, *;q=0.5'), 'fr-CH')
t.strictEqual(Strings.normalizeLocale('fr-CH,fr;q=0.9,en;q=0.8,de;q=0.7,*;q=0.5'), 'fr-CH')
t.strictEqual(Strings.normalizeLocale('fr,fr-CH;q=0.9,en;q=0.8,de;q=0.7,*;q=0.5'), 'fr')
t.strictEqual(Strings.normalizeLocale('fr ; q = 0.9 , en_US; q=1, en;q =1 ,*'), 'en-US')
t.strictEqual(Strings.normalizeLocale('*,en'), 'en')
t.strictEqual(Strings.normalizeLocale('*, en'), 'en')
t.strictEqual(Strings.normalizeLocale('* ,en'), 'en')
t.strictEqual(Strings.normalizeLocale('* ,en;q'), 'en')
t.strictEqual(Strings.normalizeLocale('* ,en;q='), 'en')
t.strictEqual(Strings.normalizeLocale('* ,en;q=0'), 'en')
t.strictEqual(Strings.normalizeLocale('*'), undefined)
t.strictEqual(Strings.normalizeLocale(['en;q=0.8', 'fr-CH, fr;q=0.9', 'de;q=0.7,*;q=0.5']), 'fr-CH')
t.strictEqual(Strings.normalizeLocale(['*', '', null, undefined, 'en;q=0.8']), 'en')
t.strictEqual(Strings.normalizeLocale(['*']), undefined)
t.strictEqual(Strings.normalizeLocale([]), undefined)
t.end()
})
tap.test('toUpper', t => {
t.strictEqual(Strings.toUpper(), '')
t.strictEqual(Strings.toUpper(null), '')
t.strictEqual(Strings.toUpper(''), '')
t.strictEqual(Strings.toUpper('abc'), 'ABC')
t.strictEqual(Strings.toUpper('abc', 'en-US'), 'ABC')
t.strictEqual(Strings.toUpper('abc', 'en_US'), 'ABC')
t.strictEqual(Strings.toUpper('abc', 'invalid locale'), 'ABC')
t.strictEqual(Strings.toUpper('abc', ['en-US', 'invalid locale']), 'ABC')
t.strictEqual(Strings.toUpper('лександра'), 'ЛЕКСАНДРА')
t.strictEqual(Strings.toUpper('łukasz'), 'ŁUKASZ')
t.end()
})
tap.test('toLower', t => {
t.strictEqual(Strings.toLower(), '')
t.strictEqual(Strings.toLower(null), '')
t.strictEqual(Strings.toLower(''), '')
t.strictEqual(Strings.toLower('ABC'), 'abc')
t.strictEqual(Strings.toLower('ABC', 'en-US'), 'abc')
t.strictEqual(Strings.toLower('ABC', 'en_US'), 'abc')
t.strictEqual(Strings.toLower('ABC', 'invalid locale'), 'abc')
t.strictEqual(Strings.toLower('ABC', ['en-US', 'invalid locale']), 'abc')
t.strictEqual(Strings.toLower('ЛЕКСАНДРА'), 'лександра')
t.strictEqual(Strings.toLower('ŁUKASZ'), 'łukasz')
t.end()
})
tap.test('toFirstLetterUpper', t => {
t.strictEqual(Strings.toFirstLetterUpper(), '')
t.strictEqual(Strings.toFirstLetterUpper(null), '')
t.strictEqual(Strings.toFirstLetterUpper(''), '')
t.strictEqual(Strings.toFirstLetterUpper('ABC'), 'ABC')
t.strictEqual(Strings.toFirstLetterUpper('1bc'), '1bc')
t.strictEqual(Strings.toFirstLetterUpper('abc'), 'Abc')
t.strictEqual(Strings.toFirstLetterUpper('abc', 'en-US'), 'Abc')
t.strictEqual(Strings.toFirstLetterUpper('abc', 'en_US'), 'Abc')
t.strictEqual(Strings.toFirstLetterUpper('abc', 'invalid locale'), 'Abc')
t.strictEqual(Strings.toFirstLetterUpper('abc', ['en-US', 'invalid locale']), 'Abc')
t.strictEqual(Strings.toFirstLetterUpper('abc de'), 'Abc de')
t.strictEqual(Strings.toFirstLetterUpper('a'), 'A')
t.strictEqual(Strings.toFirstLetterUpper('ab'), 'Ab')
t.strictEqual(Strings.toFirstLetterUpper('лександра'), 'Лександра')
t.strictEqual(Strings.toFirstLetterUpper('łukasz'), 'Łukasz')
t.end()
})
tap.test('isUpper', t => {
t.strictEqual(Strings.isUpper(), false)
t.strictEqual(Strings.isUpper(null), false)
t.strictEqual(Strings.isUpper(''), false)
t.strictEqual(Strings.isUpper('a'), false)
t.strictEqual(Strings.isUpper('A'), true)
t.strictEqual(Strings.isUpper('a', 'en-US'), false)
t.strictEqual(Strings.isUpper('A', 'en-US'), true)
t.strictEqual(Strings.isUpper('a', 'en_US'), false)
t.strictEqual(Strings.isUpper('A', 'en_US'), true)
t.strictEqual(Strings.isUpper('a', 'invalid locale'), false)
t.strictEqual(Strings.isUpper('A', 'invalid locale'), true)
t.strictEqual(Strings.isUpper('a', ['en-US', 'invalid locale']), false)
t.strictEqual(Strings.isUpper('A', ['en-US', 'invalid locale']), true)
t.strictEqual(Strings.isUpper('л'), false)
t.strictEqual(Strings.isUpper('ł'), false)
t.strictEqual(Strings.isUpper('Л'), true)
t.strictEqual(Strings.isUpper('Ł'), true)
t.end()
})
tap.test('toPlural', t => {
t.strictEqual(Strings.toPlural(), '')
t.strictEqual(Strings.toPlural(null), '')
t.strictEqual(Strings.toPlural(''), '')
t.strictEqual(Strings.toPlural('plan'), 'plans')
t.strictEqual(Strings.toPlural('PLAN'), 'PLANS')
t.strictEqual(Strings.toPlural('category'), 'categories')
t.strictEqual(Strings.toPlural('CATEGORY'), 'CATEGORIES')
t.strictEqual(Strings.toPlural('glass'), 'glasses')
t.strictEqual(Strings.toPlural('GLASS'), 'GLASSES')
t.strictEqual(Strings.toPlural('box'), 'boxes')
t.strictEqual(Strings.toPlural('BOX'), 'BOXES')
t.strictEqual(Strings.toPlural('batch'), 'batches')
t.strictEqual(Strings.toPlural('BATCH'), 'BATCHES')
t.strictEqual(Strings.toPlural('plan', {}), 'plans')
t.strictEqual(Strings.toPlural('plan', { locale: undefined }), 'plans')
t.strictEqual(Strings.toPlural('plan', { locale: null }), 'plans')
t.strictEqual(Strings.toPlural('plan', { locale: 'en-US' }), 'plans')
t.strictEqual(Strings.toPlural('plan', { locale: 'en_US' }), 'plans')
t.strictEqual(Strings.toPlural('plan', { locale: 'invalid locale' }), 'plans')
t.strictEqual(Strings.toPlural('plan', { locale: ['en-US', 'invalid locale'] }), 'plans')
t.strictEqual(Strings.toPlural('PLAN', { locale: 'en-US' }), 'PLANS')
t.strictEqual(Strings.toPlural('PLAN', { locale: 'en_US' }), 'PLANS')
t.strictEqual(Strings.toPlural('PLAN', { locale: 'invalid locale' }), 'PLANS')
t.strictEqual(Strings.toPlural('PLAN', { locale: ['en-US', 'invalid locale'] }), 'PLANS')
t.strictEqual(Strings.toPlural('plan', { suffix: 'tain' }), 'plantain')
t.strictEqual(Strings.toPlural('PLAN', { suffix: 'tain' }), 'PLANTAIN')
t.strictEqual(Strings.toPlural('plan', { locale: 'en-US', suffix: 'tain' }), 'plantain')
t.strictEqual(Strings.toPlural('PLAN', { locale: 'en-US', suffix: 'tain' }), 'PLANTAIN')
t.strictEqual(Strings.toPlural('plan', { locale: 'en_US', suffix: 'tain' }), 'plantain')
t.strictEqual(Strings.toPlural('PLAN', { locale: 'en_US', suffix: 'tain' }), 'PLANTAIN')
t.strictEqual(Strings.toPlural('plan', { locale: 'invalid locale', suffix: 'tain' }), 'plantain')
t.strictEqual(Strings.toPlural('PLAN', { locale: 'invalid locale', suffix: 'tain' }), 'PLANTAIN')
t.strictEqual(Strings.toPlural('plan', { locale: ['en-US', 'invalid locale'], suffix: 'tain' }), 'plantain')
t.end()
})
tap.test('formatInt', t => {
t.strictEqual(Strings.formatInt(), 'NaN')
t.strictEqual(Strings.formatInt(null), '0')
t.strictEqual(Strings.formatInt(0), '0')
t.strictEqual(Strings.formatInt(1), '1')
t.strictEqual(Strings.formatInt(2), '2')
t.strictEqual(Strings.formatInt(1234567), '1,234,567')
t.strictEqual(Strings.formatInt('x'), 'NaN')
t.strictEqual(Strings.formatInt('9e10'), '90,000,000,000')
t.strictEqual(Strings.formatInt(Infinity), '∞')
t.strictEqual(Strings.formatInt(null, 'en-US'), '0')
t.strictEqual(Strings.formatInt(0, 'en-US'), '0')
t.strictEqual(Strings.formatInt(1, 'en-US'), '1')
t.strictEqual(Strings.formatInt(2, 'en-US'), '2')
t.strictEqual(Strings.formatInt(1234567, 'en-US'), '1,234,567')
t.strictEqual(Strings.formatInt('x', 'en-US'), 'NaN')
t.strictEqual(Strings.formatInt('9e10', 'en-US'), '90,000,000,000')
t.strictEqual(Strings.formatInt(Infinity, 'en-US'), '∞')
t.strictEqual(Strings.formatInt(null, 'en_US'), '0')
t.strictEqual(Strings.formatInt(0, 'en_US'), '0')
t.strictEqual(Strings.formatInt(1, 'en_US'), '1')
t.strictEqual(Strings.formatInt(2, 'en_US'), '2')
t.strictEqual(Strings.formatInt(1234567, 'en_US'), '1,234,567')
t.strictEqual(Strings.formatInt('x', 'en_US'), 'NaN')
t.strictEqual(Strings.formatInt('9e10', 'en_US'), '90,000,000,000')
t.strictEqual(Strings.formatInt(Infinity, 'en-US'), '∞')
t.strictEqual(Strings.formatInt(null, 'invalid locale'), 'null')
t.strictEqual(Strings.formatInt(0, 'invalid locale'), '0')
t.strictEqual(Strings.formatInt(1, 'invalid locale'), '1')
t.strictEqual(Strings.formatInt(2, 'invalid locale'), '2')
t.strictEqual(Strings.formatInt(1234567, 'invalid locale'), '1234567')
t.strictEqual(Strings.formatInt('x', 'invalid locale'), 'x')
t.strictEqual(Strings.formatInt('9e10', 'invalid locale'), '9e10')
t.strictEqual(Strings.formatInt(Infinity, 'invalid locale'), 'Infinity')
t.strictEqual(Strings.formatInt(1234567, ['en_US', 'invalid locale']), '1,234,567')
t.end()
})
tap.test('pluralize', t => {
t.strictEqual(Strings.pluralize(), '')
t.strictEqual(Strings.pluralize(null), '')
t.strictEqual(Strings.pluralize(''), '')
t.strictEqual(Strings.pluralize(1), '')
t.strictEqual(Strings.pluralize(0), '')
t.strictEqual(Strings.pluralize(2), '')
t.strictEqual(Strings.pluralize(1, null), '')
t.strictEqual(Strings.pluralize(1, ''), '')
t.strictEqual(Strings.pluralize(1, 'guy'), '1 guy')
t.strictEqual(Strings.pluralize(0, 'guy'), '0 guies')
t.strictEqual(Strings.pluralize(2, 'guy'), '2 guies')
t.strictEqual(Strings.pluralize(1000, 'guy'), '1,000 guies')
t.strictEqual(Strings.pluralize(1, 'GUY'), '1 GUY')
t.strictEqual(Strings.pluralize(0, 'GUY'), '0 GUIES')
t.strictEqual(Strings.pluralize(2, 'GUY'), '2 GUIES')
t.strictEqual(Strings.pluralize(1000, 'GUY'), '1,000 GUIES')
t.strictEqual(Strings.pluralize(1, 'guy', 's'), '1 guy')
t.strictEqual(Strings.pluralize(0, 'guy', 's'), '0 guys')
t.strictEqual(Strings.pluralize(2, 'guy', 's'), '2 guys')
t.strictEqual(Strings.pluralize(1000, 'guy', 's'), '1,000 guys')
t.strictEqual(Strings.pluralize(1, 'GUY', 's'), '1 GUY')
t.strictEqual(Strings.pluralize(0, 'GUY', 's'), '0 GUYS')
t.strictEqual(Strings.pluralize(2, 'GUY', 's'), '2 GUYS')
t.strictEqual(Strings.pluralize(1000, 'GUY', 's'), '1,000 GUYS')
t.strictEqual(Strings.pluralize(1, 'guy', {}), '1 guy')
t.strictEqual(Strings.pluralize(2, 'guy', {}), '2 guies')
t.strictEqual(Strings.pluralize(1, 'guy', { locale: 'en-US' }), '1 guy')
t.strictEqual(Strings.pluralize(0, 'guy', { locale: 'en-US' }), '0 guies')
t.strictEqual(Strings.pluralize(2, 'guy', { locale: 'en-US' }), '2 guies')
t.strictEqual(Strings.pluralize(1000, 'guy', { locale: 'en-US' }), '1,000 guies')
t.strictEqual(Strings.pluralize(1, 'GUY', { locale: 'en-US' }), '1 GUY')
t.strictEqual(Strings.pluralize(0, 'GUY', { locale: 'en-US' }), '0 GUIES')
t.strictEqual(Strings.pluralize(2, 'GUY', { locale: 'en-US' }), '2 GUIES')
t.strictEqual(Strings.pluralize(1000, 'GUY', { locale: 'en-US' }), '1,000 GUIES')
t.strictEqual(Strings.pluralize(1, 'guy', { locale: 'en_US' }), '1 guy')
t.strictEqual(Strings.pluralize(0, 'guy', { locale: 'en_US' }), '0 guies')
t.strictEqual(Strings.pluralize(2, 'guy', { locale: 'en_US' }), '2 guies')
t.strictEqual(Strings.pluralize(1000, 'guy', { locale: 'en_US' }), '1,000 guies')
t.strictEqual(Strings.pluralize(1, 'GUY', { locale: 'en_US' }), '1 GUY')
t.strictEqual(Strings.pluralize(0, 'GUY', { locale: 'en_US' }), '0 GUIES')
t.strictEqual(Strings.pluralize(2, 'GUY', { locale: 'en_US' }), '2 GUIES')
t.strictEqual(Strings.pluralize(1000, 'GUY', { locale: 'en_US' }), '1,000 GUIES')
t.strictEqual(Strings.pluralize(1, 'guy', { locale: 'invalid locale' }), '1 guy')
t.strictEqual(Strings.pluralize(0, 'guy', { locale: 'invalid locale' }), '0 guies')
t.strictEqual(Strings.pluralize(2, 'guy', { locale: 'invalid locale' }), '2 guies')
t.strictEqual(Strings.pluralize(1000, 'guy', { locale: 'invalid locale' }), '1000 guies')
t.strictEqual(Strings.pluralize(1, 'GUY', { locale: 'invalid locale' }), '1 GUY')
t.strictEqual(Strings.pluralize(0, 'GUY', { locale: 'invalid locale' }), '0 GUIES')
t.strictEqual(Strings.pluralize(2, 'GUY', { locale: 'invalid locale' }), '2 GUIES')
t.strictEqual(Strings.pluralize(1000, 'GUY', { locale: 'invalid locale' }), '1000 GUIES')
t.strictEqual(Strings.pluralize(1, 'guy', { suffix: 's' }), '1 guy')
t.strictEqual(Strings.pluralize(0, 'guy', { suffix: 's' }), '0 guys')
t.strictEqual(Strings.pluralize(2, 'guy', { suffix: 's' }), '2 guys')
t.strictEqual(Strings.pluralize(1000, 'guy', { suffix: 's' }), '1,000 guys')
t.strictEqual(Strings.pluralize(1, 'GUY', { suffix: 's' }), '1 GUY')
t.strictEqual(Strings.pluralize(0, 'GUY', { suffix: 's' }), '0 GUYS')
t.strictEqual(Strings.pluralize(2, 'GUY', { suffix: 's' }), '2 GUYS')
t.strictEqual(Strings.pluralize(1000, 'GUY', { suffix: 's' }), '1,000 GUYS')
t.strictEqual(Strings.pluralize(1, 'guy', { suffix: 's', locale: 'en-US' }), '1 guy')
t.strictEqual(Strings.pluralize(0, 'guy', { suffix: 's', locale: 'en-US' }), '0 guys')
t.strictEqual(Strings.pluralize(2, 'guy', { suffix: 's', locale: 'en-US' }), '2 guys')
t.strictEqual(Strings.pluralize(1000, 'guy', { suffix: 's', locale: 'en-US' }), '1,000 guys')
t.strictEqual(Strings.pluralize(1, 'GUY', { suffix: 's', locale: 'en-US' }), '1 GUY')
t.strictEqual(Strings.pluralize(0, 'GUY', { suffix: 's', locale: 'en-US' }), '0 GUYS')
t.strictEqual(Strings.pluralize(2, 'GUY', { suffix: 's', locale: 'en-US' }), '2 GUYS')
t.strictEqual(Strings.pluralize(1000, 'GUY', { suffix: 's', locale: 'en-US' }), '1,000 GUYS')
t.strictEqual(Strings.pluralize(1000, 'guy', { suffix: 's', locale: 'invalid locale' }), '1000 guys')
t.strictEqual(Strings.pluralize(1000, 'GUY', { suffix: 's', locale: 'invalid locale' }), '1000 GUYS')
t.strictEqual(Strings.pluralize(1000, 'guy', { suffix: 's', locale: ['en-US', 'invalid locale'] }), '1,000 guys')
t.strictEqual(Strings.pluralize('2', 'plan'), '2 plans')
t.strictEqual(Strings.pluralize('xyz', 'plan'), '0 plans')
t.strictEqual(Strings.pluralize(1, 'person', { plural: 'people' }), '1 person')
t.strictEqual(Strings.pluralize(1, 'person', { other: 'people' }), '1 person')
t.strictEqual(Strings.pluralize(1000, 'person', { plural: 'people' }), '1,000 people')
t.strictEqual(Strings.pluralize(1000, 'person', { other: 'people' }), '1,000 people')
t.strictEqual(Strings.pluralize(1, 'PERSON', { plural: 'people' }), '1 PERSON')
t.strictEqual(Strings.pluralize(1, 'PERSON', { other: 'people' }), '1 PERSON')
t.strictEqual(Strings.pluralize(1000, 'PERSON', { plural: 'people' }), '1,000 people')
t.strictEqual(Strings.pluralize(1000, 'PERSON', { other: 'people' }), '1,000 people')
t.strictEqual(Strings.pluralize(1000, 'PERSON', { plural: 'PEOPLE' }), '1,000 PEOPLE')
t.strictEqual(Strings.pluralize(1000, 'PERSON', { other: 'PEOPLE' }), '1,000 PEOPLE')
t.strictEqual(Strings.pluralize(1, 'fly', { includeCount: false }), 'fly')
t.strictEqual(Strings.pluralize(0, 'fly', { includeCount: false }), 'flies')
t.strictEqual(Strings.pluralize(2, 'fly', { includeCount: false }), 'flies')
t.strictEqual(Strings.pluralize(1, 'guy', { suffix: 's', includeCount: false }), 'guy')
t.strictEqual(Strings.pluralize(0, 'guy', { suffix: 's', includeCount: false }), 'guys')
t.strictEqual(Strings.pluralize(2, 'guy', { suffix: 's', includeCount: false }), 'guys')
t.strictEqual(Strings.pluralize(1, 'needs', { plural: 'need', includeCount: false }), 'needs')
t.strictEqual(Strings.pluralize(1, 'needs', { other: 'need', includeCount: false }), 'needs')
t.strictEqual(Strings.pluralize(1000, 'needs', { plural: 'need', includeCount: false }), 'need')
t.strictEqual(Strings.pluralize(1000, 'needs', { other: 'need', includeCount: false }), 'need')
t.end()
})
tap.test('isVowel', t => {
t.strictEqual(Strings.isVowel(), false)
t.strictEqual(Strings.isVowel(null), false)
t.strictEqual(Strings.isVowel(''), false)
t.strictEqual(Strings.isVowel('s'), false)
t.strictEqual(Strings.isVowel('S'), false)
t.strictEqual(Strings.isVowel('a'), true)
t.strictEqual(Strings.isVowel('A'), true)
t.strictEqual(Strings.isVowel('e'), true)
t.strictEqual(Strings.isVowel('E'), true)
t.strictEqual(Strings.isVowel('i'), true)
t.strictEqual(Strings.isVowel('I'), true)
t.strictEqual(Strings.isVowel('o'), true)
t.strictEqual(Strings.isVowel('O'), true)
t.strictEqual(Strings.isVowel('u'), true)
t.strictEqual(Strings.isVowel('U'), true)
t.strictEqual(Strings.isVowel('y'), true)
t.strictEqual(Strings.isVowel('Y'), true)
t.strictEqual(Strings.isVowel('y', false), false)
t.strictEqual(Strings.isVowel('Y', false), false)
t.strictEqual(Strings.isVowel('abc'), true) // acts like "contains vowel"
t.strictEqual(Strings.isVowel('cab'), true) // acts like "contains vowel"
t.strictEqual(Strings.isVowel(0), false)
t.strictEqual(Strings.isVowel(1), false)
t.strictEqual(Strings.isVowel(2), false)
t.end()
})
tap.test('startsWithVowel', t => {
t.strictEqual(Strings.startsWithVowel(), false)
t.strictEqual(Strings.startsWithVowel(null), false)
t.strictEqual(Strings.startsWithVowel(''), false)
t.strictEqual(Strings.startsWithVowel('sale'), false)
t.strictEqual(Strings.startsWithVowel('Sale'), false)
t.strictEqual(Strings.startsWithVowel('event'), true)
t.strictEqual(Strings.startsWithVowel('Event'), true)
t.strictEqual(Strings.startsWithVowel('yard'), false)
t.strictEqual(Strings.startsWithVowel('Yard'), false)
t.end()
})
tap.test('withArticle', t => {
t.strictEqual(Strings.withArticle(), '')
t.strictEqual(Strings.withArticle(null), '')
t.strictEqual(Strings.withArticle(''), '')
t.strictEqual(Strings.withArticle('sale'), 'a sale')
t.strictEqual(Strings.withArticle('Sale'), 'A Sale')
t.strictEqual(Strings.withArticle('event'), 'an event')
t.strictEqual(Strings.withArticle('Event'), 'An Event')
t.strictEqual(Strings.withArticle('sale', { consonant: 'the', vowel: 'the' }), 'the sale')
t.strictEqual(Strings.withArticle('event', { consonant: 'the', vowel: 'the' }), 'the event')
t.strictEqual(Strings.withArticle('Sale', { consonant: 'the', vowel: 'the' }), 'The Sale')
t.strictEqual(Strings.withArticle('Event', { consonant: 'the', vowel: 'the' }), 'The Event')
t.strictEqual(Strings.withArticle('yard'), 'a yard')
t.strictEqual(Strings.withArticle('Yard'), 'A Yard')
t.end()
})
tap.test('abbreviate', t => {
t.strictEqual(Strings.abbreviate(), '')
t.strictEqual(Strings.abbreviate(null), '')
t.strictEqual(Strings.abbreviate(''), '')
t.strictEqual(Strings.abbreviate('one'), 'one')
t.strictEqual(Strings.abbreviate('one', 2), 'on')
t.strictEqual(Strings.abbreviate('one', '2'), 'on')
t.strictEqual(Strings.abbreviate('one', 4), 'one')
t.strictEqual(Strings.abbreviate('one', '4'), 'one')
t.strictEqual(Strings.abbreviate('one', 'x'), 'one')
t.strictEqual(Strings.abbreviate('one', null), 'one')
t.strictEqual(Strings.abbreviate('one two'), 'ot')
t.strictEqual(Strings.abbreviate('one two three'), 'ott')
t.strictEqual(Strings.abbreviate('One Two Three'), 'OTT')
t.strictEqual(Strings.abbreviate('One Two Three'), 'OTT')
t.strictEqual(Strings.abbreviate(' One Two Three '), 'OTT')
t.strictEqual(Strings.abbreviate('gross-margin'), 'gm')
t.strictEqual(Strings.abbreviate('gross_margin'), 'gm')
t.strictEqual(Strings.abbreviate('gross+margin'), 'gm')
t.strictEqual(Strings.abbreviate('gross.margin'), 'gm')
t.strictEqual(Strings.abbreviate('gross,margin'), 'gm')
t.strictEqual(Strings.abbreviate('AMOUNT'), 'AMT')
t.strictEqual(Strings.abbreviate('AMOUNT', 2), 'AM')
t.strictEqual(Strings.abbreviate('AMOUNT', 5), 'AMNT')
t.strictEqual(Strings.abbreviate('AMOUNT', 0), 'AMT')
t.strictEqual(Strings.abbreviate('AMOUNT', -1), 'AMT')
t.strictEqual(Strings.abbreviate('MARGIN'), 'MGN')
t.strictEqual(Strings.abbreviate('REPORT'), 'RPT')
t.strictEqual(Strings.abbreviate('MEMBER'), 'MBR')
t.strictEqual(Strings.abbreviate('PAYMENT'), 'PMT')
t.strictEqual(Strings.abbreviate('COMMISSION'), 'COM')
t.strictEqual(Strings.abbreviate('BONUS'), 'BNS')
t.strictEqual(Strings.abbreviate('VOLUME'), 'VOL')
t.strictEqual(Strings.abbreviate('Volume', 6), 'Volume')
t.strictEqual(Strings.abbreviate('annual'), 'ann')
t.strictEqual(Strings.abbreviate('contract'), 'cnt')
t.strictEqual(Strings.abbreviate('value'), 'val')
t.strictEqual(Strings.abbreviate('extended'), 'ext')
t.strictEqual(Strings.abbreviate('annual', 4), 'annl')
t.strictEqual(Strings.abbreviate('contract', 4), 'cntr')
t.strictEqual(Strings.abbreviate('revenue'), 'rev')
t.end()
})
const strings = {
[Strings.GROSS_MARGIN]: {
singular: 'Profit',
plural: 'Profit'
},
[Strings.PLAN]: 'Program',
[Strings.QUOTA]: {
one: 'Plan',
other: 'Plans'
},
[Strings.REPORT]: {
one: 'report',
other: 'reports'
}
}
const invalidKey = 'invalid_key'
tap.test('static get', t => {
t.strictEqual(Strings.get(), '')
t.strictEqual(Strings.get(null), '')
t.strictEqual(Strings.get(''), '')
// 1st arg string as key (only works for default values)
t.strictEqual(Strings.get(Strings.GROSS_MARGIN), 'Gross Margin')
t.strictEqual(Strings.get(Strings.ANNUAL_CONTRACT_VALUE), 'Annual Contract Value')
t.strictEqual(Strings.get(invalidKey), '')
// two interchangeable args: strings object and key string
t.strictEqual(Strings.get(strings, Strings.GROSS_MARGIN), 'Profit')
t.strictEqual(Strings.get(Strings.GROSS_MARGIN, strings), 'Profit')
t.strictEqual(Strings.get(strings, Strings.ANNUAL_CONTRACT_VALUE), 'Annual Contract Value')
t.strictEqual(Strings.get(Strings.ANNUAL_CONTRACT_VALUE, strings), 'Annual Contract Value')
t.strictEqual(Strings.get(strings, invalidKey), '')
t.strictEqual(Strings.get(invalidKey, strings), '')
// 3rd arg boolean for plural
t.strictEqual(Strings.get(strings, Strings.GROSS_MARGIN, false), 'Profit')
t.strictEqual(Strings.get(Strings.GROSS_MARGIN, strings, false), 'Profit')
t.strictEqual(Strings.get(strings, Strings.GROSS_MARGIN, true), 'Profit')
t.strictEqual(Strings.get(Strings.GROSS_MARGIN, strings, true), 'Profit')
t.strictEqual(Strings.get(strings, Strings.PLAN, false), 'Program')
t.strictEqual(Strings.get(Strings.PLAN, strings, false), 'Program')
t.strictEqual(Strings.get(strings, Strings.PLAN, true), 'Programs')
t.strictEqual(Strings.get(Strings.PLAN, strings, true), 'Programs')
t.strictEqual(Strings.get(strings, Strings.QUOTA, false), 'Plan')
t.strictEqual(Strings.get(Strings.QUOTA, strings, false), 'Plan')
t.strictEqual(Strings.get(strings, Strings.QUOTA, true), 'Plans')
t.strictEqual(Strings.get(Strings.QUOTA, strings, true), 'Plans')
t.strictEqual(Strings.get(strings, Strings.ANNUAL_CONTRACT_VALUE, false), 'Annual Contract Value')
t.strictEqual(Strings.get(Strings.ANNUAL_CONTRACT_VALUE, strings, false), 'Annual Contract Value')
t.strictEqual(Strings.get(strings, Strings.ANNUAL_CONTRACT_VALUE, true), 'Annual Contract Value')
t.strictEqual(Strings.get(Strings.ANNUAL_CONTRACT_VALUE, strings, true), 'Annual Contract Value')
t.strictEqual(Strings.get(strings, invalidKey, false), '')
t.strictEqual(Strings.get(invalidKey, strings, false), '')
t.strictEqual(Strings.get(strings, invalidKey, true), '')
t.strictEqual(Strings.get(invalidKey, strings, true), '')
// 3rd arg number as count
t.strictEqual(Strings.get(strings, Strings.GROSS_MARGIN, 1), 'Profit')
t.strictEqual(Strings.get(Strings.GROSS_MARGIN, strings, 1), 'Profit')
t.strictEqual(Strings.get(strings, Strings.GROSS_MARGIN, 0), 'Profit')
t.strictEqual(Strings.get(Strings.GROSS_MARGIN, strings, 0), 'Profit')
t.strictEqual(Strings.get(strings, Strings.GROSS_MARGIN, 2), 'Profit')
t.strictEqual(Strings.get(Strings.GROSS_MARGIN, strings, 2), 'Profit')
t.strictEqual(Strings.get(strings, Strings.PLAN, 1), 'Program')
t.strictEqual(Strings.get(Strings.PLAN, strings, 1), 'Program')
t.strictEqual(Strings.get(strings, Strings.PLAN, 0), 'Programs')
t.strictEqual(Strings.get(Strings.PLAN, strings, 0), 'Programs')
t.strictEqual(Strings.get(strings, Strings.PLAN, 2), 'Programs')
t.strictEqual(Strings.get(Strings.PLAN, strings, 2), 'Programs')
t.strictEqual(Strings.get(strings, Strings.QUOTA, 1), 'Plan')
t.strictEqual(Strings.get(Strings.QUOTA, strings, 1), 'Plan')
t.strictEqual(Strings.get(strings, Strings.QUOTA, 0), 'Plans')
t.strictEqual(Strings.get(Strings.QUOTA, strings, 0), 'Plans')
t.strictEqual(Strings.get(strings, Strings.QUOTA, 2), 'Plans')
t.strictEqual(Strings.get(Strings.QUOTA, strings, 2), 'Plans')
t.strictEqual(Strings.get(strings, Strings.ANNUAL_CONTRACT_VALUE, 1), 'Annual Contract Value')
t.strictEqual(Strings.get(Strings.ANNUAL_CONTRACT_VALUE, strings, 1), 'Annual Contract Value')
t.strictEqual(Strings.get(strings, Strings.ANNUAL_CONTRACT_VALUE, 0), 'Annual Contract Value')
t.strictEqual(Strings.get(Strings.ANNUAL_CONTRACT_VALUE, strings, 0), 'Annual Contract Value')
t.strictEqual(Strings.get(strings, Strings.ANNUAL_CONTRACT_VALUE, 2), 'Annual Contract Value')
t.strictEqual(Strings.get(Strings.ANNUAL_CONTRACT_VALUE, strings, 2), 'Annual Contract Value')
t.strictEqual(Strings.get(strings, invalidKey, 1), '')
t.strictEqual(Strings.get(invalidKey, strings, 1), '')
t.strictEqual(Strings.get(strings, invalidKey, 0), '')
t.strictEqual(Strings.get(invalidKey, strings, 0), '')
t.strictEqual(Strings.get(strings, invalidKey, 2), '')
t.strictEqual(Strings.get(invalidKey, strings, 2), '')
// 3rd arg object as opts with plural boolean and lc boolean
t.strictEqual(Strings.get(strings, Strings.GROSS_MARGIN, { plural: false, lc: true }), 'profit')
t.strictEqual(Strings.get(Strings.GROSS_MARGIN, strings, { plural: false, lc: true }), 'profit')
t.strictEqual(Strings.get(strings, Strings.GROSS_MARGIN, { plural: true, lc: true }), 'profit')
t.strictEqual(Strings.get(Strings.GROSS_MARGIN, strings, { plural: true, lc: true }), 'profit')
t.strictEqual(Strings.get(strings, Strings.PLAN, { plural: false, lc: true }), 'program')
t.strictEqual(Strings.get(Strings.PLAN, strings, { plural: false, lc: true }), 'program')
t.strictEqual(Strings.get(strings, Strings.PLAN, { plural: true, lc: true }), 'programs')
t.strictEqual(Strings.get(Strings.PLAN, strings, { plural: true, lc: true }), 'programs')
t.strictEqual(Strings.get(strings, Strings.QUOTA, { plural: false, lc: true }), 'plan')
t.strictEqual(Strings.get(Strings.QUOTA, strings, { plural: false, lc: true }), 'plan')
t.strictEqual(Strings.get(strings, Strings.QUOTA, { plural: true, lc: true }), 'plans')
t.strictEqual(Strings.get(Strings.QUOTA, strings, { plural: true, lc: true }), 'plans')
t.strictEqual(Strings.get(strings, Strings.ANNUAL_CONTRACT_VALUE, { plural: false, lc: true }), 'annual contract value')
t.strictEqual(Strings.get(Strings.ANNUAL_CONTRACT_VALUE, strings, { plural: false, lc: true }), 'annual contract value')
t.strictEqual(Strings.get(strings, Strings.ANNUAL_CONTRACT_VALUE, { plural: true, lc: true }), 'annual contract value')
t.strictEqual(Strings.get(Strings.ANNUAL_CONTRACT_VALUE, strings, { plural: true, lc: true }), 'annual contract value')
t.strictEqual(Strings.get(strings, invalidKey, { plural: false, lc: true }), '')
t.strictEqual(Strings.get(invalidKey, strings, { plural: false, lc: true }), '')
t.strictEqual(Strings.get(strings, invalidKey, { plural: true, lc: true }), '')
t.strictEqual(Strings.get(invalidKey, strings, { plural: true, lc: true }), '')
// 3rd arg object as opts with plural boolean and flu boolean
t.strictEqual(Strings.get(strings, Strings.REPORT, { plural: false, flu: true }), 'Report')
t.strictEqual(Strings.get(Strings.REPORT, strings, { plural: false, flu: true }), 'Report')
t.strictEqual(Strings.get(strings, Strings.REPORT, { plural: true, flu: true }), 'Reports')
t.strictEqual(Strings.get(Strings.REPORT, strings, { plural: true, flu: true }), 'Reports')
t.strictEqual(Strings.get(strings, Strings.REPORT, { plural: false, flu: false }), 'report')
t.strictEqual(Strings.get(Strings.REPORT, strings, { plural: false, flu: false }), 'report')
t.strictEqual(Strings.get(strings, Strings.REPORT, { plural: true, flu: false }), 'reports')
t.strictEqual(Strings.get(Strings.REPORT, strings, { plural: true, flu: false }), 'reports')
t.strictEqual(Strings.get(strings, invalidKey, { plural: false, flu: true }), '')
t.strictEqual(Strings.get(invalidKey, strings, { plural: false, flu: true }), '')
t.strictEqual(Strings.get(strings, invalidKey, { plural: true, flu: true }), '')
t.strictEqual(Strings.get(invalidKey, strings, { plural: true, flu: true }), '')
// 3rd arg opts object with count number and locale string
t.strictEqual(Strings.get(strings, Strings.GROSS_MARGIN, { count: 1, locale: 'en-US' }), 'Profit')
t.strictEqual(Strings.get(Strings.GROSS_MARGIN, strings, { count: 1, locale: 'en_US' }), 'Profit')
t.strictEqual(Strings.get(strings, Strings.GROSS_MARGIN, { count: 0, locale: 'en_US' }), 'Profit')
t.strictEqual(Strings.get(Strings.GROSS_MARGIN, strings, { count: 0, locale: 'en-US' }), 'Profit')
t.strictEqual(Strings.get(strings, Strings.GROSS_MARGIN, { count: 2, locale: 'en_US' }), 'Profit')
t.strictEqual(Strings.get(Strings.GROSS_MARGIN, strings, { count: 2, locale: 'en-US' }), 'Profit')
t.strictEqual(Strings.get(strings, Strings.PLAN, { count: 1, locale: 'en-US' }), 'Program')
t.strictEqual(Strings.get(Strings.PLAN, strings, { count: 1, locale: 'en_US' }), 'Program')
t.strictEqual(Strings.get(strings, Strings.PLAN, { count: 0, locale: 'en_US' }), 'Programs')
t.strictEqual(Strings.get(Strings.PLAN, strings, { count: 0, locale: 'en-US' }), 'Programs')
t.strictEqual(Strings.get(strings, Strings.PLAN, { count: 2, locale: 'en_US' }), 'Programs')
t.strictEqual(Strings.get(Strings.PLAN, strings, { count: 2, locale: 'en-US' }), 'Programs')
t.strictEqual(Strings.get(strings, Strings.QUOTA, { count: 1, locale: 'en-US' }), 'Plan')
t.strictEqual(Strings.get(Strings.QUOTA, strings, { count: 1, locale: 'en_US' }), 'Plan')
t.strictEqual(Strings.get(strings, Strings.QUOTA, { count: 0, locale: 'en_US' }), 'Plans')
t.strictEqual(Strings.get(Strings.QUOTA, strings, { count: 0, locale: 'en-US' }), 'Plans')
t.strictEqual(Strings.get(strings, Strings.QUOTA, { count: 2, locale: 'en_US' }), 'Plans')
t.strictEqual(Strings.get(Strings.QUOTA, strings, { count: 2, locale: 'en-US' }), 'Plans')
t.strictEqual(Strings.get(strings, Strings.ANNUAL_CONTRACT_VALUE, { count: 1, locale: 'en-US' }), 'Annual Contract Value')
t.strictEqual(Strings.get(Strings.ANNUAL_CONTRACT_VALUE, strings, { count: 1, locale: 'en_US' }), 'Annual Contract Value')
t.strictEqual(Strings.get(strings, Strings.ANNUAL_CONTRACT_VALUE, { count: 0, locale: 'en_US' }), 'Annual Contract Value')
t.strictEqual(Strings.get(Strings.ANNUAL_CONTRACT_VALUE, strings, { count: 0, locale: 'en-US' }), 'Annual Contract Value')
t.strictEqual(Strings.get(strings, Strings.ANNUAL_CONTRACT_VALUE, { count: 2, locale: 'en_US' }), 'Annual Contract Value')
t.strictEqual(Strings.get(Strings.ANNUAL_CONTRACT_VALUE, strings, { count: 2, locale: 'en-US' }), 'Annual Contract Value')
t.strictEqual(Strings.get(strings, invalidKey, { count: 1, locale: 'en-US' }), '')
t.strictEqual(Strings.get(invalidKey, strings, { count: 1, locale: 'en_US' }), '')
t.strictEqual(Strings.get(strings, invalidKey, { count: 0, locale: 'en_US' }), '')
t.strictEqual(Strings.get(invalidKey, strings, { count: 0, locale: 'en-US' }), '')
t.strictEqual(Strings.get(strings, invalidKey, { count: 2, locale: 'en_US' }), '')
t.strictEqual(Strings.get(invalidKey, strings, { count: 2, locale: 'en-US' }), '')
t.strictEqual(Strings.get(strings, Strings.PLAN, { count: 2, locale: ['en_US', 'invalid locale'] }), 'Programs')
// 3rd arg opts object with uc boolean and abbrev boolean
t.strictEqual(Strings.get(strings, Strings.GROSS_MARGIN, { uc: true, abbrev: true }), 'PFT')
t.strictEqual(Strings.get(Strings.GROSS_MARGIN, strings, { uc: true, abbrev: true }), 'PFT')
t.strictEqual(Strings.get(strings, Strings.ANNUAL_CONTRACT_VALUE, { uc: true, abbrev: true }), 'ACV')
t.strictEqual(Strings.get(Strings.ANNUAL_CONTRACT_VALUE, strings, { uc: true, abbrev: true }), 'ACV')
t.strictEqual(Strings.get(strings, invalidKey, { uc: true, abbrev: true }), '')
t.strictEqual(Strings.get(invalidKey, strings, { uc: true, abbrev: true }), '')
// suffix to customize auto-pluralization
t.strictEqual(Strings.get(null, 'guy', { count: 2, suffix: 's', strict: false }), 'guys')
t.strictEqual(Strings.get('guy', null, { count: 2, suffix: 's', strict: false }), 'guys')
// min/max
t.strictEqual(Strings.get(strings, Strings.GROSS_MARGIN, { min: 3, max: 6 }), 'Profit') // max here means no abbreviation necessary
t.strictEqual(Strings.get(Strings.GROSS_MARGIN, strings, { min: 3, max: 6 }), 'Profit')
t.strictEqual(Strings.get(strings, Strings.GROSS_MARGIN, { min: 3, max: 5 }), 'Pft')
t.strictEqual(Strings.get(strings, Strings.GROSS_MARGIN, { min: 4, max: 5 }), 'Prft')
t.strictEqual(Strings.get(strings, Strings.ANNUAL_CONTRACT_VALUE, { min: 4, max: 5 }), 'ACV') // min does not apply to multi-word abbreviations
t.strictEqual(Strings.get(strings, Strings.PLAN, { min: 3, max: 6 }), 'Prg')
t.strictEqual(Strings.get(strings, Strings.QUOTA, { min: 3, max: 6, count: 1 }), 'Plan')
t.strictEqual(Strings.get(strings, Strings.QUOTA, { min: 3, max: 6, count: 2 }), 'Plans')
t.strictEqual(Strings.get(strings, Strings.QUOTA, { min: 3, max: 3, count: 1 }), 'Pln')
t.strictEqual(Strings.get(strings, Strings.QUOTA, { min: 3, max: 3, count: 2 }), 'Pln')
t.strictEqual(Strings.get(strings, Strings.QUOTA, { min: 4, max: 4, count: 2 }), 'Plns')
// includeCount option
t.strictEqual(Strings.get(strings, Strings.SALE, { count: 1, includeCount: true }), '1 Sale')
t.strictEqual(Strings.get(strings, Strings.SALE, { count: 0, includeCount: true }), '0 Sales')
t.strictEqual(Strings.get(strings, Strings.SALE, { count: 1234, includeCount: true }), '1,234 Sales')
t.strictEqual(Strings.get(null, 'guy', { count: 1, includeCount: true, suffix: 's', strict: false }), '1 guy')
t.strictEqual(Strings.get(null, 'guy', { count: 0, includeCount: true, suffix: 's', strict: false }), '0 guys')
t.strictEqual(Strings.get(null, 'guy', { count: 12345, includeCount: true, suffix: 's', strict: false }), '12,345 guys')
t.strictEqual(Strings.get(strings, Strings.SALE, { count: 1, includeCount: true, uc: true, abbrev: true }), '1 SAL')
t.strictEqual(Strings.get(strings, Strings.SALE, { count: 0, includeCount: true, uc: true, abbrev: true }), '0 SLS')
t.strictEqual(Strings.get(strings, Strings.SALE, { count: 123456, includeCount: true, uc: true, abbrev: true }), '123,456 SLS')
t.strictEqual(Strings.get(strings, Strings.QUOTA, { count: 1, includeCount: true, lc: true }), '1 plan')
t.strictEqual(Strings.get(strings, Strings.QUOTA, { count: 0, includeCount: true, lc: true }), '0 plans')
t.strictEqual(Strings.get(strings, Strings.QUOTA, { count: 1234567, includeCount: true, lc: true }), '1,234,567 plans')
t.strictEqual(Strings.get(strings, Strings.PLAN, { count: 1, includeCount: true, min: 6, max: 6 }), '1 Prgrm')
t.strictEqual(Strings.get(strings, Strings.PLAN, { count: 0, includeCount: true, min: 6, max: 6 }), '0 Prgrms')
t.strictEqual(Strings.get(strings, Strings.PLAN, { count: 123, includeCount: true, min: 6, max: 6 }), '123 Prgrms')
// includeCount ignored if count is not given
t.strictEqual(Strings.get(strings, Strings.PRODUCT, { plural: true, includeCount: true, lc: true }), 'products')
// includeCount ignored if count is not a number
t.strictEqual(Strings.get(strings, Strings.SALE, { count: '1234', includeCount: true }), 'Sale')
// includeCount can also be false
t.strictEqual(Strings.get(strings, Strings.SALE, { count: 1, includeCount: false }), 'Sale')
t.strictEqual(Strings.get(strings, Strings.SALE, { count: 0, includeCount: false }), 'Sales')
t.strictEqual(Strings.get(strings, Strings.SALE, { count: 1234, includeCount: false }), 'Sales')
// withArticle
t.strictEqual(Strings.get(strings, Strings.ADJUSTMENT, { withArticle: true }), 'An Adjustment')
t.strictEqual(Strings.get(strings, Strings.SALE, { withArticle: true }), 'A Sale')
t.strictEqual(Strings.get(strings, Strings.ADJUSTMENT, { withArticle: true, lc: true }), 'an adjustment')
t.strictEqual(Strings.get(strings, Strings.SALE, { withArticle: true, lc: true }), 'a sale')
t.strictEqual(Strings.get(strings, Strings.ADJUSTMENT, { withArticle: true, consonant: 'the', vowel: 'the' }), 'The Adjustment')
t.strictEqual(Strings.get(strings, Strings.SALE, { withArticle: true, consonant: 'the', vowel: 'the' }), 'The Sale')
t.strictEqual(Strings.get(strings, Strings.ADJUSTMENT, { withArticle: true, lc: true, consonant: 'the', vowel: 'the' }), 'the adjustment')
t.strictEqual(Strings.get(strings, Strings.SALE, { withArticle: true, lc: true, consonant: 'the', vowel: 'the' }), 'the sale')
const p = {
person: {
plural: 'people'
}
}
t.strictEqual(Strings.get(p, 'person', { count: 1, strict: false }), 'person') // strict=false will fallback to key as singular
t.strictEqual(Strings.get(p, 'person', { count: 2 }), 'people')
// strings object supports wrapper
const wrapper = {
locale: 'en_US',
strings
}
t.strictEqual(Strings.get(wrapper, Strings.GROSS_MARGIN), 'Profit')
t.strictEqual(Strings.get(Strings.GROSS_MARGIN, wrapper), 'Profit')
t.end()
})
tap.test('static getSingular', t => {
t.strictEqual(Strings.getSingular(), '')
t.strictEqual(Strings.getSingular(null), '')
t.strictEqual(Strings.getSingular(''), '')
t.strictEqual(Strings.getSingular(Strings.GROSS_MARGIN), 'Gross Margin')
t.strictEqual(Strings.getSingular(Strings.UNIT), 'Unit')
t.strictEqual(Strings.getSingular(strings, Strings.GROSS_MARGIN), 'Profit')
t.strictEqual(Strings.getSingular(Strings.GROSS_MARGIN, strings), 'Profit')
t.strictEqual(Strings.getSingular(strings, Strings.PLAN), 'Program')
t.strictEqual(Strings.getSingular(Strings.PLAN, strings), 'Program')
t.strictEqual(Strings.getSingular(strings, Strings.QUOTA), 'Plan')
t.strictEqual(Strings.getSingular(Strings.QUOTA, strings), 'Plan')
t.strictEqual(Strings.getSingular(strings, Strings.ANNUAL_CONTRACT_VALUE), 'Annual Contract Value')
t.strictEqual(Strings.getSingular(Strings.ANNUAL_CONTRACT_VALUE, strings), 'Annual Contract Value')
t.strictEqual(Strings.getSingular(strings, invalidKey), '')
t.strictEqual(Strings.getSingular(invalidKey, strings), '')
t.strictEqual(Strings.getSingular(strings, Strings.GROSS_MARGIN, { lc: true }), 'profit')
t.strictEqual(Strings.getSingular(Strings.GROSS_MARGIN, strings, { lc: true }), 'profit')
t.strictEqual(Strings.getSingular(strings, Strings.PLAN, { lc: true }), 'program')
t.strictEqual(Strings.getSingular(Strings.PLAN, strings, { lc: true }), 'program')
t.strictEqual(Strings.getSingular(strings, Strings.ANNUAL_CONTRACT_VALUE, { lc: true, abbrev: true }), 'acv')
t.strictEqual(Strings.getSingular(Strings.ANNUAL_CONTRACT_VALUE, strings, { lc: true, abbrev: true }), 'acv')
t.strictEqual(Strings.getSingular(strings, Strings.REPORT, { flu: true }), 'Report')
t.strictEqual(Strings.getSingular(Strings.REPORT, strings, { flu: true }), 'Report')
t.end()
})
tap.test('static getPlural', t => {
t.strictEqual(Strings.getPlural(), '')
t.strictEqual(Strings.getPlural(null), '')
t.strictEqual(Strings.getPlural(''), '')
t.strictEqual(Strings.getPlural(Strings.GROSS_MARGIN), 'Gross Margin')
t.strictEqual(Strings.getPlural(Strings.UNIT), 'Units')
t.strictEqual(Strings.getPlural(strings, Strings.GROSS_MARGIN), 'Profit')
t.strictEqual(Strings.getPlural(Strings.GROSS_MARGIN, strings), 'Profit')
t.strictEqual(Strings.getPlural(strings, Strings.PLAN), 'Programs')
t.strictEqual(Strings.getPlural(Strings.PLAN, strings), 'Programs')
t.strictEqual(Strings.getPlural(strings, Strings.QUOTA), 'Plans')
t.strictEqual(Strings.getPlural(Strings.QUOTA, strings), 'Plans')
t.strictEqual(Strings.getPlural(strings, Strings.ANNUAL_CONTRACT_VALUE), 'Annual Contract Value')
t.strictEqual(Strings.getPlural(Strings.ANNUAL_CONTRACT_VALUE, strings), 'Annual Contract Value')
t.strictEqual(Strings.getPlural(strings, invalidKey), '')
t.strictEqual(Strings.getPlural(invalidKey, strings), '')
t.strictEqual(Strings.getPlural(strings, Strings.GROSS_MARGIN, { lc: true }), 'profit')
t.strictEqual(Strings.getPlural(Strings.GROSS_MARGIN, strings, { lc: true }), 'profit')
t.strictEqual(Strings.getPlural(strings, Strings.PLAN, { lc: true }), 'programs')
t.strictEqual(Strings.getPlural(Strings.PLAN, strings, { lc: true }), 'programs')
t.strictEqual(Strings.getPlural(strings, Strings.ANNUAL_CONTRACT_VALUE, { lc: true, abbrev: true }), 'acv')
t.strictEqual(Strings.getPlural(Strings.ANNUAL_CONTRACT_VALUE, strings, { lc: true, abbrev: true }), 'acv')
t.strictEqual(Strings.getPlural(strings, Strings.REPORT, { flu: true }), 'Reports')
t.strictEqual(Strings.getPlural(Strings.REPORT, strings, { flu: true }), 'Reports')
t.end()
})
tap.test('instance get', t => {
const d = Strings.wrap()
const s = Strings.wrap(strings)
t.strictEqual(d.get(), '')
t.strictEqual(s.get(), '')
t.strictEqual(d.get(null), '')
t.strictEqual(s.get(null), '')
t.strictEqual(d.get(''), '')
t.strictEqual(s.get(''), '')
// 1st arg string as key
t.strictEqual(d.get(Strings.GROSS_MARGIN), 'Gross Margin')
t.strictEqual(s.get(Strings.GROSS_MARGIN), 'Profit')
t.strictEqual(d.get(Strings.ANNUAL_CONTRACT_VALUE), 'Annual Contract Value')
t.strictEqual(s.get(Strings.ANNUAL_CONTRACT_VALUE), 'Annual Contract Value')
t.strictEqual(d.get(invalidKey), '')
t.strictEqual(s.get(invalidKey), '')
// 2nd arg plural boolean
t.strictEqual(d.get(Strings.GROSS_MARGIN, false), 'Gross Margin')
t.strictEqual(s.get(Strings.GROSS_MARGIN, false), 'Profit')
t.strictEqual(d.get(Strings.GROSS_MARGIN, true), 'Gross Margin')
t.strictEqual(s.get(Strings.GROSS_MARGIN, true), 'Profit')
t.strictEqual(d.get(Strings.PLAN, false), 'Plan')
t.strictEqual(s.get(Strings.PLAN, false), 'Program')
t.strictEqual(d.get(Strings.PLAN, true), 'Plans')
t.strictEqual(s.get(Strings.PLAN, true), 'Programs')
t.strictEqual(d.get(Strings.QUOTA, false), 'Quota')
t.strictEqual(s.get(Strings.QUOTA, false), 'Plan')
t.strictEqual(d.get(Strings.QUOTA, true), 'Quotas')
t.strictEqual(s.get(Strings.QUOTA, true), 'Plans')
t.strictEqual(d.get(Strings.ANNUAL_CONTRACT_VALUE, false), 'Annual Contract Value')
t.strictEqual(s.get(Strings.ANNUAL_CONTRACT_VALUE, false), 'Annual Contract Value')
t.strictEqual(d.get(Strings.ANNUAL_CONTRACT_VALUE, true), 'Annual Contract Value')
t.strictEqual(s.get(Strings.ANNUAL_CONTRACT_VALUE, true), 'Annual Contract Value')
t.strictEqual(d.get(invalidKey, false), '')
t.strictEqual(s.get(invalidKey, false), '')
t.strictEqual(d.get(invalidKey, true), '')
t.strictEqual(s.get(invalidKey, true), '')
// 2nd arg count number
t.strictEqual(d.get(Strings.GROSS_MARGIN, 1), 'Gross Margin')
t.strictEqual(s.get(Strings.GROSS_MARGIN, 1), 'Profit')
t.strictEqual(d.get(Strings.GROSS_MARGIN, 0), 'Gross Margin')
t.strictEqual(s.get(Strings.GROSS_MARGIN, 0), 'Profit')
t.strictEqual(d.get(Strings.GROSS_MARGIN, 2), 'Gross Margin')
t.strictEqual(s.get(Strings.GROSS_MARGIN, 2), 'Profit')
t.strictEqual(d.get(Strings.PLAN, 1), 'Plan')
t.strictEqual(s.get(Strings.PLAN, 1), 'Program')
t.strictEqual(d.get(Strings.PLAN, 0), 'Plans')
t.strictEqual(s.get(Strings.PLAN, 0), 'Programs')
t.strictEqual(d.get(Strings.PLAN, 2), 'Plans')
t.strictEqual(s.get(Strings.PLAN, 2), 'Programs')
t.strictEqual(d.get(Strings.QUOTA, 1), 'Quota')
t.strictEqual(s.get(Strings.QUOTA, 1), 'Plan')
t.strictEqual(d.get(Strings.QUOTA, 0), 'Quotas')
t.strictEqual(s.get(Strings.QUOTA, 0), 'Plans')
t.strictEqual(d.get(Strings.QUOTA, 2), 'Quotas')
t.strictEqual(s.get(Strings.QUOTA, 2), 'Plans')
t.strictEqual(d.get(Strings.ANNUAL_CONTRACT_VALUE, 1), 'Annual Contract Value')
t.strictEqual(s.get(Strings.ANNUAL_CONTRACT_VALUE, 1), 'Annual Contract Value')
t.strictEqual(d.get(Strings.ANNUAL_CONTRACT_VALUE, 0), 'Annual Contract Value')
t.strictEqual(s.get(Strings.ANNUAL_CONTRACT_VALUE, 0), 'Annual Contract Value')
t.strictEqual(d.get(Strings.ANNUAL_CONTRACT_VALUE, 2), 'Annual Contract Value')
t.strictEqual(s.get(Strings.ANNUAL_CONTRACT_VALUE, 2), 'Annual Contract Value')
t.strictEqual(d.get(invalidKey, 1), '')
t.strictEqual(s.get(invalidKey, 1), '')
t.strictEqual(d.get(invalidKey, 0), '')
t.strictEqual(s.get(invalidKey, 0), '')
t.strictEqual(d.get(invalidKey, 2), '')
t.strictEqual(s.get(invalidKey, 2), '')
// 2nd arg opts object with plural boolean and uc boolean
t.strictEqual(d.get(Strings.GROSS_MARGIN, { plural: false, uc: true }), 'GROSS MARGIN')
t.strictEqual(s.get(Strings.GROSS_MARGIN, { plural: false, uc: true }), 'PROFIT')
t.strictEqual(d.get(Strings.GROSS_MARGIN, { plural: true, uc: true }), 'GROSS MARGIN')
t.strictEqual(s.get(Strings.GROSS_MARGIN, { plural: true, uc: true }), 'PROFIT')
t.strictEqual(d.get(Strings.PLAN, { plural: false, uc: true }), 'PLAN')
t.strictEqual(s.get(Strings.PLAN, { plural: false, uc: true }), 'PROGRAM')
t.strictEqual(d.get(Strings.PLAN, { plural: true, uc: true }), 'PLANS')
t.strictEqual(s.get(Strings.PLAN, { plural: true, uc: true }), 'PROGRAMS')
t.strictEqual(d.get(Strings.QUOTA, { plural: false, uc: true }), 'QUOTA')
t.strictEqual(s.get(Strings.QUOTA, { plural: false, uc: true }), 'PLAN')
t.strictEqual(d.get(Strings.QUOTA, { plural: true, uc: true }), 'QUOTAS')
t.strictEqual(s.get(Strings.QUOTA, { plural: true, uc: true }), 'PLANS')
t.strictEqual(d.get(Strings.ANNUAL_CONTRACT_VALUE, { plural: false, uc: true }), 'ANNUAL CONTRACT VALUE')
t.strictEqual(s.get(Strings.ANNUAL_CONTRACT_VALUE, { plural: false, uc: true }), 'ANNUAL CONTRACT VALUE')
t.strictEqual(d.get(Strings.ANNUAL_CONTRACT_VALUE, { plural: true, uc: true }), 'ANNUAL CONTRACT VALUE')
t.strictEqual(s.get(Strings.ANNUAL_CONTRACT_VALUE, { plural: true, uc: true }), 'ANNUAL CONTRACT VALUE')
t.strictEqual(d.get(invalidKey, { plural: false, uc: true }), '')
t.strictEqual(s.get(invalidKey, { plural: false, uc: true }), '')
t.strictEqual(d.get(invalidKey, { plural: true, uc: true }), '')
t.strictEqual(s.get(invalidKey, { plural: true, uc: true }), '')
// 2nd arg opts object with count number and lc boolean
t.strictEqual(d.get(Strings.GROSS_MARGIN, { count: 1, lc: true }), 'gross margin')
t.strictEqual(s.get(Strings.GROSS_MARGIN, { count: 1, lc: true }), 'profit')
t.strictEqual(d.get(Strings.GROSS_MARGIN, { count: 0, lc: true }), 'gross margin')
t.strictEqual(s.get(Strings.GROSS_MARGIN, { count: 0, lc: true }), 'profit')
t.strictEqual(d.get(Strings.GROSS_MARGIN, { count: 2, lc: true }), 'gross margin')
t.strictEqual(s.get(Strings.GROSS_MARGIN, { count: 2, lc: true }), 'profit')
t.strictEqual(d.get(Strings.PLAN, { count: 1, lc: true }), 'plan')
t.strictEqual(s.get(Strings.PLAN, { count: 1, lc: true }), 'program')
t.strictEqual(d.get(Strings.PLAN, { count: 0, lc: true }), 'plans')
t.strictEqual(s.get(Strings.PLAN, { count: 0, lc: true }), 'programs')
t.strictEqual(d.get(Strings.PLAN, { count: 2, lc: true }), 'plans')
t.strictEqual(s.get(Strings.PLAN, { count: 2, lc: true }), 'programs')
t.strictEqual(d.get(Strings.QUOTA, { count: 1, lc: true }), 'quota')
t.strictEqual(s.get(Strings.QUOTA, { count: 1, lc: true }), 'plan')
t.strictEqual(d.get(Strings.QUOTA, { count: 0, lc: true }), 'quotas')
t.strictEqual(s.get(Strings.QUOTA, { count: 0, lc: true }), 'plans')
t.strictEqual(d.get(Strings.QUOTA, { count: 2, lc: true }), 'quotas')
t.strictEqual(s.get(Strings.QUOTA, { count: 2, lc: true }), 'plans')
t.strictEqual(d.get(Strings.ANNUAL_CONTRACT_VALUE, { count: 1, lc: true }), 'annual contract value')
t.strictEqual(s.get(Strings.ANNUAL_CONTRACT_VALUE, { count: 1, lc: true }), 'annual contract value')
t.strictEqual(d.get(Strings.ANNUAL_CONTRACT_VALUE, { count: 0, lc: true }), 'annual contract value')
t.strictEqual(s.get(Strings.ANNUAL_CONTRACT_VALUE, { count: 0, lc: true }), 'annual contract value')
t.strictEqual(d.get(Strings.ANNUAL_CONTRACT_VALUE, { count: 2, lc: true }), 'annual contract value')
t.strictEqual(s.get(Strings.ANNUAL_CONTRACT_VALUE, { count: 2, lc: true }), 'annual contract value')
t.strictEqual(d.get(invalidKey, { count: 1, lc: true }), '')
t.strictEqual(s.get(invalidKey, { count: 1, lc: true }), '')
t.strictEqual(d.get(invalidKey, { count: 0, lc: true }), '')
t.strictEqual(s.get(invalidKey, { count: 0, lc: true }), '')
t.strictEqual(d.get(invalidKey, { count: 2, lc: true }), '')
t.strictEqual(s.get(invalidKey, { count: 2, lc: true }), '')
// 2nd arg opts object with abbrev boolean
t.strictEqual(d.get(Strings.GROSS_MARGIN, { abbrev: true }), 'GM')
t.strictEqual(s.get(Strings.GROSS_MARGIN, { abbrev: true }), 'Pft')
t.strictEqual(d.get(Strings.ANNUAL_CONTRACT_VALUE, { abbrev: true }), 'ACV')
t.strictEqual(s.get(Strings.ANNUAL_CONTRACT_VALUE, { abbrev: true }), 'ACV')
// 2rd arg object as opts with plural boolean and flu boolean
t.strictEqual(d.get(Strings.REPORT, { plural: false, flu: true }), 'Report')
t.strictEqual(s.get(Strings.REPORT, { plural: false, flu: true }), 'Report')
t.strictEqual(d.get(Strings.REPORT, { plural: true, flu: true }), 'Reports')
t.strictEqual(s.get(Strings.REPORT, { plural: true, flu: true }), 'Reports')
t.strictEqual(d.get(Strings.REPORT, { plural: false, flu: false }), 'Report')
t.strictEqual(s.get(Strings.REPORT, { plural: false, flu: false }), 'report')
t.strictEqual(d.get(Strings.REPORT, { plural: true, flu: false }), 'Reports')
t.strictEqual(s.get(Strings.REPORT, { plural: true, flu: false }), 'reports')
t.strictEqual(d.get(invalidKey, strings, { plural: false, flu: true }), '')
t.strictEqual(s.get(invalidKey, strings, { plural: false, flu: true }), '')
t.strictEqual(d.get(invalidKey, strings, { plural: true, flu: true }), '')
t.strictEqual(s.get(invalidKey, strings, { plural: true, flu: true }), '')
// min/max
t.strictEqual(d.get(Strings.GROSS_MARGIN, { min: 3, max: 6 }), 'GM') // min not used for mult-word
t.strictEqual(s.get(Strings.GROSS_MARGIN, { min: 3, max: 6 }), 'Profit') // max allows for full value
t.strictEqual(s.get(Strings.GROSS_MARGIN, { min: 3, max: 5 }), 'Pft')
t.strictEqual(s.get(Strings.GROSS_MARGIN, { min: 4, max: 5 }), 'Prft')
t.end()
})
tap.test('instance getSingular', t => {
const d = Strings.wrap()
const s = Strings.wrap(strings)
t.strictEqual(d.getSingular(), '')
t.strictEqual(s.getSingular(), '')
t.strictEqual(d.getSingular(null), '')
t.strictEqual(s.getSingular(null), '')
t.strictEqual(d.getSingular(''), '')
t.strictEqual(s.getSingular(''), '')
t.strictEqual(d.getSingular(Strings.GROSS_MARGIN), 'Gross Margin')
t.strictEqual(s.getSingular(Strings.GROSS_MARGIN), 'Profit')
t.strictEqual(d.getSingular(Strings.PLAN), 'Plan')
t.strictEqual(s.getSingular(Strings.PLAN), 'Program')
t.strictEqual(d.getSingular(Strings.QUOTA), 'Quota')
t.strictEqual(s.getSingular(Strings.QUOTA), 'Plan')
t.strictEqual(d.getSingular(Strings.ANNUAL_CONTRACT_VALUE), 'Annual Contract Value')
t.strictEqual(s.getSingular(Strings.ANNUAL_CONTRACT_VALUE), 'Annual Contract Value')
t.strictEqual(d.getSingular(invalidKey), '')
t.strictEqual(s.getSingular(invalidKey), '')
t.strictEqual(d.getSingular(Strings.GROSS_MARGIN, { uc: true }), 'GROSS MARGIN')
t.strictEqual(s.getSingular(Strings.GROSS_MARGIN, { uc: true }), 'PROFIT')
t.strictEqual(d.getSingular(Strings.GROSS_MARGIN, { uc: true, abbrev: true }), 'GM')
t.strictEqual(s.getSingular(Strings.GROSS_MARGIN, { uc: true, abbrev: true }), 'PFT')
t.strictEqual(d.getSingular(Strings.REPORT, { flu: true }), 'Report')
t.strictEqual(s.getSingular(Strings.REPORT, { flu: true }), 'Report')
t.end()
})
tap.test('instance getPlural', t => {
const d = Strings.wrap()
const s = Strings.wrap(strings)
t.strictEqual(d.getPlural(), '')
t.strictEqual(s.getPlural(), '')
t.strictEqual(d.getPlural(null), '')
t.strictEqual(s.getPlural(null), '')
t.strictEqual(d.getPlural(''), '')
t.strictEqual(s.getPlural(''), '')
t.strictEqual(d.getPlural(Strings.GROSS_MARGIN), 'Gross Margin')
t.strictEqual(s.getPlural(Strings.GROSS_MARGIN), 'Profit')
t.strictEqual(d.getPlural(Strings.PLAN), 'Plans')
t.strictEqual(s.getPlural(Strings.PLAN), 'Programs')
t.strictEqual(d.getPlural(Strings.QUOTA), 'Quotas')
t.strictEqual(s.getPlural(Strings.QUOTA), 'Plans')
t.strictEqual(d.getPlural(Strings.ANNUAL_CONTRACT_VALUE), 'Annual Contract Value')
t.strictEqual(s.getPlural(Strings.ANNUAL_CONTRACT_VALUE), 'Annual Contract Value')
t.strictEqual(d.getPlural(invalidKey), '')
t.strictEqual(s.getPlural(invalidKey), '')
t.strictEqual(d.getPlural(Strings.PLAN, { lc: true }), 'plans')
t.strictEqual(s.getPlural(Strings.PLAN, { lc: true }), 'programs')
t.strictEqual(d.getPlural(Strings.REPORT, { flu: true }), 'Reports')
t.strictEqual(s.getPlural(Strings.REPORT, { flu: true }), 'Reports')
t.end()
})
tap.test('extra cases', t => {
const w = Strings.wrap({
locale: ['en-US,en-AU;q=0.8', '*'],
strings: {
[Strings.PRODUCT]: {
singular: 'Product'
},
[Strings.CATEGORY]: {
one: 'Category'
},
[Strings.UNIT]: {}
}
})
t.strictEqual(w.getPlural(Strings.PRODUCT), 'Products')
t.strictEqual(w.getPlural(Strings.CATEGORY), 'Categories')
t.strictEqual(w.getPlural(Strings.UNIT), '')
t.end()
})
tap.test('defaults', t => {
const d = Strings.wrap()
// kpis
t.strictEqual(d.getSingular(Strings.GROSS_MARGIN), 'Gross Margin')
t.strictEqual(d.getPlural(Strings.GROSS_MARGIN), 'Gross Margin')
t.strictEqual(d.getSingular(Strings.GROSS_MARGIN, { abbrev: true }), 'GM')
t.strictEqual(d.getSingular(Strings.EXTENDED_AMOUNT), 'Extended Amount')
t.strictEqual(d.getPlural(Strings.EXTENDED_AMOUNT), 'Extended Amount')
t.strictEqual(d.getSingular(Strings.EXTENDED_AMOUNT, { abbrev: true }), 'EA')
t.strictEqual(d.getSingular(Strings.ANNUAL_CONTRACT_VALUE), 'Annual Contract Value')
t.strictEqual(d.getPlural(Strings.ANNUAL_CONTRACT_VALUE), 'Annual Contract Value')
t.strictEqual(d.getSingular(Strings.ANNUAL_CONTRACT_VALUE, { abbrev: true }), 'ACV')
t.strictEqual(d.getSingular(Strings.VOLUME), 'Volume')
t.strictEqual(d.getPlural(Strings.VOLUME), 'Volume')
t.strictEqual(d.getSingular(Strings.VOLUME, { abbrev: true }), 'Vol')
t.strictEqual(d.getSingular(Strings.UNIT), 'Unit')
t.strictEqual(d.getPlural(Strings.UNIT), 'Units')
t.strictEqual(d.getSingular(Strings.UNIT, { abbrev: true }), 'Unt')
// others
t.strictEqual(d.getSingular(Strings.PRODUCT), 'Product')
t.strictEqual(d.getPlural(Strings.PRODUCT), 'Products')
t.strictEqual(d.getSingular(Strings.CATEGORY), 'Category')
t.strictEqual(d.getPlural(Strings.CATEGORY), 'Categories')
t.strictEqual(d.getSingular(Strings.PLAN), 'Plan')
t.strictEqual(d.getPlural(Strings.PLAN), 'Plans')
t.strictEqual(d.getSingular(Strings.QUOTA), 'Quota')
t.strictEqual(d.getPlural(Strings.QUOTA), 'Quotas')
t.strictEqual(d.getSingular(Strings.RULE), 'Rule')
t.strictEqual(d.getPlural(Strings.RULE), 'Rules')
t.strictEqual(d.getSingular(Strings.SALE), 'Sale')
t.strictEqual(d.getPlural(Strings.SALE), 'Sales')
t.strictEqual(d.getSingular(Strings.COMPENSATION), 'Compensation')
t.strictEqual(d.getPlural(Strings.COMPENSATION), 'Compensation')
t.strictEqual(d.getSingular(Strings.REPORT), 'Report')
t.strictEqual(d.getPlural(Strings.REPORT), 'Reports')
t.strictEqual(d.getSingular(Strings.DRAFT), 'Draft')
t.strictEqual(d.getPlural(Strings.DRAFT), 'Draft')
t.strictEqual(d.getSingular(Strings.PUBLISHED), 'Published')
t.strictEqual(d.getPlural(Strings.PUBLISHED), 'Published')
t.strictEqual(d.getSingular(Strings.CLOSED), 'Closed')
t.strictEqual(d.getPlural(Strings.CLOSED), 'Closed')
t.strictEqual(d.getSingular(Strings.DISPUTE), 'Dispute')
t.strictEqual(d.getPlural(Strings.DISPUTE), 'Disputes')
t.strictEqual(d.getSingular(Strings.MEMBER), 'Member')
t.strictEqual(d.getPlural(Strings.MEMBER), 'Members')
t.strictEqual(d.getSingular(Strings.REP), 'Rep')
t.strictEqual(d.getPlural(Strings.REP), 'Reps')
t.strictEqual(d.getSingular(Strings.TEAM), 'Team')
t.strictEqual(d.getPlural(Strings.TEAM), 'Teams')
t.strictEqual(d.getSingular(Strings.ADJUSTMENT), 'Adjustment')
t.strictEqual(d.getPlural(Strings.ADJUSTMENT), 'Adjustments')
t.strictEqual(d.getSingular(Strings.BATCH), 'Batch')
t.strictEqual(d.getPlural(Strings.BATCH), 'Batches')
t.end()
})
|
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2018 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* Returns an object containing dimensions of the Text object.
*/
var GetTextSize = function (text, size, lines)
{
var canvas = text.canvas;
var context = text.context;
var style = text.style;
var lineWidths = [];
var maxLineWidth = 0;
var drawnLines = lines.length;
if (style.maxLines > 0 && style.maxLines < lines.length)
{
drawnLines = style.maxLines;
}
style.syncFont(canvas, context);
// Text Width
for (var i = 0; i < drawnLines; i++)
{
var lineWidth = style.strokeThickness;
lineWidth += context.measureText(lines[i]).width;
// Adjust for wrapped text
if (style.wordWrap)
{
lineWidth -= context.measureText(' ').width;
}
lineWidths[i] = Math.ceil(lineWidth);
maxLineWidth = Math.max(maxLineWidth, lineWidths[i]);
}
// Text Height
var lineHeight = size.fontSize + style.strokeThickness;
var height = lineHeight * drawnLines;
var lineSpacing = text._lineSpacing || 0;
if (lineSpacing < 0 && Math.abs(lineSpacing) > lineHeight)
{
lineSpacing = -lineHeight;
}
// Adjust for line spacing
if (lineSpacing !== 0)
{
height += (lineSpacing > 0) ? lineSpacing * lines.length : lineSpacing * (lines.length - 1);
}
return {
width: maxLineWidth,
height: height,
lines: drawnLines,
lineWidths: lineWidths,
lineSpacing: lineSpacing,
lineHeight: lineHeight
};
};
module.exports = GetTextSize;
|
class ExtendedButton extends HTMLButtonElement
{
constructor()
{
super();
}
set caption(value)
{
/*use "this" because the shadow root was already defined
in HTMLButttonElement*/
this.innerText = value;
}
set tooltip(value)
{
this.title = value;
}
insertStyleFile(styleFile)
{
this.appendChild( document.createElement('style') );
this.styleSheets[0].insertRule("@import '"+styleFile+"'");
}
// connectedCallback()
// {
// }
//
// disconnectedCallback()
// {
// }
}
//Registration of web component:
/*
https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry/define
Parameters of customElements.define:
-name: Name for the new custom element. Note that custom element names must
contain a hyphen.
-constructor: Constructor for the new custom element.
-options: (Optional) Object that controls how the element is defined. One option
is currently supported:
*extends: String specifying the name of a built-in element
to extend. Used to create a customized built-in element.
*/
customElements.define('wc-extended-button', ExtendedButton, { extends: 'button' });
//export module
export { ExtendedButton };
|
/*!
* filename: ej.pivot.common.min.js
* version : 19.4.0.55
* Copyright Syncfusion Inc. 2001 - 2022. All rights reserved.
* Use of this code is subject to the terms of our license.
* A copy of the current license can be obtained at any time by e-mailing
* licensing@syncfusion.com. Any infringement will be prosecuted under
* applicable laws.
*/
(function(n){typeof define=="function"&&define.amd?define(["./../common/ej.core.min"],n):n()})(function(){ej.Pivot=ej.Pivot||{},function(n,t,r){t.Pivot={addReportItem:function(n,i){var r,u;if(i.isMeasuresDropped)i.droppedClass!=""?n.values[0].axis=i.droppedClass=="row"?"rows":i.droppedClass=="column"?"columns":n.values[0].axis:n.values[0].measures=[];else{r=this.removeReportItem(n,i.droppedFieldName,i.isMeasuresDropped);t.isNullOrUndefined(r)&&(r={fieldName:i.droppedFieldName,fieldCaption:i.droppedFieldCaption,format:i.droppedFieldFormat,formatString:i.droppedFieldFormatString,showSubTotal:i.droppedFieldShowSubTotal,expression:i.droppedExpression,hierarchyUniqueName:i.droppedHierarchyUniqueName,summaryType:i.summaryType});for(u in r)(u=="format"||u=="formatString")&&(t.isNullOrUndefined(r[u])||r[u]=="")&&delete r[u];switch(i.droppedClass){case"row":i.droppedPosition.toString()!=""?n.rows.splice(i.droppedPosition,0,r):n.rows.push(r);break;case"column":i.droppedPosition.toString()!=""?n.columns.splice(i.droppedPosition,0,r):n.columns.push(r);break;case"value":n.cube==""?i.droppedPosition.toString()!=""?n.values.splice(i.droppedPosition,0,r):n.values.push(r):i.droppedPosition.toString()!=""?n.values[0].measures.splice(i.droppedPosition,0,r):n.values[0].measures.push(r);break;case"filter":i.droppedPosition.toString()!=""?n.filters.splice(i.droppedPosition,0,r):n.filters.push(r)}}},removeReportItem:function(i,r,u){var o=i.cube==""?t.Pivot.AnalysisMode.Pivot:t.Pivot.AnalysisMode.Olap,f=n.grep(i.columns,function(n){return n.fieldName==r}),e;return u?i.values[0].measures=[]:f.length>0?i.columns=n.grep(i.columns,function(n){return n.fieldName!=r}):(f=n.grep(i.rows,function(n){return n.fieldName==r}),f.length>0?i.rows=n.grep(i.rows,function(n){return n.fieldName!=r}):(e=o==t.Pivot.AnalysisMode.Olap?i.values[0].measures:i.values,f=n.grep(e,function(n){return n.fieldName==r}),f.length>0?i.values=o==t.Pivot.AnalysisMode.Olap?[{measures:n.grep(e,function(n){return n.fieldName!=r}),axis:i.values[0].axis}]:n.grep(e,function(n){return n.fieldName!=r}):(f=n.grep(i.filters,function(n){return n.fieldName==r}),f.length>0&&(i.filters=n.grep(i.filters,function(n){return n.fieldName!=r}))))),f[0]},getReportItemByFieldName:function(i,r){var f="columns",u=n.grep(r.columns,function(n){return n.fieldName.toLowerCase()==i.toLowerCase()}),e;return u.length==0&&(u=n.grep(r.rows,function(n){return n.fieldName.toLowerCase()==i.toLowerCase()}),f="rows"),u.length==0&&(e=r.cube==""?r.values:r.values.length>0&&!t.isNullOrUndefined(r.values[0].measures)?r.values[0].measures:[],u=n.grep(e,function(n){return n.fieldName.toLowerCase()==i.toLowerCase()}),f="values"),u.length==0&&(u=n.grep(r.filters,function(n){return n.fieldName.toLowerCase()==i.toLowerCase()}),f="filters"),{item:u[0],axis:f}},getReportItemByFieldCaption:function(i,r){var f="columns",u=n.grep(r.columns,function(n){return n.fieldCaption.toLowerCase()==i.toLowerCase()}),e;return u.length==0&&(u=n.grep(r.rows,function(n){return n.fieldCaption.toLowerCase()==i.toLowerCase()}),f="rows"),u.length==0&&(e=r.cube==""?r.values:r.values.length>0&&!t.isNullOrUndefined(r.values[0].measures)?r.values[0].measures:[],u=n.grep(e,function(n){return n.fieldCaption.toLowerCase()==i.toLowerCase()}),f="values"),u.length==0&&(u=n.grep(r.filters,function(n){return n.fieldCaption.toLowerCase()==i.toLowerCase()}),f="filters"),{item:u[0],axis:f}},closePreventPanel:function(i){var r=i.type!="close"?i:this;r.element.find("[id^='preventDiv']").remove();t.isNullOrUndefined(r.model.pivotControl)||t.isNullOrUndefined(r.model.pivotControl.element)?r._currentReportItems=n.extend(!0,[],r._savedReportItems):(r.model.pivotControl.element.find("[id^='preventDiv']").remove(),r.model.pivotControl._currentReportItems=n.extend(!0,[],r.model.pivotControl._savedReportItems));t.isNullOrUndefined(r._waitingPopup)||r._waitingPopup.hide();t.isNullOrUndefined(r.model.pivotControl)||t.isNullOrUndefined(r.model.pivotControl._waitingPopup)||r.model.pivotControl._waitingPopup.hide()},openPreventPanel:function(i){var r=t.buildTag("div#preventDiv.errorDlg").css({width:n("body").width()+"px",height:n("body").height()+"px",position:"absolute",top:n("body").offset().top+"px",left:n("body").offset().left+"px","z-index":10})[0].outerHTML;n("#"+i._id).append(r)},_createErrorDialog:function(i,r,u){var e,o;if(t.Pivot.closePreventPanel(u),u._errorDialog=r,t.Pivot.openPreventPanel(u),u.element.find(".e-errorDialog:visible").length==0){e=t.isNullOrUndefined(i.Exception)?t.buildTag("div.e-errorDialog#"+this._id+"_ErrorDialog",t.buildTag("div.warningImg")[0].outerHTML+t.buildTag("div.warningContent action:",i)[0].outerHTML+t.buildTag("div",t.buildTag("button"+this._id+"_ErrOKBtn.errOKBtn",u._getLocalizedLabels("OK"),{margin:"20px 0 10px 165px"}).attr("title",u._getLocalizedLabels("OK").replace(/(<([^>]+)>)/ig,""))[0].outerHTML)[0].outerHTML).attr("title",r)[0].outerHTML:t.buildTag("div.e-errorDialog#"+this._id+"_ErrorDialog",t.buildTag("div.warningImg")[0].outerHTML+t.buildTag("div.warningContent action:",i.Exception.Message)[0].outerHTML+t.buildTag("br")[0].outerHTML+t.buildTag("div."+u._id+"stackTraceContent","Stack Trace :"+i.Exception.StackTraceString)[0].outerHTML+t.buildTag("div",t.buildTag("button#"+this._id+"_ErrOKBtn.errOKBtn",u._getLocalizedLabels("OK"),{margin:"20px 0 10px 165px"}).attr("title",u._getLocalizedLabels("OK").replace(/(<([^>]+)>)/ig,""))[0].outerHTML)[0].outerHTML).attr("title",r)[0].outerHTML;u.element.append(e);u.element.find(".e-errorDialog").ejDialog({target:"#"+u._id,enableResize:!1,enableRTL:u.model.enableRTL,width:"400px",close:t.proxy(t.Pivot.closePreventPanel,u)});o=u.element.find(".e-errorDialog").data("ejDialog");n("#"+o._id+"_wrapper").css({left:"50%",top:"50%"});u.element.find(".errOKBtn").ejButton({type:t.ButtonType.Button,width:"50px"}).on(t.eventType.click,function(){u._errorDialog!="nodeCheck"||t.isNullOrUndefined(u._schemaData)||t.isNullOrUndefined(u._schemaData._selectedTreeNode)||u._schemaData._tableTreeObj.uncheckNode(u._schemaData._selectedTreeNode);u.element.find("#preventDiv").remove();(u._errorDialog==u._getLocalizedLabels("Success")||u._errorDialog==u._getLocalizedLabels("Warning")||u._errorDialog==u._getLocalizedLabels("Exception")||u._errorDialog==u._getLocalizedLabels("Error"))&&u.element.children("#"+this._id+"_ErrorDialog_wrapper").remove()});if(u.element.find(".e-dialog .e-close").attr("title","Close"),t.isNullOrUndefined(n("#"+u._id).data("ejWaitingPopup"))||n("#"+u._id).data("ejWaitingPopup").hide(),typeof oclientWaitingPopup!="undefined"&&oclientWaitingPopup!=null&&oclientWaitingPopup.hide(),!t.isNullOrUndefined(i.Exception)){var f=50,h="...",s="Show more",c="Show less";n("."+u._id+"stackTraceContent").each(function(){var i=n(this).html();if(i.length>f){u._id;var r=i.substr(0,f),e=i.substr(f,i.length-f),o=r+t.buildTag("span."+u._id+"moreellipses",h)[0].outerHTML+t.buildTag("span."+u._id+"morecontent",t.buildTag("span",e).css("display","none")[0].outerHTML+t.buildTag("a."+u._id+"morelink",s).css("display","block")[0].outerHTML)[0].outerHTML;n(this).html(o)}});n("."+u._id+"morelink").click(function(){return n(this).hasClass("less")?(n(this).removeClass("less"),n(this).html(s)):(n(this).addClass("less"),n(this).html(c)),n(this).parent().prev().toggle("slow",function(){}),n(this).prev().toggle("slow",function(){}),!1})}}},_updateValueSortingIndex:function(i,u){if(i.SortColIndex!=r)t.PivotAnalysis._valueSorting=JSON.parse(i.SortColIndex)[0],t.PivotAnalysis._sort=u.model.valueSortSettings.sortOrder;else{i=i[0]!=r?i:i.d!=r?i.d:i;var f=n.map(i,function(n){if(n!=null)var t=n.Key;if(t!=null&&t!=r&&t=="SortColIndex")return n});f.length>0?(i.splice(n.map(i,function(n,t){var i=n.Key;if(i=="SortColIndex")return t}),1),t.PivotAnalysis._valueSorting=JSON.parse(f[0].Value),t.PivotAnalysis._sort=u.model.valueSortSettings.sortOrder):t.PivotAnalysis._valueSorting=null}},_memberSortBtnClick:function(i){var a=this.element.hasClass("e-pivotclient")&&this.model.operationalMode=="servermode"&&this.model.analysisMode=="olap",v=this.pluginName=="ejPivotSchemaDesigner"?this.model.pivotControl:this,w=this.pluginName=="ejPivotGrid"&&v.model.analysisMode==t.Pivot.AnalysisMode.Olap&&v.model.operationalMode==t.Pivot.OperationalMode.ServerMode,o=n(i.target).parents(".e-memberEditorDiv").find(".e-editorTreeView"),b=this._sortType=n(i.target).hasClass("e-memberAscendingIcon")?"ascending":"descending",c=[],y=jQuery.extend(!0,[],this._memberTreeObj._dataSource),p,f,s,e,u,l,h;if(this.element.find(".e-memberDrillPager").is(":visible")&&(p=this.model.memberEditorPageSize==r?this.model.pivotControl.model.memberEditorPageSize:this.model.memberEditorPageSize,c=t.Pivot._getParentsTreeList(this,this._drilledNode,this._editorTreeData).concat(t.DataManager(this._editorDrillTreeData[this._drilledNode]).executeLocal(t.Query().sortBy("name",this._sortType).page(this._memberDrillPageSettings.currentMemberDrillPage,p)))),!t.isNullOrUndefined(o)&&o.length>0){if(t.Pivot.updateTreeView(this),f=(this.model.enableMemberEditorPaging||!t.isNullOrUndefined(this.model.pivotControl)&&this.model.pivotControl.model.enableMemberEditorPaging)&&!this._isSearchApplied?this._editorTreeData:o.data("ejTreeView").model.fields.dataSource,s=!a&&(f[0].id=="All"||f[0].id=="(All)_0")?f.slice(1):f,c.length>0&&(s=c),s.length>1&&s[0].id=="SearchFilterSelection"&&(s=s.slice(1)),e=a?[]:f.length>1&&(f[0].id=="All"||f[0].id=="(All)_0")?f.splice(0,1):[],u=t.DataManager(s).executeLocal(t.Query().sortBy("name",b)),!t.isNullOrUndefined(e)&&e.length>0&&(u.splice(0,0,e[0]),f.splice(0,0,e[0])),(this.model.enableMemberEditorPaging||!t.isNullOrUndefined(this.model.pivotControl)&&this.model.pivotControl.model.enableMemberEditorPaging)&&c.length==0&&(u=t.DataManager(u).executeLocal(t.Query().page(this._memberPageSettings.currentMemeberPage,(this.model.memberEditorPageSize||this.model.pivotControl.model.memberEditorPageSize)+(this._memberPageSettings.currentMemeberPage==1?1:0)))),v.model.analysisMode==t.Pivot.AnalysisMode.Pivot&&u.length>0&&u[0].id!="All"&&u[0].id!="(All)_0"&&!t.isNullOrUndefined(e)&&e.length>0&&u.splice(0,0,e[0]),e={},o.data("ejTreeView").model.fields.dataSource.length>1&&o.data("ejTreeView").model.fields.dataSource[1].id=="SearchFilterSelection"&&u[1].id!="SearchFilterSelection"&&u.splice(1,0,{id:"SearchFilterSelection",name:this._getLocalizedLabels("AddCurrentSelectionToFilter"),checkedStatus:this._isSelectSearchFilter,tag:"SearchFilterSelection",spriteCssClass:"e-searchfilterselection",uniqueName:"Add current selection to filter"}),a&&this._isSearchApplied&&u.splice(0,0,{id:"SearchFilterSelection",name:this._getLocalizedLabels("AddCurrentSelectionToFilter"),checkedStatus:this._isSelectSearchFilter,tag:"SearchFilterSelection",spriteCssClass:"e-searchfilterselection",uniqueName:"Add current selection to filter"}),t.isNullOrUndefined(o)||o.ejTreeView({fields:{dataSource:jQuery.extend(!0,[],u)}}),c.length>0&&!t.isNullOrUndefined(y)&&(this._memberTreeObj._dataSource=y),w)for(l=this.element.find(".e-editorTreeView").find("li"),h=0;h<l.length;h++)t.isNullOrUndefined(n(l[h]).attr("id"))||n(l[h]).attr("data-tag",t.DataManager(o.data("ejTreeView").model.fields.dataSource).executeLocal(t.Query().where("id","equal",n(l[h]).attr("id")))[0].tag);t.Pivot._separateAllMember(this)}},_contextMenuOpen:function(i,r){var f,e,u,o;if(t.Pivot.openPreventPanel(r),r._selectedMember=n(i.target),r.pluginName=="ejPivotGrid"?(f=r.model.analysisMode==t.Pivot.AnalysisMode.Olap?"olap":"pivot",u=n("#"+this._id+"_pivotTree").data("ejMenu")):(t.isNullOrUndefined(r.model.pivotControl)||(f=r.model.pivotControl.model.analysisMode==t.Pivot.AnalysisMode.Olap?"olap":"pivot"),u=n("#"+r._id+"_pivotTreeContextMenu").data("ejMenu")),f==t.Pivot.AnalysisMode.Olap){if(t.isNullOrUndefined(n(i.target).parent().attr("data-tag"))&&n(i.target).hasClass("e-pivotButton")&&n(i.target).children(".e-pvtBtn:eq(0)").length>0)return u.disable(),r._selectedMember=n(i.target).children(".e-pvtBtn:eq(0)"),!1;!t.isNullOrUndefined(n(i.target).parent().attr("data-tag"))&&n(i.target).parent().attr("data-tag").split(":")[1].toLowerCase().startsWith("[measures]")?u.disable():t.isNullOrUndefined(r._selectedMember.parent().attr("data-tag"))||r._selectedMember.parent().attr("data-tag").split(":")[1].toLowerCase()!="measures"?t.isNullOrUndefined(n(i.target).parent().attr("data-tag"))?u.disable():(u.disableItem(r._getLocalizedLabels("AddToValues")),n(i.target.parentElement).find(".e-namedSetCDB").length>0?u.disableItem(r._getLocalizedLabels("AddToFilter")):u.enableItem(r._getLocalizedLabels("AddToFilter")),u.enableItem(r._getLocalizedLabels("AddToRow")),u.enableItem(r._getLocalizedLabels("AddToColumn"))):(u.disableItem(r._getLocalizedLabels("AddToValues")),u.disableItem(r._getLocalizedLabels("AddToFilter")),u.enableItem(r._getLocalizedLabels("AddToRow")),u.enableItem(r._getLocalizedLabels("AddToColumn")))}else f==t.Pivot.AnalysisMode.Pivot&&(e=i.target.textContent,n(i.target).hasClass("e-btn")?(u.enable(),r.pluginName=="ejPivotGrid"&&(u.disableItem(r._getLocalizedLabels("CalculatedField")),n(i.target).parents(".e-pivotButton").attr("data-tag").split(":")[0].toLowerCase()=="values"&&(r.model.operationalMode==t.PivotGrid.OperationalMode.ClientMode&&n.grep(r.model.dataSource.values,function(n){return n.fieldCaption==e&&n.isCalculatedField==!0}).length>0?u.disable():r.model.operationalMode==t.PivotGrid.OperationalMode.ServerMode&&n.grep(JSON.parse(r.getOlapReport()).PivotCalculations,function(n){return n.FieldHeader==e&&n.CalculationType==8}).length>0&&u.disable(),u.enableItem(r._getLocalizedLabels("CalculatedField"))))):n("#"+this._id+"_pivotTree").length>0?(u=n("#"+this._id+"_pivotTree").data("ejMenu"),u.disable()):u.disable());o=r.model.pivotControl;t.isNullOrUndefined(o)||o.model.analysisMode!=t.Pivot.AnalysisMode.Pivot||n(i.target).parents(".e-schemaValue").length==0&&u.disableItem(r._getLocalizedLabels("SummarizeValueBy"))},_searchTreeNodes:function(i){var w=n(i.target).hasClass("searchTreeView")?this.element.find(".searchTreeView").data("ejMaskEdit"):this.element.find(".searchEditorTreeView").data("ejMaskEdit"),f=n(i.target).hasClass("searchTreeView")?this.model.operationalMode==t.Pivot.OperationalMode.ClientMode||this.model.analysisMode==t.Pivot.AnalysisMode.Pivot&&this.model.operationalMode==t.Pivot.OperationalMode.ServerMode?this.element.find(".e-schemaFieldTree").data("ejTreeView"):this.element.find(".e-cubeTreeView").data("ejTreeView"):this.element.find(".e-editorTreeView").data("ejTreeView"),a={id:"SearchFilterSelection",name:this._getLocalizedLabels("AddCurrentSelectionToFilter"),hasChildren:!1,checkedStatus:!0,tag:"SearchFilterSelection",spriteCssClass:"e-searchfilterselection",uniqueName:"Add current selection to filter"},r=f.element,b=r.find("li[data-isItemSearch='true']"),k=t.isNullOrUndefined(w.get_StrippedValue())?"":w.get_StrippedValue().toLowerCase(),e,o,c,h,v,u;if(b.length>0&&n(b).each(function(n,t){t.removeAttribute("data-isItemSearch")}),k.length>0){var d=[],g=[],s=r.find("ul>li>div>a");for(e=0;e<s.length;e++)n(s[e]).text().toLowerCase().indexOf(k)!=-1||n(n(s[e]).closest("li")).attr("id")=="(All)_0"||n(n(s[e]).closest("li")).attr("id")=="All"||n(n(s[e]).closest("li")).attr("id")=="SearchFilterSelection"?d.push(s[e]):g.push(s[e]);for(o=r.find(d).closest("li").css("display","block"),o.length>0&&(this._isOptionSearch=!0,n(o).each(function(t,i){n(i).attr("id")!="SearchFilterSelection"&&i.setAttribute("data-isItemSearch",!0)}),r.hasClass("e-editorTreeView")&&(!r.find("li span.e-searchfilterselection").length>0?(r.find("li:first").attr("id")=="(All)_0"||r.find("li:first").attr("id")=="All"?(o.length>1&&f.insertAfter(a,r.find("li:first")),(this.element.hasClass("e-pivotschemadesigner")?this.model.pivotControl.model.analysisMode:this.model.analysisMode)==t.Pivot.AnalysisMode.Pivot&&r.find("li span.e-searchfilterselection").closest("li").css("padding","0")):f.insertBefore(a,r.find("li:first")),r.find("li span.e-searchfilterselection").closest("li").attr("data-tag",a.tag)):r.find("li span.e-searchfilterselection").length>0&&!this._isSelectSearchFilter&&f.uncheckNode(r.find("li span.e-searchfilterselection").closest("li")))),r.find(g).closest("li").css("display","none"),u=0;u<o.length;u++)c=n(o[u]),h=c.parents("ul").closest("li").css("display","block"),h.length>0&&(f.expandNode(h),f.model.expandedNodes.indexOf(n(f._liList).index(h))!=-1||t.isNullOrUndefined(window._temp)||window._temp.push(h)),v=c.children("ul"),v.length>0&&v.children("li:visible").length==0&&(c.children("ul").children("li").css("display","block"),f.expandNode(o[u]),f.model.expandedNodes.indexOf(n(f._liList).index(o[u]))!=-1||t.isNullOrUndefined(window._temp)||window._temp.push(o[u]))}else{r.find("ul>li").css("display","block");r.find("li span.e-searchfilterselection").closest("li").length>0&&f.removeNode(r.find("#"+this._id+"_SearchFilterSelection"));n(r.find("ul>li")).each(function(n,t){t.removeAttribute("data-isItemSearch")});this._isOptionSearch=!1;var l=n(r).find("ul>li"),y=0,p=0;if(n(n(l)[0]).attr("id")=="(All)_0"||n(n(l)[0]).attr("id")=="All"){for(u=1;u<n(l).length;u++)n(n(l)[u]).find("span.e-checkmark").length>0?y++:p++;y>0&&p>0?n(r.find("ul>li")[0]).find("div .e-chkbox-small > span > span:eq(0)").removeClass("e-checkmark").addClass("e-stop"):y>0&&p==0?n(r.find("ul>li")[0]).find("div .e-chkbox-small > span > span:eq(0)").removeClass("e-stop").addClass("e-checkmark"):n(r.find("ul>li")[0]).find("div .e-chkbox-small > span > span:eq(0)").removeClass("e-checkmark").removeClass("e-stop")}if(!t.isNullOrUndefined(window._temp))for(u=0;u<window._temp.length;u++)f._collpaseNode(window._temp[u]);window._temp=[];n(i.target).hasClass("searchTreeView")&&f.collapseAll()}},_updateSearchFilterSelection:function(i,r,u){var s={},o={},f,e;i.id=="SearchFilterSelection"&&(f=n(r).find("li:not([data-isItemSearch='true'])"),i.type=="nodeCheck"?(u._isSelectSearchFilter=!0,u._isOptionSearch?f.length>0&&n(f).each(function(i,f){n(f).attr("id")!="SearchFilterSelection"&&!t.isNullOrUndefined(u._currentFilterList[n(f).attr("id")])&&u._currentFilterList[n(f).attr("id")].checkedStatus&&n(r).ejTreeView("checkNode",n(f))}):f.length>0&&(u.model.enableMemberEditorPaging&&(s=u._currentFilterList,n(s).each(function(n,t){o[t.id]=t})),n(u._editorTreeData).each(function(i,r){for(var e=0;e<f.length;e++)if(f[e].id!=r.id)t.isNullOrUndefined(u._currentFilterList)||(u.model.enableMemberEditorPaging&&!t.isNullOrUndefined(o)&&o[n(r).attr("id")]?r.checkedStatus=o[n(r).attr("id")].checkedStatus:u._currentFilterList[n(r).attr("id")]&&(r.checkedStatus=u._currentFilterList[n(r).attr("id")].checkedStatus));else{r.checkedStatus=n(f[e]).find(".checked").length>0?!0:!1;break}}),e=!0,n(u._editorTreeData).each(function(n,t){if(t.checkedStatus)return e=!1,!1}),e&&u._editorTreeData.length>0?(u._dialogOKBtnObj.disable(),u.element.find(".e-dialogOKBtn").attr("disabled","disabled")):(u._dialogOKBtnObj.enable(),u.element.find(".e-dialogOKBtn").removeAttr("disabled")))):i.type=="nodeUncheck"&&(u._isSelectSearchFilter=!1,u._isOptionSearch?f.length>0&&n(f).each(function(t,i){n(i).attr("id")!="SearchFilterSelection"&&n(r).ejTreeView("uncheckNode",n(i))}):f.length>0&&(n(u._editorTreeData).each(function(t,i){for(var r=0;r<f.length;r++)if(f[r].id!=i.id)i.checkedStatus=!1;else{i.checkedStatus=n(f[r]).find(".checked").length>0?!0:!1;break}}),e=!0,n(u._editorTreeData).each(function(n,t){if(t.checkedStatus)return e=!1,!1}),e&&u._editorTreeData.length>0?(u._dialogOKBtnObj.disable(),u.element.find(".e-dialogOKBtn").attr("disabled","disabled")):(u._dialogOKBtnObj.enable(),u.element.find(".e-dialogOKBtn").removeAttr("disabled")))))},editorTreeNavigatee:function(i,r){var e,f,u;if(n(i.target).parents(".e-memberPager").length>0){if(u=r._memberPageSettings.currentMemeberPage,!n(i.target).hasClass("e-pageDisabled")){if(n(i.target).hasClass("e-nextPage"))r._memberPageSettings.startPage+=r.model.memberEditorPageSize,r._memberPageSettings.currentMemeberPage+=1,r._memberPageSettings.endPage+=r.model.memberEditorPageSize;else if(n(i.target).hasClass("e-prevPage"))r._memberPageSettings.currentMemeberPage-=1,r._memberPageSettings.startPage=Math.abs(r._memberPageSettings.startPage-(r._memberPageSettings.currentMemeberPage==1?r.model.memberEditorPageSize:r.model.memberEditorPageSize)),r._memberPageSettings.endPage-=r.model.memberEditorPageSize;else if(n(i.target).hasClass("e-firstPage"))r._memberPageSettings.currentMemeberPage=1,r._memberPageSettings.endPage=r.model.memberEditorPageSize,r._memberPageSettings.startPage=0;else if(n(i.target).hasClass("e-lastPage"))r._memberPageSettings.currentMemeberPage=parseInt(n.trim(r.element.find(".e-memberPageCount").text().split("/")[1])),r._memberPageSettings.endPage=r._memberPageSettings.currentMemeberPage*r.model.memberEditorPageSize,r._memberPageSettings.startPage=r._memberPageSettings.endPage-r.model.memberEditorPageSize;else{if(parseInt(n(i.target).val())>n.trim(r.element.find(".e-memberPageCount").text().split("/")[1])||parseInt(n(i.target).val())==0)return r.element.find(".e-memberCurrentPage").val(u),!1;r._memberPageSettings.currentMemeberPage=parseInt(n(i.target).val());r._memberPageSettings.endPage=r._memberPageSettings.currentMemeberPage*r.model.memberEditorPageSize;r._memberPageSettings.startPage=r._memberPageSettings.currentMemeberPage==1||r._memberPageSettings.currentMemeberPage==0?0:r._memberPageSettings.endPage-r.model.memberEditorPageSize}r._waitingPopup.show();r.element.hasClass("e-pivotclient")&&r.model.analysisMode==t.Pivot.AnalysisMode.Olap&&r.model.operationalMode==t.Pivot.OperationalMode.ServerMode?(r.model.enableMemberEditorSorting&&(r._editorTreeData=t.DataManager(r._editorTreeData).executeLocal(t.Query().sortBy("name",r._sortType))),this.editorTreePageInfoSuccess(r._editorTreeData,r)):(r.pluginName!="ejPivotSchemaDesigner"?r._isMemberPageFilter=!0:r.model.pivotControl._isMemberPageFilter=!0,e=t.Pivot.updateTreeView(r),f=t.DataManager(r._editorTreeData).executeLocal(t.Query().sortBy("name",t.isNullOrUndefined(r._sortType)?"":r._sortType).where(t.Predicate("pid","equal",null).and("id","notequal","All").and("id","notequal","(All)_0")).page(r._memberPageSettings.currentMemeberPage,r.pluginName=="ejPivotSchemaDesigner"?r.model.pivotControl.model.memberEditorPageSize:r.model.memberEditorPageSize)),r._memberPageSettings.currentMemeberPage>1?r.element.find(".e-prevPage, .e-firstPage").removeClass("e-pageDisabled").addClass("e-pageEnabled"):r.element.find(".e-prevPage, .e-firstPage").removeClass("e-pageEnabled").addClass("e-pageDisabled"),r._memberPageSettings.currentMemeberPage==parseInt(n.trim(r.element.find(".e-memberPageCount").text().split("/")[1]))?r.element.find(".e-nextPage, .e-lastPage").removeClass("e-pageEnabled").addClass("e-pageDisabled"):r.element.find(".e-nextPage, .e-lastPage").removeClass("e-pageDisabled").addClass("e-pageEnabled"),r.element.find(".e-memberCurrentPage").val(r._memberPageSettings.currentMemeberPage),r.element.find(".e-nextPageDiv .e-pageDisabled").css("opacity","0.5"),r.element.find(".e-nextPageDiv .e-pageEnabled").css("opacity","1"),t.Pivot._createSearchTreeview(f,r),r._waitingPopup.hide())}}else if(n(i.target).parents(".e-memberSearchPager").length>0){if(u=r._memberSearchPageSettings.currentMemberSearchPage,!n(i.target).hasClass("e-pageDisabled")){if(n(i.target).hasClass("e-nextPage"))r._memberSearchPageSettings.startSearchPage+=r.model.memberEditorPageSize,r._memberSearchPageSettings.currentMemberSearchPage+=1,r._memberSearchPageSettings.endSearchPage+=r.model.memberEditorPageSize;else if(n(i.target).hasClass("e-prevPage"))r._memberSearchPageSettings.currentMemberSearchPage-=1,r._memberSearchPageSettings.startSearchPage=Math.abs(r._memberSearchPageSettings.startSearchPage-(r._memberSearchPageSettings.currentMemberSearchPage==1?r.model.memberEditorPageSize:r.model.memberEditorPageSize)),r._memberSearchPageSettings.endSearchPage-=r.model.memberEditorPageSize;else if(n(i.target).hasClass("e-firstPage"))r._memberSearchPageSettings.currentMemberSearchPage=1,r._memberSearchPageSettings.endSearchPage=r.model.memberEditorPageSize,r._memberSearchPageSettings.startSearchPage=0;else if(n(i.target).hasClass("e-lastPage"))r._memberSearchPageSettings.currentMemberSearchPage=parseInt(n.trim(r.element.find(".e-memberSearchPageCount").text().split("/")[1])),r._memberSearchPageSettings.endSearchPage=r._memberSearchPageSettings.currentMemberSearchPage*r.model.memberEditorPageSize,r._memberSearchPageSettings.startSearchPage=r._memberSearchPageSettings.endSearchPage-r.model.memberEditorPageSize;else{if(parseInt(n(i.target).val())>n.trim(r.element.find(".e-memberSearchPageCount").text().split("/")[1])||parseInt(n(i.target).val())==0)return r.element.find(".e-memberCurrentSearchPage").val(u),!1;r._memberSearchPageSettings.currentMemberSearchPage=parseInt(n(i.target).val());r._memberSearchPageSettings.endSearchPage=r._memberSearchPageSettings.currentMemberSearchPage*r.model.memberEditorPageSize;r._memberSearchPageSettings.startSearchPage=r._memberSearchPageSettings.currentMemberSearchPage==1||r._memberSearchPageSettings.currentMemberSearchPage==0?0:r._memberSearchPageSettings.endSearchPage-r.model.memberEditorPageSize}r._waitingPopup.show();r.element.hasClass("e-pivotclient")&&r.model.analysisMode==t.Pivot.AnalysisMode.Olap&&r.model.operationalMode==t.Pivot.OperationalMode.ServerMode?this._editorTreeSearchPageInfoSuccess(r._editorSearchTreeData,r):(r.pluginName!="ejPivotSchemaDesigner"?r._isMemberPageFilter=!0:r.model.pivotControl._isMemberPageFilter=!0,this._editorTreeSearchPageInfoSuccess(r._editorSearchTreeData,r))}}else if(n(i.target).parents(".e-memberDrillPager").length>0&&(u=r._memberDrillPageSettings.currentMemberDrillPage,!n(i.target).hasClass("e-pageDisabled"))){if(n(i.target).hasClass("e-nextPage"))r._memberDrillPageSettings.startDrillPage+=r.model.memberEditorPageSize,r._memberDrillPageSettings.currentMemberDrillPage+=1,r._memberDrillPageSettings.endDrillPage+=r.model.memberEditorPageSize;else if(n(i.target).hasClass("e-prevPage"))r._memberDrillPageSettings.currentMemberDrillPage-=1,r._memberDrillPageSettings.startDrillPage=Math.abs(r._memberDrillPageSettings.startDrillPage-(r._memberDrillPageSettings.currentMemberDrillPage==1?r.model.memberEditorPageSize:r.model.memberEditorPageSize)),r._memberDrillPageSettings.endDrillPage-=r.model.memberEditorPageSize;else if(n(i.target).hasClass("e-firstPage"))r._memberDrillPageSettings.currentMemberDrillPage=1,r._memberDrillPageSettings.endDrillPage=r.model.memberEditorPageSize,r._memberDrillPageSettings.startDrillPage=0;else if(n(i.target).hasClass("e-lastPage"))r._memberDrillPageSettings.currentMemberDrillPage=parseInt(n.trim(r.element.find(".e-memberDrillPageCount").text().split("/")[1])),r._memberDrillPageSettings.endDrillPage=r._memberDrillPageSettings.currentMemberDrillPage*r.model.memberEditorPageSize,r._memberDrillPageSettings.startDrillPage=r._memberDrillPageSettings.endDrillPage-r.model.memberEditorPageSize;else{if(parseInt(n(i.target).val())>n.trim(r.element.find(".e-memberDrillPageCount").text().split("/")[1])||parseInt(n(i.target).val())==0)return r.element.find(".e-memberCurrentDrillPage").val(u),!1;r._memberDrillPageSettings.currentMemberDrillPage=parseInt(n(i.target).val());r._memberDrillPageSettings.endDrillPage=r._memberDrillPageSettings.currentMemberDrillPage*r.model.memberEditorPageSize;r._memberDrillPageSettings.startDrillPage=r._memberDrillPageSettings.currentMemberDrillPage==1||r._memberDrillPageSettings.currentMemberDrillPage==0?0:r._memberDrillPageSettings.endDrillPage-r.model.memberEditorPageSize}r._waitingPopup.show();this._editorTreeDrillPageInfoSuccess(r._memberTreeObj._dataSource.slice(),r)}},editorTreePageInfoSuccess:function(i,u){setTimeout(function(){u._memberPageSettings.currentMemeberPage>1?u.element.find(".e-prevPage, .e-firstPage").removeClass("e-pageDisabled").addClass("e-pageEnabled"):u.element.find(".e-prevPage, .e-firstPage").removeClass("e-pageEnabled").addClass("e-pageDisabled");u._memberPageSettings.currentMemeberPage==parseInt(n.trim(u.element.find(".e-memberPageCount").text().split("/")[1]))?u.element.find(".e-nextPage, .e-lastPage").removeClass("e-pageEnabled").addClass("e-pageDisabled"):u.element.find(".e-nextPage, .e-lastPage").removeClass("e-pageDisabled").addClass("e-pageEnabled");var e,f;u.model.operationalMode==t.Pivot.OperationalMode.ClientMode&&(e=i[0]!=r?i[0].Value:i.d!=r?i.d[0].Value:i.EditorTreeInfo,f=n.parseJSON(e),f.splice(-1,1));u.element.find(".e-memberCurrentPage").val(u._memberPageSettings.currentMemeberPage);u._appendTreeViewData(u.model.operationalMode==t.Pivot.OperationalMode.ClientMode?f:t.DataManager(u._editorTreeData).executeLocal(t.Query().where("pid","equal",null||r).page(u._memberPageSettings.currentMemeberPage,u.pluginName=="ejPivotSchemaDesigner"?u.model.pivotControl.model.memberEditorPageSize:u.model.memberEditorPageSize)),u.element.find(".pvtBtn").parent("[data-tag='Slicers:"+u._selectedFieldName.replace(/\[/g,"").replace(/\]/g,"")+"']").length>0);u._waitingPopup.hide()},0)},_editorTreeDrillPageInfoSuccess:function(i,u){setTimeout(function(){var o,f,e;u._memberDrillPageSettings.currentMemberDrillPage>1?u.element.find(".e-memberDrillPager").find(".e-prevPage, .e-firstPage").removeClass("e-pageDisabled").addClass("e-pageEnabled"):u.element.find(".e-memberDrillPager").find(".e-prevPage, .e-firstPage").removeClass("e-pageEnabled").addClass("e-pageDisabled");u._memberDrillPageSettings.currentMemberDrillPage==parseInt(n.trim(u.element.find(".e-memberDrillPageCount").text().split("/")[1]))?u.element.find(".e-memberDrillPager").find(".e-nextPage, .e-lastPage").removeClass("e-pageEnabled").addClass("e-pageDisabled"):u.element.find(".e-memberDrillPager").find(".e-nextPage, .e-lastPage").removeClass("e-pageDisabled").addClass("e-pageEnabled");u.element.find(".e-memberCurrentDrillPage").val(u._memberDrillPageSettings.currentMemberDrillPage);f=0;i.length>0&&i[0].length>0&&i[0][0].id=="All"&&i[0].splice(0,1);n.each(i,function(n,t){if(t.length==1&&t[0].expanded)f=n;else return!1});e=[];e=u.model.enableMemberEditorSorting&&u._sortType?t.DataManager(t.DataManager(u._editorTreeData).executeLocal(t.Query().where("pid","equal",i[f][0].id).sortBy("name",u._sortType))).executeLocal(t.Query().where("pid","notequal",null||r).page(u._memberDrillPageSettings.currentMemberDrillPage,u.pluginName=="ejPivotSchemaDesigner"?u.model.pivotControl.model.memberEditorPageSize:u.model.memberEditorPageSize)):t.DataManager(t.DataManager(u._editorTreeData).executeLocal(t.Query().where("pid","equal",i[f][0].id))).executeLocal(t.Query().where("pid","notequal",null||r).page(u._memberDrillPageSettings.currentMemberDrillPage,u.pluginName=="ejPivotSchemaDesigner"?u.model.pivotControl.model.memberEditorPageSize:u.model.memberEditorPageSize));u._editorDrillTreePageSettings[i[f][0].id]=n.extend(!0,{},u._memberDrillPageSettings);u.element.find(".e-memberDrillPager").find(".e-nextPageDiv").length>0?(o=t.Pivot._getParentsTreeList(u,i[f][0].id,u._editorTreeData).concat(e),u.pluginName!="ejPivotClient"?t.Pivot._createSearchTreeview(o,u):u._appendTreeViewData(o,u.element.find(".pvtBtn").parent("[data-tag='Slicers:"+u._selectedFieldName.replace(/\[/g,"").replace(/\]/g,"")+"']").length>0)):u.pluginName!="ejPivotClient"?t.Pivot._createSearchTreeview(e,u):u._appendTreeViewData(e,u.element.find(".pvtBtn").parent("[data-tag='Slicers:"+u._selectedFieldName.replace(/\[/g,"").replace(/\]/g,"")+"']").length>0);u._waitingPopup.hide()},0)},_editorTreeSearchPageInfoSuccess:function(i,r){setTimeout(function(){var f=r.pluginName=="ejPivotSchemaDesigner"?r.model.pivotControl.model.memberEditorPageSize:r.model.memberEditorPageSize,u;for(r._memberSearchPageSettings.currentMemberSearchPage>1?r.element.find(".e-memberSearchPager").find(".e-prevPage, .e-firstPage").removeClass("e-pageDisabled").addClass("e-pageEnabled"):r.element.find(".e-memberSearchPager").find(".e-prevPage, .e-firstPage").removeClass("e-pageEnabled").addClass("e-pageDisabled"),r._memberSearchPageSettings.currentMemberSearchPage==parseInt(n.trim(r.element.find(".e-memberSearchPageCount").text().split("/")[1]))?r.element.find(".e-memberSearchPager").find(".e-nextPage, .e-lastPage").removeClass("e-pageEnabled").addClass("e-pageDisabled"):r.element.find(".e-memberSearchPager").find(".e-nextPage, .e-lastPage").removeClass("e-pageDisabled").addClass("e-pageEnabled"),i=t.DataManager(i).executeLocal(t.Query().where(t.Predicate("id","notequal","(All)_0").and("id","notequal","All"))).slice((r._memberSearchPageSettings.currentMemberSearchPage-1)*f,(r._memberSearchPageSettings.currentMemberSearchPage-1)*f+f),u=0;u<i.length;u++)t.isNullOrUndefined(i[u].pid)||(i[u].parentId=i[u].pid);for(u=0;u<i.length;u++)t.Pivot._appendParentNodes(i,i[u],r);r.element.find(".e-memberCurrentSearchPage").val(r._memberSearchPageSettings.currentMemberSearchPage);i.splice(0,0,{id:"SearchFilterSelection",name:r._getLocalizedLabels("AddCurrentSelectionToFilter"),checkedStatus:r._isSelectSearchFilter,tag:"SearchFilterSelection",spriteCssClass:"e-searchfilterselection",uniqueName:"Add current selection to filter"});r.pluginName=="ejPivotClient"&&r.model.analysisMode==t.Pivot.AnalysisMode.Olap&&r.model.operationalMode==t.Pivot.OperationalMode.ServerMode?r._appendTreeViewData(i,r.element.find(".pvtBtn").parent("[data-tag='Slicers:"+r._selectedFieldName.replace(/\[/g,"").replace(/\]/g,"")+"']").length>0):t.Pivot._createSearchTreeview(i,r);r._waitingPopup.hide();r._parentNodeCollection={};r._parentSearchNodeCollection={}},0)},_drillEditorTreeNode:function(i,u,f){var o,e;u._waitingPopup.show();o=i.childNodes;u._isEditorDrillPaging&&!u._isEditorCollapseDrillPaging?u.element.find(".e-memberDrillPager").find(".e-nextPageDiv").length>0&&(u._memberDrillPageSettings={currentMemberDrillPage:1,startDrillPage:0,endDrillPage:0},t.isNullOrUndefined(i.parentNode.id)||(u._editorDrillTreeData[i.parentNode.id]=o.slice(),u._editorDrillTreePageSettings[i.parentNode.id]=n.extend(!0,{},u._memberDrillPageSettings)),this._refreshDrillEditorPager(i,u,f)):u._isEditorCollapseDrillPaging&&(u.element.find(".e-memberDrillPager").find(".e-nextPageDiv").length>0&&(u._isEditorCollapseDrillPaging=!1,u._memberDrillPageSettings=t.isNullOrUndefined(i.parentNode.id)?i.drillPageSettings:i.drillPageSettings[i.parentNode.id]),this._refreshDrillEditorPager(i,u,f));e=[];u._drilledNode=i.parentNode.id;e=t.isNullOrUndefined(i.parentNode.id)?i.parentNode.concat(i.childNodes):this._getParentsTreeList(u,i.parentNode.id,u._editorTreeData).concat(t.DataManager(o).executeLocal(t.Query().where("pid","notequal",null||r).page(u._memberDrillPageSettings.currentMemberDrillPage,f)));u.pluginName=="ejPivotClient"&&u.model.analysisMode==t.Pivot.AnalysisMode.Olap&&u.model.operationalMode==t.Pivot.OperationalMode.ServerMode?u._appendTreeViewData(e,u.element.find(".pvtBtn").parent("[data-tag='Slicers:"+u._selectedFieldName.replace(/\[/g,"").replace(/\]/g,"")+"']").length>0):t.Pivot._createSearchTreeview(e,u);u._waitingPopup.hide()},_refreshDrillEditorPager:function(t,i,r){i.element.find(".e-memberPager,.e-memberSearchPager").css("display","none");i.element.find(".e-memberDrillPager").css("display","block");var f=t.childNodes.length,u=f/r;u!=Math.round(u)&&(u=parseInt(u)+1);i._memberDrillPageSettings.currentMemberDrillPage==u&&i.element.find(".e-memberDrillPager").find(".e-nextPage, .e-lastPage").addClass("disabled");i.element.find(".e-memberDrillPageCount").html("/ "+u);i.element.find(".e-memberCurrentDrillPage").val(i._memberDrillPageSettings.currentMemberDrillPage);i._memberDrillPageSettings.currentMemberDrillPage>1?i.element.find(".e-memberDrillPager").find(".e-prevPage, .e-firstPage").removeClass("e-pageDisabled").addClass("e-pageEnabled"):i.element.find(".e-memberDrillPager").find(".e-prevPage, .e-firstPage").removeClass("e-pageEnabled").addClass("e-pageDisabled");i._memberDrillPageSettings.currentMemberDrillPage==parseInt(n.trim(i.element.find(".e-memberDrillPageCount").text().split("/")[1]))?i.element.find(".e-memberDrillPager").find(".e-nextPage, .e-lastPage").removeClass("e-pageEnabled").addClass("e-pageDisabled"):i.element.find(".e-memberDrillPager").find(".e-nextPage, .e-lastPage").removeClass("e-pageDisabled").addClass("e-pageEnabled");t.childNodes=t.childNodes.slice((i._memberDrillPageSettings.currentMemberDrillPage-1)*r,i._memberDrillPageSettings.currentMemberDrillPage*r)},_getParentsTreeList:function(n,i,r){var u=[],f;do parentNodes=t.DataManager(r).executeLocal(t.Query().where("id","equal",i)),f=!t.isNullOrUndefined(parentNodes)&&parentNodes.length>0&&!t.isNullOrUndefined(parentNodes[0].pid),u.push(new t.Predicate("id","equal",i)),i=f?parentNodes[0].pid:null;while(!t.isNullOrUndefined(i));return t.DataManager(r).executeLocal(t.Query().where(t.Predicate.or(u)))},_onNodeCollapse:function(i){var u=t.isNullOrUndefined(i.olapCtrlObj)?this:i.olapCtrlObj,l=!1,o={memberEditorPageSize:u.pluginName=="ejPivotSchemaDesigner"?u.model.pivotControl.model.memberEditorPageSize:u.model.memberEditorPageSize,enableMemberEditorPaging:u.pluginName=="ejPivotSchemaDesigner"?u.model.pivotControl.model.enableMemberEditorPaging:u.model.enableMemberEditorPaging},c;if(jQuery.each(u._editorTreeData,function(n,r){r.id==i.id?(t.isNullOrUndefined(r.pid)||(i.parentId=r.pid),r.expanded=!1):r.pid==i.id&&(t.isNullOrUndefined(u._editorDrillTreeData[r.id])||(l=!0))}),o.enableMemberEditorPaging&&(l||!t.isNullOrUndefined(u._editorDrillTreeData[i.id])||i.parentId=="")){u.element.find(".searchEditorTreeView").data("ejMaskEdit").clear();u._lastSavedTree=[];u._isEditorDrillPaging=!1;u.element.find(".e-memberPager").length>0?(u.element.find(".e-memberPager").css("display","block"),u.element.find(".e-memberDrillPager,.e-memberSearchPager").css("display","none")):u.element.find(".e-memberDrillPager, .e-memberSearchPager").css("display","none");var f=[],e=i.parentId,s=!1,a=!1,h="";if(!t.isNullOrUndefined(e)&&e!=""){do parentNodes=t.DataManager(u._editorTreeData).executeLocal(t.Query().where("id","equal",e)),s=s||o.memberEditorPageSize<=t.DataManager(u._editorTreeData).executeLocal(t.Query().where("pid","equal",e)).length?!0:!1,f.push(new t.Predicate(s?"id":"pid","equal",e)),!a&&s&&o.memberEditorPageSize<t.DataManager(u._editorTreeData).executeLocal(t.Query().where("pid","equal",e)).length&&(a=!0,h=e),e=parentNodes[0].pid;while(!t.isNullOrUndefined(e));s?f.push(new t.Predicate("id","equal",i.parentId)):f.push(new t.Predicate("pid","equal",null||r))}s?(t.Pivot._makeAncestorsExpandable(u,i.parentId),u._isEditorCollapseDrillPaging=!0,c={drillPageSettings:t.isNullOrUndefined(u._editorDrillTreePageSettings[h])&&u.pluginName=="ejPivotSchemaDesigner"?u.model.pivotControl._editorDrillTreePageSettings[h]:u._editorDrillTreePageSettings[h],parentNode:t.DataManager(n.extend(!0,[],u._editorTreeData)).executeLocal(t.Query().where(t.Predicate.or(f))),childNodes:t.DataManager(n.extend(!0,[],u._editorTreeData)).executeLocal(t.Query().where("pid","equal",h))},c.parentNode=n.grep(c.parentNode,function(t){var i=!1;return n.each(c.childNodes,function(n,r){r.id==t.id&&(r.expanded=!0,i=!0)}),!i}),t.Pivot._drillEditorTreeNode(c,u,o.memberEditorPageSize)):(u.model.enableMemberEditorSorting&&(u._editorTreeData=t.DataManager(u._editorTreeData).executeLocal(t.Query().sortBy("name",u._sortType))),f.length==0&&f.push(new t.Predicate("pid","equal",null||r)),u.element.find(".e-memberPager").length>0?u.pluginName!="ejPivotClient"?t.Pivot._createSearchTreeview(t.DataManager(u._editorTreeData).executeLocal(t.Query().where(t.Predicate.or(f)).page(u._memberPageSettings.currentMemeberPage,o.memberEditorPageSize)),u):u._appendTreeViewData(t.DataManager(u._editorTreeData).executeLocal(t.Query().where(t.Predicate.or(f)).page(u._memberPageSettings.currentMemeberPage,o.memberEditorPageSize)),u.element.find(".pvtBtn").parent("[data-tag='Slicers:"+u._selectedFieldName.replace(/\[/g,"").replace(/\]/g,"")+"']").length>0):u.pluginName!="ejPivotClient"?t.Pivot._createSearchTreeview(t.DataManager(u._editorTreeData).executeLocal(t.Query().where(t.Predicate.or(f))),u):u._appendTreeViewData(t.DataManager(u._editorTreeData).executeLocal(t.Query().where(t.Predicate.or(f))),u.element.find(".pvtBtn").parent("[data-tag='Slicers:"+u._selectedFieldName.replace(/\[/g,"").replace(/\]/g,"")+"']").length>0))}},_searchEditorTreeNodes:function(i,u){if(t.isNullOrUndefined(window.event)?i.which!=0&&i.which!=13:window.event.which!=0&&window.event.which!=13){t.isNullOrUndefined(u._waitingPopup.element)||u._waitingPopup.show();var f=this;setTimeout(function(){var o={memberEditorPageSize:u.pluginName=="ejPivotSchemaDesigner"?u.model.pivotControl.model.memberEditorPageSize:u.model.memberEditorPageSize,enableMemberEditorPaging:u.pluginName=="ejPivotSchemaDesigner"?u.model.pivotControl.model.enableMemberEditorPaging:u.model.enableMemberEditorPaging},c="",e,a,s,l,v,y;if(u.pluginName!="ejPivotClient"||t.isNullOrUndefined(u._pivotSchemaDesigner)){if(t.isNullOrUndefined(u.element.find(".searchEditorTreeView"))||u.element.find(".searchEditorTreeView").length==0)return!1;c=t.isNullOrUndefined(n.trim(u.element.find(".searchEditorTreeView").val()))?"":n.trim(u.element.find(".searchEditorTreeView").val()).toLowerCase()}else{if(t.isNullOrUndefined(u._pivotSchemaDesigner.element.find(".searchEditorTreeView"))||u._pivotSchemaDesigner.element.find(".searchEditorTreeView").length==0)return!1;c=t.isNullOrUndefined(n.trim(u._pivotSchemaDesigner.element.find(".searchEditorTreeView").val()))?"":n.trim(u._pivotSchemaDesigner.element.find(".searchEditorTreeView").val()).toLowerCase()}if(c!=""){var h=jQuery.extend(!0,[],t.DataManager(u._editorTreeData).executeLocal(t.Query().where("name","contains",c,!0).sortBy("name",t.isNullOrUndefined(u._sortType)?"":u._sortType))),p=n.extend(!0,[],h.slice(0,o.memberEditorPageSize+1)),i=o.enableMemberEditorPaging?p:h;for(e=0;e<i.length;e++)t.isNullOrUndefined(i[e].pid)||(i[e].parentId=i[e].pid);for(e=0;e<i.length;e++)f._appendParentNodes(i,i[e],u);u._isSearchApplied=!0;h.length>0?(u._isSelectSearchFilter=u.model.enableCheckStateOnSearch,o.enableMemberEditorPaging&&(u.element.find(".e-memberSearchPager").find(".e-nextPageDiv").length>0||u.element.find(".e-memberDrillPager").find(".e-nextPageDiv").length>0)&&(u._memberSearchPageSettings.currentMemberSearchPage=1,u._memberSearchPageSettings.startSearchPage=0,u._memberSearchPageSettings.endSearchPage=0,u.element.find(".e-memberPager,.e-memberDrillPager").css("display","none"),u._editorSearchTreeData=h.slice(),a=t.DataManager(h).executeLocal(t.Query().where(t.Predicate("id","notequal","(All)_0").and("id","notequal","All"))).length,s=a/o.memberEditorPageSize,s!=Math.round(s)&&(s=parseInt(s)+1),s>1&&u.element.find(".e-memberSearchPager").css("display","block"),u._memberSearchPageSettings.currentMemberSearchPage==s&&u.element.find(".e-memberSearchPager").find(".e-nextPage, .e-lastPage").addClass("disabled"),u.element.find(".e-memberSearchPageCount").html("/ "+s),u.element.find(".e-memberCurrentSearchPage").val(u._memberSearchPageSettings.currentMemberSearchPage),u._memberSearchPageSettings.currentMemberSearchPage>1?u.element.find(".e-memberSearchPager").find(".e-prevPage, .e-firstPage").removeClass("e-pageDisabled").addClass("e-pageEnabled"):u.element.find(".e-memberSearchPager").find(".e-prevPage, .e-firstPage").removeClass("e-pageEnabled").addClass("e-pageDisabled"),u._memberSearchPageSettings.currentMemberSearchPage==parseInt(n.trim(u.element.find(".e-memberSearchPageCount").text().split("/")[1]))?u.element.find(".e-memberSearchPager").find(".e-nextPage, .e-lastPage").removeClass("e-pageEnabled").addClass("e-pageDisabled"):u.element.find(".e-memberSearchPager").find(".e-nextPage, .e-lastPage").removeClass("e-pageDisabled").addClass("e-pageEnabled"))):(u.element.find(".e-memberPager,.e-memberSearchPager,.e-memberDrillPager").css("display","none"),u.element.find(".e-dialogFooter").css("margin-top","5px"));i.length>0&&(i[0].id=="All"&&i.splice(0,1),i.splice(0,0,{id:"SearchFilterSelection",name:u._getLocalizedLabels("AddCurrentSelectionToFilter"),checkedStatus:u._isSelectSearchFilter,tag:"SearchFilterSelection",spriteCssClass:"e-searchfilterselection",uniqueName:"Add current selection to filter"}));u.pluginName=="ejPivotClient"&&u.model.analysisMode==t.Pivot.AnalysisMode.Olap&&u.model.operationalMode==t.Pivot.OperationalMode.ServerMode?u._appendTreeViewData(i,u.element.find(".pvtBtn").parent("[data-tag='Slicers:"+u._selectedFieldName.replace(/\[/g,"").replace(/\]/g,"")+"']").length>0):f._createSearchTreeview(i,u)}else u._isSearchApplied=!1,u._isSelectSearchFilter=u.model.enableCheckStateOnSearch,l=!t.isNullOrUndefined(u._lastSavedTree)&&n.grep(u._lastSavedTree,function(n){return n.pid}).length>0?!0:!1,o.enableMemberEditorPaging&&u.element.find(".e-memberSearchPager").find(".e-nextPageDiv").length>0&&(u._editorSearchTreeData=[],u.element.find(".e-memberPageCount").text()!=""&&u.element.find(".e-memberPager").css("display","block"),u.element.find(".e-memberSearchPager").css("display","none")),l&&u.element.find(".e-memberDrillPageCount").text()!=""&&(u.element.find(".e-memberDrillPager").css("display","block"),u.element.find(".e-memberPager").css("display","none")),u.pluginName=="ejPivotClient"&&u.model.analysisMode==t.Pivot.AnalysisMode.Olap&&u.model.operationalMode==t.Pivot.OperationalMode.ServerMode?u._appendTreeViewData(o.enableMemberEditorPaging?l?t.DataManager(u._lastSavedTree).executeLocal(t.Query().sortBy("name",t.isNullOrUndefined(u._sortType)?"":u._sortType)):t.DataManager(u._editorTreeData).executeLocal(t.Query().where("pid","equal",null||r).page(u._memberPageSettings.currentMemeberPage,o.memberEditorPageSize).sortBy("name",t.isNullOrUndefined(u._sortType)?"":u._sortType)):u._editorTreeData,u.element.find(".pvtBtn").parent("[data-tag='Slicers:"+u._selectedFieldName.replace(/\[/g,"").replace(/\]/g,"")+"']").length>0):f._createSearchTreeview(o.enableMemberEditorPaging?l?t.DataManager(u._lastSavedTree).executeLocal(t.Query().sortBy("name",t.isNullOrUndefined(u._sortType)?"":u._sortType)):t.DataManager(u._editorTreeData).executeLocal(t.Query().where(t.Predicate("pid","equal",null).and("id","notequal","All").and("id","notequal","(All)_0")).page(u._memberPageSettings.currentMemeberPage,o.memberEditorPageSize).sortBy("name",t.isNullOrUndefined(u._sortType)?"":u._sortType)):u._editorTreeData,u);v={id:"SearchFilterSelection",type:u._isSelectSearchFilter?"nodeCheck":"nodeUncheck"};y=u.element.find(".e-editorTreeView");t.Pivot._updateSearchFilterSelection(v,y,u);u._waitingPopup.hide();u._parentNodeCollection={};u._parentSearchNodeCollection={}},0)}},_createSearchTreeview:function(i,r){var c=r.pluginName=="ejPivotSchemaDesigner"?r.model.pivotControl.model.enableMemberEditorPaging:r.model.enableMemberEditorPaging,e=r.pluginName=="ejPivotSchemaDesigner"?r.model.pivotControl.model.enableAdvancedFilter:r.model.enableAdvancedFilter,o=r.pluginName=="ejPivotSchemaDesigner"?r.model.pivotControl.model.enableMemberEditorSorting:r.model.enableMemberEditorSorting,s=r.element.find(".e-pvtBtn").parent("[data-tag='Slicers:"+(r._selectedFieldName||r._dialogHead)+"']").length>0,h={analysisMode:r.pluginName=="ejPivotSchemaDesigner"?r.model.pivotControl.model.analysisMode:r.model.analysisMode,operationalMode:r.pluginName=="ejPivotSchemaDesigner"?r.model.pivotControl.model.operationalMode:r.model.operationalMode},f,u;for(!r._isSearchApplied&&r._editorSearchTreeData.length==0&&i.length>0&&(r._lastSavedTree=i),i.length>0&&(i=t.DataManager(i).executeLocal(t.Query().where(t.Predicate("id","notequal","All").and("id","notequal","(All)_0"))),i.splice(0,0,{id:"All",name:e&&!s?"(Select All)":h.operationalMode==t.Pivot.OperationalMode.ServerMode?"(All)":"All",checkedStatus:r._isAllMemberChecked,_isAllMemberChecked:r._isAllMemberChecked})),r.element.find(".e-editorTreeView").ejTreeView({showCheckbox:!0,loadOnDemand:!0,enableRTL:r.model.enableRTL,beforeDelete:function(n){if(!t.isNullOrUndefined(n.event)&&n.event.type=="keydown"&&n.event.originalEvent.key.toLowerCase()=="delete")return!1},height:o?"200px":"245px",fields:{id:"id",text:"name",isChecked:"checkedStatus",parentId:"pid",expanded:"expanded",hasChild:"hasChildren",dataSource:t.Pivot._showEditorLinkPanel(i,r,r.pluginName=="ejPivotSchemaDesigner"?r.model.pivotControl:r)}}),f=r.element.find(".e-editorTreeView").find("li"),u=0;u<f.length;u++)t.isNullOrUndefined(n(f[u]).attr("id"))||n(f[u]).attr("data-tag",t.DataManager(i).executeLocal(t.Query().where("id","equal",n(f[u]).attr("id")))[0].tag);r._memberTreeObj=r.element.find(".e-editorTreeView").data("ejTreeView");r._memberTreeObj.model.nodeCheck=t.proxy(r._nodeCheckChanges,r);r._memberTreeObj.model.nodeUncheck=t.proxy(r._nodeCheckChanges,r);r.pluginName=="ejPivotGrid"?r.model.operationalMode==t.Pivot.OperationalMode.ClientMode?r._memberTreeObj.model.beforeExpand=t.proxy(r._beforeNodeExpand,r):r._memberTreeObj.model.nodeClick=t.proxy(r._nodeExpand,r):(r.model.pivotControl.model.operationalMode==t.Pivot.OperationalMode.ClientMode?r._memberTreeObj.model.beforeExpand=t.proxy(r._beforeNodeExpand,r):r._memberTreeObj.model.nodeClick=t.proxy(r._nodeExpand,r),r._memberTreeObj.model.beforeCollapse=t.proxy(t.Pivot._onNodeCollapse,r));t.isNullOrUndefined(r.element.find(".e-dialog .e-text:visible").first())||(r.element.find(".e-dialog .e-text:visible").length>0?(r.element.find(".e-dialog .e-text:visible").first().attr("tabindex","-1").addClass("e-hoverCell"),r.element.find(".e-dialog button").removeClass("e-hoverCell")):r.element.find(".e-dialog button:visible").first().attr("tabindex","-1").addClass("e-hoverCell"));r._memberTreeObj.element.find(".e-plus").length==0&&r._memberTreeObj.element.find(".e-minus").length==0&&r._memberTreeObj.element.find(".e-item").css("padding","0px");r.model.enableMemberEditorSorting&&this._separateAllMember(r)},_separateAllMember:function(n){var u=n.element.hasClass("e-pivotclient")&&n.model.operationalMode=="servermode"&&n.model.analysisMode=="olap",f=n.pluginName=="ejPivotSchemaDesigner"?n.model.pivotControl.model.enableAdvancedFilter:n.model.enableAdvancedFilter,i=n.pluginName=="ejPivotSchemaDesigner"?n.model.pivotControl.model.enableRTL:n.model.enableRTL,r=n.pluginName=="ejPivotSchemaDesigner"?n.model.pivotControl.model.analysisMode:n.model.analysisMode,o=u?"":t.buildTag("div.e-checkAllBox",t.buildTag("input#"+n._id+"_allelement.allMember","",{float:i?"right":"left"},{name:"row",type:"checkbox",tabindex:0})[0].outerHTML+" "+t.buildTag("label.e-allElementLabel",f?"(Select All)":"All",{"margin-left":"5px"})[0].outerHTML,{width:"100px",float:i?"right":"left"})[0].outerHTML,e=t.buildTag("div.memberSortDiv",t.buildTag("div.e-icon e-memberAscendingIcon",{margin:"5px"})[0].outerHTML+t.buildTag("div.e-icon e-memberDescendingIcon")[0].outerHTML,{height:"35px","margin-left":"5px",float:i?"left":"right"})[0].outerHTML,s=t.buildTag("div.memberSortingDiv",o+e,{height:"20px",margin:n.pluginName=="ejPivotSchemaDesigner"?i?r==t.Pivot.AnalysisMode.Pivot?"10px 15px 0px 21px":"10px 31px 0px 12px":r==t.Pivot.AnalysisMode.Pivot?"10px 0px 0px 8px":"10px 0px 0px 20px":i?r==t.Pivot.AnalysisMode.Pivot?"10px 15px 0px 20px":"10px 28px 0px 20px":r==t.Pivot.AnalysisMode.Pivot?"10px 0px 0px 20px":"10px 0px 0px 29px"});f&&n.element.find(".e-editorTreeView").css("margin-top","10px");n.element.find(".memberSortingDiv, .e-separateDiv").remove();r==t.Pivot.AnalysisMode.Pivot&&n.element.find(".e-editorTreeView").addClass("e-treeViewUl");u||n.element.find(".e-editorTreeView").before(s);(n.element.find(".e-editorTreeView li:first").attr("id")=="All"||n.element.find(".e-editorTreeView li:first").attr("id")=="(All)_0")&&n.element.find(".e-editorTreeView li:first").css("display","none");u?(n.element.find(".memberSortDiv, .e-separateDiv").remove(),n.element.find(".e-checkOptions").after(t.buildTag("div.e-separateDiv",{margin:"0px 5px"})[0].outerHTML),n.element.find(".e-checkOptions").append(e),f&&n.element.find(".e-editorTreeView").height(235)):(n.element.find(".memberSortingDiv").after(t.buildTag("div.e-separateDiv",{})[0].outerHTML),n.element.find(".allMember").ejCheckBox({size:"small",width:"40px",checked:n.element.find(".e-dialogOKBtn").attr("disabled")=="disabled"?!1:!0,change:t.proxy(n._nodeCheckChanges,n)}));n._sortType=="ascending"?n.element.find(".e-memberAscendingIcon").addClass("e-selectedSort"):n._sortType=="descending"&&n.element.find(".e-memberDescendingIcon").addClass("e-selectedSort")},_checkChanges:function(n){var t=this.pluginName=="ejPivotSchemaDesigner"?this.model.pivotControl:this;n.isChecked?t._nodeCheckChanges(n):n.isChecked||t._nodeUnCheckChanges(n)},_fetchMemberPageSuccess:function(i){var u,f=this.pluginName=="ejPivotSchemaDesigner"?this.model.pivotControl:this;i[0]!=r&&i.length>0?(u=i[0].Value,i[1]!=null&&i[1]!=r&&(this.model.customObject=i[1].Value)):i.d!=r&&i.d.length>0?(u=i.d[0].Value,i.d[1]!=null&&i.d[1]!=r&&(this.model.customObject=i.d[1].Value)):i!=r&&i.length>0?(u=i.EditorTreeInfo,i!=null&&i.customObject!=r&&(this.model.customObject=i.customObject)):i!=r&&(u=i.EditorTreeInfo,i!=null&&i.customObject!=r&&(this.model.customObject=i.customObject));this._memberPageSettings.endPage=this.pluginName=="ejPivotSchemaDesigner"?this.model.pivotControl.model.memberEditorPageSize:this.model.memberEditorPageSize;this._memberPageSettings.startPage=0;this._memberPageSettings.currentMemeberPage=1;filteredData=JSON.parse(u);this._editorTreeData=n.extend(!0,[],filteredData);f.model.enableAdvancedFilter&&(this._editorTreeData=n.map(this._editorTreeData,function(n){if(t.isNullOrUndefined(n.levels))return n}));(this.pluginName=="ejPivotSchemaDesigner"&&this.model.pivotControl&&this.model.pivotControl.model.enableAdvancedFilter&&this.model.pivotControl.model.analysisMode==t.PivotGrid.AnalysisMode.Olap&&this.model.pivotControl.model.operationalMode==t.PivotGrid.OperationalMode.ServerMode||this.pluginName=="ejPivotGrid"&&this.model.enableAdvancedFilter&&this.model.analysisMode==t.PivotGrid.AnalysisMode.Olap&&this.model.operationalMode==t.PivotGrid.OperationalMode.ServerMode)&&(this._memberPagingAvdData=filteredData.splice(filteredData.length-1,1));this._memberCount=t.DataManager(this._editorTreeData).executeLocal(t.Query().where(t.Predicate("pid","equal",null).and("id","notequal","All").and("id","notequal","(All)_0"))).length;filteredData=t.DataManager(this._editorTreeData).executeLocal(t.Query().where("pid","equal",null||r).page(this._memberPageSettings.currentMemeberPage,this.pluginName=="ejPivotSchemaDesigner"?this.model.pivotControl.model.memberEditorPageSize+1:this.model.memberEditorPageSize+1));this._fetchMemberSuccess({EditorTreeInfo:JSON.stringify(filteredData)})},_memberPageNodeUncheck:function(i,r){var f="",e=null,o=r.pluginName=="ejPivotSchemaDesigner"?r.model.pivotControl.model.enableMemberEditorPaging:r.model.enableMemberEditorPaging,u;n(i.currentElement).parent().parent().hasClass("e-editorTreeView")&&!r._isSearchApplied&&o?(f=t.DataManager(r._editorTreeData).executeLocal(t.Query().page(r._memberPageSettings.currentMemeberPage,r.pluginName=="ejPivotSchemaDesigner"?r.model.pivotControl.model.memberEditorPageSize+1:r.model.memberEditorPageSize+1).where("id","equal",i.currentElement.attr("id")))[0],t.isNullOrUndefined(r._editorSearchTreeData)||(e=t.DataManager(r._editorSearchTreeData).executeLocal(t.Query().page(r._memberPageSettings.currentMemeberPage,r.pluginName=="ejPivotSchemaDesigner"?r.model.pivotControl.model.memberEditorPageSize+1:r.model.memberEditorPageSize+1).where("id","equal",i.currentElement.attr("id")))[0])):(f=t.DataManager(r._editorTreeData).executeLocal(t.Query().where("id","equal",i.currentElement.attr("id")))[0],t.isNullOrUndefined(r._editorSearchTreeData)||(e=t.DataManager(r._editorSearchTreeData).executeLocal(t.Query().where("id","equal",i.currentElement.attr("id")))[0]));t.isNullOrUndefined(f)||(f.checkedStatus=!1,t.isNullOrUndefined(f.pid)||(u=t.DataManager(r._editorTreeData).executeLocal(t.Query().where("pid","equal",f.pid).where("checkedStatus","equal",!0)),t.isNullOrUndefined(u)||u.length!=0||t.Pivot._unSelectParentTreeNode(f,r)),u=t.DataManager(r._editorTreeData).executeLocal(t.Query().where("pid","equal",f.id)),!t.isNullOrUndefined(u)&&u.length>0&&t.Pivot._unSelectChildTreeNode(f,r));t.isNullOrUndefined(e)||(e.checkedStatus=!1,t.isNullOrUndefined(e.pid)||(u=t.DataManager(r._editorSearchTreeData).executeLocal(t.Query().where("pid","equal",e.pid).where("checkedStatus","equal",!0)),t.isNullOrUndefined(u)||u.length!=0||t.Pivot._unSelectParentTreeNode(e,r)),u=t.DataManager(r._editorSearchTreeData).executeLocal(t.Query().where("pid","equal",f.id)),!t.isNullOrUndefined(u)&&u.length>0&&t.Pivot._unSelectChildTreeNode(e,r))},_memberPageNodeCheck:function(i,r){var e="",o=null,s=r.pluginName=="ejPivotSchemaDesigner"?r.model.pivotControl.model.enableMemberEditorPaging:r.model.enableMemberEditorPaging,u,f;if(n(i.currentElement).parent().parent().hasClass("e-editorTreeView")&&!r._isSearchApplied&&s?(e=t.DataManager(r._editorTreeData).executeLocal(t.Query().page(r._memberPageSettings.currentMemeberPage,r.pluginName=="ejPivotSchemaDesigner"?r.model.pivotControl.model.memberEditorPageSize+1:r.model.memberEditorPageSize+1).where("id","equal",i.currentElement.attr("id")))[0],t.isNullOrUndefined(r._editorSearchTreeData)||(o=t.DataManager(r._editorSearchTreeData).executeLocal(t.Query().page(r._memberPageSettings.currentMemeberPage,r.pluginName=="ejPivotSchemaDesigner"?r.model.pivotControl.model.memberEditorPageSize+1:r.model.memberEditorPageSize+1).where("id","equal",i.currentElement.attr("id")))[0])):(e=t.DataManager(r._editorTreeData).executeLocal(t.Query().where("id","equal",i.currentElement.attr("id")))[0],t.isNullOrUndefined(r._editorSearchTreeData)||(o=t.DataManager(r._editorSearchTreeData).executeLocal(t.Query().where("id","equal",i.currentElement.attr("id")))[0])),!t.isNullOrUndefined(e)&&(e.checkedStatus=!0,t.isNullOrUndefined(e.pid)||t.Pivot._selectParentTreeNode(e,r),!t.isNullOrUndefined(e.id)&&(u=t.DataManager(r._editorTreeData).executeLocal(t.Query().where("pid","equal",e.id)),!t.isNullOrUndefined(u)&&u.length>0)))for(f=0;f<u.length;f++)u[f].checkedStatus=!0,(u[f].expanded||u[f].isChildMerged)&&t.Pivot._selectChildTreeNode(u[f],r);if(!t.isNullOrUndefined(o)&&(o.checkedStatus=!0,t.isNullOrUndefined(o.pid)||t.Pivot._selectParentTreeNode(o,r),!t.isNullOrUndefined(o.id)&&(u=t.DataManager(r._editorSearchTreeData).executeLocal(t.Query().where("pid","equal",o.id)),!t.isNullOrUndefined(u)&&u.length>0)))for(f=0;f<u.length;f++)u[f].checkedStatus=!0,t.Pivot._selectChildTreeNode(u[f],r)},_appendParentNodes:function(n,i,r){if(!t.isNullOrUndefined(i.pid)){var u,f;t.isNullOrUndefined(r._parentNodeCollection[i.pid])?(u=jQuery.extend(!0,[],t.DataManager(r._editorTreeData).executeLocal(t.Query().where("id","equal",i.pid))),r._parentNodeCollection[i.pid]=u):u=r._parentNodeCollection[i.pid];!t.isNullOrUndefined(u)&&u.length>0&&(t.isNullOrUndefined(r._parentSearchNodeCollection[u[0].id])?(f=jQuery.extend(!0,[],t.DataManager(n).executeLocal(t.Query().where("id","equal",u[0].id))),r._parentSearchNodeCollection[u[0].id]=u):f=r._parentSearchNodeCollection[u[0].id]);t.isNullOrUndefined(f)||(f.length==0?(u[0].expanded=!0,n.push(u[0]),t.isNullOrUndefined(u[0].pid)||this._appendParentNodes(n,u[0],r)):f[0].expanded=!0)}},_selectParentTreeNode:function(n,i){var r=t.DataManager(i._editorTreeData).executeLocal(t.Query().where("id","equal",n.pid));!t.isNullOrUndefined(r)&&r.length>0&&(r[0].checkedStatus=!0,this._selectParentTreeNode(r[0],i))},_selectChildTreeNode:function(n,i){var r=t.DataManager(i._editorTreeData).executeLocal(t.Query().where("pid","equal",n.id)),u;if(!t.isNullOrUndefined(r)&&r.length>0)for(u=0;u<r.length;u++)r[u].checkedStatus=!0,(r[u].expanded||r[u].isChildMerged)&&this._selectChildTreeNode(r[u],i)},_unSelectChildTreeNode:function(n,i){var r=t.DataManager(i._editorTreeData).executeLocal(t.Query().where("pid","equal",n.id)),u;if(!t.isNullOrUndefined(r)&&r.length>0)for(u=0;u<r.length;u++)r[u].checkedStatus=!1,(r[u].expanded||r[u].isChildMerged)&&this._unSelectChildTreeNode(r[u],i)},_unSelectParentTreeNode:function(n,i){var r=t.DataManager(i._editorTreeData).executeLocal(t.Query().where("id","equal",n.pid));!t.isNullOrUndefined(r)&&r.length>0&&(r[0].checkedStatus=!1,t.DataManager(i._editorTreeData).executeLocal(t.Query().where("pid","equal",r[0].pid).where("checkedStatus","equal",!0)).length==0&&this._unSelectParentTreeNode(r[0],i))},_getSelectedTreeState:function(n,i){var f,o,h,s,e,u;if(n){for(e=[],f=t.DataManager(i._editorTreeData).executeLocal(t.Query().where("pid","equal",null||r)),u=0;u<f.length;u++){if(o=t.DataManager(i._editorTreeData).executeLocal(t.Query().where("pid","equal",f[u].id)),h={caption:f[u].name,parentId:t.isNullOrUndefined(f[u].pid)?"None":f[u].pid,id:f[u].id,checked:f[u].checkedStatus,expanded:o.length>0?!0:!1,childNodes:[],tag:f[u].tag},o.length>0)for(s=0;s<o.length;s++)h.childNodes.push(this._getEditorSlicerInfo(o[s],i));e.push(h)}return JSON.stringify(e)}for(e="",u=0;u<i._editorTreeData.length;u++)i._editorTreeData[u].checkedStatus==!0&&(e+="::"+i._editorTreeData[u].id+"||"+i._editorTreeData[u].tag);return e},_getUnSelectedTreeState:function(n){for(var i="",t=0;t<n._editorTreeData.length;t++)n._editorTreeData[t].checkedStatus==!1&&(i+="::"+n._editorTreeData[t].id+"||"+n._editorTreeData[t].tag);return i},_getEditorSlicerInfo:function(n,i){var r=t.DataManager(i._editorTreeData).executeLocal(t.Query().where("pid","equal",n.id)),f={caption:n.name,parentId:t.isNullOrUndefined(n.pid)?"None":n.pid,id:n.id,checked:n.checkedStatus,expanded:r.length>0?!0:!1,childNodes:[],tag:n.tag},u;if(r.length>0)for(u=0;u<r.length;u++)f.childNodes.push(this._getEditorSlicerInfo(r[u],i));return f},_editorLinkPanelClick:function(){this.element.find(".e-dialog").hide();t.Pivot._createErrorDialog(this._getLocalizedLabels("EditorLinkPanelAlert").split("1000").join(this.model.maxNodeLimitInMemberEditor),this._getLocalizedLabels("Warning"),this)},_showEditorLinkPanel:function(i,r,u){var f,s;if(!u.model.enableMemberEditorPaging&&(u.model.analysisMode!=t.Pivot.AnalysisMode.Pivot||r._isSearchApplied||(r._editorTreeData=i),i.length>u.model.maxNodeLimitInMemberEditor+(r._isSearchApplied?1:0))){var h=[],e={},o={},c=!1;for(f=0;f<i.length;f++)t.isNullOrUndefined(e[i[f].pid])?(t.isNullOrUndefined(i[f].pid)||(s=n.grep(i,function(n){if(n.id==i[f].pid)return n}),s.length>0&&(o[i[f].pid]=s[0].expanded?!0:!1)),e[i[f].pid]=1):e[i[f].pid]++,e[i[f].pid]<=u.model.maxNodeLimitInMemberEditor+(r._isSearchApplied&&t.isNullOrUndefined(i[f].pid)?1:0)?h.push(i[f]):(t.isNullOrUndefined(o[i[f].pid])||o[i[f].pid])&&(c=!0);i=h;c&&r.element.find("div.e-linkOuterPanel").css("display","block")}return i},createErrorDialog:function(i){var r,u;t.Pivot.openPreventPanel(i);i.element.find(".e-errorDialog").length==0?(u=t.buildTag("div.e-errorDialog#"+this._id+"_ErrorDialog",t.buildTag("div.warningImg")[0].outerHTML+t.buildTag("div.warningContent",i._getLocalizedLabels("AlertMsg"))[0].outerHTML+t.buildTag("div",t.buildTag("button#"+this._id+"_ErrOKBtn.errOKBtn","OK")[0].outerHTML)[0].outerHTML).attr("title",i._getLocalizedLabels("Warning"))[0].outerHTML,i.element.append(u),i.element.find(".e-errorDialog").ejDialog({target:"#"+i._id,enableResize:!1,enableRTL:i.model.enableRTL,width:"400px"}),r=i.element.find(".e-errorDialog").data("ejDialog"),n("#"+r._id+"_wrapper").css({left:"50%",top:"50%"}),i.element.find(".errOKBtn").ejButton({type:t.ButtonType.Button,click:t.proxy(t.Pivot.errOKBtnClick,i)}),i.element.find(".e-dialog .e-close").attr("title",i._getLocalizedLabels("Close"))):(r=i.element.find(".e-errorDialog").data("ejDialog"),r.open())},errOKBtnClick:function(){this.element.find("#preventDiv").remove();var n=this.element.find(".e-errorDialog").data("ejDialog");n._ejDialog.find("div.e-dialog-icon").trigger("click")},doAjaxPost:function(i,u,f,e,o,s){var h,c,l,a=!0;f.XMLA==r?(h="application/json; charset=utf-8",c="json",l=n.proxy(e,this)):(h="text/xml",c="xml",f=f.XMLA,l=n.proxy(e,t.olap.base,s),a=t.browserInfo().name=="msie"&&t.browserInfo().version<=9?!1:!t.isNullOrUndefined(s)&&s.action!="loadFieldElements"?!0:!1);n.ajax({type:i,url:u,contentType:h,async:a,dataType:c,data:f,success:l,complete:t.proxy(function(t){n.proxy(t,this);var i={action:this._currentAction,customObject:"",element:this.element}},this),error:t.proxy(function(n){typeof this._ogridWaitingPopup!="undefined"&&this._ogridWaitingPopup!=null&&this._ogridWaitingPopup.hide();typeof oclientWaitingPopup!="undefined"&&oclientWaitingPopup!=null&&oclientWaitingPopup.hide();var t={action:this._drillAction!=""?this._drillAction:"initialize",customObject:"",element:this.element,Message:n};this._trigger("renderFailure",t);this.renderControlFromJSON("");this._dataModel=="XMLA"&&this._createErrorDialog(n.statusText,this._getLocalizedLabels("Error"));n.statusText},this)})},getCubeList:function(t,i){for(var f,u=[],r=0;r<n(i).find("row").length;r++)f=n(n(i).find("row")[r]),u.push({name:n(f).children("CUBE_NAME").text()});t.pvtCtrldObj.setCubeList(u)},generateTreeViewData:function(n){var t={catalog:n.model.pivotControl.model.dataSource.catalog,cube:n.model.pivotControl.model.dataSource.cube,url:n.model.pivotControl.model.dataSource.data,request:"MDSCHEMA_DIMENSIONS"};this._getTreeData(t,this.loadDimensionElements,{schemaData:n,action:"loadFieldElements"})},loadDimensionElements:function(i,u){var h,f=i.schemaData.model.pivotControl,c={},v=t.olap.base._getConnectionInfo(f.model.dataSource.data),o={},a=f.model.dataSource.providerName==t.olap.Providers.Mondrian,s;for(o={catalog:f.model.dataSource.catalog,cube:f.model.dataSource.cube,url:f.model.dataSource.data,request:"MDSCHEMA_DIMENSIONS"},f.schemaTreeView=[],f.reportItemNames=[],s=0;s<n(u).find("row").length;s++){var l=n(n(u).find("row")[s]),e=l.find("DIMENSION_UNIQUE_NAME").text(),h=l.find("DIMENSION_CAPTION").text();e.toLowerCase().indexOf("[measure")>=0?c={hasChildren:!0,isSelected:!1,id:e,name:h,spriteCssClass:e.toLowerCase()=="[measures]"?"e-folderCDB e-icon":"e-dimensionCDB e-icon",tag:e}:!n(n(u).find("row")[0]).find("HIERARCHY_CAPTION").length>0&&f.schemaTreeView.push({hasChildren:!0,isSelected:!1,id:a?e+"~#^Dim":e,name:h,spriteCssClass:"e-dimensionCDB e-icon",tag:e,defaultHierarchy:n(n(u).find("row")[s]).children("DEFAULT_HIERARCHY").text()})}f.schemaTreeView.splice(0,0,c);!f.model.enableDrillThrough||i.schemaData!=r&&i.schemaData.model.olap.showNamedSets?(o.request="MDSCHEMA_SETS",t.Pivot._getTreeData(o,t.Pivot.loadNamedSetElements,i)):(o.request="MDSCHEMA_HIERARCHIES",(t.isNullOrUndefined(f._fieldData)||!t.isNullOrUndefined(f._fieldData)&&t.isNullOrUndefined(f._fieldData.hierarchy))&&this._getFieldItemsInfo(f),f._fieldData.hierarchySuccess==r?t.Pivot._getTreeData(o,f.loadHierarchyElements,i):t.Pivot.loadHierarchyElements(i,f._fieldData.hierarchySuccess))},loadNamedSetElements:function(i,u){var e=i.schemaData.model.pivotControl,c={catalog:e.model.dataSource.catalog,cube:e.model.dataSource.cube,url:e.model.dataSource.data,request:"MDSCHEMA_HIERARCHIES"},u=e.model.dataSource,h=[],o,s,f;for(o=n.map(u.rows,function(n){if(n.fieldName!=r)return n.fieldName}),n.merge(o,n.map(u.columns,function(n){if(n.fieldName!=r)return n.fieldName})),n.merge(o,n.map(u.filters,function(n){if(n.fieldName!=r)return n.fieldName})),s=0;s<n(u).find("row").length;s++)f=n(n(u).find("row")[s]),n.inArray(f.find("DIMENSIONS").text().split(".")[0],h)>=0||(e.schemaTreeView.push({hasChildren:!0,isSelected:!1,pid:f.find("DIMENSIONS").text().split(".")[0],id:f.find("SET_DISPLAY_FOLDER").text()+"_"+f.find("DIMENSIONS").text().split(".")[0],name:f.find("SET_DISPLAY_FOLDER").text(),spriteCssClass:"e-folderCDB e-icon namedSets"}),h.push(f.find("DIMENSIONS").text().split(".")[0])),e.schemaTreeView.push({hasChildren:!0,isSelected:n.inArray("["+n.trim(f.children("SET_NAME").text())+"]",o)>=0,pid:f.find("SET_DISPLAY_FOLDER").text()+"_"+f.find("DIMENSIONS").text().split(".")[0],id:"["+n.trim(f.children("SET_NAME").text()).replace(/\&/g,"&")+"]",name:f.children("SET_CAPTION").text(),spriteCssClass:"e-namedSetCDB e-icon",tag:f.find("EXPRESSION").text()});t.isNullOrUndefined(e._fieldData)||e._fieldData.hierarchySuccess==r?t.Pivot._getTreeData(c,t.Pivot.loadHierarchyElements,i):t.Pivot.loadHierarchyElements(i,e._fieldData.hierarchySuccess)},loadHierarchyElements:function(i,u){var f=i.schemaData.model.pivotControl,v={catalog:f.model.dataSource.catalog,cube:f.model.dataSource.cube,url:f.model.dataSource.data,request:"MDSCHEMA_LEVELS"},c=f.model.dataSource,o,a=f.model.dataSource.providerName==t.olap.Providers.Mondrian,s;for(o=n.map(c.rows,function(n){if(n.fieldName!=r)return n.fieldName}),n.merge(o,n.map(c.columns,function(n){if(n.fieldName!=r)return n.fieldName})),n.merge(o,n.map(c.filters,function(n){if(n.fieldName!=r)return n.fieldName})),s=0;s<n(u).find("row").length;s++){var e=n(n(u).find("row")[s]),l=e.find("DIMENSION_UNIQUE_NAME").text(),h=e.find("HIERARCHY_UNIQUE_NAME").text(),y=n(f.schemaTreeView).filter(function(n,t){return t.tag==l}).map(function(n,t){return t});y.length>0&&(l!=h||a)&&f.schemaTreeView.push({hasChildren:!0,isSelected:n.inArray(h,o)>=0,pid:l+(a?"~#^Dim":""),id:h,name:e.find("HIERARCHY_CAPTION").text(),spriteCssClass:e.find("HIERARCHY_ORIGIN").text()!="2"&&e.find("HIERARCHY_ORIGIN").text()!="6"?"e-hierarchyCDB e-icon":"e-attributeCDB e-icon",tag:h})}t.Pivot._getTreeData(v,t.Pivot.loadLevelElements,i)},loadLevelElements:function(i,r){var u=i.schemaData.model.pivotControl,e=n.map(n(r).find("row"),function(t){if(parseInt(n(t).children("LEVEL_TYPE").text())!="1"&&n(t).children("HIERARCHY_UNIQUE_NAME").text().toLowerCase()!="[measures]")return{hasChildren:!1,isChecked:!1,id:n(t).find("LEVEL_UNIQUE_NAME").text(),pid:n(t).find("HIERARCHY_UNIQUE_NAME").text(),name:n(t).find("LEVEL_CAPTION").text(),tag:n(t).find("LEVEL_UNIQUE_NAME").text(),spriteCssClass:"e-level"+parseInt(n(t).children("LEVEL_NUMBER").text())+" e-icon"}}),f;n.merge(u.schemaTreeView,e);(!u.model.enableDrillThrough||u._fieldData.measureSuccess)&&(t.isNullOrUndefined(u._fieldData)||!u._fieldData.measureSuccess?(f={catalog:u.model.dataSource.catalog,cube:u.model.dataSource.cube,url:u.model.dataSource.data,request:"MDSCHEMA_MEASURES"},t.Pivot._getTreeData(f,t.Pivot.loadMeasureElements,i)):t.Pivot.loadMeasureElements(i,u._fieldData.measureSuccess))},loadMeasureGroups:function(i,r){t.isNullOrUndefined(i.pivotControl._fieldData)&&(i.pivotControl._fieldData={});i.pivotControl._fieldData.measuresGroups=n(r).find("row")},loadMeasureElements:function(i,u){var f=i.schemaData.model.pivotControl,c={catalog:f.model.dataSource.catalog,cube:f.model.dataSource.cube,url:f.model.dataSource.data,request:"MDSCHEMA_DIMENSIONS"},p=[],w=[],a,e,y;p=n.map(f.model.dataSource.values,function(n){if(n.measures!=r)return n.measures});f.reportItemNames=n.map(p,function(n){if(n.fieldName!=r)return n.fieldName});f.model.locale!="en-US"&&(c={catalog:f.model.dataSource.catalog,cube:f.model.dataSource.cube,url:f.model.dataSource.data,request:"MDSCHEMA_MEASUREGROUPS"},t.Pivot._getTreeData(c,t.Pivot.loadMeasureGroups,{pivotControl:f,action:"loadFieldElements"}));var b,k,d=[],g=[],s=[],nt=[],tt=[],l,it=f.pluginName=="ejPivotClient"&&(f.model.sortCubeMeasures==t.PivotAnalysis.SortOrder.Ascending||f.model.sortCubeMeasures==t.PivotAnalysis.SortOrder.Descending)&&f.model.sortCubeMeasures!=t.PivotAnalysis.SortOrder.None;if(it){for(sortType=f.model.sortCubeMeasures==t.PivotAnalysis.SortOrder.Ascending?"ascending":"descending",e=0;e<n(u).find("row").length;e++)g.push({name:n(u).find("row:eq("+e+") MEASURE_CAPTION").text()});for(k=t.DataManager(g).executeLocal(t.Query().sortBy("name",sortType)),n.each(k,function(t,i){for(var r=0;r<n(u).find("row").length;r++)i.name==n(u).find("row:eq("+r+") MEASURE_CAPTION").text()&&s.push(n(u).find("row:eq("+r+")"))}),e=0;e<s.length;e++)n.inArray(n(s[e]).children("MEASUREGROUP_NAME").text(),d)>=0||(d.push(n(s[e]).children("MEASUREGROUP_NAME").text()),nt.push({name:n(s[e]).children("MEASUREGROUP_NAME").text()}));b=t.DataManager(nt).executeLocal(t.Query().sortBy("name",sortType));n.each(b,function(t,i){for(var r=0;r<s.length;r++)i.name==n(s[r]).children("MEASUREGROUP_NAME").text()&&tt.push(n(s[r]))});l=tt}else l=n(u).find("row");for(e=0;e<l.length;e++){var v=n(l[e]),o=v.children("MEASUREGROUP_NAME").text(),h=v.find("MEASURE_UNIQUE_NAME").text();n.inArray(o,w)>=0||(f.model.locale!="en-US"?(y=n.map(f._fieldData.measuresGroups,function(t){if(n(t).children("MEASUREGROUP_NAME").text()==o)return n(t).children("MEASUREGROUP_CAPTION").text()}),a=y.length>0?y[0]:o):a=o,o!=""&&f.schemaTreeView.push({hasChildren:!0,isChecked:!1,pid:"[Measures]",id:o,name:a,spriteCssClass:"e-measureGroupCDB e-icon",tag:o}),w.push(o));f.schemaTreeView.push({hasChildren:!0,isSelected:n.inArray(h,f.reportItemNames)>=0,id:h,pid:o==""?"[Measures]":o,name:v.children("MEASURE_CAPTION").text(),spriteCssClass:"measure",tag:h});n.inArray(h,f.reportItemNames)>=0&&f.reportItemNames.splice(f.reportItemNames.indexOf(h),1)}!t.isNullOrUndefined(i.schemaData)&&(i.schemaData.model.olap.showKpi||f.model.enableKPI)?(treeNodeElement={hasChildren:!0,isChecked:!1,id:"folderStruct",name:"KPI",spriteCssClass:"kpiCDB e-folderCDB e-icon",tag:""},f.schemaTreeView.splice(1,0,treeNodeElement),c.request="MDSCHEMA_KPIS",t.Pivot._getTreeData(c,t.Pivot.loadKPIElements,i)):t.isNullOrUndefined(i.schemaData)||i.schemaData._createTreeView(this,f.schemaTreeView)},loadKPIElements:function(t,i){for(var r=t.schemaData.model.pivotControl,e=this.reportItemNames,a=[],o=0;o<n(i).find("row").length;o++){var f=n(n(i).find("row")[o]),u=f.children("KPI_CAPTION").text(),s=f.children("KPI_goal").text(),h=f.children("KPI_STATUS").text(),c=f.children("KPI_TREND").text(),l=f.find("KPI_VALUE").text();n.inArray(f.children("KPI_NAME").text(),a)>=0||(treeNodeElement={hasChildren:!0,isChecked:!1,pid:"folderStruct",id:u,name:u,spriteCssClass:"e-measureGroupCDB e-icon",tag:u},r.schemaTreeView.push(treeNodeElement),a.push(u));treeNodeElement={hasChildren:!0,isSelected:n.inArray(s,e)>=0,id:s,pid:u,name:r.model.enableKPI?"Goal":r._getLocalizedLabels("Goal"),spriteCssClass:"kpiGoal e-icon",tag:s};r.schemaTreeView.push(treeNodeElement);treeNodeElement={hasChildren:!0,isSelected:n.inArray(h,e)>=0,id:h,pid:u,name:r.model.enableKPI?"Status":r._getLocalizedLabels("Status"),spriteCssClass:"kpiStatus e-icon",tag:h};r.schemaTreeView.push(treeNodeElement);treeNodeElement={hasChildren:!0,isSelected:n.inArray(c,e)>=0,id:c,pid:u,name:r.model.enableKPI?"Trend":r._getLocalizedLabels("Trend"),spriteCssClass:"kpiTrend e-icon",tag:c};r.schemaTreeView.push(treeNodeElement);treeNodeElement={hasChildren:!0,isSelected:n.inArray(l,e)>=0,id:l,pid:u,name:r.model.enableKPI?"Value":r._getLocalizedLabels("Value"),spriteCssClass:"kpiValue e-icon",tag:l};r.schemaTreeView.push(treeNodeElement)}t.schemaData._createTreeView(this,r.schemaTreeView);delete r.reportItemNames;delete r.schemaTreeView},_createCalcMemberDialog:function(i,u){var u=t.isNullOrUndefined(u.model)?this:u,s="",h,l,o,a,e,c,f;s=i.length>1&&i[0]!=r?JSON.parse(i[0].Value):i.d!=r?JSON.parse(i.d[0].Value):JSON.parse(i.CubeTreeInfo);u.model.afterServiceInvoke!=null&&u._trigger("afterServiceInvoke",{action:"fetchCalcMemberTreeView",element:u.element,customObject:u.model.customObject});t.Pivot.openPreventPanel(u);u.element.find(".e-calcMemberDialog",".e-clientDialog",".e-dialog").remove();var y=t.buildTag("div.e-cubeBrowserCalcMember",t.buildTag("div#"+u._id+"_cubeTreeViewCalcMember.e-cubeTreeViewCalcMember")[0].outerHTML,{})[0].outerHTML,p=t.buildTag("label.lblCaption",u._getLocalizedLabels("Caption"),{})[0].outerHTML+t.buildTag("input#"+u._id+"_captionFieldCM.captionFieldCM","",{}).attr("aria-label",u._getLocalizedLabels("Caption"))[0].outerHTML,w=t.buildTag("label.lblexpression",u._getLocalizedLabels("Expression"),{})[0].outerHTML+t.buildTag("textarea#"+u._id+"_expressionFieldCM.e-textarea e-droppable expressionFieldCM"+(u.model.enableRTL?" e-rtl":""),"",{}).attr("aria-label",u._getLocalizedLabels("Expression"))[0].outerHTML,b=t.buildTag("label.lblmemberType",u._getLocalizedLabels("MemberType"),{})[0].outerHTML+t.buildTag("input#"+u._id+"_memberTypeFieldCM.memberTypeFieldCM","",{}).attr("aria-label",u._getLocalizedLabels("MemberType"))[0].outerHTML+t.buildTag("input#"+u._id+"_dimensionFieldCM.dimensionFieldCM","",{}).attr("aria-label","dimension")[0].outerHTML,k=t.buildTag("label.lblformat",u._getLocalizedLabels("FormatString"),{})[0].outerHTML+t.buildTag("input#"+u._id+"_formatFieldCM.formatFieldCM","",{}).attr("aria-label",u._getLocalizedLabels("FormatString"))[0].outerHTML+t.buildTag("input#"+u._id+"_customFormatFieldCM.customFormatFieldCM","",{}).attr("aria-label","custom format")[0].outerHTML,d=t.buildTag("div.e-calcMemberFieldPanel",p+w+b+k,{})[0].outerHTML,g=t.buildTag("button#"+u._id+"_btnOk.e-btnCalcMemberOk",u._getLocalizedLabels("OK"),{},{name:u._getLocalizedLabels("OK")}).attr("aria-label",u._getLocalizedLabels("OK")).attr("title",u._getLocalizedLabels("OK").replace(/(<([^>]+)>)/ig,""))[0].outerHTML,nt=t.buildTag("button#"+u._id+"_btnCancel.btnCalcMemberCancel",u._getLocalizedLabels("Cancel"),{},{name:u._getLocalizedLabels("Cancel")}).attr("aria-label",u._getLocalizedLabels("Cancel")).attr("title",u._getLocalizedLabels("Cancel").replace(/(<([^>]+)>)/ig,""))[0].outerHTML,tt=t.buildTag("div.e-calcMemberFooter",g+nt,{})[0].outerHTML;for(u._calcMemberDialog=t.buildTag("div#"+u._id+"_calcMemberDialog",y+d+tt,{})[0].outerHTML,n(u._calcMemberDialog).appendTo("#"+u._id),n("#"+u._id+"_calcMemberDialog").ejDialog({width:"auto",title:u._getLocalizedLabels("CalculatedMember"),cssClass:u.model.cssClass+" e-calcMemberDialog",enableModal:!1,target:"#"+u._id,enableRTL:u.model.enableRTL,enableResize:!1,close:t.proxy(function(){t.Pivot.closePreventPanel(u)},u),beforeOpen:t.proxy(function(){u.element.find(".e-calcMemberDialog .e-dialog").css("display","block")},u)}),u._calcMemberDialog=u.element.find("#"+u._id+"_calcMemberDialog").data("ejDialog"),n("#"+u._id+"_btnCancel").ejButton({type:t.ButtonType.Button,width:"80px",enableRTL:u.model.enableRTL,click:t.proxy(function(){u._calcMemberDialog.close();u._selectedCalcMember=null;t.Pivot.closePreventPanel(u)},u)}),n("#"+u._id+"_btnOk").ejButton({type:t.ButtonType.Button,width:"80px",enableRTL:u.model.enableRTL,click:t.proxy(function(){var e,s,i,o,r,f,c;if(n.trim(u.element.find("#"+u._id+"_captionFieldCM").val())==""||n.trim(u.element.find("#"+u._id+"_expressionFieldCM").val())==""){t.Pivot._createErrorDialog(u._getLocalizedLabels("EmptyField"),u._getLocalizedLabels("Warning"),u);return}if(u.element.find("#"+u._id+"_formatFieldCM").val()=="Custom"&&n.trim(u.element.find("#"+u._id+"_customFormatFieldCM").val())==""){t.Pivot._createErrorDialog(u._getLocalizedLabels("EmptyFormat"),u._getLocalizedLabels("Warning"),u);return}if(t.isNullOrUndefined(u._selectedCalcMember))for(e=0;e<u._calcMembers.length;e++)if(n.trim(u.element.find("#"+u._id+"_captionFieldCM").val()).toLowerCase()==u._calcMembers[e].name.toLowerCase())if(confirm(u._getLocalizedLabels("Confirm")))u._selectedCalcMember=n.trim(u.element.find("#"+u._id+"_captionFieldCM").val());else return;if(u._calcMemberDialog.close(),t.Pivot.closePreventPanel(u),s="",t.isNullOrUndefined(u._selectedCalcMember)||(r=t.DataManager(u._calcMembers).executeLocal(t.Query().where("name","equal",u._selectedCalcMember,!0)),!t.isNullOrUndefined(r)&&r.length>0&&(s=r[0].tag)),u._waitingPopup.show(),i={action:"calculatedMember",olapReport:u.currentReport,clientReports:u.reports,caption:u.currentCubeName+"%"+n.trim(u.element.find("#"+u._id+"_captionFieldCM").val()),expression:n.trim(u.element.find("#"+u._id+"_expressionFieldCM").val()),memberType:u.element.find("#"+u._id+"_memberTypeFieldCM").val(),dimension:u.element.find("#"+u._id+"_dimensionFieldCM").val(),formatString:u.element.find("#"+u._id+"_formatFieldCM").val()=="Custom"?n.trim(u.element.find("#"+u._id+"_customFormatFieldCM").val()):u.element.find("#"+u._id+"_formatFieldCM").val(),uniqueName:s,customObject:u.model.customObject},u.model.operationalMode==t.Pivot.OperationalMode.ServerMode)u.doAjaxPost("POST",u.model.url+"/"+u.model.serviceMethodSettings.calculatedMember,JSON.stringify(i),u._calcMemberDroppedSuccess);else{i.caption=i.caption.replace("%","");o="";o=i.memberType.toLowerCase().indexOf("measure")>-1?"[Measures].["+n.trim(i.caption)+"]":n(jQuery("[id*='["+i.dimension+"]']")[0]).attr("data-defaulthierarchy")+".["+n.trim(i.caption)+"]";r={caption:i.caption,expression:i.expression,tag:o,hierarchyUniqueName:"["+n.trim(i.dimension)+"].["+n.trim(i.dimension)+"]",memberType:i.memberType,formatString:i.formatString?i.formatString:i.format?i.format:null};i.memberType.toLowerCase().indexOf("measure")==-1&&u._selectedCalcMember!=null&&(t.Pivot.getReportItemByFieldName(this._schemaData._selectedFieldName,this.model.dataSource).item.hierarchyUniqueName=r.hierarchyUniqueName);u._selectedCalcMember=null;var l={id:i.caption,pid:"_0",name:i.caption,hasChildren:!1,spriteCssClass:"e-calcMemberCDB e-icon",tag:o,expression:i.expression,formatString:null,nodeType:0,hierarchyUniqueName:i.memberType=="Measure"?"":r.hierarchyUniqueName},h=!1,a=r.caption;u.model.calculatedMembers=n.grep(u.model.calculatedMembers,function(n){return n.caption==a&&(h=!0,n.caption=r.caption,n.expression=r.expression,n.hierarchyUniqueName=r.hierarchyUniqueName,n.memberType=i.memberType,n.formatString=i.formatString),n});f=u.element.find(".e-schemaFieldTree").data("ejTreeView").model.fields;f.dataSource[0].id!="_0"&&f.dataSource.splice(0,0,[{id:"_0",name:"Calculated Members",hasChildren:!0,spriteCssClass:"e-calcMemberGroupCDB e-icon",tag:""}][0]);h?(c=this._schemaData._selectedFieldName,f.dataSource=n.grep(f.dataSource,function(n){return n.id==c&&(n.expression=r.expression,n.hierarchyUniqueName=r.hierarchyUniqueName,n.expression=r.expression,n.memberType=r.memberType,n.formatString=r.formatString),n})):u.model.calculatedMembers.push(r);h?u.refreshControl():f.dataSource.push(l);t.Pivot._refreshFieldList(u)}},u)}),u.element.find("#"+u._id+"_cubeTreeViewCalcMember").ejTreeView({fields:{id:"id",parentId:"pid",text:"name",spriteCssClass:"spriteCssClass",dataSource:s},allowDragAndDrop:!0,enableRTL:u.model.enableRTL,allowDropChild:!1,allowDropSibling:!1,dragAndDropAcrossControl:!0,cssClass:"calcMemberTreeViewDragedNode",nodeDropped:t.proxy(function(t){t.target!=null&&t.target.attr("id")==""+u._id+"_expressionFieldCM"&&u.element.find("#"+u._id+"_expressionFieldCM").val(u.element.find("#"+u._id+"_expressionFieldCM").val()+n(t.droppedElement).attr("data-tag"))},u),beforeExpand:t.proxy(t.Pivot._getMemberChildNodes,u)}),u.element.find("#"+u._id+"_captionFieldCM").ejMaskEdit({name:"inputbox",inputMode:t.InputMode.Text,watermarkText:"",maskFormat:"",textAlign:u.model.enableRTL?"right":"left",width:"100%"}),u.element.find("#"+u._id+"_customFormatFieldCM").ejMaskEdit({name:"inputbox",inputMode:t.InputMode.Text,watermarkText:"",maskFormat:"",textAlign:u.model.enableRTL?"right":"left",width:"100%",cssClass:"e-calcMemberCustomFormat"}),u.element.find(".e-calcMemberCustomFormat").css("visibility","hidden"),u.element.find("#"+u._id+"_memberTypeFieldCM").ejDropDownList({dataSource:[{text:"Measure",value:"Measure"},{text:"Dimension",value:"Dimension"}],enableRTL:u.model.enableRTL,width:"100%",selectedIndex:0,change:t.proxy(function(n){n.text=="Dimension"?u.element.find(".e-calcMemberDimensionField").css("visibility","visible"):u.element.find(".e-calcMemberDimensionField").css("visibility","hidden")},u)}),h=t.DataManager(s).executeLocal(t.Query().where("spriteCssClass","contains","e-dimensionCDB")),l=[],f=0;f<h.length;f++)l.push({text:h[f].name,value:h[f].name});for(u.element.find("#"+u._id+"_dimensionFieldCM").ejDropDownList({dataSource:l,selectedIndex:0,width:"100%",enableRTL:u.model.enableRTL,cssClass:"e-calcMemberDimensionField"}),u.element.find(".e-calcMemberDimensionField").css("visibility","hidden"),u.element.find("#"+u._id+"_formatFieldCM").ejDropDownList({dataSource:[{text:"Standard",value:"Standard"},{text:"Currency",value:"Currency"},{text:"Percent",value:"Percent"},{text:"Custom",value:"Custom"}],enableRTL:u.model.enableRTL,selectedIndex:0,width:"100%",enableRTL:u.model.enableRTL,change:t.proxy(function(n){n.text=="Custom"?u.element.find(".e-calcMemberCustomFormat").css("visibility","visible"):u.element.find(".e-calcMemberCustomFormat").css("visibility","hidden")},u)}),o=u.element.find(".e-cubeTreeViewCalcMember").find("li"),f=0;f<o.length;f++)t.isNullOrUndefined(n(o[f]).attr("id"))||n(o[f]).attr("data-tag",t.DataManager(s).executeLocal(t.Query().where("id","equal",n(o[f]).attr("id")))[0].tag);for(a=u.element.find(".e-cubeTreeViewCalcMember .e-folderCDB"),f=0;f<a.length;f++)n(a[f].parentElement).removeClass("e-draggable");if(u.element.find(".e-cubeTreeViewCalcMember .calcMemberGroupCDB").length>0&&u.element.find(".e-cubeTreeViewCalcMember .calcMemberGroupCDB").parent().removeClass("e-draggable"),u._calcMemberTreeObj=u.element.find(".e-cubeTreeViewCalcMember").data("ejTreeView"),!t.isNullOrUndefined(u._selectedCalcMember)&&(e={},e=u.model.operationalMode==t.Pivot.OperationalMode.ServerMode?t.DataManager(u._calcMembers).executeLocal(t.Query().where("name","equal",u._selectedCalcMember)):t.DataManager(u.model.calculatedMembers).executeLocal(t.Query().where("caption","equal",u._selectedCalcMember)),e.length>0)){if(c=0,c=u.model.operationalMode==t.Pivot.OperationalMode.ServerMode?e[0].nodeType:e.length>0&&e[0].memberType&&(e[0].memberType=="dimension"||e[0].memberType=="Dimension")?1:0,u.element.find("#"+u._id+"_captionFieldCM").val(e[0].caption||e[0].name),u.element.find("#"+u._id+"_expressionFieldCM").val(e[0].expression),u.element.find("#"+u._id+"_memberTypeFieldCM").data("ejDropDownList").selectItemsByIndices(c),c==1){var it=u.model.operationalMode==t.Pivot.OperationalMode.ServerMode?e[0].tag:e[0].hierarchyUniqueName,rt=it.split(".")[0].replace(/\[/g,"").replace(/\]/g,""),v=u.element.find("#"+u._id+"_dimensionFieldCM").data("ejDropDownList").model.dataSource;for(f=0;f<v.length;f++)v[f].value==rt&&u.element.find("#"+u._id+"_dimensionFieldCM").data("ejDropDownList").selectItemsByIndices(f)}t.isNullOrUndefined(e[0].formatString)||(e[0].formatString=="Standard"?u.element.find("#"+u._id+"_formatFieldCM").data("ejDropDownList").selectItemsByIndices(0):e[0].formatString=="Currency"?u.element.find("#"+u._id+"_formatFieldCM").data("ejDropDownList").selectItemsByIndices(1):e[0].formatString=="Percent"?u.element.find("#"+u._id+"_formatFieldCM").data("ejDropDownList").selectItemsByIndices(2):(u.element.find("#"+u._id+"_formatFieldCM").data("ejDropDownList").selectItemsByIndices(3),u.element.find("#"+u._id+"_customFormatFieldCM").val(e[0].formatString)))}u._waitingPopup.hide()},_refreshFieldList:function(i){var e=i.element.find(".e-schemaFieldTree").data("ejTreeView"),o,f,u,s,r;for(e.refresh(),o=e.model.fields.dataSource,f=i.element.find(".e-schemaFieldTree li"),u=0;u<n(f).length;u++)s=n(n(f)[u]).attr("id"),r=n.map(o,function(n){if(n.id==s)return{tag:n.tag,expression:n.expression,defaultHierarchy:n.defaultHierarchy}}),r.length>0&&r[0]!=""&&(n(n(f)[u]).attr("data-tag",r[0].tag),t.isNullOrUndefined(r[0].expression)||n(n(f)[u]).attr("expression",r[0].expression),t.isNullOrUndefined(r[0].defaultHierarchy)||n(n(f)[u]).attr("data-defaultHierarchy",r[0].defaultHierarchy))},_getMemberChildNodes:function(i){var r,f,o;if((n(i.currentElement).find("a > span")[0].className.indexOf("level")>-1||n(i.currentElement).find("a > span")[0].className.indexOf("member")>-1)&&(r=t.DataManager(this._calcMemberTreeObj.dataSource()).executeLocal(t.Query().where("pid","equal",n(i.currentElement).attr("id")).where("name","equal","(Blank)")),!t.isNullOrUndefined(r)&&r.length>0))if(this._calcMemberTreeObj.hideNode(r[0].id),this.pNode=i.currentElement,this._waitingPopup.show(),f=n(i.currentElement).find("a > span")[0].className.indexOf("level")>-1?"level":"member",this.model.operationalMode==t.Pivot.OperationalMode.ClientMode){var u=this.model.dataSource,s=this.element.find(".e-cubeTreeViewCalcMember").data("ejTreeView"),e=n.map(s.model.fields.dataSource,function(t){if(t.id==n(i.currentElement).attr("id"))return t});if(n(i.currentElement).children("ul").children().length>1)this._waitingPopup&&this._waitingPopup.hide();else{e.length>0&&(this._calcExpanded=e[0]);var h="select {"+n(i.currentElement).attr("data-tag")+".members}dimension properties CHILDREN_CARDINALITY, MEMBER_TYPE on 0 from ["+n.trim(u.cube)+"]",c=t.olap._mdxParser.getSoapMsg(h,u.data,u.catalog),l=t.olap.base._getConnectionInfo(u.data);this.doAjaxPost("POST",l.url,{XMLA:c},t.proxy(this._generateCalculatedMember,this),null,{action:"fetchMembers"})}}else this.model.beforeServiceInvoke!=null&&this._trigger("beforeServiceInvoke",{action:"fetchMemberChildNodes",element:this.element,customObject:this.model.customObject}),o=JSON.stringify(this.model.customObject),this.doAjaxPost("POST",this.model.url+"/"+this.model.serviceMethodSettings.fetchMemberTreeNodes,JSON.stringify({action:"fetchMemberChildNodes",dimensionName:n(i.currentElement).attr("data-tag")+":"+f+":"+n(i.currentElement).attr("id"),olapReport:this.currentReport,customObject:o}),t.proxy(t.Pivot._fetchMemberSuccess,this))},_fetchMemberSuccess:function(u){var f=[],e,o;for(f=u.length>1&&u[0]!=r?JSON.parse(u[0].Value):u.d!=r?JSON.parse(u.d[0].Value):JSON.parse(u.MemberChildNodes),this.model.afterServiceInvoke!=null&&this._trigger("afterServiceInvoke",{action:"fetchMemberChildNodes",element:this.element,customObject:this.model.customObject}),this._calcMemberTreeObj.model.beforeExpand=null,this._calcMemberTreeObj.addNode(f,n(this.pNode)),e=t.DataManager(this._calcMemberTreeObj.dataSource()).executeLocal(t.Query().where("pid","equal",n(this.pNode).attr("id")).where("name","equal","(Blank)")),!t.isNullOrUndefined(e)&&e.length>0&&this._calcMemberTreeObj.removeNode(e[0].id),n.each(n(this.pNode).children().find("li"),function(n,t){t.setAttribute("data-tag",f[n].tag)}),o=n(this.pNode).children().find("li"),i=0;i<o.length;i++)f[i].hasChildren==!0&&(this._calcMemberTreeObj.addNode({id:f[i].id+"_Blank_"+i,name:"(Blank)",parentId:f[i].id},o[i]),this.element.find("#"+f[i].id).find("> div > div:first").removeClass("e-process"),this._calcMemberTreeObj.collapseNode(this.element.find("#"+f[i].id)));this._calcMemberTreeObj.model.beforeExpand=t.proxy(t.Pivot._getMemberChildNodes,this);this._waitingPopup.hide()},_drillThroughCellClick:function(r,u){var h,e,f,c,o,l,s;if(u._waitingPopup.show(),f=n(r.currentTarget.parentElement).attr("data-p"),u.model.operationalMode==t.PivotGrid.OperationalMode.ServerMode)e=n(u.element).parents(".e-pivotclient").length>0||n(u.element).parents(".e-maximumView").length>0?u._pivotClientObj:u,e.doAjaxPost("POST",e.model.url+"/"+e.model.serviceMethodSettings.drillThroughDataTable,JSON.stringify({currentReport:JSON.parse(u.getOlapReport()).Report,layout:u.model.layout,cellPos:f,selector:"",customObject:JSON.stringify(e.model.customObject)}),function(n){e._trigger("drillThrough",{element:u.element,data:n})});else{for(c=n("#"+u._id).find("tbody").find("tr:first").find("th").length,i=0;i<c;i++)o=u.getJSONRecords()[parseInt(i*u._rowCount+parseInt(f.split(",")[1]))].Info.indexOf("Measures")!=-1||u.getJSONRecords()[parseInt(i*u._rowCount+parseInt(f.split(",")[1]))].RowSpan<=1?u.getJSONRecords()[parseInt(i*u._rowCount+parseInt(f.split(",")[1]))].Info.split("::")[0]:"",o.indexOf("Measures")!=-1&&(h=o),o!=""&&(u._rowHeader[i]=o);for(l=n("#"+u._id).find("tbody").find('[data-p="'+parseInt(f.split(",")[0])+","+parseInt(f.split(",")[1])+'"]').closest("tbody").prev().children("tr").length,i=0;i<l;i++)s=u.getJSONRecords()[parseInt(parseInt(f.split(",")[0])*u._rowCount+i)].Info.indexOf("Measures")!=-1||u.getJSONRecords()[parseInt(parseInt(f.split(",")[0])*u._rowCount+i)].ColSpan<=1?u.getJSONRecords()[parseInt(parseInt(f.split(",")[0])*u._rowCount+i)].Info.split("::")[0]:"",s.indexOf("Measures")!=-1&&(h=s),s!=""&&(u._colHeader[i]=s);for((t.isNullOrUndefined(u._fieldData)||!t.isNullOrUndefined(u._fieldData)&&t.isNullOrUndefined(u._fieldData.hierarchy))&&u._getFieldItemsInfo(u),j=0;j<u._fieldData.measures.length;j++)h==u._fieldData.measures[j].id&&(u.measureGrp=u._fieldData.measures[j].pid);u._rowHeader=n.grep(u._rowHeader,function(n){return n==0||n});u._colHeader=n.grep(u._colHeader,function(n){return n==0||n});u._createDrillThroughQuery("",u)}},openHierarchySelector:function(n,i){var r,u,f;n.model.operationalMode==t.Pivot.OperationalMode.ServerMode?this._createDrillThroughDialog(n,i):(n._waitingPopup.show(),r=n.target.className.indexOf("e-pivotclient")>=0?n._pivotGrid:n,u=r._getConnectionInfo(n.model.dataSource.data),f='<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"><Header/><Body><Discover xmlns="urn:schemas-microsoft-com:xml-analysis"><RequestType>MDSCHEMA_MEASUREGROUP_DIMENSIONS<\/RequestType><Restrictions><RestrictionList><CATALOG_NAME>'+n.model.dataSource.catalog+"<\/CATALOG_NAME><CUBE_NAME>"+n.model.dataSource.cube+"<\/CUBE_NAME><MEASUREGROUP_NAME>"+r.measureGrp+"<\/MEASUREGROUP_NAME><\/RestrictionList><\/Restrictions><Properties><PropertyList><Catalog>"+n.model.dataSource.catalog+"<\/Catalog> <LocaleIdentifier>"+u.LCID+"<\/LocaleIdentifier><\/PropertyList><\/Properties><\/Discover><\/Body><\/Envelope>",this.doAjaxPost("POST",u.url,{XMLA:f},r._loadDimensionElements,null,{pvtGridObj:r,action:"loadMeasureElements"}))},_createDrillThroughDialog:function(i,r){var e,u,o,f;i.model.operationalMode!=t.PivotGrid.OperationalMode.ServerMode&&r.shift();i.element.find(".e-dialog:not(.e-calcMemberDialog, .e-calcMemberDialog .e-dialog), .e-clientDialog").remove();var s=t.buildTag("label#"+this._id+"_",i._getLocalizedLabels("SelectHierarchy"))[0].outerHTML,h="<br><textarea id='"+this._id+"_hrSel' style='width:270px; height:300px; resize:none; margin:0px 5px 0 5px'><\/textarea><\/br><br>",c="<div class=e-cubeTable style='width:200px; overflow:auto'><div valign=\"bottom\">"+this._createHierarchyBrowser()+"<\/div><\/div>",l=t.buildTag("div#"+this._id+"_dropDlg.dropDlg",'<table class="e-outerTable"><tr><td>'+c+"<\/td><td>"+s+h+"<\/td><\/tr><\/table>")[0].outerHTML+"<\/br>",a=t.buildTag("div",t.buildTag("button#"+this._id+"_btnOK.dialogBtnOK",i._getLocalizedLabels("OK")).attr("title",i._getLocalizedLabels("OK").replace(/(<([^>]+)>)/ig,""))[0].outerHTML+t.buildTag("button#"+this._id+"_btnCancel.dialogBtnCancel",i._getLocalizedLabels("Cancel")).attr("title",i._getLocalizedLabels("OK").replace(/(<([^>]+)>)/ig,""))[0].outerHTML,{float:"right",margin:"-5px 0 6px"})[0].outerHTML,v=t.buildTag("div#"+this._id+"_clientDialog.e-clientDialog",l+a,{opacity:"1"}).attr("title","Hierarchy Selector")[0].outerHTML;for(n(v).appendTo("#"+i._id),n("#"+this._id+"_btnOK, #"+this._id+"_btnCancel").ejButton(),n("#"+this._id+"_btnOK, #"+this._id+"_btnCancel").css({margin:"0 20px 20px 0",width:"50px"}),i.element.find(".e-clientDialog").ejDialog({width:550,target:"#"+i._id,enableResize:!1,enableRTL:i.model.enableRTL,close:t.proxy(t.Pivot.closePreventPanel,i)}),i.element.find(".cubeTreeViewHierarchy").ejTreeView({showCheckbox:!0,fields:{id:"id",parentId:"pid",text:"name",isChecked:"isSelected",spriteCssClass:"spriteCssClass",dataSource:i.model.operationalMode==t.PivotGrid.OperationalMode.ServerMode?t.isNullOrUndefined(r.d)?n.parseJSON(r):n.parseJSON(r.d):r},allowDragAndDrop:!0,allowDropChild:!1,allowDropSibling:!1,enableRTL:i.model.enableRTL?!0:!1,beforeDelete:function(){return!1},dragAndDropAcrossControl:!0,nodeDropped:t.proxy(this._hierarchyNodeDropped,i)}),i._tableTreeObj=i.element.find(".cubeTreeViewHierarchy").data("ejTreeView"),i._tableTreeObj.element.find(".e-ul").css({width:"100%",height:"100%"}),i._tableTreeObj.element.find(".e-chkbox-wrap").remove(),e=i._tableTreeObj.element.find("li"),u=0;u<e.length;u++)o=i.model.operationalMode==t.PivotGrid.OperationalMode.ServerMode?t.isNullOrUndefined(r.d)?n.parseJSON(r)[u].tag:n.parseJSON(r.d)[u].tag:r[u].tag,e[u].setAttribute("data-tag",o);i._tableTreeObj&&i._tableTreeObj.element.find("li").mouseover(t.proxy(function(t){n(t.target).parent().find(".e-measureGroupCDB, .e-dimensionCDB, .e-folderCDB").length>0&&n(t.target).css("cursor","default")},i));f=i;n("#"+this._id+"_btnOK").click(function(){var i=n("#"+this._id+"_hrSel").val();n(".e-dialog:not(.e-calcMemberDialog, .e-calcMemberDialog .e-dialog), .e-clientDialog, .drilltableDialog").remove();f._waitingPopup.show();t.olap._mdxParser._createDrillThroughQuery(i,f);f._waitingPopup.hide()});n("#"+this._id+"_btnCancel").click(function(){n(".e-dialog:not(.e-calcMemberDialog, .e-calcMemberDialog .e-dialog), .e-clientDialog").remove();f._waitingPopup.hide()});i.model.enableRTL&&(n(".e-dialog").addClass("e-rtl"),n(".dialogBtnCancel").css("margin","0 -70px 0 0"))},_createHierarchyBrowser:function(){return t.buildTag("div.cubeBrowserHierarchy",t.buildTag("div.cubeTreeViewHierarchy")[0].outerHTML,{width:"200px",height:"300px",overflow:"auto"})[0].outerHTML},_hierarchyNodeDropped:function(i){var r,f,u;if(i.dropTarget[0].id=="hrSel"&&(r=n(n(i.droppedElement).children()[0]).find(".e-dimensionCDB").length>0?this.model.operationalMode==t.PivotGrid.OperationalMode.ServerMode?n(i.droppedElement).find("li:first").attr("data-tag"):n(i.droppedElement).find("li:first")[0].id:n(i.droppedElement).find("li:first").length==0?this.model.operationalMode==t.PivotGrid.OperationalMode.ServerMode?n(i.droppedElement.parent().parent()).attr("data-tag"):n(i.droppedElement.parent().parent())[0].id:this.model.operationalMode==t.PivotGrid.OperationalMode.ServerMode?n(i.droppedElement).attr("data-tag"):i.droppedElementData.id,!t.isNullOrUndefined(r))){for(r=r.replace("[","[$"),f=0;f<n("#"+this._id+"_hrSel").val().split(",").length;f++)if(r==n("#"+this._id+"_hrSel").val().split(",")[f])return!1;u=this.element.find('#" + this._id + "_hrSel').val();u.length!=0?(u=u+","+r,this.element.find('#" + this._id + "_hrSel').val(u)):this.element.find('#" + this._id + "_hrSel').val(r)}},_generateDrillData:function(t,i){for(var e=n(i).find("row").children(),r=n.map(e,function(n){var t=n.textContent,i=n.tagName.replace(/_x005B_/g,"[").replace(/_x0020_/g," ").replace(/_x005D_/g,"]").replace(/_x0024_/g,"$").replace("].[","]-[");return'"'+i+'":"'+t+'"'}),o=r[0],u="",f=0;f<r.length;f++){if(r[f]==o){u+=u==""?"[{"+r[f]:"}, {"+r[f];continue}u+=","+r[f]}u+="}]";n(t.pvtGridObj.element).parents(".e-pivotclient").length>0?n(t.pvtGridObj.element).parents(".e-pivotclient").data("ejPivotClient")._trigger("drillThrough",{element:t.pvtGridObj.element,data:u}):t.pvtGridObj._trigger("drillThrough",{element:t.pvtGridObj.element,data:u})},_getFilterStateMember:function(i,r,u,f,e){if(u.filterItems.filterType=="include")if(u.filterItems.values.length==1)if(t.isNullOrUndefined(f._fieldSelectedMembers[u.fieldName.toLowerCase()])&&i){var o="select {"+u.filterItems.values[0]+"}dimension properties CHILDREN_CARDINALITY on 0 from ["+n.trim(f.model.dataSource.cube)+"]",s=t.olap._mdxParser.getSoapMsg(o,f.model.dataSource.data,f.model.dataSource.catalog),h=t.olap.base._getConnectionInfo(f.model.dataSource.data);this.doAjaxPost("POST",h.url,{XMLA:s},t.proxy(this._getInitialSlicerName,this),null,{controlObject:f,action:"fetchMembers"});e=f._slicerName}else i||(e=u.filterItems.values[0]);else e=f._getLocalizedLabels("MultipleItems");else e=r.length-(u.filterItems.values.indexOf("All")==-1?u.filterItems.values.length:u.filterItems.values.length-1)==1?r.filter(function(n){if(u.filterItems.values.indexOf(n)==-1)return n}):f._getLocalizedLabels("MultipleItems");return e},_getFilterState:function(i,u,f,e){var o="",h,s;if(e.model.operationalMode==t.Pivot.OperationalMode.ClientMode)i?(t.isNullOrUndefined(t.olap.base.olapCtrlObj)&&(t.olap.base.olapCtrlObj=e),(e._fieldSelectedMembers[f.fieldName.toLowerCase()]=="All"||t.isNullOrUndefined(e._fieldSelectedMembers[f.fieldName.toLowerCase()]))&&t.olap._mdxParser.getAllMember(e.model.dataSource,f.fieldName,e),o=e._fieldSelectedMembers[f.fieldName.toLowerCase()]=="All"||t.isNullOrUndefined(e._fieldSelectedMembers[f.fieldName.toLowerCase()])?e._allMember:e._fieldSelectedMembers[f.fieldName.toLowerCase()],o=this._getFilterStateMember(i,u,f,e,o)):o=this._getFilterStateMember(i,u,f,e,o);else if(e.model.analysisMode==t.Pivot.AnalysisMode.Pivot)if(h=t.isNullOrUndefined(e._tempFilterData)?[]:n.map(e._tempFilterData,function(n){return n[f.DimensionName]}),h.length>0&&e._fieldMembers[f.DimensionName])o=e._fieldMembers[f.DimensionName].length-h.length==1?e._fieldMembers[f.DimensionName].filter(function(n){if(h.indexOf(n)==-1)return n}):e._getLocalizedLabels("MultipleItems");else if(t.isNullOrUndefined(e._clientReportCollection))o=e._getLocalizedLabels("All");else for(s=0;s<e._clientReportCollection.length;s++)if(t.isNullOrUndefined(e._clientReportCollection[s]._fieldSelectedMembers)||(e._currentRecordName==""&&e.element.find("#"+e._id+"_reportList")!=r&&e.element.find("#"+e._id+"_reportList")[0].value==e._clientReportCollection[s].name?!1:!0)&&(e._currentRecordName==""||e._currentReportName!=e._clientReportCollection[s].name))o=e._getLocalizedLabels("All");else{e._fieldSelectedMembers[f.Tag]=e._clientReportCollection[s]._fieldSelectedMembers[f.DimensionName];o=e._fieldSelectedMembers[f.Tag]=="All"||e._fieldSelectedMembers[f.Tag]==r?e._getLocalizedLabels("All"):e._fieldSelectedMembers[f.Tag];break}else o=(e._fieldSelectedMembers[f.Tag]=="All"?f.AllMember:e._fieldSelectedMembers[f.Tag])||f.AllMember;return o},_getInitialSlicerName:function(t,i){t.controlObject._slicerName=n(n(i).find("Axis:eq(0) Tuple:eq(0)").children().children()[1]).text()},_getTreeViewItems:function(t){for(var r,e=t.element.find(".e-editorTreeView"),u=[],f=n(e).find(":input.nodecheckbox"),i=0;i<f.length;i++)r=n(f[i]).parents("li:eq(0)"),u.push({Id:r[0].id,name:n(r[0]).find("a:eq(0)").text()});return u},_getEditorMember:function(i,r,u){var f=u?r._schemaData._editorTreeData:r._editorTreeData,e=[],l,o,h,s;if(r.model.operationalMode==t.PivotGrid.OperationalMode.ClientMode){if(f.length==0){var a=this._getTreeViewItems(u?r._schemaData:r,f),v=n.extend(!0,[],u?r._schemaData._memberTreeObj.dataSource():r._memberTreeObj.dataSource()),c=n.map(a,function(i){if(i.Id!="All")return n.map(v,function(n){i.Id==n.id&&(i=n,i.name=t.isNullOrUndefined(i.parentId)?i.name+"_1":i.name)}),i}),o=n.map(c,function(t){return n.map(c,function(n){t.parentId==n.id&&(t.name=t.name+"_"+(Number(n.name.split("_")[n.name.split("_").length-1])+1))}),t});n.map(o,function(n){var t=n.name.split("_")[n.name.split("_").length-2],i=Number(n.name.split("_")[n.name.split("_").length-1]),r=n.checkedStatus;e.push({name:t,checked:r,level:Number(i)})})}else n.map(f,function(n){e.push({name:n.name,id:n.id,pid:n.pid,checked:n.checkedStatus,level:n.level})});return this._updateEditorMembers(i,e,r,f)}if(r.model.analysisMode==t.Pivot.AnalysisMode.Olap)return l=u?r._schemaData.element.find(".e-editorTreeView"):r.element.find(".e-editorTreeView"),o=f.length>0?f:n(l).find(":input.nodecheckbox"),f.length>0?n.map(o,function(n){e.push({name:n.name,id:n.id,pid:n.pid,checked:n.checkedStatus,level:Number(n.id.split("_")[n.id.split("_").length-1])})}):n.map(o,function(t){if(n(t).parents("li:eq(0)").attr("id")!="All"){var i=n(t).parent().siblings("a").text(),r=t.value.split("_")[t.value.split("_").length-1],u=t.checked||n(t.parentElement).attr("aria-checked")=="mixed"?!0:!1;e.push({name:i,checked:u,level:Number(r)})}}),this._updateEditorMembers(i,e,r,f);for(h=[],s=1;s<i.length;s++)h.push(n(i[s].parentElement).siblings("a").text());return h},_updateEditorMembers:function(i,r,u,f){var e,b,h,a,w,y;if(r.length>0&&r[0].name=="All"&&r.splice(0,1),!t.isNullOrUndefined(u._fieldMembers[i]))if(f.length==0){var p=[],o=0,l="",s=u._fieldMembers[i];for(e=0;e<r.length;e++)if(t.isNullOrUndefined(s[e+o])||r[e].level==s[e+o].level)p.push(r[e]);else if(t.isNullOrUndefined(s[e+o])||r[e].level<s[e+o].level){h=e;do r[e-1].checked&&p.push(s[h]),o++,h++;while(r[e].level<s[h].level);e--}else if(t.isNullOrUndefined(s[e+o])||r[e].level>s[e+o].level){b=s[e+o].level;h=e;do p.push(r[h]),o--,h++,e=h-1;while(r[h].level>b)}u._fieldMembers[i]=p}else a=n.extend(!0,[],u._fieldMembers[i]),w=[],n.each(r,function(n,t){for(var r=!1,i=0;i<a.length;i++)if(t.id==a[i].id){a.splice(i,1,t);r=!0;break}r||w.push(t)}),u._fieldMembers[i]=a.concat(w);u._fieldMembers[i]=t.isNullOrUndefined(u._fieldMembers[i])?r:u._fieldMembers[i];var v=1,k="",d="",c=[];do if(y=n.map(u._fieldMembers[i],function(n){if(n.level==v)return n}),c=n.map(y,function(n){if(n.checked)return n}),y.length==c.length)l=v==1?"All":k,y.length>1&&(d="All"),v++;else if(c.length==1)k=l=d=="All"?"multiple":c[0].name,v++;else if(c.length>1&&y.length>c.length){l="multiple";break}while(c.length>0&&l!="All"&&l!="multiple"&&n.map(u._fieldMembers[i],function(n){if(n.level==v)return n}).length>0);return l},_getTreeData:function(n,i,r){var u=t.olap.base._getConnectionInfo(n.url),f='<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"><Header/><Body><Discover xmlns="urn:schemas-microsoft-com:xml-analysis"><RequestType>'+n.request+"<\/RequestType><Restrictions><RestrictionList><CATALOG_NAME>"+n.catalog+"<\/CATALOG_NAME>"+(r.action=="loadcubelist"?"":"<CUBE_NAME>"+n.cube+"<\/CUBE_NAME>")+"<\/RestrictionList><\/Restrictions><Properties><PropertyList><Catalog>"+n.catalog+"<\/Catalog><LocaleIdentifier>"+u.LCID+"<\/LocaleIdentifier> <\/PropertyList><\/Properties><\/Discover><\/Body><\/Envelope>";r.action="loadFieldElements";this.doAjaxPost("POST",u.url,{XMLA:f},i,null,r)},updateTreeView:function(i){var o=i.element.find(".e-editorTreeView").find("li"),l=o.length,u=i._memberTreeObj.dataSource(),a=u.length,s,v,h,c,e,f;if(i.element.find(".e-editorTreeView").parents("#"+i._id+"_ClientDialog").find(".e-editorPara").text()==i._getLocalizedLabels("KPIs"))for(e=0;e<l;e++)for(s=n(o[e]).find("span:first").attr("aria-checked"),f=0;f<a;f++)o[e].id==u[f].id&&(s=="mixed"||s=="true")?t.isNullOrUndefined(u[f].parentId)?u[f].checkedStatus=!0:n(o[e].parentElement).parent().attr("id")==u[f].parentId&&(u[f].checkedStatus=!0):o[e].id==u[f].id&&s=="false"&&(t.isNullOrUndefined(u[f].parentId)?u[f].checkedStatus=!1:n(o[e].parentElement).parent().attr("id")==u[f].parentId&&(u[f].checkedStatus=!1));else for(e=0;e<l;e++)for(s=n(o[e]).find("span:first").attr("aria-checked"),f=0;f<a;f++)if(o[e].id==u[f].id&&(s=="mixed"||s=="true")){u[f].checkedStatus=!0;break}else if(o[e].id==u[f].id&&s=="false"){u[f].checkedStatus=!1;break}for(e=0;e<u.length;e++)if(v=!1,u[e].checkedStatus==!0){for(f=0;f<u.length;f++)if(u[f].hasOwnProperty("parentId")&&u[f].parentId==u[e].id&&u[f].checkedStatus==!0){v=!0;break}if(!v)for(h=0;h<u.length;h++)u[h].hasOwnProperty("parentId")&&u[h].parentId==u[e].id&&(u[h].checkedStatus=!0)}else if(u[e].checkedStatus==!1)for(c=0;c<u.length;c++)u[c].hasOwnProperty("parentId")&&u[c].parentId==u[e].id&&(u[c].checkedStatus=!1);for(e=0;e<l;e++)if(n(o[e]).attr("data-tag")==null||r)for(f=0;f<a;f++)if(n(o[e]).attr("id")==u[f].id){n(o[e]).attr("data-tag",u[f].tag);break}return i._memberTreeObj},getNodesState:function(n){for(var r="",u="",i=[],i=n.pluginName=="ejTreeView"?n.dataSource():n,t=0;t<i.length;t++)i[t].checkedStatus==!0?r+="::"+i[t].id+"||"+i[t].tag+"||"+(i[t].parentId||i[t].pid)+"||"+i[t].name:u+="::"+(i[t].parentId||i[t].pid)+"||"+i[t].tag+"||"+i[t].name;return{selectedNodes:r,unSelectedNodes:u}},removeParentSelectedNodes:function(t){for(var i,u=n.extend([],t),f=0;f<t.length;f++)for(i=0;i<u.length;i++)u[i].Id==t[f].parentId&&u.splice(i,1);return n.map(u,function(n){if(n.tag!=""&&n.tag!=r)return n.tag.replace(/\&/g,"&")})},getChildNodes:function(i,u,f,e,o){var s=i.targetElement,b=e.cube,k=e.catalog,d=e.data,g=o._generateChildMembers,p=n(i.currentElement).find("li").length,c=!1,h={memberEditorPageSize:o.pluginName=="ejPivotSchemaDesigner"?o.model.pivotControl.model.memberEditorPageSize:o.model.memberEditorPageSize,enableMemberEditorPaging:o.pluginName=="ejPivotSchemaDesigner"?o.model.pivotControl.model.enableMemberEditorPaging:o.model.enableMemberEditorPaging},l,v,y;if(h.enableMemberEditorPaging){for(l=0;l<o._memberTreeObj.dataSource().length;l++)if(o._memberTreeObj.dataSource()[l].parentId==i.id||o._memberTreeObj.dataSource()[l].pid==i.id){i.isChildLoaded=!0;t.Pivot.closePreventPanel(o);return}}else o._isSearchApplied=!1;if(jQuery.each(o._editorTreeData,function(n,t){if(t.id==i.id)return t.expanded=!0,t.isChildMerged=!0,!1}),p==0){var w=t.buildTag("span.nodeExpand e-load e-icon")[0].outerHTML,a=n(s).parents("li:eq(0)").attr("id"),nt=n.map(f,function(i){var f,e,l,v;i.fieldName!=u||t.isNullOrUndefined(i.filterItems)||(f=i.filterItems,(t.isNullOrUndefined(o.model.pivotControl)?o.model.enableMemberEditorPaging:o.model.pivotControl.model.enableMemberEditorPaging)?(f=n.map(f,function(n){if(n.pid!=r&&n.pid==a.replace(/\]*\]/g,"-").replace(/\[*\[/g,"-"))return c=!0,n}),f.length>0&&c==!0&&(e=t.Pivot._generateChildWithAncestors(o,n(s).parents("li:eq(0)"),h.enableMemberEditorPaging,h.memberEditorPageSize),h.enableMemberEditorPaging&&(f.length>=h.memberEditorPageSize||e.lstChildren.length>=h.memberEditorPageSize)?(o._isEditorDrillPaging=!0,o.element.find(".searchEditorTreeView").data("ejMaskEdit").clear(),o._lastSavedTree=[],t.Pivot._makeAncestorsExpandable(o,n(s).parents("li:eq(0)")[0].id),l=e.allLvlLst.length>1&&e.lstChildren.length>=h.memberEditorPageSize?t.Pivot._getParentsTreeList(o,e.lstParents[0].id,o._editorTreeData):n.grep(o._editorTreeData,function(t){return t.id==n(s).parents("li:eq(0)")["0"].id})[0],v={childNodes:e.allLvlLst.length>1&&e.lstChildren.length>=h.memberEditorPageSize?e.lstChildren:f,parentNode:l},t.Pivot._drillEditorTreeNode(v,o,h.memberEditorPageSize)):(n(s).parents("li:eq(0)").find(".nodeExpand").remove(),n(s).parents("li:eq(0)").removeClass("e-load"),n.each(f,function(n,t){delete t.parentId}),o._onDemandNodeExpand=!1,o._memberTreeObj.addNode(t.Pivot._showEditorLinkPanel(f,o,o.pluginName=="ejPivotSchemaDesigner"?o.model.pivotControl:o),n(s).parents("li:eq(0)")),o._onDemandNodeExpand=!1,o._memberTreeObj.model.nodeCheck=t.proxy(o._nodeCheckChanges,o),o._memberTreeObj.model.nodeUncheck=t.proxy(o._nodeCheckChanges,o),n.each(n(s).parents("li:eq(0)").find("li"),function(n,i){t.isNullOrUndefined(f[n])||i.setAttribute("data-tag",f[n].tag)})))):n.map(f,function(n){(n.parentId!=r&&n.parentId==a.replace(/\]*\]/g,"-").replace(/\[*\[/g,"-")||n.pid!=r&&n.pid==a.replace(/\]*\]/g,"-").replace(/\[*\[/g,"-"))&&(c=!0)}))});i.isChildLoaded=c?!0:!1;c?jQuery.grep(o._editorTreeData,function(n){if(n.pid==i.id)return n}).length>10&&o.element.find("a.e-linkPanel").css("display","block"):(n(s).parents("li:eq(0)").prepend(w),n(s).parents("li:eq(0)").attr("data-tag")==r&&(v=n.map(f,function(n){if(n.fieldName==u)return n})[0],v&&n.map(v.filterItems,function(t){t.id==n(s).parents("li:eq(0)").attr("id")&&n(s).parents("li:eq(0)").attr("data-tag",t.tag)})),y=n(s).parents("li:eq(0)").attr("data-tag").replace(/\&/g,"&"),t.olap._mdxParser.getChildren(e,y,o))}},_getFilterParams:function(n,i,r){var o="",f,u,e;if(n!="schemaValue"){if(f="",!t.isNullOrUndefined(i))for(u=0;u<i.length;u++)if(!t.isNullOrUndefined(i[u][r]))for(e=0;e<i[u][r].length;e++)f+="##"+i[u][r][e];f!=""&&(o=n+"::"+r+"::FILTERED"+f)}return o},generateChildMembers:function(i,r){var l=n(r).find("Axis:eq(0) Tuple"),f=[],a,u=this,s,y,h,p,w;t.isNullOrUndefined(u.olapCtrlObj)||(u=u.olapCtrlObj);var o={memberEditorPageSize:u.pluginName=="ejPivotSchemaDesigner"?u.model.pivotControl.model.memberEditorPageSize:u.model.memberEditorPageSize,enableMemberEditorPaging:u.pluginName=="ejPivotSchemaDesigner"?u.model.pivotControl.model.enableMemberEditorPaging:u.model.enableMemberEditorPaging},c={currentReportItems:u.pluginName=="ejPivotSchemaDesigner"?u.model.pivotControl._currentReportItems:u._currentReportItems,savedReportItems:u.pluginName=="ejPivotSchemaDesigner"?u.model.pivotControl._savedReportItems:u._savedReportItems},e=u.element.find("[data-tag='"+i.currentNode.replace(/&/g,"&")+"']");for(s=0;s<l.length;s++){var v=n(n(r).find("Axis:eq(0) Tuple:eq("+s+")").children().children()[0]).text(),b=n(n(r).find("Axis:eq(0) Tuple:eq("+s+")").children()).find("Caption").text()==""?"(Blank)":n(n(r).find("Axis:eq(0) Tuple:eq("+s+")").children()).find("Caption").text(),k={hasChildren:n(l[s]).find("CHILDREN_CARDINALITY").text()!="0",checkedStatus:n(n(e).find("input.nodecheckbox")[0]).parent().attr("aria-checked")=="true"?!0:!1,id:v.replace(/\]*\]/g,"-").replace(/\[*\[/g,"-").replace(/ /g,"_"),name:b,tag:v,level:parseInt(n(l[s]).find("LNum").text())};f.push(k)}f.length>0&&u.model.enableMemberEditorSorting&&u._sortType!=null&&(f=t.DataManager(f).executeLocal(t.Query().sortBy("name",u._sortType)));a=n(e).parents("li").length>1?n(e).parents("li").first():n(e).parents("li");n(n(a).find("input.nodecheckbox")[0]).ejCheckBox({checked:!1});u._memberTreeObj=u.element.find(".e-editorTreeView").data("ejTreeView");f.length>0&&(y=u.pluginName=="ejPivotGrid"?u._selectedField:u._selectedFieldName,n.map(c.currentReportItems,function(i){i.fieldName!=y||t.isNullOrUndefined(i.filterItems)||(n.each(f,function(t,i){i.pid=n(e).attr("id")}),n.merge(i.filterItems,f),u._editorTreeData=i.filterItems)}),c.currentReportItems.length==0&&u._editorTreeData.concat(f));e.find(".nodeExpand").remove();e.find(".e-load").removeClass("e-load");jQuery.each(u._editorTreeData,function(n,t){if(t.id==e["0"].id)return t.expanded=!0,!1});o.enableMemberEditorPaging?(h=t.Pivot._generateChildWithAncestors(u,e,o.enableMemberEditorPaging,o.memberEditorPageSize),f.length>=o.memberEditorPageSize||h.lstChildren.length>=o.memberEditorPageSize?(u._isEditorDrillPaging=!0,u.element.find(".searchEditorTreeView").data("ejMaskEdit").clear(),u._lastSavedTree=[],t.Pivot._makeAncestorsExpandable(u,e[0].id),p=h.allLvlLst.length>1&&h.lstChildren.length>=o.memberEditorPageSize?t.Pivot._getParentsTreeList(u,h.lstParents[0].id,u._editorTreeData):n.grep(u._editorTreeData,function(n){return n.id==e["0"].id})[0],w={childNodes:h.allLvlLst.length>1&&h.lstChildren.length>=o.memberEditorPageSize?h.lstChildren:f,parentNode:p},t.Pivot._drillEditorTreeNode(w,u,o.memberEditorPageSize)):u._memberTreeObj.addNode(t.Pivot._showEditorLinkPanel(f,u,u.pluginName=="ejPivotSchemaDesigner"?u.model.pivotControl:u),n(e))):u._memberTreeObj.addNode(t.Pivot._showEditorLinkPanel(f,u,u.pluginName=="ejPivotSchemaDesigner"?u.model.pivotControl:u),n(e));n.each(e.find("li"),function(n,i){t.isNullOrUndefined(f[n])||i.setAttribute("data-tag",f[n].tag)});c.savedReportItems=n.extend(!0,[],c.currentReportItems)},_generateChildWithAncestors:function(i,r,u,f){var c=[],o=[n.grep(i._editorTreeData,function(n){return n.id==r["0"].id})[0]],e=[],s,h;if(u){jQuery.each(i._editorTreeData,function(n,t){if(t.id==r["0"].id)return t.expanded=!0,!1});c.push(o[0]);do{for(s=[],e=[],h=0;h<o.length;h++)if(n.each(i._editorTreeData,function(n,i){t.isNullOrUndefined(i.pid)||i.pid!=o[h].id||(i.expanded&&(s.push(i),c.push(i)),e.push(i))}),e.length>=f)break;else e=[];if(o=s.length>0&&e.length<f?s:o,e.length>=f)break}while(s.length>0)}return{allLvlLst:c,lstParents:o,lstChildren:e}},_makeAncestorsExpandable:function(n,i){var r=t.DataManager(n._editorTreeData).executeLocal(t.Query().where("id","equal",i));r.length>0&&(r[0].expanded=!0,i=r[0].pid);!t.isNullOrUndefined(i)&&r.length>0&&this._makeAncestorsExpandable(n,i)},_jsonToEngine:function(n){for(var u,f=n,i=[],r=0;r<f.length;r++)u=parseInt(f[r].Index.split(",")[0]),t.isNullOrUndefined(i[u])?(i[u]=[],i[u].push(f[r])):i[u].push(f[r]);return i},_cropJson:function(i,r){var e=0,h=0,c=1,u={},o,s,f,a,y,l,b,k;if(u=i.model.operationalMode==t.Pivot.OperationalMode.ServerMode?{columns:JSON.parse(i.getOlapReport()).PivotColumns,rows:JSON.parse(i.getOlapReport()).PivotRows,values:JSON.parse(i.getOlapReport()).PivotCalculations}:{columns:i.model.dataSource.columns,rows:i.model.dataSource.rows,values:i.model.dataSource.values},o=u.columns.length+(u.values.length>0&&u.values[0].axis!="rows"?1:0),s=u.rows.length+(u.values.length>0&&u.values[0].axis=="rows"?1:0),o=o==0?1:o,s=s==0?1:s,i._drillAction==""&&i.model.enableCollapseByDefault){if(f=n.extend(!0,[],t.Pivot._jsonToEngine(r)),o+s>2){while(h<f[0].length)if(u.rows.length>1&&f[0][h].CSS.indexOf("summary")==-1&&h+c>o||u.columns.length==0&&u.values.length==0&&f[0][h].CSS.indexOf("summary")==-1||h>0&&c<u.columns.length){for(a=0;a<f.length;a++)f[a].splice(h,1);c++}else h++;for(c=1;e<f.length;)u.columns.length>1&&f[e][0].CSS.indexOf("summary")==-1&&e+c>s||u.rows.length==0&&u.values.length==0&&f[e][0].CSS.indexOf("summary")==-1||e>0&&c<u.rows.length?(f.splice(e,1),c++):e+=f[e][0].CSS.indexOf("summary")>-1?f[e][0].ColSpan:1}for(f=n.map(f,function(t){return[n.map(t,function(n){return(n.CSS=="summary rstot"||n.CSS=="summary cstot"||n.CSS=="summary stot")&&(n.State=2,n.Value=n.Value.replace("Total","")),n})]}),f[0][0].ColSpan=f[0][0].CSS=="none"&&u.values.length>0&&u.values[0].axis=="rows"&&u.rows.length>0?2:1,f[0][0].RowSpan=f[0][0].CSS=="none"&&u.values.length>0&&u.values[0].axis!="rows"&&u.columns.length>0?2:1,o=u.values.length>0&&u.values[0].axis=="rows"?u.values.length:1,s=u.values.length>0&&u.values[0].axis!="rows"?u.values.length:1,e=0;e<f[0].length;e++)f[0][e].CSS.indexOf("summary")>-1&&(f[0][e].RowSpan=o,f[0][e].ColSpan=1);for(e=0;e<f.length;e++)f[e][0].CSS.indexOf("summary")>-1&&(f[e][0].ColSpan=s,f[e][0].RowSpan=1);return n.map(f,function(n){return n})}if(i.model.enableCollapseByDefault||i._drillAction!=""){var v=0,f=n.extend(!0,[],t.Pivot._jsonToEngine(i._croppedJson)),d=n.extend(!0,[],t.Pivot._jsonToEngine(i._compJson)),p=n.extend(!0,[],i._compJson),w=i._drillParams.currRow==""?"column":"row";for(y=0;y<i._compJson.length;y++)if(parseInt(i._compJson[y].Index.split(",")[0])==0)v++;else break;return l=t.Pivot._getDrillRange(u,w,i,v,p),b=t.Pivot._sliceJson(u,w,o,s,i,p,l.startPos,l.endPos,v,f),i._drillAction=="drilldown"&&(k=t.Pivot._mergeJson(u,i,w,o,s,p,d,f,b,l.startPos,l.endPos,v)),n.map(i._drillAction=="drilldown"?k:b,function(n){return n})}return r},_getEnginePos:function(i,r,u){var f=n.map(t.isNullOrUndefined(u[parseInt(i.split(",")[0])])?u[parseInt(r.split(",")[0])]:u[parseInt(i.split(",")[0])],function(n,t){if(n.Index==n.Index.split(",")[0]+","+r.split(",")[1])return t})[0],e=n.map(u,function(t,i){var u=!1;return n.each(t,function(n,t){t.Index==r&&(u=!0)}),u?i:void 0})[0];return{colPos:e,rowPos:f}},_mergeJson:function(i,r,u,f,e,o,s,h,c,l,a,v){var d=t.Pivot._getIndices(u,o,r,h,l,a,v),rt=d.columnIndices,ut=d.rowIndices,ft=d.rowSpan,et=d.colSpan,nt=t.Pivot._getEnginePos(l,a,h),ot=nt.colPos,tt=nt.rowPos,it=[],p,g,k,b,w,y;if(u=="row"){if(t.isNullOrUndefined(h[parseInt(l.split(",")[0])+1])){p=parseInt(l.split(",")[0])+1;do it=n.map(s[p],function(n){if(ut.indexOf(parseInt(n.Index.split(",")[1]))>-1)return n.Span="Block",n}),h[p]=it,p++;while(p<et&&!r.model.enableCollapseByDefault)}}else if(parseInt(h[0][parseInt(l.split(",")[1])+1].Index.split(",")[1])!=parseInt(l.split(",")[1])+1)for(y=0;y<s.length;y++){p=parseInt(l.split(",")[1])+1;do g=s[y][p],rt.indexOf(parseInt(g.Index.split(",")[0]))>-1&&(g.Span="Block",h[y].splice(p,0,g)),p++;while(p<ft&&!r.model.enableCollapseByDefault)}if(u=="row"){for(w=0,y=0;y<h.length;y++)if(!t.isNullOrUndefined(h[y])){k=tt;b=0;do k==tt&&h[y].splice(k,1,c[w][b]),k++,b++,h[y].splice(k,0,c[w][b]);while(t.isNullOrUndefined(c[w][b])||parseInt(c[w][b].Index.split(",")[1])<parseInt(a.split(",")[1]));w++}}else for(w=c.length-1,y=ot;y>=e;y--)t.isNullOrUndefined(c[w])||h.splice(y,1,c[w]),w--;return t.Pivot._drillSpanCalculation(h,r)},_getIndices:function(i,r,u,f,e,o,s){var c=n.map(f,function(n){if(!t.isNullOrUndefined(n))return parseInt(n[0].Index.split(",")[0])}),l=n.map(f[0],function(n){if(!t.isNullOrUndefined(n))return parseInt(n.Index.split(",")[1])}),h;if(u.model.enableCollapseByDefault)i=="row"?c.push(parseInt(e.split(",")[0])+1):l.push(parseInt(e.split(",")[1])+1);else{var a=r[parseInt(o.split(",")[0])*s+parseInt(o.split(",")[1])],p=parseInt(a.Index.split(",")[0]),w=parseInt(a.Index.split(",")[1]),v=a.ColSpan,y=a.RowSpan;if(i=="row")for(h=p+1;h<v;h++)c.indexOf(h)==-1&&c.push(h);else for(h=w+1;h<y;h++)l.indexOf(h)==-1&&l.push(h)}return{columnIndices:c,rowIndices:l,colSpan:v,rowSpan:y}},_sliceJson:function(i,r,u,f,e,o,s,h,c,l){var w=[],kt=i.values.length>0&&i.values[0].axis!="rows"?1:0,tt,rt,et,vt,yt,pt,b,g,p,d,it,k,ht,v,y,a;if(e._drillAction=="drilldown"){var nt=r=="row"?"0,"+parseInt(s.split(",")[1]):parseInt(s.split(",")[0])+",0",wt=r=="row"?"0,"+parseInt(h.split(",")[1]):parseInt(h.split(",")[0])+",0",bt=t.Pivot._getIndices(r,o,e,l,s,h,c),dt=bt.columnIndices,gt=bt.rowIndices,ct=parseInt(nt.split(",")[0])*c+c,rt=0;nt=r=="row"?nt:parseInt(nt.split(",")[0])*c+",0";do{for(tt=r=="row"?parseInt(nt.split(",")[1]):parseInt(nt.split(",")[0]),rt=r=="row"?0:rt;!t.isNullOrUndefined(o[tt])&&(r=="column"?ct>tt:!0);)(r=="row"?dt.indexOf(parseInt(o[tt].Index.split(",")[0]))>-1:gt.indexOf(parseInt(o[tt].Index.split(",")[1]))>-1)&&(t.isNullOrUndefined(w[rt])&&(w[rt]=[]),w[rt].push(o[tt]),r=="row"&&rt++),tt=tt+(r=="row"?c:1);r=="column"&&(ct=ct+c,rt++);nt=r=="row"?"0,"+(parseInt(nt.split(",")[1])+1):parseInt(nt.split(",")[0])+c+",0"}while(nt!=(r=="row"?"0,"+(parseInt(wt.split(",")[1])+1):(parseInt(wt.split(",")[0])+1)*c+",0"));if((r=="row"?f-1>parseInt(e._drillParams.currPos.split(",")[0])+1:u-kt-1>parseInt(e._drillParams.currPos.split(",")[1])+1)&&e.model.enableCollapseByDefault){y=r=="row"?0:parseInt(e._drillParams.currPos.split(",")[1])+1;v=r=="row"?parseInt(e._drillParams.currPos.split(",")[0])+1:0;do{if(et=!1,!t.isNullOrUndefined(w[v])&&!t.isNullOrUndefined(w[v][y])&&w[r=="row"?v-1:v][r=="row"?y:y-1].CSS.indexOf("summary")==-1&&(w[v][y].CSS=="rowheader"||w[v][y].CSS=="colheader"||w[v][y].CSS=="none"||w[v][y].Value==""))if(r=="row")for(a=0;a<w.length;a++)t.isNullOrUndefined(w[a])||(w[a].splice(y,1),et=!0);else delete w[v],et=!0;r=="row"?y=et?y:y+1:v=v+1}while(r=="row"?y<w[0].length:v<w.length)}var v=parseInt(e._drillParams.currPos.split(",")[0])+(r=="row"?1:0),ut="",lt=0,at=0,y=parseInt(e._drillParams.currPos.split(",")[1])+1;if(e.model.enableCollapseByDefault)do{if(r=="row"?v==parseInt(e._drillParams.currPos.split(",")[0])+1:y==parseInt(e._drillParams.currPos.split(",")[1])+1){for(a=r=="row"?w[v].length-1:w.length-1;a>=0;a--)if((r!="column"||!t.isNullOrUndefined(w[a]))&&(p=r=="row"?w[v][a]:w[a][y],p.CSS.indexOf("summary")>-1)){p.State=2;p.Expander=1;var ot=v,d=y,st=0;if(r=="row"){do st++,ot++;while(!t.isNullOrUndefined(l[ot])&&(l[ot][0].CSS=="none"||l[ot][0].Value==""));p.ColSpan=st}else{do st++,d++;while(!t.isNullOrUndefined(l[0][d])&&(l[0][d].CSS=="none"||l[0][d].Value==""));p.RowSpan=st}p.Value=p.Value.replace(" Total","")}}else for(vt="",r=="column"&&(vt=n.map(w,function(n,i){if(!t.isNullOrUndefined(n))return i})[0]),a=r=="row"?w[v].length-1:w.length-1;a>=0;a--)r=="column"&&t.isNullOrUndefined(w[a])||(p=r=="row"?w[v][a]:w[a][y],yt=p.Value.replace(" Total",""),ut=ut==""&&p.Value.replace(" Total","")!=""?p.Value.replace(" Total",""):p.Value.replace(" Total","")!=""&&ut!=p.Value.replace(" Total","")?p.Value.replace(" Total",""):ut,yt!=""&&yt!=ut||a==0||vt==a?(p.CSS=r=="row"?"rowheader":"colheader",p.State=1,p.Expander=1,p.Value=ut,r=="row"?p.RowSpan=v>parseInt(e._drillParams.currPos.split(",")[0])-1?lt:p.RowSpan:p.ColSpan=y>parseInt(e._drillParams.currPos.split(",")[1])-1?at:p.ColSpan,lt=1,at=1):(p.CSS.indexOf("summary")>-1&&(r=="row"?p.ColSpan=parseInt(e._drillParams.currPos.split(",")[0])+2-v:p.RowSpan=parseInt(e._drillParams.currPos.split(",")[1])+2-y),lt++,at++));r=="row"?v--:y--}while(r=="row"?v>=0:y>=0)}else{var ft=t.Pivot._getEnginePos(s,h,l),v=ft.colPos,y=ft.rowPos;if(r=="row"){for(pt=0,n.each(l[0],function(n,t){if(parseInt(t.Index.split(",")[1])==parseInt(s.split(",")[1]))return pt=n,!1}),a=parseInt(s.split(",")[1]);a<parseInt(h.split(",")[1]);a++)for(b=0;b<l.length;b++)if(!t.isNullOrUndefined(l[b])){for(g="",p="",d=pt;d<l[b].length;d++)if(parseInt(l[b][d].Index.split(",")[1])==a){p=l[b][d];g=d;l[b].splice(d,1);break}t.isNullOrUndefined(l[b][g])||l[b][g].CSS!="none"&&l[b][g].Value!=""&&(l[b][g].CSS!="rowheader"||l[b][g].Expander!=0)||p.CSS!="rowheader"||(l[b][g].CSS="rowheader",l[b][g].Value=p.Value,l[b][g].State=p.State,l[b][g].Expander=p.Expander)}}else for(it=[],a=parseInt(s.split(",")[0]);a<parseInt(h.split(",")[0]);a++)if(it=it.length==0&&!t.isNullOrUndefined(l[a])?l[a]:it,delete l[a],parseInt(h.split(",")[0])-a==1){k=0;do(l[a+1][k].CSS=="none"||l[a+1][k].Value==""||l[a+1][k].CSS=="colheader"&&l[a+1][k].Expander==0)&&(l[a+1][k].CSS=it[k].CSS,l[a+1][k].Value=it[k].Value,l[a+1][k].State=it[k].State,l[a+1][k].Expander=it[k].Expander),k++;while(k<=parseInt(h.split(",")[1]))}if(ht=r=="row"?n.map(l[parseInt(h.split(",")[0])+1],function(n){if(n.CSS=="rowheader"||n.CSS.indexOf("summary")>-1)return n}).length:n.map(l,function(n){if(!t.isNullOrUndefined(n)&&!t.isNullOrUndefined(n[y+1])&&(n[y+1].CSS=="colheader"||n[y+1].CSS.indexOf("summary")>-1))return n}).length,ht==0)if(r=="row"){v=parseInt(h.split(",")[0])+1;do delete l[v],v++;while(!t.isNullOrUndefined(l[v])&&(l[v][0].CSS=="none"||l[v][0].Value==""))}else{y=parseInt(h.split(",")[1])+1;do{for(a=0;a<l.length;a++)t.isNullOrUndefined(l[a])||(l[a]=n.map(l[a],function(n){if(parseInt(n.Index.split(",")[1])!=y)return n}));y++}while(y<l[0][0].RowSpan-(i.values.length>0&&i.values[0].axis!="rows"?1:0))}if(ft=t.Pivot._getEnginePos(s,h,l),v=ft.colPos,y=ft.rowPos,r=="row"){for(a=0;a<l[parseInt(h.split(",")[0])].length;a++)if(l[parseInt(h.split(",")[0])][a].Index==h){l[parseInt(h.split(",")[0])][a].Value=l[parseInt(h.split(",")[0])][a].Value.replace(" Total","");l[parseInt(h.split(",")[0])][a].State=2;l[parseInt(h.split(",")[0])][a].ColSpan=ht==0?l[parseInt(h.split(",")[0])][a].ColSpan-1:l[parseInt(h.split(",")[0])][a].ColSpan;break}}else l[v][y].Value=l[v][y].Value.replace(" Total",""),l[v][y].State=2,l[v][y].RowSpan=ht==0?l[v][y].RowSpan-1:l[v][y].RowSpan;w=t.Pivot._drillSpanCalculation(l,e)}return w},_getDrillRange:function(i,r,u,f,e){var o=0,v=0,l="",h="",y=f,a=r=="row"?u._drillParams.currRow.split(">#>"):u._drillParams.currCol.split(">#>"),c,s;do{if(c=r=="row"?parseInt((o-1)/f):v,c+1==a.length)if((e[o].CSS!="none"&&e[o].Value!=""||t.isNullOrUndefined(e[r=="row"?o-f:o-1])||typeof e[r=="row"?o-f:o-1].Value!="string"||e[r=="row"?o-f:o-1].Value.replace(" Total","")!=n.trim(a[c<1?0:c-1]))&&(typeof e[o].Value!="string"||e[o].Value==""||e[o].Value.replace(" Total","")==n.trim(a[c]))||l=="")typeof e[o].Value=="string"&&e[o].Value.replace(" Total","")==n.trim(a[c])&&(l=l==""?e[o].Index:l);else{for(s=r=="row"?o-1:o-f;!t.isNullOrUndefined(e[s])&&e[s].CSS!="summary rstot"&&e[s].CSS!="summary cstot"&&e[s].CSS!="summary stot";)s=r=="row"?s-1:s-f;t.isNullOrUndefined(e[s])||(h=e[s].Index);break}else e[o].Value.replace(" Total","")==n.trim(a[c])&&(o=r=="row"?y*(c+1)+(o-1):o-y+1);o=r=="row"?o+1:o+f;v=o%f;r=="column"&&o>e.length&&(v++,o=v)}while(e.length>o&&h=="");return u._drillAction=="drillup"&&u.model.operationalMode==t.Pivot.OperationalMode.ClientMode&&(r=="column"&&i.values.length>0&&i.values[0].axis!="row"?h=parseInt(h.split(",")[0])-(i.values.length-1)+","+h.split(",")[1]:r=="row"&&i.values.length>0&&i.values[0].axis=="row"&&(h=h.split(",")[0]+","+(parseInt(h.split(",")[1])-(i.values.length-1)))),{startPos:l,endPos:h}},_drillSpanCalculation:function(i,r){for(var k,tt,h,f,s,e,o=r.model.operationalMode==t.PivotGrid.OperationalMode.ServerMode?JSON.parse(r.getOlapReport()).PivotCalculations:r.getOlapReport().values,w=r.model.operationalMode==t.PivotGrid.OperationalMode.ServerMode?JSON.parse(r.getOlapReport()).PivotColumns:r.getOlapReport().columns,b=r.model.operationalMode==t.PivotGrid.OperationalMode.ServerMode?JSON.parse(r.getOlapReport()).PivotRows:r.getOlapReport().rows,d=[],g=[],nt=n.map(i,function(n){if(!t.isNullOrUndefined(n))return n[0]}).length,u=0;u<i[0].length;u++){for(s=0,k=0,e=0;e<i.length;e++)t.isNullOrUndefined(i[e])||t.isNullOrUndefined(i[e][u])||(s++,i[e][u].ColSpan>nt-s+1&&(i[e][u].ColSpan=nt-s+1),i[e][u].CSS!="none"&&i[e][u].Value!=""&&k++);k==0&&d.push(u)}for(u=0;u<i.length;u++)t.isNullOrUndefined(i[u])||(tt=n.map(i[u],function(n,t){if(d.indexOf(t)==-1)return n.RowSpan>=i[u].length-t&&(n.RowSpan=i[u].length-t),n.CSS=="summary value"&&(n.RowSpan=1,n.ColSpan=1),n}),g[u]=tt);i=g;var it=w.length+(o.length>0&&o[0].axis!="rows"?o.length:0),rt=b.length+(o.length>0&&o[0].axis=="rows"?o.length:0),c=-1;do c++;while(!t.isNullOrUndefined(i[0])&&!t.isNullOrUndefined(i[0][c])&&(i[0][c].CSS=="none"||i[0][c].Value==""));i[0][0].RowSpan=c>it?it:c;c=o.length>0&&o[0].axis!="rows"?c-1:c;h=-1;f=0;do h++;while(!t.isNullOrUndefined(i[h])&&(i[h][0].CSS=="none"||i[h][0].Value==""));for(i[0][0].ColSpan=h>rt?rt:h,u=0;u<i[0].length;u++)for(s=o.length>0&&o[0].axis=="rows"?1:0,e=0;e<i[0][0].ColSpan;e++)t.isNullOrUndefined(i[e][u])||(s++,!(u==0&&e==0)&&i[e][u].ColSpan>i[0][0].ColSpan-s+1&&i[0][0].ColSpan-s+1>0&&(i[e][u].ColSpan=i[0][0].ColSpan-s+1));for(u=i[0][0].ColSpan-1;u<i.length;u++)if(s=o.length>0&&o[0].axis!="rows"?1:0,!t.isNullOrUndefined(i[u]))for(e=0;e<i[0][0].RowSpan;e++)s++,!(u==0&&e==0)&&i[u][e].RowSpan>i[0][0].RowSpan-s+1&&i[0][0].RowSpan-s+1>0&&(i[u][e].RowSpan=i[0][0].RowSpan-s+1);if(!t.isNullOrUndefined(b)&&b.length>1){h=o.length>0&&o[0].axis=="rows"?h-1:h;do{i[f]=n.map(i[f],function(n){return n.CSS.indexOf("summary")>-1&&(n.ColSpan=h-f),n});var a=0,v=!1,l="";for(u=i[f].length-1;u>=i[0][0].RowSpan;u--)i[f][u].CSS=="summary rstot"||i[f][u].CSS=="summary stot"?(t.isNullOrUndefined(i[f][u+1])||i[f][u+1].CSS!="rowheader"||(i[f][u+1].RowSpan=a),a=0,v=!0,l=""):i[0][0].RowSpan-u==0?i[f][u].RowSpan=v||l==i[f][u].Value?a+1:i[f][u].RowSpan:(l=i[f][u].Value,a++);f++}while(h>f+(o.length>0&&o[0].axis=="rows"?1:0))}if(!t.isNullOrUndefined(w)&&w.length>1){f=0;do{for(u=0;u<i.length;u++)!t.isNullOrUndefined(i[u])&&i[u][f].CSS.indexOf("summary")>-1&&(i[u][f].RowSpan=c-f);var y=0,v=!1,p="",l="",s=n.grep(i,function(n,i){if(!t.isNullOrUndefined(n)&&n[0].CSS!="none"&&n[0].Value!="")return p=p==""?i:p,n}).length;for(u=i.length-1;u>=p;u--)s-=!t.isNullOrUndefined(i[u])&&i[u][0].CSS!="none"&&i[u][0].Value!=""?1:0,t.isNullOrUndefined(i[u])||i[u][f].CSS!="summary cstot"&&i[u][f].CSS!="summary stot"?s!=0||t.isNullOrUndefined(i[u])?t.isNullOrUndefined(i[u])||(l=i[u][f].Value,y++):i[u][f].ColSpan=v||l==i[u][f].Value?y+1:i[u][f].ColSpan:(t.isNullOrUndefined(i[u+1])||t.isNullOrUndefined(i[u+1][f])||i[u+1][f].CSS!="rowheader"&&i[u+1][f].CSS!="colheader"||(i[u+1][f].ColSpan=y),y=0,v=!0,l="");f++}while(c>f+(o.length>0&&o[0].axis!="rows"?1:0))}return i},_calculatePagingSpan:function(i,r){var u,s,f;if(i!=null&&i!=""&&i.length>0){for(r._rowCount=0,u=jQuery.extend(!0,[],i),r._compJson=r._drillAction==""?jQuery.extend(!0,[],u):r._compJson,r._croppedJson=t.Pivot._cropJson(r,u),u=n.extend(!0,[],r._croppedJson),f=0;f<u.length;f++)if(parseInt(u[f].Index.split(",")[0])==0)r._rowCount++;else break;var e=r.model.operationalMode==t.PivotGrid.OperationalMode.ServerMode?JSON.parse(r.getOlapReport()).PivotRows.length:r.getOlapReport().rows.length,h=r.model.operationalMode==t.PivotGrid.OperationalMode.ServerMode?JSON.parse(r.getOlapReport()).PivotColumns.length:r.getOlapReport().columns.length,o=r.model.operationalMode==t.PivotGrid.OperationalMode.ServerMode?JSON.parse(r.getOlapReport()).PivotCalculations.length:r.getOlapReport().values.length,l=u.length/r._rowCount,c=u[0].RowSpan==0?0:u[0].RowSpan-1;for(f=c+r.model.dataSource.pagerOptions.seriesPageSize;f<u.length&&f<r._rowCount;f=f+r.model.dataSource.pagerOptions.seriesPageSize)if(u[f].CSS.indexOf("summary")>-1||u[f].CSS.indexOf("rowheader")>-1&&u[f].Expander==0&&u[f+r._rowCount]!=null&&u[f+r._rowCount].CSS.indexOf("value")>-1)continue;else e>1&&t.Pivot._calculateRowPagingSpan(f,u,1,e,r);for(s=u[0].ColSpan==0?0:u[0].ColSpan-1,f=(s+r.model.dataSource.pagerOptions.categoricalPageSize)*r._rowCount;f<u.length;f=f+r.model.dataSource.pagerOptions.categoricalPageSize*r._rowCount)if(u[f].CSS.indexOf("summary")>-1&&o<=1)continue;else if(r.model.dataSource.pagerOptions.categoricalPageSize==1&&(u[f].CSS.indexOf("stot")>-1&&u[f+r._rowCount]!=null&&u[f+r._rowCount].CSS.indexOf("gtot")>-1||u[f].CSS.indexOf("gtot")>-1&&u[f+r._rowCount]==null))continue;else t.Pivot._calculateColumnPagingSpan(f,u,1,h,o,r);r._relPagingRecords=jQuery.extend(!0,[],u);r._rowCount=0}},_generatePagingRecords:function(i){var e,nt,r,it,a,u,f;if(i._relPagingRecords!=null&&i._relPagingRecords.length>0){for(e=n.extend(!0,[],i._relPagingRecords),i._rowCount=0,r=0;r<e.length;r++)if(parseInt(e[r].Index.split(",")[0])==0)i._rowCount++;else break;var tt=e.length/i._rowCount,c=e[0].RowSpan==0?0:e[0].RowSpan-1,l=e[0].ColSpan==0?0:e[0].ColSpan-1,v=Math.ceil((tt-(l+1))/i.model.dataSource.pagerOptions.categoricalPageSize),y=Math.ceil((i._rowCount-(c+1))/i.model.dataSource.pagerOptions.seriesPageSize);i.model.dataSource.pagerOptions.categoricalCurrentPage=i.model.dataSource.pagerOptions.categoricalCurrentPage>v?v:i.model.dataSource.pagerOptions.categoricalCurrentPage;i.model.dataSource.pagerOptions.seriesCurrentPage=i.model.dataSource.pagerOptions.seriesCurrentPage>y?y:i.model.dataSource.pagerOptions.seriesCurrentPage;i._seriesPageCount=i.model.enablePaging?i._rowCount-(c+1):y;i._categPageCount=i.model.enablePaging?tt-(l+1):v;i._categCurrentPage=i.model.dataSource.pagerOptions.categoricalCurrentPage;i._seriesCurrentPage=i.model.dataSource.pagerOptions.seriesCurrentPage;var s=[],h=c+1+i.model.dataSource.pagerOptions.seriesPageSize,it=l+1+i.model.dataSource.pagerOptions.categoricalPageSize,rt,r,ut,o,p,w,b,k,d,g;for(rt=r=ut=o=p=w=b=k=d=g=0,u=0;u<c+1;u++){for(f=0;f<l+1;f++)e[r]!=null&&(s[o]=e[r],r=r+i._rowCount,o=o+h);r=++rt;o=++ut}for(p=r=c+(i.model.dataSource.pagerOptions.seriesCurrentPage==0||i.model.dataSource.pagerOptions.seriesCurrentPage==1?0:(i.model.dataSource.pagerOptions.seriesCurrentPage-1)*i.model.dataSource.pagerOptions.seriesPageSize)+1,w=o=c+1,u=0;u<i.model.dataSource.pagerOptions.seriesPageSize;u++){for(f=0;f<l+1;f++)e[r]!=null&&(s[o]=e[r],r=r+i._rowCount,o=o+h);if(r=++p,o=++w,r>i._rowCount-1)break}for(b=r=(l+1)*i._rowCount+(i.model.dataSource.pagerOptions.categoricalCurrentPage==0||i.model.dataSource.pagerOptions.categoricalCurrentPage==1?0:(i.model.dataSource.pagerOptions.categoricalCurrentPage-1)*i.model.dataSource.pagerOptions.categoricalPageSize*i._rowCount),k=o=(l+1)*h,u=0;u<c+1;u++){for(f=0;f<i.model.dataSource.pagerOptions.categoricalPageSize;f++)e[r]!=null&&(s[o]=e[r],r=r+i._rowCount,o=o+h);if(r=++b,o=++k,e[r]==null)break}for(d=r=(l+1)*i._rowCount+(i.model.dataSource.pagerOptions.categoricalCurrentPage==0||i.model.dataSource.pagerOptions.categoricalCurrentPage==1?0:(i.model.dataSource.pagerOptions.categoricalCurrentPage-1)*i.model.dataSource.pagerOptions.categoricalPageSize*i._rowCount)+c+(i.model.dataSource.pagerOptions.seriesCurrentPage==0||i.model.dataSource.pagerOptions.seriesCurrentPage==1?0:(i.model.dataSource.pagerOptions.seriesCurrentPage-1)*i.model.dataSource.pagerOptions.seriesPageSize)+1,g=o=(l+1)*h+c+1,nt=0,u=0;u<i.model.dataSource.pagerOptions.seriesPageSize;u++){for(f=0;f<i.model.dataSource.pagerOptions.categoricalPageSize;f++)e[r]!=null&&(s[o]=e[r],nt=parseInt(e[r].Index.split(",")[1]),r=r+i._rowCount,o=o+h);if(r=++d,o=++g,e[r]==null||nt>parseInt(e[r].Index.split(",")[1]))break}for(i._rowCount=0,s=s.filter(function(n){return n!=null}),h=0,r=0;r<s.length;r++)if(parseInt(s[r].Index.split(",")[0])==0)h++;else break;for(it=s.length/h,u=0;u<it;u++)for(f=0;f<h;f++)t.isNullOrUndefined(s[u*h+f])||(s[u*h+f].Index=""+u+","+f+"");for(a=t.Pivot._drillSpanCalculation(t.Pivot._jsonToEngine(s),i),u=0;u<a.length;u++)for(f=0;f<a[u].length;f++)a[u][f].Index=u+","+f;return n.map(a,function(n){return n})}},_calculateRowPagingSpan:function(n,i,r,u,f){var o,e;if(i[n].CSS.indexOf("summary")>-1||i[n].CSS.indexOf("rowheader")>-1&&i[n].Expander==0&&r<u&&i[n+f._rowCount]!=null&&i[n+f._rowCount].CSS.indexOf("value")>-1)return!1;if(i[n].Expander==1&&i[n].RowSpan>1)i[n+1].RowSpan=i[n].RowSpan-1,i[n].RowSpan=1,i[n+1].Expander=i[n].Expander,i[n+1].State=i[n].State,i[n+1].Value=i[n].Value,i[n+1].CSS=i[n].CSS,i[n+f._rowCount].CSS.indexOf("value")==-1&&r<u-1&&t.Pivot._calculateRowPagingSpan(n+f._rowCount,i,r+1,u,f);else if(i[n].Expander==0&&i[n+f._rowCount]!=null&&r<u&&i[n+f._rowCount].CSS.indexOf("value")==-1)for(o=1,e=n-1;e>=0;e--)if(o++,i[e].Expander==1){i[e].RowSpan!=o&&(i[n+1].RowSpan=i[e].RowSpan-o,i[e].RowSpan=o,i[n+1].Expander=i[e].Expander,i[n+1].State=i[e].State,i[n+1].Value=i[e].Value,i[n+1].CSS=i[e].CSS,i[n+f._rowCount].CSS.indexOf("value")==-1&&r<u-1&&t.Pivot._calculateRowPagingSpan(n+f._rowCount,i,r+1,u,f));break}},_calculateColumnPagingSpan:function(n,i,r,u,f,e){var s,o;if(i[n].CSS.indexOf("summary")>-1&&f<=1)return!1;if(i[n+e._rowCount]!=null&&(i[n].Expander==1&&i[n].ColSpan>1||i[n].CSS.indexOf("summary")>-1&&i[n].ColSpan>1||r==u&&f>1&&i[n].ColSpan>1))i[n+e._rowCount].ColSpan=i[n].ColSpan-1,i[n].ColSpan=1,i[n+e._rowCount].Expander=i[n].Expander,i[n+e._rowCount].RowSpan=i[n].RowSpan,i[n+e._rowCount].State=i[n].State,i[n+e._rowCount].Value=i[n].Value,i[n+e._rowCount].CSS=i[n].CSS,r<u&&i[n].CSS.indexOf("summary")==-1&&t.Pivot._calculateColumnPagingSpan(n+1,i,r+1,u,f,e);else if(i[n].Expander==0&&i[n+e._rowCount]!=null&&i[n+e._rowCount].Expander!=1)for(s=1,o=n-e._rowCount;o>=0;o=o-e._rowCount)if(s++,i[o].Expander==1||i[o].CSS.indexOf("summary")>-1&&i[o].ColSpan>1||r==u&&f>1&&i[o].ColSpan>1){i[o].ColSpan!=s&&(i[n+e._rowCount].ColSpan=i[o].ColSpan-s,i[o].ColSpan=s,i[n+e._rowCount].RowSpan=i[o].RowSpan,i[n+e._rowCount].Expander=i[o].Expander,i[n+e._rowCount].State=i[o].State,i[n+e._rowCount].Value=i[o].Value,i[n+e._rowCount].CSS=i[o].CSS,r<u&&i[o].CSS.indexOf("summary")==-1&&t.Pivot._calculateColumnPagingSpan(n+1,i,r+1,u,f,e));break}},createAdvanceFilterTag:function(i,r){var f="",k=t.buildTag("li.e-separator").css("margin-left","29px")[0].outerHTML,e=r.element.hasClass("e-pivotschemadesigner")?r.model.pivotControl.model.operationalMode:r.model.operationalMode,b=r.element.hasClass("e-pivotschemadesigner")?r.model.pivotControl.model.analysisMode:r.model.analysisMode,h,c,o,a,v,u,s,y,l,p,w;if(i.action=="filterTag")f=[{id:"ascOrder",text:r._getLocalizedLabels("SortAtoZ"),parentId:null,spriteCssClass:"e-ascImage e-icon"},{id:"descOrder",text:r._getLocalizedLabels("SortZtoA"),parentId:null,spriteCssClass:"e-descImage e-icon"},{id:"clearSorting",text:r._getLocalizedLabels("ClearSorting"),parentId:null,spriteCssClass:"e-clrSort e-icon"},{id:"sep1",parentId:null,text:"",spriteCssClass:"e-seperator"},{id:"clearAllFilters",text:r._getLocalizedLabels("ClearFilterFrom"),parentId:null,spriteCssClass:"e-clrFilter e-icon"},{id:"labelFilterBtn",text:r._getLocalizedLabels("LabelFilters"),parentId:null},{id:"valueFilterBtn",text:r._getLocalizedLabels("ValueFilters"),parentId:null},{id:"labelClearFilter",parentId:"labelFilterBtn",text:r._getLocalizedLabels("ClearFilter"),spriteCssClass:"e-clrFilter e-icon"},{id:"sep2",parentId:"labelFilterBtn",text:"",spriteCssClass:"e-seperator"},{id:"equals_labelFilter",parentId:"labelFilterBtn",text:r._getLocalizedLabels("Equals"),spriteCssClass:"sprite"},{id:"notequals_labelFilter",parentId:"labelFilterBtn",text:r._getLocalizedLabels("DoesNotEquals")+"...",spriteCssClass:"sprite"},{id:"sep3",parentId:"labelFilterBtn",text:"",spriteCssClass:"e-seperator"},{id:"beginswith",parentId:"labelFilterBtn",text:r._getLocalizedLabels("BeginsWith")+"...",spriteCssClass:"sprite"},{id:"notbeginswith",parentId:"labelFilterBtn",text:r._getLocalizedLabels("DoesNotBeginsWith")+"...",spriteCssClass:"sprite"},{id:"endswith",parentId:"labelFilterBtn",text:r._getLocalizedLabels("EndsWith")+"...",spriteCssClass:"sprite"},{id:"notendswith",parentId:"labelFilterBtn",text:r._getLocalizedLabels("DoesNotEndsWith")+"...",spriteCssClass:"sprite"},{id:"sep4",parentId:"labelFilterBtn",text:"",spriteCssClass:"e-seperator"},{id:"contains",parentId:"labelFilterBtn",text:r._getLocalizedLabels("Contains")+"...",spriteCssClass:"sprite"},{id:"notcontains",parentId:"labelFilterBtn",text:r._getLocalizedLabels("DoesNotContains")+"...",spriteCssClass:"sprite"},{id:"sep5",parentId:"labelFilterBtn",text:"",spriteCssClass:"e-seperator"},{id:"greaterthan_labelFilter",parentId:"labelFilterBtn",text:r._getLocalizedLabels("GreaterThan")+"...",spriteCssClass:"sprite"},{id:"greaterthanorequalto_labelFilter",parentId:"labelFilterBtn",text:r._getLocalizedLabels("GreaterThanOrEqualTo")+"...",spriteCssClass:"sprite"},{id:"lessthan_labelFilter",parentId:"labelFilterBtn",text:r._getLocalizedLabels("LessThan")+"...",spriteCssClass:"sprite"},{id:"lessthanorequalto_labelFilter",parentId:"labelFilterBtn",text:r._getLocalizedLabels("LessThanOrEqualTo")+"...",spriteCssClass:"sprite"},{id:"valueClearFilter",parentId:"valueFilterBtn",text:r._getLocalizedLabels("ClearFilter"),spriteCssClass:"e-clrFilter e-icon"},{id:"sep6",parentId:"valueFilterBtn",text:"",spriteCssClass:"e-seperator"},{id:"equals_valueFilter",parentId:"valueFilterBtn",text:r._getLocalizedLabels("Equals"),spriteCssClass:"equals"},{id:"notequals_valueFilter",parentId:"valueFilterBtn",text:r._getLocalizedLabels("DoesNotEquals")+"...",spriteCssClass:"sprite"},{id:"sep7",parentId:"valueFilterBtn",text:"",spriteCssClass:"e-seperator"},{id:"greaterthan_valueFilter",parentId:"valueFilterBtn",text:r._getLocalizedLabels("GreaterThan")+"...",spriteCssClass:"sprite"},{id:"greaterthanorequalto_valueFilter",parentId:"valueFilterBtn",text:r._getLocalizedLabels("GreaterThanOrEqualTo")+"...",spriteCssClass:"sprite"},{id:"lessthan_valueFilter",parentId:"valueFilterBtn",text:r._getLocalizedLabels("LessThan")+"...",spriteCssClass:"sprite"},{id:"lessthanorequalto_valueFilter",parentId:"valueFilterBtn",text:r._getLocalizedLabels("LessThanOrEqualTo")+"...",spriteCssClass:"sprite"},{id:"sep8",parentId:"valueFilterBtn",text:"",spriteCssClass:"e-seperator"},{id:"between",parentId:"valueFilterBtn",text:r._getLocalizedLabels("Between")+"...",spriteCssClass:"sprite"},{id:"notbetween",parentId:"valueFilterBtn",text:r._getLocalizedLabels("NotBetween")+"...",spriteCssClass:"sprite"},{id:"topCount",parentId:"valueFilterBtn",text:r._getLocalizedLabels("Top10")+"...",spriteCssClass:"sprite"}],(e==t.Pivot.OperationalMode.ClientMode||e==t.Pivot.OperationalMode.ServerMode&&b==t.Pivot.AnalysisMode.Pivot)&&f.splice(f.length-1,2);else if(i.action=="clearFilter")f=t.buildTag("div.clearSorting",t.buildTag("span.e-clrSort","",{padding:"0px 10px 0px 4px"}).addClass("e-icon").attr("aria-label","clear sort")[0].outerHTML+t.buildTag("span.clearSortText","Clear Sorting",{padding:"5px 0px"})[0].outerHTML)[0].outerHTML+t.buildTag("div.separator",{padding:"5px 0px"})[0].outerHTML+t.buildTag("div.clearAllFilters",t.buildTag("span.e-clrFilter","",{padding:"0px 10px 0px 4px"}).addClass("e-icon").attr("aria-label"," clear filter")[0].outerHTML+t.buildTag("span.clearFltrText",'Clear Filter From"'+i.selectedLevel.text+'"',{padding:"5px 0px"})[0].outerHTML)[0].outerHTML;else if(i.action=="sort")f=t.buildTag("div#"+this._id+"_sortDiv.sortDiv",t.buildTag("li#"+this._id+"_ascOrder.e-ascOrder",t.buildTag("span.e-ascImage").addClass("e-icon").attr("aria-label","ascending")[0].outerHTML+r._getLocalizedLabels("Sort")+" A to Z")[0].outerHTML+t.buildTag("li#"+this._id+"_descOrder.e-descOrder",t.buildTag("span.e-descImage").addClass("e-icon").attr("aria-label","descending")[0].outerHTML+r._getLocalizedLabels("Sort")+" Z to A")[0].outerHTML)[0].outerHTML;else if(i.action=="labelFilterDlg"||i.action=="valueFilterDlg"){if(h="",c=[],i.action=="labelFilterDlg")h=t.buildTag("table.labelfilter",t.buildTag("tr",t.buildTag("td",r._getLocalizedLabels("LabelFilterLabel")).attr("colspan","2")[0].outerHTML)[0].outerHTML+t.buildTag("tr",t.buildTag("td","<input type='text' id='"+this._id+"_filterOptions' class='filterOptions' style='width:220px'/>")[0].outerHTML+t.buildTag("td.filterValuesTd","<input type='text' id='"+this._id+"_filterValue1' value='"+(i.filterInfo.length>0?e==t.Pivot.OperationalMode.ClientMode?i.filterInfo[0].values[0]:i.filterInfo[0].value1:"")+"' style='display:inline; width:160px; height:19px; margin-left:7px;' class='e-filterValues'/><\/br>")[0].outerHTML)[0].outerHTML)[0].outerHTML,c=[{value:"equals",option:r._getLocalizedLabels("Equals").toLowerCase()},{value:"not equals",option:r._getLocalizedLabels("DoesNotEquals").toLowerCase()},{value:"begins with",option:r._getLocalizedLabels("BeginsWith").toLowerCase()},{value:"not begins with",option:r._getLocalizedLabels("DoesNotBeginsWith").toLowerCase()},{value:"ends with",option:r._getLocalizedLabels("EndsWith").toLowerCase()},{value:"not ends with",option:r._getLocalizedLabels("DoesNotEndsWith").toLowerCase()},{value:"contains",option:r._getLocalizedLabels("Contains").toLowerCase()},{value:"not contains",option:r._getLocalizedLabels("DoesNotContains").toLowerCase()},{value:"greater than",option:r._getLocalizedLabels("IsGreaterThan").toLowerCase()},{value:"greater than or equal to",option:r._getLocalizedLabels("IsGreaterThanOrEqualTo").toLowerCase()},{value:"less than",option:r._getLocalizedLabels("IsLessThan").toLowerCase()},{value:"less than or equal to",option:r._getLocalizedLabels("IsLessThanOrEqualTo").toLowerCase()},];else{if(o=[],v=n(i.selectedArgs.element).attr("id")=="between"||n(i.selectedArgs.element).attr("id")=="notbetween"||i.selectedArgs.value=="between"||i.selectedArgs.value=="not between"?"4":"3",r.element.find(".e-cubeTreeView ").length>0)o=n.map(r.element.find(".e-cubeTreeView [data-tag*='[Measures]'] "),function(t){return{option:n(t).text(),value:n(t).attr("data-tag")}});else for(u=r.element.hasClass("e-pivotschemadesigner")?r.element.find(".e-schemaValue .e-pivotButton"):r.element.find(".groupingBarPivot .values .e-pivotButton"),u=r._schemaData&&u.length==0?n(r._schemaData.element.find(".e-schemaValue .e-pivotButton")):u,s=0;s<u.length;s++)o.push({option:n(u[s]).text(),value:n(u[s]).attr("data-tag").split(":")[1]});a=n(i.selectedArgs.element).hasClass("topCount")?t.buildTag("td","<input type='text' id='"+this._id+"_filterOptions' class='filterOptions' />").attr("width","80px")[0].outerHTML+t.buildTag("td","<input type='text' id='"+this._id+"_filterValue1' class='e-filterValues' />").attr("width","50px")[0].outerHTML+t.buildTag("td","<input type='text' id='"+this._id+"_filterMeasures' class='filterMeasures' />").attr("width","180px")[0].outerHTML:t.buildTag("td","<input type='text' id='"+this._id+"_filterMeasures' class='filterMeasures' />").attr("width","180px")[0].outerHTML+t.buildTag("td","<input type='text' id='"+this._id+"_filterOptions' class='filterOptions'/>").attr("width","180px")[0].outerHTML+t.buildTag("td.filterValuesTd","<input type='text' id='"+this._id+"_filterValue1' value='"+(i.filterInfo.length>0?e==t.Pivot.OperationalMode.ClientMode?i.filterInfo[0].values[0]:i.filterInfo[0].value1:"")+"' style='display:inline; width:190px; height:19px;' class='e-filterValues'/>"+(v=="4"?"<span>"+r._getLocalizedLabels("and")+" <\/span><input type='text' id='"+this._id+"_filterValue2' value='"+(i.filterInfo.length>0?e==t.Pivot.OperationalMode.ClientMode&&!t.isNullOrUndefined(i.filterInfo[0].values[1])?i.filterInfo[0].values[1]:e==t.Pivot.OperationalMode.ServerMode&&!t.isNullOrUndefined(i.filterInfo[0].value2)?i.filterInfo[0].value2:"":"")+"' style='display:inline; width:190px; height:19px;' class='e-filterValues'/> <\/br>":"<\/br>"))[0].outerHTML;h=t.buildTag("table.valuefilter",t.buildTag("tr",t.buildTag("td",r._getLocalizedLabels("ValueFilterLabel")).attr("colspan",i.text=="Between"?"4":"3")[0].outerHTML)[0].outerHTML+t.buildTag("tr",a)[0].outerHTML)[0].outerHTML;c=[{value:"equals",option:r._getLocalizedLabels("Equals").toLowerCase()},{value:"not equals",option:r._getLocalizedLabels("DoesNotEquals").toLowerCase()},{value:"greater than",option:r._getLocalizedLabels("IsGreaterThan").toLowerCase()},{value:"greater than or equal to",option:r._getLocalizedLabels("IsGreaterThanOrEqualTo").toLowerCase()},{value:"less than",option:r._getLocalizedLabels("IsLessThan").toLowerCase()},{value:"less than or equal to",option:r._getLocalizedLabels("IsLessThanOrEqualTo").toLowerCase()},{value:"between",option:r._getLocalizedLabels("Between").toLowerCase()},{value:"not between",option:r._getLocalizedLabels("NotBetween").toLowerCase()}]}y=t.buildTag("div",t.buildTag("button#"+this._id+"_filterDlgOKBtn.e-dialogOKBtn",r._getLocalizedLabels("OK")).attr("title",r._getLocalizedLabels("OK").replace(/(<([^>]+)>)/ig,""))[0].outerHTML+t.buildTag("button#"+this._id+"_filterDlgCancelBtn.e-dialogCancelBtn",r._getLocalizedLabels("Cancel")).attr("title",r._getLocalizedLabels("Cancel").replace(/(<([^>]+)>)/ig,""))[0].outerHTML,{float:r.model.enableRTL?"left":"right",margin:"8px 0 6px"})[0].outerHTML;r.element.find(".e-dialog").remove();n(t.buildTag("div#"+this._id+"_filterDialog.filterDialog",h+y,{opacity:"1"})).appendTo("#"+r._id);r.element.find(".filterDialog").ejDialog({enableRTL:r.model.enableRTL,enableResize:!1,cssClass:"e-labelValueFilterDlg",width:"auto",content:"#"+r._id,close:t.proxy(t.Pivot.closePreventPanel,r)});i.action=="valueFilterDlg"&&(r.element.find(".filterMeasures").ejDropDownList({dataSource:o,width:"180px",height:"25px",fields:{text:"option",value:"value"},create:function(){n(this.wrapper.find(".e-input")).focus(function(){n(this).blur()})}}),r._measureDDL=r.element.find(".filterMeasures").data("ejDropDownList"),l=i.filterInfo.length>0&&!t.isNullOrUndefined(i.filterInfo[0].measure)?i.filterInfo[0].measure:o.length>0?o[0].value:"",l!=""&&r._measureDDL.selectItemByValue(l));n(i.selectedArgs.element).attr("id")=="topCount"?(r.element.find("#"+this._id+"_filterOptions").ejDropDownList({dataSource:[{option:"Top",value:"topCount"},{option:"Bottom",value:"BottomCount"}],fields:{text:"option",value:"value"},value:i.filterInfo.length>0?i.filterInfo[0].operator:"topCount",create:function(){n(this.wrapper.find(".e-input")).focus(function(){n(this).blur()})}}),r.element.find("#"+this._id+"_filterValue1").ejNumericTextbox({value:i.filterInfo.length>0?parseInt(i.filterInfo[0].value1):5,minValue:1})):(p=n(i.selectedArgs.element).parent().children('li:not([id^="sep"])').index(i.selectedArgs.element),r.element.find(".filterOptions").ejDropDownList({dataSource:c,width:"180px",height:"25px",fields:{value:"value",text:"option"},selectedIndices:[p-1],change:t.proxy(r._filterOptionChanged,r),create:function(){n(this.wrapper.find(".e-input")).focus(function(){n(this).blur()})}}),n(i.selectedArgs.element).length==0&&(w=r.element.find(".filterOptions").data("ejDropDownList"),w.selectItemByValue(i.selectedArgs.selectedValue)));r.element.find("#"+this._id+"_filterDlgOKBtn").ejButton({type:t.ButtonType.Button,click:t.proxy(r._filterElementOkBtnClick,r)});r.element.find("#"+this._id+"_filterDlgCancelBtn").ejButton({type:t.ButtonType.Button,click:function(){n(".e-dialog").hide();t.Pivot.closePreventPanel(r)}});r.element.find(".e-titlebar").prepend(t.buildTag("div",(i.action=="valueFilterDlg"?r._getLocalizedLabels("ValueFilters")+"(":r._getLocalizedLabels("LabelFilters")+"(")+(r._selectedLevelUniqueName.indexOf(".")==-1?r._selectedLevelUniqueName:r._selectedLevelUniqueName.indexOf(".")<0?r._selectedLevelUniqueName:r._selectedLevelUniqueName.split(".")[2].replace(/\[/g,"").replace(/\]/g,""))+")",{display:"inline"}))}return f}};t.Pivot.SortOrder={None:"none",Ascending:"ascending",Descending:"descending"};t.Pivot.AdvancedFilterType={LabelFilter:"label",ValueFilter:"value"};t.Pivot.ValueFilterOptions={None:"none",Equals:"equals",NotEquals:"notequals",GreaterThan:"greaterthan",GreaterThanOrEqualTo:"greaterthanorequalto",LessThan:"lessthan",LessThanOrEqualTo:"lessthanorequalto",Between:"between",NotBetween:"notbetween"};t.Pivot.LabelFilterOptions={None:"none",BeginsWith:"beginswith",NotBeginsWith:"notbeginswith",EndsWith:"endswith",NotEndsWith:"notendswith",Contains:"contains",NotContains:"notcontains",Equals:"equals",NotEquals:"notequals",GreaterThan:"greaterthan",GreaterThanOrEqualTo:"greaterthanorequalto",LessThan:"lessthan",LessThanOrEqualTo:"lessthanorequalto",Between:"between",NotBetween:"notbetween"};t.Pivot.AnalysisMode={Olap:"olap",Pivot:"pivot"};t.Pivot.OperationalMode={ClientMode:"clientmode",ServerMode:"servermode"}}(jQuery,Syncfusion)});
|
/*! jQuery v3.2.1 | (c) JS Foundation and other contributors | jquery.org/license */
!function(a,b){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){"use strict";var c=[],d=a.document,e=Object.getPrototypeOf,f=c.slice,g=c.concat,h=c.push,i=c.indexOf,j={},k=j.toString,l=j.hasOwnProperty,m=l.toString,n=m.call(Object),o={};function p(a,b){b=b||d;var c=b.createElement("script");c.text=a,b.head.appendChild(c).parentNode.removeChild(c)}var q="3.2.1",r=function(a,b){return new r.fn.init(a,b)},s=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,t=/^-ms-/,u=/-([a-z])/g,v=function(a,b){return b.toUpperCase()};r.fn=r.prototype={jquery:q,constructor:r,length:0,toArray:function(){return f.call(this)},get:function(a){return null==a?f.call(this):a<0?this[a+this.length]:this[a]},pushStack:function(a){var b=r.merge(this.constructor(),a);return b.prevObject=this,b},each:function(a){return r.each(this,a)},map:function(a){return this.pushStack(r.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(f.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(a<0?b:0);return this.pushStack(c>=0&&c<b?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:h,sort:c.sort,splice:c.splice},r.extend=r.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||r.isFunction(g)||(g={}),h===i&&(g=this,h--);h<i;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(r.isPlainObject(d)||(e=Array.isArray(d)))?(e?(e=!1,f=c&&Array.isArray(c)?c:[]):f=c&&r.isPlainObject(c)?c:{},g[b]=r.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},r.extend({expando:"jQuery"+(q+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===r.type(a)},isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){var b=r.type(a);return("number"===b||"string"===b)&&!isNaN(a-parseFloat(a))},isPlainObject:function(a){var b,c;return!(!a||"[object Object]"!==k.call(a))&&(!(b=e(a))||(c=l.call(b,"constructor")&&b.constructor,"function"==typeof c&&m.call(c)===n))},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?j[k.call(a)]||"object":typeof a},globalEval:function(a){p(a)},camelCase:function(a){return a.replace(t,"ms-").replace(u,v)},each:function(a,b){var c,d=0;if(w(a)){for(c=a.length;d<c;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(s,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(w(Object(a))?r.merge(c,"string"==typeof a?[a]:a):h.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:i.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;d<c;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;f<g;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,f=0,h=[];if(w(a))for(d=a.length;f<d;f++)e=b(a[f],f,c),null!=e&&h.push(e);else for(f in a)e=b(a[f],f,c),null!=e&&h.push(e);return g.apply([],h)},guid:1,proxy:function(a,b){var c,d,e;if("string"==typeof b&&(c=a[b],b=a,a=c),r.isFunction(a))return d=f.call(arguments,2),e=function(){return a.apply(b||this,d.concat(f.call(arguments)))},e.guid=a.guid=a.guid||r.guid++,e},now:Date.now,support:o}),"function"==typeof Symbol&&(r.fn[Symbol.iterator]=c[Symbol.iterator]),r.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){j["[object "+b+"]"]=b.toLowerCase()});function w(a){var b=!!a&&"length"in a&&a.length,c=r.type(a);return"function"!==c&&!r.isWindow(a)&&("array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a)}var x=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=function(a,b){for(var c=0,d=a.length;c<d;c++)if(a[c]===b)return c;return-1},J="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",K="[\\x20\\t\\r\\n\\f]",L="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",M="\\["+K+"*("+L+")(?:"+K+"*([*^$|!~]?=)"+K+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+L+"))|)"+K+"*\\]",N=":("+L+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+M+")*)|.*)\\)|)",O=new RegExp(K+"+","g"),P=new RegExp("^"+K+"+|((?:^|[^\\\\])(?:\\\\.)*)"+K+"+$","g"),Q=new RegExp("^"+K+"*,"+K+"*"),R=new RegExp("^"+K+"*([>+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(N),U=new RegExp("^"+L+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),aa=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:d<0?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ba=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ca=function(a,b){return b?"\0"===a?"\ufffd":a.slice(0,-1)+"\\"+a.charCodeAt(a.length-1).toString(16)+" ":"\\"+a},da=function(){m()},ea=ta(function(a){return a.disabled===!0&&("form"in a||"label"in a)},{dir:"parentNode",next:"legend"});try{G.apply(D=H.call(v.childNodes),v.childNodes),D[v.childNodes.length].nodeType}catch(fa){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s=b&&b.ownerDocument,w=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==w&&9!==w&&11!==w)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==w&&(l=Z.exec(a)))if(f=l[1]){if(9===w){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(s&&(j=s.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(l[2])return G.apply(d,b.getElementsByTagName(a)),d;if((f=l[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==w)s=b,r=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(ba,ca):b.setAttribute("id",k=u),o=g(a),h=o.length;while(h--)o[h]="#"+k+" "+sa(o[h]);r=o.join(","),s=$.test(a)&&qa(b.parentNode)||b}if(r)try{return G.apply(d,s.querySelectorAll(r)),d}catch(x){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(P,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("fieldset");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return function(b){return"form"in b?b.parentNode&&b.disabled===!1?"label"in b?"label"in b.parentNode?b.parentNode.disabled===a:b.disabled===a:b.isDisabled===a||b.isDisabled!==!a&&ea(b)===a:b.disabled===a:"label"in b&&b.disabled===a}}function pa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function qa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return!!b&&"HTML"!==b.nodeName},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),v!==n&&(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(n.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){return a.getAttribute("id")===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}}):(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c,d,e,f=b.getElementById(a);if(f){if(c=f.getAttributeNode("id"),c&&c.value===a)return[f];e=b.getElementsByName(a),d=0;while(f=e[d++])if(c=f.getAttributeNode("id"),c&&c.value===a)return[f]}return[]}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){if("undefined"!=typeof b.getElementsByClassName&&p)return b.getElementsByClassName(a)},r=[],q=[],(c.qsa=Y.test(n.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\r\\' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){a.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+K+"*[*^$|!~]?="),2!==a.querySelectorAll(":enabled").length&&q.push(":enabled",":disabled"),o.appendChild(a).disabled=!0,2!==a.querySelectorAll(":disabled").length&&q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Y.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"*"),s.call(a,"[s!='']:x"),r.push("!=",N)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Y.test(o.compareDocumentPosition),t=b||Y.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?I(k,a)-I(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?I(k,a)-I(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?la(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(S,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.escape=function(a){return(a+"").replace(ba,ca)},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(_,aa),a[3]=(a[3]||a[4]||a[5]||"").replace(_,aa),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return V.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&T.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(_,aa).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:!b||(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(O," ")+" ").indexOf(c)>-1:"|="===b&&(e===c||e.slice(0,c.length+1)===c+"-"))}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(P,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(_,aa),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return U.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(_,aa).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:oa(!1),disabled:oa(!0),checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:pa(function(){return[0]}),last:pa(function(a,b){return[b-1]}),eq:pa(function(a,b,c){return[c<0?c+b:c]}),even:pa(function(a,b){for(var c=0;c<b;c+=2)a.push(c);return a}),odd:pa(function(a,b){for(var c=1;c<b;c+=2)a.push(c);return a}),lt:pa(function(a,b,c){for(var d=c<0?c+b:c;--d>=0;)a.push(d);return a}),gt:pa(function(a,b,c){for(var d=c<0?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=ma(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=na(b);function ra(){}ra.prototype=d.filters=d.pseudos,d.setFilters=new ra,g=ga.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){c&&!(e=Q.exec(h))||(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=R.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(P," ")}),h=h.slice(c.length));for(g in d.filter)!(e=V[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?ga.error(a):z(a,i).slice(0)};function sa(a){for(var b=0,c=a.length,d="";b<c;b++)d+=a[b].value;return d}function ta(a,b,c){var d=b.dir,e=b.next,f=e||d,g=c&&"parentNode"===f,h=x++;return b.first?function(b,c,e){while(b=b[d])if(1===b.nodeType||g)return a(b,c,e);return!1}:function(b,c,i){var j,k,l,m=[w,h];if(i){while(b=b[d])if((1===b.nodeType||g)&&a(b,c,i))return!0}else while(b=b[d])if(1===b.nodeType||g)if(l=b[u]||(b[u]={}),k=l[b.uniqueID]||(l[b.uniqueID]={}),e&&e===b.nodeName.toLowerCase())b=b[d]||b;else{if((j=k[f])&&j[0]===w&&j[1]===h)return m[2]=j[2];if(k[f]=m,m[2]=a(b,c,i))return!0}return!1}}function ua(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function va(a,b,c){for(var d=0,e=b.length;d<e;d++)ga(a,b[d],c);return c}function wa(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;h<i;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function xa(a,b,c,d,e,f){return d&&!d[u]&&(d=xa(d)),e&&!e[u]&&(e=xa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||va(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:wa(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=wa(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?I(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=wa(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ya(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ta(function(a){return a===b},h,!0),l=ta(function(a){return I(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];i<f;i++)if(c=d.relative[a[i].type])m=[ta(ua(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;e<f;e++)if(d.relative[a[e].type])break;return xa(i>1&&ua(m),i>1&&sa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(P,"$1"),c,i<e&&ya(a.slice(i,e)),e<f&&ya(a=a.slice(e)),e<f&&sa(a))}m.push(c)}return ua(m)}function za(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=E.call(i));u=wa(u)}G.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&ga.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=ya(b[c]),f[u]?d.push(f):e.push(f);f=A(a,za(e,d)),f.selector=a}return f},i=ga.select=function(a,b,c,e){var f,i,j,k,l,m="function"==typeof a&&a,n=!e&&g(a=m.selector||a);if(c=c||[],1===n.length){if(i=n[0]=n[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&9===b.nodeType&&p&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(_,aa),b)||[])[0],!b)return c;m&&(b=b.parentNode),a=a.slice(i.shift().value.length)}f=V.needsContext.test(a)?0:i.length;while(f--){if(j=i[f],d.relative[k=j.type])break;if((l=d.find[k])&&(e=l(j.matches[0].replace(_,aa),$.test(i[0].type)&&qa(b.parentNode)||b))){if(i.splice(f,1),a=e.length&&sa(i),!a)return G.apply(c,e),c;break}}}return(m||h(a,n))(e,b,!p,c,!b||$.test(a)&&qa(b.parentNode)||b),c},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("fieldset"))}),ja(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){if(!c)return a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){if(!c&&"input"===a.nodeName.toLowerCase())return a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(J,function(a,b,c){var d;if(!c)return a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);r.find=x,r.expr=x.selectors,r.expr[":"]=r.expr.pseudos,r.uniqueSort=r.unique=x.uniqueSort,r.text=x.getText,r.isXMLDoc=x.isXML,r.contains=x.contains,r.escapeSelector=x.escape;var y=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&r(a).is(c))break;d.push(a)}return d},z=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},A=r.expr.match.needsContext;function B(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()}var C=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,D=/^.[^:#\[\.,]*$/;function E(a,b,c){return r.isFunction(b)?r.grep(a,function(a,d){return!!b.call(a,d,a)!==c}):b.nodeType?r.grep(a,function(a){return a===b!==c}):"string"!=typeof b?r.grep(a,function(a){return i.call(b,a)>-1!==c}):D.test(b)?r.filter(b,a,c):(b=r.filter(b,a),r.grep(a,function(a){return i.call(b,a)>-1!==c&&1===a.nodeType}))}r.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?r.find.matchesSelector(d,a)?[d]:[]:r.find.matches(a,r.grep(b,function(a){return 1===a.nodeType}))},r.fn.extend({find:function(a){var b,c,d=this.length,e=this;if("string"!=typeof a)return this.pushStack(r(a).filter(function(){for(b=0;b<d;b++)if(r.contains(e[b],this))return!0}));for(c=this.pushStack([]),b=0;b<d;b++)r.find(a,e[b],c);return d>1?r.uniqueSort(c):c},filter:function(a){return this.pushStack(E(this,a||[],!1))},not:function(a){return this.pushStack(E(this,a||[],!0))},is:function(a){return!!E(this,"string"==typeof a&&A.test(a)?r(a):a||[],!1).length}});var F,G=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,H=r.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||F,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:G.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof r?b[0]:b,r.merge(this,r.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),C.test(e[1])&&r.isPlainObject(b))for(e in b)r.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&(this[0]=f,this.length=1),this}return a.nodeType?(this[0]=a,this.length=1,this):r.isFunction(a)?void 0!==c.ready?c.ready(a):a(r):r.makeArray(a,this)};H.prototype=r.fn,F=r(d);var I=/^(?:parents|prev(?:Until|All))/,J={children:!0,contents:!0,next:!0,prev:!0};r.fn.extend({has:function(a){var b=r(a,this),c=b.length;return this.filter(function(){for(var a=0;a<c;a++)if(r.contains(this,b[a]))return!0})},closest:function(a,b){var c,d=0,e=this.length,f=[],g="string"!=typeof a&&r(a);if(!A.test(a))for(;d<e;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&r.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?r.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?i.call(r(a),this[0]):i.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(r.uniqueSort(r.merge(this.get(),r(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function K(a,b){while((a=a[b])&&1!==a.nodeType);return a}r.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return y(a,"parentNode")},parentsUntil:function(a,b,c){return y(a,"parentNode",c)},next:function(a){return K(a,"nextSibling")},prev:function(a){return K(a,"previousSibling")},nextAll:function(a){return y(a,"nextSibling")},prevAll:function(a){return y(a,"previousSibling")},nextUntil:function(a,b,c){return y(a,"nextSibling",c)},prevUntil:function(a,b,c){return y(a,"previousSibling",c)},siblings:function(a){return z((a.parentNode||{}).firstChild,a)},children:function(a){return z(a.firstChild)},contents:function(a){return B(a,"iframe")?a.contentDocument:(B(a,"template")&&(a=a.content||a),r.merge([],a.childNodes))}},function(a,b){r.fn[a]=function(c,d){var e=r.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=r.filter(d,e)),this.length>1&&(J[a]||r.uniqueSort(e),I.test(a)&&e.reverse()),this.pushStack(e)}});var L=/[^\x20\t\r\n\f]+/g;function M(a){var b={};return r.each(a.match(L)||[],function(a,c){b[c]=!0}),b}r.Callbacks=function(a){a="string"==typeof a?M(a):r.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=e||a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h<f.length)f[h].apply(c[0],c[1])===!1&&a.stopOnFalse&&(h=f.length,c=!1)}a.memory||(c=!1),b=!1,e&&(f=c?[]:"")},j={add:function(){return f&&(c&&!b&&(h=f.length-1,g.push(c)),function d(b){r.each(b,function(b,c){r.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&"string"!==r.type(c)&&d(c)})}(arguments),c&&!b&&i()),this},remove:function(){return r.each(arguments,function(a,b){var c;while((c=r.inArray(b,f,c))>-1)f.splice(c,1),c<=h&&h--}),this},has:function(a){return a?r.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||b||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j};function N(a){return a}function O(a){throw a}function P(a,b,c,d){var e;try{a&&r.isFunction(e=a.promise)?e.call(a).done(b).fail(c):a&&r.isFunction(e=a.then)?e.call(a,b,c):b.apply(void 0,[a].slice(d))}catch(a){c.apply(void 0,[a])}}r.extend({Deferred:function(b){var c=[["notify","progress",r.Callbacks("memory"),r.Callbacks("memory"),2],["resolve","done",r.Callbacks("once memory"),r.Callbacks("once memory"),0,"resolved"],["reject","fail",r.Callbacks("once memory"),r.Callbacks("once memory"),1,"rejected"]],d="pending",e={state:function(){return d},always:function(){return f.done(arguments).fail(arguments),this},"catch":function(a){return e.then(null,a)},pipe:function(){var a=arguments;return r.Deferred(function(b){r.each(c,function(c,d){var e=r.isFunction(a[d[4]])&&a[d[4]];f[d[1]](function(){var a=e&&e.apply(this,arguments);a&&r.isFunction(a.promise)?a.promise().progress(b.notify).done(b.resolve).fail(b.reject):b[d[0]+"With"](this,e?[a]:arguments)})}),a=null}).promise()},then:function(b,d,e){var f=0;function g(b,c,d,e){return function(){var h=this,i=arguments,j=function(){var a,j;if(!(b<f)){if(a=d.apply(h,i),a===c.promise())throw new TypeError("Thenable self-resolution");j=a&&("object"==typeof a||"function"==typeof a)&&a.then,r.isFunction(j)?e?j.call(a,g(f,c,N,e),g(f,c,O,e)):(f++,j.call(a,g(f,c,N,e),g(f,c,O,e),g(f,c,N,c.notifyWith))):(d!==N&&(h=void 0,i=[a]),(e||c.resolveWith)(h,i))}},k=e?j:function(){try{j()}catch(a){r.Deferred.exceptionHook&&r.Deferred.exceptionHook(a,k.stackTrace),b+1>=f&&(d!==O&&(h=void 0,i=[a]),c.rejectWith(h,i))}};b?k():(r.Deferred.getStackHook&&(k.stackTrace=r.Deferred.getStackHook()),a.setTimeout(k))}}return r.Deferred(function(a){c[0][3].add(g(0,a,r.isFunction(e)?e:N,a.notifyWith)),c[1][3].add(g(0,a,r.isFunction(b)?b:N)),c[2][3].add(g(0,a,r.isFunction(d)?d:O))}).promise()},promise:function(a){return null!=a?r.extend(a,e):e}},f={};return r.each(c,function(a,b){var g=b[2],h=b[5];e[b[1]]=g.add,h&&g.add(function(){d=h},c[3-a][2].disable,c[0][2].lock),g.add(b[3].fire),f[b[0]]=function(){return f[b[0]+"With"](this===f?void 0:this,arguments),this},f[b[0]+"With"]=g.fireWith}),e.promise(f),b&&b.call(f,f),f},when:function(a){var b=arguments.length,c=b,d=Array(c),e=f.call(arguments),g=r.Deferred(),h=function(a){return function(c){d[a]=this,e[a]=arguments.length>1?f.call(arguments):c,--b||g.resolveWith(d,e)}};if(b<=1&&(P(a,g.done(h(c)).resolve,g.reject,!b),"pending"===g.state()||r.isFunction(e[c]&&e[c].then)))return g.then();while(c--)P(e[c],h(c),g.reject);return g.promise()}});var Q=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;r.Deferred.exceptionHook=function(b,c){a.console&&a.console.warn&&b&&Q.test(b.name)&&a.console.warn("jQuery.Deferred exception: "+b.message,b.stack,c)},r.readyException=function(b){a.setTimeout(function(){throw b})};var R=r.Deferred();r.fn.ready=function(a){return R.then(a)["catch"](function(a){r.readyException(a)}),this},r.extend({isReady:!1,readyWait:1,ready:function(a){(a===!0?--r.readyWait:r.isReady)||(r.isReady=!0,a!==!0&&--r.readyWait>0||R.resolveWith(d,[r]))}}),r.ready.then=R.then;function S(){d.removeEventListener("DOMContentLoaded",S),
a.removeEventListener("load",S),r.ready()}"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(r.ready):(d.addEventListener("DOMContentLoaded",S),a.addEventListener("load",S));var T=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===r.type(c)){e=!0;for(h in c)T(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,r.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(r(a),c)})),b))for(;h<i;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},U=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function V(){this.expando=r.expando+V.uid++}V.uid=1,V.prototype={cache:function(a){var b=a[this.expando];return b||(b={},U(a)&&(a.nodeType?a[this.expando]=b:Object.defineProperty(a,this.expando,{value:b,configurable:!0}))),b},set:function(a,b,c){var d,e=this.cache(a);if("string"==typeof b)e[r.camelCase(b)]=c;else for(d in b)e[r.camelCase(d)]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][r.camelCase(b)]},access:function(a,b,c){return void 0===b||b&&"string"==typeof b&&void 0===c?this.get(a,b):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d=a[this.expando];if(void 0!==d){if(void 0!==b){Array.isArray(b)?b=b.map(r.camelCase):(b=r.camelCase(b),b=b in d?[b]:b.match(L)||[]),c=b.length;while(c--)delete d[b[c]]}(void 0===b||r.isEmptyObject(d))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!r.isEmptyObject(b)}};var W=new V,X=new V,Y=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Z=/[A-Z]/g;function $(a){return"true"===a||"false"!==a&&("null"===a?null:a===+a+""?+a:Y.test(a)?JSON.parse(a):a)}function _(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Z,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c=$(c)}catch(e){}X.set(a,b,c)}else c=void 0;return c}r.extend({hasData:function(a){return X.hasData(a)||W.hasData(a)},data:function(a,b,c){return X.access(a,b,c)},removeData:function(a,b){X.remove(a,b)},_data:function(a,b,c){return W.access(a,b,c)},_removeData:function(a,b){W.remove(a,b)}}),r.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=X.get(f),1===f.nodeType&&!W.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=r.camelCase(d.slice(5)),_(f,d,e[d])));W.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){X.set(this,a)}):T(this,function(b){var c;if(f&&void 0===b){if(c=X.get(f,a),void 0!==c)return c;if(c=_(f,a),void 0!==c)return c}else this.each(function(){X.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){X.remove(this,a)})}}),r.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=W.get(a,b),c&&(!d||Array.isArray(c)?d=W.access(a,b,r.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=r.queue(a,b),d=c.length,e=c.shift(),f=r._queueHooks(a,b),g=function(){r.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return W.get(a,c)||W.access(a,c,{empty:r.Callbacks("once memory").add(function(){W.remove(a,[b+"queue",c])})})}}),r.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?r.queue(this[0],a):void 0===b?this:this.each(function(){var c=r.queue(this,a,b);r._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&r.dequeue(this,a)})},dequeue:function(a){return this.each(function(){r.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=r.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=W.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var aa=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ba=new RegExp("^(?:([+-])=|)("+aa+")([a-z%]*)$","i"),ca=["Top","Right","Bottom","Left"],da=function(a,b){return a=b||a,"none"===a.style.display||""===a.style.display&&r.contains(a.ownerDocument,a)&&"none"===r.css(a,"display")},ea=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};function fa(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return r.css(a,b,"")},i=h(),j=c&&c[3]||(r.cssNumber[b]?"":"px"),k=(r.cssNumber[b]||"px"!==j&&+i)&&ba.exec(r.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,r.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var ga={};function ha(a){var b,c=a.ownerDocument,d=a.nodeName,e=ga[d];return e?e:(b=c.body.appendChild(c.createElement(d)),e=r.css(b,"display"),b.parentNode.removeChild(b),"none"===e&&(e="block"),ga[d]=e,e)}function ia(a,b){for(var c,d,e=[],f=0,g=a.length;f<g;f++)d=a[f],d.style&&(c=d.style.display,b?("none"===c&&(e[f]=W.get(d,"display")||null,e[f]||(d.style.display="")),""===d.style.display&&da(d)&&(e[f]=ha(d))):"none"!==c&&(e[f]="none",W.set(d,"display",c)));for(f=0;f<g;f++)null!=e[f]&&(a[f].style.display=e[f]);return a}r.fn.extend({show:function(){return ia(this,!0)},hide:function(){return ia(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){da(this)?r(this).show():r(this).hide()})}});var ja=/^(?:checkbox|radio)$/i,ka=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,la=/^$|\/(?:java|ecma)script/i,ma={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ma.optgroup=ma.option,ma.tbody=ma.tfoot=ma.colgroup=ma.caption=ma.thead,ma.th=ma.td;function na(a,b){var c;return c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[],void 0===b||b&&B(a,b)?r.merge([a],c):c}function oa(a,b){for(var c=0,d=a.length;c<d;c++)W.set(a[c],"globalEval",!b||W.get(b[c],"globalEval"))}var pa=/<|&#?\w+;/;function qa(a,b,c,d,e){for(var f,g,h,i,j,k,l=b.createDocumentFragment(),m=[],n=0,o=a.length;n<o;n++)if(f=a[n],f||0===f)if("object"===r.type(f))r.merge(m,f.nodeType?[f]:f);else if(pa.test(f)){g=g||l.appendChild(b.createElement("div")),h=(ka.exec(f)||["",""])[1].toLowerCase(),i=ma[h]||ma._default,g.innerHTML=i[1]+r.htmlPrefilter(f)+i[2],k=i[0];while(k--)g=g.lastChild;r.merge(m,g.childNodes),g=l.firstChild,g.textContent=""}else m.push(b.createTextNode(f));l.textContent="",n=0;while(f=m[n++])if(d&&r.inArray(f,d)>-1)e&&e.push(f);else if(j=r.contains(f.ownerDocument,f),g=na(l.appendChild(f),"script"),j&&oa(g),c){k=0;while(f=g[k++])la.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),o.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",o.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var ra=d.documentElement,sa=/^key/,ta=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ua=/^([^.]*)(?:\.(.+)|)/;function va(){return!0}function wa(){return!1}function xa(){try{return d.activeElement}catch(a){}}function ya(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)ya(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=wa;else if(!e)return a;return 1===f&&(g=e,e=function(a){return r().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=r.guid++)),a.each(function(){r.event.add(this,b,e,d,c)})}r.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=W.get(a);if(q){c.handler&&(f=c,c=f.handler,e=f.selector),e&&r.find.matchesSelector(ra,e),c.guid||(c.guid=r.guid++),(i=q.events)||(i=q.events={}),(g=q.handle)||(g=q.handle=function(b){return"undefined"!=typeof r&&r.event.triggered!==b.type?r.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(L)||[""],j=b.length;while(j--)h=ua.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n&&(l=r.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=r.event.special[n]||{},k=r.extend({type:n,origType:p,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&r.expr.match.needsContext.test(e),namespace:o.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,o,g)!==!1||a.addEventListener&&a.addEventListener(n,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),r.event.global[n]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=W.hasData(a)&&W.get(a);if(q&&(i=q.events)){b=(b||"").match(L)||[""],j=b.length;while(j--)if(h=ua.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n){l=r.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&p!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,o,q.handle)!==!1||r.removeEvent(a,n,q.handle),delete i[n])}else for(n in i)r.event.remove(a,n+b[j],c,d,!0);r.isEmptyObject(i)&&W.remove(a,"handle events")}},dispatch:function(a){var b=r.event.fix(a),c,d,e,f,g,h,i=new Array(arguments.length),j=(W.get(this,"events")||{})[b.type]||[],k=r.event.special[b.type]||{};for(i[0]=b,c=1;c<arguments.length;c++)i[c]=arguments[c];if(b.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,b)!==!1){h=r.event.handlers.call(this,b,j),c=0;while((f=h[c++])&&!b.isPropagationStopped()){b.currentTarget=f.elem,d=0;while((g=f.handlers[d++])&&!b.isImmediatePropagationStopped())b.rnamespace&&!b.rnamespace.test(g.namespace)||(b.handleObj=g,b.data=g.data,e=((r.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(b.result=e)===!1&&(b.preventDefault(),b.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,b),b.result}},handlers:function(a,b){var c,d,e,f,g,h=[],i=b.delegateCount,j=a.target;if(i&&j.nodeType&&!("click"===a.type&&a.button>=1))for(;j!==this;j=j.parentNode||this)if(1===j.nodeType&&("click"!==a.type||j.disabled!==!0)){for(f=[],g={},c=0;c<i;c++)d=b[c],e=d.selector+" ",void 0===g[e]&&(g[e]=d.needsContext?r(e,this).index(j)>-1:r.find(e,this,null,[j]).length),g[e]&&f.push(d);f.length&&h.push({elem:j,handlers:f})}return j=this,i<b.length&&h.push({elem:j,handlers:b.slice(i)}),h},addProp:function(a,b){Object.defineProperty(r.Event.prototype,a,{enumerable:!0,configurable:!0,get:r.isFunction(b)?function(){if(this.originalEvent)return b(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[a]},set:function(b){Object.defineProperty(this,a,{enumerable:!0,configurable:!0,writable:!0,value:b})}})},fix:function(a){return a[r.expando]?a:new r.Event(a)},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==xa()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===xa()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&B(this,"input"))return this.click(),!1},_default:function(a){return B(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}}},r.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c)},r.Event=function(a,b){return this instanceof r.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?va:wa,this.target=a.target&&3===a.target.nodeType?a.target.parentNode:a.target,this.currentTarget=a.currentTarget,this.relatedTarget=a.relatedTarget):this.type=a,b&&r.extend(this,b),this.timeStamp=a&&a.timeStamp||r.now(),void(this[r.expando]=!0)):new r.Event(a,b)},r.Event.prototype={constructor:r.Event,isDefaultPrevented:wa,isPropagationStopped:wa,isImmediatePropagationStopped:wa,isSimulated:!1,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=va,a&&!this.isSimulated&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=va,a&&!this.isSimulated&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=va,a&&!this.isSimulated&&a.stopImmediatePropagation(),this.stopPropagation()}},r.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(a){var b=a.button;return null==a.which&&sa.test(a.type)?null!=a.charCode?a.charCode:a.keyCode:!a.which&&void 0!==b&&ta.test(a.type)?1&b?1:2&b?3:4&b?2:0:a.which}},r.event.addProp),r.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){r.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return e&&(e===d||r.contains(d,e))||(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),r.fn.extend({on:function(a,b,c,d){return ya(this,a,b,c,d)},one:function(a,b,c,d){return ya(this,a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,r(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return b!==!1&&"function"!=typeof b||(c=b,b=void 0),c===!1&&(c=wa),this.each(function(){r.event.remove(this,a,c,b)})}});var za=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,Aa=/<script|<style|<link/i,Ba=/checked\s*(?:[^=]|=\s*.checked.)/i,Ca=/^true\/(.*)/,Da=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Ea(a,b){return B(a,"table")&&B(11!==b.nodeType?b:b.firstChild,"tr")?r(">tbody",a)[0]||a:a}function Fa(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function Ga(a){var b=Ca.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ha(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(W.hasData(a)&&(f=W.access(a),g=W.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;c<d;c++)r.event.add(b,e,j[e][c])}X.hasData(a)&&(h=X.access(a),i=r.extend({},h),X.set(b,i))}}function Ia(a,b){var c=b.nodeName.toLowerCase();"input"===c&&ja.test(a.type)?b.checked=a.checked:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}function Ja(a,b,c,d){b=g.apply([],b);var e,f,h,i,j,k,l=0,m=a.length,n=m-1,q=b[0],s=r.isFunction(q);if(s||m>1&&"string"==typeof q&&!o.checkClone&&Ba.test(q))return a.each(function(e){var f=a.eq(e);s&&(b[0]=q.call(this,e,f.html())),Ja(f,b,c,d)});if(m&&(e=qa(b,a[0].ownerDocument,!1,a,d),f=e.firstChild,1===e.childNodes.length&&(e=f),f||d)){for(h=r.map(na(e,"script"),Fa),i=h.length;l<m;l++)j=e,l!==n&&(j=r.clone(j,!0,!0),i&&r.merge(h,na(j,"script"))),c.call(a[l],j,l);if(i)for(k=h[h.length-1].ownerDocument,r.map(h,Ga),l=0;l<i;l++)j=h[l],la.test(j.type||"")&&!W.access(j,"globalEval")&&r.contains(k,j)&&(j.src?r._evalUrl&&r._evalUrl(j.src):p(j.textContent.replace(Da,""),k))}return a}function Ka(a,b,c){for(var d,e=b?r.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||r.cleanData(na(d)),d.parentNode&&(c&&r.contains(d.ownerDocument,d)&&oa(na(d,"script")),d.parentNode.removeChild(d));return a}r.extend({htmlPrefilter:function(a){return a.replace(za,"<$1></$2>")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=r.contains(a.ownerDocument,a);if(!(o.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||r.isXMLDoc(a)))for(g=na(h),f=na(a),d=0,e=f.length;d<e;d++)Ia(f[d],g[d]);if(b)if(c)for(f=f||na(a),g=g||na(h),d=0,e=f.length;d<e;d++)Ha(f[d],g[d]);else Ha(a,h);return g=na(h,"script"),g.length>0&&oa(g,!i&&na(a,"script")),h},cleanData:function(a){for(var b,c,d,e=r.event.special,f=0;void 0!==(c=a[f]);f++)if(U(c)){if(b=c[W.expando]){if(b.events)for(d in b.events)e[d]?r.event.remove(c,d):r.removeEvent(c,d,b.handle);c[W.expando]=void 0}c[X.expando]&&(c[X.expando]=void 0)}}}),r.fn.extend({detach:function(a){return Ka(this,a,!0)},remove:function(a){return Ka(this,a)},text:function(a){return T(this,function(a){return void 0===a?r.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return Ja(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ea(this,a);b.appendChild(a)}})},prepend:function(){return Ja(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ea(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ja(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ja(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(r.cleanData(na(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null!=a&&a,b=null==b?a:b,this.map(function(){return r.clone(this,a,b)})},html:function(a){return T(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!Aa.test(a)&&!ma[(ka.exec(a)||["",""])[1].toLowerCase()]){a=r.htmlPrefilter(a);try{for(;c<d;c++)b=this[c]||{},1===b.nodeType&&(r.cleanData(na(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return Ja(this,arguments,function(b){var c=this.parentNode;r.inArray(this,a)<0&&(r.cleanData(na(this)),c&&c.replaceChild(b,this))},a)}}),r.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){r.fn[a]=function(a){for(var c,d=[],e=r(a),f=e.length-1,g=0;g<=f;g++)c=g===f?this:this.clone(!0),r(e[g])[b](c),h.apply(d,c.get());return this.pushStack(d)}});var La=/^margin/,Ma=new RegExp("^("+aa+")(?!px)[a-z%]+$","i"),Na=function(b){var c=b.ownerDocument.defaultView;return c&&c.opener||(c=a),c.getComputedStyle(b)};!function(){function b(){if(i){i.style.cssText="box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",i.innerHTML="",ra.appendChild(h);var b=a.getComputedStyle(i);c="1%"!==b.top,g="2px"===b.marginLeft,e="4px"===b.width,i.style.marginRight="50%",f="4px"===b.marginRight,ra.removeChild(h),i=null}}var c,e,f,g,h=d.createElement("div"),i=d.createElement("div");i.style&&(i.style.backgroundClip="content-box",i.cloneNode(!0).style.backgroundClip="",o.clearCloneStyle="content-box"===i.style.backgroundClip,h.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",h.appendChild(i),r.extend(o,{pixelPosition:function(){return b(),c},boxSizingReliable:function(){return b(),e},pixelMarginRight:function(){return b(),f},reliableMarginLeft:function(){return b(),g}}))}();function Oa(a,b,c){var d,e,f,g,h=a.style;return c=c||Na(a),c&&(g=c.getPropertyValue(b)||c[b],""!==g||r.contains(a.ownerDocument,a)||(g=r.style(a,b)),!o.pixelMarginRight()&&Ma.test(g)&&La.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function Pa(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Qa=/^(none|table(?!-c[ea]).+)/,Ra=/^--/,Sa={position:"absolute",visibility:"hidden",display:"block"},Ta={letterSpacing:"0",fontWeight:"400"},Ua=["Webkit","Moz","ms"],Va=d.createElement("div").style;function Wa(a){if(a in Va)return a;var b=a[0].toUpperCase()+a.slice(1),c=Ua.length;while(c--)if(a=Ua[c]+b,a in Va)return a}function Xa(a){var b=r.cssProps[a];return b||(b=r.cssProps[a]=Wa(a)||a),b}function Ya(a,b,c){var d=ba.exec(b);return d?Math.max(0,d[2]-(c||0))+(d[3]||"px"):b}function Za(a,b,c,d,e){var f,g=0;for(f=c===(d?"border":"content")?4:"width"===b?1:0;f<4;f+=2)"margin"===c&&(g+=r.css(a,c+ca[f],!0,e)),d?("content"===c&&(g-=r.css(a,"padding"+ca[f],!0,e)),"margin"!==c&&(g-=r.css(a,"border"+ca[f]+"Width",!0,e))):(g+=r.css(a,"padding"+ca[f],!0,e),"padding"!==c&&(g+=r.css(a,"border"+ca[f]+"Width",!0,e)));return g}function $a(a,b,c){var d,e=Na(a),f=Oa(a,b,e),g="border-box"===r.css(a,"boxSizing",!1,e);return Ma.test(f)?f:(d=g&&(o.boxSizingReliable()||f===a.style[b]),"auto"===f&&(f=a["offset"+b[0].toUpperCase()+b.slice(1)]),f=parseFloat(f)||0,f+Za(a,b,c||(g?"border":"content"),d,e)+"px")}r.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Oa(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=r.camelCase(b),i=Ra.test(b),j=a.style;return i||(b=Xa(h)),g=r.cssHooks[b]||r.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:j[b]:(f=typeof c,"string"===f&&(e=ba.exec(c))&&e[1]&&(c=fa(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(r.cssNumber[h]?"":"px")),o.clearCloneStyle||""!==c||0!==b.indexOf("background")||(j[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i?j.setProperty(b,c):j[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=r.camelCase(b),i=Ra.test(b);return i||(b=Xa(h)),g=r.cssHooks[b]||r.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=Oa(a,b,d)),"normal"===e&&b in Ta&&(e=Ta[b]),""===c||c?(f=parseFloat(e),c===!0||isFinite(f)?f||0:e):e}}),r.each(["height","width"],function(a,b){r.cssHooks[b]={get:function(a,c,d){if(c)return!Qa.test(r.css(a,"display"))||a.getClientRects().length&&a.getBoundingClientRect().width?$a(a,b,d):ea(a,Sa,function(){return $a(a,b,d)})},set:function(a,c,d){var e,f=d&&Na(a),g=d&&Za(a,b,d,"border-box"===r.css(a,"boxSizing",!1,f),f);return g&&(e=ba.exec(c))&&"px"!==(e[3]||"px")&&(a.style[b]=c,c=r.css(a,b)),Ya(a,c,g)}}}),r.cssHooks.marginLeft=Pa(o.reliableMarginLeft,function(a,b){if(b)return(parseFloat(Oa(a,"marginLeft"))||a.getBoundingClientRect().left-ea(a,{marginLeft:0},function(){return a.getBoundingClientRect().left}))+"px"}),r.each({margin:"",padding:"",border:"Width"},function(a,b){r.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];d<4;d++)e[a+ca[d]+b]=f[d]||f[d-2]||f[0];return e}},La.test(a)||(r.cssHooks[a+b].set=Ya)}),r.fn.extend({css:function(a,b){return T(this,function(a,b,c){var d,e,f={},g=0;if(Array.isArray(b)){for(d=Na(a),e=b.length;g<e;g++)f[b[g]]=r.css(a,b[g],!1,d);return f}return void 0!==c?r.style(a,b,c):r.css(a,b)},a,b,arguments.length>1)}});function _a(a,b,c,d,e){return new _a.prototype.init(a,b,c,d,e)}r.Tween=_a,_a.prototype={constructor:_a,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||r.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(r.cssNumber[c]?"":"px")},cur:function(){var a=_a.propHooks[this.prop];return a&&a.get?a.get(this):_a.propHooks._default.get(this)},run:function(a){var b,c=_a.propHooks[this.prop];return this.options.duration?this.pos=b=r.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):_a.propHooks._default.set(this),this}},_a.prototype.init.prototype=_a.prototype,_a.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=r.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){r.fx.step[a.prop]?r.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[r.cssProps[a.prop]]&&!r.cssHooks[a.prop]?a.elem[a.prop]=a.now:r.style(a.elem,a.prop,a.now+a.unit)}}},_a.propHooks.scrollTop=_a.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},r.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},r.fx=_a.prototype.init,r.fx.step={};var ab,bb,cb=/^(?:toggle|show|hide)$/,db=/queueHooks$/;function eb(){bb&&(d.hidden===!1&&a.requestAnimationFrame?a.requestAnimationFrame(eb):a.setTimeout(eb,r.fx.interval),r.fx.tick())}function fb(){return a.setTimeout(function(){ab=void 0}),ab=r.now()}function gb(a,b){var c,d=0,e={height:a};for(b=b?1:0;d<4;d+=2-b)c=ca[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function hb(a,b,c){for(var d,e=(kb.tweeners[b]||[]).concat(kb.tweeners["*"]),f=0,g=e.length;f<g;f++)if(d=e[f].call(c,b,a))return d}function ib(a,b,c){var d,e,f,g,h,i,j,k,l="width"in b||"height"in b,m=this,n={},o=a.style,p=a.nodeType&&da(a),q=W.get(a,"fxshow");c.queue||(g=r._queueHooks(a,"fx"),null==g.unqueued&&(g.unqueued=0,h=g.empty.fire,g.empty.fire=function(){g.unqueued||h()}),g.unqueued++,m.always(function(){m.always(function(){g.unqueued--,r.queue(a,"fx").length||g.empty.fire()})}));for(d in b)if(e=b[d],cb.test(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}n[d]=q&&q[d]||r.style(a,d)}if(i=!r.isEmptyObject(b),i||!r.isEmptyObject(n)){l&&1===a.nodeType&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=q&&q.display,null==j&&(j=W.get(a,"display")),k=r.css(a,"display"),"none"===k&&(j?k=j:(ia([a],!0),j=a.style.display||j,k=r.css(a,"display"),ia([a]))),("inline"===k||"inline-block"===k&&null!=j)&&"none"===r.css(a,"float")&&(i||(m.done(function(){o.display=j}),null==j&&(k=o.display,j="none"===k?"":k)),o.display="inline-block")),c.overflow&&(o.overflow="hidden",m.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]})),i=!1;for(d in n)i||(q?"hidden"in q&&(p=q.hidden):q=W.access(a,"fxshow",{display:j}),f&&(q.hidden=!p),p&&ia([a],!0),m.done(function(){p||ia([a]),W.remove(a,"fxshow");for(d in n)r.style(a,d,n[d])})),i=hb(p?q[d]:0,d,m),d in q||(q[d]=i.start,p&&(i.end=i.start,i.start=0))}}function jb(a,b){var c,d,e,f,g;for(c in a)if(d=r.camelCase(c),e=b[d],f=a[c],Array.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=r.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function kb(a,b,c){var d,e,f=0,g=kb.prefilters.length,h=r.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=ab||fb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;g<i;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),f<1&&i?c:(i||h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:r.extend({},b),opts:r.extend(!0,{specialEasing:{},easing:r.easing._default},c),originalProperties:b,originalOptions:c,startTime:ab||fb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=r.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;c<d;c++)j.tweens[c].run(1);return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for(jb(k,j.opts.specialEasing);f<g;f++)if(d=kb.prefilters[f].call(j,a,k,j.opts))return r.isFunction(d.stop)&&(r._queueHooks(j.elem,j.opts.queue).stop=r.proxy(d.stop,d)),d;return r.map(k,hb,j),r.isFunction(j.opts.start)&&j.opts.start.call(a,j),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always),r.fx.timer(r.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j}r.Animation=r.extend(kb,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return fa(c.elem,a,ba.exec(b),c),c}]},tweener:function(a,b){r.isFunction(a)?(b=a,a=["*"]):a=a.match(L);for(var c,d=0,e=a.length;d<e;d++)c=a[d],kb.tweeners[c]=kb.tweeners[c]||[],kb.tweeners[c].unshift(b)},prefilters:[ib],prefilter:function(a,b){b?kb.prefilters.unshift(a):kb.prefilters.push(a)}}),r.speed=function(a,b,c){var d=a&&"object"==typeof a?r.extend({},a):{complete:c||!c&&b||r.isFunction(a)&&a,duration:a,easing:c&&b||b&&!r.isFunction(b)&&b};return r.fx.off?d.duration=0:"number"!=typeof d.duration&&(d.duration in r.fx.speeds?d.duration=r.fx.speeds[d.duration]:d.duration=r.fx.speeds._default),null!=d.queue&&d.queue!==!0||(d.queue="fx"),d.old=d.complete,d.complete=function(){r.isFunction(d.old)&&d.old.call(this),d.queue&&r.dequeue(this,d.queue)},d},r.fn.extend({fadeTo:function(a,b,c,d){return this.filter(da).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=r.isEmptyObject(a),f=r.speed(b,c,d),g=function(){var b=kb(this,r.extend({},a),f);(e||W.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=r.timers,g=W.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&db.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));!b&&c||r.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=W.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=r.timers,g=d?d.length:0;for(c.finish=!0,r.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;b<g;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),r.each(["toggle","show","hide"],function(a,b){var c=r.fn[b];r.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(gb(b,!0),a,d,e)}}),r.each({slideDown:gb("show"),slideUp:gb("hide"),slideToggle:gb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){r.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),r.timers=[],r.fx.tick=function(){var a,b=0,c=r.timers;for(ab=r.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||r.fx.stop(),ab=void 0},r.fx.timer=function(a){r.timers.push(a),r.fx.start()},r.fx.interval=13,r.fx.start=function(){bb||(bb=!0,eb())},r.fx.stop=function(){bb=null},r.fx.speeds={slow:600,fast:200,_default:400},r.fn.delay=function(b,c){return b=r.fx?r.fx.speeds[b]||b:b,c=c||"fx",this.queue(c,function(c,d){var e=a.setTimeout(c,b);d.stop=function(){a.clearTimeout(e)}})},function(){var a=d.createElement("input"),b=d.createElement("select"),c=b.appendChild(d.createElement("option"));a.type="checkbox",o.checkOn=""!==a.value,o.optSelected=c.selected,a=d.createElement("input"),a.value="t",a.type="radio",o.radioValue="t"===a.value}();var lb,mb=r.expr.attrHandle;r.fn.extend({attr:function(a,b){return T(this,r.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){r.removeAttr(this,a)})}}),r.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?r.prop(a,b,c):(1===f&&r.isXMLDoc(a)||(e=r.attrHooks[b.toLowerCase()]||(r.expr.match.bool.test(b)?lb:void 0)),void 0!==c?null===c?void r.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=r.find.attr(a,b),
null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!o.radioValue&&"radio"===b&&B(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d=0,e=b&&b.match(L);if(e&&1===a.nodeType)while(c=e[d++])a.removeAttribute(c)}}),lb={set:function(a,b,c){return b===!1?r.removeAttr(a,c):a.setAttribute(c,c),c}},r.each(r.expr.match.bool.source.match(/\w+/g),function(a,b){var c=mb[b]||r.find.attr;mb[b]=function(a,b,d){var e,f,g=b.toLowerCase();return d||(f=mb[g],mb[g]=e,e=null!=c(a,b,d)?g:null,mb[g]=f),e}});var nb=/^(?:input|select|textarea|button)$/i,ob=/^(?:a|area)$/i;r.fn.extend({prop:function(a,b){return T(this,r.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[r.propFix[a]||a]})}}),r.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&r.isXMLDoc(a)||(b=r.propFix[b]||b,e=r.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=r.find.attr(a,"tabindex");return b?parseInt(b,10):nb.test(a.nodeName)||ob.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),o.optSelected||(r.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),r.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){r.propFix[this.toLowerCase()]=this});function pb(a){var b=a.match(L)||[];return b.join(" ")}function qb(a){return a.getAttribute&&a.getAttribute("class")||""}r.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).addClass(a.call(this,b,qb(this)))});if("string"==typeof a&&a){b=a.match(L)||[];while(c=this[i++])if(e=qb(c),d=1===c.nodeType&&" "+pb(e)+" "){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=pb(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).removeClass(a.call(this,b,qb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(L)||[];while(c=this[i++])if(e=qb(c),d=1===c.nodeType&&" "+pb(e)+" "){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=pb(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):r.isFunction(a)?this.each(function(c){r(this).toggleClass(a.call(this,c,qb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=r(this),f=a.match(L)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=qb(this),b&&W.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":W.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+pb(qb(c))+" ").indexOf(b)>-1)return!0;return!1}});var rb=/\r/g;r.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=r.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,r(this).val()):a,null==e?e="":"number"==typeof e?e+="":Array.isArray(e)&&(e=r.map(e,function(a){return null==a?"":a+""})),b=r.valHooks[this.type]||r.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=r.valHooks[e.type]||r.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(rb,""):null==c?"":c)}}}),r.extend({valHooks:{option:{get:function(a){var b=r.find.attr(a,"value");return null!=b?b:pb(r.text(a))}},select:{get:function(a){var b,c,d,e=a.options,f=a.selectedIndex,g="select-one"===a.type,h=g?null:[],i=g?f+1:e.length;for(d=f<0?i:g?f:0;d<i;d++)if(c=e[d],(c.selected||d===f)&&!c.disabled&&(!c.parentNode.disabled||!B(c.parentNode,"optgroup"))){if(b=r(c).val(),g)return b;h.push(b)}return h},set:function(a,b){var c,d,e=a.options,f=r.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=r.inArray(r.valHooks.option.get(d),f)>-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),r.each(["radio","checkbox"],function(){r.valHooks[this]={set:function(a,b){if(Array.isArray(b))return a.checked=r.inArray(r(a).val(),b)>-1}},o.checkOn||(r.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var sb=/^(?:focusinfocus|focusoutblur)$/;r.extend(r.event,{trigger:function(b,c,e,f){var g,h,i,j,k,m,n,o=[e||d],p=l.call(b,"type")?b.type:b,q=l.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!sb.test(p+r.event.triggered)&&(p.indexOf(".")>-1&&(q=p.split("."),p=q.shift(),q.sort()),k=p.indexOf(":")<0&&"on"+p,b=b[r.expando]?b:new r.Event(p,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=q.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:r.makeArray(c,[b]),n=r.event.special[p]||{},f||!n.trigger||n.trigger.apply(e,c)!==!1)){if(!f&&!n.noBubble&&!r.isWindow(e)){for(j=n.delegateType||p,sb.test(j+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),i=h;i===(e.ownerDocument||d)&&o.push(i.defaultView||i.parentWindow||a)}g=0;while((h=o[g++])&&!b.isPropagationStopped())b.type=g>1?j:n.bindType||p,m=(W.get(h,"events")||{})[b.type]&&W.get(h,"handle"),m&&m.apply(h,c),m=k&&h[k],m&&m.apply&&U(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=p,f||b.isDefaultPrevented()||n._default&&n._default.apply(o.pop(),c)!==!1||!U(e)||k&&r.isFunction(e[p])&&!r.isWindow(e)&&(i=e[k],i&&(e[k]=null),r.event.triggered=p,e[p](),r.event.triggered=void 0,i&&(e[k]=i)),b.result}},simulate:function(a,b,c){var d=r.extend(new r.Event,c,{type:a,isSimulated:!0});r.event.trigger(d,null,b)}}),r.fn.extend({trigger:function(a,b){return this.each(function(){r.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];if(c)return r.event.trigger(a,b,c,!0)}}),r.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(a,b){r.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),r.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),o.focusin="onfocusin"in a,o.focusin||r.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){r.event.simulate(b,a.target,r.event.fix(a))};r.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=W.access(d,b);e||d.addEventListener(a,c,!0),W.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=W.access(d,b)-1;e?W.access(d,b,e):(d.removeEventListener(a,c,!0),W.remove(d,b))}}});var tb=a.location,ub=r.now(),vb=/\?/;r.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return c&&!c.getElementsByTagName("parsererror").length||r.error("Invalid XML: "+b),c};var wb=/\[\]$/,xb=/\r?\n/g,yb=/^(?:submit|button|image|reset|file)$/i,zb=/^(?:input|select|textarea|keygen)/i;function Ab(a,b,c,d){var e;if(Array.isArray(b))r.each(b,function(b,e){c||wb.test(a)?d(a,e):Ab(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==r.type(b))d(a,b);else for(e in b)Ab(a+"["+e+"]",b[e],c,d)}r.param=function(a,b){var c,d=[],e=function(a,b){var c=r.isFunction(b)?b():b;d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(null==c?"":c)};if(Array.isArray(a)||a.jquery&&!r.isPlainObject(a))r.each(a,function(){e(this.name,this.value)});else for(c in a)Ab(c,a[c],b,e);return d.join("&")},r.fn.extend({serialize:function(){return r.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=r.prop(this,"elements");return a?r.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!r(this).is(":disabled")&&zb.test(this.nodeName)&&!yb.test(a)&&(this.checked||!ja.test(a))}).map(function(a,b){var c=r(this).val();return null==c?null:Array.isArray(c)?r.map(c,function(a){return{name:b.name,value:a.replace(xb,"\r\n")}}):{name:b.name,value:c.replace(xb,"\r\n")}}).get()}});var Bb=/%20/g,Cb=/#.*$/,Db=/([?&])_=[^&]*/,Eb=/^(.*?):[ \t]*([^\r\n]*)$/gm,Fb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Gb=/^(?:GET|HEAD)$/,Hb=/^\/\//,Ib={},Jb={},Kb="*/".concat("*"),Lb=d.createElement("a");Lb.href=tb.href;function Mb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(L)||[];if(r.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Nb(a,b,c,d){var e={},f=a===Jb;function g(h){var i;return e[h]=!0,r.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Ob(a,b){var c,d,e=r.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&r.extend(!0,a,d),a}function Pb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}if(f)return f!==i[0]&&i.unshift(f),c[f]}function Qb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}r.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:tb.href,type:"GET",isLocal:Fb.test(tb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Kb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":r.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Ob(Ob(a,r.ajaxSettings),b):Ob(r.ajaxSettings,a)},ajaxPrefilter:Mb(Ib),ajaxTransport:Mb(Jb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m,n,o=r.ajaxSetup({},c),p=o.context||o,q=o.context&&(p.nodeType||p.jquery)?r(p):r.event,s=r.Deferred(),t=r.Callbacks("once memory"),u=o.statusCode||{},v={},w={},x="canceled",y={readyState:0,getResponseHeader:function(a){var b;if(k){if(!h){h={};while(b=Eb.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return k?g:null},setRequestHeader:function(a,b){return null==k&&(a=w[a.toLowerCase()]=w[a.toLowerCase()]||a,v[a]=b),this},overrideMimeType:function(a){return null==k&&(o.mimeType=a),this},statusCode:function(a){var b;if(a)if(k)y.always(a[y.status]);else for(b in a)u[b]=[u[b],a[b]];return this},abort:function(a){var b=a||x;return e&&e.abort(b),A(0,b),this}};if(s.promise(y),o.url=((b||o.url||tb.href)+"").replace(Hb,tb.protocol+"//"),o.type=c.method||c.type||o.method||o.type,o.dataTypes=(o.dataType||"*").toLowerCase().match(L)||[""],null==o.crossDomain){j=d.createElement("a");try{j.href=o.url,j.href=j.href,o.crossDomain=Lb.protocol+"//"+Lb.host!=j.protocol+"//"+j.host}catch(z){o.crossDomain=!0}}if(o.data&&o.processData&&"string"!=typeof o.data&&(o.data=r.param(o.data,o.traditional)),Nb(Ib,o,c,y),k)return y;l=r.event&&o.global,l&&0===r.active++&&r.event.trigger("ajaxStart"),o.type=o.type.toUpperCase(),o.hasContent=!Gb.test(o.type),f=o.url.replace(Cb,""),o.hasContent?o.data&&o.processData&&0===(o.contentType||"").indexOf("application/x-www-form-urlencoded")&&(o.data=o.data.replace(Bb,"+")):(n=o.url.slice(f.length),o.data&&(f+=(vb.test(f)?"&":"?")+o.data,delete o.data),o.cache===!1&&(f=f.replace(Db,"$1"),n=(vb.test(f)?"&":"?")+"_="+ub++ +n),o.url=f+n),o.ifModified&&(r.lastModified[f]&&y.setRequestHeader("If-Modified-Since",r.lastModified[f]),r.etag[f]&&y.setRequestHeader("If-None-Match",r.etag[f])),(o.data&&o.hasContent&&o.contentType!==!1||c.contentType)&&y.setRequestHeader("Content-Type",o.contentType),y.setRequestHeader("Accept",o.dataTypes[0]&&o.accepts[o.dataTypes[0]]?o.accepts[o.dataTypes[0]]+("*"!==o.dataTypes[0]?", "+Kb+"; q=0.01":""):o.accepts["*"]);for(m in o.headers)y.setRequestHeader(m,o.headers[m]);if(o.beforeSend&&(o.beforeSend.call(p,y,o)===!1||k))return y.abort();if(x="abort",t.add(o.complete),y.done(o.success),y.fail(o.error),e=Nb(Jb,o,c,y)){if(y.readyState=1,l&&q.trigger("ajaxSend",[y,o]),k)return y;o.async&&o.timeout>0&&(i=a.setTimeout(function(){y.abort("timeout")},o.timeout));try{k=!1,e.send(v,A)}catch(z){if(k)throw z;A(-1,z)}}else A(-1,"No Transport");function A(b,c,d,h){var j,m,n,v,w,x=c;k||(k=!0,i&&a.clearTimeout(i),e=void 0,g=h||"",y.readyState=b>0?4:0,j=b>=200&&b<300||304===b,d&&(v=Pb(o,y,d)),v=Qb(o,v,y,j),j?(o.ifModified&&(w=y.getResponseHeader("Last-Modified"),w&&(r.lastModified[f]=w),w=y.getResponseHeader("etag"),w&&(r.etag[f]=w)),204===b||"HEAD"===o.type?x="nocontent":304===b?x="notmodified":(x=v.state,m=v.data,n=v.error,j=!n)):(n=x,!b&&x||(x="error",b<0&&(b=0))),y.status=b,y.statusText=(c||x)+"",j?s.resolveWith(p,[m,x,y]):s.rejectWith(p,[y,x,n]),y.statusCode(u),u=void 0,l&&q.trigger(j?"ajaxSuccess":"ajaxError",[y,o,j?m:n]),t.fireWith(p,[y,x]),l&&(q.trigger("ajaxComplete",[y,o]),--r.active||r.event.trigger("ajaxStop")))}return y},getJSON:function(a,b,c){return r.get(a,b,c,"json")},getScript:function(a,b){return r.get(a,void 0,b,"script")}}),r.each(["get","post"],function(a,b){r[b]=function(a,c,d,e){return r.isFunction(c)&&(e=e||d,d=c,c=void 0),r.ajax(r.extend({url:a,type:b,dataType:e,data:c,success:d},r.isPlainObject(a)&&a))}}),r._evalUrl=function(a){return r.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},r.fn.extend({wrapAll:function(a){var b;return this[0]&&(r.isFunction(a)&&(a=a.call(this[0])),b=r(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this},wrapInner:function(a){return r.isFunction(a)?this.each(function(b){r(this).wrapInner(a.call(this,b))}):this.each(function(){var b=r(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=r.isFunction(a);return this.each(function(c){r(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(a){return this.parent(a).not("body").each(function(){r(this).replaceWith(this.childNodes)}),this}}),r.expr.pseudos.hidden=function(a){return!r.expr.pseudos.visible(a)},r.expr.pseudos.visible=function(a){return!!(a.offsetWidth||a.offsetHeight||a.getClientRects().length)},r.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Rb={0:200,1223:204},Sb=r.ajaxSettings.xhr();o.cors=!!Sb&&"withCredentials"in Sb,o.ajax=Sb=!!Sb,r.ajaxTransport(function(b){var c,d;if(o.cors||Sb&&!b.crossDomain)return{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Rb[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}}),r.ajaxPrefilter(function(a){a.crossDomain&&(a.contents.script=!1)}),r.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return r.globalEval(a),a}}}),r.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),r.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=r("<script>").prop({charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&f("error"===a.type?404:200,a.type)}),d.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Tb=[],Ub=/(=)\?(?=&|$)|\?\?/;r.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Tb.pop()||r.expando+"_"+ub++;return this[a]=!0,a}}),r.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Ub.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ub.test(b.data)&&"data");if(h||"jsonp"===b.dataTypes[0])return e=b.jsonpCallback=r.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Ub,"$1"+e):b.jsonp!==!1&&(b.url+=(vb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||r.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){void 0===f?r(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Tb.push(e)),g&&r.isFunction(f)&&f(g[0]),g=f=void 0}),"script"}),o.createHTMLDocument=function(){var a=d.implementation.createHTMLDocument("").body;return a.innerHTML="<form></form><form></form>",2===a.childNodes.length}(),r.parseHTML=function(a,b,c){if("string"!=typeof a)return[];"boolean"==typeof b&&(c=b,b=!1);var e,f,g;return b||(o.createHTMLDocument?(b=d.implementation.createHTMLDocument(""),e=b.createElement("base"),e.href=d.location.href,b.head.appendChild(e)):b=d),f=C.exec(a),g=!c&&[],f?[b.createElement(f[1])]:(f=qa([a],b,g),g&&g.length&&r(g).remove(),r.merge([],f.childNodes))},r.fn.load=function(a,b,c){var d,e,f,g=this,h=a.indexOf(" ");return h>-1&&(d=pb(a.slice(h)),a=a.slice(0,h)),r.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&r.ajax({url:a,type:e||"GET",dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?r("<div>").append(r.parseHTML(a)).find(d):a)}).always(c&&function(a,b){g.each(function(){c.apply(this,f||[a.responseText,b,a])})}),this},r.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){r.fn[b]=function(a){return this.on(b,a)}}),r.expr.pseudos.animated=function(a){return r.grep(r.timers,function(b){return a===b.elem}).length},r.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=r.css(a,"position"),l=r(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=r.css(a,"top"),i=r.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),r.isFunction(b)&&(b=b.call(a,c,r.extend({},h))),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},r.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){r.offset.setOffset(this,a,b)});var b,c,d,e,f=this[0];if(f)return f.getClientRects().length?(d=f.getBoundingClientRect(),b=f.ownerDocument,c=b.documentElement,e=b.defaultView,{top:d.top+e.pageYOffset-c.clientTop,left:d.left+e.pageXOffset-c.clientLeft}):{top:0,left:0}},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===r.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),B(a[0],"html")||(d=a.offset()),d={top:d.top+r.css(a[0],"borderTopWidth",!0),left:d.left+r.css(a[0],"borderLeftWidth",!0)}),{top:b.top-d.top-r.css(c,"marginTop",!0),left:b.left-d.left-r.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&"static"===r.css(a,"position"))a=a.offsetParent;return a||ra})}}),r.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c="pageYOffset"===b;r.fn[a]=function(d){return T(this,function(a,d,e){var f;return r.isWindow(a)?f=a:9===a.nodeType&&(f=a.defaultView),void 0===e?f?f[b]:a[d]:void(f?f.scrollTo(c?f.pageXOffset:e,c?e:f.pageYOffset):a[d]=e)},a,d,arguments.length)}}),r.each(["top","left"],function(a,b){r.cssHooks[b]=Pa(o.pixelPosition,function(a,c){if(c)return c=Oa(a,b),Ma.test(c)?r(a).position()[b]+"px":c})}),r.each({Height:"height",Width:"width"},function(a,b){r.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){r.fn[d]=function(e,f){var g=arguments.length&&(c||"boolean"!=typeof e),h=c||(e===!0||f===!0?"margin":"border");return T(this,function(b,c,e){var f;return r.isWindow(b)?0===d.indexOf("outer")?b["inner"+a]:b.document.documentElement["client"+a]:9===b.nodeType?(f=b.documentElement,Math.max(b.body["scroll"+a],f["scroll"+a],b.body["offset"+a],f["offset"+a],f["client"+a])):void 0===e?r.css(b,c,h):r.style(b,c,e,h)},b,g?e:void 0,g)}})}),r.fn.extend({bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}}),r.holdReady=function(a){a?r.readyWait++:r.ready(!0)},r.isArray=Array.isArray,r.parseJSON=JSON.parse,r.nodeName=B,"function"==typeof define&&define.amd&&define("jquery",[],function(){return r});var Vb=a.jQuery,Wb=a.$;return r.noConflict=function(b){return a.$===r&&(a.$=Wb),b&&a.jQuery===r&&(a.jQuery=Vb),r},b||(a.jQuery=a.$=r),r});
;
// Underscore.js 1.8.3
// http://underscorejs.org
// (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
// Underscore may be freely distributed under the MIT license.
(function(){function n(n){function t(t,r,e,u,i,o){for(;i>=0&&o>i;i+=n){var a=u?u[i]:i;e=r(e,t[a],a,t)}return e}return function(r,e,u,i){e=b(e,i,4);var o=!k(r)&&m.keys(r),a=(o||r).length,c=n>0?0:a-1;return arguments.length<3&&(u=r[o?o[c]:c],c+=n),t(r,e,u,o,c,a)}}function t(n){return function(t,r,e){r=x(r,e);for(var u=O(t),i=n>0?0:u-1;i>=0&&u>i;i+=n)if(r(t[i],i,t))return i;return-1}}function r(n,t,r){return function(e,u,i){var o=0,a=O(e);if("number"==typeof i)n>0?o=i>=0?i:Math.max(i+a,o):a=i>=0?Math.min(i+1,a):i+a+1;else if(r&&i&&a)return i=r(e,u),e[i]===u?i:-1;if(u!==u)return i=t(l.call(e,o,a),m.isNaN),i>=0?i+o:-1;for(i=n>0?o:a-1;i>=0&&a>i;i+=n)if(e[i]===u)return i;return-1}}function e(n,t){var r=I.length,e=n.constructor,u=m.isFunction(e)&&e.prototype||a,i="constructor";for(m.has(n,i)&&!m.contains(t,i)&&t.push(i);r--;)i=I[r],i in n&&n[i]!==u[i]&&!m.contains(t,i)&&t.push(i)}var u=this,i=u._,o=Array.prototype,a=Object.prototype,c=Function.prototype,f=o.push,l=o.slice,s=a.toString,p=a.hasOwnProperty,h=Array.isArray,v=Object.keys,g=c.bind,y=Object.create,d=function(){},m=function(n){return n instanceof m?n:this instanceof m?void(this._wrapped=n):new m(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=m),exports._=m):u._=m,m.VERSION="1.8.3";var b=function(n,t,r){if(t===void 0)return n;switch(null==r?3:r){case 1:return function(r){return n.call(t,r)};case 2:return function(r,e){return n.call(t,r,e)};case 3:return function(r,e,u){return n.call(t,r,e,u)};case 4:return function(r,e,u,i){return n.call(t,r,e,u,i)}}return function(){return n.apply(t,arguments)}},x=function(n,t,r){return null==n?m.identity:m.isFunction(n)?b(n,t,r):m.isObject(n)?m.matcher(n):m.property(n)};m.iteratee=function(n,t){return x(n,t,1/0)};var _=function(n,t){return function(r){var e=arguments.length;if(2>e||null==r)return r;for(var u=1;e>u;u++)for(var i=arguments[u],o=n(i),a=o.length,c=0;a>c;c++){var f=o[c];t&&r[f]!==void 0||(r[f]=i[f])}return r}},j=function(n){if(!m.isObject(n))return{};if(y)return y(n);d.prototype=n;var t=new d;return d.prototype=null,t},w=function(n){return function(t){return null==t?void 0:t[n]}},A=Math.pow(2,53)-1,O=w("length"),k=function(n){var t=O(n);return"number"==typeof t&&t>=0&&A>=t};m.each=m.forEach=function(n,t,r){t=b(t,r);var e,u;if(k(n))for(e=0,u=n.length;u>e;e++)t(n[e],e,n);else{var i=m.keys(n);for(e=0,u=i.length;u>e;e++)t(n[i[e]],i[e],n)}return n},m.map=m.collect=function(n,t,r){t=x(t,r);for(var e=!k(n)&&m.keys(n),u=(e||n).length,i=Array(u),o=0;u>o;o++){var a=e?e[o]:o;i[o]=t(n[a],a,n)}return i},m.reduce=m.foldl=m.inject=n(1),m.reduceRight=m.foldr=n(-1),m.find=m.detect=function(n,t,r){var e;return e=k(n)?m.findIndex(n,t,r):m.findKey(n,t,r),e!==void 0&&e!==-1?n[e]:void 0},m.filter=m.select=function(n,t,r){var e=[];return t=x(t,r),m.each(n,function(n,r,u){t(n,r,u)&&e.push(n)}),e},m.reject=function(n,t,r){return m.filter(n,m.negate(x(t)),r)},m.every=m.all=function(n,t,r){t=x(t,r);for(var e=!k(n)&&m.keys(n),u=(e||n).length,i=0;u>i;i++){var o=e?e[i]:i;if(!t(n[o],o,n))return!1}return!0},m.some=m.any=function(n,t,r){t=x(t,r);for(var e=!k(n)&&m.keys(n),u=(e||n).length,i=0;u>i;i++){var o=e?e[i]:i;if(t(n[o],o,n))return!0}return!1},m.contains=m.includes=m.include=function(n,t,r,e){return k(n)||(n=m.values(n)),("number"!=typeof r||e)&&(r=0),m.indexOf(n,t,r)>=0},m.invoke=function(n,t){var r=l.call(arguments,2),e=m.isFunction(t);return m.map(n,function(n){var u=e?t:n[t];return null==u?u:u.apply(n,r)})},m.pluck=function(n,t){return m.map(n,m.property(t))},m.where=function(n,t){return m.filter(n,m.matcher(t))},m.findWhere=function(n,t){return m.find(n,m.matcher(t))},m.max=function(n,t,r){var e,u,i=-1/0,o=-1/0;if(null==t&&null!=n){n=k(n)?n:m.values(n);for(var a=0,c=n.length;c>a;a++)e=n[a],e>i&&(i=e)}else t=x(t,r),m.each(n,function(n,r,e){u=t(n,r,e),(u>o||u===-1/0&&i===-1/0)&&(i=n,o=u)});return i},m.min=function(n,t,r){var e,u,i=1/0,o=1/0;if(null==t&&null!=n){n=k(n)?n:m.values(n);for(var a=0,c=n.length;c>a;a++)e=n[a],i>e&&(i=e)}else t=x(t,r),m.each(n,function(n,r,e){u=t(n,r,e),(o>u||1/0===u&&1/0===i)&&(i=n,o=u)});return i},m.shuffle=function(n){for(var t,r=k(n)?n:m.values(n),e=r.length,u=Array(e),i=0;e>i;i++)t=m.random(0,i),t!==i&&(u[i]=u[t]),u[t]=r[i];return u},m.sample=function(n,t,r){return null==t||r?(k(n)||(n=m.values(n)),n[m.random(n.length-1)]):m.shuffle(n).slice(0,Math.max(0,t))},m.sortBy=function(n,t,r){return t=x(t,r),m.pluck(m.map(n,function(n,r,e){return{value:n,index:r,criteria:t(n,r,e)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.index-t.index}),"value")};var F=function(n){return function(t,r,e){var u={};return r=x(r,e),m.each(t,function(e,i){var o=r(e,i,t);n(u,e,o)}),u}};m.groupBy=F(function(n,t,r){m.has(n,r)?n[r].push(t):n[r]=[t]}),m.indexBy=F(function(n,t,r){n[r]=t}),m.countBy=F(function(n,t,r){m.has(n,r)?n[r]++:n[r]=1}),m.toArray=function(n){return n?m.isArray(n)?l.call(n):k(n)?m.map(n,m.identity):m.values(n):[]},m.size=function(n){return null==n?0:k(n)?n.length:m.keys(n).length},m.partition=function(n,t,r){t=x(t,r);var e=[],u=[];return m.each(n,function(n,r,i){(t(n,r,i)?e:u).push(n)}),[e,u]},m.first=m.head=m.take=function(n,t,r){return null==n?void 0:null==t||r?n[0]:m.initial(n,n.length-t)},m.initial=function(n,t,r){return l.call(n,0,Math.max(0,n.length-(null==t||r?1:t)))},m.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:m.rest(n,Math.max(0,n.length-t))},m.rest=m.tail=m.drop=function(n,t,r){return l.call(n,null==t||r?1:t)},m.compact=function(n){return m.filter(n,m.identity)};var S=function(n,t,r,e){for(var u=[],i=0,o=e||0,a=O(n);a>o;o++){var c=n[o];if(k(c)&&(m.isArray(c)||m.isArguments(c))){t||(c=S(c,t,r));var f=0,l=c.length;for(u.length+=l;l>f;)u[i++]=c[f++]}else r||(u[i++]=c)}return u};m.flatten=function(n,t){return S(n,t,!1)},m.without=function(n){return m.difference(n,l.call(arguments,1))},m.uniq=m.unique=function(n,t,r,e){m.isBoolean(t)||(e=r,r=t,t=!1),null!=r&&(r=x(r,e));for(var u=[],i=[],o=0,a=O(n);a>o;o++){var c=n[o],f=r?r(c,o,n):c;t?(o&&i===f||u.push(c),i=f):r?m.contains(i,f)||(i.push(f),u.push(c)):m.contains(u,c)||u.push(c)}return u},m.union=function(){return m.uniq(S(arguments,!0,!0))},m.intersection=function(n){for(var t=[],r=arguments.length,e=0,u=O(n);u>e;e++){var i=n[e];if(!m.contains(t,i)){for(var o=1;r>o&&m.contains(arguments[o],i);o++);o===r&&t.push(i)}}return t},m.difference=function(n){var t=S(arguments,!0,!0,1);return m.filter(n,function(n){return!m.contains(t,n)})},m.zip=function(){return m.unzip(arguments)},m.unzip=function(n){for(var t=n&&m.max(n,O).length||0,r=Array(t),e=0;t>e;e++)r[e]=m.pluck(n,e);return r},m.object=function(n,t){for(var r={},e=0,u=O(n);u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},m.findIndex=t(1),m.findLastIndex=t(-1),m.sortedIndex=function(n,t,r,e){r=x(r,e,1);for(var u=r(t),i=0,o=O(n);o>i;){var a=Math.floor((i+o)/2);r(n[a])<u?i=a+1:o=a}return i},m.indexOf=r(1,m.findIndex,m.sortedIndex),m.lastIndexOf=r(-1,m.findLastIndex),m.range=function(n,t,r){null==t&&(t=n||0,n=0),r=r||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=Array(e),i=0;e>i;i++,n+=r)u[i]=n;return u};var E=function(n,t,r,e,u){if(!(e instanceof t))return n.apply(r,u);var i=j(n.prototype),o=n.apply(i,u);return m.isObject(o)?o:i};m.bind=function(n,t){if(g&&n.bind===g)return g.apply(n,l.call(arguments,1));if(!m.isFunction(n))throw new TypeError("Bind must be called on a function");var r=l.call(arguments,2),e=function(){return E(n,e,t,this,r.concat(l.call(arguments)))};return e},m.partial=function(n){var t=l.call(arguments,1),r=function(){for(var e=0,u=t.length,i=Array(u),o=0;u>o;o++)i[o]=t[o]===m?arguments[e++]:t[o];for(;e<arguments.length;)i.push(arguments[e++]);return E(n,r,this,this,i)};return r},m.bindAll=function(n){var t,r,e=arguments.length;if(1>=e)throw new Error("bindAll must be passed function names");for(t=1;e>t;t++)r=arguments[t],n[r]=m.bind(n[r],n);return n},m.memoize=function(n,t){var r=function(e){var u=r.cache,i=""+(t?t.apply(this,arguments):e);return m.has(u,i)||(u[i]=n.apply(this,arguments)),u[i]};return r.cache={},r},m.delay=function(n,t){var r=l.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},m.defer=m.partial(m.delay,m,1),m.throttle=function(n,t,r){var e,u,i,o=null,a=0;r||(r={});var c=function(){a=r.leading===!1?0:m.now(),o=null,i=n.apply(e,u),o||(e=u=null)};return function(){var f=m.now();a||r.leading!==!1||(a=f);var l=t-(f-a);return e=this,u=arguments,0>=l||l>t?(o&&(clearTimeout(o),o=null),a=f,i=n.apply(e,u),o||(e=u=null)):o||r.trailing===!1||(o=setTimeout(c,l)),i}},m.debounce=function(n,t,r){var e,u,i,o,a,c=function(){var f=m.now()-o;t>f&&f>=0?e=setTimeout(c,t-f):(e=null,r||(a=n.apply(i,u),e||(i=u=null)))};return function(){i=this,u=arguments,o=m.now();var f=r&&!e;return e||(e=setTimeout(c,t)),f&&(a=n.apply(i,u),i=u=null),a}},m.wrap=function(n,t){return m.partial(t,n)},m.negate=function(n){return function(){return!n.apply(this,arguments)}},m.compose=function(){var n=arguments,t=n.length-1;return function(){for(var r=t,e=n[t].apply(this,arguments);r--;)e=n[r].call(this,e);return e}},m.after=function(n,t){return function(){return--n<1?t.apply(this,arguments):void 0}},m.before=function(n,t){var r;return function(){return--n>0&&(r=t.apply(this,arguments)),1>=n&&(t=null),r}},m.once=m.partial(m.before,2);var M=!{toString:null}.propertyIsEnumerable("toString"),I=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];m.keys=function(n){if(!m.isObject(n))return[];if(v)return v(n);var t=[];for(var r in n)m.has(n,r)&&t.push(r);return M&&e(n,t),t},m.allKeys=function(n){if(!m.isObject(n))return[];var t=[];for(var r in n)t.push(r);return M&&e(n,t),t},m.values=function(n){for(var t=m.keys(n),r=t.length,e=Array(r),u=0;r>u;u++)e[u]=n[t[u]];return e},m.mapObject=function(n,t,r){t=x(t,r);for(var e,u=m.keys(n),i=u.length,o={},a=0;i>a;a++)e=u[a],o[e]=t(n[e],e,n);return o},m.pairs=function(n){for(var t=m.keys(n),r=t.length,e=Array(r),u=0;r>u;u++)e[u]=[t[u],n[t[u]]];return e},m.invert=function(n){for(var t={},r=m.keys(n),e=0,u=r.length;u>e;e++)t[n[r[e]]]=r[e];return t},m.functions=m.methods=function(n){var t=[];for(var r in n)m.isFunction(n[r])&&t.push(r);return t.sort()},m.extend=_(m.allKeys),m.extendOwn=m.assign=_(m.keys),m.findKey=function(n,t,r){t=x(t,r);for(var e,u=m.keys(n),i=0,o=u.length;o>i;i++)if(e=u[i],t(n[e],e,n))return e},m.pick=function(n,t,r){var e,u,i={},o=n;if(null==o)return i;m.isFunction(t)?(u=m.allKeys(o),e=b(t,r)):(u=S(arguments,!1,!1,1),e=function(n,t,r){return t in r},o=Object(o));for(var a=0,c=u.length;c>a;a++){var f=u[a],l=o[f];e(l,f,o)&&(i[f]=l)}return i},m.omit=function(n,t,r){if(m.isFunction(t))t=m.negate(t);else{var e=m.map(S(arguments,!1,!1,1),String);t=function(n,t){return!m.contains(e,t)}}return m.pick(n,t,r)},m.defaults=_(m.allKeys,!0),m.create=function(n,t){var r=j(n);return t&&m.extendOwn(r,t),r},m.clone=function(n){return m.isObject(n)?m.isArray(n)?n.slice():m.extend({},n):n},m.tap=function(n,t){return t(n),n},m.isMatch=function(n,t){var r=m.keys(t),e=r.length;if(null==n)return!e;for(var u=Object(n),i=0;e>i;i++){var o=r[i];if(t[o]!==u[o]||!(o in u))return!1}return!0};var N=function(n,t,r,e){if(n===t)return 0!==n||1/n===1/t;if(null==n||null==t)return n===t;n instanceof m&&(n=n._wrapped),t instanceof m&&(t=t._wrapped);var u=s.call(n);if(u!==s.call(t))return!1;switch(u){case"[object RegExp]":case"[object String]":return""+n==""+t;case"[object Number]":return+n!==+n?+t!==+t:0===+n?1/+n===1/t:+n===+t;case"[object Date]":case"[object Boolean]":return+n===+t}var i="[object Array]"===u;if(!i){if("object"!=typeof n||"object"!=typeof t)return!1;var o=n.constructor,a=t.constructor;if(o!==a&&!(m.isFunction(o)&&o instanceof o&&m.isFunction(a)&&a instanceof a)&&"constructor"in n&&"constructor"in t)return!1}r=r||[],e=e||[];for(var c=r.length;c--;)if(r[c]===n)return e[c]===t;if(r.push(n),e.push(t),i){if(c=n.length,c!==t.length)return!1;for(;c--;)if(!N(n[c],t[c],r,e))return!1}else{var f,l=m.keys(n);if(c=l.length,m.keys(t).length!==c)return!1;for(;c--;)if(f=l[c],!m.has(t,f)||!N(n[f],t[f],r,e))return!1}return r.pop(),e.pop(),!0};m.isEqual=function(n,t){return N(n,t)},m.isEmpty=function(n){return null==n?!0:k(n)&&(m.isArray(n)||m.isString(n)||m.isArguments(n))?0===n.length:0===m.keys(n).length},m.isElement=function(n){return!(!n||1!==n.nodeType)},m.isArray=h||function(n){return"[object Array]"===s.call(n)},m.isObject=function(n){var t=typeof n;return"function"===t||"object"===t&&!!n},m.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(n){m["is"+n]=function(t){return s.call(t)==="[object "+n+"]"}}),m.isArguments(arguments)||(m.isArguments=function(n){return m.has(n,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(m.isFunction=function(n){return"function"==typeof n||!1}),m.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},m.isNaN=function(n){return m.isNumber(n)&&n!==+n},m.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"===s.call(n)},m.isNull=function(n){return null===n},m.isUndefined=function(n){return n===void 0},m.has=function(n,t){return null!=n&&p.call(n,t)},m.noConflict=function(){return u._=i,this},m.identity=function(n){return n},m.constant=function(n){return function(){return n}},m.noop=function(){},m.property=w,m.propertyOf=function(n){return null==n?function(){}:function(t){return n[t]}},m.matcher=m.matches=function(n){return n=m.extendOwn({},n),function(t){return m.isMatch(t,n)}},m.times=function(n,t,r){var e=Array(Math.max(0,n));t=b(t,r,1);for(var u=0;n>u;u++)e[u]=t(u);return e},m.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))},m.now=Date.now||function(){return(new Date).getTime()};var B={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},T=m.invert(B),R=function(n){var t=function(t){return n[t]},r="(?:"+m.keys(n).join("|")+")",e=RegExp(r),u=RegExp(r,"g");return function(n){return n=null==n?"":""+n,e.test(n)?n.replace(u,t):n}};m.escape=R(B),m.unescape=R(T),m.result=function(n,t,r){var e=null==n?void 0:n[t];return e===void 0&&(e=r),m.isFunction(e)?e.call(n):e};var q=0;m.uniqueId=function(n){var t=++q+"";return n?n+t:t},m.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var K=/(.)^/,z={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\u2028|\u2029/g,L=function(n){return"\\"+z[n]};m.template=function(n,t,r){!t&&r&&(t=r),t=m.defaults({},t,m.templateSettings);var e=RegExp([(t.escape||K).source,(t.interpolate||K).source,(t.evaluate||K).source].join("|")+"|$","g"),u=0,i="__p+='";n.replace(e,function(t,r,e,o,a){return i+=n.slice(u,a).replace(D,L),u=a+t.length,r?i+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":e?i+="'+\n((__t=("+e+"))==null?'':__t)+\n'":o&&(i+="';\n"+o+"\n__p+='"),t}),i+="';\n",t.variable||(i="with(obj||{}){\n"+i+"}\n"),i="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+i+"return __p;\n";try{var o=new Function(t.variable||"obj","_",i)}catch(a){throw a.source=i,a}var c=function(n){return o.call(this,n,m)},f=t.variable||"obj";return c.source="function("+f+"){\n"+i+"}",c},m.chain=function(n){var t=m(n);return t._chain=!0,t};var P=function(n,t){return n._chain?m(t).chain():t};m.mixin=function(n){m.each(m.functions(n),function(t){var r=m[t]=n[t];m.prototype[t]=function(){var n=[this._wrapped];return f.apply(n,arguments),P(this,r.apply(m,n))}})},m.mixin(m),m.each(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=o[n];m.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!==n&&"splice"!==n||0!==r.length||delete r[0],P(this,r)}}),m.each(["concat","join","slice"],function(n){var t=o[n];m.prototype[n]=function(){return P(this,t.apply(this._wrapped,arguments))}}),m.prototype.value=function(){return this._wrapped},m.prototype.valueOf=m.prototype.toJSON=m.prototype.value,m.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return m})}).call(this);
/*!
* jQuery Once v2.2.0 - http://github.com/robloach/jquery-once
* @license MIT, GPL-2.0
* http://opensource.org/licenses/MIT
* http://opensource.org/licenses/GPL-2.0
*/
(function(e){"use strict";if(typeof exports==="object"){e(require("jquery"))}else if(typeof define==="function"&&define.amd){define(["jquery"],e)}else{e(jQuery)}})(function(e){"use strict";var n=function(e){e=e||"once";if(typeof e!=="string"){throw new TypeError("The jQuery Once id parameter must be a string")}return e};e.fn.once=function(t){var r="jquery-once-"+n(t);return this.filter(function(){return e(this).data(r)!==true}).data(r,true)};e.fn.removeOnce=function(e){return this.findOnce(e).removeData("jquery-once-"+n(e))};e.fn.findOnce=function(t){var r="jquery-once-"+n(t);return this.filter(function(){return e(this).data(r)===true})}});
(function(t){var e=typeof self=="object"&&self.self==self&&self||typeof global=="object"&&global.global==global&&global;if(typeof define==="function"&&define.amd){define(["underscore","jquery","exports"],function(i,r,n){e.Backbone=t(e,n,i,r)})}else if(typeof exports!=="undefined"){var i=require("underscore"),r;try{r=require("jquery")}catch(n){}t(e,exports,i,r)}else{e.Backbone=t(e,{},e._,e.jQuery||e.Zepto||e.ender||e.$)}})(function(t,e,i,r){var n=t.Backbone;var s=Array.prototype.slice;e.VERSION="1.2.3";e.$=r;e.noConflict=function(){t.Backbone=n;return this};e.emulateHTTP=false;e.emulateJSON=false;var a=function(t,e,r){switch(t){case 1:return function(){return i[e](this[r])};case 2:return function(t){return i[e](this[r],t)};case 3:return function(t,n){return i[e](this[r],h(t,this),n)};case 4:return function(t,n,s){return i[e](this[r],h(t,this),n,s)};default:return function(){var t=s.call(arguments);t.unshift(this[r]);return i[e].apply(i,t)}}};var o=function(t,e,r){i.each(e,function(e,n){if(i[n])t.prototype[n]=a(e,n,r)})};var h=function(t,e){if(i.isFunction(t))return t;if(i.isObject(t)&&!e._isModel(t))return u(t);if(i.isString(t))return function(e){return e.get(t)};return t};var u=function(t){var e=i.matches(t);return function(t){return e(t.attributes)}};var l=e.Events={};var c=/\s+/;var f=function(t,e,r,n,s){var a=0,o;if(r&&typeof r==="object"){if(n!==void 0&&"context"in s&&s.context===void 0)s.context=n;for(o=i.keys(r);a<o.length;a++){e=f(t,e,o[a],r[o[a]],s)}}else if(r&&c.test(r)){for(o=r.split(c);a<o.length;a++){e=t(e,o[a],n,s)}}else{e=t(e,r,n,s)}return e};l.on=function(t,e,i){return d(this,t,e,i)};var d=function(t,e,i,r,n){t._events=f(v,t._events||{},e,i,{context:r,ctx:t,listening:n});if(n){var s=t._listeners||(t._listeners={});s[n.id]=n}return t};l.listenTo=function(t,e,r){if(!t)return this;var n=t._listenId||(t._listenId=i.uniqueId("l"));var s=this._listeningTo||(this._listeningTo={});var a=s[n];if(!a){var o=this._listenId||(this._listenId=i.uniqueId("l"));a=s[n]={obj:t,objId:n,id:o,listeningTo:s,count:0}}d(t,e,r,this,a);return this};var v=function(t,e,i,r){if(i){var n=t[e]||(t[e]=[]);var s=r.context,a=r.ctx,o=r.listening;if(o)o.count++;n.push({callback:i,context:s,ctx:s||a,listening:o})}return t};l.off=function(t,e,i){if(!this._events)return this;this._events=f(g,this._events,t,e,{context:i,listeners:this._listeners});return this};l.stopListening=function(t,e,r){var n=this._listeningTo;if(!n)return this;var s=t?[t._listenId]:i.keys(n);for(var a=0;a<s.length;a++){var o=n[s[a]];if(!o)break;o.obj.off(e,r,this)}if(i.isEmpty(n))this._listeningTo=void 0;return this};var g=function(t,e,r,n){if(!t)return;var s=0,a;var o=n.context,h=n.listeners;if(!e&&!r&&!o){var u=i.keys(h);for(;s<u.length;s++){a=h[u[s]];delete h[a.id];delete a.listeningTo[a.objId]}return}var l=e?[e]:i.keys(t);for(;s<l.length;s++){e=l[s];var c=t[e];if(!c)break;var f=[];for(var d=0;d<c.length;d++){var v=c[d];if(r&&r!==v.callback&&r!==v.callback._callback||o&&o!==v.context){f.push(v)}else{a=v.listening;if(a&&--a.count===0){delete h[a.id];delete a.listeningTo[a.objId]}}}if(f.length){t[e]=f}else{delete t[e]}}if(i.size(t))return t};l.once=function(t,e,r){var n=f(p,{},t,e,i.bind(this.off,this));return this.on(n,void 0,r)};l.listenToOnce=function(t,e,r){var n=f(p,{},e,r,i.bind(this.stopListening,this,t));return this.listenTo(t,n)};var p=function(t,e,r,n){if(r){var s=t[e]=i.once(function(){n(e,s);r.apply(this,arguments)});s._callback=r}return t};l.trigger=function(t){if(!this._events)return this;var e=Math.max(0,arguments.length-1);var i=Array(e);for(var r=0;r<e;r++)i[r]=arguments[r+1];f(m,this._events,t,void 0,i);return this};var m=function(t,e,i,r){if(t){var n=t[e];var s=t.all;if(n&&s)s=s.slice();if(n)_(n,r);if(s)_(s,[e].concat(r))}return t};var _=function(t,e){var i,r=-1,n=t.length,s=e[0],a=e[1],o=e[2];switch(e.length){case 0:while(++r<n)(i=t[r]).callback.call(i.ctx);return;case 1:while(++r<n)(i=t[r]).callback.call(i.ctx,s);return;case 2:while(++r<n)(i=t[r]).callback.call(i.ctx,s,a);return;case 3:while(++r<n)(i=t[r]).callback.call(i.ctx,s,a,o);return;default:while(++r<n)(i=t[r]).callback.apply(i.ctx,e);return}};l.bind=l.on;l.unbind=l.off;i.extend(e,l);var y=e.Model=function(t,e){var r=t||{};e||(e={});this.cid=i.uniqueId(this.cidPrefix);this.attributes={};if(e.collection)this.collection=e.collection;if(e.parse)r=this.parse(r,e)||{};r=i.defaults({},r,i.result(this,"defaults"));this.set(r,e);this.changed={};this.initialize.apply(this,arguments)};i.extend(y.prototype,l,{changed:null,validationError:null,idAttribute:"id",cidPrefix:"c",initialize:function(){},toJSON:function(t){return i.clone(this.attributes)},sync:function(){return e.sync.apply(this,arguments)},get:function(t){return this.attributes[t]},escape:function(t){return i.escape(this.get(t))},has:function(t){return this.get(t)!=null},matches:function(t){return!!i.iteratee(t,this)(this.attributes)},set:function(t,e,r){if(t==null)return this;var n;if(typeof t==="object"){n=t;r=e}else{(n={})[t]=e}r||(r={});if(!this._validate(n,r))return false;var s=r.unset;var a=r.silent;var o=[];var h=this._changing;this._changing=true;if(!h){this._previousAttributes=i.clone(this.attributes);this.changed={}}var u=this.attributes;var l=this.changed;var c=this._previousAttributes;for(var f in n){e=n[f];if(!i.isEqual(u[f],e))o.push(f);if(!i.isEqual(c[f],e)){l[f]=e}else{delete l[f]}s?delete u[f]:u[f]=e}this.id=this.get(this.idAttribute);if(!a){if(o.length)this._pending=r;for(var d=0;d<o.length;d++){this.trigger("change:"+o[d],this,u[o[d]],r)}}if(h)return this;if(!a){while(this._pending){r=this._pending;this._pending=false;this.trigger("change",this,r)}}this._pending=false;this._changing=false;return this},unset:function(t,e){return this.set(t,void 0,i.extend({},e,{unset:true}))},clear:function(t){var e={};for(var r in this.attributes)e[r]=void 0;return this.set(e,i.extend({},t,{unset:true}))},hasChanged:function(t){if(t==null)return!i.isEmpty(this.changed);return i.has(this.changed,t)},changedAttributes:function(t){if(!t)return this.hasChanged()?i.clone(this.changed):false;var e=this._changing?this._previousAttributes:this.attributes;var r={};for(var n in t){var s=t[n];if(i.isEqual(e[n],s))continue;r[n]=s}return i.size(r)?r:false},previous:function(t){if(t==null||!this._previousAttributes)return null;return this._previousAttributes[t]},previousAttributes:function(){return i.clone(this._previousAttributes)},fetch:function(t){t=i.extend({parse:true},t);var e=this;var r=t.success;t.success=function(i){var n=t.parse?e.parse(i,t):i;if(!e.set(n,t))return false;if(r)r.call(t.context,e,i,t);e.trigger("sync",e,i,t)};z(this,t);return this.sync("read",this,t)},save:function(t,e,r){var n;if(t==null||typeof t==="object"){n=t;r=e}else{(n={})[t]=e}r=i.extend({validate:true,parse:true},r);var s=r.wait;if(n&&!s){if(!this.set(n,r))return false}else{if(!this._validate(n,r))return false}var a=this;var o=r.success;var h=this.attributes;r.success=function(t){a.attributes=h;var e=r.parse?a.parse(t,r):t;if(s)e=i.extend({},n,e);if(e&&!a.set(e,r))return false;if(o)o.call(r.context,a,t,r);a.trigger("sync",a,t,r)};z(this,r);if(n&&s)this.attributes=i.extend({},h,n);var u=this.isNew()?"create":r.patch?"patch":"update";if(u==="patch"&&!r.attrs)r.attrs=n;var l=this.sync(u,this,r);this.attributes=h;return l},destroy:function(t){t=t?i.clone(t):{};var e=this;var r=t.success;var n=t.wait;var s=function(){e.stopListening();e.trigger("destroy",e,e.collection,t)};t.success=function(i){if(n)s();if(r)r.call(t.context,e,i,t);if(!e.isNew())e.trigger("sync",e,i,t)};var a=false;if(this.isNew()){i.defer(t.success)}else{z(this,t);a=this.sync("delete",this,t)}if(!n)s();return a},url:function(){var t=i.result(this,"urlRoot")||i.result(this.collection,"url")||F();if(this.isNew())return t;var e=this.get(this.idAttribute);return t.replace(/[^\/]$/,"$&/")+encodeURIComponent(e)},parse:function(t,e){return t},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(t){return this._validate({},i.defaults({validate:true},t))},_validate:function(t,e){if(!e.validate||!this.validate)return true;t=i.extend({},this.attributes,t);var r=this.validationError=this.validate(t,e)||null;if(!r)return true;this.trigger("invalid",this,r,i.extend(e,{validationError:r}));return false}});var b={keys:1,values:1,pairs:1,invert:1,pick:0,omit:0,chain:1,isEmpty:1};o(y,b,"attributes");var x=e.Collection=function(t,e){e||(e={});if(e.model)this.model=e.model;if(e.comparator!==void 0)this.comparator=e.comparator;this._reset();this.initialize.apply(this,arguments);if(t)this.reset(t,i.extend({silent:true},e))};var w={add:true,remove:true,merge:true};var E={add:true,remove:false};var k=function(t,e,i){i=Math.min(Math.max(i,0),t.length);var r=Array(t.length-i);var n=e.length;for(var s=0;s<r.length;s++)r[s]=t[s+i];for(s=0;s<n;s++)t[s+i]=e[s];for(s=0;s<r.length;s++)t[s+n+i]=r[s]};i.extend(x.prototype,l,{model:y,initialize:function(){},toJSON:function(t){return this.map(function(e){return e.toJSON(t)})},sync:function(){return e.sync.apply(this,arguments)},add:function(t,e){return this.set(t,i.extend({merge:false},e,E))},remove:function(t,e){e=i.extend({},e);var r=!i.isArray(t);t=r?[t]:i.clone(t);var n=this._removeModels(t,e);if(!e.silent&&n)this.trigger("update",this,e);return r?n[0]:n},set:function(t,e){if(t==null)return;e=i.defaults({},e,w);if(e.parse&&!this._isModel(t))t=this.parse(t,e);var r=!i.isArray(t);t=r?[t]:t.slice();var n=e.at;if(n!=null)n=+n;if(n<0)n+=this.length+1;var s=[];var a=[];var o=[];var h={};var u=e.add;var l=e.merge;var c=e.remove;var f=false;var d=this.comparator&&n==null&&e.sort!==false;var v=i.isString(this.comparator)?this.comparator:null;var g;for(var p=0;p<t.length;p++){g=t[p];var m=this.get(g);if(m){if(l&&g!==m){var _=this._isModel(g)?g.attributes:g;if(e.parse)_=m.parse(_,e);m.set(_,e);if(d&&!f)f=m.hasChanged(v)}if(!h[m.cid]){h[m.cid]=true;s.push(m)}t[p]=m}else if(u){g=t[p]=this._prepareModel(g,e);if(g){a.push(g);this._addReference(g,e);h[g.cid]=true;s.push(g)}}}if(c){for(p=0;p<this.length;p++){g=this.models[p];if(!h[g.cid])o.push(g)}if(o.length)this._removeModels(o,e)}var y=false;var b=!d&&u&&c;if(s.length&&b){y=this.length!=s.length||i.some(this.models,function(t,e){return t!==s[e]});this.models.length=0;k(this.models,s,0);this.length=this.models.length}else if(a.length){if(d)f=true;k(this.models,a,n==null?this.length:n);this.length=this.models.length}if(f)this.sort({silent:true});if(!e.silent){for(p=0;p<a.length;p++){if(n!=null)e.index=n+p;g=a[p];g.trigger("add",g,this,e)}if(f||y)this.trigger("sort",this,e);if(a.length||o.length)this.trigger("update",this,e)}return r?t[0]:t},reset:function(t,e){e=e?i.clone(e):{};for(var r=0;r<this.models.length;r++){this._removeReference(this.models[r],e)}e.previousModels=this.models;this._reset();t=this.add(t,i.extend({silent:true},e));if(!e.silent)this.trigger("reset",this,e);return t},push:function(t,e){return this.add(t,i.extend({at:this.length},e))},pop:function(t){var e=this.at(this.length-1);return this.remove(e,t)},unshift:function(t,e){return this.add(t,i.extend({at:0},e))},shift:function(t){var e=this.at(0);return this.remove(e,t)},slice:function(){return s.apply(this.models,arguments)},get:function(t){if(t==null)return void 0;var e=this.modelId(this._isModel(t)?t.attributes:t);return this._byId[t]||this._byId[e]||this._byId[t.cid]},at:function(t){if(t<0)t+=this.length;return this.models[t]},where:function(t,e){return this[e?"find":"filter"](t)},findWhere:function(t){return this.where(t,true)},sort:function(t){var e=this.comparator;if(!e)throw new Error("Cannot sort a set without a comparator");t||(t={});var r=e.length;if(i.isFunction(e))e=i.bind(e,this);if(r===1||i.isString(e)){this.models=this.sortBy(e)}else{this.models.sort(e)}if(!t.silent)this.trigger("sort",this,t);return this},pluck:function(t){return i.invoke(this.models,"get",t)},fetch:function(t){t=i.extend({parse:true},t);var e=t.success;var r=this;t.success=function(i){var n=t.reset?"reset":"set";r[n](i,t);if(e)e.call(t.context,r,i,t);r.trigger("sync",r,i,t)};z(this,t);return this.sync("read",this,t)},create:function(t,e){e=e?i.clone(e):{};var r=e.wait;t=this._prepareModel(t,e);if(!t)return false;if(!r)this.add(t,e);var n=this;var s=e.success;e.success=function(t,e,i){if(r)n.add(t,i);if(s)s.call(i.context,t,e,i)};t.save(null,e);return t},parse:function(t,e){return t},clone:function(){return new this.constructor(this.models,{model:this.model,comparator:this.comparator})},modelId:function(t){return t[this.model.prototype.idAttribute||"id"]},_reset:function(){this.length=0;this.models=[];this._byId={}},_prepareModel:function(t,e){if(this._isModel(t)){if(!t.collection)t.collection=this;return t}e=e?i.clone(e):{};e.collection=this;var r=new this.model(t,e);if(!r.validationError)return r;this.trigger("invalid",this,r.validationError,e);return false},_removeModels:function(t,e){var i=[];for(var r=0;r<t.length;r++){var n=this.get(t[r]);if(!n)continue;var s=this.indexOf(n);this.models.splice(s,1);this.length--;if(!e.silent){e.index=s;n.trigger("remove",n,this,e)}i.push(n);this._removeReference(n,e)}return i.length?i:false},_isModel:function(t){return t instanceof y},_addReference:function(t,e){this._byId[t.cid]=t;var i=this.modelId(t.attributes);if(i!=null)this._byId[i]=t;t.on("all",this._onModelEvent,this)},_removeReference:function(t,e){delete this._byId[t.cid];var i=this.modelId(t.attributes);if(i!=null)delete this._byId[i];if(this===t.collection)delete t.collection;t.off("all",this._onModelEvent,this)},_onModelEvent:function(t,e,i,r){if((t==="add"||t==="remove")&&i!==this)return;if(t==="destroy")this.remove(e,r);if(t==="change"){var n=this.modelId(e.previousAttributes());var s=this.modelId(e.attributes);if(n!==s){if(n!=null)delete this._byId[n];if(s!=null)this._byId[s]=e}}this.trigger.apply(this,arguments)}});var S={forEach:3,each:3,map:3,collect:3,reduce:4,foldl:4,inject:4,reduceRight:4,foldr:4,find:3,detect:3,filter:3,select:3,reject:3,every:3,all:3,some:3,any:3,include:3,includes:3,contains:3,invoke:0,max:3,min:3,toArray:1,size:1,first:3,head:3,take:3,initial:3,rest:3,tail:3,drop:3,last:3,without:0,difference:0,indexOf:3,shuffle:1,lastIndexOf:3,isEmpty:1,chain:1,sample:3,partition:3,groupBy:3,countBy:3,sortBy:3,indexBy:3};o(x,S,"models");var I=e.View=function(t){this.cid=i.uniqueId("view");i.extend(this,i.pick(t,P));this._ensureElement();this.initialize.apply(this,arguments)};var T=/^(\S+)\s*(.*)$/;var P=["model","collection","el","id","attributes","className","tagName","events"];i.extend(I.prototype,l,{tagName:"div",$:function(t){return this.$el.find(t)},initialize:function(){},render:function(){return this},remove:function(){this._removeElement();this.stopListening();return this},_removeElement:function(){this.$el.remove()},setElement:function(t){this.undelegateEvents();this._setElement(t);this.delegateEvents();return this},_setElement:function(t){this.$el=t instanceof e.$?t:e.$(t);this.el=this.$el[0]},delegateEvents:function(t){t||(t=i.result(this,"events"));if(!t)return this;this.undelegateEvents();for(var e in t){var r=t[e];if(!i.isFunction(r))r=this[r];if(!r)continue;var n=e.match(T);this.delegate(n[1],n[2],i.bind(r,this))}return this},delegate:function(t,e,i){this.$el.on(t+".delegateEvents"+this.cid,e,i);return this},undelegateEvents:function(){if(this.$el)this.$el.off(".delegateEvents"+this.cid);return this},undelegate:function(t,e,i){this.$el.off(t+".delegateEvents"+this.cid,e,i);return this},_createElement:function(t){return document.createElement(t)},_ensureElement:function(){if(!this.el){var t=i.extend({},i.result(this,"attributes"));if(this.id)t.id=i.result(this,"id");if(this.className)t["class"]=i.result(this,"className");this.setElement(this._createElement(i.result(this,"tagName")));this._setAttributes(t)}else{this.setElement(i.result(this,"el"))}},_setAttributes:function(t){this.$el.attr(t)}});e.sync=function(t,r,n){var s=H[t];i.defaults(n||(n={}),{emulateHTTP:e.emulateHTTP,emulateJSON:e.emulateJSON});var a={type:s,dataType:"json"};if(!n.url){a.url=i.result(r,"url")||F()}if(n.data==null&&r&&(t==="create"||t==="update"||t==="patch")){a.contentType="application/json";a.data=JSON.stringify(n.attrs||r.toJSON(n))}if(n.emulateJSON){a.contentType="application/x-www-form-urlencoded";a.data=a.data?{model:a.data}:{}}if(n.emulateHTTP&&(s==="PUT"||s==="DELETE"||s==="PATCH")){a.type="POST";if(n.emulateJSON)a.data._method=s;var o=n.beforeSend;n.beforeSend=function(t){t.setRequestHeader("X-HTTP-Method-Override",s);if(o)return o.apply(this,arguments)}}if(a.type!=="GET"&&!n.emulateJSON){a.processData=false}var h=n.error;n.error=function(t,e,i){n.textStatus=e;n.errorThrown=i;if(h)h.call(n.context,t,e,i)};var u=n.xhr=e.ajax(i.extend(a,n));r.trigger("request",r,u,n);return u};var H={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};e.ajax=function(){return e.$.ajax.apply(e.$,arguments)};var $=e.Router=function(t){t||(t={});if(t.routes)this.routes=t.routes;this._bindRoutes();this.initialize.apply(this,arguments)};var A=/\((.*?)\)/g;var C=/(\(\?)?:\w+/g;var R=/\*\w+/g;var j=/[\-{}\[\]+?.,\\\^$|#\s]/g;i.extend($.prototype,l,{initialize:function(){},route:function(t,r,n){if(!i.isRegExp(t))t=this._routeToRegExp(t);if(i.isFunction(r)){n=r;r=""}if(!n)n=this[r];var s=this;e.history.route(t,function(i){var a=s._extractParameters(t,i);if(s.execute(n,a,r)!==false){s.trigger.apply(s,["route:"+r].concat(a));s.trigger("route",r,a);e.history.trigger("route",s,r,a)}});return this},execute:function(t,e,i){if(t)t.apply(this,e)},navigate:function(t,i){e.history.navigate(t,i);return this},_bindRoutes:function(){if(!this.routes)return;this.routes=i.result(this,"routes");var t,e=i.keys(this.routes);while((t=e.pop())!=null){this.route(t,this.routes[t])}},_routeToRegExp:function(t){t=t.replace(j,"\\$&").replace(A,"(?:$1)?").replace(C,function(t,e){return e?t:"([^/?]+)"}).replace(R,"([^?]*?)");return new RegExp("^"+t+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(t,e){var r=t.exec(e).slice(1);return i.map(r,function(t,e){if(e===r.length-1)return t||null;return t?decodeURIComponent(t):null})}});var M=e.History=function(){this.handlers=[];this.checkUrl=i.bind(this.checkUrl,this);if(typeof window!=="undefined"){this.location=window.location;this.history=window.history}};var N=/^[#\/]|\s+$/g;var O=/^\/+|\/+$/g;var U=/#.*$/;M.started=false;i.extend(M.prototype,l,{interval:50,atRoot:function(){var t=this.location.pathname.replace(/[^\/]$/,"$&/");return t===this.root&&!this.getSearch()},matchRoot:function(){var t=this.decodeFragment(this.location.pathname);var e=t.slice(0,this.root.length-1)+"/";return e===this.root},decodeFragment:function(t){return decodeURI(t.replace(/%25/g,"%2525"))},getSearch:function(){var t=this.location.href.replace(/#.*/,"").match(/\?.+/);return t?t[0]:""},getHash:function(t){var e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:""},getPath:function(){var t=this.decodeFragment(this.location.pathname+this.getSearch()).slice(this.root.length-1);return t.charAt(0)==="/"?t.slice(1):t},getFragment:function(t){if(t==null){if(this._usePushState||!this._wantsHashChange){t=this.getPath()}else{t=this.getHash()}}return t.replace(N,"")},start:function(t){if(M.started)throw new Error("Backbone.history has already been started");M.started=true;this.options=i.extend({root:"/"},this.options,t);this.root=this.options.root;this._wantsHashChange=this.options.hashChange!==false;this._hasHashChange="onhashchange"in window&&(document.documentMode===void 0||document.documentMode>7);this._useHashChange=this._wantsHashChange&&this._hasHashChange;this._wantsPushState=!!this.options.pushState;this._hasPushState=!!(this.history&&this.history.pushState);this._usePushState=this._wantsPushState&&this._hasPushState;this.fragment=this.getFragment();this.root=("/"+this.root+"/").replace(O,"/");if(this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){var e=this.root.slice(0,-1)||"/";this.location.replace(e+"#"+this.getPath());return true}else if(this._hasPushState&&this.atRoot()){this.navigate(this.getHash(),{replace:true})}}if(!this._hasHashChange&&this._wantsHashChange&&!this._usePushState){this.iframe=document.createElement("iframe");this.iframe.src="javascript:0";this.iframe.style.display="none";this.iframe.tabIndex=-1;var r=document.body;var n=r.insertBefore(this.iframe,r.firstChild).contentWindow;n.document.open();n.document.close();n.location.hash="#"+this.fragment}var s=window.addEventListener||function(t,e){return attachEvent("on"+t,e)};if(this._usePushState){s("popstate",this.checkUrl,false)}else if(this._useHashChange&&!this.iframe){s("hashchange",this.checkUrl,false)}else if(this._wantsHashChange){this._checkUrlInterval=setInterval(this.checkUrl,this.interval)}if(!this.options.silent)return this.loadUrl()},stop:function(){var t=window.removeEventListener||function(t,e){return detachEvent("on"+t,e)};if(this._usePushState){t("popstate",this.checkUrl,false)}else if(this._useHashChange&&!this.iframe){t("hashchange",this.checkUrl,false)}if(this.iframe){document.body.removeChild(this.iframe);this.iframe=null}if(this._checkUrlInterval)clearInterval(this._checkUrlInterval);M.started=false},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(t){var e=this.getFragment();if(e===this.fragment&&this.iframe){e=this.getHash(this.iframe.contentWindow)}if(e===this.fragment)return false;if(this.iframe)this.navigate(e);this.loadUrl()},loadUrl:function(t){if(!this.matchRoot())return false;t=this.fragment=this.getFragment(t);return i.some(this.handlers,function(e){if(e.route.test(t)){e.callback(t);return true}})},navigate:function(t,e){if(!M.started)return false;if(!e||e===true)e={trigger:!!e};t=this.getFragment(t||"");var i=this.root;if(t===""||t.charAt(0)==="?"){i=i.slice(0,-1)||"/"}var r=i+t;t=this.decodeFragment(t.replace(U,""));if(this.fragment===t)return;this.fragment=t;if(this._usePushState){this.history[e.replace?"replaceState":"pushState"]({},document.title,r)}else if(this._wantsHashChange){this._updateHash(this.location,t,e.replace);if(this.iframe&&t!==this.getHash(this.iframe.contentWindow)){var n=this.iframe.contentWindow;if(!e.replace){n.document.open();n.document.close()}this._updateHash(n.location,t,e.replace)}}else{return this.location.assign(r)}if(e.trigger)return this.loadUrl(t)},_updateHash:function(t,e,i){if(i){var r=t.href.replace(/(javascript:|#).*$/,"");t.replace(r+"#"+e)}else{t.hash="#"+e}}});e.history=new M;var q=function(t,e){var r=this;var n;if(t&&i.has(t,"constructor")){n=t.constructor}else{n=function(){return r.apply(this,arguments)}}i.extend(n,r,e);var s=function(){this.constructor=n};s.prototype=r.prototype;n.prototype=new s;if(t)i.extend(n.prototype,t);n.__super__=r.prototype;return n};y.extend=x.extend=$.extend=I.extend=M.extend=q;var F=function(){throw new Error('A "url" property or function must be specified')};var z=function(t,e){var i=e.error;e.error=function(r){if(i)i.call(e.context,t,r,e);t.trigger("error",t,r,e)}};return e});
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function () {
var settingsElement = document.querySelector('head > script[type="application/json"][data-drupal-selector="drupal-settings-json"], body > script[type="application/json"][data-drupal-selector="drupal-settings-json"]');
window.drupalSettings = {};
if (settingsElement !== null) {
window.drupalSettings = JSON.parse(settingsElement.textContent);
}
})();;
window.drupalTranslations = {"strings":{"":{"Save":"Guardar","An AJAX HTTP error occurred.":"Hubo un error HTTP AJAX.","HTTP Result Code: !status":"C\u00f3digo de Resultado HTTP: !status","An AJAX HTTP request terminated abnormally.":"Una solicitud HTTP de AJAX termin\u00f3 de manera anormal.","Debugging information follows.":"A continuaci\u00f3n se detalla la informaci\u00f3n de depuraci\u00f3n.","Path: !uri":"Ruta: !uri","StatusText: !statusText":"StatusText: !statusText","ResponseText: !responseText":"ResponseText: !responseText","ReadyState: !readyState":"ReadyState: !readyState","CustomMessage: !customMessage":"CustomMessage: !customMessage","Please wait...":"Espere, por favor...","The response failed verification so will not be processed.":"La respuesta de verificaci\u00f3n fall\u00f3, por lo que no se procesar\u00e1.","The callback URL is not local and not trusted: !url":"La URL de llamada no es local y no es confiable: !url","Changed":"Modificado","Home":"Inicio","Next":"Siguiente","closed":"cerrado","Cancel":"Cancelar","Edit":"Editar","Link":"Enlace","Image":"Imagen","Open":"Abierta","Sunday":"Domingo","Monday":"Lunes","Tuesday":"Martes","Wednesday":"Mi\u00e9rcoles","Thursday":"Jueves","Friday":"Viernes","Saturday":"S\u00e1bado","Add":"Agregar","Continue":"Continuar","Done":"Hecho","OK":"OK","Prev":"Previo","Mon":"Lun","Tue":"Mar","Wed":"Mi\u00e9","Thu":"Jue","Fri":"Vie","Sat":"S\u00e1b","Sun":"Dom","May":"Mayo","Close":"Cerrar","Show":"Mostrar","Select all rows in this table":"Seleccionar todas las filas de esta tabla","Deselect all rows in this table":"Quitar la selecci\u00f3n a todas las filas de esta tabla","Today":"Hoy","Jan":"Ene","Feb":"Feb","Mar":"Mar","Apr":"Abr","Jun":"Jun","Jul":"Jul","Aug":"Ago","Sep":"Sep","Oct":"Oct","Nov":"Nov","Dec":"Dic","Extend":"Ampliar","Su":"Do","Mo":"Lu","Tu":"Ma","We":"Mi","Th":"Ju","Fr":"Vi","Sa":"Sa","Not published":"No publicado","Loading...":"Cargando...","Hide":"Ocultar","Unlink":"Desvincular","Not promoted":"No publicado en p\u00e1gina principal","mm\/dd\/yy":"mm\/dd\/yy","Quick edit":"Edici\u00f3n r\u00e1pida","Edit Link":"Editar enlace","Remove group":"Eliminar grupo","By @name on @date":"Por @name en @date","By @name":"Por @name","Not in menu":"No est\u00e1 en un men\u00fa","Alias: @alias":"Alias: @alias","No alias":"Sin alias","@label":"@label","New revision":"Nueva revisi\u00f3n","Drag to re-order":"Arrastre para reordenar","Discard changes":"\u00bfDescartar cambios?","Saving":"Guardando","No revision":"Sin revisi\u00f3n","Requires a title":"Necesita un t\u00edtulo","Not restricted":"Sin restricci\u00f3n","(active tab)":"(solapa activa)","Restricted to certain pages":"Restringido a algunas p\u00e1ginas","The block cannot be placed in this region.":"El bloque no se puede colocar en esta regi\u00f3n.","Hide summary":"Ocultar resumen","Edit summary":"Editar resumen","Don\u0027t display post information":"No mostrar informaci\u00f3n del env\u00edo","Collapse":"Plegar","The selected file %filename cannot be uploaded. Only files with the following extensions are allowed: %extensions.":"El archivo seleccionado %filename no se puede subir al servidor. Solo se permiten archivos con las siguientes extensiones: %extensions.","Re-order rows by numerical weight instead of dragging.":"Reordenar las filas por peso num\u00e9rico en lugar de arrastrar.","Show row weights":"Mostrar pesos de la fila","Hide row weights":"Ocultar pesos de la fila","Apply (all displays)":"Aplicar (todas las presentaciones)","Apply (this display)":"Aplicar (esta presentaci\u00f3n)","Revert to default":"Volver al valor inicial","You have unsaved changes":"Usted tiene cambios no guaradados","Needs to be updated":"Necesita ser actualizado","Does not need to be updated":"No necesita ser actualizado","Show all columns":"Mostrar todas las columnas","Show table cells that were hidden to make the table fit within a small screen.":"Mostrar celdas de tablas que estaban ocultas para que la tabla se ajuste a una pantalla peque\u00f1a.","List additional actions":"Lista adicional de acciones","Flag other translations as outdated":"Marcar las otras traducciones como desfasadas","Do not flag other translations as outdated":"No marcar las otras traducciones como desfasadas","opened":"abierto","Horizontal orientation":"Orientaci\u00f3n horizontal","Vertical orientation":"Orientaci\u00f3n vertical","Tray orientation changed to @orientation.":"La orientaci\u00f3n de la bandeja se ha cambiado a @orientation.","You have unsaved changes.":"Tiene cambios sin guardar.","@action @title configuration options":"@action @title opciones de configuraci\u00f3n","Tabbing is no longer constrained by the Contextual module.":"Tabulando (Tabbing) ya no se ver\u00e1 limitado por el m\u00f3dulo Contextual (Contextual).","Tabbing is constrained to a set of @contextualsCount and the edit mode toggle.":"La tabulaci\u00f3n est\u00e1 restringida a un conjunto de @contextualsCount y al cambio a modo de edici\u00f3n.","Press the esc key to exit.":"Presionar tecla esc para salir.","@count contextual link\u0003@count contextual links":"@count enlace contextual\u0003@count enlaces contextuales","!tour_item of !total":"!tour_item de !total","End tour":"Final del recorrido","Discard changes?":"\u00bfDescartar cambios?","The toolbar cannot be set to a horizontal orientation when it is locked.":"La barra de herramientas no puede ser puesta en orientaci\u00f3n horizontal cuando esta bloqueada.","Could not load the form for \u003Cq\u003E@field-label\u003C\/q\u003E, either due to a website problem or a network connection problem.\u003Cbr\u003EPlease try again.":"No se pudo cargar el formulario para \u003Cq\u003E@field-label\u003C\/q\u003E, ya sea debido a un problema en el sitio, ya por un problema de conexi\u00f3n de red.\u003Cbr\u003EPor favor, int\u00e9ntelo de nuevo.","Your changes to \u003Cq\u003E@entity-title\u003C\/q\u003E could not be saved, either due to a website problem or a network connection problem.\u003Cbr\u003EPlease try again.":"Los cambios en \u003Cq\u003E@entity-title\u003C\/q\u003E no podr\u00e1n salvarse, debido a un problema en el sitio web o un problema de conexi\u00f3n de red.\u003Cbr\u003EPor favor, int\u00e9ntelo de nuevo.","Changing the text format to %text_format will permanently remove content that is not allowed in that text format.\u003Cbr\u003E\u003Cbr\u003ESave your changes before switching the text format to avoid losing data.":"Cambiar el formato de texto a %text_format eliminar\u00e1 permanentemente el contenido que no est\u00e1 permitido en ese formato de texto.\u003Cbr\u003E\u003Cbr\u003EGuarde sus datos antes de cambiar el formato de texto para evitar perder datos.","Change text format?":"\u00bfCambiar el formato de texto?","Rich Text Editor, !label field":"Editor de texto con formato, campo !label","Tray \u0022@tray\u0022 @action.":"Bandeja \u0022@tray\u0022 @action","Tray @action.":"Bandeja @action.","Hide lower priority columns":"Ocultar columnas de menor prioridad","!modules modules are available in the modified list.":"!modules m\u00f3dulos est\u00e1n disponibles en la lista modificada.","Network problem!":"Problema de red!","Authored on @date":"Escrito el @date","1 block is available in the modified list.\u0003@count blocks are available in the modified list.":"1 bloque esta disponible en la lista modificada.\u0003@count bloques est\u00e1n disponibles en la lista modificada.","Insert this token into your form":"Inserte este comod\u00edn en su formulario","First click a text field to insert your tokens into.":"Primero haga clic en un campo de texto en el que quiera insertar sus patrones de reemplazo.","item":"elemento","items":"elementos"},"Long month name":{"January":"Enero","February":"Febrero","March":"Marzo","April":"Abril","May":"Mayo","June":"Junio","July":"Julio","August":"Agosto","September":"Septiembre","October":"Octubre","November":"Noviembre","December":"Diciembre"}},"pluralFormula":{"1":0,"default":1}};;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
window.Drupal = { behaviors: {}, locale: {} };
(function (Drupal, drupalSettings, drupalTranslations) {
Drupal.throwError = function (error) {
setTimeout(function () {
throw error;
}, 0);
};
Drupal.attachBehaviors = function (context, settings) {
context = context || document;
settings = settings || drupalSettings;
var behaviors = Drupal.behaviors;
Object.keys(behaviors || {}).forEach(function (i) {
if (typeof behaviors[i].attach === 'function') {
try {
behaviors[i].attach(context, settings);
} catch (e) {
Drupal.throwError(e);
}
}
});
};
Drupal.detachBehaviors = function (context, settings, trigger) {
context = context || document;
settings = settings || drupalSettings;
trigger = trigger || 'unload';
var behaviors = Drupal.behaviors;
Object.keys(behaviors || {}).forEach(function (i) {
if (typeof behaviors[i].detach === 'function') {
try {
behaviors[i].detach(context, settings, trigger);
} catch (e) {
Drupal.throwError(e);
}
}
});
};
Drupal.checkPlain = function (str) {
str = str.toString().replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, ''');
return str;
};
Drupal.formatString = function (str, args) {
var processedArgs = {};
Object.keys(args || {}).forEach(function (key) {
switch (key.charAt(0)) {
case '@':
processedArgs[key] = Drupal.checkPlain(args[key]);
break;
case '!':
processedArgs[key] = args[key];
break;
default:
processedArgs[key] = Drupal.theme('placeholder', args[key]);
break;
}
});
return Drupal.stringReplace(str, processedArgs, null);
};
Drupal.stringReplace = function (str, args, keys) {
if (str.length === 0) {
return str;
}
if (!Array.isArray(keys)) {
keys = Object.keys(args || {});
keys.sort(function (a, b) {
return a.length - b.length;
});
}
if (keys.length === 0) {
return str;
}
var key = keys.pop();
var fragments = str.split(key);
if (keys.length) {
for (var i = 0; i < fragments.length; i++) {
fragments[i] = Drupal.stringReplace(fragments[i], args, keys.slice(0));
}
}
return fragments.join(args[key]);
};
Drupal.t = function (str, args, options) {
options = options || {};
options.context = options.context || '';
if (typeof drupalTranslations !== 'undefined' && drupalTranslations.strings && drupalTranslations.strings[options.context] && drupalTranslations.strings[options.context][str]) {
str = drupalTranslations.strings[options.context][str];
}
if (args) {
str = Drupal.formatString(str, args);
}
return str;
};
Drupal.url = function (path) {
return drupalSettings.path.baseUrl + drupalSettings.path.pathPrefix + path;
};
Drupal.url.toAbsolute = function (url) {
var urlParsingNode = document.createElement('a');
try {
url = decodeURIComponent(url);
} catch (e) {}
urlParsingNode.setAttribute('href', url);
return urlParsingNode.cloneNode(false).href;
};
Drupal.url.isLocal = function (url) {
var absoluteUrl = Drupal.url.toAbsolute(url);
var protocol = window.location.protocol;
if (protocol === 'http:' && absoluteUrl.indexOf('https:') === 0) {
protocol = 'https:';
}
var baseUrl = protocol + '//' + window.location.host + drupalSettings.path.baseUrl.slice(0, -1);
try {
absoluteUrl = decodeURIComponent(absoluteUrl);
} catch (e) {}
try {
baseUrl = decodeURIComponent(baseUrl);
} catch (e) {}
return absoluteUrl === baseUrl || absoluteUrl.indexOf(baseUrl + '/') === 0;
};
Drupal.formatPlural = function (count, singular, plural, args, options) {
args = args || {};
args['@count'] = count;
var pluralDelimiter = drupalSettings.pluralDelimiter;
var translations = Drupal.t(singular + pluralDelimiter + plural, args, options).split(pluralDelimiter);
var index = 0;
if (typeof drupalTranslations !== 'undefined' && drupalTranslations.pluralFormula) {
index = count in drupalTranslations.pluralFormula ? drupalTranslations.pluralFormula[count] : drupalTranslations.pluralFormula.default;
} else if (args['@count'] !== 1) {
index = 1;
}
return translations[index];
};
Drupal.encodePath = function (item) {
return window.encodeURIComponent(item).replace(/%2F/g, '/');
};
Drupal.theme = function (func) {
if (func in Drupal.theme) {
var _Drupal$theme;
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
return (_Drupal$theme = Drupal.theme)[func].apply(_Drupal$theme, args);
}
};
Drupal.theme.placeholder = function (str) {
return '<em class="placeholder">' + Drupal.checkPlain(str) + '</em>';
};
})(Drupal, window.drupalSettings, window.drupalTranslations);;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
if (window.jQuery) {
jQuery.noConflict();
}
document.documentElement.className += ' js';
(function (domready, Drupal, drupalSettings) {
domready(function () {
Drupal.attachBehaviors(document, drupalSettings);
});
})(domready, Drupal, window.drupalSettings);;
/*! jQuery UI - v1.12.1 - 2017-03-31
* http://jqueryui.com
* Copyright jQuery Foundation and other contributors; Licensed */
!function(a){"function"==typeof define&&define.amd?define(["jquery","./version"],a):a(jQuery)}(function(a){return a.extend(a.expr[":"],{data:a.expr.createPseudo?a.expr.createPseudo(function(b){return function(c){return!!a.data(c,b)}}):function(b,c,d){return!!a.data(b,d[3])}})});;
/*! jQuery UI - v1.12.1 - 2017-03-31
* http://jqueryui.com
* Copyright jQuery Foundation and other contributors; Licensed */
!function(a){"function"==typeof define&&define.amd?define(["jquery","./version"],a):a(jQuery)}(function(a){return a.fn.extend({disableSelection:function(){var a="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.on(a+".ui-disableSelection",function(a){a.preventDefault()})}}(),enableSelection:function(){return this.off(".ui-disableSelection")}})});;
/*! jQuery UI - v1.12.1 - 2017-03-31
* http://jqueryui.com
* Copyright jQuery Foundation and other contributors; Licensed */
!function(a){"function"==typeof define&&define.amd?define(["jquery","./version"],a):a(jQuery)}(function(a){return a.fn.form=function(){return"string"==typeof this[0].form?this.closest("form"):a(this[0].form)}});;
/*! jQuery UI - v1.12.1 - 2017-03-31
* http://jqueryui.com
* Copyright jQuery Foundation and other contributors; Licensed */
!function(a){"function"==typeof define&&define.amd?define(["jquery","./version","./escape-selector"],a):a(jQuery)}(function(a){return a.fn.labels=function(){var b,c,d,e,f;return this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(e=this.eq(0).parents("label"),d=this.attr("id"),d&&(b=this.eq(0).parents().last(),f=b.add(b.length?b.siblings():this.siblings()),c="label[for='"+a.ui.escapeSelector(d)+"']",e=e.add(f.find(c).addBack(c))),this.pushStack(e))}});;
/*! jQuery UI - v1.12.1 - 2017-03-31
* http://jqueryui.com
* Copyright jQuery Foundation and other contributors; Licensed */
!function(a){"function"==typeof define&&define.amd?define(["jquery","./version"],a):a(jQuery)}(function(a){"1.7"===a.fn.jquery.substring(0,3)&&(a.each(["Width","Height"],function(b,c){function d(b,c,d,f){return a.each(e,function(){c-=parseFloat(a.css(b,"padding"+this))||0,d&&(c-=parseFloat(a.css(b,"border"+this+"Width"))||0),f&&(c-=parseFloat(a.css(b,"margin"+this))||0)}),c}var e="Width"===c?["Left","Right"]:["Top","Bottom"],f=c.toLowerCase(),g={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+c]=function(b){return void 0===b?g["inner"+c].call(this):this.each(function(){a(this).css(f,d(this,b)+"px")})},a.fn["outer"+c]=function(b,e){return"number"!=typeof b?g["outer"+c].call(this,b):this.each(function(){a(this).css(f,d(this,b,!0,e)+"px")})}}),a.fn.addBack=function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))})});;
/*! jQuery UI - v1.12.1 - 2017-03-31
* http://jqueryui.com
* Copyright jQuery Foundation and other contributors; Licensed */
!function(a){"function"==typeof define&&define.amd?define(["jquery","./version"],a):a(jQuery)}(function(a){return a.fn.scrollParent=function(b){var c=this.css("position"),d="absolute"===c,e=b?/(auto|scroll|hidden)/:/(auto|scroll)/,f=this.parents().filter(function(){var b=a(this);return(!d||"static"!==b.css("position"))&&e.test(b.css("overflow")+b.css("overflow-y")+b.css("overflow-x"))}).eq(0);return"fixed"!==c&&f.length?f:a(this[0].ownerDocument||document)}});;
/*! jQuery UI - v1.12.1 - 2017-03-31
* http://jqueryui.com
* Copyright jQuery Foundation and other contributors; Licensed */
!function(a){"function"==typeof define&&define.amd?define(["jquery","./version","./focusable"],a):a(jQuery)}(function(a){return a.extend(a.expr[":"],{tabbable:function(b){var c=a.attr(b,"tabindex"),d=null!=c;return(!d||c>=0)&&a.ui.focusable(b,d)}})});;
/*! jQuery UI - v1.12.1 - 2017-03-31
* http://jqueryui.com
* Copyright jQuery Foundation and other contributors; Licensed */
!function(a){"function"==typeof define&&define.amd?define(["jquery","./version"],a):a(jQuery)}(function(a){return a.fn.extend({uniqueId:function(){var a=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++a)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&a(this).removeAttr("id")})}})});;
/*! jQuery UI - v1.12.1 - 2017-03-31
* http://jqueryui.com
* Copyright jQuery Foundation and other contributors; Licensed */
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){return a.ui=a.ui||{},a.ui.version="1.12.1"});;
/*! jQuery UI - v1.12.1 - 2017-03-31
* http://jqueryui.com
* Copyright jQuery Foundation and other contributors; Licensed */
!function(a){"function"==typeof define&&define.amd?define(["jquery","./version"],a):a(jQuery)}(function(a){function b(a){for(var b=a.css("visibility");"inherit"===b;)a=a.parent(),b=a.css("visibility");return"hidden"!==b}return a.ui.focusable=function(c,d){var e,f,g,h,i,j=c.nodeName.toLowerCase();return"area"===j?(e=c.parentNode,f=e.name,!(!c.href||!f||"map"!==e.nodeName.toLowerCase())&&(g=a("img[usemap='#"+f+"']"),g.length>0&&g.is(":visible"))):(/^(input|select|textarea|button|object)$/.test(j)?(h=!c.disabled,h&&(i=a(c).closest("fieldset")[0],i&&(h=!i.disabled))):h="a"===j?c.href||d:d,h&&a(c).is(":visible")&&b(a(c)))},a.extend(a.expr[":"],{focusable:function(b){return a.ui.focusable(b,null!=a.attr(b,"tabindex"))}}),a.ui.focusable});;
/*! jQuery UI - v1.12.1 - 2017-03-31
* http://jqueryui.com
* Copyright jQuery Foundation and other contributors; Licensed */
!function(a){"function"==typeof define&&define.amd?define(["jquery","./version"],a):a(jQuery)}(function(a){return a.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase())});;
/*! jQuery UI - v1.12.1 - 2017-03-31
* http://jqueryui.com
* Copyright jQuery Foundation and other contributors; Licensed */
!function(a){"function"==typeof define&&define.amd?define(["jquery","./version"],a):a(jQuery)}(function(a){return a.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}});;
/*! jQuery UI - v1.12.1 - 2017-03-31
* http://jqueryui.com
* Copyright jQuery Foundation and other contributors; Licensed */
!function(a){"function"==typeof define&&define.amd?define(["jquery","./version"],a):a(jQuery)}(function(a){return a.ui.plugin={add:function(b,c,d){var e,f=a.ui[b].prototype;for(e in d)f.plugins[e]=f.plugins[e]||[],f.plugins[e].push([c,d[e]])},call:function(a,b,c,d){var e,f=a.plugins[b];if(f&&(d||a.element[0].parentNode&&11!==a.element[0].parentNode.nodeType))for(e=0;e<f.length;e++)a.options[f[e][0]]&&f[e][1].apply(a.element,c)}}});;
/*! jQuery UI - v1.12.1 - 2017-03-31
* http://jqueryui.com
* Copyright jQuery Foundation and other contributors; Licensed */
!function(a){"function"==typeof define&&define.amd?define(["jquery","./version"],a):a(jQuery)}(function(a){return a.ui.safeActiveElement=function(a){var b;try{b=a.activeElement}catch(c){b=a.body}return b||(b=a.body),b.nodeName||(b=a.body),b}});;
/*! jQuery UI - v1.12.1 - 2017-03-31
* http://jqueryui.com
* Copyright jQuery Foundation and other contributors; Licensed */
!function(a){"function"==typeof define&&define.amd?define(["jquery","./version"],a):a(jQuery)}(function(a){return a.ui.safeBlur=function(b){b&&"body"!==b.nodeName.toLowerCase()&&a(b).trigger("blur")}});;
/*! jQuery UI - v1.12.1 - 2017-03-31
* http://jqueryui.com
* Copyright jQuery Foundation and other contributors; Licensed */
!function(a){"function"==typeof define&&define.amd?define(["jquery","./version"],a):a(jQuery)}(function(a){var b=0,c=Array.prototype.slice;return a.cleanData=function(b){return function(c){var d,e,f;for(f=0;null!=(e=c[f]);f++)try{d=a._data(e,"events"),d&&d.remove&&a(e).triggerHandler("remove")}catch(g){}b(c)}}(a.cleanData),a.widget=function(b,c,d){var e,f,g,h={},i=b.split(".")[0];b=b.split(".")[1];var j=i+"-"+b;return d||(d=c,c=a.Widget),a.isArray(d)&&(d=a.extend.apply(null,[{}].concat(d))),a.expr[":"][j.toLowerCase()]=function(b){return!!a.data(b,j)},a[i]=a[i]||{},e=a[i][b],f=a[i][b]=function(a,b){return this._createWidget?void(arguments.length&&this._createWidget(a,b)):new f(a,b)},a.extend(f,e,{version:d.version,_proto:a.extend({},d),_childConstructors:[]}),g=new c,g.options=a.widget.extend({},g.options),a.each(d,function(b,d){return a.isFunction(d)?void(h[b]=function(){function a(){return c.prototype[b].apply(this,arguments)}function e(a){return c.prototype[b].apply(this,a)}return function(){var b,c=this._super,f=this._superApply;return this._super=a,this._superApply=e,b=d.apply(this,arguments),this._super=c,this._superApply=f,b}}()):void(h[b]=d)}),f.prototype=a.widget.extend(g,{widgetEventPrefix:e?g.widgetEventPrefix||b:b},h,{constructor:f,namespace:i,widgetName:b,widgetFullName:j}),e?(a.each(e._childConstructors,function(b,c){var d=c.prototype;a.widget(d.namespace+"."+d.widgetName,f,c._proto)}),delete e._childConstructors):c._childConstructors.push(f),a.widget.bridge(b,f),f},a.widget.extend=function(b){for(var d,e,f=c.call(arguments,1),g=0,h=f.length;g<h;g++)for(d in f[g])e=f[g][d],f[g].hasOwnProperty(d)&&void 0!==e&&(a.isPlainObject(e)?b[d]=a.isPlainObject(b[d])?a.widget.extend({},b[d],e):a.widget.extend({},e):b[d]=e);return b},a.widget.bridge=function(b,d){var e=d.prototype.widgetFullName||b;a.fn[b]=function(f){var g="string"==typeof f,h=c.call(arguments,1),i=this;return g?this.length||"instance"!==f?this.each(function(){var c,d=a.data(this,e);return"instance"===f?(i=d,!1):d?a.isFunction(d[f])&&"_"!==f.charAt(0)?(c=d[f].apply(d,h),c!==d&&void 0!==c?(i=c&&c.jquery?i.pushStack(c.get()):c,!1):void 0):a.error("no such method '"+f+"' for "+b+" widget instance"):a.error("cannot call methods on "+b+" prior to initialization; attempted to call method '"+f+"'")}):i=void 0:(h.length&&(f=a.widget.extend.apply(null,[f].concat(h))),this.each(function(){var b=a.data(this,e);b?(b.option(f||{}),b._init&&b._init()):a.data(this,e,new d(f,this))})),i}},a.Widget=function(){},a.Widget._childConstructors=[],a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(c,d){d=a(d||this.defaultElement||this)[0],this.element=a(d),this.uuid=b++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=a(),this.hoverable=a(),this.focusable=a(),this.classesElementLookup={},d!==this&&(a.data(d,this.widgetFullName,this),this._on(!0,this.element,{remove:function(a){a.target===d&&this.destroy()}}),this.document=a(d.style?d.ownerDocument:d.document||d),this.window=a(this.document[0].defaultView||this.document[0].parentWindow)),this.options=a.widget.extend({},this.options,this._getCreateOptions(),c),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:a.noop,_create:a.noop,_init:a.noop,destroy:function(){var b=this;this._destroy(),a.each(this.classesElementLookup,function(a,c){b._removeClass(c,a)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:a.noop,widget:function(){return this.element},option:function(b,c){var d,e,f,g=b;if(0===arguments.length)return a.widget.extend({},this.options);if("string"==typeof b)if(g={},d=b.split("."),b=d.shift(),d.length){for(e=g[b]=a.widget.extend({},this.options[b]),f=0;f<d.length-1;f++)e[d[f]]=e[d[f]]||{},e=e[d[f]];if(b=d.pop(),1===arguments.length)return void 0===e[b]?null:e[b];e[b]=c}else{if(1===arguments.length)return void 0===this.options[b]?null:this.options[b];g[b]=c}return this._setOptions(g),this},_setOptions:function(a){var b;for(b in a)this._setOption(b,a[b]);return this},_setOption:function(a,b){return"classes"===a&&this._setOptionClasses(b),this.options[a]=b,"disabled"===a&&this._setOptionDisabled(b),this},_setOptionClasses:function(b){var c,d,e;for(c in b)e=this.classesElementLookup[c],b[c]!==this.options.classes[c]&&e&&e.length&&(d=a(e.get()),this._removeClass(e,c),d.addClass(this._classes({element:d,keys:c,classes:b,add:!0})))},_setOptionDisabled:function(a){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!a),a&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(b){function c(c,f){var g,h;for(h=0;h<c.length;h++)g=e.classesElementLookup[c[h]]||a(),g=a(b.add?a.unique(g.get().concat(b.element.get())):g.not(b.element).get()),e.classesElementLookup[c[h]]=g,d.push(c[h]),f&&b.classes[c[h]]&&d.push(b.classes[c[h]])}var d=[],e=this;return b=a.extend({element:this.element,classes:this.options.classes||{}},b),this._on(b.element,{remove:"_untrackClassesElement"}),b.keys&&c(b.keys.match(/\S+/g)||[],!0),b.extra&&c(b.extra.match(/\S+/g)||[]),d.join(" ")},_untrackClassesElement:function(b){var c=this;a.each(c.classesElementLookup,function(d,e){a.inArray(b.target,e)!==-1&&(c.classesElementLookup[d]=a(e.not(b.target).get()))})},_removeClass:function(a,b,c){return this._toggleClass(a,b,c,!1)},_addClass:function(a,b,c){return this._toggleClass(a,b,c,!0)},_toggleClass:function(a,b,c,d){d="boolean"==typeof d?d:c;var e="string"==typeof a||null===a,f={extra:e?b:c,keys:e?a:b,element:e?this.element:a,add:d};return f.element.toggleClass(this._classes(f),d),this},_on:function(b,c,d){var e,f=this;"boolean"!=typeof b&&(d=c,c=b,b=!1),d?(c=e=a(c),this.bindings=this.bindings.add(c)):(d=c,c=this.element,e=this.widget()),a.each(d,function(d,g){function h(){if(b||f.options.disabled!==!0&&!a(this).hasClass("ui-state-disabled"))return("string"==typeof g?f[g]:g).apply(f,arguments)}"string"!=typeof g&&(h.guid=g.guid=g.guid||h.guid||a.guid++);var i=d.match(/^([\w:-]*)\s*(.*)$/),j=i[1]+f.eventNamespace,k=i[2];k?e.on(j,k,h):c.on(j,h)})},_off:function(b,c){c=(c||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,b.off(c).off(c),this.bindings=a(this.bindings.not(b).get()),this.focusable=a(this.focusable.not(b).get()),this.hoverable=a(this.hoverable.not(b).get())},_delay:function(a,b){function c(){return("string"==typeof a?d[a]:a).apply(d,arguments)}var d=this;return setTimeout(c,b||0)},_hoverable:function(b){this.hoverable=this.hoverable.add(b),this._on(b,{mouseenter:function(b){this._addClass(a(b.currentTarget),null,"ui-state-hover")},mouseleave:function(b){this._removeClass(a(b.currentTarget),null,"ui-state-hover")}})},_focusable:function(b){this.focusable=this.focusable.add(b),this._on(b,{focusin:function(b){this._addClass(a(b.currentTarget),null,"ui-state-focus")},focusout:function(b){this._removeClass(a(b.currentTarget),null,"ui-state-focus")}})},_trigger:function(b,c,d){var e,f,g=this.options[b];if(d=d||{},c=a.Event(c),c.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase(),c.target=this.element[0],f=c.originalEvent)for(e in f)e in c||(c[e]=f[e]);return this.element.trigger(c,d),!(a.isFunction(g)&&g.apply(this.element[0],[c].concat(d))===!1||c.isDefaultPrevented())}},a.each({show:"fadeIn",hide:"fadeOut"},function(b,c){a.Widget.prototype["_"+b]=function(d,e,f){"string"==typeof e&&(e={effect:e});var g,h=e?e===!0||"number"==typeof e?c:e.effect||c:b;e=e||{},"number"==typeof e&&(e={duration:e}),g=!a.isEmptyObject(e),e.complete=f,e.delay&&d.delay(e.delay),g&&a.effects&&a.effects.effect[h]?d[b](e):h!==b&&d[h]?d[h](e.duration,e.easing,f):d.queue(function(c){a(this)[b](),f&&f.call(d[0]),c()})}}),a.widget});;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function ($, Drupal, drupalSettings, _, Backbone, JSON, storage) {
var options = $.extend(drupalSettings.contextual, {
strings: {
open: Drupal.t('Open'),
close: Drupal.t('Close')
}
});
var cachedPermissionsHash = storage.getItem('Drupal.contextual.permissionsHash');
var permissionsHash = drupalSettings.user.permissionsHash;
if (cachedPermissionsHash !== permissionsHash) {
if (typeof permissionsHash === 'string') {
_.chain(storage).keys().each(function (key) {
if (key.substring(0, 18) === 'Drupal.contextual.') {
storage.removeItem(key);
}
});
}
storage.setItem('Drupal.contextual.permissionsHash', permissionsHash);
}
function adjustIfNestedAndOverlapping($contextual) {
var $contextuals = $contextual.parents('.contextual-region').eq(-1).find('.contextual');
if ($contextuals.length <= 1) {
return;
}
var firstTop = $contextuals.eq(0).offset().top;
var secondTop = $contextuals.eq(1).offset().top;
if (firstTop === secondTop) {
var $nestedContextual = $contextuals.eq(1);
var height = 0;
var $trigger = $nestedContextual.find('.trigger');
$trigger.removeClass('visually-hidden');
height = $nestedContextual.height();
$trigger.addClass('visually-hidden');
$nestedContextual.css({ top: $nestedContextual.position().top + height });
}
}
function initContextual($contextual, html) {
var $region = $contextual.closest('.contextual-region');
var contextual = Drupal.contextual;
$contextual.html(html).addClass('contextual').prepend(Drupal.theme('contextualTrigger'));
var destination = 'destination=' + Drupal.encodePath(Drupal.url(drupalSettings.path.currentPath));
$contextual.find('.contextual-links a').each(function () {
var url = this.getAttribute('href');
var glue = url.indexOf('?') === -1 ? '?' : '&';
this.setAttribute('href', url + glue + destination);
});
var model = new contextual.StateModel({
title: $region.find('h2').eq(0).text().trim()
});
var viewOptions = $.extend({ el: $contextual, model: model }, options);
contextual.views.push({
visual: new contextual.VisualView(viewOptions),
aural: new contextual.AuralView(viewOptions),
keyboard: new contextual.KeyboardView(viewOptions)
});
contextual.regionViews.push(new contextual.RegionView($.extend({ el: $region, model: model }, options)));
contextual.collection.add(model);
$(document).trigger('drupalContextualLinkAdded', {
$el: $contextual,
$region: $region,
model: model
});
adjustIfNestedAndOverlapping($contextual);
}
Drupal.behaviors.contextual = {
attach: function attach(context) {
var $context = $(context);
var $placeholders = $context.find('[data-contextual-id]').once('contextual-render');
if ($placeholders.length === 0) {
return;
}
var ids = [];
$placeholders.each(function () {
ids.push({
id: $(this).attr('data-contextual-id'),
token: $(this).attr('data-contextual-token')
});
});
var uncachedIDs = [];
var uncachedTokens = [];
ids.forEach(function (contextualID) {
var html = storage.getItem('Drupal.contextual.' + contextualID.id);
if (html && html.length) {
window.setTimeout(function () {
initContextual($context.find('[data-contextual-id="' + contextualID.id + '"]'), html);
});
return;
}
uncachedIDs.push(contextualID.id);
uncachedTokens.push(contextualID.token);
});
if (uncachedIDs.length > 0) {
$.ajax({
url: Drupal.url('contextual/render'),
type: 'POST',
data: { 'ids[]': uncachedIDs, 'tokens[]': uncachedTokens },
dataType: 'json',
success: function success(results) {
_.each(results, function (html, contextualID) {
storage.setItem('Drupal.contextual.' + contextualID, html);
if (html.length > 0) {
$placeholders = $context.find('[data-contextual-id="' + contextualID + '"]');
for (var i = 0; i < $placeholders.length; i++) {
initContextual($placeholders.eq(i), html);
}
}
});
}
});
}
}
};
Drupal.contextual = {
views: [],
regionViews: []
};
Drupal.contextual.collection = new Backbone.Collection([], {
model: Drupal.contextual.StateModel
});
Drupal.theme.contextualTrigger = function () {
return '<button class="trigger visually-hidden focusable" type="button"></button>';
};
$(document).on('drupalContextualLinkAdded', function (event, data) {
Drupal.ajax.bindAjaxLinks(data.$el[0]);
});
})(jQuery, Drupal, drupalSettings, _, Backbone, window.JSON, window.sessionStorage);;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function (Drupal, Backbone) {
Drupal.contextual.StateModel = Backbone.Model.extend({
defaults: {
title: '',
regionIsHovered: false,
hasFocus: false,
isOpen: false,
isLocked: false
},
toggleOpen: function toggleOpen() {
var newIsOpen = !this.get('isOpen');
this.set('isOpen', newIsOpen);
if (newIsOpen) {
this.focus();
}
return this;
},
close: function close() {
this.set('isOpen', false);
return this;
},
focus: function focus() {
this.set('hasFocus', true);
var cid = this.cid;
this.collection.each(function (model) {
if (model.cid !== cid) {
model.close().blur();
}
});
return this;
},
blur: function blur() {
if (!this.get('isOpen')) {
this.set('hasFocus', false);
}
return this;
}
});
})(Drupal, Backbone);;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function (Drupal, Backbone) {
Drupal.contextual.AuralView = Backbone.View.extend({
initialize: function initialize(options) {
this.options = options;
this.listenTo(this.model, 'change', this.render);
this.$el.attr('role', 'form');
this.render();
},
render: function render() {
var isOpen = this.model.get('isOpen');
this.$el.find('.contextual-links').prop('hidden', !isOpen);
this.$el.find('.trigger').text(Drupal.t('@action @title configuration options', {
'@action': !isOpen ? this.options.strings.open : this.options.strings.close,
'@title': this.model.get('title')
})).attr('aria-pressed', isOpen);
}
});
})(Drupal, Backbone);;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function (Drupal, Backbone) {
Drupal.contextual.KeyboardView = Backbone.View.extend({
events: {
'focus .trigger': 'focus',
'focus .contextual-links a': 'focus',
'blur .trigger': function blurTrigger() {
this.model.blur();
},
'blur .contextual-links a': function blurContextualLinksA() {
var that = this;
this.timer = window.setTimeout(function () {
that.model.close().blur();
}, 150);
}
},
initialize: function initialize() {
this.timer = NaN;
},
focus: function focus() {
window.clearTimeout(this.timer);
this.model.focus();
}
});
})(Drupal, Backbone);;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function (Drupal, Backbone, Modernizr) {
Drupal.contextual.RegionView = Backbone.View.extend({
events: function events() {
var mapping = {
mouseenter: function mouseenter() {
this.model.set('regionIsHovered', true);
},
mouseleave: function mouseleave() {
this.model.close().blur().set('regionIsHovered', false);
}
};
if (Modernizr.touchevents) {
mapping = {};
}
return mapping;
},
initialize: function initialize() {
this.listenTo(this.model, 'change:hasFocus', this.render);
},
render: function render() {
this.$el.toggleClass('focus', this.model.get('hasFocus'));
return this;
}
});
})(Drupal, Backbone, Modernizr);;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function (Drupal, Backbone, Modernizr) {
Drupal.contextual.VisualView = Backbone.View.extend({
events: function events() {
var touchEndToClick = function touchEndToClick(event) {
event.preventDefault();
event.target.click();
};
var mapping = {
'click .trigger': function clickTrigger() {
this.model.toggleOpen();
},
'touchend .trigger': touchEndToClick,
'click .contextual-links a': function clickContextualLinksA() {
this.model.close().blur();
},
'touchend .contextual-links a': touchEndToClick
};
if (!Modernizr.touchevents) {
mapping.mouseenter = function () {
this.model.focus();
};
}
return mapping;
},
initialize: function initialize() {
this.listenTo(this.model, 'change', this.render);
},
render: function render() {
var isOpen = this.model.get('isOpen');
var isVisible = this.model.get('isLocked') || this.model.get('regionIsHovered') || isOpen;
this.$el.toggleClass('open', isOpen).find('.trigger').toggleClass('visually-hidden', !isVisible);
if ('isOpen' in this.model.changed) {
this.$el.closest('.contextual-region').find('.contextual .trigger:not(:first)').toggle(!isOpen);
}
return this;
}
});
})(Drupal, Backbone, Modernizr);;
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.AOS=t():e.AOS=t()}(this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var i=n[o]={exports:{},id:o,loaded:!1};return e[o].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="dist/",t(0)}([function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},r=n(1),a=(o(r),n(6)),u=o(a),c=n(7),s=o(c),f=n(8),d=o(f),l=n(9),p=o(l),m=n(10),b=o(m),v=n(11),y=o(v),g=n(14),h=o(g),w=[],k=!1,x={offset:120,delay:0,easing:"ease",duration:400,disable:!1,once:!1,startEvent:"DOMContentLoaded",throttleDelay:99,debounceDelay:50,disableMutationObserver:!1},j=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e&&(k=!0),k)return w=(0,y.default)(w,x),(0,b.default)(w,x.once),w},O=function(){w=(0,h.default)(),j()},M=function(){w.forEach(function(e,t){e.node.removeAttribute("data-aos"),e.node.removeAttribute("data-aos-easing"),e.node.removeAttribute("data-aos-duration"),e.node.removeAttribute("data-aos-delay")})},S=function(e){return e===!0||"mobile"===e&&p.default.mobile()||"phone"===e&&p.default.phone()||"tablet"===e&&p.default.tablet()||"function"==typeof e&&e()===!0},_=function(e){x=i(x,e),w=(0,h.default)();var t=document.all&&!window.atob;return S(x.disable)||t?M():(x.disableMutationObserver||d.default.isSupported()||(console.info('\n aos: MutationObserver is not supported on this browser,\n code mutations observing has been disabled.\n You may have to call "refreshHard()" by yourself.\n '),x.disableMutationObserver=!0),document.querySelector("body").setAttribute("data-aos-easing",x.easing),document.querySelector("body").setAttribute("data-aos-duration",x.duration),document.querySelector("body").setAttribute("data-aos-delay",x.delay),"DOMContentLoaded"===x.startEvent&&["complete","interactive"].indexOf(document.readyState)>-1?j(!0):"load"===x.startEvent?window.addEventListener(x.startEvent,function(){j(!0)}):document.addEventListener(x.startEvent,function(){j(!0)}),window.addEventListener("resize",(0,s.default)(j,x.debounceDelay,!0)),window.addEventListener("orientationchange",(0,s.default)(j,x.debounceDelay,!0)),window.addEventListener("scroll",(0,u.default)(function(){(0,b.default)(w,x.once)},x.throttleDelay)),x.disableMutationObserver||d.default.ready("[data-aos]",O),w)};e.exports={init:_,refresh:j,refreshHard:O}},function(e,t){},,,,,function(e,t){(function(t){"use strict";function n(e,t,n){function o(t){var n=b,o=v;return b=v=void 0,k=t,g=e.apply(o,n)}function r(e){return k=e,h=setTimeout(f,t),M?o(e):g}function a(e){var n=e-w,o=e-k,i=t-n;return S?j(i,y-o):i}function c(e){var n=e-w,o=e-k;return void 0===w||n>=t||n<0||S&&o>=y}function f(){var e=O();return c(e)?d(e):void(h=setTimeout(f,a(e)))}function d(e){return h=void 0,_&&b?o(e):(b=v=void 0,g)}function l(){void 0!==h&&clearTimeout(h),k=0,b=w=v=h=void 0}function p(){return void 0===h?g:d(O())}function m(){var e=O(),n=c(e);if(b=arguments,v=this,w=e,n){if(void 0===h)return r(w);if(S)return h=setTimeout(f,t),o(w)}return void 0===h&&(h=setTimeout(f,t)),g}var b,v,y,g,h,w,k=0,M=!1,S=!1,_=!0;if("function"!=typeof e)throw new TypeError(s);return t=u(t)||0,i(n)&&(M=!!n.leading,S="maxWait"in n,y=S?x(u(n.maxWait)||0,t):y,_="trailing"in n?!!n.trailing:_),m.cancel=l,m.flush=p,m}function o(e,t,o){var r=!0,a=!0;if("function"!=typeof e)throw new TypeError(s);return i(o)&&(r="leading"in o?!!o.leading:r,a="trailing"in o?!!o.trailing:a),n(e,t,{leading:r,maxWait:t,trailing:a})}function i(e){var t="undefined"==typeof e?"undefined":c(e);return!!e&&("object"==t||"function"==t)}function r(e){return!!e&&"object"==("undefined"==typeof e?"undefined":c(e))}function a(e){return"symbol"==("undefined"==typeof e?"undefined":c(e))||r(e)&&k.call(e)==d}function u(e){if("number"==typeof e)return e;if(a(e))return f;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(l,"");var n=m.test(e);return n||b.test(e)?v(e.slice(2),n?2:8):p.test(e)?f:+e}var c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s="Expected a function",f=NaN,d="[object Symbol]",l=/^\s+|\s+$/g,p=/^[-+]0x[0-9a-f]+$/i,m=/^0b[01]+$/i,b=/^0o[0-7]+$/i,v=parseInt,y="object"==("undefined"==typeof t?"undefined":c(t))&&t&&t.Object===Object&&t,g="object"==("undefined"==typeof self?"undefined":c(self))&&self&&self.Object===Object&&self,h=y||g||Function("return this")(),w=Object.prototype,k=w.toString,x=Math.max,j=Math.min,O=function(){return h.Date.now()};e.exports=o}).call(t,function(){return this}())},function(e,t){(function(t){"use strict";function n(e,t,n){function i(t){var n=b,o=v;return b=v=void 0,O=t,g=e.apply(o,n)}function r(e){return O=e,h=setTimeout(f,t),M?i(e):g}function u(e){var n=e-w,o=e-O,i=t-n;return S?x(i,y-o):i}function s(e){var n=e-w,o=e-O;return void 0===w||n>=t||n<0||S&&o>=y}function f(){var e=j();return s(e)?d(e):void(h=setTimeout(f,u(e)))}function d(e){return h=void 0,_&&b?i(e):(b=v=void 0,g)}function l(){void 0!==h&&clearTimeout(h),O=0,b=w=v=h=void 0}function p(){return void 0===h?g:d(j())}function m(){var e=j(),n=s(e);if(b=arguments,v=this,w=e,n){if(void 0===h)return r(w);if(S)return h=setTimeout(f,t),i(w)}return void 0===h&&(h=setTimeout(f,t)),g}var b,v,y,g,h,w,O=0,M=!1,S=!1,_=!0;if("function"!=typeof e)throw new TypeError(c);return t=a(t)||0,o(n)&&(M=!!n.leading,S="maxWait"in n,y=S?k(a(n.maxWait)||0,t):y,_="trailing"in n?!!n.trailing:_),m.cancel=l,m.flush=p,m}function o(e){var t="undefined"==typeof e?"undefined":u(e);return!!e&&("object"==t||"function"==t)}function i(e){return!!e&&"object"==("undefined"==typeof e?"undefined":u(e))}function r(e){return"symbol"==("undefined"==typeof e?"undefined":u(e))||i(e)&&w.call(e)==f}function a(e){if("number"==typeof e)return e;if(r(e))return s;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(d,"");var n=p.test(e);return n||m.test(e)?b(e.slice(2),n?2:8):l.test(e)?s:+e}var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c="Expected a function",s=NaN,f="[object Symbol]",d=/^\s+|\s+$/g,l=/^[-+]0x[0-9a-f]+$/i,p=/^0b[01]+$/i,m=/^0o[0-7]+$/i,b=parseInt,v="object"==("undefined"==typeof t?"undefined":u(t))&&t&&t.Object===Object&&t,y="object"==("undefined"==typeof self?"undefined":u(self))&&self&&self.Object===Object&&self,g=v||y||Function("return this")(),h=Object.prototype,w=h.toString,k=Math.max,x=Math.min,j=function(){return g.Date.now()};e.exports=n}).call(t,function(){return this}())},function(e,t){"use strict";function n(e){var t=void 0,o=void 0,i=void 0;for(t=0;t<e.length;t+=1){if(o=e[t],o.dataset&&o.dataset.aos)return!0;if(i=o.children&&n(o.children))return!0}return!1}function o(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function i(){return!!o()}function r(e,t){var n=window.document,i=o(),r=new i(a);u=t,r.observe(n.documentElement,{childList:!0,subtree:!0,removedNodes:!0})}function a(e){e&&e.forEach(function(e){var t=Array.prototype.slice.call(e.addedNodes),o=Array.prototype.slice.call(e.removedNodes),i=t.concat(o);if(n(i))return u()})}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){};t.default={isSupported:i,ready:r}},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(){return navigator.userAgent||navigator.vendor||window.opera||""}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i,a=/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i,u=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i,c=/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i,s=function(){function e(){n(this,e)}return i(e,[{key:"phone",value:function(){var e=o();return!(!r.test(e)&&!a.test(e.substr(0,4)))}},{key:"mobile",value:function(){var e=o();return!(!u.test(e)&&!c.test(e.substr(0,4)))}},{key:"tablet",value:function(){return this.mobile()&&!this.phone()}}]),e}();t.default=new s},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t,n){var o=e.node.getAttribute("data-aos-once");t>e.position?e.node.classList.add("aos-animate"):"undefined"!=typeof o&&("false"===o||!n&&"true"!==o)&&e.node.classList.remove("aos-animate")},o=function(e,t){var o=window.pageYOffset,i=window.innerHeight;e.forEach(function(e,r){n(e,i+o,t)})};t.default=o},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(12),r=o(i),a=function(e,t){return e.forEach(function(e,n){e.node.classList.add("aos-init"),e.position=(0,r.default)(e.node,t.offset)}),e};t.default=a},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(13),r=o(i),a=function(e,t){var n=0,o=0,i=window.innerHeight,a={offset:e.getAttribute("data-aos-offset"),anchor:e.getAttribute("data-aos-anchor"),anchorPlacement:e.getAttribute("data-aos-anchor-placement")};switch(a.offset&&!isNaN(a.offset)&&(o=parseInt(a.offset)),a.anchor&&document.querySelectorAll(a.anchor)&&(e=document.querySelectorAll(a.anchor)[0]),n=(0,r.default)(e).top,a.anchorPlacement){case"top-bottom":break;case"center-bottom":n+=e.offsetHeight/2;break;case"bottom-bottom":n+=e.offsetHeight;break;case"top-center":n+=i/2;break;case"bottom-center":n+=i/2+e.offsetHeight;break;case"center-center":n+=i/2+e.offsetHeight/2;break;case"top-top":n+=i;break;case"bottom-top":n+=e.offsetHeight+i;break;case"center-top":n+=e.offsetHeight/2+i}return a.anchorPlacement||a.offset||isNaN(t)||(o=t),n+o};t.default=a},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){for(var t=0,n=0;e&&!isNaN(e.offsetLeft)&&!isNaN(e.offsetTop);)t+=e.offsetLeft-("BODY"!=e.tagName?e.scrollLeft:0),n+=e.offsetTop-("BODY"!=e.tagName?e.scrollTop:0),e=e.offsetParent;return{top:n,left:t}};t.default=n},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){return e=e||document.querySelectorAll("[data-aos]"),Array.prototype.map.call(e,function(e){return{node:e}})};t.default=n}])});;
/**
* @file
* JavaScript file for the AOS module.
*/
(function ($, Drupal, drupalSettings) {
Drupal.behaviors.aos = {
attach: function attach(context, settings) {
AOS.init();
}
};
})(jQuery, Drupal, drupalSettings);
;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function ($, Drupal) {
Drupal.theme.progressBar = function (id) {
return '<div id="' + id + '" class="progress" aria-live="polite">' + '<div class="progress__label"> </div>' + '<div class="progress__track"><div class="progress__bar"></div></div>' + '<div class="progress__percentage"></div>' + '<div class="progress__description"> </div>' + '</div>';
};
Drupal.ProgressBar = function (id, updateCallback, method, errorCallback) {
this.id = id;
this.method = method || 'GET';
this.updateCallback = updateCallback;
this.errorCallback = errorCallback;
this.element = $(Drupal.theme('progressBar', id));
};
$.extend(Drupal.ProgressBar.prototype, {
setProgress: function setProgress(percentage, message, label) {
if (percentage >= 0 && percentage <= 100) {
$(this.element).find('div.progress__bar').css('width', percentage + '%');
$(this.element).find('div.progress__percentage').html(percentage + '%');
}
$('div.progress__description', this.element).html(message);
$('div.progress__label', this.element).html(label);
if (this.updateCallback) {
this.updateCallback(percentage, message, this);
}
},
startMonitoring: function startMonitoring(uri, delay) {
this.delay = delay;
this.uri = uri;
this.sendPing();
},
stopMonitoring: function stopMonitoring() {
clearTimeout(this.timer);
this.uri = null;
},
sendPing: function sendPing() {
if (this.timer) {
clearTimeout(this.timer);
}
if (this.uri) {
var pb = this;
var uri = this.uri;
if (uri.indexOf('?') === -1) {
uri += '?';
} else {
uri += '&';
}
uri += '_format=json';
$.ajax({
type: this.method,
url: uri,
data: '',
dataType: 'json',
success: function success(progress) {
if (progress.status === 0) {
pb.displayError(progress.data);
return;
}
pb.setProgress(progress.percentage, progress.message, progress.label);
pb.timer = setTimeout(function () {
pb.sendPing();
}, pb.delay);
},
error: function error(xmlhttp) {
var e = new Drupal.AjaxError(xmlhttp, pb.uri);
pb.displayError('<pre>' + e.message + '</pre>');
}
});
}
},
displayError: function displayError(string) {
var error = $('<div class="messages messages--error"></div>').html(string);
$(this.element).before(error).hide();
if (this.errorCallback) {
this.errorCallback(this);
}
}
});
})(jQuery, Drupal);;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
(function ($, window, Drupal, drupalSettings) {
Drupal.behaviors.AJAX = {
attach: function attach(context, settings) {
function loadAjaxBehavior(base) {
var elementSettings = settings.ajax[base];
if (typeof elementSettings.selector === 'undefined') {
elementSettings.selector = '#' + base;
}
$(elementSettings.selector).once('drupal-ajax').each(function () {
elementSettings.element = this;
elementSettings.base = base;
Drupal.ajax(elementSettings);
});
}
Object.keys(settings.ajax || {}).forEach(function (base) {
return loadAjaxBehavior(base);
});
Drupal.ajax.bindAjaxLinks(document.body);
$('.use-ajax-submit').once('ajax').each(function () {
var elementSettings = {};
elementSettings.url = $(this.form).attr('action');
elementSettings.setClick = true;
elementSettings.event = 'click';
elementSettings.progress = { type: 'throbber' };
elementSettings.base = $(this).attr('id');
elementSettings.element = this;
Drupal.ajax(elementSettings);
});
},
detach: function detach(context, settings, trigger) {
if (trigger === 'unload') {
Drupal.ajax.expired().forEach(function (instance) {
Drupal.ajax.instances[instance.instanceIndex] = null;
});
}
}
};
Drupal.AjaxError = function (xmlhttp, uri, customMessage) {
var statusCode = void 0;
var statusText = void 0;
var responseText = void 0;
if (xmlhttp.status) {
statusCode = '\n' + Drupal.t('An AJAX HTTP error occurred.') + '\n' + Drupal.t('HTTP Result Code: !status', { '!status': xmlhttp.status });
} else {
statusCode = '\n' + Drupal.t('An AJAX HTTP request terminated abnormally.');
}
statusCode += '\n' + Drupal.t('Debugging information follows.');
var pathText = '\n' + Drupal.t('Path: !uri', { '!uri': uri });
statusText = '';
try {
statusText = '\n' + Drupal.t('StatusText: !statusText', {
'!statusText': $.trim(xmlhttp.statusText)
});
} catch (e) {}
responseText = '';
try {
responseText = '\n' + Drupal.t('ResponseText: !responseText', {
'!responseText': $.trim(xmlhttp.responseText)
});
} catch (e) {}
responseText = responseText.replace(/<("[^"]*"|'[^']*'|[^'">])*>/gi, '');
responseText = responseText.replace(/[\n]+\s+/g, '\n');
var readyStateText = xmlhttp.status === 0 ? '\n' + Drupal.t('ReadyState: !readyState', {
'!readyState': xmlhttp.readyState
}) : '';
customMessage = customMessage ? '\n' + Drupal.t('CustomMessage: !customMessage', {
'!customMessage': customMessage
}) : '';
this.message = statusCode + pathText + statusText + customMessage + responseText + readyStateText;
this.name = 'AjaxError';
};
Drupal.AjaxError.prototype = new Error();
Drupal.AjaxError.prototype.constructor = Drupal.AjaxError;
Drupal.ajax = function (settings) {
if (arguments.length !== 1) {
throw new Error('Drupal.ajax() function must be called with one configuration object only');
}
var base = settings.base || false;
var element = settings.element || false;
delete settings.base;
delete settings.element;
if (!settings.progress && !element) {
settings.progress = false;
}
var ajax = new Drupal.Ajax(base, element, settings);
ajax.instanceIndex = Drupal.ajax.instances.length;
Drupal.ajax.instances.push(ajax);
return ajax;
};
Drupal.ajax.instances = [];
Drupal.ajax.expired = function () {
return Drupal.ajax.instances.filter(function (instance) {
return instance && instance.element !== false && !document.body.contains(instance.element);
});
};
Drupal.ajax.bindAjaxLinks = function (element) {
$(element).find('.use-ajax').once('ajax').each(function (i, ajaxLink) {
var $linkElement = $(ajaxLink);
var elementSettings = {
progress: { type: 'throbber' },
dialogType: $linkElement.data('dialog-type'),
dialog: $linkElement.data('dialog-options'),
dialogRenderer: $linkElement.data('dialog-renderer'),
base: $linkElement.attr('id'),
element: ajaxLink
};
var href = $linkElement.attr('href');
if (href) {
elementSettings.url = href;
elementSettings.event = 'click';
}
Drupal.ajax(elementSettings);
});
};
Drupal.Ajax = function (base, element, elementSettings) {
var defaults = {
event: element ? 'mousedown' : null,
keypress: true,
selector: base ? '#' + base : null,
effect: 'none',
speed: 'none',
method: 'replaceWith',
progress: {
type: 'throbber',
message: Drupal.t('Please wait...')
},
submit: {
js: true
}
};
$.extend(this, defaults, elementSettings);
this.commands = new Drupal.AjaxCommands();
this.instanceIndex = false;
if (this.wrapper) {
this.wrapper = '#' + this.wrapper;
}
this.element = element;
this.element_settings = elementSettings;
this.elementSettings = elementSettings;
if (this.element && this.element.form) {
this.$form = $(this.element.form);
}
if (!this.url) {
var $element = $(this.element);
if ($element.is('a')) {
this.url = $element.attr('href');
} else if (this.element && element.form) {
this.url = this.$form.attr('action');
}
}
var originalUrl = this.url;
this.url = this.url.replace(/\/nojs(\/|$|\?|#)/, '/ajax$1');
if (drupalSettings.ajaxTrustedUrl[originalUrl]) {
drupalSettings.ajaxTrustedUrl[this.url] = true;
}
var ajax = this;
ajax.options = {
url: ajax.url,
data: ajax.submit,
beforeSerialize: function beforeSerialize(elementSettings, options) {
return ajax.beforeSerialize(elementSettings, options);
},
beforeSubmit: function beforeSubmit(formValues, elementSettings, options) {
ajax.ajaxing = true;
return ajax.beforeSubmit(formValues, elementSettings, options);
},
beforeSend: function beforeSend(xmlhttprequest, options) {
ajax.ajaxing = true;
return ajax.beforeSend(xmlhttprequest, options);
},
success: function success(response, status, xmlhttprequest) {
if (typeof response === 'string') {
response = $.parseJSON(response);
}
if (response !== null && !drupalSettings.ajaxTrustedUrl[ajax.url]) {
if (xmlhttprequest.getResponseHeader('X-Drupal-Ajax-Token') !== '1') {
var customMessage = Drupal.t('The response failed verification so will not be processed.');
return ajax.error(xmlhttprequest, ajax.url, customMessage);
}
}
return ajax.success(response, status);
},
complete: function complete(xmlhttprequest, status) {
ajax.ajaxing = false;
if (status === 'error' || status === 'parsererror') {
return ajax.error(xmlhttprequest, ajax.url);
}
},
dataType: 'json',
type: 'POST'
};
if (elementSettings.dialog) {
ajax.options.data.dialogOptions = elementSettings.dialog;
}
if (ajax.options.url.indexOf('?') === -1) {
ajax.options.url += '?';
} else {
ajax.options.url += '&';
}
var wrapper = 'drupal_' + (elementSettings.dialogType || 'ajax');
if (elementSettings.dialogRenderer) {
wrapper += '.' + elementSettings.dialogRenderer;
}
ajax.options.url += Drupal.ajax.WRAPPER_FORMAT + '=' + wrapper;
$(ajax.element).on(elementSettings.event, function (event) {
if (!drupalSettings.ajaxTrustedUrl[ajax.url] && !Drupal.url.isLocal(ajax.url)) {
throw new Error(Drupal.t('The callback URL is not local and not trusted: !url', {
'!url': ajax.url
}));
}
return ajax.eventResponse(this, event);
});
if (elementSettings.keypress) {
$(ajax.element).on('keypress', function (event) {
return ajax.keypressResponse(this, event);
});
}
if (elementSettings.prevent) {
$(ajax.element).on(elementSettings.prevent, false);
}
};
Drupal.ajax.WRAPPER_FORMAT = '_wrapper_format';
Drupal.Ajax.AJAX_REQUEST_PARAMETER = '_drupal_ajax';
Drupal.Ajax.prototype.execute = function () {
if (this.ajaxing) {
return;
}
try {
this.beforeSerialize(this.element, this.options);
return $.ajax(this.options);
} catch (e) {
this.ajaxing = false;
window.alert('An error occurred while attempting to process ' + this.options.url + ': ' + e.message);
return $.Deferred().reject();
}
};
Drupal.Ajax.prototype.keypressResponse = function (element, event) {
var ajax = this;
if (event.which === 13 || event.which === 32 && element.type !== 'text' && element.type !== 'textarea' && element.type !== 'tel' && element.type !== 'number') {
event.preventDefault();
event.stopPropagation();
$(element).trigger(ajax.elementSettings.event);
}
};
Drupal.Ajax.prototype.eventResponse = function (element, event) {
event.preventDefault();
event.stopPropagation();
var ajax = this;
if (ajax.ajaxing) {
return;
}
try {
if (ajax.$form) {
if (ajax.setClick) {
element.form.clk = element;
}
ajax.$form.ajaxSubmit(ajax.options);
} else {
ajax.beforeSerialize(ajax.element, ajax.options);
$.ajax(ajax.options);
}
} catch (e) {
ajax.ajaxing = false;
window.alert('An error occurred while attempting to process ' + ajax.options.url + ': ' + e.message);
}
};
Drupal.Ajax.prototype.beforeSerialize = function (element, options) {
if (this.$form) {
var settings = this.settings || drupalSettings;
Drupal.detachBehaviors(this.$form.get(0), settings, 'serialize');
}
options.data[Drupal.Ajax.AJAX_REQUEST_PARAMETER] = 1;
var pageState = drupalSettings.ajaxPageState;
options.data['ajax_page_state[theme]'] = pageState.theme;
options.data['ajax_page_state[theme_token]'] = pageState.theme_token;
options.data['ajax_page_state[libraries]'] = pageState.libraries;
};
Drupal.Ajax.prototype.beforeSubmit = function (formValues, element, options) {};
Drupal.Ajax.prototype.beforeSend = function (xmlhttprequest, options) {
if (this.$form) {
options.extraData = options.extraData || {};
options.extraData.ajax_iframe_upload = '1';
var v = $.fieldValue(this.element);
if (v !== null) {
options.extraData[this.element.name] = v;
}
}
$(this.element).prop('disabled', true);
if (!this.progress || !this.progress.type) {
return;
}
var progressIndicatorMethod = 'setProgressIndicator' + this.progress.type.slice(0, 1).toUpperCase() + this.progress.type.slice(1).toLowerCase();
if (progressIndicatorMethod in this && typeof this[progressIndicatorMethod] === 'function') {
this[progressIndicatorMethod].call(this);
}
};
Drupal.theme.ajaxProgressThrobber = function (message) {
var messageMarkup = typeof message === 'string' ? Drupal.theme('ajaxProgressMessage', message) : '';
var throbber = '<div class="throbber"> </div>';
return '<div class="ajax-progress ajax-progress-throbber">' + throbber + messageMarkup + '</div>';
};
Drupal.theme.ajaxProgressIndicatorFullscreen = function () {
return '<div class="ajax-progress ajax-progress-fullscreen"> </div>';
};
Drupal.theme.ajaxProgressMessage = function (message) {
return '<div class="message">' + message + '</div>';
};
Drupal.Ajax.prototype.setProgressIndicatorBar = function () {
var progressBar = new Drupal.ProgressBar('ajax-progress-' + this.element.id, $.noop, this.progress.method, $.noop);
if (this.progress.message) {
progressBar.setProgress(-1, this.progress.message);
}
if (this.progress.url) {
progressBar.startMonitoring(this.progress.url, this.progress.interval || 1500);
}
this.progress.element = $(progressBar.element).addClass('ajax-progress ajax-progress-bar');
this.progress.object = progressBar;
$(this.element).after(this.progress.element);
};
Drupal.Ajax.prototype.setProgressIndicatorThrobber = function () {
this.progress.element = $(Drupal.theme('ajaxProgressThrobber', this.progress.message));
$(this.element).after(this.progress.element);
};
Drupal.Ajax.prototype.setProgressIndicatorFullscreen = function () {
this.progress.element = $(Drupal.theme('ajaxProgressIndicatorFullscreen'));
$('body').after(this.progress.element);
};
Drupal.Ajax.prototype.success = function (response, status) {
var _this = this;
if (this.progress.element) {
$(this.progress.element).remove();
}
if (this.progress.object) {
this.progress.object.stopMonitoring();
}
$(this.element).prop('disabled', false);
var elementParents = $(this.element).parents('[data-drupal-selector]').addBack().toArray();
var focusChanged = false;
Object.keys(response || {}).forEach(function (i) {
if (response[i].command && _this.commands[response[i].command]) {
_this.commands[response[i].command](_this, response[i], status);
if (response[i].command === 'invoke' && response[i].method === 'focus') {
focusChanged = true;
}
}
});
if (!focusChanged && this.element && !$(this.element).data('disable-refocus')) {
var target = false;
for (var n = elementParents.length - 1; !target && n >= 0; n--) {
target = document.querySelector('[data-drupal-selector="' + elementParents[n].getAttribute('data-drupal-selector') + '"]');
}
if (target) {
$(target).trigger('focus');
}
}
if (this.$form) {
var settings = this.settings || drupalSettings;
Drupal.attachBehaviors(this.$form.get(0), settings);
}
this.settings = null;
};
Drupal.Ajax.prototype.getEffect = function (response) {
var type = response.effect || this.effect;
var speed = response.speed || this.speed;
var effect = {};
if (type === 'none') {
effect.showEffect = 'show';
effect.hideEffect = 'hide';
effect.showSpeed = '';
} else if (type === 'fade') {
effect.showEffect = 'fadeIn';
effect.hideEffect = 'fadeOut';
effect.showSpeed = speed;
} else {
effect.showEffect = type + 'Toggle';
effect.hideEffect = type + 'Toggle';
effect.showSpeed = speed;
}
return effect;
};
Drupal.Ajax.prototype.error = function (xmlhttprequest, uri, customMessage) {
if (this.progress.element) {
$(this.progress.element).remove();
}
if (this.progress.object) {
this.progress.object.stopMonitoring();
}
$(this.wrapper).show();
$(this.element).prop('disabled', false);
if (this.$form) {
var settings = this.settings || drupalSettings;
Drupal.attachBehaviors(this.$form.get(0), settings);
}
throw new Drupal.AjaxError(xmlhttprequest, uri, customMessage);
};
Drupal.theme.ajaxWrapperNewContent = function ($newContent, ajax, response) {
return (response.effect || ajax.effect) !== 'none' && $newContent.filter(function (i) {
return !($newContent[i].nodeName === '#comment' || $newContent[i].nodeName === '#text' && /^(\s|\n|\r)*$/.test($newContent[i].textContent));
}).length > 1 ? Drupal.theme('ajaxWrapperMultipleRootElements', $newContent) : $newContent;
};
Drupal.theme.ajaxWrapperMultipleRootElements = function ($elements) {
return $('<div></div>').append($elements);
};
Drupal.AjaxCommands = function () {};
Drupal.AjaxCommands.prototype = {
insert: function insert(ajax, response) {
var $wrapper = response.selector ? $(response.selector) : $(ajax.wrapper);
var method = response.method || ajax.method;
var effect = ajax.getEffect(response);
var settings = response.settings || ajax.settings || drupalSettings;
var $newContent = $($.parseHTML(response.data, document, true));
$newContent = Drupal.theme('ajaxWrapperNewContent', $newContent, ajax, response);
switch (method) {
case 'html':
case 'replaceWith':
case 'replaceAll':
case 'empty':
case 'remove':
Drupal.detachBehaviors($wrapper.get(0), settings);
break;
default:
break;
}
$wrapper[method]($newContent);
if (effect.showEffect !== 'show') {
$newContent.hide();
}
var $ajaxNewContent = $newContent.find('.ajax-new-content');
if ($ajaxNewContent.length) {
$ajaxNewContent.hide();
$newContent.show();
$ajaxNewContent[effect.showEffect](effect.showSpeed);
} else if (effect.showEffect !== 'show') {
$newContent[effect.showEffect](effect.showSpeed);
}
if ($newContent.parents('html').length) {
$newContent.each(function (index, element) {
if (element.nodeType === Node.ELEMENT_NODE) {
Drupal.attachBehaviors(element, settings);
}
});
}
},
remove: function remove(ajax, response, status) {
var settings = response.settings || ajax.settings || drupalSettings;
$(response.selector).each(function () {
Drupal.detachBehaviors(this, settings);
}).remove();
},
changed: function changed(ajax, response, status) {
var $element = $(response.selector);
if (!$element.hasClass('ajax-changed')) {
$element.addClass('ajax-changed');
if (response.asterisk) {
$element.find(response.asterisk).append(' <abbr class="ajax-changed" title="' + Drupal.t('Changed') + '">*</abbr> ');
}
}
},
alert: function alert(ajax, response, status) {
window.alert(response.text, response.title);
},
redirect: function redirect(ajax, response, status) {
window.location = response.url;
},
css: function css(ajax, response, status) {
$(response.selector).css(response.argument);
},
settings: function settings(ajax, response, status) {
var ajaxSettings = drupalSettings.ajax;
if (ajaxSettings) {
Drupal.ajax.expired().forEach(function (instance) {
if (instance.selector) {
var selector = instance.selector.replace('#', '');
if (selector in ajaxSettings) {
delete ajaxSettings[selector];
}
}
});
}
if (response.merge) {
$.extend(true, drupalSettings, response.settings);
} else {
ajax.settings = response.settings;
}
},
data: function data(ajax, response, status) {
$(response.selector).data(response.name, response.value);
},
invoke: function invoke(ajax, response, status) {
var $element = $(response.selector);
$element[response.method].apply($element, _toConsumableArray(response.args));
},
restripe: function restripe(ajax, response, status) {
$(response.selector).find('> tbody > tr:visible, > tr:visible').removeClass('odd even').filter(':even').addClass('odd').end().filter(':odd').addClass('even');
},
update_build_id: function update_build_id(ajax, response, status) {
$('input[name="form_build_id"][value="' + response.old + '"]').val(response.new);
},
add_css: function add_css(ajax, response, status) {
$('head').prepend(response.data);
var match = void 0;
var importMatch = /^@import url\("(.*)"\);$/gim;
if (document.styleSheets[0].addImport && importMatch.test(response.data)) {
importMatch.lastIndex = 0;
do {
match = importMatch.exec(response.data);
document.styleSheets[0].addImport(match[1]);
} while (match);
}
}
};
})(jQuery, window, Drupal, drupalSettings);;
/*!
* jQuery Form Plugin
* version: 4.2.2
* Requires jQuery v1.7.2 or later
* Project repository: https://github.com/jquery-form/form
* Copyright 2017 Kevin Morris
* Copyright 2006 M. Alsup
* Dual licensed under the LGPL-2.1+ or MIT licenses
* https://github.com/jquery-form/form#license
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/
!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&module.exports?module.exports=function(t,r){return void 0===r&&(r="undefined"!=typeof window?require("jquery"):require("jquery")(t)),e(r),r}:e(jQuery)}(function(e){"use strict";function t(t){var r=t.data;t.isDefaultPrevented()||(t.preventDefault(),e(t.target).closest("form").ajaxSubmit(r))}function r(t){var r=t.target,a=e(r);if(!a.is("[type=submit],[type=image]")){var n=a.closest("[type=submit]");if(0===n.length)return;r=n[0]}var i=r.form;if(i.clk=r,"image"===r.type)if(void 0!==t.offsetX)i.clk_x=t.offsetX,i.clk_y=t.offsetY;else if("function"==typeof e.fn.offset){var o=a.offset();i.clk_x=t.pageX-o.left,i.clk_y=t.pageY-o.top}else i.clk_x=t.pageX-r.offsetLeft,i.clk_y=t.pageY-r.offsetTop;setTimeout(function(){i.clk=i.clk_x=i.clk_y=null},100)}function a(){if(e.fn.ajaxSubmit.debug){var t="[jquery.form] "+Array.prototype.join.call(arguments,"");window.console&&window.console.log?window.console.log(t):window.opera&&window.opera.postError&&window.opera.postError(t)}}var n=/\r?\n/g,i={};i.fileapi=void 0!==e('<input type="file">').get(0).files,i.formdata=void 0!==window.FormData;var o=!!e.fn.prop;e.fn.attr2=function(){if(!o)return this.attr.apply(this,arguments);var e=this.prop.apply(this,arguments);return e&&e.jquery||"string"==typeof e?e:this.attr.apply(this,arguments)},e.fn.ajaxSubmit=function(t,r,n,s){function u(r){var a,n,i=e.param(r,t.traditional).split("&"),o=i.length,s=[];for(a=0;a<o;a++)i[a]=i[a].replace(/\+/g," "),n=i[a].split("="),s.push([decodeURIComponent(n[0]),decodeURIComponent(n[1])]);return s}function c(r){function n(e){var t=null;try{e.contentWindow&&(t=e.contentWindow.document)}catch(e){a("cannot get iframe.contentWindow document: "+e)}if(t)return t;try{t=e.contentDocument?e.contentDocument:e.document}catch(r){a("cannot get iframe.contentDocument: "+r),t=e.document}return t}function i(){function t(){try{var e=n(v).readyState;a("state = "+e),e&&"uninitialized"===e.toLowerCase()&&setTimeout(t,50)}catch(e){a("Server abort: ",e," (",e.name,")"),s(L),j&&clearTimeout(j),j=void 0}}var r=p.attr2("target"),i=p.attr2("action"),o=p.attr("enctype")||p.attr("encoding")||"multipart/form-data";w.setAttribute("target",m),l&&!/post/i.test(l)||w.setAttribute("method","POST"),i!==f.url&&w.setAttribute("action",f.url),f.skipEncodingOverride||l&&!/post/i.test(l)||p.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"}),f.timeout&&(j=setTimeout(function(){T=!0,s(A)},f.timeout));var u=[];try{if(f.extraData)for(var c in f.extraData)f.extraData.hasOwnProperty(c)&&(e.isPlainObject(f.extraData[c])&&f.extraData[c].hasOwnProperty("name")&&f.extraData[c].hasOwnProperty("value")?u.push(e('<input type="hidden" name="'+f.extraData[c].name+'">',k).val(f.extraData[c].value).appendTo(w)[0]):u.push(e('<input type="hidden" name="'+c+'">',k).val(f.extraData[c]).appendTo(w)[0]));f.iframeTarget||h.appendTo(D),v.attachEvent?v.attachEvent("onload",s):v.addEventListener("load",s,!1),setTimeout(t,15);try{w.submit()}catch(e){document.createElement("form").submit.apply(w)}}finally{w.setAttribute("action",i),w.setAttribute("enctype",o),r?w.setAttribute("target",r):p.removeAttr("target"),e(u).remove()}}function s(t){if(!x.aborted&&!X){if((O=n(v))||(a("cannot access response document"),t=L),t===A&&x)return x.abort("timeout"),void S.reject(x,"timeout");if(t===L&&x)return x.abort("server abort"),void S.reject(x,"error","server abort");if(O&&O.location.href!==f.iframeSrc||T){v.detachEvent?v.detachEvent("onload",s):v.removeEventListener("load",s,!1);var r,i="success";try{if(T)throw"timeout";var o="xml"===f.dataType||O.XMLDocument||e.isXMLDoc(O);if(a("isXml="+o),!o&&window.opera&&(null===O.body||!O.body.innerHTML)&&--C)return a("requeing onLoad callback, DOM not available"),void setTimeout(s,250);var u=O.body?O.body:O.documentElement;x.responseText=u?u.innerHTML:null,x.responseXML=O.XMLDocument?O.XMLDocument:O,o&&(f.dataType="xml"),x.getResponseHeader=function(e){return{"content-type":f.dataType}[e.toLowerCase()]},u&&(x.status=Number(u.getAttribute("status"))||x.status,x.statusText=u.getAttribute("statusText")||x.statusText);var c=(f.dataType||"").toLowerCase(),l=/(json|script|text)/.test(c);if(l||f.textarea){var p=O.getElementsByTagName("textarea")[0];if(p)x.responseText=p.value,x.status=Number(p.getAttribute("status"))||x.status,x.statusText=p.getAttribute("statusText")||x.statusText;else if(l){var m=O.getElementsByTagName("pre")[0],g=O.getElementsByTagName("body")[0];m?x.responseText=m.textContent?m.textContent:m.innerText:g&&(x.responseText=g.textContent?g.textContent:g.innerText)}}else"xml"===c&&!x.responseXML&&x.responseText&&(x.responseXML=q(x.responseText));try{M=N(x,c,f)}catch(e){i="parsererror",x.error=r=e||i}}catch(e){a("error caught: ",e),i="error",x.error=r=e||i}x.aborted&&(a("upload aborted"),i=null),x.status&&(i=x.status>=200&&x.status<300||304===x.status?"success":"error"),"success"===i?(f.success&&f.success.call(f.context,M,"success",x),S.resolve(x.responseText,"success",x),d&&e.event.trigger("ajaxSuccess",[x,f])):i&&(void 0===r&&(r=x.statusText),f.error&&f.error.call(f.context,x,i,r),S.reject(x,"error",r),d&&e.event.trigger("ajaxError",[x,f,r])),d&&e.event.trigger("ajaxComplete",[x,f]),d&&!--e.active&&e.event.trigger("ajaxStop"),f.complete&&f.complete.call(f.context,x,i),X=!0,f.timeout&&clearTimeout(j),setTimeout(function(){f.iframeTarget?h.attr("src",f.iframeSrc):h.remove(),x.responseXML=null},100)}}}var u,c,f,d,m,h,v,x,y,b,T,j,w=p[0],S=e.Deferred();if(S.abort=function(e){x.abort(e)},r)for(c=0;c<g.length;c++)u=e(g[c]),o?u.prop("disabled",!1):u.removeAttr("disabled");(f=e.extend(!0,{},e.ajaxSettings,t)).context=f.context||f,m="jqFormIO"+(new Date).getTime();var k=w.ownerDocument,D=p.closest("body");if(f.iframeTarget?(b=(h=e(f.iframeTarget,k)).attr2("name"))?m=b:h.attr2("name",m):(h=e('<iframe name="'+m+'" src="'+f.iframeSrc+'" />',k)).css({position:"absolute",top:"-1000px",left:"-1000px"}),v=h[0],x={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(t){var r="timeout"===t?"timeout":"aborted";a("aborting upload... "+r),this.aborted=1;try{v.contentWindow.document.execCommand&&v.contentWindow.document.execCommand("Stop")}catch(e){}h.attr("src",f.iframeSrc),x.error=r,f.error&&f.error.call(f.context,x,r,t),d&&e.event.trigger("ajaxError",[x,f,r]),f.complete&&f.complete.call(f.context,x,r)}},(d=f.global)&&0==e.active++&&e.event.trigger("ajaxStart"),d&&e.event.trigger("ajaxSend",[x,f]),f.beforeSend&&!1===f.beforeSend.call(f.context,x,f))return f.global&&e.active--,S.reject(),S;if(x.aborted)return S.reject(),S;(y=w.clk)&&(b=y.name)&&!y.disabled&&(f.extraData=f.extraData||{},f.extraData[b]=y.value,"image"===y.type&&(f.extraData[b+".x"]=w.clk_x,f.extraData[b+".y"]=w.clk_y));var A=1,L=2,F=e("meta[name=csrf-token]").attr("content"),E=e("meta[name=csrf-param]").attr("content");E&&F&&(f.extraData=f.extraData||{},f.extraData[E]=F),f.forceSync?i():setTimeout(i,10);var M,O,X,C=50,q=e.parseXML||function(e,t){return window.ActiveXObject?((t=new ActiveXObject("Microsoft.XMLDOM")).async="false",t.loadXML(e)):t=(new DOMParser).parseFromString(e,"text/xml"),t&&t.documentElement&&"parsererror"!==t.documentElement.nodeName?t:null},_=e.parseJSON||function(e){return window.eval("("+e+")")},N=function(t,r,a){var n=t.getResponseHeader("content-type")||"",i=("xml"===r||!r)&&n.indexOf("xml")>=0,o=i?t.responseXML:t.responseText;return i&&"parsererror"===o.documentElement.nodeName&&e.error&&e.error("parsererror"),a&&a.dataFilter&&(o=a.dataFilter(o,r)),"string"==typeof o&&(("json"===r||!r)&&n.indexOf("json")>=0?o=_(o):("script"===r||!r)&&n.indexOf("javascript")>=0&&e.globalEval(o)),o};return S}if(!this.length)return a("ajaxSubmit: skipping submit process - no element selected"),this;var l,f,d,p=this;"function"==typeof t?t={success:t}:"string"==typeof t||!1===t&&arguments.length>0?(t={url:t,data:r,dataType:n},"function"==typeof s&&(t.success=s)):void 0===t&&(t={}),l=t.method||t.type||this.attr2("method"),(d=(d="string"==typeof(f=t.url||this.attr2("action"))?e.trim(f):"")||window.location.href||"")&&(d=(d.match(/^([^#]+)/)||[])[1]),t=e.extend(!0,{url:d,success:e.ajaxSettings.success,type:l||e.ajaxSettings.type,iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},t);var m={};if(this.trigger("form-pre-serialize",[this,t,m]),m.veto)return a("ajaxSubmit: submit vetoed via form-pre-serialize trigger"),this;if(t.beforeSerialize&&!1===t.beforeSerialize(this,t))return a("ajaxSubmit: submit aborted via beforeSerialize callback"),this;var h=t.traditional;void 0===h&&(h=e.ajaxSettings.traditional);var v,g=[],x=this.formToArray(t.semantic,g,t.filtering);if(t.data){var y=e.isFunction(t.data)?t.data(x):t.data;t.extraData=y,v=e.param(y,h)}if(t.beforeSubmit&&!1===t.beforeSubmit(x,this,t))return a("ajaxSubmit: submit aborted via beforeSubmit callback"),this;if(this.trigger("form-submit-validate",[x,this,t,m]),m.veto)return a("ajaxSubmit: submit vetoed via form-submit-validate trigger"),this;var b=e.param(x,h);v&&(b=b?b+"&"+v:v),"GET"===t.type.toUpperCase()?(t.url+=(t.url.indexOf("?")>=0?"&":"?")+b,t.data=null):t.data=b;var T=[];if(t.resetForm&&T.push(function(){p.resetForm()}),t.clearForm&&T.push(function(){p.clearForm(t.includeHidden)}),!t.dataType&&t.target){var j=t.success||function(){};T.push(function(r,a,n){var i=arguments,o=t.replaceTarget?"replaceWith":"html";e(t.target)[o](r).each(function(){j.apply(this,i)})})}else t.success&&(e.isArray(t.success)?e.merge(T,t.success):T.push(t.success));if(t.success=function(e,r,a){for(var n=t.context||this,i=0,o=T.length;i<o;i++)T[i].apply(n,[e,r,a||p,p])},t.error){var w=t.error;t.error=function(e,r,a){var n=t.context||this;w.apply(n,[e,r,a,p])}}if(t.complete){var S=t.complete;t.complete=function(e,r){var a=t.context||this;S.apply(a,[e,r,p])}}var k=e("input[type=file]:enabled",this).filter(function(){return""!==e(this).val()}).length>0,D="multipart/form-data",A=p.attr("enctype")===D||p.attr("encoding")===D,L=i.fileapi&&i.formdata;a("fileAPI :"+L);var F,E=(k||A)&&!L;!1!==t.iframe&&(t.iframe||E)?t.closeKeepAlive?e.get(t.closeKeepAlive,function(){F=c(x)}):F=c(x):F=(k||A)&&L?function(r){for(var a=new FormData,n=0;n<r.length;n++)a.append(r[n].name,r[n].value);if(t.extraData){var i=u(t.extraData);for(n=0;n<i.length;n++)i[n]&&a.append(i[n][0],i[n][1])}t.data=null;var o=e.extend(!0,{},e.ajaxSettings,t,{contentType:!1,processData:!1,cache:!1,type:l||"POST"});t.uploadProgress&&(o.xhr=function(){var r=e.ajaxSettings.xhr();return r.upload&&r.upload.addEventListener("progress",function(e){var r=0,a=e.loaded||e.position,n=e.total;e.lengthComputable&&(r=Math.ceil(a/n*100)),t.uploadProgress(e,a,n,r)},!1),r}),o.data=null;var s=o.beforeSend;return o.beforeSend=function(e,r){t.formData?r.data=t.formData:r.data=a,s&&s.call(this,e,r)},e.ajax(o)}(x):e.ajax(t),p.removeData("jqxhr").data("jqxhr",F);for(var M=0;M<g.length;M++)g[M]=null;return this.trigger("form-submit-notify",[this,t]),this},e.fn.ajaxForm=function(n,i,o,s){if(("string"==typeof n||!1===n&&arguments.length>0)&&(n={url:n,data:i,dataType:o},"function"==typeof s&&(n.success=s)),n=n||{},n.delegation=n.delegation&&e.isFunction(e.fn.on),!n.delegation&&0===this.length){var u={s:this.selector,c:this.context};return!e.isReady&&u.s?(a("DOM not ready, queuing ajaxForm"),e(function(){e(u.s,u.c).ajaxForm(n)}),this):(a("terminating; zero elements found by selector"+(e.isReady?"":" (DOM not ready)")),this)}return n.delegation?(e(document).off("submit.form-plugin",this.selector,t).off("click.form-plugin",this.selector,r).on("submit.form-plugin",this.selector,n,t).on("click.form-plugin",this.selector,n,r),this):this.ajaxFormUnbind().on("submit.form-plugin",n,t).on("click.form-plugin",n,r)},e.fn.ajaxFormUnbind=function(){return this.off("submit.form-plugin click.form-plugin")},e.fn.formToArray=function(t,r,a){var n=[];if(0===this.length)return n;var o,s=this[0],u=this.attr("id"),c=t||void 0===s.elements?s.getElementsByTagName("*"):s.elements;if(c&&(c=e.makeArray(c)),u&&(t||/(Edge|Trident)\//.test(navigator.userAgent))&&(o=e(':input[form="'+u+'"]').get()).length&&(c=(c||[]).concat(o)),!c||!c.length)return n;e.isFunction(a)&&(c=e.map(c,a));var l,f,d,p,m,h,v;for(l=0,h=c.length;l<h;l++)if(m=c[l],(d=m.name)&&!m.disabled)if(t&&s.clk&&"image"===m.type)s.clk===m&&(n.push({name:d,value:e(m).val(),type:m.type}),n.push({name:d+".x",value:s.clk_x},{name:d+".y",value:s.clk_y}));else if((p=e.fieldValue(m,!0))&&p.constructor===Array)for(r&&r.push(m),f=0,v=p.length;f<v;f++)n.push({name:d,value:p[f]});else if(i.fileapi&&"file"===m.type){r&&r.push(m);var g=m.files;if(g.length)for(f=0;f<g.length;f++)n.push({name:d,value:g[f],type:m.type});else n.push({name:d,value:"",type:m.type})}else null!==p&&void 0!==p&&(r&&r.push(m),n.push({name:d,value:p,type:m.type,required:m.required}));if(!t&&s.clk){var x=e(s.clk),y=x[0];(d=y.name)&&!y.disabled&&"image"===y.type&&(n.push({name:d,value:x.val()}),n.push({name:d+".x",value:s.clk_x},{name:d+".y",value:s.clk_y}))}return n},e.fn.formSerialize=function(t){return e.param(this.formToArray(t))},e.fn.fieldSerialize=function(t){var r=[];return this.each(function(){var a=this.name;if(a){var n=e.fieldValue(this,t);if(n&&n.constructor===Array)for(var i=0,o=n.length;i<o;i++)r.push({name:a,value:n[i]});else null!==n&&void 0!==n&&r.push({name:this.name,value:n})}}),e.param(r)},e.fn.fieldValue=function(t){for(var r=[],a=0,n=this.length;a<n;a++){var i=this[a],o=e.fieldValue(i,t);null===o||void 0===o||o.constructor===Array&&!o.length||(o.constructor===Array?e.merge(r,o):r.push(o))}return r},e.fieldValue=function(t,r){var a=t.name,i=t.type,o=t.tagName.toLowerCase();if(void 0===r&&(r=!0),r&&(!a||t.disabled||"reset"===i||"button"===i||("checkbox"===i||"radio"===i)&&!t.checked||("submit"===i||"image"===i)&&t.form&&t.form.clk!==t||"select"===o&&-1===t.selectedIndex))return null;if("select"===o){var s=t.selectedIndex;if(s<0)return null;for(var u=[],c=t.options,l="select-one"===i,f=l?s+1:c.length,d=l?s:0;d<f;d++){var p=c[d];if(p.selected&&!p.disabled){var m=p.value;if(m||(m=p.attributes&&p.attributes.value&&!p.attributes.value.specified?p.text:p.value),l)return m;u.push(m)}}return u}return e(t).val().replace(n,"\r\n")},e.fn.clearForm=function(t){return this.each(function(){e("input,select,textarea",this).clearFields(t)})},e.fn.clearFields=e.fn.clearInputs=function(t){var r=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var a=this.type,n=this.tagName.toLowerCase();r.test(a)||"textarea"===n?this.value="":"checkbox"===a||"radio"===a?this.checked=!1:"select"===n?this.selectedIndex=-1:"file"===a?/MSIE/.test(navigator.userAgent)?e(this).replaceWith(e(this).clone(!0)):e(this).val(""):t&&(!0===t&&/hidden/.test(a)||"string"==typeof t&&e(this).is(t))&&(this.value="")})},e.fn.resetForm=function(){return this.each(function(){var t=e(this),r=this.tagName.toLowerCase();switch(r){case"input":this.checked=this.defaultChecked;case"textarea":return this.value=this.defaultValue,!0;case"option":case"optgroup":var a=t.parents("select");return a.length&&a[0].multiple?"option"===r?this.selected=this.defaultSelected:t.find("option").resetForm():a.resetForm(),!0;case"select":return t.find("option").each(function(e){if(this.selected=this.defaultSelected,this.defaultSelected&&!t[0].multiple)return t[0].selectedIndex=e,!1}),!0;case"label":var n=e(t.attr("for")),i=t.find("input,select,textarea");return n[0]&&i.unshift(n[0]),i.resetForm(),!0;case"form":return("function"==typeof this.reset||"object"==typeof this.reset&&!this.reset.nodeType)&&this.reset(),!0;default:return t.find("form,input,label,select,textarea").resetForm(),!0}})},e.fn.enable=function(e){return void 0===e&&(e=!0),this.each(function(){this.disabled=!e})},e.fn.selected=function(t){return void 0===t&&(t=!0),this.each(function(){var r=this.type;if("checkbox"===r||"radio"===r)this.checked=t;else if("option"===this.tagName.toLowerCase()){var a=e(this).parent("select");t&&a[0]&&"select-one"===a[0].type&&a.find("option").selected(!1),this.selected=t}})},e.fn.ajaxSubmit.debug=!1});
;
/*! jQuery UI - v1.12.1 - 2017-03-31
* http://jqueryui.com
* Copyright jQuery Foundation and other contributors; Licensed */
!function(a){"function"==typeof define&&define.amd?define(["jquery","./version"],a):a(jQuery)}(function(a){return function(){function b(a,b,c){return[parseFloat(a[0])*(l.test(a[0])?b/100:1),parseFloat(a[1])*(l.test(a[1])?c/100:1)]}function c(b,c){return parseInt(a.css(b,c),10)||0}function d(b){var c=b[0];return 9===c.nodeType?{width:b.width(),height:b.height(),offset:{top:0,left:0}}:a.isWindow(c)?{width:b.width(),height:b.height(),offset:{top:b.scrollTop(),left:b.scrollLeft()}}:c.preventDefault?{width:0,height:0,offset:{top:c.pageY,left:c.pageX}}:{width:b.outerWidth(),height:b.outerHeight(),offset:b.offset()}}var e,f=Math.max,g=Math.abs,h=/left|center|right/,i=/top|center|bottom/,j=/[\+\-]\d+(\.[\d]+)?%?/,k=/^\w+/,l=/%$/,m=a.fn.position;a.position={scrollbarWidth:function(){if(void 0!==e)return e;var b,c,d=a("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),f=d.children()[0];return a("body").append(d),b=f.offsetWidth,d.css("overflow","scroll"),c=f.offsetWidth,b===c&&(c=d[0].clientWidth),d.remove(),e=b-c},getScrollInfo:function(b){var c=b.isWindow||b.isDocument?"":b.element.css("overflow-x"),d=b.isWindow||b.isDocument?"":b.element.css("overflow-y"),e="scroll"===c||"auto"===c&&b.width<b.element[0].scrollWidth,f="scroll"===d||"auto"===d&&b.height<b.element[0].scrollHeight;return{width:f?a.position.scrollbarWidth():0,height:e?a.position.scrollbarWidth():0}},getWithinInfo:function(b){var c=a(b||window),d=a.isWindow(c[0]),e=!!c[0]&&9===c[0].nodeType,f=!d&&!e;return{element:c,isWindow:d,isDocument:e,offset:f?a(b).offset():{left:0,top:0},scrollLeft:c.scrollLeft(),scrollTop:c.scrollTop(),width:c.outerWidth(),height:c.outerHeight()}}},a.fn.position=function(e){if(!e||!e.of)return m.apply(this,arguments);e=a.extend({},e);var l,n,o,p,q,r,s=a(e.of),t=a.position.getWithinInfo(e.within),u=a.position.getScrollInfo(t),v=(e.collision||"flip").split(" "),w={};return r=d(s),s[0].preventDefault&&(e.at="left top"),n=r.width,o=r.height,p=r.offset,q=a.extend({},p),a.each(["my","at"],function(){var a,b,c=(e[this]||"").split(" ");1===c.length&&(c=h.test(c[0])?c.concat(["center"]):i.test(c[0])?["center"].concat(c):["center","center"]),c[0]=h.test(c[0])?c[0]:"center",c[1]=i.test(c[1])?c[1]:"center",a=j.exec(c[0]),b=j.exec(c[1]),w[this]=[a?a[0]:0,b?b[0]:0],e[this]=[k.exec(c[0])[0],k.exec(c[1])[0]]}),1===v.length&&(v[1]=v[0]),"right"===e.at[0]?q.left+=n:"center"===e.at[0]&&(q.left+=n/2),"bottom"===e.at[1]?q.top+=o:"center"===e.at[1]&&(q.top+=o/2),l=b(w.at,n,o),q.left+=l[0],q.top+=l[1],this.each(function(){var d,h,i=a(this),j=i.outerWidth(),k=i.outerHeight(),m=c(this,"marginLeft"),r=c(this,"marginTop"),x=j+m+c(this,"marginRight")+u.width,y=k+r+c(this,"marginBottom")+u.height,z=a.extend({},q),A=b(w.my,i.outerWidth(),i.outerHeight());"right"===e.my[0]?z.left-=j:"center"===e.my[0]&&(z.left-=j/2),"bottom"===e.my[1]?z.top-=k:"center"===e.my[1]&&(z.top-=k/2),z.left+=A[0],z.top+=A[1],d={marginLeft:m,marginTop:r},a.each(["left","top"],function(b,c){a.ui.position[v[b]]&&a.ui.position[v[b]][c](z,{targetWidth:n,targetHeight:o,elemWidth:j,elemHeight:k,collisionPosition:d,collisionWidth:x,collisionHeight:y,offset:[l[0]+A[0],l[1]+A[1]],my:e.my,at:e.at,within:t,elem:i})}),e.using&&(h=function(a){var b=p.left-z.left,c=b+n-j,d=p.top-z.top,h=d+o-k,l={target:{element:s,left:p.left,top:p.top,width:n,height:o},element:{element:i,left:z.left,top:z.top,width:j,height:k},horizontal:c<0?"left":b>0?"right":"center",vertical:h<0?"top":d>0?"bottom":"middle"};n<j&&g(b+c)<n&&(l.horizontal="center"),o<k&&g(d+h)<o&&(l.vertical="middle"),f(g(b),g(c))>f(g(d),g(h))?l.important="horizontal":l.important="vertical",e.using.call(this,a,l)}),i.offset(a.extend(z,{using:h}))})},a.ui.position={fit:{left:function(a,b){var c,d=b.within,e=d.isWindow?d.scrollLeft:d.offset.left,g=d.width,h=a.left-b.collisionPosition.marginLeft,i=e-h,j=h+b.collisionWidth-g-e;b.collisionWidth>g?i>0&&j<=0?(c=a.left+i+b.collisionWidth-g-e,a.left+=i-c):j>0&&i<=0?a.left=e:i>j?a.left=e+g-b.collisionWidth:a.left=e:i>0?a.left+=i:j>0?a.left-=j:a.left=f(a.left-h,a.left)},top:function(a,b){var c,d=b.within,e=d.isWindow?d.scrollTop:d.offset.top,g=b.within.height,h=a.top-b.collisionPosition.marginTop,i=e-h,j=h+b.collisionHeight-g-e;b.collisionHeight>g?i>0&&j<=0?(c=a.top+i+b.collisionHeight-g-e,a.top+=i-c):j>0&&i<=0?a.top=e:i>j?a.top=e+g-b.collisionHeight:a.top=e:i>0?a.top+=i:j>0?a.top-=j:a.top=f(a.top-h,a.top)}},flip:{left:function(a,b){var c,d,e=b.within,f=e.offset.left+e.scrollLeft,h=e.width,i=e.isWindow?e.scrollLeft:e.offset.left,j=a.left-b.collisionPosition.marginLeft,k=j-i,l=j+b.collisionWidth-h-i,m="left"===b.my[0]?-b.elemWidth:"right"===b.my[0]?b.elemWidth:0,n="left"===b.at[0]?b.targetWidth:"right"===b.at[0]?-b.targetWidth:0,o=-2*b.offset[0];k<0?(c=a.left+m+n+o+b.collisionWidth-h-f,(c<0||c<g(k))&&(a.left+=m+n+o)):l>0&&(d=a.left-b.collisionPosition.marginLeft+m+n+o-i,(d>0||g(d)<l)&&(a.left+=m+n+o))},top:function(a,b){var c,d,e=b.within,f=e.offset.top+e.scrollTop,h=e.height,i=e.isWindow?e.scrollTop:e.offset.top,j=a.top-b.collisionPosition.marginTop,k=j-i,l=j+b.collisionHeight-h-i,m="top"===b.my[1],n=m?-b.elemHeight:"bottom"===b.my[1]?b.elemHeight:0,o="top"===b.at[1]?b.targetHeight:"bottom"===b.at[1]?-b.targetHeight:0,p=-2*b.offset[1];k<0?(d=a.top+n+o+p+b.collisionHeight-h-f,(d<0||d<g(k))&&(a.top+=n+o+p)):l>0&&(c=a.top-b.collisionPosition.marginTop+n+o+p-i,(c>0||g(c)<l)&&(a.top+=n+o+p))}},flipfit:{left:function(){a.ui.position.flip.left.apply(this,arguments),a.ui.position.fit.left.apply(this,arguments)},top:function(){a.ui.position.flip.top.apply(this,arguments),a.ui.position.fit.top.apply(this,arguments)}}}}(),a.ui.position});;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
Drupal.debounce = function (func, wait, immediate) {
var timeout = void 0;
var result = void 0;
return function () {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
var context = this;
var later = function later() {
timeout = null;
if (!immediate) {
result = func.apply(context, args);
}
};
var callNow = immediate && !timeout;
clearTimeout(timeout);
timeout = setTimeout(later, wait);
if (callNow) {
result = func.apply(context, args);
}
return result;
};
};;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function ($, Drupal, debounce) {
var offsets = {
top: 0,
right: 0,
bottom: 0,
left: 0
};
function getRawOffset(el, edge) {
var $el = $(el);
var documentElement = document.documentElement;
var displacement = 0;
var horizontal = edge === 'left' || edge === 'right';
var placement = $el.offset()[horizontal ? 'left' : 'top'];
placement -= window['scroll' + (horizontal ? 'X' : 'Y')] || document.documentElement['scroll' + (horizontal ? 'Left' : 'Top')] || 0;
switch (edge) {
case 'top':
displacement = placement + $el.outerHeight();
break;
case 'left':
displacement = placement + $el.outerWidth();
break;
case 'bottom':
displacement = documentElement.clientHeight - placement;
break;
case 'right':
displacement = documentElement.clientWidth - placement;
break;
default:
displacement = 0;
}
return displacement;
}
function calculateOffset(edge) {
var edgeOffset = 0;
var displacingElements = document.querySelectorAll('[data-offset-' + edge + ']');
var n = displacingElements.length;
for (var i = 0; i < n; i++) {
var el = displacingElements[i];
if (el.style.display === 'none') {
continue;
}
var displacement = parseInt(el.getAttribute('data-offset-' + edge), 10);
if (isNaN(displacement)) {
displacement = getRawOffset(el, edge);
}
edgeOffset = Math.max(edgeOffset, displacement);
}
return edgeOffset;
}
function calculateOffsets() {
return {
top: calculateOffset('top'),
right: calculateOffset('right'),
bottom: calculateOffset('bottom'),
left: calculateOffset('left')
};
}
function displace(broadcast) {
offsets = calculateOffsets();
Drupal.displace.offsets = offsets;
if (typeof broadcast === 'undefined' || broadcast) {
$(document).trigger('drupalViewportOffsetChange', offsets);
}
return offsets;
}
Drupal.behaviors.drupalDisplace = {
attach: function attach() {
if (this.displaceProcessed) {
return;
}
this.displaceProcessed = true;
$(window).on('resize.drupalDisplace', debounce(displace, 200));
}
};
Drupal.displace = displace;
$.extend(Drupal.displace, {
offsets: offsets,
calculateOffset: calculateOffset
});
})(jQuery, Drupal, Drupal.debounce);;
/*! jquery.cookie v1.4.1 | MIT */
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?a(require("jquery")):a(jQuery)}(function(a){function b(a){return h.raw?a:encodeURIComponent(a)}function c(a){return h.raw?a:decodeURIComponent(a)}function d(a){return b(h.json?JSON.stringify(a):String(a))}function e(a){0===a.indexOf('"')&&(a=a.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return a=decodeURIComponent(a.replace(g," ")),h.json?JSON.parse(a):a}catch(b){}}function f(b,c){var d=h.raw?b:e(b);return a.isFunction(c)?c(d):d}var g=/\+/g,h=a.cookie=function(e,g,i){if(void 0!==g&&!a.isFunction(g)){if(i=a.extend({},h.defaults,i),"number"==typeof i.expires){var j=i.expires,k=i.expires=new Date;k.setTime(+k+864e5*j)}return document.cookie=[b(e),"=",d(g),i.expires?"; expires="+i.expires.toUTCString():"",i.path?"; path="+i.path:"",i.domain?"; domain="+i.domain:"",i.secure?"; secure":""].join("")}for(var l=e?void 0:{},m=document.cookie?document.cookie.split("; "):[],n=0,o=m.length;o>n;n++){var p=m[n].split("="),q=c(p.shift()),r=p.join("=");if(e&&e===q){l=f(r,g);break}e||void 0===(r=f(r))||(l[q]=r)}return l};h.defaults={},a.removeCookie=function(b,c){return void 0===a.cookie(b)?!1:(a.cookie(b,"",a.extend({},c,{expires:-1})),!a.cookie(b))}});;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function ($, Drupal, debounce) {
$.fn.drupalGetSummary = function () {
var callback = this.data('summaryCallback');
return this[0] && callback ? $.trim(callback(this[0])) : '';
};
$.fn.drupalSetSummary = function (callback) {
var self = this;
if (typeof callback !== 'function') {
var val = callback;
callback = function callback() {
return val;
};
}
return this.data('summaryCallback', callback).off('formUpdated.summary').on('formUpdated.summary', function () {
self.trigger('summaryUpdated');
}).trigger('summaryUpdated');
};
Drupal.behaviors.formSingleSubmit = {
attach: function attach() {
function onFormSubmit(e) {
var $form = $(e.currentTarget);
var formValues = $form.serialize();
var previousValues = $form.attr('data-drupal-form-submit-last');
if (previousValues === formValues) {
e.preventDefault();
} else {
$form.attr('data-drupal-form-submit-last', formValues);
}
}
$('body').once('form-single-submit').on('submit.singleSubmit', 'form:not([method~="GET"])', onFormSubmit);
}
};
function triggerFormUpdated(element) {
$(element).trigger('formUpdated');
}
function fieldsList(form) {
var $fieldList = $(form).find('[name]').map(function (index, element) {
return element.getAttribute('id');
});
return $.makeArray($fieldList);
}
Drupal.behaviors.formUpdated = {
attach: function attach(context) {
var $context = $(context);
var contextIsForm = $context.is('form');
var $forms = (contextIsForm ? $context : $context.find('form')).once('form-updated');
var formFields = void 0;
if ($forms.length) {
$.makeArray($forms).forEach(function (form) {
var events = 'change.formUpdated input.formUpdated ';
var eventHandler = debounce(function (event) {
triggerFormUpdated(event.target);
}, 300);
formFields = fieldsList(form).join(',');
form.setAttribute('data-drupal-form-fields', formFields);
$(form).on(events, eventHandler);
});
}
if (contextIsForm) {
formFields = fieldsList(context).join(',');
var currentFields = $(context).attr('data-drupal-form-fields');
if (formFields !== currentFields) {
triggerFormUpdated(context);
}
}
},
detach: function detach(context, settings, trigger) {
var $context = $(context);
var contextIsForm = $context.is('form');
if (trigger === 'unload') {
var $forms = (contextIsForm ? $context : $context.find('form')).removeOnce('form-updated');
if ($forms.length) {
$.makeArray($forms).forEach(function (form) {
form.removeAttribute('data-drupal-form-fields');
$(form).off('.formUpdated');
});
}
}
}
};
Drupal.behaviors.fillUserInfoFromBrowser = {
attach: function attach(context, settings) {
var userInfo = ['name', 'mail', 'homepage'];
var $forms = $('[data-user-info-from-browser]').once('user-info-from-browser');
if ($forms.length) {
userInfo.forEach(function (info) {
var $element = $forms.find('[name=' + info + ']');
var browserData = localStorage.getItem('Drupal.visitor.' + info);
var emptyOrDefault = $element.val() === '' || $element.attr('data-drupal-default-value') === $element.val();
if ($element.length && emptyOrDefault && browserData) {
$element.val(browserData);
}
});
}
$forms.on('submit', function () {
userInfo.forEach(function (info) {
var $element = $forms.find('[name=' + info + ']');
if ($element.length) {
localStorage.setItem('Drupal.visitor.' + info, $element.val());
}
});
});
}
};
var handleFragmentLinkClickOrHashChange = function handleFragmentLinkClickOrHashChange(e) {
var url = void 0;
if (e.type === 'click') {
url = e.currentTarget.location ? e.currentTarget.location : e.currentTarget;
} else {
url = window.location;
}
var hash = url.hash.substr(1);
if (hash) {
var $target = $('#' + hash);
$('body').trigger('formFragmentLinkClickOrHashChange', [$target]);
setTimeout(function () {
return $target.trigger('focus');
}, 300);
}
};
var debouncedHandleFragmentLinkClickOrHashChange = debounce(handleFragmentLinkClickOrHashChange, 300, true);
$(window).on('hashchange.form-fragment', debouncedHandleFragmentLinkClickOrHashChange);
$(document).on('click.form-fragment', 'a[href*="#"]', debouncedHandleFragmentLinkClickOrHashChange);
})(jQuery, Drupal, Drupal.debounce);;
/*! jQuery UI - v1.12.1 - 2017-03-31
* http://jqueryui.com
* Copyright jQuery Foundation and other contributors; Licensed */
!function(a){"function"==typeof define&&define.amd?define(["jquery","./controlgroup","./checkboxradio","../keycode","../widget"],a):a(jQuery)}(function(a){return a.widget("ui.button",{version:"1.12.1",defaultElement:"<button>",options:{classes:{"ui-button":"ui-corner-all"},disabled:null,icon:null,iconPosition:"beginning",label:null,showLabel:!0},_getCreateOptions:function(){var a,b=this._super()||{};return this.isInput=this.element.is("input"),a=this.element[0].disabled,null!=a&&(b.disabled=a),this.originalLabel=this.isInput?this.element.val():this.element.html(),this.originalLabel&&(b.label=this.originalLabel),b},_create:function(){!this.option.showLabel&!this.options.icon&&(this.options.showLabel=!0),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled||!1),this.hasTitle=!!this.element.attr("title"),this.options.label&&this.options.label!==this.originalLabel&&(this.isInput?this.element.val(this.options.label):this.element.html(this.options.label)),this._addClass("ui-button","ui-widget"),this._setOption("disabled",this.options.disabled),this._enhance(),this.element.is("a")&&this._on({keyup:function(b){b.keyCode===a.ui.keyCode.SPACE&&(b.preventDefault(),this.element[0].click?this.element[0].click():this.element.trigger("click"))}})},_enhance:function(){this.element.is("button")||this.element.attr("role","button"),this.options.icon&&(this._updateIcon("icon",this.options.icon),this._updateTooltip())},_updateTooltip:function(){this.title=this.element.attr("title"),this.options.showLabel||this.title||this.element.attr("title",this.options.label)},_updateIcon:function(b,c){var d="iconPosition"!==b,e=d?this.options.iconPosition:c,f="top"===e||"bottom"===e;this.icon?d&&this._removeClass(this.icon,null,this.options.icon):(this.icon=a("<span>"),this._addClass(this.icon,"ui-button-icon","ui-icon"),this.options.showLabel||this._addClass("ui-button-icon-only")),d&&this._addClass(this.icon,null,c),this._attachIcon(e),f?(this._addClass(this.icon,null,"ui-widget-icon-block"),this.iconSpace&&this.iconSpace.remove()):(this.iconSpace||(this.iconSpace=a("<span> </span>"),this._addClass(this.iconSpace,"ui-button-icon-space")),this._removeClass(this.icon,null,"ui-wiget-icon-block"),this._attachIconSpace(e))},_destroy:function(){this.element.removeAttr("role"),this.icon&&this.icon.remove(),this.iconSpace&&this.iconSpace.remove(),this.hasTitle||this.element.removeAttr("title")},_attachIconSpace:function(a){this.icon[/^(?:end|bottom)/.test(a)?"before":"after"](this.iconSpace)},_attachIcon:function(a){this.element[/^(?:end|bottom)/.test(a)?"append":"prepend"](this.icon)},_setOptions:function(a){var b=void 0===a.showLabel?this.options.showLabel:a.showLabel,c=void 0===a.icon?this.options.icon:a.icon;b||c||(a.showLabel=!0),this._super(a)},_setOption:function(a,b){"icon"===a&&(b?this._updateIcon(a,b):this.icon&&(this.icon.remove(),this.iconSpace&&this.iconSpace.remove())),"iconPosition"===a&&this._updateIcon(a,b),"showLabel"===a&&(this._toggleClass("ui-button-icon-only",null,!b),this._updateTooltip()),"label"===a&&(this.isInput?this.element.val(b):(this.element.html(b),this.icon&&(this._attachIcon(this.options.iconPosition),this._attachIconSpace(this.options.iconPosition)))),this._super(a,b),"disabled"===a&&(this._toggleClass(null,"ui-state-disabled",b),this.element[0].disabled=b,b&&this.element.blur())},refresh:function(){var a=this.element.is("input, button")?this.element[0].disabled:this.element.hasClass("ui-button-disabled");a!==this.options.disabled&&this._setOptions({disabled:a}),this._updateTooltip()}}),a.uiBackCompat!==!1&&(a.widget("ui.button",a.ui.button,{options:{text:!0,icons:{primary:null,secondary:null}},_create:function(){this.options.showLabel&&!this.options.text&&(this.options.showLabel=this.options.text),!this.options.showLabel&&this.options.text&&(this.options.text=this.options.showLabel),this.options.icon||!this.options.icons.primary&&!this.options.icons.secondary?this.options.icon&&(this.options.icons.primary=this.options.icon):this.options.icons.primary?this.options.icon=this.options.icons.primary:(this.options.icon=this.options.icons.secondary,this.options.iconPosition="end"),this._super()},_setOption:function(a,b){return"text"===a?void this._super("showLabel",b):("showLabel"===a&&(this.options.text=b),"icon"===a&&(this.options.icons.primary=b),"icons"===a&&(b.primary?(this._super("icon",b.primary),this._super("iconPosition","beginning")):b.secondary&&(this._super("icon",b.secondary),this._super("iconPosition","end"))),void this._superApply(arguments))}}),a.fn.button=function(b){return function(){return!this.length||this.length&&"INPUT"!==this[0].tagName||this.length&&"INPUT"===this[0].tagName&&"checkbox"!==this.attr("type")&&"radio"!==this.attr("type")?b.apply(this,arguments):(a.ui.checkboxradio||a.error("Checkboxradio widget missing"),0===arguments.length?this.checkboxradio({icon:!1}):this.checkboxradio.apply(this,arguments))}}(a.fn.button),a.fn.buttonset=function(){return a.ui.controlgroup||a.error("Controlgroup widget missing"),"option"===arguments[0]&&"items"===arguments[1]&&arguments[2]?this.controlgroup.apply(this,[arguments[0],"items.button",arguments[2]]):"option"===arguments[0]&&"items"===arguments[1]?this.controlgroup.apply(this,[arguments[0],"items.button"]):("object"==typeof arguments[0]&&arguments[0].items&&(arguments[0].items={button:arguments[0].items}),this.controlgroup.apply(this,arguments))}),a.ui.button});;
/*! jQuery UI - v1.12.1 - 2017-03-31
* http://jqueryui.com
* Copyright jQuery Foundation and other contributors; Licensed */
!function(a){"function"==typeof define&&define.amd?define(["jquery","../ie","../version","../widget"],a):a(jQuery)}(function(a){var b=!1;return a(document).on("mouseup",function(){b=!1}),a.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var b=this;this.element.on("mousedown."+this.widgetName,function(a){return b._mouseDown(a)}).on("click."+this.widgetName,function(c){if(!0===a.data(c.target,b.widgetName+".preventClickEvent"))return a.removeData(c.target,b.widgetName+".preventClickEvent"),c.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(c){if(!b){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(c),this._mouseDownEvent=c;var d=this,e=1===c.which,f=!("string"!=typeof this.options.cancel||!c.target.nodeName)&&a(c.target).closest(this.options.cancel).length;return!(e&&!f&&this._mouseCapture(c))||(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){d.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(c)&&this._mouseDelayMet(c)&&(this._mouseStarted=this._mouseStart(c)!==!1,!this._mouseStarted)?(c.preventDefault(),!0):(!0===a.data(c.target,this.widgetName+".preventClickEvent")&&a.removeData(c.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(a){return d._mouseMove(a)},this._mouseUpDelegate=function(a){return d._mouseUp(a)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),c.preventDefault(),b=!0,!0))}},_mouseMove:function(b){if(this._mouseMoved){if(a.ui.ie&&(!document.documentMode||document.documentMode<9)&&!b.button)return this._mouseUp(b);if(!b.which)if(b.originalEvent.altKey||b.originalEvent.ctrlKey||b.originalEvent.metaKey||b.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(b)}return(b.which||b.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(b),b.preventDefault()):(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==!1,this._mouseStarted?this._mouseDrag(b):this._mouseUp(b)),!this._mouseStarted)},_mouseUp:function(c){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,c.target===this._mouseDownEvent.target&&a.data(c.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(c)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,b=!1,c.preventDefault()},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})});;
/*! jQuery UI - v1.12.1 - 2017-03-31
* http://jqueryui.com
* Copyright jQuery Foundation and other contributors; Licensed */
!function(a){"function"==typeof define&&define.amd?define(["jquery","./mouse","../data","../plugin","../safe-active-element","../safe-blur","../scroll-parent","../version","../widget"],a):a(jQuery)}(function(a){return a.widget("ui.draggable",a.ui.mouse,{version:"1.12.1",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this._addClass("ui-draggable"),this._setHandleClassName(),this._mouseInit()},_setOption:function(a,b){this._super(a,b),"handle"===a&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?void(this.destroyOnClear=!0):(this._removeHandleClassName(),void this._mouseDestroy())},_mouseCapture:function(b){var c=this.options;return!(this.helper||c.disabled||a(b.target).closest(".ui-resizable-handle").length>0)&&(this.handle=this._getHandle(b),!!this.handle&&(this._blurActiveElement(b),this._blockFrames(c.iframeFix===!0?"iframe":c.iframeFix),!0))},_blockFrames:function(b){this.iframeBlocks=this.document.find(b).map(function(){var b=a(this);return a("<div>").css("position","absolute").appendTo(b.parent()).outerWidth(b.outerWidth()).outerHeight(b.outerHeight()).offset(b.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(b){var c=a.ui.safeActiveElement(this.document[0]),d=a(b.target);d.closest(c).length||a.ui.safeBlur(c)},_mouseStart:function(b){var c=this.options;return this.helper=this._createHelper(b),this._addClass(this.helper,"ui-draggable-dragging"),this._cacheHelperProportions(),a.ui.ddmanager&&(a.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===a(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(b),this.originalPosition=this.position=this._generatePosition(b,!1),this.originalPageX=b.pageX,this.originalPageY=b.pageY,c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt),this._setContainment(),this._trigger("start",b)===!1?(this._clear(),!1):(this._cacheHelperProportions(),a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this._mouseDrag(b,!0),a.ui.ddmanager&&a.ui.ddmanager.dragStart(this,b),!0)},_refreshOffsets:function(a){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:a.pageX-this.offset.left,top:a.pageY-this.offset.top}},_mouseDrag:function(b,c){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(b,!0),this.positionAbs=this._convertPositionTo("absolute"),!c){var d=this._uiHash();if(this._trigger("drag",b,d)===!1)return this._mouseUp(new a.Event("mouseup",b)),!1;this.position=d.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",a.ui.ddmanager&&a.ui.ddmanager.drag(this,b),!1},_mouseStop:function(b){var c=this,d=!1;return a.ui.ddmanager&&!this.options.dropBehaviour&&(d=a.ui.ddmanager.drop(this,b)),this.dropped&&(d=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!d||"valid"===this.options.revert&&d||this.options.revert===!0||a.isFunction(this.options.revert)&&this.options.revert.call(this.element,d)?a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){c._trigger("stop",b)!==!1&&c._clear()}):this._trigger("stop",b)!==!1&&this._clear(),!1},_mouseUp:function(b){return this._unblockFrames(),a.ui.ddmanager&&a.ui.ddmanager.dragStop(this,b),this.handleElement.is(b.target)&&this.element.trigger("focus"),a.ui.mouse.prototype._mouseUp.call(this,b)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp(new a.Event("mouseup",{target:this.element[0]})):this._clear(),this},_getHandle:function(b){return!this.options.handle||!!a(b.target).closest(this.element.find(this.options.handle)).length},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper),e=d?a(c.helper.apply(this.element[0],[b])):"clone"===c.helper?this.element.clone().removeAttr("id"):this.element;return e.parents("body").length||e.appendTo("parent"===c.appendTo?this.element[0].parentNode:c.appendTo),d&&e[0]===this.element[0]&&this._setPositionRelative(),e[0]===this.element[0]||/(fixed|absolute)/.test(e.css("position"))||e.css("position","absolute"),e},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(b){"string"==typeof b&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_isRootNode:function(a){return/(html|body)/i.test(a.tagName)||a===this.document[0]},_getParentOffset:function(){var b=this.offsetParent.offset(),c=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==c&&a.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(b={top:0,left:0}),{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var a=this.element.position(),b=this._isRootNode(this.scrollParent[0]);return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+(b?0:this.scrollParent.scrollTop()),left:a.left-(parseInt(this.helper.css("left"),10)||0)+(b?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b,c,d,e=this.options,f=this.document[0];return this.relativeContainer=null,e.containment?"window"===e.containment?void(this.containment=[a(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,a(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,a(window).scrollLeft()+a(window).width()-this.helperProportions.width-this.margins.left,a(window).scrollTop()+(a(window).height()||f.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]):"document"===e.containment?void(this.containment=[0,0,a(f).width()-this.helperProportions.width-this.margins.left,(a(f).height()||f.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]):e.containment.constructor===Array?void(this.containment=e.containment):("parent"===e.containment&&(e.containment=this.helper[0].parentNode),c=a(e.containment),d=c[0],void(d&&(b=/(scroll|auto)/.test(c.css("overflow")),this.containment=[(parseInt(c.css("borderLeftWidth"),10)||0)+(parseInt(c.css("paddingLeft"),10)||0),(parseInt(c.css("borderTopWidth"),10)||0)+(parseInt(c.css("paddingTop"),10)||0),(b?Math.max(d.scrollWidth,d.offsetWidth):d.offsetWidth)-(parseInt(c.css("borderRightWidth"),10)||0)-(parseInt(c.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(b?Math.max(d.scrollHeight,d.offsetHeight):d.offsetHeight)-(parseInt(c.css("borderBottomWidth"),10)||0)-(parseInt(c.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=c))):void(this.containment=null)},_convertPositionTo:function(a,b){b||(b=this.position);var c="absolute"===a?1:-1,d=this._isRootNode(this.scrollParent[0]);return{top:b.top+this.offset.relative.top*c+this.offset.parent.top*c-("fixed"===this.cssPosition?-this.offset.scroll.top:d?0:this.offset.scroll.top)*c,left:b.left+this.offset.relative.left*c+this.offset.parent.left*c-("fixed"===this.cssPosition?-this.offset.scroll.left:d?0:this.offset.scroll.left)*c}},_generatePosition:function(a,b){var c,d,e,f,g=this.options,h=this._isRootNode(this.scrollParent[0]),i=a.pageX,j=a.pageY;return h&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),b&&(this.containment&&(this.relativeContainer?(d=this.relativeContainer.offset(),c=[this.containment[0]+d.left,this.containment[1]+d.top,this.containment[2]+d.left,this.containment[3]+d.top]):c=this.containment,a.pageX-this.offset.click.left<c[0]&&(i=c[0]+this.offset.click.left),a.pageY-this.offset.click.top<c[1]&&(j=c[1]+this.offset.click.top),a.pageX-this.offset.click.left>c[2]&&(i=c[2]+this.offset.click.left),a.pageY-this.offset.click.top>c[3]&&(j=c[3]+this.offset.click.top)),g.grid&&(e=g.grid[1]?this.originalPageY+Math.round((j-this.originalPageY)/g.grid[1])*g.grid[1]:this.originalPageY,j=c?e-this.offset.click.top>=c[1]||e-this.offset.click.top>c[3]?e:e-this.offset.click.top>=c[1]?e-g.grid[1]:e+g.grid[1]:e,f=g.grid[0]?this.originalPageX+Math.round((i-this.originalPageX)/g.grid[0])*g.grid[0]:this.originalPageX,i=c?f-this.offset.click.left>=c[0]||f-this.offset.click.left>c[2]?f:f-this.offset.click.left>=c[0]?f-g.grid[0]:f+g.grid[0]:f),"y"===g.axis&&(i=this.originalPageX),"x"===g.axis&&(j=this.originalPageY)),{top:j-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:h?0:this.offset.scroll.top),left:i-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:h?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_trigger:function(b,c,d){return d=d||this._uiHash(),a.ui.plugin.call(this,b,[c,d,this],!0),/^(drag|start|stop)/.test(b)&&(this.positionAbs=this._convertPositionTo("absolute"),d.offset=this.positionAbs),a.Widget.prototype._trigger.call(this,b,c,d)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),a.ui.plugin.add("draggable","connectToSortable",{start:function(b,c,d){var e=a.extend({},c,{item:d.element});d.sortables=[],a(d.options.connectToSortable).each(function(){var c=a(this).sortable("instance");c&&!c.options.disabled&&(d.sortables.push(c),c.refreshPositions(),c._trigger("activate",b,e))})},stop:function(b,c,d){var e=a.extend({},c,{item:d.element});d.cancelHelperRemoval=!1,a.each(d.sortables,function(){var a=this;a.isOver?(a.isOver=0,d.cancelHelperRemoval=!0,a.cancelHelperRemoval=!1,a._storedCSS={position:a.placeholder.css("position"),top:a.placeholder.css("top"),left:a.placeholder.css("left")},a._mouseStop(b),a.options.helper=a.options._helper):(a.cancelHelperRemoval=!0,a._trigger("deactivate",b,e))})},drag:function(b,c,d){a.each(d.sortables,function(){var e=!1,f=this;f.positionAbs=d.positionAbs,f.helperProportions=d.helperProportions,f.offset.click=d.offset.click,f._intersectsWith(f.containerCache)&&(e=!0,a.each(d.sortables,function(){return this.positionAbs=d.positionAbs,this.helperProportions=d.helperProportions,this.offset.click=d.offset.click,this!==f&&this._intersectsWith(this.containerCache)&&a.contains(f.element[0],this.element[0])&&(e=!1),e})),e?(f.isOver||(f.isOver=1,d._parent=c.helper.parent(),f.currentItem=c.helper.appendTo(f.element).data("ui-sortable-item",!0),f.options._helper=f.options.helper,f.options.helper=function(){return c.helper[0]},b.target=f.currentItem[0],f._mouseCapture(b,!0),f._mouseStart(b,!0,!0),f.offset.click.top=d.offset.click.top,f.offset.click.left=d.offset.click.left,f.offset.parent.left-=d.offset.parent.left-f.offset.parent.left,f.offset.parent.top-=d.offset.parent.top-f.offset.parent.top,d._trigger("toSortable",b),d.dropped=f.element,a.each(d.sortables,function(){this.refreshPositions()}),d.currentItem=d.element,f.fromOutside=d),f.currentItem&&(f._mouseDrag(b),c.position=f.position)):f.isOver&&(f.isOver=0,f.cancelHelperRemoval=!0,f.options._revert=f.options.revert,f.options.revert=!1,f._trigger("out",b,f._uiHash(f)),f._mouseStop(b,!0),f.options.revert=f.options._revert,f.options.helper=f.options._helper,f.placeholder&&f.placeholder.remove(),c.helper.appendTo(d._parent),d._refreshOffsets(b),c.position=d._generatePosition(b,!0),d._trigger("fromSortable",b),d.dropped=!1,a.each(d.sortables,function(){this.refreshPositions()}))})}}),a.ui.plugin.add("draggable","cursor",{start:function(b,c,d){var e=a("body"),f=d.options;e.css("cursor")&&(f._cursor=e.css("cursor")),e.css("cursor",f.cursor)},stop:function(b,c,d){var e=d.options;e._cursor&&a("body").css("cursor",e._cursor)}}),a.ui.plugin.add("draggable","opacity",{start:function(b,c,d){var e=a(c.helper),f=d.options;e.css("opacity")&&(f._opacity=e.css("opacity")),e.css("opacity",f.opacity)},stop:function(b,c,d){var e=d.options;e._opacity&&a(c.helper).css("opacity",e._opacity)}}),a.ui.plugin.add("draggable","scroll",{start:function(a,b,c){c.scrollParentNotHidden||(c.scrollParentNotHidden=c.helper.scrollParent(!1)),c.scrollParentNotHidden[0]!==c.document[0]&&"HTML"!==c.scrollParentNotHidden[0].tagName&&(c.overflowOffset=c.scrollParentNotHidden.offset())},drag:function(b,c,d){var e=d.options,f=!1,g=d.scrollParentNotHidden[0],h=d.document[0];g!==h&&"HTML"!==g.tagName?(e.axis&&"x"===e.axis||(d.overflowOffset.top+g.offsetHeight-b.pageY<e.scrollSensitivity?g.scrollTop=f=g.scrollTop+e.scrollSpeed:b.pageY-d.overflowOffset.top<e.scrollSensitivity&&(g.scrollTop=f=g.scrollTop-e.scrollSpeed)),e.axis&&"y"===e.axis||(d.overflowOffset.left+g.offsetWidth-b.pageX<e.scrollSensitivity?g.scrollLeft=f=g.scrollLeft+e.scrollSpeed:b.pageX-d.overflowOffset.left<e.scrollSensitivity&&(g.scrollLeft=f=g.scrollLeft-e.scrollSpeed))):(e.axis&&"x"===e.axis||(b.pageY-a(h).scrollTop()<e.scrollSensitivity?f=a(h).scrollTop(a(h).scrollTop()-e.scrollSpeed):a(window).height()-(b.pageY-a(h).scrollTop())<e.scrollSensitivity&&(f=a(h).scrollTop(a(h).scrollTop()+e.scrollSpeed))),e.axis&&"y"===e.axis||(b.pageX-a(h).scrollLeft()<e.scrollSensitivity?f=a(h).scrollLeft(a(h).scrollLeft()-e.scrollSpeed):a(window).width()-(b.pageX-a(h).scrollLeft())<e.scrollSensitivity&&(f=a(h).scrollLeft(a(h).scrollLeft()+e.scrollSpeed)))),f!==!1&&a.ui.ddmanager&&!e.dropBehaviour&&a.ui.ddmanager.prepareOffsets(d,b)}}),a.ui.plugin.add("draggable","snap",{start:function(b,c,d){var e=d.options;d.snapElements=[],a(e.snap.constructor!==String?e.snap.items||":data(ui-draggable)":e.snap).each(function(){var b=a(this),c=b.offset();this!==d.element[0]&&d.snapElements.push({item:this,width:b.outerWidth(),height:b.outerHeight(),top:c.top,left:c.left})})},drag:function(b,c,d){var e,f,g,h,i,j,k,l,m,n,o=d.options,p=o.snapTolerance,q=c.offset.left,r=q+d.helperProportions.width,s=c.offset.top,t=s+d.helperProportions.height;for(m=d.snapElements.length-1;m>=0;m--)i=d.snapElements[m].left-d.margins.left,j=i+d.snapElements[m].width,k=d.snapElements[m].top-d.margins.top,l=k+d.snapElements[m].height,r<i-p||q>j+p||t<k-p||s>l+p||!a.contains(d.snapElements[m].item.ownerDocument,d.snapElements[m].item)?(d.snapElements[m].snapping&&d.options.snap.release&&d.options.snap.release.call(d.element,b,a.extend(d._uiHash(),{snapItem:d.snapElements[m].item})),d.snapElements[m].snapping=!1):("inner"!==o.snapMode&&(e=Math.abs(k-t)<=p,f=Math.abs(l-s)<=p,g=Math.abs(i-r)<=p,h=Math.abs(j-q)<=p,e&&(c.position.top=d._convertPositionTo("relative",{top:k-d.helperProportions.height,left:0}).top),f&&(c.position.top=d._convertPositionTo("relative",{top:l,left:0}).top),g&&(c.position.left=d._convertPositionTo("relative",{top:0,left:i-d.helperProportions.width}).left),h&&(c.position.left=d._convertPositionTo("relative",{top:0,left:j}).left)),n=e||f||g||h,"outer"!==o.snapMode&&(e=Math.abs(k-s)<=p,f=Math.abs(l-t)<=p,g=Math.abs(i-q)<=p,h=Math.abs(j-r)<=p,e&&(c.position.top=d._convertPositionTo("relative",{top:k,left:0}).top),f&&(c.position.top=d._convertPositionTo("relative",{top:l-d.helperProportions.height,left:0}).top),g&&(c.position.left=d._convertPositionTo("relative",{top:0,left:i}).left),h&&(c.position.left=d._convertPositionTo("relative",{top:0,left:j-d.helperProportions.width}).left)),!d.snapElements[m].snapping&&(e||f||g||h||n)&&d.options.snap.snap&&d.options.snap.snap.call(d.element,b,a.extend(d._uiHash(),{snapItem:d.snapElements[m].item})),d.snapElements[m].snapping=e||f||g||h||n)}}),a.ui.plugin.add("draggable","stack",{start:function(b,c,d){var e,f=d.options,g=a.makeArray(a(f.stack)).sort(function(b,c){return(parseInt(a(b).css("zIndex"),10)||0)-(parseInt(a(c).css("zIndex"),10)||0)});g.length&&(e=parseInt(a(g[0]).css("zIndex"),10)||0,a(g).each(function(b){a(this).css("zIndex",e+b)}),this.css("zIndex",e+g.length))}}),a.ui.plugin.add("draggable","zIndex",{start:function(b,c,d){var e=a(c.helper),f=d.options;e.css("zIndex")&&(f._zIndex=e.css("zIndex")),e.css("zIndex",f.zIndex)},stop:function(b,c,d){var e=d.options;e._zIndex&&a(c.helper).css("zIndex",e._zIndex)}}),a.ui.draggable});;
/*! jQuery UI - v1.12.1 - 2017-03-31
* http://jqueryui.com
* Copyright jQuery Foundation and other contributors; Licensed */
!function(a){"function"==typeof define&&define.amd?define(["jquery","./mouse","../disable-selection","../plugin","../version","../widget"],a):a(jQuery)}(function(a){return a.widget("ui.resizable",a.ui.mouse,{version:"1.12.1",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(a){return parseFloat(a)||0},_isNumber:function(a){return!isNaN(parseFloat(a))},_hasScroll:function(b,c){if("hidden"===a(b).css("overflow"))return!1;var d=c&&"left"===c?"scrollLeft":"scrollTop",e=!1;return b[d]>0||(b[d]=1,e=b[d]>0,b[d]=0,e)},_create:function(){var b,c=this.options,d=this;this._addClass("ui-resizable"),a.extend(this,{_aspectRatio:!!c.aspectRatio,aspectRatio:c.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:c.helper||c.ghost||c.animate?c.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(a("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,b={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(b),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(b),this._proportionallyResize()),this._setupHandles(),c.autoHide&&a(this.element).on("mouseenter",function(){c.disabled||(d._removeClass("ui-resizable-autohide"),d._handles.show())}).on("mouseleave",function(){c.disabled||d.resizing||(d._addClass("ui-resizable-autohide"),d._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy();var b,c=function(b){a(b).removeData("resizable").removeData("ui-resizable").off(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(c(this.element),b=this.element,this.originalElement.css({position:b.css("position"),width:b.outerWidth(),height:b.outerHeight(),top:b.css("top"),left:b.css("left")}).insertAfter(b),b.remove()),this.originalElement.css("resize",this.originalResizeStyle),c(this.originalElement),this},_setOption:function(a,b){switch(this._super(a,b),a){case"handles":this._removeHandles(),this._setupHandles()}},_setupHandles:function(){var b,c,d,e,f,g=this.options,h=this;if(this.handles=g.handles||(a(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=a(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),d=this.handles.split(","),this.handles={},c=0;c<d.length;c++)b=a.trim(d[c]),e="ui-resizable-"+b,f=a("<div>"),this._addClass(f,"ui-resizable-handle "+e),f.css({zIndex:g.zIndex}),this.handles[b]=".ui-resizable-"+b,this.element.append(f);this._renderAxis=function(b){var c,d,e,f;b=b||this.element;for(c in this.handles)this.handles[c].constructor===String?this.handles[c]=this.element.children(this.handles[c]).first().show():(this.handles[c].jquery||this.handles[c].nodeType)&&(this.handles[c]=a(this.handles[c]),this._on(this.handles[c],{mousedown:h._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(d=a(this.handles[c],this.element),f=/sw|ne|nw|se|n|s/.test(c)?d.outerHeight():d.outerWidth(),e=["padding",/ne|nw|n/.test(c)?"Top":/se|sw|s/.test(c)?"Bottom":/^e$/.test(c)?"Right":"Left"].join(""),b.css(e,f),this._proportionallyResize()),this._handles=this._handles.add(this.handles[c])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){h.resizing||(this.className&&(f=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),h.axis=f&&f[1]?f[1]:"se")}),g.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._handles.remove()},_mouseCapture:function(b){var c,d,e=!1;for(c in this.handles)d=a(this.handles[c])[0],(d===b.target||a.contains(d,b.target))&&(e=!0);return!this.options.disabled&&e},_mouseStart:function(b){var c,d,e,f=this.options,g=this.element;return this.resizing=!0,this._renderProxy(),c=this._num(this.helper.css("left")),d=this._num(this.helper.css("top")),f.containment&&(c+=a(f.containment).scrollLeft()||0,d+=a(f.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:c,top:d},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:g.width(),height:g.height()},this.originalSize=this._helper?{width:g.outerWidth(),height:g.outerHeight()}:{width:g.width(),height:g.height()},this.sizeDiff={width:g.outerWidth()-g.width(),height:g.outerHeight()-g.height()},this.originalPosition={left:c,top:d},this.originalMousePosition={left:b.pageX,top:b.pageY},this.aspectRatio="number"==typeof f.aspectRatio?f.aspectRatio:this.originalSize.width/this.originalSize.height||1,e=a(".ui-resizable-"+this.axis).css("cursor"),a("body").css("cursor","auto"===e?this.axis+"-resize":e),this._addClass("ui-resizable-resizing"),this._propagate("start",b),!0},_mouseDrag:function(b){var c,d,e=this.originalMousePosition,f=this.axis,g=b.pageX-e.left||0,h=b.pageY-e.top||0,i=this._change[f];return this._updatePrevProperties(),!!i&&(c=i.apply(this,[b,g,h]),this._updateVirtualBoundaries(b.shiftKey),(this._aspectRatio||b.shiftKey)&&(c=this._updateRatio(c,b)),c=this._respectSize(c,b),this._updateCache(c),this._propagate("resize",b),d=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),a.isEmptyObject(d)||(this._updatePrevProperties(),this._trigger("resize",b,this.ui()),this._applyChanges()),!1)},_mouseStop:function(b){this.resizing=!1;var c,d,e,f,g,h,i,j=this.options,k=this;return this._helper&&(c=this._proportionallyResizeElements,d=c.length&&/textarea/i.test(c[0].nodeName),e=d&&this._hasScroll(c[0],"left")?0:k.sizeDiff.height,f=d?0:k.sizeDiff.width,g={width:k.helper.width()-f,height:k.helper.height()-e},h=parseFloat(k.element.css("left"))+(k.position.left-k.originalPosition.left)||null,i=parseFloat(k.element.css("top"))+(k.position.top-k.originalPosition.top)||null,j.animate||this.element.css(a.extend(g,{top:i,left:h})),k.helper.height(k.size.height),k.helper.width(k.size.width),this._helper&&!j.animate&&this._proportionallyResize()),a("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",b),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var a={};return this.position.top!==this.prevPosition.top&&(a.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(a.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(a.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(a.height=this.size.height+"px"),this.helper.css(a),a},_updateVirtualBoundaries:function(a){var b,c,d,e,f,g=this.options;f={minWidth:this._isNumber(g.minWidth)?g.minWidth:0,maxWidth:this._isNumber(g.maxWidth)?g.maxWidth:1/0,minHeight:this._isNumber(g.minHeight)?g.minHeight:0,maxHeight:this._isNumber(g.maxHeight)?g.maxHeight:1/0},(this._aspectRatio||a)&&(b=f.minHeight*this.aspectRatio,d=f.minWidth/this.aspectRatio,c=f.maxHeight*this.aspectRatio,e=f.maxWidth/this.aspectRatio,b>f.minWidth&&(f.minWidth=b),d>f.minHeight&&(f.minHeight=d),c<f.maxWidth&&(f.maxWidth=c),e<f.maxHeight&&(f.maxHeight=e)),this._vBoundaries=f},_updateCache:function(a){this.offset=this.helper.offset(),this._isNumber(a.left)&&(this.position.left=a.left),this._isNumber(a.top)&&(this.position.top=a.top),this._isNumber(a.height)&&(this.size.height=a.height),this._isNumber(a.width)&&(this.size.width=a.width)},_updateRatio:function(a){var b=this.position,c=this.size,d=this.axis;return this._isNumber(a.height)?a.width=a.height*this.aspectRatio:this._isNumber(a.width)&&(a.height=a.width/this.aspectRatio),"sw"===d&&(a.left=b.left+(c.width-a.width),a.top=null),"nw"===d&&(a.top=b.top+(c.height-a.height),a.left=b.left+(c.width-a.width)),a},_respectSize:function(a){var b=this._vBoundaries,c=this.axis,d=this._isNumber(a.width)&&b.maxWidth&&b.maxWidth<a.width,e=this._isNumber(a.height)&&b.maxHeight&&b.maxHeight<a.height,f=this._isNumber(a.width)&&b.minWidth&&b.minWidth>a.width,g=this._isNumber(a.height)&&b.minHeight&&b.minHeight>a.height,h=this.originalPosition.left+this.originalSize.width,i=this.originalPosition.top+this.originalSize.height,j=/sw|nw|w/.test(c),k=/nw|ne|n/.test(c);return f&&(a.width=b.minWidth),g&&(a.height=b.minHeight),d&&(a.width=b.maxWidth),e&&(a.height=b.maxHeight),f&&j&&(a.left=h-b.minWidth),d&&j&&(a.left=h-b.maxWidth),g&&k&&(a.top=i-b.minHeight),e&&k&&(a.top=i-b.maxHeight),a.width||a.height||a.left||!a.top?a.width||a.height||a.top||!a.left||(a.left=null):a.top=null,a},_getPaddingPlusBorderDimensions:function(a){for(var b=0,c=[],d=[a.css("borderTopWidth"),a.css("borderRightWidth"),a.css("borderBottomWidth"),a.css("borderLeftWidth")],e=[a.css("paddingTop"),a.css("paddingRight"),a.css("paddingBottom"),a.css("paddingLeft")];b<4;b++)c[b]=parseFloat(d[b])||0,c[b]+=parseFloat(e[b])||0;return{height:c[0]+c[2],width:c[1]+c[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var a,b=0,c=this.helper||this.element;b<this._proportionallyResizeElements.length;b++)a=this._proportionallyResizeElements[b],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(a)),a.css({height:c.height()-this.outerDimensions.height||0,width:c.width()-this.outerDimensions.width||0})},_renderProxy:function(){var b=this.element,c=this.options;this.elementOffset=b.offset(),this._helper?(this.helper=this.helper||a("<div style='overflow:hidden;'></div>"),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++c.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(a,b){return{width:this.originalSize.width+b}},w:function(a,b){var c=this.originalSize,d=this.originalPosition;return{left:d.left+b,width:c.width-b}},n:function(a,b,c){var d=this.originalSize,e=this.originalPosition;return{top:e.top+c,height:d.height-c}},s:function(a,b,c){return{height:this.originalSize.height+c}},se:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},sw:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,c,d]))},ne:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},nw:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,c,d]))}},_propagate:function(b,c){a.ui.plugin.call(this,b,[c,this.ui()]),"resize"!==b&&this._trigger(b,c,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),a.ui.plugin.add("resizable","animate",{stop:function(b){var c=a(this).resizable("instance"),d=c.options,e=c._proportionallyResizeElements,f=e.length&&/textarea/i.test(e[0].nodeName),g=f&&c._hasScroll(e[0],"left")?0:c.sizeDiff.height,h=f?0:c.sizeDiff.width,i={width:c.size.width-h,height:c.size.height-g},j=parseFloat(c.element.css("left"))+(c.position.left-c.originalPosition.left)||null,k=parseFloat(c.element.css("top"))+(c.position.top-c.originalPosition.top)||null;c.element.animate(a.extend(i,k&&j?{top:k,left:j}:{}),{duration:d.animateDuration,easing:d.animateEasing,step:function(){var d={width:parseFloat(c.element.css("width")),height:parseFloat(c.element.css("height")),top:parseFloat(c.element.css("top")),left:parseFloat(c.element.css("left"))};e&&e.length&&a(e[0]).css({width:d.width,height:d.height}),c._updateCache(d),c._propagate("resize",b)}})}}),a.ui.plugin.add("resizable","containment",{start:function(){var b,c,d,e,f,g,h,i=a(this).resizable("instance"),j=i.options,k=i.element,l=j.containment,m=l instanceof a?l.get(0):/parent/.test(l)?k.parent().get(0):l;m&&(i.containerElement=a(m),/document/.test(l)||l===document?(i.containerOffset={left:0,top:0},i.containerPosition={left:0,top:0},i.parentData={element:a(document),left:0,top:0,width:a(document).width(),height:a(document).height()||document.body.parentNode.scrollHeight}):(b=a(m),c=[],a(["Top","Right","Left","Bottom"]).each(function(a,d){c[a]=i._num(b.css("padding"+d))}),i.containerOffset=b.offset(),i.containerPosition=b.position(),i.containerSize={height:b.innerHeight()-c[3],width:b.innerWidth()-c[1]},d=i.containerOffset,e=i.containerSize.height,f=i.containerSize.width,g=i._hasScroll(m,"left")?m.scrollWidth:f,h=i._hasScroll(m)?m.scrollHeight:e,i.parentData={element:m,left:d.left,top:d.top,width:g,height:h}))},resize:function(b){var c,d,e,f,g=a(this).resizable("instance"),h=g.options,i=g.containerOffset,j=g.position,k=g._aspectRatio||b.shiftKey,l={top:0,left:0},m=g.containerElement,n=!0;m[0]!==document&&/static/.test(m.css("position"))&&(l=i),j.left<(g._helper?i.left:0)&&(g.size.width=g.size.width+(g._helper?g.position.left-i.left:g.position.left-l.left),k&&(g.size.height=g.size.width/g.aspectRatio,n=!1),g.position.left=h.helper?i.left:0),j.top<(g._helper?i.top:0)&&(g.size.height=g.size.height+(g._helper?g.position.top-i.top:g.position.top),k&&(g.size.width=g.size.height*g.aspectRatio,n=!1),g.position.top=g._helper?i.top:0),e=g.containerElement.get(0)===g.element.parent().get(0),f=/relative|absolute/.test(g.containerElement.css("position")),e&&f?(g.offset.left=g.parentData.left+g.position.left,g.offset.top=g.parentData.top+g.position.top):(g.offset.left=g.element.offset().left,g.offset.top=g.element.offset().top),c=Math.abs(g.sizeDiff.width+(g._helper?g.offset.left-l.left:g.offset.left-i.left)),d=Math.abs(g.sizeDiff.height+(g._helper?g.offset.top-l.top:g.offset.top-i.top)),c+g.size.width>=g.parentData.width&&(g.size.width=g.parentData.width-c,k&&(g.size.height=g.size.width/g.aspectRatio,n=!1)),d+g.size.height>=g.parentData.height&&(g.size.height=g.parentData.height-d,k&&(g.size.width=g.size.height*g.aspectRatio,n=!1)),n||(g.position.left=g.prevPosition.left,g.position.top=g.prevPosition.top,g.size.width=g.prevSize.width,g.size.height=g.prevSize.height)},stop:function(){var b=a(this).resizable("instance"),c=b.options,d=b.containerOffset,e=b.containerPosition,f=b.containerElement,g=a(b.helper),h=g.offset(),i=g.outerWidth()-b.sizeDiff.width,j=g.outerHeight()-b.sizeDiff.height;b._helper&&!c.animate&&/relative/.test(f.css("position"))&&a(this).css({left:h.left-e.left-d.left,width:i,height:j}),b._helper&&!c.animate&&/static/.test(f.css("position"))&&a(this).css({left:h.left-e.left-d.left,width:i,height:j})}}),a.ui.plugin.add("resizable","alsoResize",{start:function(){var b=a(this).resizable("instance"),c=b.options;a(c.alsoResize).each(function(){var b=a(this);b.data("ui-resizable-alsoresize",{width:parseFloat(b.width()),height:parseFloat(b.height()),left:parseFloat(b.css("left")),top:parseFloat(b.css("top"))})})},resize:function(b,c){var d=a(this).resizable("instance"),e=d.options,f=d.originalSize,g=d.originalPosition,h={height:d.size.height-f.height||0,width:d.size.width-f.width||0,top:d.position.top-g.top||0,left:d.position.left-g.left||0};a(e.alsoResize).each(function(){var b=a(this),d=a(this).data("ui-resizable-alsoresize"),e={},f=b.parents(c.originalElement[0]).length?["width","height"]:["width","height","top","left"];a.each(f,function(a,b){var c=(d[b]||0)+(h[b]||0);c&&c>=0&&(e[b]=c||null)}),b.css(e)})},stop:function(){a(this).removeData("ui-resizable-alsoresize")}}),a.ui.plugin.add("resizable","ghost",{start:function(){var b=a(this).resizable("instance"),c=b.size;b.ghost=b.originalElement.clone(),b.ghost.css({opacity:.25,display:"block",position:"relative",height:c.height,width:c.width,margin:0,left:0,top:0}),b._addClass(b.ghost,"ui-resizable-ghost"),a.uiBackCompat!==!1&&"string"==typeof b.options.ghost&&b.ghost.addClass(this.options.ghost),b.ghost.appendTo(b.helper)},resize:function(){var b=a(this).resizable("instance");b.ghost&&b.ghost.css({position:"relative",height:b.size.height,width:b.size.width})},stop:function(){var b=a(this).resizable("instance");b.ghost&&b.helper&&b.helper.get(0).removeChild(b.ghost.get(0))}}),a.ui.plugin.add("resizable","grid",{resize:function(){var b,c=a(this).resizable("instance"),d=c.options,e=c.size,f=c.originalSize,g=c.originalPosition,h=c.axis,i="number"==typeof d.grid?[d.grid,d.grid]:d.grid,j=i[0]||1,k=i[1]||1,l=Math.round((e.width-f.width)/j)*j,m=Math.round((e.height-f.height)/k)*k,n=f.width+l,o=f.height+m,p=d.maxWidth&&d.maxWidth<n,q=d.maxHeight&&d.maxHeight<o,r=d.minWidth&&d.minWidth>n,s=d.minHeight&&d.minHeight>o;d.grid=i,r&&(n+=j),s&&(o+=k),p&&(n-=j),q&&(o-=k),/^(se|s|e)$/.test(h)?(c.size.width=n,c.size.height=o):/^(ne)$/.test(h)?(c.size.width=n,c.size.height=o,c.position.top=g.top-m):/^(sw)$/.test(h)?(c.size.width=n,c.size.height=o,c.position.left=g.left-l):((o-k<=0||n-j<=0)&&(b=c._getPaddingPlusBorderDimensions(this)),o-k>0?(c.size.height=o,c.position.top=g.top-m):(o=k-b.height,c.size.height=o,c.position.top=g.top+f.height-o),n-j>0?(c.size.width=n,c.position.left=g.left-l):(n=j-b.width,c.size.width=n,c.position.left=g.left+f.width-n))}}),a.ui.resizable});;
/*! jQuery UI - v1.12.1 - 2017-03-31
* http://jqueryui.com
* Copyright jQuery Foundation and other contributors; Licensed */
!function(a){"function"==typeof define&&define.amd?define(["jquery","./button","./draggable","./mouse","./resizable","../focusable","../keycode","../position","../safe-active-element","../safe-blur","../tabbable","../unique-id","../version","../widget"],a):a(jQuery)}(function(a){return a.widget("ui.dialog",{version:"1.12.1",options:{appendTo:"body",autoOpen:!0,buttons:[],classes:{"ui-dialog":"ui-corner-all","ui-dialog-titlebar":"ui-corner-all"},closeOnEscape:!0,closeText:"Close",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(b){var c=a(this).css(b).offset().top;c<0&&a(this).css("top",b.top-c)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),null==this.options.title&&null!=this.originalTitle&&(this.options.title=this.originalTitle),this.options.disabled&&(this.options.disabled=!1),this._createWrapper(),this.element.show().removeAttr("title").appendTo(this.uiDialog),this._addClass("ui-dialog-content","ui-widget-content"),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&a.fn.draggable&&this._makeDraggable(),this.options.resizable&&a.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var b=this.options.appendTo;return b&&(b.jquery||b.nodeType)?a(b):this.document.find(b||"body").eq(0)},_destroy:function(){var a,b=this.originalPosition;this._untrackInstance(),this._destroyOverlay(),this.element.removeUniqueId().css(this.originalCss).detach(),this.uiDialog.remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),a=b.parent.children().eq(b.index),a.length&&a[0]!==this.element[0]?a.before(this.element):b.parent.append(this.element)},widget:function(){return this.uiDialog},disable:a.noop,enable:a.noop,close:function(b){var c=this;this._isOpen&&this._trigger("beforeClose",b)!==!1&&(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),this.opener.filter(":focusable").trigger("focus").length||a.ui.safeBlur(a.ui.safeActiveElement(this.document[0])),this._hide(this.uiDialog,this.options.hide,function(){c._trigger("close",b)}))},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(b,c){var d=!1,e=this.uiDialog.siblings(".ui-front:visible").map(function(){return+a(this).css("z-index")}).get(),f=Math.max.apply(null,e);return f>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",f+1),d=!0),d&&!c&&this._trigger("focus",b),d},open:function(){var b=this;return this._isOpen?void(this._moveToTop()&&this._focusTabbable()):(this._isOpen=!0,this.opener=a(a.ui.safeActiveElement(this.document[0])),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,function(){b._focusTabbable(),b._trigger("focus")}),this._makeFocusTarget(),void this._trigger("open"))},_focusTabbable:function(){var a=this._focusedElement;a||(a=this.element.find("[autofocus]")),a.length||(a=this.element.find(":tabbable")),a.length||(a=this.uiDialogButtonPane.find(":tabbable")),a.length||(a=this.uiDialogTitlebarClose.filter(":tabbable")),a.length||(a=this.uiDialog),a.eq(0).trigger("focus")},_keepFocus:function(b){function c(){var b=a.ui.safeActiveElement(this.document[0]),c=this.uiDialog[0]===b||a.contains(this.uiDialog[0],b);c||this._focusTabbable()}b.preventDefault(),c.call(this),this._delay(c)},_createWrapper:function(){this.uiDialog=a("<div>").hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._addClass(this.uiDialog,"ui-dialog","ui-widget ui-widget-content ui-front"),this._on(this.uiDialog,{keydown:function(b){if(this.options.closeOnEscape&&!b.isDefaultPrevented()&&b.keyCode&&b.keyCode===a.ui.keyCode.ESCAPE)return b.preventDefault(),void this.close(b);if(b.keyCode===a.ui.keyCode.TAB&&!b.isDefaultPrevented()){var c=this.uiDialog.find(":tabbable"),d=c.filter(":first"),e=c.filter(":last");b.target!==e[0]&&b.target!==this.uiDialog[0]||b.shiftKey?b.target!==d[0]&&b.target!==this.uiDialog[0]||!b.shiftKey||(this._delay(function(){e.trigger("focus")}),b.preventDefault()):(this._delay(function(){d.trigger("focus")}),b.preventDefault())}},mousedown:function(a){this._moveToTop(a)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var b;this.uiDialogTitlebar=a("<div>"),this._addClass(this.uiDialogTitlebar,"ui-dialog-titlebar","ui-widget-header ui-helper-clearfix"),this._on(this.uiDialogTitlebar,{mousedown:function(b){a(b.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.trigger("focus")}}),this.uiDialogTitlebarClose=a("<button type='button'></button>").button({label:a("<a>").text(this.options.closeText).html(),icon:"ui-icon-closethick",showLabel:!1}).appendTo(this.uiDialogTitlebar),this._addClass(this.uiDialogTitlebarClose,"ui-dialog-titlebar-close"),this._on(this.uiDialogTitlebarClose,{click:function(a){a.preventDefault(),this.close(a)}}),b=a("<span>").uniqueId().prependTo(this.uiDialogTitlebar),this._addClass(b,"ui-dialog-title"),this._title(b),this.uiDialogTitlebar.prependTo(this.uiDialog),this.uiDialog.attr({"aria-labelledby":b.attr("id")})},_title:function(a){this.options.title?a.text(this.options.title):a.html(" ")},_createButtonPane:function(){this.uiDialogButtonPane=a("<div>"),this._addClass(this.uiDialogButtonPane,"ui-dialog-buttonpane","ui-widget-content ui-helper-clearfix"),this.uiButtonSet=a("<div>").appendTo(this.uiDialogButtonPane),this._addClass(this.uiButtonSet,"ui-dialog-buttonset"),this._createButtons()},_createButtons:function(){var b=this,c=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),a.isEmptyObject(c)||a.isArray(c)&&!c.length?void this._removeClass(this.uiDialog,"ui-dialog-buttons"):(a.each(c,function(c,d){var e,f;d=a.isFunction(d)?{click:d,text:c}:d,d=a.extend({type:"button"},d),e=d.click,f={icon:d.icon,iconPosition:d.iconPosition,showLabel:d.showLabel,icons:d.icons,text:d.text},delete d.click,delete d.icon,delete d.iconPosition,delete d.showLabel,delete d.icons,"boolean"==typeof d.text&&delete d.text,a("<button></button>",d).button(f).appendTo(b.uiButtonSet).on("click",function(){e.apply(b.element[0],arguments)})}),this._addClass(this.uiDialog,"ui-dialog-buttons"),void this.uiDialogButtonPane.appendTo(this.uiDialog))},_makeDraggable:function(){function b(a){return{position:a.position,offset:a.offset}}var c=this,d=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(d,e){c._addClass(a(this),"ui-dialog-dragging"),c._blockFrames(),c._trigger("dragStart",d,b(e))},drag:function(a,d){c._trigger("drag",a,b(d))},stop:function(e,f){var g=f.offset.left-c.document.scrollLeft(),h=f.offset.top-c.document.scrollTop();d.position={my:"left top",at:"left"+(g>=0?"+":"")+g+" top"+(h>=0?"+":"")+h,of:c.window},c._removeClass(a(this),"ui-dialog-dragging"),c._unblockFrames(),c._trigger("dragStop",e,b(f))}})},_makeResizable:function(){function b(a){return{originalPosition:a.originalPosition,originalSize:a.originalSize,position:a.position,size:a.size}}var c=this,d=this.options,e=d.resizable,f=this.uiDialog.css("position"),g="string"==typeof e?e:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:d.maxWidth,maxHeight:d.maxHeight,minWidth:d.minWidth,minHeight:this._minHeight(),handles:g,start:function(d,e){c._addClass(a(this),"ui-dialog-resizing"),c._blockFrames(),c._trigger("resizeStart",d,b(e))},resize:function(a,d){c._trigger("resize",a,b(d))},stop:function(e,f){var g=c.uiDialog.offset(),h=g.left-c.document.scrollLeft(),i=g.top-c.document.scrollTop();d.height=c.uiDialog.height(),d.width=c.uiDialog.width(),d.position={my:"left top",at:"left"+(h>=0?"+":"")+h+" top"+(i>=0?"+":"")+i,of:c.window},c._removeClass(a(this),"ui-dialog-resizing"),c._unblockFrames(),c._trigger("resizeStop",e,b(f))}}).css("position",f)},_trackFocus:function(){this._on(this.widget(),{focusin:function(b){this._makeFocusTarget(),this._focusedElement=a(b.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var b=this._trackingInstances(),c=a.inArray(this,b);c!==-1&&b.splice(c,1)},_trackingInstances:function(){var a=this.document.data("ui-dialog-instances");return a||(a=[],this.document.data("ui-dialog-instances",a)),a},_minHeight:function(){var a=this.options;return"auto"===a.height?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(){var a=this.uiDialog.is(":visible");a||this.uiDialog.show(),this.uiDialog.position(this.options.position),a||this.uiDialog.hide()},_setOptions:function(b){var c=this,d=!1,e={};a.each(b,function(a,b){c._setOption(a,b),a in c.sizeRelatedOptions&&(d=!0),a in c.resizableRelatedOptions&&(e[a]=b)}),d&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",e)},_setOption:function(b,c){var d,e,f=this.uiDialog;"disabled"!==b&&(this._super(b,c),"appendTo"===b&&this.uiDialog.appendTo(this._appendTo()),"buttons"===b&&this._createButtons(),"closeText"===b&&this.uiDialogTitlebarClose.button({label:a("<a>").text(""+this.options.closeText).html()}),"draggable"===b&&(d=f.is(":data(ui-draggable)"),d&&!c&&f.draggable("destroy"),!d&&c&&this._makeDraggable()),"position"===b&&this._position(),"resizable"===b&&(e=f.is(":data(ui-resizable)"),e&&!c&&f.resizable("destroy"),e&&"string"==typeof c&&f.resizable("option","handles",c),e||c===!1||this._makeResizable()),"title"===b&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var a,b,c,d=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),d.minWidth>d.width&&(d.width=d.minWidth),a=this.uiDialog.css({height:"auto",width:d.width}).outerHeight(),b=Math.max(0,d.minHeight-a),c="number"==typeof d.maxHeight?Math.max(0,d.maxHeight-a):"none","auto"===d.height?this.element.css({minHeight:b,maxHeight:c,height:"auto"}):this.element.height(Math.max(0,d.height-a)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var b=a(this);return a("<div>").css({position:"absolute",width:b.outerWidth(),height:b.outerHeight()}).appendTo(b.parent()).offset(b.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(b){return!!a(b.target).closest(".ui-dialog").length||!!a(b.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var b=!0;this._delay(function(){b=!1}),this.document.data("ui-dialog-overlays")||this._on(this.document,{focusin:function(a){b||this._allowInteraction(a)||(a.preventDefault(),this._trackingInstances()[0]._focusTabbable())}}),this.overlay=a("<div>").appendTo(this._appendTo()),this._addClass(this.overlay,null,"ui-widget-overlay ui-front"),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1)}},_destroyOverlay:function(){if(this.options.modal&&this.overlay){var a=this.document.data("ui-dialog-overlays")-1;a?this.document.data("ui-dialog-overlays",a):(this._off(this.document,"focusin"),this.document.removeData("ui-dialog-overlays")),this.overlay.remove(),this.overlay=null}}}),a.uiBackCompat!==!1&&a.widget("ui.dialog",a.ui.dialog,{options:{dialogClass:""},_createWrapper:function(){this._super(),this.uiDialog.addClass(this.options.dialogClass)},_setOption:function(a,b){"dialogClass"===a&&this.uiDialog.removeClass(this.options.dialogClass).addClass(b),this._superApply(arguments)}}),a.ui.dialog});;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function ($, Drupal, drupalSettings) {
drupalSettings.dialog = {
autoOpen: true,
dialogClass: '',
buttonClass: 'button',
buttonPrimaryClass: 'button--primary',
close: function close(event) {
Drupal.dialog(event.target).close();
Drupal.detachBehaviors(event.target, null, 'unload');
}
};
Drupal.dialog = function (element, options) {
var undef = void 0;
var $element = $(element);
var dialog = {
open: false,
returnValue: undef
};
function openDialog(settings) {
settings = $.extend({}, drupalSettings.dialog, options, settings);
$(window).trigger('dialog:beforecreate', [dialog, $element, settings]);
$element.dialog(settings);
dialog.open = true;
$(window).trigger('dialog:aftercreate', [dialog, $element, settings]);
}
function closeDialog(value) {
$(window).trigger('dialog:beforeclose', [dialog, $element]);
$element.dialog('close');
dialog.returnValue = value;
dialog.open = false;
$(window).trigger('dialog:afterclose', [dialog, $element]);
}
dialog.show = function () {
openDialog({ modal: false });
};
dialog.showModal = function () {
openDialog({ modal: true });
};
dialog.close = closeDialog;
return dialog;
};
})(jQuery, Drupal, drupalSettings);;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function ($, Drupal, drupalSettings, debounce, displace) {
drupalSettings.dialog = $.extend({ autoResize: true, maxHeight: '95%' }, drupalSettings.dialog);
function resetPosition(options) {
var offsets = displace.offsets;
var left = offsets.left - offsets.right;
var top = offsets.top - offsets.bottom;
var leftString = (left > 0 ? '+' : '-') + Math.abs(Math.round(left / 2)) + 'px';
var topString = (top > 0 ? '+' : '-') + Math.abs(Math.round(top / 2)) + 'px';
options.position = {
my: 'center' + (left !== 0 ? leftString : '') + ' center' + (top !== 0 ? topString : ''),
of: window
};
return options;
}
function resetSize(event) {
var positionOptions = ['width', 'height', 'minWidth', 'minHeight', 'maxHeight', 'maxWidth', 'position'];
var adjustedOptions = {};
var windowHeight = $(window).height();
var option = void 0;
var optionValue = void 0;
var adjustedValue = void 0;
for (var n = 0; n < positionOptions.length; n++) {
option = positionOptions[n];
optionValue = event.data.settings[option];
if (optionValue) {
if (typeof optionValue === 'string' && /%$/.test(optionValue) && /height/i.test(option)) {
windowHeight -= displace.offsets.top + displace.offsets.bottom;
adjustedValue = parseInt(0.01 * parseInt(optionValue, 10) * windowHeight, 10);
if (option === 'height' && event.data.$element.parent().outerHeight() < adjustedValue) {
adjustedValue = 'auto';
}
adjustedOptions[option] = adjustedValue;
}
}
}
if (!event.data.settings.modal) {
adjustedOptions = resetPosition(adjustedOptions);
}
event.data.$element.dialog('option', adjustedOptions).trigger('dialogContentResize');
}
$(window).on({
'dialog:aftercreate': function dialogAftercreate(event, dialog, $element, settings) {
var autoResize = debounce(resetSize, 20);
var eventData = { settings: settings, $element: $element };
if (settings.autoResize === true || settings.autoResize === 'true') {
$element.dialog('option', { resizable: false, draggable: false }).dialog('widget').css('position', 'fixed');
$(window).on('resize.dialogResize scroll.dialogResize', eventData, autoResize).trigger('resize.dialogResize');
$(document).on('drupalViewportOffsetChange.dialogResize', eventData, autoResize);
}
},
'dialog:beforeclose': function dialogBeforeclose(event, dialog, $element) {
$(window).off('.dialogResize');
$(document).off('.dialogResize');
}
});
})(jQuery, Drupal, drupalSettings, Drupal.debounce, Drupal.displace);;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function ($) {
$.widget('ui.dialog', $.ui.dialog, {
options: {
buttonClass: 'button',
buttonPrimaryClass: 'button--primary'
},
_createButtons: function _createButtons() {
var opts = this.options;
var primaryIndex = void 0;
var index = void 0;
var il = opts.buttons.length;
for (index = 0; index < il; index++) {
if (opts.buttons[index].primary && opts.buttons[index].primary === true) {
primaryIndex = index;
delete opts.buttons[index].primary;
break;
}
}
this._super();
var $buttons = this.uiButtonSet.children().addClass(opts.buttonClass);
if (typeof primaryIndex !== 'undefined') {
$buttons.eq(index).addClass(opts.buttonPrimaryClass);
}
}
});
})(jQuery);;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function ($, _, Backbone, Drupal, drupalSettings, JSON, storage) {
var options = $.extend(drupalSettings.quickedit, {
strings: {
quickEdit: Drupal.t('Quick edit')
}
});
var fieldsMetadataQueue = [];
var fieldsAvailableQueue = [];
var contextualLinksQueue = [];
var entityInstancesTracker = {};
function initQuickEdit(bodyElement) {
Drupal.quickedit.collections.entities = new Drupal.quickedit.EntityCollection();
Drupal.quickedit.collections.fields = new Drupal.quickedit.FieldCollection();
Drupal.quickedit.app = new Drupal.quickedit.AppView({
el: bodyElement,
model: new Drupal.quickedit.AppModel(),
entitiesCollection: Drupal.quickedit.collections.entities,
fieldsCollection: Drupal.quickedit.collections.fields
});
}
function processEntity(entityElement) {
var entityID = entityElement.getAttribute('data-quickedit-entity-id');
if (!entityInstancesTracker.hasOwnProperty(entityID)) {
entityInstancesTracker[entityID] = 0;
} else {
entityInstancesTracker[entityID]++;
}
var entityInstanceID = entityInstancesTracker[entityID];
entityElement.setAttribute('data-quickedit-entity-instance-id', entityInstanceID);
}
function initializeField(fieldElement, fieldID, entityID, entityInstanceID) {
var entity = Drupal.quickedit.collections.entities.findWhere({
entityID: entityID,
entityInstanceID: entityInstanceID
});
$(fieldElement).addClass('quickedit-field');
var field = new Drupal.quickedit.FieldModel({
el: fieldElement,
fieldID: fieldID,
id: fieldID + '[' + entity.get('entityInstanceID') + ']',
entity: entity,
metadata: Drupal.quickedit.metadata.get(fieldID),
acceptStateChange: _.bind(Drupal.quickedit.app.acceptEditorStateChange, Drupal.quickedit.app)
});
Drupal.quickedit.collections.fields.add(field);
}
function loadMissingEditors(callback) {
var loadedEditors = _.keys(Drupal.quickedit.editors);
var missingEditors = [];
Drupal.quickedit.collections.fields.each(function (fieldModel) {
var metadata = Drupal.quickedit.metadata.get(fieldModel.get('fieldID'));
if (metadata.access && _.indexOf(loadedEditors, metadata.editor) === -1) {
missingEditors.push(metadata.editor);
Drupal.quickedit.editors[metadata.editor] = false;
}
});
missingEditors = _.uniq(missingEditors);
if (missingEditors.length === 0) {
callback();
return;
}
var loadEditorsAjax = Drupal.ajax({
url: Drupal.url('quickedit/attachments'),
submit: { 'editors[]': missingEditors }
});
var realInsert = Drupal.AjaxCommands.prototype.insert;
loadEditorsAjax.commands.insert = function (ajax, response, status) {
_.defer(callback);
realInsert(ajax, response, status);
};
loadEditorsAjax.execute();
}
function initializeEntityContextualLink(contextualLink) {
var metadata = Drupal.quickedit.metadata;
function hasFieldWithPermission(fieldIDs) {
for (var i = 0; i < fieldIDs.length; i++) {
var fieldID = fieldIDs[i];
if (metadata.get(fieldID, 'access') === true) {
return true;
}
}
return false;
}
function allMetadataExists(fieldIDs) {
return fieldIDs.length === metadata.intersection(fieldIDs).length;
}
var fields = _.where(fieldsAvailableQueue, {
entityID: contextualLink.entityID,
entityInstanceID: contextualLink.entityInstanceID
});
var fieldIDs = _.pluck(fields, 'fieldID');
if (fieldIDs.length === 0) {
return false;
}
if (hasFieldWithPermission(fieldIDs)) {
var entityModel = new Drupal.quickedit.EntityModel({
el: contextualLink.region,
entityID: contextualLink.entityID,
entityInstanceID: contextualLink.entityInstanceID,
id: contextualLink.entityID + '[' + contextualLink.entityInstanceID + ']',
label: Drupal.quickedit.metadata.get(contextualLink.entityID, 'label')
});
Drupal.quickedit.collections.entities.add(entityModel);
var entityDecorationView = new Drupal.quickedit.EntityDecorationView({
el: contextualLink.region,
model: entityModel
});
entityModel.set('entityDecorationView', entityDecorationView);
_.each(fields, function (field) {
initializeField(field.el, field.fieldID, contextualLink.entityID, contextualLink.entityInstanceID);
});
fieldsAvailableQueue = _.difference(fieldsAvailableQueue, fields);
var initContextualLink = _.once(function () {
var $links = $(contextualLink.el).find('.contextual-links');
var contextualLinkView = new Drupal.quickedit.ContextualLinkView($.extend({
el: $('<li class="quickedit"><a href="" role="button" aria-pressed="false"></a></li>').prependTo($links),
model: entityModel,
appModel: Drupal.quickedit.app.model
}, options));
entityModel.set('contextualLinkView', contextualLinkView);
});
loadMissingEditors(initContextualLink);
return true;
}
if (allMetadataExists(fieldIDs)) {
return true;
}
return false;
}
function extractEntityID(fieldID) {
return fieldID.split('/').slice(0, 2).join('/');
}
function processField(fieldElement) {
var metadata = Drupal.quickedit.metadata;
var fieldID = fieldElement.getAttribute('data-quickedit-field-id');
var entityID = extractEntityID(fieldID);
var entityElementSelector = '[data-quickedit-entity-id="' + entityID + '"]';
var $entityElement = $(entityElementSelector);
if (!$entityElement.length) {
throw new Error('Quick Edit could not associate the rendered entity field markup (with [data-quickedit-field-id="' + fieldID + '"]) with the corresponding rendered entity markup: no parent DOM node found with [data-quickedit-entity-id="' + entityID + '"]. This is typically caused by the theme\'s template for this entity type forgetting to print the attributes.');
}
var entityElement = $(fieldElement).closest($entityElement);
if (entityElement.length === 0) {
var $lowestCommonParent = $entityElement.parents().has(fieldElement).first();
entityElement = $lowestCommonParent.find($entityElement);
}
var entityInstanceID = entityElement.get(0).getAttribute('data-quickedit-entity-instance-id');
if (!metadata.has(fieldID)) {
fieldsMetadataQueue.push({
el: fieldElement,
fieldID: fieldID,
entityID: entityID,
entityInstanceID: entityInstanceID
});
return;
}
if (metadata.get(fieldID, 'access') !== true) {
return;
}
if (Drupal.quickedit.collections.entities.findWhere({
entityID: entityID,
entityInstanceID: entityInstanceID
})) {
initializeField(fieldElement, fieldID, entityID, entityInstanceID);
} else {
fieldsAvailableQueue.push({
el: fieldElement,
fieldID: fieldID,
entityID: entityID,
entityInstanceID: entityInstanceID
});
}
}
function deleteContainedModelsAndQueues($context) {
$context.find('[data-quickedit-entity-id]').addBack('[data-quickedit-entity-id]').each(function (index, entityElement) {
var entityModel = Drupal.quickedit.collections.entities.findWhere({
el: entityElement
});
if (entityModel) {
var contextualLinkView = entityModel.get('contextualLinkView');
contextualLinkView.undelegateEvents();
contextualLinkView.remove();
entityModel.get('entityDecorationView').remove();
entityModel.destroy();
}
function hasOtherRegion(contextualLink) {
return contextualLink.region !== entityElement;
}
contextualLinksQueue = _.filter(contextualLinksQueue, hasOtherRegion);
});
$context.find('[data-quickedit-field-id]').addBack('[data-quickedit-field-id]').each(function (index, fieldElement) {
Drupal.quickedit.collections.fields.chain().filter(function (fieldModel) {
return fieldModel.get('el') === fieldElement;
}).invoke('destroy');
function hasOtherFieldElement(field) {
return field.el !== fieldElement;
}
fieldsMetadataQueue = _.filter(fieldsMetadataQueue, hasOtherFieldElement);
fieldsAvailableQueue = _.filter(fieldsAvailableQueue, hasOtherFieldElement);
});
}
function fetchMissingMetadata(callback) {
if (fieldsMetadataQueue.length) {
var fieldIDs = _.pluck(fieldsMetadataQueue, 'fieldID');
var fieldElementsWithoutMetadata = _.pluck(fieldsMetadataQueue, 'el');
var entityIDs = _.uniq(_.pluck(fieldsMetadataQueue, 'entityID'), true);
entityIDs = _.difference(entityIDs, Drupal.quickedit.metadata.intersection(entityIDs));
fieldsMetadataQueue = [];
$.ajax({
url: Drupal.url('quickedit/metadata'),
type: 'POST',
data: {
'fields[]': fieldIDs,
'entities[]': entityIDs
},
dataType: 'json',
success: function success(results) {
_.each(results, function (fieldMetadata, fieldID) {
Drupal.quickedit.metadata.add(fieldID, fieldMetadata);
});
callback(fieldElementsWithoutMetadata);
}
});
}
}
Drupal.behaviors.quickedit = {
attach: function attach(context) {
$('body').once('quickedit-init').each(initQuickEdit);
var $fields = $(context).find('[data-quickedit-field-id]').once('quickedit');
if ($fields.length === 0) {
return;
}
$(context).find('[data-quickedit-entity-id]').once('quickedit').each(function (index, entityElement) {
processEntity(entityElement);
});
$fields.each(function (index, fieldElement) {
processField(fieldElement);
});
contextualLinksQueue = _.filter(contextualLinksQueue, function (contextualLink) {
return !initializeEntityContextualLink(contextualLink);
});
fetchMissingMetadata(function (fieldElementsWithFreshMetadata) {
_.each(fieldElementsWithFreshMetadata, processField);
contextualLinksQueue = _.filter(contextualLinksQueue, function (contextualLink) {
return !initializeEntityContextualLink(contextualLink);
});
});
},
detach: function detach(context, settings, trigger) {
if (trigger === 'unload') {
deleteContainedModelsAndQueues($(context));
}
}
};
Drupal.quickedit = {
app: null,
collections: {
entities: null,
fields: null
},
editors: {},
metadata: {
has: function has(fieldID) {
return storage.getItem(this._prefixFieldID(fieldID)) !== null;
},
add: function add(fieldID, metadata) {
storage.setItem(this._prefixFieldID(fieldID), JSON.stringify(metadata));
},
get: function get(fieldID, key) {
var metadata = JSON.parse(storage.getItem(this._prefixFieldID(fieldID)));
return typeof key === 'undefined' ? metadata : metadata[key];
},
_prefixFieldID: function _prefixFieldID(fieldID) {
return 'Drupal.quickedit.metadata.' + fieldID;
},
_unprefixFieldID: function _unprefixFieldID(fieldID) {
return fieldID.substring(26);
},
intersection: function intersection(fieldIDs) {
var prefixedFieldIDs = _.map(fieldIDs, this._prefixFieldID);
var intersection = _.intersection(prefixedFieldIDs, _.keys(sessionStorage));
return _.map(intersection, this._unprefixFieldID);
}
}
};
var permissionsHashKey = Drupal.quickedit.metadata._prefixFieldID('permissionsHash');
var permissionsHashValue = storage.getItem(permissionsHashKey);
var permissionsHash = drupalSettings.user.permissionsHash;
if (permissionsHashValue !== permissionsHash) {
if (typeof permissionsHash === 'string') {
_.chain(storage).keys().each(function (key) {
if (key.substring(0, 26) === 'Drupal.quickedit.metadata.') {
storage.removeItem(key);
}
});
}
storage.setItem(permissionsHashKey, permissionsHash);
}
$(document).on('drupalContextualLinkAdded', function (event, data) {
if (data.$region.is('[data-quickedit-entity-id]')) {
if (!data.$region.is('[data-quickedit-entity-instance-id]')) {
data.$region.once('quickedit');
processEntity(data.$region.get(0));
}
var contextualLink = {
entityID: data.$region.attr('data-quickedit-entity-id'),
entityInstanceID: data.$region.attr('data-quickedit-entity-instance-id'),
el: data.$el[0],
region: data.$region[0]
};
if (!initializeEntityContextualLink(contextualLink)) {
contextualLinksQueue.push(contextualLink);
}
}
});
})(jQuery, _, Backbone, Drupal, drupalSettings, window.JSON, window.sessionStorage);;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function ($, Drupal) {
Drupal.quickedit.util = Drupal.quickedit.util || {};
Drupal.quickedit.util.constants = {};
Drupal.quickedit.util.constants.transitionEnd = 'transitionEnd.quickedit webkitTransitionEnd.quickedit transitionend.quickedit msTransitionEnd.quickedit oTransitionEnd.quickedit';
Drupal.quickedit.util.buildUrl = function (id, urlFormat) {
var parts = id.split('/');
return Drupal.formatString(decodeURIComponent(urlFormat), {
'!entity_type': parts[0],
'!id': parts[1],
'!field_name': parts[2],
'!langcode': parts[3],
'!view_mode': parts[4]
});
};
Drupal.quickedit.util.networkErrorModal = function (title, message) {
var $message = $('<div>' + message + '</div>');
var networkErrorModal = Drupal.dialog($message.get(0), {
title: title,
dialogClass: 'quickedit-network-error',
buttons: [{
text: Drupal.t('OK'),
click: function click() {
networkErrorModal.close();
},
primary: true
}],
create: function create() {
$(this).parent().find('.ui-dialog-titlebar-close').remove();
},
close: function close(event) {
$(event.target).remove();
}
});
networkErrorModal.showModal();
};
Drupal.quickedit.util.form = {
load: function load(options, callback) {
var fieldID = options.fieldID;
var formLoaderAjax = Drupal.ajax({
url: Drupal.quickedit.util.buildUrl(fieldID, Drupal.url('quickedit/form/!entity_type/!id/!field_name/!langcode/!view_mode')),
submit: {
nocssjs: options.nocssjs,
reset: options.reset
},
error: function error(xhr, url) {
var fieldLabel = Drupal.quickedit.metadata.get(fieldID, 'label');
var message = Drupal.t('Could not load the form for <q>@field-label</q>, either due to a website problem or a network connection problem.<br>Please try again.', { '@field-label': fieldLabel });
Drupal.quickedit.util.networkErrorModal(Drupal.t('Network problem!'), message);
var fieldModel = Drupal.quickedit.app.model.get('activeField');
fieldModel.set('state', 'candidate');
}
});
formLoaderAjax.commands.quickeditFieldForm = function (ajax, response, status) {
callback(response.data, ajax);
Drupal.ajax.instances[this.instanceIndex] = null;
};
formLoaderAjax.execute();
},
ajaxifySaving: function ajaxifySaving(options, $submit) {
var settings = {
url: $submit.closest('form').attr('action'),
setClick: true,
event: 'click.quickedit',
progress: false,
submit: {
nocssjs: options.nocssjs,
other_view_modes: options.other_view_modes
},
success: function success(response, status) {
var _this = this;
Object.keys(response || {}).forEach(function (i) {
if (response[i].command && _this.commands[response[i].command]) {
_this.commands[response[i].command](_this, response[i], status);
}
});
},
base: $submit.attr('id'),
element: $submit[0]
};
return Drupal.ajax(settings);
},
unajaxifySaving: function unajaxifySaving(ajax) {
$(ajax.element).off('click.quickedit');
}
};
})(jQuery, Drupal);;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
(function (Drupal, Backbone) {
Drupal.quickedit.BaseModel = Backbone.Model.extend({
initialize: function initialize(options) {
this.__initialized = true;
return Backbone.Model.prototype.initialize.call(this, options);
},
set: function set(key, val, options) {
if (this.__initialized) {
if ((typeof key === 'undefined' ? 'undefined' : _typeof(key)) === 'object') {
key.validate = true;
} else {
if (!options) {
options = {};
}
options.validate = true;
}
}
return Backbone.Model.prototype.set.call(this, key, val, options);
}
});
})(Drupal, Backbone);;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function (Backbone, Drupal) {
Drupal.quickedit.AppModel = Backbone.Model.extend({
defaults: {
highlightedField: null,
activeField: null,
activeModal: null
}
});
})(Backbone, Drupal);;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function (_, $, Backbone, Drupal) {
Drupal.quickedit.EntityModel = Drupal.quickedit.BaseModel.extend({
defaults: {
el: null,
entityID: null,
entityInstanceID: null,
id: null,
label: null,
fields: null,
isActive: false,
inTempStore: false,
isDirty: false,
isCommitting: false,
state: 'closed',
fieldsInTempStore: [],
reload: false
},
initialize: function initialize() {
this.set('fields', new Drupal.quickedit.FieldCollection());
this.listenTo(this, 'change:state', this.stateChange);
this.listenTo(this.get('fields'), 'change:state', this.fieldStateChange);
Drupal.quickedit.BaseModel.prototype.initialize.call(this);
},
stateChange: function stateChange(entityModel, state, options) {
var to = state;
switch (to) {
case 'closed':
this.set({
isActive: false,
inTempStore: false,
isDirty: false
});
break;
case 'launching':
break;
case 'opening':
entityModel.get('fields').each(function (fieldModel) {
fieldModel.set('state', 'candidate', options);
});
break;
case 'opened':
this.set('isActive', true);
break;
case 'committing':
{
var fields = this.get('fields');
fields.chain().filter(function (fieldModel) {
return _.intersection([fieldModel.get('state')], ['active']).length;
}).each(function (fieldModel) {
fieldModel.set('state', 'candidate');
});
fields.chain().filter(function (fieldModel) {
return _.intersection([fieldModel.get('state')], Drupal.quickedit.app.changedFieldStates).length;
}).each(function (fieldModel) {
fieldModel.set('state', 'saving');
});
break;
}
case 'deactivating':
{
var changedFields = this.get('fields').filter(function (fieldModel) {
return _.intersection([fieldModel.get('state')], ['changed', 'invalid']).length;
});
if ((changedFields.length || this.get('fieldsInTempStore').length) && !options.saved && !options.confirmed) {
this.set('state', 'opened', { confirming: true });
_.defer(function () {
Drupal.quickedit.app.confirmEntityDeactivation(entityModel);
});
} else {
var invalidFields = this.get('fields').filter(function (fieldModel) {
return _.intersection([fieldModel.get('state')], ['invalid']).length;
});
entityModel.set('reload', this.get('fieldsInTempStore').length || invalidFields.length);
entityModel.get('fields').each(function (fieldModel) {
if (_.intersection([fieldModel.get('state')], ['candidate', 'highlighted']).length) {
fieldModel.trigger('change:state', fieldModel, fieldModel.get('state'), options);
} else {
fieldModel.set('state', 'candidate', options);
}
});
}
break;
}
case 'closing':
options.reason = 'stop';
this.get('fields').each(function (fieldModel) {
fieldModel.set({
inTempStore: false,
state: 'inactive'
}, options);
});
break;
}
},
_updateInTempStoreAttributes: function _updateInTempStoreAttributes(entityModel, fieldModel) {
var current = fieldModel.get('state');
var previous = fieldModel.previous('state');
var fieldsInTempStore = entityModel.get('fieldsInTempStore');
if (current === 'saved') {
entityModel.set('inTempStore', true);
fieldModel.set('inTempStore', true);
fieldsInTempStore.push(fieldModel.get('fieldID'));
fieldsInTempStore = _.uniq(fieldsInTempStore);
entityModel.set('fieldsInTempStore', fieldsInTempStore);
} else if (current === 'candidate' && previous === 'inactive') {
fieldModel.set('inTempStore', _.intersection([fieldModel.get('fieldID')], fieldsInTempStore).length > 0);
}
},
fieldStateChange: function fieldStateChange(fieldModel, state) {
var entityModel = this;
var fieldState = state;
switch (this.get('state')) {
case 'closed':
case 'launching':
break;
case 'opening':
_.defer(function () {
entityModel.set('state', 'opened', {
'accept-field-states': Drupal.quickedit.app.readyFieldStates
});
});
break;
case 'opened':
if (fieldState === 'changed') {
entityModel.set('isDirty', true);
} else {
this._updateInTempStoreAttributes(entityModel, fieldModel);
}
break;
case 'committing':
{
if (fieldState === 'invalid') {
_.defer(function () {
entityModel.set('state', 'opened', { reason: 'invalid' });
});
} else {
this._updateInTempStoreAttributes(entityModel, fieldModel);
}
var options = {
'accept-field-states': Drupal.quickedit.app.readyFieldStates
};
if (entityModel.set('isCommitting', true, options)) {
entityModel.save({
success: function success() {
entityModel.set({
state: 'deactivating',
isCommitting: false
}, { saved: true });
},
error: function error() {
entityModel.set('isCommitting', false);
entityModel.set('state', 'opened', {
reason: 'networkerror'
});
var message = Drupal.t('Your changes to <q>@entity-title</q> could not be saved, either due to a website problem or a network connection problem.<br>Please try again.', { '@entity-title': entityModel.get('label') });
Drupal.quickedit.util.networkErrorModal(Drupal.t('Network problem!'), message);
}
});
}
break;
}
case 'deactivating':
_.defer(function () {
entityModel.set('state', 'closing', {
'accept-field-states': Drupal.quickedit.app.readyFieldStates
});
});
break;
case 'closing':
_.defer(function () {
entityModel.set('state', 'closed', {
'accept-field-states': ['inactive']
});
});
break;
}
},
save: function save(options) {
var entityModel = this;
var entitySaverAjax = Drupal.ajax({
url: Drupal.url('quickedit/entity/' + entityModel.get('entityID')),
error: function error() {
options.error.call(entityModel);
}
});
entitySaverAjax.commands.quickeditEntitySaved = function (ajax, response, status) {
entityModel.get('fields').each(function (fieldModel) {
fieldModel.set('inTempStore', false);
});
entityModel.set('inTempStore', false);
entityModel.set('fieldsInTempStore', []);
if (options.success) {
options.success.call(entityModel);
}
};
entitySaverAjax.execute();
},
validate: function validate(attrs, options) {
var acceptedFieldStates = options['accept-field-states'] || [];
var currentState = this.get('state');
var nextState = attrs.state;
if (currentState !== nextState) {
if (_.indexOf(this.constructor.states, nextState) === -1) {
return '"' + nextState + '" is an invalid state';
}
if (!this._acceptStateChange(currentState, nextState, options)) {
return 'state change not accepted';
}
if (!this._fieldsHaveAcceptableStates(acceptedFieldStates)) {
return 'state change not accepted because fields are not in acceptable state';
}
}
var currentIsCommitting = this.get('isCommitting');
var nextIsCommitting = attrs.isCommitting;
if (currentIsCommitting === false && nextIsCommitting === true) {
if (!this._fieldsHaveAcceptableStates(acceptedFieldStates)) {
return 'isCommitting change not accepted because fields are not in acceptable state';
}
} else if (currentIsCommitting === true && nextIsCommitting === true) {
return 'isCommitting is a mutex, hence only changes are allowed';
}
},
_acceptStateChange: function _acceptStateChange(from, to, context) {
var accept = true;
if (!this.constructor.followsStateSequence(from, to)) {
accept = false;
if (from === 'closing' && to === 'closed') {
accept = true;
} else if (from === 'committing' && to === 'opened' && context.reason && (context.reason === 'invalid' || context.reason === 'networkerror')) {
accept = true;
} else if (from === 'deactivating' && to === 'opened' && context.confirming) {
accept = true;
} else if (from === 'opened' && to === 'deactivating' && context.confirmed) {
accept = true;
}
}
return accept;
},
_fieldsHaveAcceptableStates: function _fieldsHaveAcceptableStates(acceptedFieldStates) {
var accept = true;
if (acceptedFieldStates.length > 0) {
var fieldStates = this.get('fields').pluck('state') || [];
if (_.difference(fieldStates, acceptedFieldStates).length) {
accept = false;
}
}
return accept;
},
destroy: function destroy(options) {
Drupal.quickedit.BaseModel.prototype.destroy.call(this, options);
this.stopListening();
this.get('fields').reset();
},
sync: function sync() {}
}, {
states: ['closed', 'launching', 'opening', 'opened', 'committing', 'deactivating', 'closing'],
followsStateSequence: function followsStateSequence(from, to) {
return _.indexOf(this.states, from) < _.indexOf(this.states, to);
}
});
Drupal.quickedit.EntityCollection = Backbone.Collection.extend({
model: Drupal.quickedit.EntityModel
});
})(_, jQuery, Backbone, Drupal);;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function (_, Backbone, Drupal) {
Drupal.quickedit.FieldModel = Drupal.quickedit.BaseModel.extend({
defaults: {
el: null,
fieldID: null,
id: null,
entity: null,
metadata: null,
acceptStateChange: null,
logicalFieldID: null,
state: 'inactive',
isChanged: false,
inTempStore: false,
html: null,
htmlForOtherViewModes: null
},
initialize: function initialize(options) {
this.set('html', options.el.outerHTML);
this.get('entity').get('fields').add(this);
this.set('logicalFieldID', this.get('fieldID').split('/').slice(0, 4).join('/'));
Drupal.quickedit.BaseModel.prototype.initialize.call(this, options);
},
destroy: function destroy(options) {
if (this.get('state') !== 'inactive') {
throw new Error('FieldModel cannot be destroyed if it is not inactive state.');
}
Drupal.quickedit.BaseModel.prototype.destroy.call(this, options);
},
sync: function sync() {},
validate: function validate(attrs, options) {
var current = this.get('state');
var next = attrs.state;
if (current !== next) {
if (_.indexOf(this.constructor.states, next) === -1) {
return '"' + next + '" is an invalid state';
}
if (!this.get('acceptStateChange')(current, next, options, this)) {
return 'state change not accepted';
}
}
},
getEntityID: function getEntityID() {
return this.get('fieldID').split('/').slice(0, 2).join('/');
},
getViewMode: function getViewMode() {
return this.get('fieldID').split('/').pop();
},
findOtherViewModes: function findOtherViewModes() {
var currentField = this;
var otherViewModes = [];
Drupal.quickedit.collections.fields.where({ logicalFieldID: currentField.get('logicalFieldID') }).forEach(function (field) {
if (field !== currentField && field.get('fieldID') !== currentField.get('fieldID')) {
otherViewModes.push(field.getViewMode());
}
});
return otherViewModes;
}
}, {
states: ['inactive', 'candidate', 'highlighted', 'activating', 'active', 'changed', 'saving', 'saved', 'invalid'],
followsStateSequence: function followsStateSequence(from, to) {
return _.indexOf(this.states, from) < _.indexOf(this.states, to);
}
});
Drupal.quickedit.FieldCollection = Backbone.Collection.extend({
model: Drupal.quickedit.FieldModel
});
})(_, Backbone, Drupal);;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function (Backbone, Drupal) {
Drupal.quickedit.EditorModel = Backbone.Model.extend({
defaults: {
originalValue: null,
currentValue: null,
validationErrors: null
}
});
})(Backbone, Drupal);;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function ($, _, Backbone, Drupal) {
var reload = false;
Drupal.quickedit.AppView = Backbone.View.extend({
initialize: function initialize(options) {
this.activeFieldStates = ['activating', 'active'];
this.singleFieldStates = ['highlighted', 'activating', 'active'];
this.changedFieldStates = ['changed', 'saving', 'saved', 'invalid'];
this.readyFieldStates = ['candidate', 'highlighted'];
this.listenTo(options.entitiesCollection, 'change:state', this.appStateChange);
this.listenTo(options.entitiesCollection, 'change:isActive', this.enforceSingleActiveEntity);
this.listenTo(options.fieldsCollection, 'change:state', this.editorStateChange);
this.listenTo(options.fieldsCollection, 'change:html', this.renderUpdatedField);
this.listenTo(options.fieldsCollection, 'change:html', this.propagateUpdatedField);
this.listenTo(options.fieldsCollection, 'add', this.rerenderedFieldToCandidate);
this.listenTo(options.fieldsCollection, 'destroy', this.teardownEditor);
},
appStateChange: function appStateChange(entityModel, state) {
var app = this;
var entityToolbarView = void 0;
switch (state) {
case 'launching':
reload = false;
entityToolbarView = new Drupal.quickedit.EntityToolbarView({
model: entityModel,
appModel: this.model
});
entityModel.toolbarView = entityToolbarView;
entityModel.get('fields').each(function (fieldModel) {
app.setupEditor(fieldModel);
});
_.defer(function () {
entityModel.set('state', 'opening');
});
break;
case 'closed':
entityToolbarView = entityModel.toolbarView;
entityModel.get('fields').each(function (fieldModel) {
app.teardownEditor(fieldModel);
});
if (entityToolbarView) {
entityToolbarView.remove();
delete entityModel.toolbarView;
}
if (reload) {
reload = false;
window.location.reload();
}
break;
}
},
acceptEditorStateChange: function acceptEditorStateChange(from, to, context, fieldModel) {
var accept = true;
if (context && (context.reason === 'stop' || context.reason === 'rerender')) {
if (from === 'candidate' && to === 'inactive') {
accept = true;
}
} else {
if (!Drupal.quickedit.FieldModel.followsStateSequence(from, to)) {
accept = false;
if (_.indexOf(this.activeFieldStates, from) !== -1 && to === 'candidate') {
accept = true;
} else if ((from === 'changed' || from === 'invalid') && to === 'candidate') {
accept = true;
} else if (from === 'highlighted' && to === 'candidate') {
accept = true;
} else if (from === 'saved' && to === 'candidate') {
accept = true;
} else if (from === 'invalid' && to === 'saving') {
accept = true;
} else if (from === 'invalid' && to === 'activating') {
accept = true;
}
}
if (accept) {
var activeField = void 0;
var activeFieldState = void 0;
if ((this.readyFieldStates.indexOf(from) !== -1 || from === 'invalid') && this.activeFieldStates.indexOf(to) !== -1) {
activeField = this.model.get('activeField');
if (activeField && activeField !== fieldModel) {
activeFieldState = activeField.get('state');
if (this.activeFieldStates.indexOf(activeFieldState) !== -1) {
activeField.set('state', 'candidate');
} else if (activeFieldState === 'changed' || activeFieldState === 'invalid') {
activeField.set('state', 'saving');
}
if (from === 'invalid') {
this.model.set('activeField', fieldModel);
accept = false;
}
}
} else if (_.indexOf(this.activeFieldStates, from) !== -1 && to === 'candidate') {
if (context && context.reason === 'mouseleave') {
accept = false;
}
} else if ((from === 'changed' || from === 'invalid') && to === 'candidate') {
if (context && context.reason === 'mouseleave') {
accept = false;
} else if (context && context.confirmed) {
accept = true;
}
}
}
}
return accept;
},
setupEditor: function setupEditor(fieldModel) {
var entityModel = fieldModel.get('entity');
var entityToolbarView = entityModel.toolbarView;
var fieldToolbarRoot = entityToolbarView.getToolbarRoot();
var editorName = fieldModel.get('metadata').editor;
var editorModel = new Drupal.quickedit.EditorModel();
var editorView = new Drupal.quickedit.editors[editorName]({
el: $(fieldModel.get('el')),
model: editorModel,
fieldModel: fieldModel
});
var toolbarView = new Drupal.quickedit.FieldToolbarView({
el: fieldToolbarRoot,
model: fieldModel,
$editedElement: $(editorView.getEditedElement()),
editorView: editorView,
entityModel: entityModel
});
var decorationView = new Drupal.quickedit.FieldDecorationView({
el: $(editorView.getEditedElement()),
model: fieldModel,
editorView: editorView
});
fieldModel.editorView = editorView;
fieldModel.toolbarView = toolbarView;
fieldModel.decorationView = decorationView;
},
teardownEditor: function teardownEditor(fieldModel) {
if (typeof fieldModel.editorView === 'undefined') {
return;
}
fieldModel.toolbarView.remove();
delete fieldModel.toolbarView;
fieldModel.decorationView.remove();
delete fieldModel.decorationView;
fieldModel.editorView.remove();
delete fieldModel.editorView;
},
confirmEntityDeactivation: function confirmEntityDeactivation(entityModel) {
var that = this;
var discardDialog = void 0;
function closeDiscardDialog(action) {
discardDialog.close(action);
that.model.set('activeModal', null);
if (action === 'save') {
entityModel.set('state', 'committing', { confirmed: true });
} else {
entityModel.set('state', 'deactivating', { confirmed: true });
if (entityModel.get('reload')) {
reload = true;
entityModel.set('reload', false);
}
}
}
if (!this.model.get('activeModal')) {
var $unsavedChanges = $('<div>' + Drupal.t('You have unsaved changes') + '</div>');
discardDialog = Drupal.dialog($unsavedChanges.get(0), {
title: Drupal.t('Discard changes?'),
dialogClass: 'quickedit-discard-modal',
resizable: false,
buttons: [{
text: Drupal.t('Save'),
click: function click() {
closeDiscardDialog('save');
},
primary: true
}, {
text: Drupal.t('Discard changes'),
click: function click() {
closeDiscardDialog('discard');
}
}],
closeOnEscape: false,
create: function create() {
$(this).parent().find('.ui-dialog-titlebar-close').remove();
},
beforeClose: false,
close: function close(event) {
$(event.target).remove();
}
});
this.model.set('activeModal', discardDialog);
discardDialog.showModal();
}
},
editorStateChange: function editorStateChange(fieldModel, state) {
var from = fieldModel.previous('state');
var to = state;
if (_.indexOf(this.singleFieldStates, to) !== -1 && this.model.get('highlightedField') !== fieldModel) {
this.model.set('highlightedField', fieldModel);
} else if (this.model.get('highlightedField') === fieldModel && to === 'candidate') {
this.model.set('highlightedField', null);
}
if (_.indexOf(this.activeFieldStates, to) !== -1 && this.model.get('activeField') !== fieldModel) {
this.model.set('activeField', fieldModel);
} else if (this.model.get('activeField') === fieldModel && to === 'candidate') {
if (from === 'changed' || from === 'invalid') {
fieldModel.editorView.revert();
}
this.model.set('activeField', null);
}
},
renderUpdatedField: function renderUpdatedField(fieldModel, html, options) {
var $fieldWrapper = $(fieldModel.get('el'));
var $context = $fieldWrapper.parent();
var renderField = function renderField() {
fieldModel.destroy();
$fieldWrapper.replaceWith(html);
Drupal.attachBehaviors($context.get(0));
};
if (!options.propagation) {
_.defer(function () {
fieldModel.set('state', 'candidate');
_.defer(function () {
fieldModel.set('state', 'inactive', { reason: 'rerender' });
renderField();
});
});
} else {
renderField();
}
},
propagateUpdatedField: function propagateUpdatedField(updatedField, html, options) {
if (options.propagation) {
return;
}
var htmlForOtherViewModes = updatedField.get('htmlForOtherViewModes');
Drupal.quickedit.collections.fields.where({ logicalFieldID: updatedField.get('logicalFieldID') }).forEach(function (field) {
if (field === updatedField) {} else if (field.getViewMode() === updatedField.getViewMode()) {
field.set('html', updatedField.get('html'));
} else if (field.getViewMode() in htmlForOtherViewModes) {
field.set('html', htmlForOtherViewModes[field.getViewMode()], {
propagation: true
});
}
});
},
rerenderedFieldToCandidate: function rerenderedFieldToCandidate(fieldModel) {
var activeEntity = Drupal.quickedit.collections.entities.findWhere({
isActive: true
});
if (!activeEntity) {
return;
}
if (fieldModel.get('entity') === activeEntity) {
this.setupEditor(fieldModel);
fieldModel.set('state', 'candidate');
}
},
enforceSingleActiveEntity: function enforceSingleActiveEntity(changedEntityModel) {
if (changedEntityModel.get('isActive') === false) {
return;
}
changedEntityModel.collection.chain().filter(function (entityModel) {
return entityModel.get('isActive') === true && entityModel !== changedEntityModel;
}).each(function (entityModel) {
entityModel.set('state', 'deactivating');
});
}
});
})(jQuery, _, Backbone, Drupal);;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function ($, Backbone, Drupal) {
Drupal.quickedit.FieldDecorationView = Backbone.View.extend({
_widthAttributeIsEmpty: null,
events: {
'mouseenter.quickedit': 'onMouseEnter',
'mouseleave.quickedit': 'onMouseLeave',
click: 'onClick',
'tabIn.quickedit': 'onMouseEnter',
'tabOut.quickedit': 'onMouseLeave'
},
initialize: function initialize(options) {
this.editorView = options.editorView;
this.listenTo(this.model, 'change:state', this.stateChange);
this.listenTo(this.model, 'change:isChanged change:inTempStore', this.renderChanged);
},
remove: function remove() {
this.setElement();
Backbone.View.prototype.remove.call(this);
},
stateChange: function stateChange(model, state) {
var from = model.previous('state');
var to = state;
switch (to) {
case 'inactive':
this.undecorate();
break;
case 'candidate':
this.decorate();
if (from !== 'inactive') {
this.stopHighlight();
if (from !== 'highlighted') {
this.model.set('isChanged', false);
this.stopEdit();
}
}
this._unpad();
break;
case 'highlighted':
this.startHighlight();
break;
case 'activating':
this.prepareEdit();
break;
case 'active':
if (from !== 'activating') {
this.prepareEdit();
}
if (this.editorView.getQuickEditUISettings().padding) {
this._pad();
}
break;
case 'changed':
this.model.set('isChanged', true);
break;
case 'saving':
break;
case 'saved':
break;
case 'invalid':
break;
}
},
renderChanged: function renderChanged() {
this.$el.toggleClass('quickedit-changed', this.model.get('isChanged') || this.model.get('inTempStore'));
},
onMouseEnter: function onMouseEnter(event) {
var that = this;
that.model.set('state', 'highlighted');
event.stopPropagation();
},
onMouseLeave: function onMouseLeave(event) {
var that = this;
that.model.set('state', 'candidate', { reason: 'mouseleave' });
event.stopPropagation();
},
onClick: function onClick(event) {
this.model.set('state', 'activating');
event.preventDefault();
event.stopPropagation();
},
decorate: function decorate() {
this.$el.addClass('quickedit-candidate quickedit-editable');
},
undecorate: function undecorate() {
this.$el.removeClass('quickedit-candidate quickedit-editable quickedit-highlighted quickedit-editing');
},
startHighlight: function startHighlight() {
var that = this;
that.$el.addClass('quickedit-highlighted');
},
stopHighlight: function stopHighlight() {
this.$el.removeClass('quickedit-highlighted');
},
prepareEdit: function prepareEdit() {
this.$el.addClass('quickedit-editing');
if (this.editorView.getQuickEditUISettings().popup) {
this.$el.addClass('quickedit-editor-is-popup');
}
},
stopEdit: function stopEdit() {
this.$el.removeClass('quickedit-highlighted quickedit-editing');
if (this.editorView.getQuickEditUISettings().popup) {
this.$el.removeClass('quickedit-editor-is-popup');
}
$('.quickedit-candidate').addClass('quickedit-editable');
},
_pad: function _pad() {
if (this.$el.data('quickedit-padded')) {
return;
}
var self = this;
if (this.$el[0].style.width === '') {
this._widthAttributeIsEmpty = true;
this.$el.addClass('quickedit-animate-disable-width').css('width', this.$el.width());
}
var posProp = this._getPositionProperties(this.$el);
setTimeout(function () {
self.$el.removeClass('quickedit-animate-disable-width');
self.$el.css({
position: 'relative',
top: posProp.top - 5 + 'px',
left: posProp.left - 5 + 'px',
'padding-top': posProp['padding-top'] + 5 + 'px',
'padding-left': posProp['padding-left'] + 5 + 'px',
'padding-right': posProp['padding-right'] + 5 + 'px',
'padding-bottom': posProp['padding-bottom'] + 5 + 'px',
'margin-bottom': posProp['margin-bottom'] - 10 + 'px'
}).data('quickedit-padded', true);
}, 0);
},
_unpad: function _unpad() {
if (!this.$el.data('quickedit-padded')) {
return;
}
var self = this;
if (this._widthAttributeIsEmpty) {
this.$el.addClass('quickedit-animate-disable-width').css('width', '');
}
var posProp = this._getPositionProperties(this.$el);
setTimeout(function () {
self.$el.removeClass('quickedit-animate-disable-width');
self.$el.css({
position: 'relative',
top: posProp.top + 5 + 'px',
left: posProp.left + 5 + 'px',
'padding-top': posProp['padding-top'] - 5 + 'px',
'padding-left': posProp['padding-left'] - 5 + 'px',
'padding-right': posProp['padding-right'] - 5 + 'px',
'padding-bottom': posProp['padding-bottom'] - 5 + 'px',
'margin-bottom': posProp['margin-bottom'] + 10 + 'px'
});
}, 0);
this.$el.removeData('quickedit-padded');
},
_getPositionProperties: function _getPositionProperties($e) {
var p = void 0;
var r = {};
var props = ['top', 'left', 'bottom', 'right', 'padding-top', 'padding-left', 'padding-right', 'padding-bottom', 'margin-bottom'];
var propCount = props.length;
for (var i = 0; i < propCount; i++) {
p = props[i];
r[p] = parseInt(this._replaceBlankPosition($e.css(p)), 10);
}
return r;
},
_replaceBlankPosition: function _replaceBlankPosition(pos) {
if (pos === 'auto' || !pos) {
pos = '0px';
}
return pos;
}
});
})(jQuery, Backbone, Drupal);;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function (Drupal, $, Backbone) {
Drupal.quickedit.EntityDecorationView = Backbone.View.extend({
initialize: function initialize() {
this.listenTo(this.model, 'change', this.render);
},
render: function render() {
this.$el.toggleClass('quickedit-entity-active', this.model.get('isActive'));
},
remove: function remove() {
this.setElement(null);
Backbone.View.prototype.remove.call(this);
}
});
})(Drupal, jQuery, Backbone);;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function ($, _, Backbone, Drupal, debounce) {
Drupal.quickedit.EntityToolbarView = Backbone.View.extend({
_fieldToolbarRoot: null,
events: function events() {
var map = {
'click button.action-save': 'onClickSave',
'click button.action-cancel': 'onClickCancel',
mouseenter: 'onMouseenter'
};
return map;
},
initialize: function initialize(options) {
var that = this;
this.appModel = options.appModel;
this.$entity = $(this.model.get('el'));
this.listenTo(this.model, 'change:isActive change:isDirty change:state', this.render);
this.listenTo(this.appModel, 'change:highlightedField change:activeField', this.render);
this.listenTo(this.model.get('fields'), 'change:state', this.fieldStateChange);
$(window).on('resize.quickedit scroll.quickedit drupalViewportOffsetChange.quickedit', debounce($.proxy(this.windowChangeHandler, this), 150));
$(document).on('drupalViewportOffsetChange.quickedit', function (event, offsets) {
if (that.$fence) {
that.$fence.css(offsets);
}
});
var $toolbar = this.buildToolbarEl();
this.setElement($toolbar);
this._fieldToolbarRoot = $toolbar.find('.quickedit-toolbar-field').get(0);
this.render();
},
render: function render() {
if (this.model.get('isActive')) {
var $body = $('body');
if ($body.children('#quickedit-entity-toolbar').length === 0) {
$body.append(this.$el);
}
if ($body.children('#quickedit-toolbar-fence').length === 0) {
this.$fence = $(Drupal.theme('quickeditEntityToolbarFence')).css(Drupal.displace()).appendTo($body);
}
this.label();
this.show('ops');
this.position();
}
var $button = this.$el.find('.quickedit-button.action-save');
var isDirty = this.model.get('isDirty');
switch (this.model.get('state')) {
case 'opened':
$button.removeClass('action-saving icon-throbber icon-end').text(Drupal.t('Save')).removeAttr('disabled').attr('aria-hidden', !isDirty);
break;
case 'committing':
$button.addClass('action-saving icon-throbber icon-end').text(Drupal.t('Saving')).attr('disabled', 'disabled');
break;
default:
$button.attr('aria-hidden', true);
break;
}
return this;
},
remove: function remove() {
this.$fence.remove();
$(window).off('resize.quickedit scroll.quickedit drupalViewportOffsetChange.quickedit');
$(document).off('drupalViewportOffsetChange.quickedit');
Backbone.View.prototype.remove.call(this);
},
windowChangeHandler: function windowChangeHandler(event) {
this.position();
},
fieldStateChange: function fieldStateChange(model, state) {
switch (state) {
case 'active':
this.render();
break;
case 'invalid':
this.render();
break;
}
},
position: function position(element) {
clearTimeout(this.timer);
var that = this;
var edge = document.documentElement.dir === 'rtl' ? 'right' : 'left';
var delay = 0;
var check = 0;
var horizontalPadding = 0;
var of = void 0;
var activeField = void 0;
var highlightedField = void 0;
do {
switch (check) {
case 0:
of = element;
break;
case 1:
activeField = Drupal.quickedit.app.model.get('activeField');
of = activeField && activeField.editorView && activeField.editorView.$formContainer && activeField.editorView.$formContainer.find('.quickedit-form');
break;
case 2:
of = activeField && activeField.editorView && activeField.editorView.getEditedElement();
if (activeField && activeField.editorView && activeField.editorView.getQuickEditUISettings().padding) {
horizontalPadding = 5;
}
break;
case 3:
highlightedField = Drupal.quickedit.app.model.get('highlightedField');
of = highlightedField && highlightedField.editorView && highlightedField.editorView.getEditedElement();
delay = 250;
break;
default:
{
var fieldModels = this.model.get('fields').models;
var topMostPosition = 1000000;
var topMostField = null;
for (var i = 0; i < fieldModels.length; i++) {
var pos = fieldModels[i].get('el').getBoundingClientRect().top;
if (pos < topMostPosition) {
topMostPosition = pos;
topMostField = fieldModels[i];
}
}
of = topMostField.get('el');
delay = 50;
break;
}
}
check++;
} while (!of);
function refinePosition(view, suggested, info) {
var isBelow = suggested.top > info.target.top;
info.element.element.toggleClass('quickedit-toolbar-pointer-top', isBelow);
if (view.$entity[0] === info.target.element[0]) {
var $field = view.$entity.find('.quickedit-editable').eq(isBelow ? -1 : 0);
if ($field.length > 0) {
suggested.top = isBelow ? $field.offset().top + $field.outerHeight(true) : $field.offset().top - info.element.element.outerHeight(true);
}
}
var fenceTop = view.$fence.offset().top;
var fenceHeight = view.$fence.height();
var toolbarHeight = info.element.element.outerHeight(true);
if (suggested.top < fenceTop) {
suggested.top = fenceTop;
} else if (suggested.top + toolbarHeight > fenceTop + fenceHeight) {
suggested.top = fenceTop + fenceHeight - toolbarHeight;
}
info.element.element.css({
left: Math.floor(suggested.left),
top: Math.floor(suggested.top)
});
}
function positionToolbar() {
that.$el.position({
my: edge + ' bottom',
at: edge + '+' + (1 + horizontalPadding) + ' top',
of: of,
collision: 'flipfit',
using: refinePosition.bind(null, that),
within: that.$fence
}).css({
'max-width': document.documentElement.clientWidth < 450 ? document.documentElement.clientWidth : 450,
'min-width': document.documentElement.clientWidth < 240 ? document.documentElement.clientWidth : 240,
width: '100%'
});
}
this.timer = setTimeout(function () {
_.defer(positionToolbar);
}, delay);
},
onClickSave: function onClickSave(event) {
event.stopPropagation();
event.preventDefault();
this.model.set('state', 'committing');
},
onClickCancel: function onClickCancel(event) {
event.preventDefault();
this.model.set('state', 'deactivating');
},
onMouseenter: function onMouseenter(event) {
clearTimeout(this.timer);
},
buildToolbarEl: function buildToolbarEl() {
var $toolbar = $(Drupal.theme('quickeditEntityToolbar', {
id: 'quickedit-entity-toolbar'
}));
$toolbar.find('.quickedit-toolbar-entity').prepend(Drupal.theme('quickeditToolgroup', {
classes: ['ops'],
buttons: [{
label: Drupal.t('Save'),
type: 'submit',
classes: 'action-save quickedit-button icon',
attributes: {
'aria-hidden': true
}
}, {
label: Drupal.t('Close'),
classes: 'action-cancel quickedit-button icon icon-close icon-only'
}]
}));
$toolbar.css({
left: this.$entity.offset().left,
top: this.$entity.offset().top
});
return $toolbar;
},
getToolbarRoot: function getToolbarRoot() {
return this._fieldToolbarRoot;
},
label: function label() {
var label = '';
var entityLabel = this.model.get('label');
var activeField = Drupal.quickedit.app.model.get('activeField');
var activeFieldLabel = activeField && activeField.get('metadata').label;
var highlightedField = Drupal.quickedit.app.model.get('highlightedField');
var highlightedFieldLabel = highlightedField && highlightedField.get('metadata').label;
if (activeFieldLabel) {
label = Drupal.theme('quickeditEntityToolbarLabel', {
entityLabel: entityLabel,
fieldLabel: activeFieldLabel
});
} else if (highlightedFieldLabel) {
label = Drupal.theme('quickeditEntityToolbarLabel', {
entityLabel: entityLabel,
fieldLabel: highlightedFieldLabel
});
} else {
label = Drupal.checkPlain(entityLabel);
}
this.$el.find('.quickedit-toolbar-label').html(label);
},
addClass: function addClass(toolgroup, classes) {
this._find(toolgroup).addClass(classes);
},
removeClass: function removeClass(toolgroup, classes) {
this._find(toolgroup).removeClass(classes);
},
_find: function _find(toolgroup) {
return this.$el.find('.quickedit-toolbar .quickedit-toolgroup.' + toolgroup);
},
show: function show(toolgroup) {
this.$el.removeClass('quickedit-animate-invisible');
}
});
})(jQuery, _, Backbone, Drupal, Drupal.debounce);;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function ($, Backbone, Drupal) {
Drupal.quickedit.ContextualLinkView = Backbone.View.extend({
events: function events() {
function touchEndToClick(event) {
event.preventDefault();
event.target.click();
}
return {
'click a': function clickA(event) {
event.preventDefault();
this.model.set('state', 'launching');
},
'touchEnd a': touchEndToClick
};
},
initialize: function initialize(options) {
this.$el.find('a').text(options.strings.quickEdit);
this.render();
this.listenTo(this.model, 'change:isActive', this.render);
},
render: function render(entityModel, isActive) {
this.$el.find('a').attr('aria-pressed', isActive);
this.$el.closest('.contextual').toggle(!isActive);
return this;
}
});
})(jQuery, Backbone, Drupal);;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function ($, _, Backbone, Drupal) {
Drupal.quickedit.FieldToolbarView = Backbone.View.extend({
$editedElement: null,
editorView: null,
_id: null,
initialize: function initialize(options) {
this.$editedElement = options.$editedElement;
this.editorView = options.editorView;
this.$root = this.$el;
this._id = 'quickedit-toolbar-for-' + this.model.id.replace(/[/[\]]/g, '_');
this.listenTo(this.model, 'change:state', this.stateChange);
},
render: function render() {
this.setElement($(Drupal.theme('quickeditFieldToolbar', {
id: this._id
})));
this.$el.prependTo(this.$root);
return this;
},
stateChange: function stateChange(model, state) {
var from = model.previous('state');
var to = state;
switch (to) {
case 'inactive':
break;
case 'candidate':
if (from !== 'inactive' && from !== 'highlighted') {
this.$el.remove();
this.setElement();
}
break;
case 'highlighted':
break;
case 'activating':
this.render();
if (this.editorView.getQuickEditUISettings().fullWidthToolbar) {
this.$el.addClass('quickedit-toolbar-fullwidth');
}
if (this.editorView.getQuickEditUISettings().unifiedToolbar) {
this.insertWYSIWYGToolGroups();
}
break;
case 'active':
break;
case 'changed':
break;
case 'saving':
break;
case 'saved':
break;
case 'invalid':
break;
}
},
insertWYSIWYGToolGroups: function insertWYSIWYGToolGroups() {
this.$el.append(Drupal.theme('quickeditToolgroup', {
id: this.getFloatedWysiwygToolgroupId(),
classes: ['wysiwyg-floated', 'quickedit-animate-slow', 'quickedit-animate-invisible', 'quickedit-animate-delay-veryfast'],
buttons: []
})).append(Drupal.theme('quickeditToolgroup', {
id: this.getMainWysiwygToolgroupId(),
classes: ['wysiwyg-main', 'quickedit-animate-slow', 'quickedit-animate-invisible', 'quickedit-animate-delay-veryfast'],
buttons: []
}));
this.show('wysiwyg-floated');
this.show('wysiwyg-main');
},
getId: function getId() {
return 'quickedit-toolbar-for-' + this._id;
},
getFloatedWysiwygToolgroupId: function getFloatedWysiwygToolgroupId() {
return 'quickedit-wysiwyg-floated-toolgroup-for-' + this._id;
},
getMainWysiwygToolgroupId: function getMainWysiwygToolgroupId() {
return 'quickedit-wysiwyg-main-toolgroup-for-' + this._id;
},
_find: function _find(toolgroup) {
return this.$el.find('.quickedit-toolgroup.' + toolgroup);
},
show: function show(toolgroup) {
var $group = this._find(toolgroup);
$group.on(Drupal.quickedit.util.constants.transitionEnd, function (event) {
$group.off(Drupal.quickedit.util.constants.transitionEnd);
});
window.setTimeout(function () {
$group.removeClass('quickedit-animate-invisible');
}, 0);
}
});
})(jQuery, _, Backbone, Drupal);;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function ($, Backbone, Drupal) {
Drupal.quickedit.EditorView = Backbone.View.extend({
initialize: function initialize(options) {
this.fieldModel = options.fieldModel;
this.listenTo(this.fieldModel, 'change:state', this.stateChange);
},
remove: function remove() {
this.setElement();
Backbone.View.prototype.remove.call(this);
},
getEditedElement: function getEditedElement() {
return this.$el;
},
getQuickEditUISettings: function getQuickEditUISettings() {
return {
padding: false,
unifiedToolbar: false,
fullWidthToolbar: false,
popup: false
};
},
stateChange: function stateChange(fieldModel, state) {
var from = fieldModel.previous('state');
var to = state;
switch (to) {
case 'inactive':
break;
case 'candidate':
if (from === 'invalid') {
this.removeValidationErrors();
}
break;
case 'highlighted':
break;
case 'activating':
{
var loadDependencies = function loadDependencies(callback) {
callback();
};
loadDependencies(function () {
fieldModel.set('state', 'active');
});
break;
}
case 'active':
break;
case 'changed':
break;
case 'saving':
if (from === 'invalid') {
this.removeValidationErrors();
}
this.save();
break;
case 'saved':
break;
case 'invalid':
this.showValidationErrors();
break;
}
},
revert: function revert() {},
save: function save() {
var fieldModel = this.fieldModel;
var editorModel = this.model;
var backstageId = 'quickedit_backstage-' + this.fieldModel.id.replace(/[/[\]_\s]/g, '-');
function fillAndSubmitForm(value) {
var $form = $('#' + backstageId).find('form');
$form.find(':input[type!="hidden"][type!="submit"]:not(select)').not('[name$="\\[summary\\]"]').val(value);
$form.find('.quickedit-form-submit').trigger('click.quickedit');
}
var formOptions = {
fieldID: this.fieldModel.get('fieldID'),
$el: this.$el,
nocssjs: true,
other_view_modes: fieldModel.findOtherViewModes(),
reset: !this.fieldModel.get('entity').get('inTempStore')
};
var self = this;
Drupal.quickedit.util.form.load(formOptions, function (form, ajax) {
var $backstage = $(Drupal.theme('quickeditBackstage', { id: backstageId })).appendTo('body');
var $form = $(form).appendTo($backstage);
$form.prop('novalidate', true);
var $submit = $form.find('.quickedit-form-submit');
self.formSaveAjax = Drupal.quickedit.util.form.ajaxifySaving(formOptions, $submit);
function removeHiddenForm() {
Drupal.quickedit.util.form.unajaxifySaving(self.formSaveAjax);
delete self.formSaveAjax;
$backstage.remove();
}
self.formSaveAjax.commands.quickeditFieldFormSaved = function (ajax, response, status) {
removeHiddenForm();
fieldModel.set('state', 'saved');
fieldModel.set('htmlForOtherViewModes', response.other_view_modes);
fieldModel.set('html', response.data);
};
self.formSaveAjax.commands.quickeditFieldFormValidationErrors = function (ajax, response, status) {
removeHiddenForm();
editorModel.set('validationErrors', response.data);
fieldModel.set('state', 'invalid');
};
self.formSaveAjax.commands.quickeditFieldForm = function () {};
fillAndSubmitForm(editorModel.get('currentValue'));
});
},
showValidationErrors: function showValidationErrors() {
var $errors = $('<div class="quickedit-validation-errors"></div>').append(this.model.get('validationErrors'));
this.getEditedElement().addClass('quickedit-validation-error').after($errors);
},
removeValidationErrors: function removeValidationErrors() {
this.getEditedElement().removeClass('quickedit-validation-error').next('.quickedit-validation-errors').remove();
}
});
})(jQuery, Backbone, Drupal);;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function ($, Drupal) {
Drupal.theme.quickeditBackstage = function (settings) {
var html = '';
html += '<div id="' + settings.id + '" />';
return html;
};
Drupal.theme.quickeditEntityToolbar = function (settings) {
var html = '';
html += '<div id="' + settings.id + '" class="quickedit quickedit-toolbar-container clearfix">';
html += '<i class="quickedit-toolbar-pointer"></i>';
html += '<div class="quickedit-toolbar-content">';
html += '<div class="quickedit-toolbar quickedit-toolbar-entity clearfix icon icon-pencil">';
html += '<div class="quickedit-toolbar-label" />';
html += '</div>';
html += '<div class="quickedit-toolbar quickedit-toolbar-field clearfix" />';
html += '</div><div class="quickedit-toolbar-lining"></div></div>';
return html;
};
Drupal.theme.quickeditEntityToolbarLabel = function (settings) {
return '<span class="field">' + Drupal.checkPlain(settings.fieldLabel) + '</span>' + Drupal.checkPlain(settings.entityLabel);
};
Drupal.theme.quickeditEntityToolbarFence = function () {
return '<div id="quickedit-toolbar-fence" />';
};
Drupal.theme.quickeditFieldToolbar = function (settings) {
return '<div id="' + settings.id + '" />';
};
Drupal.theme.quickeditToolgroup = function (settings) {
var classes = settings.classes || [];
classes.unshift('quickedit-toolgroup');
var html = '';
html += '<div class="' + classes.join(' ') + '"';
if (settings.id) {
html += ' id="' + settings.id + '"';
}
html += '>';
html += Drupal.theme('quickeditButtons', { buttons: settings.buttons });
html += '</div>';
return html;
};
Drupal.theme.quickeditButtons = function (settings) {
var html = '';
var _loop = function _loop(i) {
var button = settings.buttons[i];
if (!button.hasOwnProperty('type')) {
button.type = 'button';
}
var attributes = [];
var attrMap = settings.buttons[i].attributes || {};
Object.keys(attrMap).forEach(function (attr) {
attributes.push(attr + (attrMap[attr] ? '="' + attrMap[attr] + '"' : ''));
});
html += '<button type="' + button.type + '" class="' + button.classes + '" ' + attributes.join(' ') + '>' + button.label + '</button>';
};
for (var i = 0; i < settings.buttons.length; i++) {
_loop(i);
}
return html;
};
Drupal.theme.quickeditFormContainer = function (settings) {
var html = '';
html += '<div id="' + settings.id + '" class="quickedit-form-container">';
html += ' <div class="quickedit-form">';
html += ' <div class="placeholder">';
html += settings.loadingMsg;
html += ' </div>';
html += ' </div>';
html += '</div>';
return html;
};
})(jQuery, Drupal);;
/*! modernizr 3.2.0 (Custom Build) | MIT *
* http://modernizr.com/download/?-applicationcache-audio-backgroundsize-borderimage-boxshadow-canvas-canvastext-cssanimations-csscolumns-cssreflections-csstransforms-csstransforms3d-csstransitions-flexbox-flexboxlegacy-fontface-generatedcontent-geolocation-hashchange-history-hsla-indexeddb-inlinesvg-input-inputtypes-localstorage-multiplebgs-opacity-postmessage-rgba-sessionstorage-smil-svg-svgclippaths-textshadow-video-webgl-websockets-websqldatabase-webworkers-domprefixes-hasevent-mq-prefixes-shiv-testallprops-testprop-teststyles !*/
!function(e,t,n){function r(e,t){return typeof e===t}function a(){var e,t,n,a,o,i,s;for(var c in b)if(b.hasOwnProperty(c)){if(e=[],t=b[c],t.name&&(e.push(t.name.toLowerCase()),t.options&&t.options.aliases&&t.options.aliases.length))for(n=0;n<t.options.aliases.length;n++)e.push(t.options.aliases[n].toLowerCase());for(a=r(t.fn,"function")?t.fn():t.fn,o=0;o<e.length;o++)i=e[o],s=i.split("."),1===s.length?Modernizr[s[0]]=a:(!Modernizr[s[0]]||Modernizr[s[0]]instanceof Boolean||(Modernizr[s[0]]=new Boolean(Modernizr[s[0]])),Modernizr[s[0]][s[1]]=a),y.push((a?"":"no-")+s.join("-"))}}function o(e){var t=w.className,n=Modernizr._config.classPrefix||"";if(S&&(t=t.baseVal),Modernizr._config.enableJSClass){var r=new RegExp("(^|\\s)"+n+"no-js(\\s|$)");t=t.replace(r,"$1"+n+"js$2")}Modernizr._config.enableClasses&&(t+=" "+n+e.join(" "+n),S?w.className.baseVal=t:w.className=t)}function i(){return"function"!=typeof t.createElement?t.createElement(arguments[0]):S?t.createElementNS.call(t,"http://www.w3.org/2000/svg",arguments[0]):t.createElement.apply(t,arguments)}function s(e,t){return!!~(""+e).indexOf(t)}function c(){var e=t.body;return e||(e=i(S?"svg":"body"),e.fake=!0),e}function l(e,n,r,a){var o,s,l,d,u="modernizr",f=i("div"),p=c();if(parseInt(r,10))for(;r--;)l=i("div"),l.id=a?a[r]:u+(r+1),f.appendChild(l);return o=i("style"),o.type="text/css",o.id="s"+u,(p.fake?p:f).appendChild(o),p.appendChild(f),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(t.createTextNode(e)),f.id=u,p.fake&&(p.style.background="",p.style.overflow="hidden",d=w.style.overflow,w.style.overflow="hidden",w.appendChild(p)),s=n(f,e),p.fake?(p.parentNode.removeChild(p),w.style.overflow=d,w.offsetHeight):f.parentNode.removeChild(f),!!s}function d(e){return e.replace(/([a-z])-([a-z])/g,function(e,t,n){return t+n.toUpperCase()}).replace(/^-/,"")}function u(e,t){return function(){return e.apply(t,arguments)}}function f(e,t,n){var a;for(var o in e)if(e[o]in t)return n===!1?e[o]:(a=t[e[o]],r(a,"function")?u(a,n||t):a);return!1}function p(e){return e.replace(/([A-Z])/g,function(e,t){return"-"+t.toLowerCase()}).replace(/^ms-/,"-ms-")}function m(t,r){var a=t.length;if("CSS"in e&&"supports"in e.CSS){for(;a--;)if(e.CSS.supports(p(t[a]),r))return!0;return!1}if("CSSSupportsRule"in e){for(var o=[];a--;)o.push("("+p(t[a])+":"+r+")");return o=o.join(" or "),l("@supports ("+o+") { #modernizr { position: absolute; } }",function(e){return"absolute"==getComputedStyle(e,null).position})}return n}function g(e,t,a,o){function c(){u&&(delete I.style,delete I.modElem)}if(o=r(o,"undefined")?!1:o,!r(a,"undefined")){var l=m(e,a);if(!r(l,"undefined"))return l}for(var u,f,p,g,h,v=["modernizr","tspan"];!I.style;)u=!0,I.modElem=i(v.shift()),I.style=I.modElem.style;for(p=e.length,f=0;p>f;f++)if(g=e[f],h=I.style[g],s(g,"-")&&(g=d(g)),I.style[g]!==n){if(o||r(a,"undefined"))return c(),"pfx"==t?g:!0;try{I.style[g]=a}catch(y){}if(I.style[g]!=h)return c(),"pfx"==t?g:!0}return c(),!1}function h(e,t,n,a,o){var i=e.charAt(0).toUpperCase()+e.slice(1),s=(e+" "+L.join(i+" ")+i).split(" ");return r(t,"string")||r(t,"undefined")?g(s,t,a,o):(s=(e+" "+E.join(i+" ")+i).split(" "),f(s,t,n))}function v(e,t,r){return h(e,n,n,t,r)}var y=[],b=[],x={_version:"3.2.0",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(e,t){var n=this;setTimeout(function(){t(n[e])},0)},addTest:function(e,t,n){b.push({name:e,fn:t,options:n})},addAsyncTest:function(e){b.push({name:null,fn:e})}},Modernizr=function(){};Modernizr.prototype=x,Modernizr=new Modernizr,Modernizr.addTest("applicationcache","applicationCache"in e),Modernizr.addTest("geolocation","geolocation"in navigator),Modernizr.addTest("history",function(){var t=navigator.userAgent;return-1===t.indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone")?e.history&&"pushState"in e.history:!1}),Modernizr.addTest("postmessage","postMessage"in e),Modernizr.addTest("svg",!!t.createElementNS&&!!t.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect),Modernizr.addTest("websockets","WebSocket"in e&&2===e.WebSocket.CLOSING),Modernizr.addTest("localstorage",function(){var e="modernizr";try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(t){return!1}}),Modernizr.addTest("sessionstorage",function(){var e="modernizr";try{return sessionStorage.setItem(e,e),sessionStorage.removeItem(e),!0}catch(t){return!1}}),Modernizr.addTest("websqldatabase","openDatabase"in e),Modernizr.addTest("webworkers","Worker"in e);var T=x._config.usePrefixes?" -webkit- -moz- -o- -ms- ".split(" "):[];x._prefixes=T;var w=t.documentElement,S="svg"===w.nodeName.toLowerCase();S||!function(e,t){function n(e,t){var n=e.createElement("p"),r=e.getElementsByTagName("head")[0]||e.documentElement;return n.innerHTML="x<style>"+t+"</style>",r.insertBefore(n.lastChild,r.firstChild)}function r(){var e=b.elements;return"string"==typeof e?e.split(" "):e}function a(e,t){var n=b.elements;"string"!=typeof n&&(n=n.join(" ")),"string"!=typeof e&&(e=e.join(" ")),b.elements=n+" "+e,l(t)}function o(e){var t=y[e[h]];return t||(t={},v++,e[h]=v,y[v]=t),t}function i(e,n,r){if(n||(n=t),u)return n.createElement(e);r||(r=o(n));var a;return a=r.cache[e]?r.cache[e].cloneNode():g.test(e)?(r.cache[e]=r.createElem(e)).cloneNode():r.createElem(e),!a.canHaveChildren||m.test(e)||a.tagUrn?a:r.frag.appendChild(a)}function s(e,n){if(e||(e=t),u)return e.createDocumentFragment();n=n||o(e);for(var a=n.frag.cloneNode(),i=0,s=r(),c=s.length;c>i;i++)a.createElement(s[i]);return a}function c(e,t){t.cache||(t.cache={},t.createElem=e.createElement,t.createFrag=e.createDocumentFragment,t.frag=t.createFrag()),e.createElement=function(n){return b.shivMethods?i(n,e,t):t.createElem(n)},e.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+r().join().replace(/[\w\-:]+/g,function(e){return t.createElem(e),t.frag.createElement(e),'c("'+e+'")'})+");return n}")(b,t.frag)}function l(e){e||(e=t);var r=o(e);return!b.shivCSS||d||r.hasCSS||(r.hasCSS=!!n(e,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),u||c(e,r),e}var d,u,f="3.7.3",p=e.html5||{},m=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,g=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,h="_html5shiv",v=0,y={};!function(){try{var e=t.createElement("a");e.innerHTML="<xyz></xyz>",d="hidden"in e,u=1==e.childNodes.length||function(){t.createElement("a");var e=t.createDocumentFragment();return"undefined"==typeof e.cloneNode||"undefined"==typeof e.createDocumentFragment||"undefined"==typeof e.createElement}()}catch(n){d=!0,u=!0}}();var b={elements:p.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:f,shivCSS:p.shivCSS!==!1,supportsUnknownElements:u,shivMethods:p.shivMethods!==!1,type:"default",shivDocument:l,createElement:i,createDocumentFragment:s,addElements:a};e.html5=b,l(t),"object"==typeof module&&module.exports&&(module.exports=b)}("undefined"!=typeof e?e:this,t);var C="Moz O ms Webkit",E=x._config.usePrefixes?C.toLowerCase().split(" "):[];x._domPrefixes=E;var k=function(e){function n(t,n){var a;return t?(n&&"string"!=typeof n||(n=i(n||"div")),t="on"+t,a=t in n,!a&&r&&(n.setAttribute||(n=i("div")),n.setAttribute(t,""),a="function"==typeof n[t],n[t]!==e&&(n[t]=e),n.removeAttribute(t)),a):!1}var r=!("onblur"in t.documentElement);return n}();x.hasEvent=k,Modernizr.addTest("hashchange",function(){return k("hashchange",e)===!1?!1:t.documentMode===n||t.documentMode>7}),Modernizr.addTest("audio",function(){var e=i("audio"),t=!1;try{(t=!!e.canPlayType)&&(t=new Boolean(t),t.ogg=e.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),t.mp3=e.canPlayType("audio/mpeg;").replace(/^no$/,""),t.opus=e.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),t.wav=e.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),t.m4a=(e.canPlayType("audio/x-m4a;")||e.canPlayType("audio/aac;")).replace(/^no$/,""))}catch(n){}return t}),Modernizr.addTest("canvas",function(){var e=i("canvas");return!(!e.getContext||!e.getContext("2d"))}),Modernizr.addTest("canvastext",function(){return Modernizr.canvas===!1?!1:"function"==typeof i("canvas").getContext("2d").fillText}),Modernizr.addTest("video",function(){var e=i("video"),t=!1;try{(t=!!e.canPlayType)&&(t=new Boolean(t),t.ogg=e.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),t.h264=e.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),t.webm=e.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,""),t.vp9=e.canPlayType('video/webm; codecs="vp9"').replace(/^no$/,""),t.hls=e.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(/^no$/,""))}catch(n){}return t}),Modernizr.addTest("webgl",function(){var t=i("canvas"),n="probablySupportsContext"in t?"probablySupportsContext":"supportsContext";return n in t?t[n]("webgl")||t[n]("experimental-webgl"):"WebGLRenderingContext"in e}),Modernizr.addTest("multiplebgs",function(){var e=i("a").style;return e.cssText="background:url(https://),url(https://),red url(https://)",/(url\s*\(.*?){3}/.test(e.background)}),Modernizr.addTest("opacity",function(){var e=i("a").style;return e.cssText=T.join("opacity:.55;"),/^0.55$/.test(e.opacity)}),Modernizr.addTest("rgba",function(){var e=i("a").style;return e.cssText="background-color:rgba(150,255,150,.5)",(""+e.backgroundColor).indexOf("rgba")>-1}),Modernizr.addTest("inlinesvg",function(){var e=i("div");return e.innerHTML="<svg/>","http://www.w3.org/2000/svg"==("undefined"!=typeof SVGRect&&e.firstChild&&e.firstChild.namespaceURI)});var P=i("input"),_="autocomplete autofocus list placeholder max min multiple pattern required step".split(" "),N={};Modernizr.input=function(t){for(var n=0,r=t.length;r>n;n++)N[t[n]]=!!(t[n]in P);return N.list&&(N.list=!(!i("datalist")||!e.HTMLDataListElement)),N}(_);var z="search tel url email datetime date month week time datetime-local number range color".split(" "),R={};Modernizr.inputtypes=function(e){for(var r,a,o,i=e.length,s=":)",c=0;i>c;c++)P.setAttribute("type",r=e[c]),o="text"!==P.type&&"style"in P,o&&(P.value=s,P.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(r)&&P.style.WebkitAppearance!==n?(w.appendChild(P),a=t.defaultView,o=a.getComputedStyle&&"textfield"!==a.getComputedStyle(P,null).WebkitAppearance&&0!==P.offsetHeight,w.removeChild(P)):/^(search|tel)$/.test(r)||(o=/^(url|email|number)$/.test(r)?P.checkValidity&&P.checkValidity()===!1:P.value!=s)),R[e[c]]=!!o;return R}(z),Modernizr.addTest("hsla",function(){var e=i("a").style;return e.cssText="background-color:hsla(120,40%,100%,.5)",s(e.backgroundColor,"rgba")||s(e.backgroundColor,"hsla")});var $="CSS"in e&&"supports"in e.CSS,A="supportsCSS"in e;Modernizr.addTest("supports",$||A);var M={}.toString;Modernizr.addTest("svgclippaths",function(){return!!t.createElementNS&&/SVGClipPath/.test(M.call(t.createElementNS("http://www.w3.org/2000/svg","clipPath")))}),Modernizr.addTest("smil",function(){return!!t.createElementNS&&/SVGAnimate/.test(M.call(t.createElementNS("http://www.w3.org/2000/svg","animate")))});var L=x._config.usePrefixes?C.split(" "):[];x._cssomPrefixes=L;var O=function(){var t=e.matchMedia||e.msMatchMedia;return t?function(e){var n=t(e);return n&&n.matches||!1}:function(t){var n=!1;return l("@media "+t+" { #modernizr { position: absolute; } }",function(t){n="absolute"==(e.getComputedStyle?e.getComputedStyle(t,null):t.currentStyle).position}),n}}();x.mq=O;var B=x.testStyles=l,F=function(){var e=navigator.userAgent,t=e.match(/applewebkit\/([0-9]+)/gi)&&parseFloat(RegExp.$1),n=e.match(/w(eb)?osbrowser/gi),r=e.match(/windows phone/gi)&&e.match(/iemobile\/([0-9])+/gi)&&parseFloat(RegExp.$1)>=9,a=533>t&&e.match(/android/gi);return n||a||r}();F?Modernizr.addTest("fontface",!1):B('@font-face {font-family:"font";src:url("https://")}',function(e,n){var r=t.getElementById("smodernizr"),a=r.sheet||r.styleSheet,o=a?a.cssRules&&a.cssRules[0]?a.cssRules[0].cssText:a.cssText||"":"",i=/src/i.test(o)&&0===o.indexOf(n.split(" ")[0]);Modernizr.addTest("fontface",i)}),B('#modernizr{font:0/0 a}#modernizr:after{content:":)";visibility:hidden;font:7px/1 a}',function(e){Modernizr.addTest("generatedcontent",e.offsetHeight>=7)});var j=function(t){var r,a=T.length,o=e.CSSRule;if("undefined"==typeof o)return n;if(!t)return!1;if(t=t.replace(/^@/,""),r=t.replace(/-/g,"_").toUpperCase()+"_RULE",r in o)return"@"+t;for(var i=0;a>i;i++){var s=T[i],c=s.toUpperCase()+"_"+r;if(c in o)return"@-"+s.toLowerCase()+"-"+t}return!1};x.atRule=j;var D={elem:i("modernizr")};Modernizr._q.push(function(){delete D.elem});var I={style:D.elem.style};Modernizr._q.unshift(function(){delete I.style});var W=x.testProp=function(e,t,r){return g([e],n,t,r)};Modernizr.addTest("textshadow",W("textShadow","1px 1px")),x.testAllProps=h,x.testAllProps=v,Modernizr.addTest("cssanimations",v("animationName","a",!0)),Modernizr.addTest("backgroundsize",v("backgroundSize","100%",!0)),Modernizr.addTest("borderimage",v("borderImage","url() 1",!0)),Modernizr.addTest("boxshadow",v("boxShadow","1px 1px",!0)),function(){Modernizr.addTest("csscolumns",function(){var e=!1,t=v("columnCount");try{(e=!!t)&&(e=new Boolean(e))}catch(n){}return e});for(var e,t,n=["Width","Span","Fill","Gap","Rule","RuleColor","RuleStyle","RuleWidth","BreakBefore","BreakAfter","BreakInside"],r=0;r<n.length;r++)e=n[r].toLowerCase(),t=v("column"+n[r]),("breakbefore"===e||"breakafter"===e||"breakinside"==e)&&(t=t||v(n[r])),Modernizr.addTest("csscolumns."+e,t)}(),Modernizr.addTest("flexbox",v("flexBasis","1px",!0)),Modernizr.addTest("flexboxlegacy",v("boxDirection","reverse",!0)),Modernizr.addTest("cssreflections",v("boxReflect","above",!0)),Modernizr.addTest("csstransforms",function(){return-1===navigator.userAgent.indexOf("Android 2.")&&v("transform","scale(1)",!0)}),Modernizr.addTest("csstransforms3d",function(){var e=!!v("perspective","1px",!0),t=Modernizr._config.usePrefixes;if(e&&(!t||"webkitPerspective"in w.style)){var n,r="#modernizr{width:0;height:0}";Modernizr.supports?n="@supports (perspective: 1px)":(n="@media (transform-3d)",t&&(n+=",(-webkit-transform-3d)")),n+="{#modernizr{width:7px;height:18px;margin:0;padding:0;border:0}}",B(r+n,function(t){e=7===t.offsetWidth&&18===t.offsetHeight})}return e}),Modernizr.addTest("csstransitions",v("transition","all",!0));var V=x.prefixed=function(e,t,n){return 0===e.indexOf("@")?j(e):(-1!=e.indexOf("-")&&(e=d(e)),t?h(e,t,n):h(e,"pfx"))},q=V("indexedDB",e);Modernizr.addTest("indexeddb",!!q),q&&Modernizr.addTest("indexeddb.deletedatabase","deleteDatabase"in q),a(),o(y),delete x.addTest,delete x.addAsyncTest;for(var H=0;H<Modernizr._q.length;H++)Modernizr._q[H]();e.Modernizr=Modernizr}(window,document);
;
"use strict";var imgEnsti=new Image,imgAudisis=new Image,imgCrece=new Image,imgDisecom=new Image,imgProgestion=new Image,logoEnsti=new Image,logoAudisis=new Image,logoCrece=new Image,logoDisecom=new Image,logoProgestion=new Image,logoProgestionWhite=new Image,svgClose=new Image,imageUrl="../themes/contrib/basic/images/source/";imgEnsti.src=imageUrl+"emp-ensti.jpg",imgAudisis.src=imageUrl+"emp-audisis.jpg",imgCrece.src=imageUrl+"emp-crece.jpg",imgDisecom.src=imageUrl+"emp-disecom.jpg",imgProgestion.src=imageUrl+"emp-progestion.jpg",logoEnsti.src=imageUrl+"svg/logo-ensti.svg",logoAudisis.src=imageUrl+"svg/logo-audisis.svg",logoCrece.src=imageUrl+"svg/logo-crece.svg",logoDisecom.src=imageUrl+"svg/logo-disecom.svg",logoProgestion.src=imageUrl+"svg/logo-progestion.svg",logoProgestionWhite.src=imageUrl+"svg/logo-progestion-white.svg",svgClose.src=imageUrl+"svg/icon-close.svg";var empresas={ensti:{img:imgEnsti,logo:logoEnsti,desc:"Reclutamiento, selección y contratación de personal.",link:"/empresas/ensti"},audisis:{img:imgAudisis,logo:logoAudisis,desc:"Desarrollo de tecnología e inteligencia de negocios.",link:"/empresas/audisis"},crece:{img:imgCrece,logo:logoCrece,desc:"Capacitaciones por código Sence o privadas.",link:"/empresas/crece"},disecom:{img:imgDisecom,logo:logoDisecom,desc:"Diseño, trade, marketing y producción",link:"/empresas/disecom"},progestion:{img:imgProgestion,logo:logoProgestion,logoWhite:logoProgestionWhite,desc:"Outsourcing y gestión integral",link:"/empresas/progestion"}};
;
"use strict";var empContainer=document.getElementById("js-emp");if(empContainer){var empTitle=document.createElement("div"),empGrid3col=document.createElement("div"),empGrid2col=document.createElement("div");empContainer.className="padding-3-0",empGrid3col.className="grid grid-3",empGrid2col.className="grid grid-2 margin-top-10",empTitle.innerHTML="\n <h5>Conoce nuestras áreas especializadas</h5>\n ",empGrid3col.innerHTML='\n <div class="card flex-start-start">\n <div class="card__img card__img-bg" style="background-image:url(\''+empresas.ensti.img.src+'\');"></div>\n <div class="card__info-area">\n <img class="card__logo" src="'+empresas.ensti.logo.src+'" alt="logo ensti">\n <h6>'+empresas.ensti.desc+'</h6>\n </div>\n <div class="card__actions">\n <a class="btn btn--outlined" href="'+empresas.ensti.link+'">Ver más</a>\n </div>\n </div>\n \n <div class="card flex-start-start">\n <div class="card__img card__img-bg" style="background-image:url(\''+empresas.audisis.img.src+'\');"></div>\n <div class="card__info-area">\n <img class="card__logo" src="'+empresas.audisis.logo.src+'" alt="logo audisis">\n <h6>'+empresas.audisis.desc+'</h6>\n </div>\n <div class="card__actions">\n <a class="btn btn--outlined" href="'+empresas.audisis.link+'">Ver más</a>\n </div>\n </div>\n \n <div class="card flex-start-start">\n <div class="card__img card__img-bg" style="background-image:url(\''+empresas.crece.img.src+'\');"></div> \n <div class="card__info-area">\n <img class="card__logo" src="'+empresas.crece.logo.src+'" alt="logo crece">\n <h6>'+empresas.crece.desc+'</h6>\n </div>\n <div class="card__actions">\n <a class="btn btn--outlined" href="'+empresas.crece.link+'">Ver más</a>\n </div>\n </div>\n ',empGrid2col.innerHTML='\n <div class="card flex-start-start">\n <div class="card__img card__img-bg" style="background-image:url(\''+empresas.disecom.img.src+'\');"></div>\n \n <div class="card__info-area">\n <img class="card__logo" src="'+empresas.disecom.logo.src+'" alt="logo disecom">\n <h6>'+empresas.disecom.desc+'</h6>\n </div>\n <div class="card__actions">\n <a class="btn btn--outlined" href="'+empresas.disecom.link+'">Ver más</a>\n </div>\n </div>\n <div class="card flex-start-start">\n <div class="card__img card__img-bg" style="background-image:url(\''+empresas.progestion.img.src+'\');"></div>\n <div class="card__info-area">\n <img class="card__logo" src="'+empresas.progestion.logo.src+'" alt="logo progestion">\n <h6>'+empresas.progestion.desc+'</h6>\n </div>\n <div class="card__actions">\n <a class="btn btn--outlined" href="'+empresas.progestion.link+'">Ver más</a>\n </div>\n </div>\n ',empContainer.appendChild(empTitle),empContainer.appendChild(empGrid3col),empContainer.appendChild(empGrid2col)}
;
"use strict";var contactInfoContainer=document.getElementById("js-contactcontainer"),contactInfoContent=document.createElement("div"),contactInfoImgPhone=new Image,contactInfoImgMail=new Image,contactInfoImgChile=new Image,contactInfoImgPeru=new Image;contactInfoContent.className="contact-info__content",contactInfoImgPhone.src=imageUrl+"svg/icon-phone.svg",contactInfoImgMail.src=imageUrl+"svg/icon-mail.svg",contactInfoImgChile.src=imageUrl+"bandera-chile.png",contactInfoImgPeru.src=imageUrl+"bandera-peru.png",contactInfoContent.innerHTML='\n<div class="contact-info__title"><h4 class="text__white">CONTÁCTANOS A:</h4></div>\n\n<div class="contact-info__content-box grid contact-info-grid">\n <div class="contact-info__box icon-mail">\n <img class="contact-info__icon" src="'+contactInfoImgMail.src+'" alt="icon mail">\n </div>\n <div class="contact-info__box chile-bandera">\n <img class="contact-info__bandera" src="'+contactInfoImgChile.src+'" alt="Bandera Chile">\n </div>\n <div class="contact-info__box chile-correo">\n <h6>comercial.chile@grupoprogestion.com</h6>\n </div>\n <div class="contact-info__box chile-bandera">\n <img class="contact-info__bandera" src="'+contactInfoImgChile.src+'" alt="Bandera Chile">\n </div>\n <div class="contact-info__box icon-phone">\n <img class="contact-info__icon" src="'+contactInfoImgPhone.src+'" alt="icon phone">\n </div>\n\n <div class="contact-info__box chile-telefono">\n <h6>Tel: (+56 2) 2433 6500</h6>\n </div>\n\n <div class="contact-info__box peru-bandera">\n <img class="contact-info__bandera" src="'+contactInfoImgPeru.src+'" alt="Bandera Peru">\n </div>\n <div class="contact-info__box peru-correo">\n <h6>comercial.peru@grupoprogestion.com</h6>\n </div>\n <div class="contact-info__box peru-bandera">\n <img class="contact-info__bandera" src="'+contactInfoImgPeru.src+'" alt="Bandera Peru">\n </div>\n <div class="contact-info__box peru-telefono">\n <h6>Tel: (+52) 55 5250 4056</h6>\n </div>\n</div>\n',contactInfoContainer&&contactInfoContainer.appendChild(contactInfoContent);
;
"use strict";var hdrContactInfo=document.getElementById("js-hdr-contact-info"),hdrContContent=document.createElement("div");hdrContactInfo&&(hdrContContent.className="hdr-contact__content",hdrContContent.innerHTML='\n <p><span>Casa Matriz:</span>Crescente Errázuriz 1875, Ñuñoa - Stgo, Chile</p>\n <p>Tel: (+56 2) 2433 6500</p>\n <p> <a href="https://www.one.grupoprogestion.com">Acceso Clientes</a></p>\n ',hdrContactInfo.appendChild(hdrContContent));
;
"use strict";var ftrSmallContainer=document.getElementById("js-footer-small"),ftrSmallcontent=document.createElement("div");ftrSmallcontent.className="footer-small__content",ftrSmallcontent.innerHTML='\n<div><p>Copyright Grupo Progestion Todos los derechos reservados.</p></div>\n<div>\n<a href="">Acceso Clientes</a>\n<a href="">Intranet</a>\n<a href="">Cloud Grupo</a>\n<a href="">Crece TV</a>\n<a href="">Liquidaciones</a>\n<a href="">Webmail Progestion</a>\n</div>\n',ftrSmallContainer.appendChild(ftrSmallcontent);
;
"use strict";var rrssContainer=document.getElementById("js-rrss__container"),rrssContent=document.createElement("div"),iconFacebook=new Image,iconInstagram=new Image,iconTwitter=new Image,iconLinkedin=new Image;iconFacebook.src=imageUrl+"svg/icon-facebook.svg",iconInstagram.src=imageUrl+"svg/icon-instagram.svg",iconTwitter.src=imageUrl+"svg/icon-twitter.svg",iconLinkedin.src=imageUrl+"svg/icon-linkedin.svg",rrssContent.className="rrss__content",rrssContent.innerHTML='\n <a href="https://www.facebook.com/GrupoProgestionChile/"><img class="icon" src="'+iconFacebook.src+'"/></a>\n <a href="https://www.instagram.com/grupoprogestionchile/"><img class="icon" src="'+iconInstagram.src+'"/></a>\n <a href="https://twitter.com/Progestion_com?lang=es"><img class="icon" src="'+iconTwitter.src+'"/></a>\n <a href="https://www.linkedin.com/company/grupo-progestion/"><img class="icon" src="'+iconLinkedin.src+'"/></a>\n',rrssContainer&&rrssContainer.appendChild(rrssContent);
;
"use strict";var anivId=document.getElementById("js-20-anos"),anivContent=document.createElement("div"),anivImg=new Image;anivContent.classList="grid grid-6 padding-1-0-1-0",anivImg.src=imageUrl+"svg/icon-20-anos.svg",anivContent.innerHTML='\n<div class="aniv__img">\n<img class="icon-bigger" src="'+anivImg.src+'" alt="20 Años de experiencia">\n</div>\n<div class="aniv__text flex-col-ss">\n<h2 class="color-primary">La confianza de nuestros clientes nos hace ser diferentes</h2>\n<p>Llevamos 20 años liderando el mercado internacional, ampliando nuestros servicios y profesionalizando diariamente a nuestro personal, este logro se debe al esfuerzo constante por innovar y la confianza que depositamos en nuetros colaboradores, además de la satisfación de nuetros clientes por los resultados obtenidos a lo largo del tiempo.</p>\n</div>\n',anivId&&anivId.appendChild(anivContent);var misionVisionId=document.getElementById("js-mision-vision"),misionVisionContent=document.createElement("div");misionVisionContent.classList="grid grid-6 padding-1-0-1-0",misionVisionContent.innerHTML='\n<div class="mision-vision__hero flex-col-ss">\n <h2 class="color-primary">Quienes somos</h2>\n <h3>Grupo Progestion, nace con el objetivo de entregar un servicio de alto valor y lograr sobre pasar las expectativas de nuestros Socios Comerciales, todo esto con innovación y mejora continua, incorporando tecnología en todos nuestros servicios.</h3>\n</div>\n<div class="mision-vision__text flex-col-ss">\n <h2 class="color-primary">Misión</h2>\n <p>Proveer servicios, productos y tecnologías con calidad internacional, bajo un enfoque de mejora y desarrollo de condiciones competitivas que nos fortalezcan en los mercados actuales y futuros, a través de un personal competente y comprometido.</p>\n <h2 class="color-primary">Visión</h2>\n <p>Consolidarnos como proveedores líderes de servicios integrales en los mercados que participamos, convirtiéndonos en una empresa reconocida por su prestigio internacional como una empresa innovadora, socialmente responsable y de vanguardia.</p>\n</div>\n',misionVisionId&&misionVisionId.appendChild(misionVisionContent);var valoresMainId=document.getElementById("js-valores-main"),valoresMainContent=document.createElement("div"),valoresIcon=new Image;valoresIcon.src=imageUrl+"svg/icon-copa.svg",valoresMainContent.className="grid grid-6 padding-1-0-1-0",valoresMainContent.innerHTML='\n<div class="valores-main flex-col-cc text-align-center">\n<img class="icon-big" alt="Copa" src="'+valoresIcon.src+'"/>\n<h2 class="color-primary">Nuestros Valores nos hacen diferentes</h2>\n<p>Somos una empresa seria, profesional y humana en sus tratos y con su entorno, respetamos el medio ambiente en cada acto que realizamos y mantenemos relaciones duraderas y responsables con todos nuestros clientes.</p>\n</div>\n',valoresMainId&&valoresMainId.appendChild(valoresMainContent);var valoresCardsId=document.getElementById("js-valores-cards"),valoresCardContent=document.createElement("div"),fomentoImg=new Image,valRespetoImg=new Image,valSatisfaccionImg=new Image,valCumplimientoImg=new Image;fomentoImg.src=imageUrl+"svg/icon-capacitaciones.svg",valRespetoImg.src=imageUrl+"svg/icon-hand.svg",valSatisfaccionImg.src=imageUrl+"svg/icon-satisfaccion.svg",valCumplimientoImg.src=imageUrl+"svg/icon-primeros.svg",valoresCardContent.className="grid grid-4 padding-1-0-1-0",valoresCardContent.innerHTML='\n<div class="card card__bg-blue flex-col-cc text-align-center padding-2-1-2-1">\n <img class="card__icon-60px" src="'+fomentoImg.src+'" alt="icon"/>\n <p class="text__white">El fomento al desarrollo profesional</p>\n</div>\n\n<div class="card card__bg-blue flex-col-cc text-align-center padding-2-1-2-1">\n <img class="card__icon-60px" src="'+valRespetoImg.src+'" alt="icon"/>\n <p class="text__white">El respeto a nuestros clientes y compañeros</p>\n</div>\n\n<div class="card card__bg-blue flex-col-cc text-align-center padding-2-1-2-1">\n <img class="card__icon-60px" src="'+valSatisfaccionImg.src+'" alt="icon"/>\n <p class="text__white">La satisfacción de nuestros clientes</p>\n</div>\n\n<div class="card card__bg-blue flex-col-cc text-align-center padding-2-1-2-1">\n <img class="card__icon-60px" src="'+valCumplimientoImg.src+'" alt="icon"/>\n <p class="text__white">El cumplimiento de nuetros compromisos</p>\n</div>\n',valoresCardsId&&valoresCardsId.appendChild(valoresCardContent);
;
"use strict";var sucurId=document.getElementById("js-sucursales"),sucurContent=document.createElement("div"),gpsImg=new Image,movilImg=new Image,sucurStgo=document.createElement("div"),sucurRegiones=document.createElement("div"),sucurInter=document.createElement("div");gpsImg.src=imageUrl+"svg/icon-gps.svg",movilImg.src=imageUrl+"svg/icon-phone.svg",sucurContent.className="sucursales__content",sucurStgo.className="padding-1-0-1-0",sucurRegiones.className="padding-1-0-1-0",sucurInter.className="padding-1-0-1-0",sucurStgo.innerHTML='\n<div class="title-bar padding-1-0-1-0"><h3>Sucursales</h3></div>\n<div><h4 class="text-align-center color-primary">Santiago</h4></div>\n<div class="grid grid-3">\n <div class="flex-col-ss">\n <h5 class="color-primary">Casa Matriz</h5>\n <p class="before-icon icon-gps">Crescente Errazuriz 1875, Ñuñoa.</p>\n <p class="before-icon icon-movil">Central: (+562) 2433 6500</p>\n </div>\n\n <div class="flex-col-ss">\n <h5 class="color-primary">Casa Matriz</h5>\n <p class="before-icon icon-gps">Crescente Errazuriz 1875, Ñuñoa.</p>\n <p class="before-icon icon-movil">Central: (+562) 2433 6500</p>\n </div>\n\n <div class="flex-col-ss">\n <h5 class="color-primary">Supply Chain Management</h5>\n <p class="before-icon icon-gps">Puerto Madero #9710 B.S.F Pudahuel.</p>\n <p class="before-icon icon-movil">Central: (+562) 2544 8658</p>\n </div>\n</div>\n',sucurRegiones.innerHTML='\n<div><h4 class="text-align-center color-primary">Regiones</h4></div>\n<div class="grid grid-4">\n\n <div class="flex-col-ss">\n <h5 class="color-primary">Iquique</h5>\n <p class="before-icon icon-gps">Sotomayor #575, Oficina 401</p>\n <p class="before-icon icon-movil">Central: (+56) (55) 2433 6500</p>\n </div>\n\n <div class="flex-col-ss">\n <h5 class="color-primary">Antofagasta</h5>\n <p class="before-icon icon-gps">Los Aromos 8874</p>\n <p class="before-icon icon-movil">Central: (+56) (55) 2423 732</p>\n </div>\n\n <div class="flex-col-ss">\n <h5 class="color-primary">La Serena</h5>\n <p class="before-icon icon-gps">Miguel Aguirre Perry #1833</p>\n <p class="before-icon icon-movil">Central: (+56) (51) 2560 627</p>\n </div>\n\n <div class="flex-col-ss">\n <h5 class="color-primary">Viña del Mar</h5>\n <p class="before-icon icon-gps">1 Norte #1579</p>\n <p class="before-icon icon-movil">Central: (+56) (02) 243 365 00</p>\n </div>\n\n <div class="flex-col-ss">\n <h5 class="color-primary">Talca</h5>\n <p class="before-icon icon-gps">8 Oriente #890</p>\n <p class="before-icon icon-movil">Central: (+56) (71) 2510 283</p>\n </div>\n\n <div class="flex-col-ss">\n <h5 class="color-primary">Concepción</h5>\n <p class="before-icon icon-gps">Los Aromos 8874</p>\n <p class="before-icon icon-movil">Central: (+56) (55) 2423 732</p>\n </div>\n\n <div class="flex-col-ss">\n <h5 class="color-primary">Temuco</h5>\n <p class="before-icon icon-gps">Phillippi #470</p>\n <p class="before-icon icon-movil">Central: (+56) (45) 465 794</p>\n </div>\n\n <div class="flex-col-ss">\n <h5 class="color-primary">Puerto Montt</h5>\n <p class="before-icon icon-gps">Serrano #210</p>\n <p class="before-icon icon-movil">Central: (+56) (65) 238 5454</p>\n </div>\n</div>\n',sucurInter.innerHTML='\n<div><h4 class="text-align-center color-primary">Internacional</h4></div>\n<div class="flex-col-cc">\n <div class="flex-col-ss">\n <h5 class="color-primary">Perú</h5>\n <p class="before-icon icon-gps">La Habana 160º, San Isidro</p>\n <p class="before-icon icon-movil">Central: (+51 1) 2405 945</p>\n </div>\n</div>\n',sucurContent&&(sucurContent.appendChild(sucurStgo),sucurContent.appendChild(sucurRegiones),sucurContent.appendChild(sucurInter)),sucurId&&sucurId.appendChild(sucurContent);
;
"use strict";var menuServicesId=document.getElementById("js-menu-services"),menuServicesContent=document.createElement("div"),servicesDataId=document.getElementById("js-services-data"),servicesHeroId=document.getElementById("js-services-hero"),serviceHeroContent=document.createElement("div"),serviceHeroLogo=new Image,serviceCreceImg=new Image,serviceProgestionImg=new Image,serviceEnstiImg=new Image,serviceDisecomImg=new Image,serviceAudisisImg=new Image;if(menuServicesId){servicesDataId.classList="padding-3-0",serviceHeroLogo.src=imageUrl+"svg/icon-360-blue.svg",serviceCreceImg.src=imageUrl+"emp-crece-650x260.jpg",serviceProgestionImg.src=imageUrl+"emp-progestion-650x260.jpg",serviceEnstiImg.src=imageUrl+"emp-ensti-650x260.jpg",serviceDisecomImg.src=imageUrl+"emp-disecom-650x260.jpg",serviceAudisisImg.src=imageUrl+"/emp-audisis-650x260.jpg",serviceHeroContent.innerHTML='\n <div class="grid grid-2--20-80 padding-3-0">\n <div class="">\n <img class="icon-big" src="'+serviceHeroLogo.src+'" alt="logo 360">\n </div>\n <div class="flex-col-cc">\n <h3 class="color-primary">Entregamos soluciones 360° en Marketing, Trade, Logística, Outsourcing, Tecnología y Capacitaciones.</h3>\n <p>Ofrecemos soluciones a medida de nuestros clientes, nos hacemos responsables de un proceso completo, o de una parte de éste, siempre con excelencia e innovación.</p>\n </div>\n </div>\n ',servicesHeroId&&servicesHeroId.appendChild(serviceHeroContent),menuServicesContent.innerHTML='\n <ul class="services-menu__ul flex-col-ss" id="js-menu-services-action">\n <li class="js-capture-id" id="disecom">Marketing,Trade y Bodegaje</li>\n <li class="js-capture-id" id="progestion">Outsourcing y gestión integral</li>\n <li class="js-capture-id" id="ensti">Servicios Transitorios</li>\n <li class="js-capture-id" id="crece">Capacitaciones</li>\n <li class="js-capture-id" id="audisis">Desarrollo de tecnología y BI</li>\n <li class="js-capture-id" id="progestion">Facility Services</li>\n </ul>\n ',menuServicesId&&menuServicesId.appendChild(menuServicesContent);var servicesData={progestion:{logo:logoProgestion,img:serviceProgestionImg.src,title:"Outsourcing y Servicios Integrales con 20 años de experiencia",desc:"Entidad especializada en poner a disposición de nuestros clientes, personal calificado y capacitado, que permita alcanzar los objetivos comerciales y operacionales de las empresas. Los servicios de Outsourcing o tercerización son una creciente realidad a nivel mundial.",services:"<li>Outsourcing</li><li>Gestión Integral</li><li>Promotoría</li><li>Implementación</li><li>KAM</li>",url:"/progestion"},disecom:{logo:logoDisecom,img:serviceDisecomImg.src,title:"Trade Marketing, Diseño y Supply Chain Management",desc:"Disecom ofrece una amplia variedad de servicios enfocados al trade marketing, diseño, producción y distribución, pensados para potenciar el PDV en todos los canales, asi como eventos especiales como ferias o eventos nacionales e internacionales.",services:"<li>Diseño y Producción</li><li>Representantes de Marca</li><li>Diseño y producción de Stands</li><li>Diseño de Material POP</li><li>Marketing</li><li>Digital Media y Diseño web</li><li>Producción Audiovisual</li><li>Trade Marketing</li><li>Implementación y Control de PDV</li><li>Auditoría en el PDV</li><li>Equipos Swatt de reposición</li><li>Focus Group, Inspector incognito</li><li>Levantamiento de Información y BBDD con estadísticas</li>",url:"/disecom"},ensti:{logo:logoEnsti,img:serviceEnstiImg.src,title:"Servicios Transitorios",desc:"Para eventos o campañas con fechas de termino definidas, licencias o remplazos.",services:"<li>Selección de personal</li><li>Capacitaciones</li><li>Selección de personal</li><li>Seguimiento</li>",url:"/ensti"},crece:{logo:logoCrece,img:serviceCreceImg.src,title:"Centro de Capacitaciones",desc:"Nuestras capacitaciones entregan mejores oportunidades, condiciones de vida, de trabajo e incrementa la productividad. Tenemos capacitaciones por Código Sence y particulares.",services:"<li>Cursos por código Sence o Privados</li><li>Salas Propias</li><li>OTEC Certificada ISO 9.001</li>",url:"/crece"},audisis:{logo:logoAudisis,img:serviceAudisisImg.src,title:"Tecnología e inteligencia de negocios",desc:"En AUDISIS estamos comprometidos y enfocados en que nuestros clientes crezcan y rentabilicen sus negocios, apoyándolos con herramientas tecnológicas customizables para la toma de decisiones estratégicas. Innovando e integrando nuestras soluciones de inteligencia y servicios de tecnología a los procesos claves del negocio de nuestros clientes.",services:"<li>inteligencia de negocios, integración de datos y analytics</li><li>Extracción, transformación y carga de información comercio exterior</li><li>CheckRoom: Plataforma móvil y ambiente web para el cliente destinado a levantar desde terreno información y disponibilizarla en dashboards de control online para clientes de promotoría.</li><li>Plataforma de gastos corporativos: Servicio web que facilita, agiliza y hace más robusto el proceso de rendición de gastos en la empresa. Gestiona las rendiciones de gastos y automatiza la administración de estos.</li><li>Desarrollo de aplicaciones web y móviles.</li><li>Nube corporativa para tu empresa.</li>",url:"/audisis"}},callService=function(e){e.preventDefault;var i=servicesData[e.currentTarget.id],s='\n <div class="service__emp">\n <div class="flex-row-ssb padding-1-0-1-0">\n <img class="icon-normal" src="'+i.logo.src+'" alt="logo">\n <a class="btn btn__secondary" href="'+i.url+'">Ir al sitio</a>\n </div>\n <img class="img-100w border-radius-8" src="'+i.img+'" alt="img">\n <h3 class="padding-1-0-1-0 color-primary">'+i.title+'</h3>\n <ul class="list-decorate">'+i.services+"</ul>\n </div>\n ";servicesDataId&&(servicesDataId.innerHTML=s)},menuServicesCaptId=Array.from(document.getElementsByClassName("js-capture-id"));menuServicesCaptId.map(function(e){return e.addEventListener("click",callService,!0)})}
;
"use strict";console.log("trabaja con nosotros");
;
"use strict";var eDisId=document.getElementById("js-emp-disecom"),eDisHeroId=document.getElementById("js-emp-disecom-hero"),eDisMenuId=document.getElementById("js-emp-disecom-menu"),eDisMenuContent=document.createElement("div"),eDisContainer=document.createElement("div");if(eDisHeroId){var eDisHeroContent=document.createElement("div"),imageUrl="./../themes/contrib/basic/images/source/",logo=new Image;logo.src=imageUrl+"svg/logo-disecom.svg",eDisHeroContent.innerHTML='\n <div class="flex-column-cc text-align-center padding-3-0">\n <img class="icon-bigger" src="'+logo.src+'" alt="Logo Disecom">\n <h1>Marketing, Trade y Logística a tu servicio.</h1>\n <p>¡Lleva tu estrategia comercial al PDV!</p>\n </div>\n ',eDisHeroId.appendChild(eDisHeroContent)}if(eDisMenuId){var selectTab=function(e){selectedTab&&(selectedTab.className="js-capture-id"),e.className="btn__deploy",selectedTab=e};eDisMenuContent.classList="top-bar__content",eDisMenuContent.innerHTML='\n <div class="flex-row-cse head-menu margin-bottom-2">\n <li onclick="selectTab(this)" class="js-capture-id" id="trademarketing"><p>Trade Marketing</p></li>\n <li onclick="selectTab(this)" class="js-capture-id" id="supplychainmanagement"><p>Supply Chain Management</p></li>\n <li onclick="selectTab(this)" class="js-capture-id" id="disenoyproduccion"><p>Diseño y Producción</p></li>\n </div>\n ',eDisMenuId.appendChild(eDisMenuContent);var eDisImgTrade=new Image,eDisImgSupply=new Image,eDisImgDiseno=new Image,eDisIconTrade=new Image,eDisIconSupply=new Image,eDisIconDiseno=new Image,_imageUrl="./../themes/contrib/basic/images/source/";eDisImgTrade.src=_imageUrl+"emp-disecom-bodega.jpg",eDisImgSupply.src=_imageUrl+"emp-disecom-bodega.jpg",eDisImgDiseno.src=_imageUrl+"emp-disecom-bodega.jpg",eDisIconTrade.src=_imageUrl+"svg/name.svg",eDisIconSupply.src=_imageUrl+"svg/name.svg",eDisIconDiseno.src=_imageUrl+"svg/name.svg";var tradeMarketingInfo='\n <div class="grid-2-no-gap">\n <div class="box-bg-img" style="background-image:url(\''+eDisImgTrade.src+'\');"></div>\n <div class="flex-col-sc padding-3-2">\n <h1>Implementación y Control de PDV</h1>\n <h4>junto con auditorías y Equipos Swatt de posición, realizamos visitas según ruta logrando eficiencia en tiempo-recurso y cobertura.</h4>\n </div>\n </div>\n\n <div class="grid-2-no-gap">\n <div class="flex-col-sc padding-3-2">\n <h1>Equipos Trade Marketing exclusivos y/o por evento.</h1>\n <h4>Llevamos acabo tu campaña con equipos capacitados</h4>\n </div>\n <div class="box-bg-img" style="background-image:url(\''+eDisImgTrade.src+'\');"></div>\n </div>\n\n <div class="grid-2-no-gap">\n <div class="box-bg-img" style="background-image:url(\''+eDisImgTrade.src+'\');"></div>\n <div class="flex-col-sc padding-3-2">\n <h1>Levantamiento para generación de BBDD y estadística.</h1>\n <h4>Levantamiento para generación de BBDD y estadística y Plan estratégico de visitas por zonas (Barrido).</h4>\n </div>\n </div>\n\n <div class="grid-2-no-gap">\n <div class="flex-col-sc padding-3-2">\n <h1>Focus Group e Inspector incógnito</h1>\n <h4>Descubre lo que realmente pasa en el PDV</h4>\n </div>\n <div class="box-bg-img" style="background-image:url(\''+eDisImgTrade.src+"');\"></div>\n </div>\n ",supplyChainManagementInfo='\n <div class="grid-2-no-gap">\n <div class="box-bg-img" style="background-image:url(\''+eDisImgTrade.src+'\');"></div>\n <div class="flex-col-sc padding-3-2">\n <h1>Almacenamiento</h1>\n <h4>Nuestro Centro de Distribución se encuentra dentro del Centro Logístico de Puerto Madero (Bodegas San Francisco). El punto ideal para atender redes de distribución con acceso directo a la Ruta 68, Alameda, Américo Vespucio y Costanera Norte. Cuenta con 4.600 mt² con Almacenamiento tipo Rack y a Piso para cargas sobredimensionadas.</h4>\n </div>\n </div>\n <div class="grid-2-no-gap">\n <div class="flex-col-sc padding-3-2">\n <h1>Logística de despacho.</h1>\n <h4>Cuenta con amplia diversidad de para su Logística de despachos, de acuerdo a tus necesidades (Motos, Camionetas, Camiones, etc.). A nivel nacional tenemos alianza con nuestra Empresa Interna TRANSPRO, como también con importantes Courier a nivel nacional.</h4>\n </div>\n <div class="box-bg-img" style="background-image:url(\''+eDisImgTrade.src+'\');"></div>\n </div>\n <div class="grid-2-no-gap">\n <div class="box-bg-img" style="background-image:url(\''+eDisImgTrade.src+'\');"></div>\n <div class="flex-col-sc padding-3-2">\n <h1>Maquila</h1>\n <h4>Servicio destinado a la preparación, transformación, elaboración o reparación de mercancías. Esta área se enfoca en entregar valor agregado a los procesos logísticos de nuestros Clientes. Disecom cuenta con procesos estructurados para cada necesidad de los servicios.</h4>\n </div>\n </div>\n <div class="grid-2-no-gap">\n <div class="flex-col-sc padding-3-2">\n <h1>Reportes on-line y trazabilidad.</h1>\n <h4>Sistema de gestión logístico WMS, cuenta con: Control de Stock On Line, Apertura de control de Stock por (Propietario, Categoría, Familia, SKU, Ficha técnica, Valorización, etc.), Control de fecha vencimiento o permanencia de Productos, Muebles, POP.</h4>\n </div>\n <div class="box-bg-img" style="background-image:url(\''+eDisImgTrade.src+"');\"></div>\n </div>\n ",disenoyProduccionInfo='\n<div class="grid-2-no-gap">\n<div class="box-bg-img" style="background-image:url(\''+eDisImgTrade.src+'\');"></div>\n<div class="flex-col-sc padding-3-2">\n <h1>Diseño y Producción.</h1>\n <h4>Adaptamos y creamos piezas gráficas para variedad de soportes comerciales.</h4>\n</div>\n</div>\n<div class="grid-2-no-gap">\n<div class="flex-col-sc padding-3-2">\n <h1>Promotoría y gestores de venta</h1>\n <h4>Potencia tus ventas en el PDV con la mejor seleccion de gestores de venta.</h4>\n</div>\n<div class="box-bg-img" style="background-image:url(\''+eDisImgTrade.src+'\');"></div>\n</div>\n<div class="grid-2-no-gap">\n<div class="box-bg-img" style="background-image:url(\''+eDisImgTrade.src+'\');"></div>\n<div class="flex-col-sc padding-3-2">\n <h1>Stands y Eventos</h1>\n <h4>Diseño de stands y producción de eventos con anfitriones de marca, dínamicas, sampling y reportes audiovisuales.</h4>\n</div>\n</div>\n<div class="grid-2-no-gap">\n<div class="flex-col-sc padding-3-2">\n <h1>Social media y Web</h1>\n <h4>Diseño de campañas para RRSS, Landing Pages y sitios escalables y auto-administrables.</h4>\n</div>\n<div class="box-bg-img" style="background-image:url(\''+eDisImgTrade.src+"');\"></div>\n</div>\n",callService=function(e){e.preventDefault;var a=[e.currentTarget.id];"trademarketing"==a?eDisId.innerHTML=tradeMarketingInfo:"supplychainmanagement"==a?eDisId.innerHTML=supplyChainManagementInfo:"disenoyproduccion"==a&&(eDisId.innerHTML=disenoyProduccionInfo)},menuServicesCaptId=Array.from(document.getElementsByClassName("js-capture-id"));menuServicesCaptId.map(function(e){return e.addEventListener("click",callService,!0)});var selectedTab=null;eDisId.innerHTML=tradeMarketingInfo}
;
"use strict";var eAudisisId=document.getElementById("js-emp-audisis-content"),eAudisisHeroId=document.getElementById("js-emp-audisis-hero"),eAudisisContainer=document.createElement("div");if(eAudisisHeroId){var eAudisisHeroContent=document.createElement("div"),imageUrl="./../themes/contrib/basic/images/source/",logo=new Image;logo.src=imageUrl+"svg/logo-audisis.svg",eAudisisHeroContent.innerHTML='\n <div data-aos="fade-in" class="flex-column-cc text-align-center padding-3-0 max-w-720">\n <img class="icon-bigger margin-bottom-2" src="'+logo.src+'" alt="Logo Audisisecom">\n <h4>Comprometidos en que nuestros clientes crezcan, apoyándolos con herramientas tecnológicas customizables para la toma de decisiones estratégicas</h4>\n </div>\n ',eAudisisHeroId.appendChild(eAudisisHeroContent)}if(eAudisisId){var _imageUrl="./../themes/contrib/basic/images/source/",imgOne=new Image,imgTwo=new Image,imgTree=new Image;imgOne.src=_imageUrl+"audisis/audisis-1.jpg",imgTwo.src=_imageUrl+"audisis/audisis-2.jpg",imgTree.src=_imageUrl+"audisis/audisis-3.jpg";var sSoftware=document.createElement("div");sSoftware.innerHTML='\n <div class="grid grid-service audisis-service-1 padding-1-0-1-0">\n <div data-aos="fade-in" data-aos-delay="100" data-aos-duration="1000" class="grid-image-one">\n <img src="'+imgOne.src+'" alt="Imagen Desarrollo de Software">\n </div> \n <div data-aos="fade-up" data-aos-delay="140" data-aos-duration="1400" class="grid-box-one box box__audisis flex-col-ss">\n <pre>Tecnología</pre>\n <h4>Desarrollo de software</h4>\n <p>Se busca integrar de forma transversal la gestión del punto de venta en relación con la visibilidad de los resultados para la toma de decisiones, la comunicación con la fuerza de venta, capacitación directamente desde la aplicación móvil, logística y reportes.</p>\n <a href="#">SABER MÁS</a>\n </div>\n </div>\n ';var sBi=document.createElement("div");sBi.innerHTML='\n <div class="grid grid-service audisis-service-1 padding-3-0-3-0">\n <div data-aos="fade-in" data-aos-delay="100" data-aos-duration="1000" class="grid-image-two">\n <img src="'+imgTwo.src+'" alt="Imagen Business Inteligence">\n </div> \n <div data-aos="fade-up" data-aos-delay="140" data-aos-duration="1400" class="grid-box-two box box__audisis flex-col-ss">\n <pre>Inteligencia</pre>\n <h4>Business Inteligence</h4>\n <p>Se busca integrar de forma transversal la gestión del punto de venta en relación con la visibilidad de los resultados para la toma de decisiones, la comunicación con la fuerza de venta, capacitación directamente desde la aplicación móvil.</p>\n <a href="#">SABER MÁS</a>\n </div>\n </div>\n ',eAudisisId.appendChild(sSoftware),eAudisisId.appendChild(sBi)}
;
"use strict";var eEnstiId=document.getElementById("js-emp-ensti-content"),eEnstiHeroId=document.getElementById("js-emp-ensti-hero"),eEnstiContainer=document.createElement("div");if(eEnstiHeroId){var eEnstiHeroContent=document.createElement("div"),imageUrl="./../themes/contrib/basic/images/source/",logo=new Image;logo.src=imageUrl+"svg/logo-ensti.svg",eEnstiHeroContent.innerHTML='\n <div class="flex-column-cc text-align-center padding-3-0 max-w-720">\n <img class="icon-bigger margin-bottom-2" src="'+logo.src+'" alt="Logo Enstiecom">\n <h2>Servicios Transitorios</h2>\n <p>Suministramos trabajadores para que cumplan una labor determinada de carácter transitorio o ocasional.</p>\n </div>\n ',eEnstiHeroId.appendChild(eEnstiHeroContent)}if(eEnstiId){var eEnstiImgTrade=new Image,eEnstiImgSupply=new Image,eEnstiImgEnsti=new Image,_imageUrl="./../themes/contrib/basic/images/source/";eEnstiImgTrade.src=_imageUrl+"emp-ensti.jpg",eEnstiImgSupply.src=_imageUrl+"emp-ensti.jpg",eEnstiImgEnsti.src=_imageUrl+"emp-ensti.jpg";var enstiInfo='\n <div class="grid-2-no-gap">\n <div class="box-bg-img" style="background-image:url(\''+eEnstiImgTrade.src+'\');"></div>\n <div class="flex-col-sc padding-3-2">\n <h3>Desarrollo de software</h3>\n <h5>Se busca integrar de forma transversal la gestión del punto de venta en relación con la visibilidad de los resultados para la toma de decisiones, la comunicación con la fuerza de venta, capacitación directamente desde la aplicación móvil, logística y reportes de venta con ayuda de nuestro servicio de inteligencia de negocios y nuestra aplicación Ensti App.</h5>\n </div>\n </div>\n\n <div class="grid-2-no-gap">\n <div class="flex-col-sc padding-3-2">\n <h3>Servicio de extracción, transformación y carga de información comercio exterior.</h3>\n <h5>Panel de control online que despliega la información sobre importaciones y exportaciones de comercio exterior relacionados con el negocio del cliente y su competencia.</h5>\n </div>\n <div class="box-bg-img" style="background-image:url(\''+eEnstiImgTrade.src+"');\"></div>\n </div>\n ";eEnstiId.innerHTML=enstiInfo}
;
"use strict";var eProgestionId=document.getElementById("js-emp-progestion-content"),eProgestionHeroId=document.getElementById("js-emp-progestion-hero"),eProgestionMenuId=document.getElementById("js-emp-progestion-menu"),eProgestionMenuContent=document.createElement("div"),eProgestionContainer=document.createElement("div");if(eProgestionHeroId){var eProgestionHeroContent=document.createElement("div");eProgestionHeroContent.innerHTML='\n <div class="hero__container" style="background-image: url('+empresas.progestion.img.src+');">\n <div class="padding-3-2 hero__content hero__content--progestion">\n <div class="hero__box flex-col-cc">\n <object class="hero__logo" data="'+empresas.progestion.logoWhite.src+'" type="image/svg+xml"></object>\n <h4>Líderes en gestión integral</h4>\n <p>Empresa Orientada a ser parte estratégica de cada cliente como un socio comercial en cada recurso contratado, profesionalizando sus roles y resultados todos enfocados en los KPI del cliente</p>\n </div>\n </div>\n </div>\n ',eProgestionHeroId.appendChild(eProgestionHeroContent)}if(eProgestionMenuId){var selectTab=function(e){selectedTab&&(selectedTab.className="js-capture-id"),e.className="btn__deploy",selectedTab=e};eProgestionMenuContent.classList="sidebar_second",eProgestionMenuContent.innerHTML='\n <div class="flex-col-ss">\n <li onclick="selectTab(this)" class="js-capture-id" id="service1"><p>Outsourcing</p></li>\n <li onclick="selectTab(this)" class="js-capture-id" id="service2"><p>Área Distribución</p></li>\n <li onclick="selectTab(this)" class="js-capture-id" id="service3"><p>Área salud</p></li>\n </div>\n ',eProgestionMenuId.appendChild(eProgestionMenuContent);var service1Info='\n <div class="flex-col-ss">\n <div class="box-bg-img" style="background-image:url(\''+empresas.progestion.img.src+'\');"></div>\n <div class="flex-col-sc padding-3-2">\n <h1>Nuestro Principal foco, es apoyar con la mayor eficiencia en diferente servicios a nuestros cliente</h1>\n <h4>Reposición, KAM -KAS, BI, vendedores, supervisores, jefaturas y mucho más.</h4>\n </div>\n <div class="flex-col-sc padding-3-2">\n <h1>Auditoría y toma de data en cada PDV</h1>\n <h4>en base a necesidad y medida de cada cliente.</h4>\n </div>\n <div class="flex-col-sc padding-3-2">\n <h1>Personal exclusivo</h1>\n <h4>Con cobertura en todo el país, ofrecemos personal exclusivo o compartido por cuenta según los requerimientos de cada cliente.</h4>\n </div>\n <div class="flex-col-sc padding-3-2">\n <h1>Mejoras continuas</h1>\n <h4>Enfocadas en los RRHH, selección y escuelas de entrenamiento</h4>\n </div>\n <div class="flex-col-sc padding-3-2">\n <h1>Apoyo en TMKG y gestión BI</h1>\n <h4>Reportes on-line en base a los KPI\'s definidos por el cliente</h4>\n </div>\n </div>\n ',service2Info='\n <div class="grid-2-no-gap">\n <div class="box-bg-img" style="background-image:url(\''+eProgestionImg.src+'\');"></div>\n <div class="flex-col-sc padding-3-2">\n <h1>Cobertura nacional</h1>\n <h4>contamos con cobertura total para todos los cargos</h4>\n </div>\n </div>\n <div class="grid-2-no-gap">\n <div class="flex-col-sc padding-3-2">\n <h1>Supervisión constante</h1>\n <h4>junto con apoyo del Área de Prevención de Riesgo y RRHH.</h4>\n </div>\n <div class="box-bg-img" style="background-image:url(\''+eProgestionImg.src+'\');"></div>\n </div>\n <div class="grid-2-no-gap">\n <div class="box-bg-img" style="background-image:url(\''+eProgestionImg.src+'\');"></div>\n <div class="flex-col-sc padding-3-2">\n <h1>Cargos definidos</h1>\n <h4>Bodegueros, manejadores de maquinaría yales, grúas etc. Supervisores, prevencionistas de riesgo, área de administración, jefaturas y más.</h4>\n </div>\n </div>\n ',service3Info='\n <div class="grid-2-no-gap">\n <div class="box-bg-img" style="background-image:url(\''+eProgestionImg.src+'\');"></div>\n <div class="flex-col-sc padding-3-2">\n <h1>Estamos en todos los centros médicos</h1>\n <h4>Consultas, farmacias y laboratorios con distintos cargos y roles</h4>\n </div>\n </div>\n <div class="grid-2-no-gap">\n <div class="flex-col-sc padding-3-2">\n <h1>Mejoras continuas y capacitaciones personalizadas</h1>\n <h4>Enfocadas a potenciar las habilidades y mejorar la debilidades de los seleccionados</h4>\n </div>\n <div class="box-bg-img" style="background-image:url(\''+eProgestionImg.src+'\');"></div>\n </div>\n <div class="grid-2-no-gap">\n <div class="box-bg-img" style="background-image:url(\''+eProgestionImg.src+'\');"></div>\n <div class="flex-col-sc padding-3-2">\n <h1>Con cargos definidos</h1>\n <h4>Arsenaleras, asistentes quirúrgicos, matronas, visitantes médicos, nutricionistas, veterinarios, jefaturas, encargads de pabellón y más.</h4>\n </div>\n </div>\n ',callService=function(e){e.preventDefault;var n=[e.currentTarget.id];"service1"==n?eProgestionId.innerHTML=service1Info:"service2"==n?eProgestionId.innerHTML=service2Info:"service3"==n&&(eProgestionId.innerHTML=service3Info)},menuServicesCaptId=Array.from(document.getElementsByClassName("js-capture-id"));menuServicesCaptId.map(function(e){return e.addEventListener("click",callService,!0)});var selectedTab=null;eProgestionId.innerHTML=service1Info}
;
"use strict";var hamburgerMenu=document.getElementById("js-hamburger-menu");hamburgerMenu.classList="hamburger-menu";var injectMenu=function(e){e<720?console.log("Se inyectó el menú"):console.log("se borró")},callMenu=function(){document.getElementById("js-main-menu").classList.toggle("main-menu__active")};hamburgerMenu&&(window.addEventListener("resize",function(e){injectMenu(window.innerWidth)}),hamburgerMenu.addEventListener("click",function(e){callMenu()}));var mainMenuContainerId=document.getElementById("js-main-menu"),mainMenuContent=document.createElement("div");mainMenuContent.classList="menu--main__content",mainMenuContent.innerHTML='\n<ul>\n<li><a href="/inicio">Inicio</a></li>\n<li class="relative js-toggle" id="js-toggle"><a id="js-main-menu-empresas" href="javascript:void(0)" role="button">Empresas</a></li>\n<li><a href="/servicios">Servicios</a></li>\n<li><a href="/nosotros">Nosotros</a></li>\n<li><a href="/blog">Blog</a></li>\n<li><a href="/trabaja-con-nosotros">Cantidatos</a></li>\n<li><a href="/contacto">Contacto</a></li>\n</ul>\n',mainMenuContainerId&&mainMenuContainerId.appendChild(mainMenuContent);var menuId=document.getElementById("js-main-menu-empresas"),empBoxContainer=document.createElement("div"),empBoxContent=document.createElement("div"),empBoxEffect=document.createElement("div");if(empBoxContainer.classList="sub-menu menu-float__container flex-col-cc",empBoxContent.classList="menu-float__content",empBoxEffect.classList="menu-float__effect",menuId&&(empBoxEffect.innerHTML='<div class="menu-float__effect blur" id="js-blur-effect"></div>'),menuId){empBoxContent.innerHTML='\n <div class="grid grid-auto-48px relative">\n <h3>Todas nuestras empresas forman parte de nuestra visión 360.</h3>\n <div id="js-close-popup" class="flex-col-ss"><img src="'+svgClose.src+'" alt="cerrar"></div>\n </div>\n <div class="grid grid-3">\n <div class="flex-col-ss padding-1-5rem sub-menu-box">\n <img src="'+logoProgestion.src+'" alt="logo progestion">\n <p>Outsourcing, selección y gestión integral.</p>\n <a class="btn btn--outlined" href="'+empresas.progestion.link+'">conocer más</a>\n </div>\n <div class="flex-col-ss padding-1-5rem sub-menu-box">\n <img src="'+logoEnsti.src+'" alt="logo ensti">\n <p>Servicios Transitorios y subcontratación.</p>\n <a class="btn btn--outlined" href="'+empresas.ensti.link+'">Más información</a>\n </div>\n <div class="flex-col-ss padding-1-5rem sub-menu-box">\n <img src="'+logoAudisis.src+'" alt="logo audisis">\n <p>Desarrollo de tecnología e inteligencia de negocios.</p>\n <a class="btn btn--outlined" href="'+empresas.audisis.link+'">Más información</a>\n </div>\n <div class="flex-col-ss padding-1-5rem sub-menu-box">\n <img src="'+logoCrece.src+'" alt="logo crece">\n <p>Capacitaciones por código Sence o privadas.</p>\n <a class="btn btn--outlined" href="'+empresas.crece.link+'">Más información</a>\n </div>\n <div class="flex-col-ss padding-1-5rem sub-menu-box">\n <img src="'+logoDisecom.src+'" alt="logo disecom">\n <p>Outsourcing, selección y gestión integral</p>\n <a class="btn btn--outlined" href="'+empresas.disecom.link+'">Más información</a>\n </div>\n <div class="flex-col-ss padding-1-5rem sub-menu-box">\n <img src="" alt="logo facility services">\n <p>Compra reservas y cotizaciones</p>\n <a class="btn btn--outlined" href="">Más información</a>\n </div>\n </div>\n ',empBoxContainer.appendChild(empBoxContent),empBoxContainer.appendChild(empBoxEffect);var eToggle=document.getElementById("js-toggle"),popUp=document.getElementById("js-pop-up");menuId.addEventListener("click",function(e){e.preventDefault,e.stopPropagation,eToggle.classList.contains("js-toggle")?(popUp.appendChild(empBoxContainer),eToggle.classList.replace("js-toggle","js-toggle-active")):eToggle.classList.contains("js-toggle-active")&&(popUp.removeChild(empBoxContainer),eToggle.classList.replace("js-toggle-active","js-toggle")),document.getElementById("js-close-popup").addEventListener("click",function(e){!eToggle.contains(event.target)&&eToggle.classList.contains("js-toggle-active")&&(popUp.removeChild(empBoxContainer),eToggle.classList.replace("js-toggle-active","js-toggle"))})})}
;
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.AOS=t():e.AOS=t()}(this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var i=n[o]={exports:{},id:o,loaded:!1};return e[o].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="dist/",t(0)}([function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},r=n(1),a=(o(r),n(6)),u=o(a),c=n(7),f=o(c),s=n(8),d=o(s),l=n(9),p=o(l),m=n(10),b=o(m),v=n(11),y=o(v),g=n(14),h=o(g),w=[],k=!1,x={offset:120,delay:0,easing:"ease",duration:400,disable:!1,once:!1,startEvent:"DOMContentLoaded",throttleDelay:99,debounceDelay:50,disableMutationObserver:!1},j=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e&&(k=!0),k)return w=(0,y.default)(w,x),(0,b.default)(w,x.once),w},O=function(){w=(0,h.default)(),j()},_=function(){w.forEach(function(e,t){e.node.removeAttribute("data-aos"),e.node.removeAttribute("data-aos-easing"),e.node.removeAttribute("data-aos-duration"),e.node.removeAttribute("data-aos-delay")})},S=function(e){return e===!0||"mobile"===e&&p.default.mobile()||"phone"===e&&p.default.phone()||"tablet"===e&&p.default.tablet()||"function"==typeof e&&e()===!0},z=function(e){x=i(x,e),w=(0,h.default)();var t=document.all&&!window.atob;return S(x.disable)||t?_():(document.querySelector("body").setAttribute("data-aos-easing",x.easing),document.querySelector("body").setAttribute("data-aos-duration",x.duration),document.querySelector("body").setAttribute("data-aos-delay",x.delay),"DOMContentLoaded"===x.startEvent&&["complete","interactive"].indexOf(document.readyState)>-1?j(!0):"load"===x.startEvent?window.addEventListener(x.startEvent,function(){j(!0)}):document.addEventListener(x.startEvent,function(){j(!0)}),window.addEventListener("resize",(0,f.default)(j,x.debounceDelay,!0)),window.addEventListener("orientationchange",(0,f.default)(j,x.debounceDelay,!0)),window.addEventListener("scroll",(0,u.default)(function(){(0,b.default)(w,x.once)},x.throttleDelay)),x.disableMutationObserver||(0,d.default)("[data-aos]",O),w)};e.exports={init:z,refresh:j,refreshHard:O}},function(e,t){},,,,,function(e,t){(function(t){"use strict";function n(e,t,n){function o(t){var n=b,o=v;return b=v=void 0,k=t,g=e.apply(o,n)}function r(e){return k=e,h=setTimeout(s,t),_?o(e):g}function a(e){var n=e-w,o=e-k,i=t-n;return S?j(i,y-o):i}function c(e){var n=e-w,o=e-k;return void 0===w||n>=t||n<0||S&&o>=y}function s(){var e=O();return c(e)?d(e):void(h=setTimeout(s,a(e)))}function d(e){return h=void 0,z&&b?o(e):(b=v=void 0,g)}function l(){void 0!==h&&clearTimeout(h),k=0,b=w=v=h=void 0}function p(){return void 0===h?g:d(O())}function m(){var e=O(),n=c(e);if(b=arguments,v=this,w=e,n){if(void 0===h)return r(w);if(S)return h=setTimeout(s,t),o(w)}return void 0===h&&(h=setTimeout(s,t)),g}var b,v,y,g,h,w,k=0,_=!1,S=!1,z=!0;if("function"!=typeof e)throw new TypeError(f);return t=u(t)||0,i(n)&&(_=!!n.leading,S="maxWait"in n,y=S?x(u(n.maxWait)||0,t):y,z="trailing"in n?!!n.trailing:z),m.cancel=l,m.flush=p,m}function o(e,t,o){var r=!0,a=!0;if("function"!=typeof e)throw new TypeError(f);return i(o)&&(r="leading"in o?!!o.leading:r,a="trailing"in o?!!o.trailing:a),n(e,t,{leading:r,maxWait:t,trailing:a})}function i(e){var t="undefined"==typeof e?"undefined":c(e);return!!e&&("object"==t||"function"==t)}function r(e){return!!e&&"object"==("undefined"==typeof e?"undefined":c(e))}function a(e){return"symbol"==("undefined"==typeof e?"undefined":c(e))||r(e)&&k.call(e)==d}function u(e){if("number"==typeof e)return e;if(a(e))return s;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(l,"");var n=m.test(e);return n||b.test(e)?v(e.slice(2),n?2:8):p.test(e)?s:+e}var c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f="Expected a function",s=NaN,d="[object Symbol]",l=/^\s+|\s+$/g,p=/^[-+]0x[0-9a-f]+$/i,m=/^0b[01]+$/i,b=/^0o[0-7]+$/i,v=parseInt,y="object"==("undefined"==typeof t?"undefined":c(t))&&t&&t.Object===Object&&t,g="object"==("undefined"==typeof self?"undefined":c(self))&&self&&self.Object===Object&&self,h=y||g||Function("return this")(),w=Object.prototype,k=w.toString,x=Math.max,j=Math.min,O=function(){return h.Date.now()};e.exports=o}).call(t,function(){return this}())},function(e,t){(function(t){"use strict";function n(e,t,n){function i(t){var n=b,o=v;return b=v=void 0,O=t,g=e.apply(o,n)}function r(e){return O=e,h=setTimeout(s,t),_?i(e):g}function u(e){var n=e-w,o=e-O,i=t-n;return S?x(i,y-o):i}function f(e){var n=e-w,o=e-O;return void 0===w||n>=t||n<0||S&&o>=y}function s(){var e=j();return f(e)?d(e):void(h=setTimeout(s,u(e)))}function d(e){return h=void 0,z&&b?i(e):(b=v=void 0,g)}function l(){void 0!==h&&clearTimeout(h),O=0,b=w=v=h=void 0}function p(){return void 0===h?g:d(j())}function m(){var e=j(),n=f(e);if(b=arguments,v=this,w=e,n){if(void 0===h)return r(w);if(S)return h=setTimeout(s,t),i(w)}return void 0===h&&(h=setTimeout(s,t)),g}var b,v,y,g,h,w,O=0,_=!1,S=!1,z=!0;if("function"!=typeof e)throw new TypeError(c);return t=a(t)||0,o(n)&&(_=!!n.leading,S="maxWait"in n,y=S?k(a(n.maxWait)||0,t):y,z="trailing"in n?!!n.trailing:z),m.cancel=l,m.flush=p,m}function o(e){var t="undefined"==typeof e?"undefined":u(e);return!!e&&("object"==t||"function"==t)}function i(e){return!!e&&"object"==("undefined"==typeof e?"undefined":u(e))}function r(e){return"symbol"==("undefined"==typeof e?"undefined":u(e))||i(e)&&w.call(e)==s}function a(e){if("number"==typeof e)return e;if(r(e))return f;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(d,"");var n=p.test(e);return n||m.test(e)?b(e.slice(2),n?2:8):l.test(e)?f:+e}var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c="Expected a function",f=NaN,s="[object Symbol]",d=/^\s+|\s+$/g,l=/^[-+]0x[0-9a-f]+$/i,p=/^0b[01]+$/i,m=/^0o[0-7]+$/i,b=parseInt,v="object"==("undefined"==typeof t?"undefined":u(t))&&t&&t.Object===Object&&t,y="object"==("undefined"==typeof self?"undefined":u(self))&&self&&self.Object===Object&&self,g=v||y||Function("return this")(),h=Object.prototype,w=h.toString,k=Math.max,x=Math.min,j=function(){return g.Date.now()};e.exports=n}).call(t,function(){return this}())},function(e,t){"use strict";function n(e,t){var n=window.document,r=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver,a=new r(o);i=t,a.observe(n.documentElement,{childList:!0,subtree:!0,removedNodes:!0})}function o(e){e&&e.forEach(function(e){var t=Array.prototype.slice.call(e.addedNodes),n=Array.prototype.slice.call(e.removedNodes),o=t.concat(n).filter(function(e){return e.hasAttribute&&e.hasAttribute("data-aos")}).length;o&&i()})}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){};t.default=n},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(){return navigator.userAgent||navigator.vendor||window.opera||""}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i,a=/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i,u=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i,c=/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i,f=function(){function e(){n(this,e)}return i(e,[{key:"phone",value:function(){var e=o();return!(!r.test(e)&&!a.test(e.substr(0,4)))}},{key:"mobile",value:function(){var e=o();return!(!u.test(e)&&!c.test(e.substr(0,4)))}},{key:"tablet",value:function(){return this.mobile()&&!this.phone()}}]),e}();t.default=new f},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t,n){var o=e.node.getAttribute("data-aos-once");t>e.position?e.node.classList.add("aos-animate"):"undefined"!=typeof o&&("false"===o||!n&&"true"!==o)&&e.node.classList.remove("aos-animate")},o=function(e,t){var o=window.pageYOffset,i=window.innerHeight;e.forEach(function(e,r){n(e,i+o,t)})};t.default=o},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(12),r=o(i),a=function(e,t){return e.forEach(function(e,n){e.node.classList.add("aos-init"),e.position=(0,r.default)(e.node,t.offset)}),e};t.default=a},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(13),r=o(i),a=function(e,t){var n=0,o=0,i=window.innerHeight,a={offset:e.getAttribute("data-aos-offset"),anchor:e.getAttribute("data-aos-anchor"),anchorPlacement:e.getAttribute("data-aos-anchor-placement")};switch(a.offset&&!isNaN(a.offset)&&(o=parseInt(a.offset)),a.anchor&&document.querySelectorAll(a.anchor)&&(e=document.querySelectorAll(a.anchor)[0]),n=(0,r.default)(e).top,a.anchorPlacement){case"top-bottom":break;case"center-bottom":n+=e.offsetHeight/2;break;case"bottom-bottom":n+=e.offsetHeight;break;case"top-center":n+=i/2;break;case"bottom-center":n+=i/2+e.offsetHeight;break;case"center-center":n+=i/2+e.offsetHeight/2;break;case"top-top":n+=i;break;case"bottom-top":n+=e.offsetHeight+i;break;case"center-top":n+=e.offsetHeight/2+i}return a.anchorPlacement||a.offset||isNaN(t)||(o=t),n+o};t.default=a},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){for(var t=0,n=0;e&&!isNaN(e.offsetLeft)&&!isNaN(e.offsetTop);)t+=e.offsetLeft-("BODY"!=e.tagName?e.scrollLeft:0),n+=e.offsetTop-("BODY"!=e.tagName?e.scrollTop:0),e=e.offsetParent;return{top:n,left:t}};t.default=n},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){return e=e||document.querySelectorAll("[data-aos]"),Array.prototype.map.call(e,function(e){return{node:e}})};t.default=n}])});;
"use strict";console.log("scripts"),AOS.init();
;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function (Drupal, drupalSettings) {
Drupal.behaviors.activeLinks = {
attach: function attach(context) {
var path = drupalSettings.path;
var queryString = JSON.stringify(path.currentQuery);
var querySelector = path.currentQuery ? '[data-drupal-link-query=\'' + queryString + '\']' : ':not([data-drupal-link-query])';
var originalSelectors = ['[data-drupal-link-system-path="' + path.currentPath + '"]'];
var selectors = void 0;
if (path.isFront) {
originalSelectors.push('[data-drupal-link-system-path="<front>"]');
}
selectors = [].concat(originalSelectors.map(function (selector) {
return selector + ':not([hreflang])';
}), originalSelectors.map(function (selector) {
return selector + '[hreflang="' + path.currentLanguage + '"]';
}));
selectors = selectors.map(function (current) {
return current + querySelector;
});
var activeLinks = context.querySelectorAll(selectors.join(','));
var il = activeLinks.length;
for (var i = 0; i < il; i++) {
activeLinks[i].classList.add('is-active');
}
},
detach: function detach(context, settings, trigger) {
if (trigger === 'unload') {
var activeLinks = context.querySelectorAll('[data-drupal-link-system-path].is-active');
var il = activeLinks.length;
for (var i = 0; i < il; i++) {
activeLinks[i].classList.remove('is-active');
}
}
}
};
})(Drupal, drupalSettings);;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function (Drupal, debounce) {
var liveElement = void 0;
var announcements = [];
Drupal.behaviors.drupalAnnounce = {
attach: function attach(context) {
if (!liveElement) {
liveElement = document.createElement('div');
liveElement.id = 'drupal-live-announce';
liveElement.className = 'visually-hidden';
liveElement.setAttribute('aria-live', 'polite');
liveElement.setAttribute('aria-busy', 'false');
document.body.appendChild(liveElement);
}
}
};
function announce() {
var text = [];
var priority = 'polite';
var announcement = void 0;
var il = announcements.length;
for (var i = 0; i < il; i++) {
announcement = announcements.pop();
text.unshift(announcement.text);
if (announcement.priority === 'assertive') {
priority = 'assertive';
}
}
if (text.length) {
liveElement.innerHTML = '';
liveElement.setAttribute('aria-busy', 'true');
liveElement.setAttribute('aria-live', priority);
liveElement.innerHTML = text.join('\n');
liveElement.setAttribute('aria-busy', 'false');
}
}
Drupal.announce = function (text, priority) {
announcements.push({
text: text,
priority: priority
});
return debounce(announce, 200)();
};
})(Drupal, Drupal.debounce);;
window.matchMedia||(window.matchMedia=function(){"use strict";var e=window.styleMedia||window.media;if(!e){var t=document.createElement("style"),i=document.getElementsByTagName("script")[0],n=null;t.type="text/css";t.id="matchmediajs-test";i.parentNode.insertBefore(t,i);n="getComputedStyle"in window&&window.getComputedStyle(t,null)||t.currentStyle;e={matchMedium:function(e){var i="@media "+e+"{ #matchmediajs-test { width: 1px; } }";if(t.styleSheet){t.styleSheet.cssText=i}else{t.textContent=i}return n.width==="1px"}}}return function(t){return{matches:e.matchMedium(t||"all"),media:t||"all"}}}());
;
(function(){if(window.matchMedia&&window.matchMedia("all").addListener){return false}var e=window.matchMedia,i=e("only all").matches,n=false,t=0,a=[],r=function(i){clearTimeout(t);t=setTimeout(function(){for(var i=0,n=a.length;i<n;i++){var t=a[i].mql,r=a[i].listeners||[],o=e(t.media).matches;if(o!==t.matches){t.matches=o;for(var s=0,l=r.length;s<l;s++){r[s].call(window,t)}}}},30)};window.matchMedia=function(t){var o=e(t),s=[],l=0;o.addListener=function(e){if(!i){return}if(!n){n=true;window.addEventListener("resize",r,true)}if(l===0){l=a.push({mql:o,listeners:s})}s.push(e)};o.removeListener=function(e){for(var i=0,n=s.length;i<n;i++){if(s[i]===e){s.splice(i,1)}}};return o}})();
;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function ($, Drupal, drupalSettings) {
var activeItem = Drupal.url(drupalSettings.path.currentPath);
$.fn.drupalToolbarMenu = function () {
var ui = {
handleOpen: Drupal.t('Extend'),
handleClose: Drupal.t('Collapse')
};
function toggleList($item, switcher) {
var $toggle = $item.children('.toolbar-box').children('.toolbar-handle');
switcher = typeof switcher !== 'undefined' ? switcher : !$item.hasClass('open');
$item.toggleClass('open', switcher);
$toggle.toggleClass('open', switcher);
$toggle.find('.action').text(switcher ? ui.handleClose : ui.handleOpen);
}
function toggleClickHandler(event) {
var $toggle = $(event.target);
var $item = $toggle.closest('li');
toggleList($item);
var $openItems = $item.siblings().filter('.open');
toggleList($openItems, false);
}
function linkClickHandler(event) {
if (!Drupal.toolbar.models.toolbarModel.get('isFixed')) {
Drupal.toolbar.models.toolbarModel.set('activeTab', null);
}
event.stopPropagation();
}
function initItems($menu) {
var options = {
class: 'toolbar-icon toolbar-handle',
action: ui.handleOpen,
text: ''
};
$menu.find('li > a').wrap('<div class="toolbar-box">');
$menu.find('li').each(function (index, element) {
var $item = $(element);
if ($item.children('ul.toolbar-menu').length) {
var $box = $item.children('.toolbar-box');
options.text = Drupal.t('@label', {
'@label': $box.find('a').text()
});
$item.children('.toolbar-box').append(Drupal.theme('toolbarMenuItemToggle', options));
}
});
}
function markListLevels($lists, level) {
level = !level ? 1 : level;
var $lis = $lists.children('li').addClass('level-' + level);
$lists = $lis.children('ul');
if ($lists.length) {
markListLevels($lists, level + 1);
}
}
function openActiveItem($menu) {
var pathItem = $menu.find('a[href="' + window.location.pathname + '"]');
if (pathItem.length && !activeItem) {
activeItem = window.location.pathname;
}
if (activeItem) {
var $activeItem = $menu.find('a[href="' + activeItem + '"]').addClass('menu-item--active');
var $activeTrail = $activeItem.parentsUntil('.root', 'li').addClass('menu-item--active-trail');
toggleList($activeTrail, true);
}
}
return this.each(function (selector) {
var $menu = $(this).once('toolbar-menu');
if ($menu.length) {
$menu.on('click.toolbar', '.toolbar-box', toggleClickHandler).on('click.toolbar', '.toolbar-box a', linkClickHandler);
$menu.addClass('root');
initItems($menu);
markListLevels($menu);
openActiveItem($menu);
}
});
};
Drupal.theme.toolbarMenuItemToggle = function (options) {
return '<button class="' + options.class + '"><span class="action">' + options.action + '</span> <span class="label">' + options.text + '</span></button>';
};
})(jQuery, Drupal, drupalSettings);;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function ($, Drupal, drupalSettings) {
var options = $.extend({
breakpoints: {
'toolbar.narrow': '',
'toolbar.standard': '',
'toolbar.wide': ''
}
}, drupalSettings.toolbar, {
strings: {
horizontal: Drupal.t('Horizontal orientation'),
vertical: Drupal.t('Vertical orientation')
}
});
Drupal.behaviors.toolbar = {
attach: function attach(context) {
if (!window.matchMedia('only screen').matches) {
return;
}
$(context).find('#toolbar-administration').once('toolbar').each(function () {
var model = new Drupal.toolbar.ToolbarModel({
locked: JSON.parse(localStorage.getItem('Drupal.toolbar.trayVerticalLocked')),
activeTab: document.getElementById(JSON.parse(localStorage.getItem('Drupal.toolbar.activeTabID'))),
height: $('#toolbar-administration').outerHeight()
});
Drupal.toolbar.models.toolbarModel = model;
Object.keys(options.breakpoints).forEach(function (label) {
var mq = options.breakpoints[label];
var mql = window.matchMedia(mq);
Drupal.toolbar.mql[label] = mql;
mql.addListener(Drupal.toolbar.mediaQueryChangeHandler.bind(null, model, label));
Drupal.toolbar.mediaQueryChangeHandler.call(null, model, label, mql);
});
Drupal.toolbar.views.toolbarVisualView = new Drupal.toolbar.ToolbarVisualView({
el: this,
model: model,
strings: options.strings
});
Drupal.toolbar.views.toolbarAuralView = new Drupal.toolbar.ToolbarAuralView({
el: this,
model: model,
strings: options.strings
});
Drupal.toolbar.views.bodyVisualView = new Drupal.toolbar.BodyVisualView({
el: this,
model: model
});
model.trigger('change:isFixed', model, model.get('isFixed'));
model.trigger('change:activeTray', model, model.get('activeTray'));
var menuModel = new Drupal.toolbar.MenuModel();
Drupal.toolbar.models.menuModel = menuModel;
Drupal.toolbar.views.menuVisualView = new Drupal.toolbar.MenuVisualView({
el: $(this).find('.toolbar-menu-administration').get(0),
model: menuModel,
strings: options.strings
});
Drupal.toolbar.setSubtrees.done(function (subtrees) {
menuModel.set('subtrees', subtrees);
var theme = drupalSettings.ajaxPageState.theme;
localStorage.setItem('Drupal.toolbar.subtrees.' + theme, JSON.stringify(subtrees));
model.set('areSubtreesLoaded', true);
});
Drupal.toolbar.views.toolbarVisualView.loadSubtrees();
$(document).on('drupalViewportOffsetChange.toolbar', function (event, offsets) {
model.set('offsets', offsets);
});
model.on('change:orientation', function (model, orientation) {
$(document).trigger('drupalToolbarOrientationChange', orientation);
}).on('change:activeTab', function (model, tab) {
$(document).trigger('drupalToolbarTabChange', tab);
}).on('change:activeTray', function (model, tray) {
$(document).trigger('drupalToolbarTrayChange', tray);
});
if (Drupal.toolbar.models.toolbarModel.get('orientation') === 'horizontal' && Drupal.toolbar.models.toolbarModel.get('activeTab') === null) {
Drupal.toolbar.models.toolbarModel.set({
activeTab: $('.toolbar-bar .toolbar-tab:not(.home-toolbar-tab) a').get(0)
});
}
$(window).on({
'dialog:aftercreate': function dialogAftercreate(event, dialog, $element, settings) {
var $toolbar = $('#toolbar-bar');
$toolbar.css('margin-top', '0');
if (settings.drupalOffCanvasPosition === 'top') {
var height = Drupal.offCanvas.getContainer($element).outerHeight();
$toolbar.css('margin-top', height + 'px');
$element.on('dialogContentResize.off-canvas', function () {
var newHeight = Drupal.offCanvas.getContainer($element).outerHeight();
$toolbar.css('margin-top', newHeight + 'px');
});
}
},
'dialog:beforeclose': function dialogBeforeclose() {
$('#toolbar-bar').css('margin-top', '0');
}
});
});
}
};
Drupal.toolbar = {
views: {},
models: {},
mql: {},
setSubtrees: new $.Deferred(),
mediaQueryChangeHandler: function mediaQueryChangeHandler(model, label, mql) {
switch (label) {
case 'toolbar.narrow':
model.set({
isOriented: mql.matches,
isTrayToggleVisible: false
});
if (!mql.matches || !model.get('orientation')) {
model.set({ orientation: 'vertical' }, { validate: true });
}
break;
case 'toolbar.standard':
model.set({
isFixed: mql.matches
});
break;
case 'toolbar.wide':
model.set({
orientation: mql.matches && !model.get('locked') ? 'horizontal' : 'vertical'
}, { validate: true });
model.set({
isTrayToggleVisible: mql.matches
});
break;
default:
break;
}
}
};
Drupal.theme.toolbarOrientationToggle = function () {
return '<div class="toolbar-toggle-orientation"><div class="toolbar-lining">' + '<button class="toolbar-icon" type="button"></button>' + '</div></div>';
};
Drupal.AjaxCommands.prototype.setToolbarSubtrees = function (ajax, response, status) {
Drupal.toolbar.setSubtrees.resolve(response.subtrees);
};
})(jQuery, Drupal, drupalSettings);;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function (Backbone, Drupal) {
Drupal.toolbar.MenuModel = Backbone.Model.extend({
defaults: {
subtrees: {}
}
});
})(Backbone, Drupal);;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function (Backbone, Drupal) {
Drupal.toolbar.ToolbarModel = Backbone.Model.extend({
defaults: {
activeTab: null,
activeTray: null,
isOriented: false,
isFixed: false,
areSubtreesLoaded: false,
isViewportOverflowConstrained: false,
orientation: 'horizontal',
locked: false,
isTrayToggleVisible: true,
height: null,
offsets: {
top: 0,
right: 0,
bottom: 0,
left: 0
}
},
validate: function validate(attributes, options) {
if (attributes.orientation === 'horizontal' && this.get('locked') && !options.override) {
return Drupal.t('The toolbar cannot be set to a horizontal orientation when it is locked.');
}
}
});
})(Backbone, Drupal);;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function ($, Drupal, Backbone) {
Drupal.toolbar.BodyVisualView = Backbone.View.extend({
initialize: function initialize() {
this.listenTo(this.model, 'change:activeTray ', this.render);
this.listenTo(this.model, 'change:isFixed change:isViewportOverflowConstrained', this.isToolbarFixed);
},
isToolbarFixed: function isToolbarFixed() {
var isViewportOverflowConstrained = this.model.get('isViewportOverflowConstrained');
$('body').toggleClass('toolbar-fixed', isViewportOverflowConstrained || this.model.get('isFixed'));
},
render: function render() {
$('body').toggleClass('toolbar-tray-open', !!this.model.get('activeTray'));
}
});
})(jQuery, Drupal, Backbone);;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function ($, Backbone, Drupal) {
Drupal.toolbar.MenuVisualView = Backbone.View.extend({
initialize: function initialize() {
this.listenTo(this.model, 'change:subtrees', this.render);
},
render: function render() {
var _this = this;
var subtrees = this.model.get('subtrees');
Object.keys(subtrees || {}).forEach(function (id) {
_this.$el.find('#toolbar-link-' + id).once('toolbar-subtrees').after(subtrees[id]);
});
if ('drupalToolbarMenu' in $.fn) {
this.$el.children('.toolbar-menu').drupalToolbarMenu();
}
}
});
})(jQuery, Backbone, Drupal);;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function (Backbone, Drupal) {
Drupal.toolbar.ToolbarAuralView = Backbone.View.extend({
initialize: function initialize(options) {
this.strings = options.strings;
this.listenTo(this.model, 'change:orientation', this.onOrientationChange);
this.listenTo(this.model, 'change:activeTray', this.onActiveTrayChange);
},
onOrientationChange: function onOrientationChange(model, orientation) {
Drupal.announce(Drupal.t('Tray orientation changed to @orientation.', {
'@orientation': orientation
}));
},
onActiveTrayChange: function onActiveTrayChange(model, tray) {
var relevantTray = tray === null ? model.previous('activeTray') : tray;
if (!relevantTray) {
return;
}
var action = tray === null ? Drupal.t('closed') : Drupal.t('opened');
var trayNameElement = relevantTray.querySelector('.toolbar-tray-name');
var text = void 0;
if (trayNameElement !== null) {
text = Drupal.t('Tray "@tray" @action.', {
'@tray': trayNameElement.textContent,
'@action': action
});
} else {
text = Drupal.t('Tray @action.', { '@action': action });
}
Drupal.announce(text);
}
});
})(Backbone, Drupal);;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function ($, Drupal, drupalSettings, Backbone) {
Drupal.toolbar.ToolbarVisualView = Backbone.View.extend({
events: function events() {
var touchEndToClick = function touchEndToClick(event) {
event.preventDefault();
event.target.click();
};
return {
'click .toolbar-bar .toolbar-tab .trigger': 'onTabClick',
'click .toolbar-toggle-orientation button': 'onOrientationToggleClick',
'touchend .toolbar-bar .toolbar-tab .trigger': touchEndToClick,
'touchend .toolbar-toggle-orientation button': touchEndToClick
};
},
initialize: function initialize(options) {
this.strings = options.strings;
this.listenTo(this.model, 'change:activeTab change:orientation change:isOriented change:isTrayToggleVisible', this.render);
this.listenTo(this.model, 'change:mqMatches', this.onMediaQueryChange);
this.listenTo(this.model, 'change:offsets', this.adjustPlacement);
this.listenTo(this.model, 'change:activeTab change:orientation change:isOriented', this.updateToolbarHeight);
this.$el.find('.toolbar-tray .toolbar-lining').append(Drupal.theme('toolbarOrientationToggle'));
this.model.trigger('change:activeTab');
},
updateToolbarHeight: function updateToolbarHeight() {
var toolbarTabOuterHeight = $('#toolbar-bar').find('.toolbar-tab').outerHeight() || 0;
var toolbarTrayHorizontalOuterHeight = $('.is-active.toolbar-tray-horizontal').outerHeight() || 0;
this.model.set('height', toolbarTabOuterHeight + toolbarTrayHorizontalOuterHeight);
$('body').css({
'padding-top': this.model.get('height')
});
this.triggerDisplace();
},
triggerDisplace: function triggerDisplace() {
_.defer(function () {
Drupal.displace(true);
});
},
render: function render() {
this.updateTabs();
this.updateTrayOrientation();
this.updateBarAttributes();
$('body').removeClass('toolbar-loading');
if (this.model.changed.orientation === 'vertical' || this.model.changed.activeTab) {
this.loadSubtrees();
}
return this;
},
onTabClick: function onTabClick(event) {
if (event.target.hasAttribute('data-toolbar-tray')) {
var activeTab = this.model.get('activeTab');
var clickedTab = event.target;
this.model.set('activeTab', !activeTab || clickedTab !== activeTab ? clickedTab : null);
event.preventDefault();
event.stopPropagation();
}
},
onOrientationToggleClick: function onOrientationToggleClick(event) {
var orientation = this.model.get('orientation');
var antiOrientation = orientation === 'vertical' ? 'horizontal' : 'vertical';
var locked = antiOrientation === 'vertical';
if (locked) {
localStorage.setItem('Drupal.toolbar.trayVerticalLocked', 'true');
} else {
localStorage.removeItem('Drupal.toolbar.trayVerticalLocked');
}
this.model.set({
locked: locked,
orientation: antiOrientation
}, {
validate: true,
override: true
});
event.preventDefault();
event.stopPropagation();
},
updateTabs: function updateTabs() {
var $tab = $(this.model.get('activeTab'));
$(this.model.previous('activeTab')).removeClass('is-active').prop('aria-pressed', false);
$(this.model.previous('activeTray')).removeClass('is-active');
if ($tab.length > 0) {
$tab.addClass('is-active').prop('aria-pressed', true);
var name = $tab.attr('data-toolbar-tray');
var id = $tab.get(0).id;
if (id) {
localStorage.setItem('Drupal.toolbar.activeTabID', JSON.stringify(id));
}
var $tray = this.$el.find('[data-toolbar-tray="' + name + '"].toolbar-tray');
if ($tray.length) {
$tray.addClass('is-active');
this.model.set('activeTray', $tray.get(0));
} else {
this.model.set('activeTray', null);
}
} else {
this.model.set('activeTray', null);
localStorage.removeItem('Drupal.toolbar.activeTabID');
}
},
updateBarAttributes: function updateBarAttributes() {
var isOriented = this.model.get('isOriented');
if (isOriented) {
this.$el.find('.toolbar-bar').attr('data-offset-top', '');
} else {
this.$el.find('.toolbar-bar').removeAttr('data-offset-top');
}
this.$el.toggleClass('toolbar-oriented', isOriented);
},
updateTrayOrientation: function updateTrayOrientation() {
var orientation = this.model.get('orientation');
var antiOrientation = orientation === 'vertical' ? 'horizontal' : 'vertical';
$('body').toggleClass('toolbar-vertical', orientation === 'vertical').toggleClass('toolbar-horizontal', orientation === 'horizontal');
var removeClass = antiOrientation === 'horizontal' ? 'toolbar-tray-horizontal' : 'toolbar-tray-vertical';
var $trays = this.$el.find('.toolbar-tray').removeClass(removeClass).addClass('toolbar-tray-' + orientation);
var iconClass = 'toolbar-icon-toggle-' + orientation;
var iconAntiClass = 'toolbar-icon-toggle-' + antiOrientation;
var $orientationToggle = this.$el.find('.toolbar-toggle-orientation').toggle(this.model.get('isTrayToggleVisible'));
$orientationToggle.find('button').val(antiOrientation).attr('title', this.strings[antiOrientation]).text(this.strings[antiOrientation]).removeClass(iconClass).addClass(iconAntiClass);
var dir = document.documentElement.dir;
var edge = dir === 'rtl' ? 'right' : 'left';
$trays.removeAttr('data-offset-left data-offset-right data-offset-top');
$trays.filter('.toolbar-tray-vertical.is-active').attr('data-offset-' + edge, '');
$trays.filter('.toolbar-tray-horizontal.is-active').attr('data-offset-top', '');
},
adjustPlacement: function adjustPlacement() {
var $trays = this.$el.find('.toolbar-tray');
if (!this.model.get('isOriented')) {
$trays.removeClass('toolbar-tray-horizontal').addClass('toolbar-tray-vertical');
}
},
loadSubtrees: function loadSubtrees() {
var $activeTab = $(this.model.get('activeTab'));
var orientation = this.model.get('orientation');
if (!this.model.get('areSubtreesLoaded') && typeof $activeTab.data('drupal-subtrees') !== 'undefined' && orientation === 'vertical') {
var subtreesHash = drupalSettings.toolbar.subtreesHash;
var theme = drupalSettings.ajaxPageState.theme;
var endpoint = Drupal.url('toolbar/subtrees/' + subtreesHash);
var cachedSubtreesHash = localStorage.getItem('Drupal.toolbar.subtreesHash.' + theme);
var cachedSubtrees = JSON.parse(localStorage.getItem('Drupal.toolbar.subtrees.' + theme));
var isVertical = this.model.get('orientation') === 'vertical';
if (isVertical && subtreesHash === cachedSubtreesHash && cachedSubtrees) {
Drupal.toolbar.setSubtrees.resolve(cachedSubtrees);
} else if (isVertical) {
localStorage.removeItem('Drupal.toolbar.subtreesHash.' + theme);
localStorage.removeItem('Drupal.toolbar.subtrees.' + theme);
Drupal.ajax({ url: endpoint }).execute();
localStorage.setItem('Drupal.toolbar.subtreesHash.' + theme, subtreesHash);
}
}
}
});
})(jQuery, Drupal, drupalSettings, Backbone);;
/*
* jQuery Foundation Joyride Plugin 2.1
* http://foundation.zurb.com
* Copyright 2013, ZURB
* Free to use under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*/
/*jslint unparam: true, browser: true, indent: 2 */
;(function ($, window, undefined) {
'use strict';
var defaults = {
'version' : '2.1',
'tipLocation' : 'bottom', // 'top' or 'bottom' in relation to parent
'nubPosition' : 'auto', // override on a per tooltip bases
'scroll' : true, // whether to scroll to tips
'scrollSpeed' : 300, // Page scrolling speed in milliseconds
'timer' : 0, // 0 = no timer , all other numbers = timer in milliseconds
'autoStart' : false, // true or false - false tour starts when restart called
'startTimerOnClick' : true, // true or false - true requires clicking the first button start the timer
'startOffset' : 0, // the index of the tooltip you want to start on (index of the li)
'nextButton' : true, // true or false to control whether a next button is used
'tipAnimation' : 'fade', // 'pop' or 'fade' in each tip
'pauseAfter' : [], // array of indexes where to pause the tour after
'tipAnimationFadeSpeed': 300, // when tipAnimation = 'fade' this is speed in milliseconds for the transition
'cookieMonster' : false, // true or false to control whether cookies are used
'cookieName' : 'joyride', // Name the cookie you'll use
'cookieDomain' : false, // Will this cookie be attached to a domain, ie. '.notableapp.com'
'cookiePath' : false, // Set to '/' if you want the cookie for the whole website
'localStorage' : false, // true or false to control whether localstorage is used
'localStorageKey' : 'joyride', // Keyname in localstorage
'tipContainer' : 'body', // Where will the tip be attached
'modal' : false, // Whether to cover page with modal during the tour
'expose' : false, // Whether to expose the elements at each step in the tour (requires modal:true)
'postExposeCallback' : $.noop, // A method to call after an element has been exposed
'preRideCallback' : $.noop, // A method to call before the tour starts (passed index, tip, and cloned exposed element)
'postRideCallback' : $.noop, // A method to call once the tour closes (canceled or complete)
'preStepCallback' : $.noop, // A method to call before each step
'postStepCallback' : $.noop, // A method to call after each step
'template' : { // HTML segments for tip layout
'link' : '<a href="#close" class="joyride-close-tip">X</a>',
'timer' : '<div class="joyride-timer-indicator-wrap"><span class="joyride-timer-indicator"></span></div>',
'tip' : '<div class="joyride-tip-guide"><span class="joyride-nub"></span></div>',
'wrapper' : '<div class="joyride-content-wrapper" role="dialog"></div>',
'button' : '<a href="#" class="joyride-next-tip"></a>',
'modal' : '<div class="joyride-modal-bg"></div>',
'expose' : '<div class="joyride-expose-wrapper"></div>',
'exposeCover': '<div class="joyride-expose-cover"></div>'
}
},
Modernizr = Modernizr || false,
settings = {},
methods = {
init : function (opts) {
return this.each(function () {
if ($.isEmptyObject(settings)) {
settings = $.extend(true, defaults, opts);
// non configurable settings
settings.document = window.document;
settings.$document = $(settings.document);
settings.$window = $(window);
settings.$content_el = $(this);
settings.$body = $(settings.tipContainer);
settings.body_offset = $(settings.tipContainer).position();
settings.$tip_content = $('> li', settings.$content_el);
settings.paused = false;
settings.attempts = 0;
settings.tipLocationPatterns = {
top: ['bottom'],
bottom: [], // bottom should not need to be repositioned
left: ['right', 'top', 'bottom'],
right: ['left', 'top', 'bottom']
};
// are we using jQuery 1.7+
methods.jquery_check();
// can we create cookies?
if (!$.isFunction($.cookie)) {
settings.cookieMonster = false;
}
// generate the tips and insert into dom.
if ( (!settings.cookieMonster || !$.cookie(settings.cookieName) ) &&
(!settings.localStorage || !methods.support_localstorage() || !localStorage.getItem(settings.localStorageKey) ) ) {
settings.$tip_content.each(function (index) {
methods.create({$li : $(this), index : index});
});
// show first tip
if(settings.autoStart)
{
if (!settings.startTimerOnClick && settings.timer > 0) {
methods.show('init');
methods.startTimer();
} else {
methods.show('init');
}
}
}
settings.$document.on('click.joyride', '.joyride-next-tip, .joyride-modal-bg', function (e) {
e.preventDefault();
if (settings.$li.next().length < 1) {
methods.end();
} else if (settings.timer > 0) {
clearTimeout(settings.automate);
methods.hide();
methods.show();
methods.startTimer();
} else {
methods.hide();
methods.show();
}
});
settings.$document.on('click.joyride', '.joyride-close-tip', function (e) {
e.preventDefault();
methods.end(true /* isAborted */);
});
settings.$window.on('resize.joyride', function (e) {
if(settings.$li){
if(settings.exposed && settings.exposed.length>0){
var $els = $(settings.exposed);
$els.each(function(){
var $this = $(this);
methods.un_expose($this);
methods.expose($this);
});
}
if (methods.is_phone()) {
methods.pos_phone();
} else {
methods.pos_default();
}
}
});
} else {
methods.restart();
}
});
},
// call this method when you want to resume the tour
resume : function () {
methods.set_li();
methods.show();
},
nextTip: function(){
if (settings.$li.next().length < 1) {
methods.end();
} else if (settings.timer > 0) {
clearTimeout(settings.automate);
methods.hide();
methods.show();
methods.startTimer();
} else {
methods.hide();
methods.show();
}
},
tip_template : function (opts) {
var $blank, content, $wrapper;
opts.tip_class = opts.tip_class || '';
$blank = $(settings.template.tip).addClass(opts.tip_class);
content = $.trim($(opts.li).html()) +
methods.button_text(opts.button_text) +
settings.template.link +
methods.timer_instance(opts.index);
$wrapper = $(settings.template.wrapper);
if (opts.li.attr('data-aria-labelledby')) {
$wrapper.attr('aria-labelledby', opts.li.attr('data-aria-labelledby'))
}
if (opts.li.attr('data-aria-describedby')) {
$wrapper.attr('aria-describedby', opts.li.attr('data-aria-describedby'))
}
$blank.append($wrapper);
$blank.first().attr('data-index', opts.index);
$('.joyride-content-wrapper', $blank).append(content);
return $blank[0];
},
timer_instance : function (index) {
var txt;
if ((index === 0 && settings.startTimerOnClick && settings.timer > 0) || settings.timer === 0) {
txt = '';
} else {
txt = methods.outerHTML($(settings.template.timer)[0]);
}
return txt;
},
button_text : function (txt) {
if (settings.nextButton) {
txt = $.trim(txt) || 'Next';
txt = methods.outerHTML($(settings.template.button).append(txt)[0]);
} else {
txt = '';
}
return txt;
},
create : function (opts) {
// backwards compatibility with data-text attribute
var buttonText = opts.$li.attr('data-button') || opts.$li.attr('data-text'),
tipClass = opts.$li.attr('class'),
$tip_content = $(methods.tip_template({
tip_class : tipClass,
index : opts.index,
button_text : buttonText,
li : opts.$li
}));
$(settings.tipContainer).append($tip_content);
},
show : function (init) {
var opts = {}, ii, opts_arr = [], opts_len = 0, p,
$timer = null;
// are we paused?
if (settings.$li === undefined || ($.inArray(settings.$li.index(), settings.pauseAfter) === -1)) {
// don't go to the next li if the tour was paused
if (settings.paused) {
settings.paused = false;
} else {
methods.set_li(init);
}
settings.attempts = 0;
if (settings.$li.length && settings.$target.length > 0) {
if(init){ //run when we first start
settings.preRideCallback(settings.$li.index(), settings.$next_tip );
if(settings.modal){
methods.show_modal();
}
}
settings.preStepCallback(settings.$li.index(), settings.$next_tip );
// parse options
opts_arr = (settings.$li.data('options') || ':').split(';');
opts_len = opts_arr.length;
for (ii = opts_len - 1; ii >= 0; ii--) {
p = opts_arr[ii].split(':');
if (p.length === 2) {
opts[$.trim(p[0])] = $.trim(p[1]);
}
}
settings.tipSettings = $.extend({}, settings, opts);
settings.tipSettings.tipLocationPattern = settings.tipLocationPatterns[settings.tipSettings.tipLocation];
if(settings.modal && settings.expose){
methods.expose();
}
// scroll if not modal
if (!settings.$target.is("body") && settings.scroll) {
methods.scroll_to();
}
if (methods.is_phone()) {
methods.pos_phone(true);
} else {
methods.pos_default(true);
}
$timer = $('.joyride-timer-indicator', settings.$next_tip);
if (/pop/i.test(settings.tipAnimation)) {
$timer.outerWidth(0);
if (settings.timer > 0) {
settings.$next_tip.show();
$timer.animate({
width: $('.joyride-timer-indicator-wrap', settings.$next_tip).outerWidth()
}, settings.timer);
} else {
settings.$next_tip.show();
}
} else if (/fade/i.test(settings.tipAnimation)) {
$timer.outerWidth(0);
if (settings.timer > 0) {
settings.$next_tip.fadeIn(settings.tipAnimationFadeSpeed);
settings.$next_tip.show();
$timer.animate({
width: $('.joyride-timer-indicator-wrap', settings.$next_tip).outerWidth()
}, settings.timer);
} else {
settings.$next_tip.fadeIn(settings.tipAnimationFadeSpeed);
}
}
settings.$current_tip = settings.$next_tip;
// Focus next button for keyboard users.
$('.joyride-next-tip', settings.$current_tip).focus();
methods.tabbable(settings.$current_tip);
// skip non-existent targets
} else if (settings.$li && settings.$target.length < 1) {
methods.show();
} else {
methods.end();
}
} else {
settings.paused = true;
}
},
// detect phones with media queries if supported.
is_phone : function () {
if (Modernizr) {
return Modernizr.mq('only screen and (max-width: 767px)');
}
return (settings.$window.width() < 767) ? true : false;
},
support_localstorage : function () {
if (Modernizr) {
return Modernizr.localstorage;
} else {
return !!window.localStorage;
}
},
hide : function () {
if(settings.modal && settings.expose){
methods.un_expose();
}
if(!settings.modal){
$('.joyride-modal-bg').hide();
}
settings.$current_tip.hide();
settings.postStepCallback(settings.$li.index(), settings.$current_tip);
},
set_li : function (init) {
if (init) {
settings.$li = settings.$tip_content.eq(settings.startOffset);
methods.set_next_tip();
settings.$current_tip = settings.$next_tip;
} else {
settings.$li = settings.$li.next();
methods.set_next_tip();
}
methods.set_target();
},
set_next_tip : function () {
settings.$next_tip = $('.joyride-tip-guide[data-index=' + settings.$li.index() + ']');
},
set_target : function () {
var cl = settings.$li.attr('data-class'),
id = settings.$li.attr('data-id'),
$sel = function () {
if (id) {
return $(settings.document.getElementById(id));
} else if (cl) {
return $('.' + cl).filter(":visible").first();
} else {
return $('body');
}
};
settings.$target = $sel();
},
scroll_to : function () {
var window_half, tipOffset;
window_half = settings.$window.height() / 2;
tipOffset = Math.ceil(settings.$target.offset().top - window_half + settings.$next_tip.outerHeight());
$("html, body").stop().animate({
scrollTop: tipOffset
}, settings.scrollSpeed);
},
paused : function () {
if (($.inArray((settings.$li.index() + 1), settings.pauseAfter) === -1)) {
return true;
}
return false;
},
destroy : function () {
if(!$.isEmptyObject(settings)){
settings.$document.off('.joyride');
}
$(window).off('.joyride');
$('.joyride-close-tip, .joyride-next-tip, .joyride-modal-bg').off('.joyride');
$('.joyride-tip-guide, .joyride-modal-bg').remove();
clearTimeout(settings.automate);
settings = {};
},
restart : function () {
if(!settings.autoStart)
{
if (!settings.startTimerOnClick && settings.timer > 0) {
methods.show('init');
methods.startTimer();
} else {
methods.show('init');
}
settings.autoStart = true;
}
else
{
methods.hide();
settings.$li = undefined;
methods.show('init');
}
},
pos_default : function (init) {
var half_fold = Math.ceil(settings.$window.height() / 2),
tip_position = settings.$next_tip.offset(),
$nub = $('.joyride-nub', settings.$next_tip),
nub_width = Math.ceil($nub.outerWidth() / 2),
nub_height = Math.ceil($nub.outerHeight() / 2),
toggle = init || false;
// tip must not be "display: none" to calculate position
if (toggle) {
settings.$next_tip.css('visibility', 'hidden');
settings.$next_tip.show();
}
if (!settings.$target.is("body")) {
var
topAdjustment = settings.tipSettings.tipAdjustmentY ? parseInt(settings.tipSettings.tipAdjustmentY) : 0,
leftAdjustment = settings.tipSettings.tipAdjustmentX ? parseInt(settings.tipSettings.tipAdjustmentX) : 0;
if (methods.bottom()) {
settings.$next_tip.css({
top: (settings.$target.offset().top + nub_height + settings.$target.outerHeight() + topAdjustment),
left: settings.$target.offset().left + leftAdjustment});
if (/right/i.test(settings.tipSettings.nubPosition)) {
settings.$next_tip.css('left', settings.$target.offset().left - settings.$next_tip.outerWidth() + settings.$target.outerWidth());
}
methods.nub_position($nub, settings.tipSettings.nubPosition, 'top');
} else if (methods.top()) {
settings.$next_tip.css({
top: (settings.$target.offset().top - settings.$next_tip.outerHeight() - nub_height + topAdjustment),
left: settings.$target.offset().left + leftAdjustment});
methods.nub_position($nub, settings.tipSettings.nubPosition, 'bottom');
} else if (methods.right()) {
settings.$next_tip.css({
top: settings.$target.offset().top + topAdjustment,
left: (settings.$target.outerWidth() + settings.$target.offset().left + nub_width) + leftAdjustment});
methods.nub_position($nub, settings.tipSettings.nubPosition, 'left');
} else if (methods.left()) {
settings.$next_tip.css({
top: settings.$target.offset().top + topAdjustment,
left: (settings.$target.offset().left - settings.$next_tip.outerWidth() - nub_width) + leftAdjustment});
methods.nub_position($nub, settings.tipSettings.nubPosition, 'right');
}
if (!methods.visible(methods.corners(settings.$next_tip)) && settings.attempts < settings.tipSettings.tipLocationPattern.length) {
$nub.removeClass('bottom')
.removeClass('top')
.removeClass('right')
.removeClass('left');
settings.tipSettings.tipLocation = settings.tipSettings.tipLocationPattern[settings.attempts];
settings.attempts++;
methods.pos_default(true);
}
} else if (settings.$li.length) {
methods.pos_modal($nub);
}
if (toggle) {
settings.$next_tip.hide();
settings.$next_tip.css('visibility', 'visible');
}
},
pos_phone : function (init) {
var tip_height = settings.$next_tip.outerHeight(),
tip_offset = settings.$next_tip.offset(),
target_height = settings.$target.outerHeight(),
$nub = $('.joyride-nub', settings.$next_tip),
nub_height = Math.ceil($nub.outerHeight() / 2),
toggle = init || false;
$nub.removeClass('bottom')
.removeClass('top')
.removeClass('right')
.removeClass('left');
if (toggle) {
settings.$next_tip.css('visibility', 'hidden');
settings.$next_tip.show();
}
if (!settings.$target.is("body")) {
if (methods.top()) {
settings.$next_tip.offset({top: settings.$target.offset().top - tip_height - nub_height});
$nub.addClass('bottom');
} else {
settings.$next_tip.offset({top: settings.$target.offset().top + target_height + nub_height});
$nub.addClass('top');
}
} else if (settings.$li.length) {
methods.pos_modal($nub);
}
if (toggle) {
settings.$next_tip.hide();
settings.$next_tip.css('visibility', 'visible');
}
},
pos_modal : function ($nub) {
methods.center();
$nub.hide();
methods.show_modal();
},
show_modal : function() {
if ($('.joyride-modal-bg').length < 1) {
$('body').append(settings.template.modal).show();
}
if (/pop/i.test(settings.tipAnimation)) {
$('.joyride-modal-bg').show();
} else {
$('.joyride-modal-bg').fadeIn(settings.tipAnimationFadeSpeed);
}
},
expose: function(){
var expose,
exposeCover,
el,
origCSS,
randId = 'expose-'+Math.floor(Math.random()*10000);
if (arguments.length>0 && arguments[0] instanceof $){
el = arguments[0];
} else if(settings.$target && !settings.$target.is("body")){
el = settings.$target;
} else {
return false;
}
if(el.length < 1){
if(window.console){
console.error('element not valid', el);
}
return false;
}
expose = $(settings.template.expose);
settings.$body.append(expose);
expose.css({
top: el.offset().top,
left: el.offset().left,
width: el.outerWidth(true),
height: el.outerHeight(true)
});
exposeCover = $(settings.template.exposeCover);
origCSS = {
zIndex: el.css('z-index'),
position: el.css('position')
};
el.css('z-index',expose.css('z-index')*1+1);
if(origCSS.position == 'static'){
el.css('position','relative');
}
el.data('expose-css',origCSS);
exposeCover.css({
top: el.offset().top,
left: el.offset().left,
width: el.outerWidth(true),
height: el.outerHeight(true)
});
settings.$body.append(exposeCover);
expose.addClass(randId);
exposeCover.addClass(randId);
if(settings.tipSettings['exposeClass']){
expose.addClass(settings.tipSettings['exposeClass']);
exposeCover.addClass(settings.tipSettings['exposeClass']);
}
el.data('expose', randId);
settings.postExposeCallback(settings.$li.index(), settings.$next_tip, el);
methods.add_exposed(el);
},
un_expose: function(){
var exposeId,
el,
expose ,
origCSS,
clearAll = false;
if (arguments.length>0 && arguments[0] instanceof $){
el = arguments[0];
} else if(settings.$target && !settings.$target.is("body")){
el = settings.$target;
} else {
return false;
}
if(el.length < 1){
if(window.console){
console.error('element not valid', el);
}
return false;
}
exposeId = el.data('expose');
expose = $('.'+exposeId);
if(arguments.length>1){
clearAll = arguments[1];
}
if(clearAll === true){
$('.joyride-expose-wrapper,.joyride-expose-cover').remove();
} else {
expose.remove();
}
origCSS = el.data('expose-css');
if(origCSS.zIndex == 'auto'){
el.css('z-index', '');
} else {
el.css('z-index',origCSS.zIndex);
}
if(origCSS.position != el.css('position')){
if(origCSS.position == 'static'){// this is default, no need to set it.
el.css('position', '');
} else {
el.css('position',origCSS.position);
}
}
el.removeData('expose');
el.removeData('expose-z-index');
methods.remove_exposed(el);
},
add_exposed: function(el){
settings.exposed = settings.exposed || [];
if(el instanceof $){
settings.exposed.push(el[0]);
} else if(typeof el == 'string'){
settings.exposed.push(el);
}
},
remove_exposed: function(el){
var search;
if(el instanceof $){
search = el[0]
} else if (typeof el == 'string'){
search = el;
}
settings.exposed = settings.exposed || [];
for(var i=0; i<settings.exposed.length; i++){
if(settings.exposed[i] == search){
settings.exposed.splice(i,1);
return;
}
}
},
center : function () {
var $w = settings.$window;
settings.$next_tip.css({
top : ((($w.height() - settings.$next_tip.outerHeight()) / 2) + $w.scrollTop()),
left : ((($w.width() - settings.$next_tip.outerWidth()) / 2) + $w.scrollLeft())
});
return true;
},
bottom : function () {
return /bottom/i.test(settings.tipSettings.tipLocation);
},
top : function () {
return /top/i.test(settings.tipSettings.tipLocation);
},
right : function () {
return /right/i.test(settings.tipSettings.tipLocation);
},
left : function () {
return /left/i.test(settings.tipSettings.tipLocation);
},
corners : function (el) {
var w = settings.$window,
window_half = w.height() / 2,
tipOffset = Math.ceil(settings.$target.offset().top - window_half + settings.$next_tip.outerHeight()),//using this to calculate since scroll may not have finished yet.
right = w.width() + w.scrollLeft(),
offsetBottom = w.height() + tipOffset,
bottom = w.height() + w.scrollTop(),
top = w.scrollTop();
if(tipOffset < top){
if (tipOffset <0 ){
top = 0;
} else {
top = tipOffset;
}
}
if(offsetBottom > bottom){
bottom = offsetBottom;
}
return [
el.offset().top < top,
right < el.offset().left + el.outerWidth(),
bottom < el.offset().top + el.outerHeight(),
w.scrollLeft() > el.offset().left
];
},
visible : function (hidden_corners) {
var i = hidden_corners.length;
while (i--) {
if (hidden_corners[i]) return false;
}
return true;
},
nub_position : function (nub, pos, def) {
if (pos === 'auto') {
nub.addClass(def);
} else {
nub.addClass(pos);
}
},
startTimer : function () {
if (settings.$li.length) {
settings.automate = setTimeout(function () {
methods.hide();
methods.show();
methods.startTimer();
}, settings.timer);
} else {
clearTimeout(settings.automate);
}
},
end : function (isAborted) {
isAborted = isAborted || false;
// Unbind resize events.
if (isAborted) {
settings.$window.off('resize.joyride');
}
if (settings.cookieMonster) {
$.cookie(settings.cookieName, 'ridden', { expires: 365, domain: settings.cookieDomain, path: settings.cookiePath });
}
if (settings.localStorage) {
localStorage.setItem(settings.localStorageKey, true);
}
if (settings.timer > 0) {
clearTimeout(settings.automate);
}
if(settings.modal && settings.expose){
methods.un_expose();
}
if (settings.$current_tip) {
settings.$current_tip.hide();
}
if (settings.$li) {
settings.postStepCallback(settings.$li.index(), settings.$current_tip, isAborted);
settings.postRideCallback(settings.$li.index(), settings.$current_tip, isAborted);
}
$('.joyride-modal-bg').hide();
},
jquery_check : function () {
// define on() and off() for older jQuery
if (!$.isFunction($.fn.on)) {
$.fn.on = function (types, sel, fn) {
return this.delegate(sel, types, fn);
};
$.fn.off = function (types, sel, fn) {
return this.undelegate(sel, types, fn);
};
return false;
}
return true;
},
outerHTML : function (el) {
// support FireFox < 11
return el.outerHTML || new XMLSerializer().serializeToString(el);
},
version : function () {
return settings.version;
},
tabbable : function (el) {
$(el).on('keydown', function( event ) {
if (!event.isDefaultPrevented() && event.keyCode &&
// Escape key.
event.keyCode === 27 ) {
event.preventDefault();
methods.end(true /* isAborted */);
return;
}
// Prevent tabbing out of tour items.
if ( event.keyCode !== 9 ) {
return;
}
var tabbables = $(el).find(":tabbable"),
first = tabbables.filter(":first"),
last = tabbables.filter(":last");
if ( event.target === last[0] && !event.shiftKey ) {
first.focus( 1 );
event.preventDefault();
} else if ( event.target === first[0] && event.shiftKey ) {
last.focus( 1 );
event.preventDefault();
}
});
}
};
$.fn.joyride = function (method) {
if (methods[method]) {
return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
} else if (typeof method === 'object' || !method) {
return methods.init.apply(this, arguments);
} else {
$.error('Method ' + method + ' does not exist on jQuery.joyride');
}
};
}(jQuery, this));
;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function ($, Backbone, Drupal, document) {
var queryString = decodeURI(window.location.search);
Drupal.behaviors.tour = {
attach: function attach(context) {
$('body').once('tour').each(function () {
var model = new Drupal.tour.models.StateModel();
new Drupal.tour.views.ToggleTourView({
el: $(context).find('#toolbar-tab-tour'),
model: model
});
model.on('change:isActive', function (model, isActive) {
$(document).trigger(isActive ? 'drupalTourStarted' : 'drupalTourStopped');
}).set('tour', $(context).find('ol#tour'));
if (/tour=?/i.test(queryString)) {
model.set('isActive', true);
}
});
}
};
Drupal.tour = Drupal.tour || {
models: {},
views: {}
};
Drupal.tour.models.StateModel = Backbone.Model.extend({
defaults: {
tour: [],
isActive: false,
activeTour: []
}
});
Drupal.tour.views.ToggleTourView = Backbone.View.extend({
events: { click: 'onClick' },
initialize: function initialize() {
this.listenTo(this.model, 'change:tour change:isActive', this.render);
this.listenTo(this.model, 'change:isActive', this.toggleTour);
},
render: function render() {
this.$el.toggleClass('hidden', this._getTour().length === 0);
var isActive = this.model.get('isActive');
this.$el.find('button').toggleClass('is-active', isActive).prop('aria-pressed', isActive);
return this;
},
toggleTour: function toggleTour() {
if (this.model.get('isActive')) {
var $tour = this._getTour();
this._removeIrrelevantTourItems($tour, this._getDocument());
var that = this;
var close = Drupal.t('Close');
if ($tour.find('li').length) {
$tour.joyride({
autoStart: true,
postRideCallback: function postRideCallback() {
that.model.set('isActive', false);
},
template: {
link: '<a href="#close" class="joyride-close-tip" aria-label="' + close + '">×</a>',
button: '<a href="#" class="button button--primary joyride-next-tip"></a>'
}
});
this.model.set({ isActive: true, activeTour: $tour });
}
} else {
this.model.get('activeTour').joyride('destroy');
this.model.set({ isActive: false, activeTour: [] });
}
},
onClick: function onClick(event) {
this.model.set('isActive', !this.model.get('isActive'));
event.preventDefault();
event.stopPropagation();
},
_getTour: function _getTour() {
return this.model.get('tour');
},
_getDocument: function _getDocument() {
return $(document);
},
_removeIrrelevantTourItems: function _removeIrrelevantTourItems($tour, $document) {
var removals = false;
var tips = /tips=([^&]+)/.exec(queryString);
$tour.find('li').each(function () {
var $this = $(this);
var itemId = $this.attr('data-id');
var itemClass = $this.attr('data-class');
if (tips && !$(this).hasClass(tips[1])) {
removals = true;
$this.remove();
return;
}
if (!itemId && !itemClass || itemId && $document.find('#' + itemId).length || itemClass && $document.find('.' + itemClass).length) {
return;
}
removals = true;
$this.remove();
});
if (removals) {
var total = $tour.find('li').length;
if (!total) {
this.model.set({ tour: [] });
}
$tour.find('li').each(function (index) {
var progress = Drupal.t('!tour_item of !total', {
'!tour_item': index + 1,
'!total': total
});
$(this).find('.tour-progress').text(progress);
}).eq(-1).attr('data-text', Drupal.t('End tour'));
}
}
});
})(jQuery, Backbone, Drupal, document);;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function ($, Drupal) {
function TabbingManager() {
this.stack = [];
}
function TabbingContext(options) {
$.extend(this, {
level: null,
$tabbableElements: $(),
$disabledElements: $(),
released: false,
active: false
}, options);
}
$.extend(TabbingManager.prototype, {
constrain: function constrain(elements) {
var il = this.stack.length;
for (var i = 0; i < il; i++) {
this.stack[i].deactivate();
}
var $elements = $(elements).find(':tabbable').addBack(':tabbable');
var tabbingContext = new TabbingContext({
level: this.stack.length,
$tabbableElements: $elements
});
this.stack.push(tabbingContext);
tabbingContext.activate();
$(document).trigger('drupalTabbingConstrained', tabbingContext);
return tabbingContext;
},
release: function release() {
var toActivate = this.stack.length - 1;
while (toActivate >= 0 && this.stack[toActivate].released) {
toActivate--;
}
this.stack.splice(toActivate + 1);
if (toActivate >= 0) {
this.stack[toActivate].activate();
}
},
activate: function activate(tabbingContext) {
var $set = tabbingContext.$tabbableElements;
var level = tabbingContext.level;
var $disabledSet = $(':tabbable').not($set);
tabbingContext.$disabledElements = $disabledSet;
var il = $disabledSet.length;
for (var i = 0; i < il; i++) {
this.recordTabindex($disabledSet.eq(i), level);
}
$disabledSet.prop('tabindex', -1).prop('autofocus', false);
var $hasFocus = $set.filter('[autofocus]').eq(-1);
if ($hasFocus.length === 0) {
$hasFocus = $set.eq(0);
}
$hasFocus.trigger('focus');
},
deactivate: function deactivate(tabbingContext) {
var $set = tabbingContext.$disabledElements;
var level = tabbingContext.level;
var il = $set.length;
for (var i = 0; i < il; i++) {
this.restoreTabindex($set.eq(i), level);
}
},
recordTabindex: function recordTabindex($el, level) {
var tabInfo = $el.data('drupalOriginalTabIndices') || {};
tabInfo[level] = {
tabindex: $el[0].getAttribute('tabindex'),
autofocus: $el[0].hasAttribute('autofocus')
};
$el.data('drupalOriginalTabIndices', tabInfo);
},
restoreTabindex: function restoreTabindex($el, level) {
var tabInfo = $el.data('drupalOriginalTabIndices');
if (tabInfo && tabInfo[level]) {
var data = tabInfo[level];
if (data.tabindex) {
$el[0].setAttribute('tabindex', data.tabindex);
} else {
$el[0].removeAttribute('tabindex');
}
if (data.autofocus) {
$el[0].setAttribute('autofocus', 'autofocus');
}
if (level === 0) {
$el.removeData('drupalOriginalTabIndices');
} else {
var levelToDelete = level;
while (tabInfo.hasOwnProperty(levelToDelete)) {
delete tabInfo[levelToDelete];
levelToDelete++;
}
$el.data('drupalOriginalTabIndices', tabInfo);
}
}
}
});
$.extend(TabbingContext.prototype, {
release: function release() {
if (!this.released) {
this.deactivate();
this.released = true;
Drupal.tabbingManager.release(this);
$(document).trigger('drupalTabbingContextReleased', this);
}
},
activate: function activate() {
if (!this.active && !this.released) {
this.active = true;
Drupal.tabbingManager.activate(this);
$(document).trigger('drupalTabbingContextActivated', this);
}
},
deactivate: function deactivate() {
if (this.active) {
this.active = false;
Drupal.tabbingManager.deactivate(this);
$(document).trigger('drupalTabbingContextDeactivated', this);
}
}
});
if (Drupal.tabbingManager) {
return;
}
Drupal.tabbingManager = new TabbingManager();
})(jQuery, Drupal);;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function ($, Drupal, Backbone) {
var strings = {
tabbingReleased: Drupal.t('Tabbing is no longer constrained by the Contextual module.'),
tabbingConstrained: Drupal.t('Tabbing is constrained to a set of @contextualsCount and the edit mode toggle.'),
pressEsc: Drupal.t('Press the esc key to exit.')
};
function initContextualToolbar(context) {
if (!Drupal.contextual || !Drupal.contextual.collection) {
return;
}
var contextualToolbar = Drupal.contextualToolbar;
contextualToolbar.model = new contextualToolbar.StateModel({
isViewing: localStorage.getItem('Drupal.contextualToolbar.isViewing') !== 'false'
}, {
contextualCollection: Drupal.contextual.collection
});
var viewOptions = {
el: $('.toolbar .toolbar-bar .contextual-toolbar-tab'),
model: contextualToolbar.model,
strings: strings
};
new contextualToolbar.VisualView(viewOptions);
new contextualToolbar.AuralView(viewOptions);
}
Drupal.behaviors.contextualToolbar = {
attach: function attach(context) {
if ($('body').once('contextualToolbar-init').length) {
initContextualToolbar(context);
}
}
};
Drupal.contextualToolbar = {
model: null
};
})(jQuery, Drupal, Backbone);;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function (Drupal, Backbone) {
Drupal.contextualToolbar.StateModel = Backbone.Model.extend({
defaults: {
isViewing: true,
isVisible: false,
contextualCount: 0,
tabbingContext: null
},
initialize: function initialize(attrs, options) {
this.listenTo(options.contextualCollection, 'reset remove add', this.countContextualLinks);
this.listenTo(options.contextualCollection, 'add', this.lockNewContextualLinks);
this.listenTo(this, 'change:contextualCount', this.updateVisibility);
this.listenTo(this, 'change:isViewing', function (model, isViewing) {
options.contextualCollection.each(function (contextualModel) {
contextualModel.set('isLocked', !isViewing);
});
});
},
countContextualLinks: function countContextualLinks(contextualModel, contextualCollection) {
this.set('contextualCount', contextualCollection.length);
},
lockNewContextualLinks: function lockNewContextualLinks(contextualModel, contextualCollection) {
if (!this.get('isViewing')) {
contextualModel.set('isLocked', true);
}
},
updateVisibility: function updateVisibility() {
this.set('isVisible', this.get('contextualCount') > 0);
}
});
})(Drupal, Backbone);;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function ($, Drupal, Backbone, _) {
Drupal.contextualToolbar.AuralView = Backbone.View.extend({
announcedOnce: false,
initialize: function initialize(options) {
this.options = options;
this.listenTo(this.model, 'change', this.render);
this.listenTo(this.model, 'change:isViewing', this.manageTabbing);
$(document).on('keyup', _.bind(this.onKeypress, this));
this.manageTabbing();
},
render: function render() {
this.$el.find('button').attr('aria-pressed', !this.model.get('isViewing'));
return this;
},
manageTabbing: function manageTabbing() {
var tabbingContext = this.model.get('tabbingContext');
if (tabbingContext) {
if (tabbingContext.active) {
Drupal.announce(this.options.strings.tabbingReleased);
}
tabbingContext.release();
}
if (!this.model.get('isViewing')) {
tabbingContext = Drupal.tabbingManager.constrain($('.contextual-toolbar-tab, .contextual'));
this.model.set('tabbingContext', tabbingContext);
this.announceTabbingConstraint();
this.announcedOnce = true;
}
},
announceTabbingConstraint: function announceTabbingConstraint() {
var strings = this.options.strings;
Drupal.announce(Drupal.formatString(strings.tabbingConstrained, {
'@contextualsCount': Drupal.formatPlural(Drupal.contextual.collection.length, '@count contextual link', '@count contextual links')
}));
Drupal.announce(strings.pressEsc);
},
onKeypress: function onKeypress(event) {
if (!this.announcedOnce && event.keyCode === 9 && !this.model.get('isViewing')) {
this.announceTabbingConstraint();
this.announcedOnce = true;
}
if (event.keyCode === 27) {
this.model.set('isViewing', true);
}
}
});
})(jQuery, Drupal, Backbone, _);;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function (Drupal, Backbone) {
Drupal.contextualToolbar.VisualView = Backbone.View.extend({
events: function events() {
var touchEndToClick = function touchEndToClick(event) {
event.preventDefault();
event.target.click();
};
return {
click: function click() {
this.model.set('isViewing', !this.model.get('isViewing'));
},
touchend: touchEndToClick
};
},
initialize: function initialize() {
this.listenTo(this.model, 'change', this.render);
this.listenTo(this.model, 'change:isViewing', this.persist);
},
render: function render() {
this.$el.toggleClass('hidden', !this.model.get('isVisible'));
this.$el.find('button').toggleClass('is-active', !this.model.get('isViewing'));
return this;
},
persist: function persist(model, isViewing) {
if (!isViewing) {
localStorage.setItem('Drupal.contextualToolbar.isViewing', 'false');
} else {
localStorage.removeItem('Drupal.contextualToolbar.isViewing');
}
}
});
})(Drupal, Backbone);;
/*!
* hoverIntent v1.8.1 // 2014.08.11 // jQuery v1.9.1+
* http://briancherne.github.io/jquery-hoverIntent/
*
* You may use hoverIntent under the terms of the MIT license. Basically that
* means you are free to use hoverIntent as long as this header is left intact.
* Copyright 2007, 2014 Brian Cherne
*/
/* hoverIntent is similar to jQuery's built-in "hover" method except that
* instead of firing the handlerIn function immediately, hoverIntent checks
* to see if the user's mouse has slowed down (beneath the sensitivity
* threshold) before firing the event. The handlerOut function is only
* called after a matching handlerIn.
*
* // basic usage ... just like .hover()
* .hoverIntent( handlerIn, handlerOut )
* .hoverIntent( handlerInOut )
*
* // basic usage ... with event delegation!
* .hoverIntent( handlerIn, handlerOut, selector )
* .hoverIntent( handlerInOut, selector )
*
* // using a basic configuration object
* .hoverIntent( config )
*
* @param handlerIn function OR configuration object
* @param handlerOut function OR selector for delegation OR undefined
* @param selector selector OR undefined
* @author Brian Cherne <brian(at)cherne(dot)net>
*/
;(function(factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
define(['jquery'], factory);
} else if (jQuery && !jQuery.fn.hoverIntent) {
factory(jQuery);
}
})(function($) {
'use strict';
// default configuration values
var _cfg = {
interval: 100,
sensitivity: 6,
timeout: 0
};
// counter used to generate an ID for each instance
var INSTANCE_COUNT = 0;
// current X and Y position of mouse, updated during mousemove tracking (shared across instances)
var cX, cY;
// saves the current pointer position coordinates based on the given mousemove event
var track = function(ev) {
cX = ev.pageX;
cY = ev.pageY;
};
// compares current and previous mouse positions
var compare = function(ev,$el,s,cfg) {
// compare mouse positions to see if pointer has slowed enough to trigger `over` function
if ( Math.sqrt( (s.pX-cX)*(s.pX-cX) + (s.pY-cY)*(s.pY-cY) ) < cfg.sensitivity ) {
$el.off(s.event,track);
delete s.timeoutId;
// set hoverIntent state as active for this element (permits `out` handler to trigger)
s.isActive = true;
// overwrite old mouseenter event coordinates with most recent pointer position
ev.pageX = cX; ev.pageY = cY;
// clear coordinate data from state object
delete s.pX; delete s.pY;
return cfg.over.apply($el[0],[ev]);
} else {
// set previous coordinates for next comparison
s.pX = cX; s.pY = cY;
// use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs)
s.timeoutId = setTimeout( function(){compare(ev, $el, s, cfg);} , cfg.interval );
}
};
// triggers given `out` function at configured `timeout` after a mouseleave and clears state
var delay = function(ev,$el,s,out) {
delete $el.data('hoverIntent')[s.id];
return out.apply($el[0],[ev]);
};
$.fn.hoverIntent = function(handlerIn,handlerOut,selector) {
// instance ID, used as a key to store and retrieve state information on an element
var instanceId = INSTANCE_COUNT++;
// extend the default configuration and parse parameters
var cfg = $.extend({}, _cfg);
if ( $.isPlainObject(handlerIn) ) {
cfg = $.extend(cfg, handlerIn);
if ( !$.isFunction(cfg.out) ) {
cfg.out = cfg.over;
}
} else if ( $.isFunction(handlerOut) ) {
cfg = $.extend(cfg, { over: handlerIn, out: handlerOut, selector: selector } );
} else {
cfg = $.extend(cfg, { over: handlerIn, out: handlerIn, selector: handlerOut } );
}
// A private function for handling mouse 'hovering'
var handleHover = function(e) {
// cloned event to pass to handlers (copy required for event object to be passed in IE)
var ev = $.extend({},e);
// the current target of the mouse event, wrapped in a jQuery object
var $el = $(this);
// read hoverIntent data from element (or initialize if not present)
var hoverIntentData = $el.data('hoverIntent');
if (!hoverIntentData) { $el.data('hoverIntent', (hoverIntentData = {})); }
// read per-instance state from element (or initialize if not present)
var state = hoverIntentData[instanceId];
if (!state) { hoverIntentData[instanceId] = state = { id: instanceId }; }
// state properties:
// id = instance ID, used to clean up data
// timeoutId = timeout ID, reused for tracking mouse position and delaying "out" handler
// isActive = plugin state, true after `over` is called just until `out` is called
// pX, pY = previously-measured pointer coordinates, updated at each polling interval
// event = string representing the namespaced event used for mouse tracking
// clear any existing timeout
if (state.timeoutId) { state.timeoutId = clearTimeout(state.timeoutId); }
// namespaced event used to register and unregister mousemove tracking
var mousemove = state.event = 'mousemove.hoverIntent.hoverIntent'+instanceId;
// handle the event, based on its type
if (e.type === 'mouseenter') {
// do nothing if already active
if (state.isActive) { return; }
// set "previous" X and Y position based on initial entry point
state.pX = ev.pageX; state.pY = ev.pageY;
// update "current" X and Y position based on mousemove
$el.off(mousemove,track).on(mousemove,track);
// start polling interval (self-calling timeout) to compare mouse coordinates over time
state.timeoutId = setTimeout( function(){compare(ev,$el,state,cfg);} , cfg.interval );
} else { // "mouseleave"
// do nothing if not already active
if (!state.isActive) { return; }
// unbind expensive mousemove event
$el.off(mousemove,track);
// if hoverIntent state is true, then call the mouseOut function after the specified delay
state.timeoutId = setTimeout( function(){delay(ev,$el,state,cfg.out);} , cfg.timeout );
}
};
// listen for mouseenter and mouseleave
return this.on({'mouseenter.hoverIntent':handleHover,'mouseleave.hoverIntent':handleHover}, cfg.selector);
};
});
;
(function ($, Drupal) {
Drupal.behaviors.adminToolbar = {
attach: function (context, settings) {
$('a.toolbar-icon', context).removeAttr('title');
$('.toolbar-tray li.menu-item--expanded, .toolbar-tray ul li.menu-item--expanded .menu-item', context).hoverIntent({
over: function () {
// At the current depth, we should delete all "hover-intent" classes.
// Other wise we get unwanted behaviour where menu items are expanded while already in hovering other ones.
$(this).parent().find('li').removeClass('hover-intent');
$(this).addClass('hover-intent');
},
out: function () {
$(this).removeClass('hover-intent');
},
timeout: 250
});
// Make the toolbar menu navigable with keyboard.
$('ul.toolbar-menu li.menu-item--expanded a', context).on('focusin', function () {
$('li.menu-item--expanded', context).removeClass('hover-intent');
$(this).parents('li.menu-item--expanded').addClass('hover-intent');
});
$('ul.toolbar-menu li.menu-item a', context).keydown(function (e) {
if ((e.shiftKey && (e.keyCode || e.which) == 9)) {
if ($(this).parent('.menu-item').prev().hasClass('menu-item--expanded')) {
$(this).parent('.menu-item').prev().addClass('hover-intent');
}
}
});
$('.toolbar-menu:first-child > .menu-item:not(.menu-item--expanded) a, .toolbar-tab > a', context).on('focusin', function () {
$('.menu-item--expanded').removeClass('hover-intent');
});
$('.toolbar-menu:first-child > .menu-item', context).on('hover', function () {
$(this, 'a').css("background: #fff;");
});
$('ul:not(.toolbar-menu)', context).on({
mousemove: function () {
$('li.menu-item--expanded').removeClass('hover-intent');
},
hover: function () {
$('li.menu-item--expanded').removeClass('hover-intent');
}
});
}
};
})(jQuery, Drupal);
;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function ($, Drupal, drupalSettings) {
var pathInfo = drupalSettings.path;
var escapeAdminPath = sessionStorage.getItem('escapeAdminPath');
var windowLocation = window.location;
if (!pathInfo.currentPathIsAdmin && !/destination=/.test(windowLocation.search)) {
sessionStorage.setItem('escapeAdminPath', windowLocation);
}
Drupal.behaviors.escapeAdmin = {
attach: function attach() {
var $toolbarEscape = $('[data-toolbar-escape-admin]').once('escapeAdmin');
if ($toolbarEscape.length && pathInfo.currentPathIsAdmin) {
if (escapeAdminPath !== null) {
$toolbarEscape.attr('href', escapeAdminPath);
} else {
$toolbarEscape.text(Drupal.t('Home'));
}
}
}
};
})(jQuery, Drupal, drupalSettings);;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function ($, Drupal, drupalSettings) {
function mapTextContentToAjaxResponse(content) {
if (content === '') {
return false;
}
try {
return JSON.parse(content);
} catch (e) {
return false;
}
}
function bigPipeProcessPlaceholderReplacement(index, placeholderReplacement) {
var placeholderId = placeholderReplacement.getAttribute('data-big-pipe-replacement-for-placeholder-with-id');
var content = this.textContent.trim();
if (typeof drupalSettings.bigPipePlaceholderIds[placeholderId] !== 'undefined') {
var response = mapTextContentToAjaxResponse(content);
if (response === false) {
$(this).removeOnce('big-pipe');
} else {
var ajaxObject = Drupal.ajax({
url: '',
base: false,
element: false,
progress: false
});
ajaxObject.success(response, 'success');
}
}
}
var interval = drupalSettings.bigPipeInterval || 50;
var timeoutID = void 0;
function bigPipeProcessDocument(context) {
if (!context.querySelector('script[data-big-pipe-event="start"]')) {
return false;
}
$(context).find('script[data-big-pipe-replacement-for-placeholder-with-id]').once('big-pipe').each(bigPipeProcessPlaceholderReplacement);
if (context.querySelector('script[data-big-pipe-event="stop"]')) {
if (timeoutID) {
clearTimeout(timeoutID);
}
return true;
}
return false;
}
function bigPipeProcess() {
timeoutID = setTimeout(function () {
if (!bigPipeProcessDocument(document)) {
bigPipeProcess();
}
}, interval);
}
bigPipeProcess();
$(window).on('load', function () {
if (timeoutID) {
clearTimeout(timeoutID);
}
bigPipeProcessDocument(document);
});
})(jQuery, Drupal, drupalSettings);;
|
import { useReducer, useRef } from 'react'
import { actionTypes, actions } from './actions'
const initialState = {
selfControlled: false,
columns: [],
data: [],
totalItems: 0,
withRowActions: false,
filters: [],
selection: {
isActive: false,
selectBy: 'id',
items: [],
excludeMode: false,
checkRowSelectable: () => true,
},
columnManagement: {
isActive: false,
isOpen: false,
},
sort: {
sortable: false,
sortBy: {
field: null,
order: null,
type: '',
},
},
}
const toggleSelection = (selection, totalItems, payload) => {
const { excludeMode, items, selectBy } = selection
const { item, isSelected } = payload
const addItem = excludeMode === isSelected
if (addItem) {
if (items.length + 1 === totalItems && excludeMode) {
return { items: [], excludeMode: !excludeMode }
}
return { items: [...items, item[selectBy]], excludeMode: excludeMode }
}
return {
items: items.filter(
selectByField => selectByField !== payload.item[selectBy],
),
excludeMode: excludeMode,
}
}
const toggleSelectAll = (selection, selfControlled, payload, totalItems) => {
const isAllSelected = selfControlled
? selection.items.length === totalItems
: selection.excludeMode && !selection.items.length
let excludeMode = selection.excludeMode
let items = []
if (selfControlled) {
items = !selection.items.length
? payload.map(item => item[selection.selectBy])
: []
} else {
excludeMode = !isAllSelected && !selection.items.length
}
return {
excludeMode,
items,
}
}
const reducer = (state, action) => {
switch (action.type) {
case actionTypes.SET_COLUMNS:
return { ...state, columns: action.payload }
case actionTypes.SET_DATA:
return { ...state, data: [...action.payload] }
case actionTypes.SET_TOTAL_ITEMS:
return { ...state, totalItems: action.payload }
case actionTypes.SET_SELF_CONTROLLED:
return { ...state, selfControlled: action.payload }
case actionTypes.SET_WITH_ROW_ACTIONS:
return { ...state, withRowActions: action.payload }
case actionTypes.SET_SELECTION_ACTIVITY:
return {
...state,
selection: {
...state.selection,
isActive: action.payload.selectable,
selectBy: action.payload.selectBy,
},
}
case actionTypes.SET_SELECTION:
return {
...state,
selection: {
...state.selection,
items: action.payload.items,
excludeMode: action.payload.excludeMode,
},
}
case actionTypes.SET_CHECK_ROW_SELECTABLE:
return {
...state,
selection: {
...state.selection,
checkRowSelectable: action.payload,
},
}
case actionTypes.TOGGLE_SELECTED_ITEM:
const selection = toggleSelection(
state.selection,
state.totalItems,
action.payload,
)
return {
...state,
selection: {
...state.selection,
items: selection.items,
excludeMode: selection.excludeMode,
},
}
case actionTypes.TOGGLE_SELECT_ALL:
const newSelection = toggleSelectAll(
state.selection,
state.selfControlled,
action.payload,
state.totalItems,
)
return { ...state, selection: { ...state.selection, ...newSelection } }
case actionTypes.DESELECT_ALL:
return {
...state,
selection: { ...state.selection, excludeMode: false, items: [] },
}
case actionTypes.SET_SORTABLE:
return { ...state, sort: { ...state.sort, sortable: action.payload } }
case actionTypes.SET_FILTERS:
return { ...state, filters: action.payload }
case actionTypes.SET_SORT_BY:
return { ...state, sort: { ...state.sort, sortBy: action.payload } }
case actionTypes.SET_COLUMN_MANAGEMENT_ACTIVITY:
return {
...state,
columnManagement: {
...state.columnManagement,
isActive: action.payload,
},
}
case actionTypes.SET_COLUMN_MANAGEMENT_IS_OPEN:
return {
...state,
columnManagement: { ...state.columnManagement, isOpen: action.payload },
}
default:
return state
}
}
export default () => {
const [state, dispatch] = useReducer(reducer, initialState)
const { current: bondedActions } = useRef(actions(dispatch))
return [state, bondedActions]
}
|
var path = require('path')
var utils = require('./utils')
var webpack = require('webpack')
var config = require('../config')
var vueLoaderConfig = require('./vue-loader.conf')
function resolve (dir) {
return path.join(__dirname, '..', dir)
}
module.exports = {
entry: {
app: ['babel-polyfill','./src/main.js']
},
output: {
path: config.build.assetsRoot,
filename: '[name].js',
publicPath: process.env.NODE_ENV === 'production'
? config.build.assetsPublicPath
: config.dev.assetsPublicPath
},
resolve: {
extensions: ['.js', '.vue', '.json'],
modules: [
resolve('src'),
resolve('node_modules')
],
alias: {
'vue$': 'vue/dist/vue.common.js',
'src': resolve('src'),
'assets': resolve('src/assets'),
'components': resolve('src/components')
}
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
options: {
loaders: {
scss: 'style-loader!css-loader!sass-loader',
sass: 'style-loader!css-loader!sass-loader?indentedSyntax',
},
},
},
{
test: /\.js$/,
loader: 'babel-loader',
include: [
resolve('src'),
resolve('test'),
resolve('node_modules/element-ui/src/mixins/emitter.js'),
resolve('node_modules/element-ui/src/utils/util.js')
]
},
{
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
loader: 'url-loader',
query: {
limit: 10000,
name: utils.assetsPath('img/[name].[hash:7].[ext]')
}
},
{
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
loader: 'url-loader',
query: {
limit: 10000,
name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
}
}
]
},
// plugins: [
// new webpack.DllReferencePlugin({
// context: path.resolve(__dirname, '..'),
// manifest: require('./vendor-manifest.json')
// })
// ]
plugins:[
new webpack.ProvidePlugin({
jQuery:"jquery",
$:"jquery"
})
],
}
|
const fs = require('fs-extra');
const { Base64 } = require('js-base64');
const { CONSTANTS } = require('../Constants');
function setupContractPayload(name, file, additionalReplacements = null) {
let contractCode = fs.readFileSync(file);
contractCode = contractCode.toString();
contractCode = contractCode.replace(/'\$\{CONSTANTS.UTILITY_TOKEN_PRECISION\}\$'/g, CONSTANTS.UTILITY_TOKEN_PRECISION);
contractCode = contractCode.replace(/'\$\{CONSTANTS.UTILITY_TOKEN_SYMBOL\}\$'/g, CONSTANTS.UTILITY_TOKEN_SYMBOL);
contractCode = contractCode.replace(/'\$\{CONSTANTS.GOVERNANCE_TOKEN_PRECISION\}\$'/g, CONSTANTS.GOVERNANCE_TOKEN_PRECISION);
contractCode = contractCode.replace(/'\$\{CONSTANTS.GOVERNANCE_TOKEN_SYMBOL\}\$'/g, CONSTANTS.GOVERNANCE_TOKEN_SYMBOL);
contractCode = contractCode.replace(/'\$\{CONSTANTS.GOVERNANCE_TOKEN_MIN_VALUE\}\$'/g, CONSTANTS.GOVERNANCE_TOKEN_MIN_VALUE);
contractCode = contractCode.replace(/'\$\{CONSTANTS.HIVE_PEGGED_SYMBOL\}\$'/g, CONSTANTS.HIVE_PEGGED_SYMBOL);
contractCode = contractCode.replace(/'\$\{CONSTANTS.HIVE_ENGINE_ACCOUNT\}\$'/g, CONSTANTS.HIVE_ENGINE_ACCOUNT);
if (additionalReplacements) {
contractCode = additionalReplacements(contractCode);
}
const base64ContractCode = Base64.encode(contractCode);
return {
name,
params: '',
code: base64ContractCode,
};
}
module.exports.setupContractPayload = setupContractPayload;
|
/*!
* ${copyright}
*/
// Provides the XMPPJSONPatchSyncPatchSync model implementation of a list binding
sap.ui.define(['jquery.sap.global', 'sap/ui/model/ChangeReason', 'sap/ui/model/ClientListBinding'],
function(jQuery, ChangeReason, ClientListBinding) {
"use strict";
/**
*
* @class
* List binding implementation for XMPPJSONPatchSync format
*
* @param {incentergy.model.XMPPJSONPatchSyncModel} oModel
* @param {string} sPath
* @param {sap.ui.model.Context} oContext
* @param {sap.ui.model.Sorter|sap.ui.model.Sorter[]} [aSorters] initial sort order (can be either a sorter or an array of sorters)
* @param {sap.ui.model.Filter|sap.ui.model.Filter[]} [aFilters] predefined filter/s (can be either a filter or an array of filters)
* @param {object} [mParameters]
* @alias incentergy.model.XMPPJSONPatchSyncListBinding
* @extends sap.ui.model.ClientListBinding
*/
var XMPPJSONPatchSyncListBinding = ClientListBinding.extend("incentergy.model.XMPPJSONPatchSyncListBinding");
/**
* Return contexts for the list or a specified subset of contexts
* @param {int} [iStartIndex=0] the startIndex where to start the retrieval of contexts
* @param {int} [iLength=length of the list] determines how many contexts to retrieve beginning from the start index.
* Default is the whole list length.
*
* @return {Array} the contexts array
* @protected
*/
XMPPJSONPatchSyncListBinding.prototype.getContexts = function(iStartIndex, iLength) {
this.iLastStartIndex = iStartIndex;
this.iLastLength = iLength;
if (!iStartIndex) {
iStartIndex = 0;
}
if (!iLength) {
iLength = Math.min(this.iLength, this.oModel.iSizeLimit);
}
var aContexts = this._getContexts(iStartIndex, iLength),
aContextData = [];
if (this.bUseExtendedChangeDetection) {
// Use try/catch to detect issues with cyclic references in JS objects,
// in this case diff will be disabled.
try {
for (var i = 0; i < aContexts.length; i++) {
aContextData.push(this.getContextData(aContexts[i]));
}
//Check diff
if (this.aLastContextData && iStartIndex < this.iLastEndIndex) {
aContexts.diff = jQuery.sap.arraySymbolDiff(this.aLastContextData, aContextData);
}
this.iLastEndIndex = iStartIndex + iLength;
this.aLastContexts = aContexts.slice(0);
this.aLastContextData = aContextData.slice(0);
} catch (oError) {
this.bUseExtendedChangeDetection = false;
jQuery.sap.log.warning("XMPPJSONPatchSyncListBinding: Extended change detection has been disabled as XMPPJSONPatchSync data could not be serialized.");
}
}
return aContexts;
};
XMPPJSONPatchSyncListBinding.prototype.getCurrentContexts = function() {
if (this.bUseExtendedChangeDetection) {
return this.aLastContexts || [];
} else {
return this.getContexts(this.iLastStartIndex, this.iLastLength);
}
};
/**
* Get indices of the list
*/
XMPPJSONPatchSyncListBinding.prototype.updateIndices = function() {
var i;
this.aIndices = [];
if (Array.isArray(this.oList)) {
for (i = 0; i < this.oList.length; i++) {
this.aIndices.push(i);
}
} else {
for (i in this.oList) {
this.aIndices.push(i);
}
}
};
/**
* Update the list, indices array and apply sorting and filtering
* @private
*/
XMPPJSONPatchSyncListBinding.prototype.update = function() {
var oList = this.oModel._getObject(this.sPath, this.oContext);
if (oList) {
if (Array.isArray(oList)) {
if (this.bUseExtendedChangeDetection) {
this.oList = jQuery.extend(true, [], oList);
} else {
this.oList = oList.slice(0);
}
} else {
this.oList = jQuery.extend(this.bUseExtendedChangeDetection, {}, oList);
}
this.updateIndices();
this.applyFilter();
this.applySort();
this.iLength = this._getLength();
} else {
this.oList = [];
this.aIndices = [];
this.iLength = 0;
}
};
/**
* Check whether this Binding would provide new values and in case it changed,
* inform interested parties about this.
*
* @param {boolean} bForceupdate
*
*/
XMPPJSONPatchSyncListBinding.prototype.checkUpdate = function(bForceupdate) {
if (this.bSuspended && !this.bIgnoreSuspend && !bForceupdate) {
return;
}
if (!this.bUseExtendedChangeDetection) {
var oList = this.oModel._getObject(this.sPath, this.oContext);
if (!jQuery.sap.equal(this.oList, oList) || bForceupdate) {
this.update();
this._fireChange({ reason: ChangeReason.Change });
}
} else {
var bChangeDetected = false;
var that = this;
//If the list has changed we need to update the indices first
var oList = this.oModel._getObject(this.sPath, this.oContext);
if (oList && this.oList.length != oList.length) {
bChangeDetected = true;
}
if (!jQuery.sap.equal(this.oList, oList)) {
this.update();
}
//Get contexts for visible area and compare with stored contexts
var aContexts = this._getContexts(this.iLastStartIndex, this.iLastLength);
if (this.aLastContexts) {
if (this.aLastContexts.length != aContexts.length) {
bChangeDetected = true;
} else {
jQuery.each(this.aLastContextData, function(iIndex, oLastData) {
var oCurrentData = that.getContextData(aContexts[iIndex]);
if (oCurrentData !== oLastData) {
bChangeDetected = true;
return false;
}
});
}
} else {
bChangeDetected = true;
}
if (bChangeDetected || bForceupdate) {
this._fireChange({ reason: ChangeReason.Change });
}
}
};
return XMPPJSONPatchSyncListBinding;
});
|
//contact
if(!!document.getElementById('email')) {
var user = 'hello', domain = 'zettamachine.com';
document.getElementById('email').innerHTML = '<i class="fa fa-envelope"></i> <a href="mailto:' + user + '@' + domain + '">' + user + '@' + domain + '</a>';
}
//nav background
window.onscroll= function(e) {
e.preventDefault();
if(window.scrollY > 0) {
document.querySelector('.navbar').style.backgroundColor = 'rgb(16,20,23, 0.5)';
} else {
document.querySelector('.navbar').style.backgroundColor = 'rgba(16,20,23)';
}
}
//burger
document.querySelector('.navbar-burger').addEventListener('click',function(e) {
e.preventDefault();
this.classList.toggle('is-active');
document.getElementById('zetta-burger').classList.toggle('is-active');
document.getElementById('zetta-burger').style.backgroundColor = 'rgb(16,20,23)';
});
document.getElementById('zetta-burger').addEventListener('mouseleave',function(e) {
e.preventDefault();
console.log('mouse leave');
document.querySelector('.navbar-burger').classList.toggle('is-active');
document.getElementById('zetta-burger').classList.toggle('is-active');
});
|
const path = require('path');
module.exports = {
ignore: ['**/Nav*/*.js'],
components: 'app/components/**/index.js',
defaultExample: true,
moduleAliases: {
components: path.resolve(__dirname, 'app/components'),
images: path.resolve(__dirname, 'app/images'),
},
webpackConfig: {
module: {
rules: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel-loader',
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader'],
},
{
test: /\.(png|jpe?g|gif)$/i,
use: [
{
loader: 'file-loader',
},
],
},
],
},
},
};
|
"use strict";
const { MAP_SIZE_X, MAP_SIZE_Z, INIT_SHADOW_COUNT, INIT_GRASS_COUNT } = require("../config");
const Grass = require("../behaviors/Grass");
const Orb = require("../behaviors/Orb");
const Shadow = require("../behaviors/Shadow");
const { randomPosition } = require("../utils/random");
class GameState {
constructor() {
this.isPaused = true;
this.gameTicks = 0;
this.mapSize = {
x: MAP_SIZE_X,
z: MAP_SIZE_Z
};
this.gameStep = 1;
this.shadows = generateShadows();
this.orbs = [];
this.grass = generateGrass();
}
/**
* Returns orbs that are alive in game.
*/
liveOrbs() {
return this.orbs.filter((orb) => Orb.LiveBehaviors.includes(orb.currentBehavior));
}
}
function generateShadows() {
const shadows = [];
for (let i = 0; i < INIT_SHADOW_COUNT; i++) {
const shadow = new Shadow(randomPosition());
while (coordinatesAreUsed(shadow, shadows)) {
shadow.position = randomPosition();
}
shadows.push(shadow);
}
return shadows;
}
function generateGrass() {
const grasses = [];
for (let i = 0; i < INIT_GRASS_COUNT; i++) {
const grass = new Grass(randomPosition());
while (coordinatesAreUsed(grass, grasses)) {
grass.position = randomPosition();
}
grasses.push(grass);
}
return grasses;
}
function coordinatesAreUsed(object, objects) {
for (const other of objects) {
if (object.isTouching(other)) {
return true;
}
}
return false;
}
module.exports = GameState;
|
// This file has been autogenerated.
var profile = require('../../../lib/util/profile');
exports.getMockedProfile = function () {
var newProfile = new profile.Profile();
newProfile.addSubscription(new profile.Subscription({
id: 'e33f361b-53c2-4cc7-b829-78906708387b',
name: 'Microsoft Azure Internal Consumption',
user: {
name: 'user@domain.example',
type: 'servicePrincipal'
},
tenantId: '72f988bf-86f1-41af-91ab-2d7cd011db47',
state: 'Enabled',
registeredProviders: [],
_eventsCount: '1',
isDefault: true
}, newProfile.environments['AzureCloud']));
return newProfile;
};
exports.setEnvironment = function() {
process.env['AZURE_VM_TEST_LOCATION'] = 'eastus';
};
exports.scopes = [[function (nock) {
var result =
nock('http://management.azure.com:443')
.get('/subscriptions/e33f361b-53c2-4cc7-b829-78906708387b/providers/Microsoft.ContainerService/containerServices?api-version=2016-09-30')
.reply(200, "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/e33f361b-53c2-4cc7-b829-78906708387b/resourceGroups/XPLATTSTCNTNGCREATE1735/providers/Microsoft.ContainerService/containerServices/xplatContainer23022\",\r\n \"name\": \"xplatContainer23022\",\r\n \"type\": \"Microsoft.ContainerService/ContainerServices\",\r\n \"location\": \"australiasoutheast\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"orchestratorProfile\": {\r\n \"orchestratorType\": \"Swarm\"\r\n },\r\n \"masterProfile\": {\r\n \"count\": 1,\r\n \"dnsPrefix\": \"xplatContainer23022master\",\r\n \"fqdn\": \"xplatcontainer23022master.australiasoutheast.cloudapp.azure.com\"\r\n },\r\n \"agentPoolProfiles\": [\r\n {\r\n \"name\": \"xplatContainer23022a1\",\r\n \"count\": 1,\r\n \"vmSize\": \"Standard_A1\",\r\n \"dnsPrefix\": \"xplatContainer23022a2\",\r\n \"fqdn\": \"xplatcontainer23022a2.australiasoutheast.cloudapp.azure.com\",\r\n \"osType\": \"Linux\"\r\n }\r\n ],\r\n \"linuxProfile\": {\r\n \"ssh\": {\r\n \"publicKeys\": [\r\n {\r\n \"keyData\": \"ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEA1J/ZLar7bMxCr0eN1yAkMM8B7Z6eQP2P0LG5W/ATM/c7r5voER2N/xJ2JMyKRM73zX83nyTroGRynFsLTaizSQ2hNCAs15oxwspnFrlBZVsNhNs6DvPUDosJ81/ud5Emle8VYAWCwtAl0BVx+fWCygqKTXcYznuHTwnxYyk5hgPno3YD7/mk2j53EN6iY+ua0FNnxPQAHIXxwREOWSTr4zp40vEpfbww2GuabdACh5gg7rxtjCb2NAIKBmn8Bm0fpKzwtaPA6ihFfUwpBvhihdn7OIpss7G50VplX+h3xdyx31TFJ7rcqlsSrwXI1SNic0WWjnU1j/6Ely4Z1HnCYQ==\"\r\n }\r\n ]\r\n },\r\n \"adminUsername\": \"azureuser\"\r\n },\r\n \"diagnosticsProfile\": {\r\n \"vmDiagnostics\": {\r\n \"enabled\": true,\r\n \"storageUri\": \"https://cjiaqe6pelcv4swarmdiag0.blob.core.windows.net/\"\r\n }\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/e33f361b-53c2-4cc7-b829-78906708387b/resourceGroups/XPLATTSTCNTNGCREATE1735/providers/Microsoft.ContainerService/containerServices/xplatContainer3361\",\r\n \"name\": \"xplatContainer3361\",\r\n \"type\": \"Microsoft.ContainerService/ContainerServices\",\r\n \"location\": \"australiasoutheast\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"orchestratorProfile\": {\r\n \"orchestratorType\": \"DCOS\"\r\n },\r\n \"masterProfile\": {\r\n \"count\": 1,\r\n \"dnsPrefix\": \"xplatContainer3361master\",\r\n \"fqdn\": \"xplatcontainer3361master.australiasoutheast.cloudapp.azure.com\"\r\n },\r\n \"agentPoolProfiles\": [\r\n {\r\n \"name\": \"xplatContainer3361a1\",\r\n \"count\": 2,\r\n \"vmSize\": \"Standard_A1\",\r\n \"dnsPrefix\": \"xplatContainer3361a2\",\r\n \"fqdn\": \"xplatcontainer3361a2.australiasoutheast.cloudapp.azure.com\",\r\n \"osType\": \"Linux\"\r\n }\r\n ],\r\n \"linuxProfile\": {\r\n \"ssh\": {\r\n \"publicKeys\": [\r\n {\r\n \"keyData\": \"ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEA1J/ZLar7bMxCr0eN1yAkMM8B7Z6eQP2P0LG5W/ATM/c7r5voER2N/xJ2JMyKRM73zX83nyTroGRynFsLTaizSQ2hNCAs15oxwspnFrlBZVsNhNs6DvPUDosJ81/ud5Emle8VYAWCwtAl0BVx+fWCygqKTXcYznuHTwnxYyk5hgPno3YD7/mk2j53EN6iY+ua0FNnxPQAHIXxwREOWSTr4zp40vEpfbww2GuabdACh5gg7rxtjCb2NAIKBmn8Bm0fpKzwtaPA6ihFfUwpBvhihdn7OIpss7G50VplX+h3xdyx31TFJ7rcqlsSrwXI1SNic0WWjnU1j/6Ely4Z1HnCYQ==\"\r\n }\r\n ]\r\n },\r\n \"adminUsername\": \"azureuser\"\r\n },\r\n \"diagnosticsProfile\": {\r\n \"vmDiagnostics\": {\r\n \"enabled\": true,\r\n \"storageUri\": \"https://rqtvpeoexq5xidiag0.blob.core.windows.net/\"\r\n }\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/e33f361b-53c2-4cc7-b829-78906708387b/resourceGroups/XPLATTSTCNTNGCREATE6747/providers/Microsoft.ContainerService/containerServices/xplatContainer7523\",\r\n \"name\": \"xplatContainer7523\",\r\n \"type\": \"Microsoft.ContainerService/ContainerServices\",\r\n \"location\": \"australiasoutheast\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"orchestratorProfile\": {\r\n \"orchestratorType\": \"DCOS\"\r\n },\r\n \"masterProfile\": {\r\n \"count\": 1,\r\n \"dnsPrefix\": \"xplatContainer7523master\",\r\n \"fqdn\": \"xplatcontainer7523master.australiasoutheast.cloudapp.azure.com\"\r\n },\r\n \"agentPoolProfiles\": [\r\n {\r\n \"name\": \"xplatContainer7523a1\",\r\n \"count\": 2,\r\n \"vmSize\": \"Standard_A1\",\r\n \"dnsPrefix\": \"xplatContainer7523a2\",\r\n \"fqdn\": \"xplatcontainer7523a2.australiasoutheast.cloudapp.azure.com\",\r\n \"osType\": \"Linux\"\r\n }\r\n ],\r\n \"linuxProfile\": {\r\n \"ssh\": {\r\n \"publicKeys\": [\r\n {\r\n \"keyData\": \"ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEA1J/ZLar7bMxCr0eN1yAkMM8B7Z6eQP2P0LG5W/ATM/c7r5voER2N/xJ2JMyKRM73zX83nyTroGRynFsLTaizSQ2hNCAs15oxwspnFrlBZVsNhNs6DvPUDosJ81/ud5Emle8VYAWCwtAl0BVx+fWCygqKTXcYznuHTwnxYyk5hgPno3YD7/mk2j53EN6iY+ua0FNnxPQAHIXxwREOWSTr4zp40vEpfbww2GuabdACh5gg7rxtjCb2NAIKBmn8Bm0fpKzwtaPA6ihFfUwpBvhihdn7OIpss7G50VplX+h3xdyx31TFJ7rcqlsSrwXI1SNic0WWjnU1j/6Ely4Z1HnCYQ==\"\r\n }\r\n ]\r\n },\r\n \"adminUsername\": \"azureuser\"\r\n },\r\n \"diagnosticsProfile\": {\r\n \"vmDiagnostics\": {\r\n \"enabled\": true,\r\n \"storageUri\": \"https://fmbr2fokmn72odiag0.blob.core.windows.net/\"\r\n }\r\n }\r\n }\r\n }\r\n ]\r\n}", { 'cache-control': 'no-cache',
pragma: 'no-cache',
'content-length': '5597',
'content-type': 'application/json; charset=utf-8',
expires: '-1',
'strict-transport-security': 'max-age=31536000; includeSubDomains',
'x-ms-served-by': '6d8fb542-dd65-48cb-9954-9a384a89dc05_131277408688806488',
'x-ms-request-id': '228683bc-1373-4f09-9a14-1f4ec1eeaf16',
server: 'Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0',
'x-ms-ratelimit-remaining-subscription-reads': '14995',
'x-ms-correlation-request-id': '75e2f964-4fac-4936-a7cb-72a901360f06',
'x-ms-routing-request-id': 'CENTRALUS:20170129T094934Z:75e2f964-4fac-4936-a7cb-72a901360f06',
date: 'Sun, 29 Jan 2017 09:49:34 GMT',
connection: 'close' });
return result; },
function (nock) {
var result =
nock('https://management.azure.com:443')
.get('/subscriptions/e33f361b-53c2-4cc7-b829-78906708387b/providers/Microsoft.ContainerService/containerServices?api-version=2016-09-30')
.reply(200, "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/e33f361b-53c2-4cc7-b829-78906708387b/resourceGroups/XPLATTSTCNTNGCREATE1735/providers/Microsoft.ContainerService/containerServices/xplatContainer23022\",\r\n \"name\": \"xplatContainer23022\",\r\n \"type\": \"Microsoft.ContainerService/ContainerServices\",\r\n \"location\": \"australiasoutheast\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"orchestratorProfile\": {\r\n \"orchestratorType\": \"Swarm\"\r\n },\r\n \"masterProfile\": {\r\n \"count\": 1,\r\n \"dnsPrefix\": \"xplatContainer23022master\",\r\n \"fqdn\": \"xplatcontainer23022master.australiasoutheast.cloudapp.azure.com\"\r\n },\r\n \"agentPoolProfiles\": [\r\n {\r\n \"name\": \"xplatContainer23022a1\",\r\n \"count\": 1,\r\n \"vmSize\": \"Standard_A1\",\r\n \"dnsPrefix\": \"xplatContainer23022a2\",\r\n \"fqdn\": \"xplatcontainer23022a2.australiasoutheast.cloudapp.azure.com\",\r\n \"osType\": \"Linux\"\r\n }\r\n ],\r\n \"linuxProfile\": {\r\n \"ssh\": {\r\n \"publicKeys\": [\r\n {\r\n \"keyData\": \"ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEA1J/ZLar7bMxCr0eN1yAkMM8B7Z6eQP2P0LG5W/ATM/c7r5voER2N/xJ2JMyKRM73zX83nyTroGRynFsLTaizSQ2hNCAs15oxwspnFrlBZVsNhNs6DvPUDosJ81/ud5Emle8VYAWCwtAl0BVx+fWCygqKTXcYznuHTwnxYyk5hgPno3YD7/mk2j53EN6iY+ua0FNnxPQAHIXxwREOWSTr4zp40vEpfbww2GuabdACh5gg7rxtjCb2NAIKBmn8Bm0fpKzwtaPA6ihFfUwpBvhihdn7OIpss7G50VplX+h3xdyx31TFJ7rcqlsSrwXI1SNic0WWjnU1j/6Ely4Z1HnCYQ==\"\r\n }\r\n ]\r\n },\r\n \"adminUsername\": \"azureuser\"\r\n },\r\n \"diagnosticsProfile\": {\r\n \"vmDiagnostics\": {\r\n \"enabled\": true,\r\n \"storageUri\": \"https://cjiaqe6pelcv4swarmdiag0.blob.core.windows.net/\"\r\n }\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/e33f361b-53c2-4cc7-b829-78906708387b/resourceGroups/XPLATTSTCNTNGCREATE1735/providers/Microsoft.ContainerService/containerServices/xplatContainer3361\",\r\n \"name\": \"xplatContainer3361\",\r\n \"type\": \"Microsoft.ContainerService/ContainerServices\",\r\n \"location\": \"australiasoutheast\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"orchestratorProfile\": {\r\n \"orchestratorType\": \"DCOS\"\r\n },\r\n \"masterProfile\": {\r\n \"count\": 1,\r\n \"dnsPrefix\": \"xplatContainer3361master\",\r\n \"fqdn\": \"xplatcontainer3361master.australiasoutheast.cloudapp.azure.com\"\r\n },\r\n \"agentPoolProfiles\": [\r\n {\r\n \"name\": \"xplatContainer3361a1\",\r\n \"count\": 2,\r\n \"vmSize\": \"Standard_A1\",\r\n \"dnsPrefix\": \"xplatContainer3361a2\",\r\n \"fqdn\": \"xplatcontainer3361a2.australiasoutheast.cloudapp.azure.com\",\r\n \"osType\": \"Linux\"\r\n }\r\n ],\r\n \"linuxProfile\": {\r\n \"ssh\": {\r\n \"publicKeys\": [\r\n {\r\n \"keyData\": \"ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEA1J/ZLar7bMxCr0eN1yAkMM8B7Z6eQP2P0LG5W/ATM/c7r5voER2N/xJ2JMyKRM73zX83nyTroGRynFsLTaizSQ2hNCAs15oxwspnFrlBZVsNhNs6DvPUDosJ81/ud5Emle8VYAWCwtAl0BVx+fWCygqKTXcYznuHTwnxYyk5hgPno3YD7/mk2j53EN6iY+ua0FNnxPQAHIXxwREOWSTr4zp40vEpfbww2GuabdACh5gg7rxtjCb2NAIKBmn8Bm0fpKzwtaPA6ihFfUwpBvhihdn7OIpss7G50VplX+h3xdyx31TFJ7rcqlsSrwXI1SNic0WWjnU1j/6Ely4Z1HnCYQ==\"\r\n }\r\n ]\r\n },\r\n \"adminUsername\": \"azureuser\"\r\n },\r\n \"diagnosticsProfile\": {\r\n \"vmDiagnostics\": {\r\n \"enabled\": true,\r\n \"storageUri\": \"https://rqtvpeoexq5xidiag0.blob.core.windows.net/\"\r\n }\r\n }\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/e33f361b-53c2-4cc7-b829-78906708387b/resourceGroups/XPLATTSTCNTNGCREATE6747/providers/Microsoft.ContainerService/containerServices/xplatContainer7523\",\r\n \"name\": \"xplatContainer7523\",\r\n \"type\": \"Microsoft.ContainerService/ContainerServices\",\r\n \"location\": \"australiasoutheast\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"orchestratorProfile\": {\r\n \"orchestratorType\": \"DCOS\"\r\n },\r\n \"masterProfile\": {\r\n \"count\": 1,\r\n \"dnsPrefix\": \"xplatContainer7523master\",\r\n \"fqdn\": \"xplatcontainer7523master.australiasoutheast.cloudapp.azure.com\"\r\n },\r\n \"agentPoolProfiles\": [\r\n {\r\n \"name\": \"xplatContainer7523a1\",\r\n \"count\": 2,\r\n \"vmSize\": \"Standard_A1\",\r\n \"dnsPrefix\": \"xplatContainer7523a2\",\r\n \"fqdn\": \"xplatcontainer7523a2.australiasoutheast.cloudapp.azure.com\",\r\n \"osType\": \"Linux\"\r\n }\r\n ],\r\n \"linuxProfile\": {\r\n \"ssh\": {\r\n \"publicKeys\": [\r\n {\r\n \"keyData\": \"ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEA1J/ZLar7bMxCr0eN1yAkMM8B7Z6eQP2P0LG5W/ATM/c7r5voER2N/xJ2JMyKRM73zX83nyTroGRynFsLTaizSQ2hNCAs15oxwspnFrlBZVsNhNs6DvPUDosJ81/ud5Emle8VYAWCwtAl0BVx+fWCygqKTXcYznuHTwnxYyk5hgPno3YD7/mk2j53EN6iY+ua0FNnxPQAHIXxwREOWSTr4zp40vEpfbww2GuabdACh5gg7rxtjCb2NAIKBmn8Bm0fpKzwtaPA6ihFfUwpBvhihdn7OIpss7G50VplX+h3xdyx31TFJ7rcqlsSrwXI1SNic0WWjnU1j/6Ely4Z1HnCYQ==\"\r\n }\r\n ]\r\n },\r\n \"adminUsername\": \"azureuser\"\r\n },\r\n \"diagnosticsProfile\": {\r\n \"vmDiagnostics\": {\r\n \"enabled\": true,\r\n \"storageUri\": \"https://fmbr2fokmn72odiag0.blob.core.windows.net/\"\r\n }\r\n }\r\n }\r\n }\r\n ]\r\n}", { 'cache-control': 'no-cache',
pragma: 'no-cache',
'content-length': '5597',
'content-type': 'application/json; charset=utf-8',
expires: '-1',
'strict-transport-security': 'max-age=31536000; includeSubDomains',
'x-ms-served-by': '6d8fb542-dd65-48cb-9954-9a384a89dc05_131277408688806488',
'x-ms-request-id': '228683bc-1373-4f09-9a14-1f4ec1eeaf16',
server: 'Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0',
'x-ms-ratelimit-remaining-subscription-reads': '14995',
'x-ms-correlation-request-id': '75e2f964-4fac-4936-a7cb-72a901360f06',
'x-ms-routing-request-id': 'CENTRALUS:20170129T094934Z:75e2f964-4fac-4936-a7cb-72a901360f06',
date: 'Sun, 29 Jan 2017 09:49:34 GMT',
connection: 'close' });
return result; }]];
|
//> This is the litterate configuration file for litterate itself.
module.exports = {
name: 'Animated Value',
description: '`animated-value` is an **imperative animation API for declarative UI renderers**, like React, Preact, and Torus. It allows us to build rich, fully interactive animations with the full benefits of a JavaScript-driven imperative animation system -- custom tweening and physics including spring-based interactive physics, full interruptibility and redirectability, reliable chaining and callbacks, and more -- within the robust declarative UI frameworks we use to build apps today. Read more [on GitHub](https://github.com/thesephist/codeframe).',
//> We use GitHub Pages to host this generated site, which lives under a /animated-value subdirectory
baseURL: '/animated-value',
files: [
'./src/**/*.js',
],
}
|
/**
* @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.dialog.add( 'paste', function( editor ) {
var lang = editor.lang.clipboard;
var isCustomDomain = CKEDITOR.env.isCustomDomain();
function onPasteFrameLoad( win ) {
var doc = new CKEDITOR.dom.document( win.document ),
body = doc.getBody(),
script = doc.getById( 'cke_actscrpt' );
script && script.remove();
body.setAttribute( 'contenteditable', true );
// IE before version 8 will leave cursor blinking inside the document after
// editor blurred unless we clean up the selection. (#4716)
if ( CKEDITOR.env.ie && CKEDITOR.env.version < 8 ) {
doc.getWindow().on( 'blur', function() {
doc.$.selection.empty();
});
}
doc.on( 'keydown', function( e ) {
var domEvent = e.data,
key = domEvent.getKeystroke(),
processed;
switch ( key ) {
case 27:
this.hide();
processed = 1;
break;
case 9:
case CKEDITOR.SHIFT + 9:
this.changeFocus( 1 );
processed = 1;
}
processed && domEvent.preventDefault();
}, this );
editor.fire( 'ariaWidget', new CKEDITOR.dom.element( win.frameElement ) );
// Handle pending focus.
if ( doc.getWindow().getFrame().removeCustomData( 'pendingFocus' ) )
body.focus();
}
// If pasteDialogCommit wasn't canceled by e.g. editor.getClipboardData
// then fire paste event.
// Do not use editor#paste, because it would start from beforePaste event.
editor.on( 'pasteDialogCommit', function( evt ) {
if ( evt.data )
editor.fire( 'paste', { type: 'auto', dataValue: evt.data } );
}, null, null, 1000 );
return {
title: lang.title,
minWidth: CKEDITOR.env.ie && CKEDITOR.env.quirks ? 370 : 350,
minHeight: CKEDITOR.env.quirks ? 250 : 245,
onShow: function() {
// FIREFOX BUG: Force the browser to render the dialog to make the to-be-
// inserted iframe editable. (#3366)
this.parts.dialog.$.offsetHeight;
this.setupContent();
// Set dialog title to the custom value (set e.g. in editor.openDialog callback) and reset this value.
// If custom title not set, use default one.
this.parts.title.setHtml( this.customTitle || lang.title );
this.customTitle = null;
},
onLoad: function() {
if ( ( CKEDITOR.env.ie7Compat || CKEDITOR.env.ie6Compat ) && editor.lang.dir == 'rtl' )
this.parts.contents.setStyle( 'overflow', 'hidden' );
},
onOk: function() {
this.commitContent();
},
contents: [
{
id: 'general',
label: editor.lang.common.generalTab,
elements: [
{
type: 'html',
id: 'securityMsg',
html: '<div style="white-space:normal;width:340px">' + lang.securityMsg + '</div>'
},
{
type: 'html',
id: 'pasteMsg',
html: '<div style="white-space:normal;width:340px">' + lang.pasteMsg + '</div>'
},
{
type: 'html',
id: 'editing_area',
style: 'width:100%;height:100%',
html: '',
focus: function() {
var iframe = this.getInputElement(),
doc = iframe.getFrameDocument(),
body = doc.getBody();
// Frame content may not loaded at the moment.
if ( !body || body.isReadOnly() )
iframe.setCustomData( 'pendingFocus', 1 );
else
body.focus();
},
setup: function() {
var dialog = this.getDialog();
var htmlToLoad = '<html dir="' + editor.config.contentsLangDirection + '"' +
' lang="' + ( editor.config.contentsLanguage || editor.langCode ) + '">' +
'<head><style>body{margin:3px;height:95%}</style></head><body>' +
'<script id="cke_actscrpt" type="text/javascript">' +
'window.parent.CKEDITOR.tools.callFunction(' + CKEDITOR.tools.addFunction( onPasteFrameLoad, dialog ) + ',this);' +
'</script></body>' +
'</html>';
var src =
CKEDITOR.env.air ?
'javascript:void(0)' :
isCustomDomain ?
'javascript:void((function(){' +
'document.open();' +
'document.domain=\'' + document.domain + '\';' +
'document.close();' +
'})())"'
: '';
var iframe = CKEDITOR.dom.element.createFromHtml( '<iframe' +
' class="cke_pasteframe"' +
' frameborder="0" ' +
' allowTransparency="true"' +
' src="' + src + '"' +
' role="region"' +
' aria-label="' + lang.pasteArea + '"' +
' aria-describedby="' + dialog.getContentElement( 'general', 'pasteMsg' ).domId + '"' +
' aria-multiple="true"' +
'></iframe>' );
iframe.on( 'load', function( e ) {
e.removeListener();
var doc = iframe.getFrameDocument();
doc.write( htmlToLoad );
editor.focusManager.add( doc.getBody() );
if ( CKEDITOR.env.air )
onPasteFrameLoad.call( this, doc.getWindow().$ );
}, dialog );
iframe.setCustomData( 'dialog', dialog );
var container = this.getElement();
container.setHtml( '' );
container.append( iframe );
// IE need a redirect on focus to make
// the cursor blinking inside iframe. (#5461)
if ( CKEDITOR.env.ie ) {
var focusGrabber = CKEDITOR.dom.element.createFromHtml( '<span tabindex="-1" style="position:absolute" role="presentation"></span>' );
focusGrabber.on( 'focus', function() {
iframe.$.contentWindow.focus();
});
container.append( focusGrabber );
// Override focus handler on field.
this.focus = function() {
focusGrabber.focus();
this.fire( 'focus' );
};
}
this.getInputElement = function() {
return iframe;
};
// Force container to scale in IE.
if ( CKEDITOR.env.ie ) {
container.setStyle( 'display', 'block' );
container.setStyle( 'height', ( iframe.$.offsetHeight + 2 ) + 'px' );
}
},
commit: function( data ) {
var editor = this.getDialog().getParentEditor(),
body = this.getInputElement().getFrameDocument().getBody(),
bogus = body.getBogus(),
html;
bogus && bogus.remove();
// Saving the contents so changes until paste is complete will not take place (#7500)
html = body.getHtml();
// Opera needs some time to think about what has happened and what it should do now.
setTimeout( function() {
editor.fire( 'pasteDialogCommit', html );
}, 0 );
}
}
]
}
]
};
});
/**
* Internal event to pass paste dialog's data to the listeners.
*
* @private
* @event pasteDialogCommit
* @member CKEDITOR.editor
* @param {CKEDITOR.editor} editor This editor instance.
*/
|
import { get, set, computed, setProperties } from '@ember/object';
import { resolve } from 'rsvp';
import { scheduleOnce } from '@ember/runloop';
import { alias, notEmpty } from '@ember/object/computed';
import { inject as service } from '@ember/service';
import Component from '@ember/component';
import NewOrEdit from 'shared/mixins/new-or-edit';
import C from 'ui/utils/constants';
import Util from 'ui/utils/util';
import { task } from 'ember-concurrency';
import YAML from 'yamljs';
import layout from './template';
import { isEmpty } from '@ember/utils';
import CatalogApp from 'shared/mixins/catalog-app';
import { isNumeric } from 'shared/utils/util';
import convertDotAnswersToYaml from 'shared/utils/convert-yaml';
import ChildHook from 'shared/mixins/child-hook';
export default Component.extend(NewOrEdit, CatalogApp, ChildHook, {
catalog: service(),
intl: service(),
scope: service(),
router: service(),
settings: service(),
globalStore: service(),
layout,
namespaceErrors: null,
allTemplates: null,
templateResource: null,
namespaceResource: null,
versionsArray: null,
versionsLinks: null,
namespaces: null,
actuallySave: true,
showHeader: true,
showPreview: true,
customizeNamespace: false,
decoding: false,
forceUpgrade: false,
istio: false,
titleAdd: 'newCatalog.titleAdd',
titleUpgrade: 'newCatalog.titleUpgrade',
selectVersionAdd: 'newCatalog.selectVersionAdd',
selectVersionUpgrade: 'newCatalog.selectVersionUpgrade',
saveUpgrade: 'newCatalog.saveUpgrade',
saveNew: 'newCatalog.saveNew',
sectionClass: 'box mb-20',
showDefaultVersionOption: false,
classNames: ['launch-catalog'],
catalogApp: null,
srcSet: false,
detailExpanded: false,
previewOpen: false,
previewTab: null,
questionsArray: null,
selectedTemplateUrl: null,
selectedTemplateModel: null,
catalogTemplate: null,
readmeContent: null,
appReadmeContent: null,
pastedAnswers: null,
noAppReadme: null,
selectedFileContetnt: null,
isGKE: alias('scope.currentCluster.isGKE'),
primaryResource: alias('namespaceResource'),
editing: notEmpty('catalogApp.id'),
requiredNamespace: alias('selectedTemplateModel.requiredNamespace'),
init() {
this._super(...arguments);
set(this, 'selectedTemplateModel', null);
scheduleOnce('afterRender', () => {
if ( get(this, 'selectedTemplateUrl') ) {
if (this.catalogTemplate) {
this.initTemplateModel(this.catalogTemplate);
} else {
this.templateChanged();
}
} else {
var def = get(this, 'templateResource.defaultVersion');
var links = get(this, 'versionLinks');
var app = get(this, 'catalogApp');
if (get(app, 'id') && !get(this, 'upgrade')) {
def = get(app, 'externalIdInfo.version');
}
if (links[def]) {
set(this, 'selectedTemplateUrl', links[def]);
} else {
set(this, 'selectedTemplateUrl', null);
}
}
});
},
didRender() {
if (!this.get('srcSet')) {
set(this, 'srcSet', true);
const $icon = this.$('img');
$icon.attr('src', $icon.data('src'));
this.$('img').on('error', () => {
$icon.attr('src', `${ this.get('app.baseAssets') }assets/images/generic-catalog.svg`);
});
}
},
actions: {
toogleDetailedDescriptions() {
set(this, 'detailExpanded', true);
},
toogleNamespace() {
set(this, 'customizeNamespace', true);
},
cancel() {
if ( get(this, 'istio') ) {
const projectId = get(this, 'scope.currentProject.id');
get(this, 'router').transitionTo('authenticated.project.istio.project-istio.rules', projectId);
} else if ( this.cancel ) {
this.cancel();
}
},
togglePreview() {
this.toggleProperty('previewOpen');
},
selectPreviewTab(tab) {
set(this, 'previewTab', tab);
},
},
answersArray: computed('selectedTemplateModel.questions', 'selectedTemplateModel.customAnswers', 'catalogApp.answers', function() {
let model = get(this, 'selectedTemplateModel');
if (get(model, 'questions')) {
const questions = [];
(get(this, 'selectedTemplateModel.questions') || []).forEach((q) => {
questions.push(q);
const subquestions = get(q, 'subquestions');
if ( subquestions ) {
questions.pushObjects(subquestions);
}
});
const customAnswers = get(this, 'selectedTemplateModel.customAnswers') || {};
Object.keys(customAnswers).forEach((key) => {
questions.push({
variable: key,
answer: customAnswers[key],
});
});
return questions;
} else {
return get(this, 'catalogApp.answers');
}
}),
answersString: computed('answersArray.@each.{variable,answer}', function() {
let model = get(this, 'selectedTemplateModel');
if (get(model, 'questions')) {
let neu = {};
(get(this, 'answersArray') || []).forEach((a) => {
neu[a.variable] = isEmpty(a.answer) ? a.default : a.answer;
});
const customAnswers = get(model, 'customAnswers') || {};
Object.keys(customAnswers).forEach((key) => {
neu[key] = customAnswers[key];
});
return YAML.stringify(neu);
} else {
return JSON.stringify(get(this, 'answersArray'));
}
}),
getTemplate: task(function * () {
var url = get(this, 'selectedTemplateUrl');
if ( url === 'default' ) {
let defaultUrl = get(this, 'defaultUrl');
if ( defaultUrl ) {
url = defaultUrl;
} else {
url = null;
}
}
if (url) {
var version = get(this, 'settings.rancherVersion');
if ( version ) {
url = Util.addQueryParam(url, 'rancherVersion', version);
}
var current = get(this, 'catalogApp.answers');
if ( !current ) {
current = {};
set(this, 'catalogApp.answers', current);
}
var selectedTemplateModel = yield get(this, 'catalog').fetchByUrl(url)
.then((response) => {
if (response.questions) {
this.parseQuestionsAndAnswers(response, current);
}
return response;
});
if (selectedTemplateModel && selectedTemplateModel.requiredNamespace) {
set(this, 'primaryResource.name', selectedTemplateModel.requiredNamespace);
}
set(this, 'selectedTemplateModel', selectedTemplateModel);
this.initPreviewTab(selectedTemplateModel);
} else {
setProperties(this, {
selectedTemplateModel: null,
readmeContent: null,
appReadmeContent: null,
noAppReadme: false,
});
}
this.updateReadme();
}),
initTemplateModel(templateModel) {
let currentAnswers = get(this, 'catalogApp.answers') || {};
this.parseQuestionsAndAnswers(templateModel, currentAnswers);
this.initPreviewTab(templateModel);
set(this, 'selectedTemplateModel', templateModel);
this.updateReadme();
},
initPreviewTab(selectedTemplateModel) {
const files = Object.keys(selectedTemplateModel.get('files')) || [];
if ( files.length > 0 ) {
const valuesYaml = files.find((file) => file.endsWith('/values.yaml'));
set(this, 'previewTab', valuesYaml ? valuesYaml : files[0]);
}
},
parseQuestionsAndAnswers(template, currentAnswers) {
const questions = [];
const customAnswers = {};
(template.questions || []).forEach((q) => {
questions.push(q);
const subquestions = get(q, 'subquestions');
if ( subquestions ) {
questions.pushObjects(subquestions);
}
});
questions.forEach((item) => {
// This will be the component that is rendered to edit this answer
item.inputComponent = `schema/input-${ item.type }`;
// Only types marked supported will show the component, Ember will explode if the component doesn't exist
item.supported = C.SUPPORTED_SCHEMA_INPUTS.indexOf(item.type) >= 0;
if (typeof currentAnswers[item.variable] !== 'undefined') {
// If there's an existing value, use it (for upgrade)
item.answer = currentAnswers[item.variable];
} else if (item.type === 'service' || item.type === 'certificate') {
// Loaded async and then the component picks the default
} else if ( item.type === 'boolean' ) {
// Coerce booleans
item.answer = (item.default === 'true' || item.default === true);
} else {
// Everything else
item.answer = item.default || null;
}
});
Object.keys(currentAnswers).forEach((key) => {
const q = questions.findBy('variable', key);
if ( !q ) {
customAnswers[key] = currentAnswers[key];
}
});
template.customAnswers = customAnswers;
},
validate() {
this._super();
const errors = get(this, 'errors') || [];
errors.pushObjects(get(this, 'namespaceErrors') || []);
errors.pushObjects(get(this, 'selectedTemplateModel').validationErrors() || []);
if (errors.length) {
set(this, 'errors', errors.uniq());
return false;
}
return true;
},
doSave() {
const requiredNamespace = get(this, 'requiredNamespace');
if ( requiredNamespace && (get(this, 'namespaces') || []).findBy('id', requiredNamespace) ) {
return resolve(get(this, 'primaryResource'));
}
return this._super(...arguments);
},
willSave() {
set(this, 'errors', null);
var ok = this.validate();
if (!ok) {
// Validation failed
return false;
}
if ( get(this, 'actuallySave') ) {
if (!get(this, 'selectedTemplateModel.valuesYaml') && get(this, 'selectedTemplateModel.questions')) {
set(get(this, 'catalogApp'), 'answers', get(this, 'answers'));
}
return this.applyHooks('_beforeSaveHooks').catch((err) => {
set(this, 'errors', [err.message]);
return false;
});
} else {
// TODO 2.0 this is part of the volumes stuff so we need to investigate if this still works
// let versionId = null;
// if ( get(this, 'selectedTemplateUrl') !== 'default' && get(this, 'selectedTemplateModel') ) {
// versionId = get(this, 'selectedTemplateModel.id');
// }
// if (this.doSave) {
// this.doSave({
// answers: get(this, 'answers'),
// externalId: get(this, 'newExternalId'),
// templateId: get(this, 'templateResource.id'),
// templateVersionId: versionId,
// });
// }
return false;
}
},
didSave(neu) {
let app = get(this, 'catalogApp');
let yaml = get(this, 'selectedTemplateModel.valuesYaml');
if ( !yaml && this.shouldFallBackToYaml() ) {
const questions = get(this, 'selectedTemplateModel.allQuestions') || [];
const input = {};
questions.forEach((q) => {
if ( q.answer !== undefined && q.answer !== null ) {
input[q.variable] = q.answer;
} else if ( q.default !== undefined && q.default !== null ) {
input[q.variable] = q.default;
} else {
input[q.variable] = '';
}
});
yaml = convertDotAnswersToYaml(input);
}
if (get(app, 'id')) {
return app.doAction('upgrade', {
externalId: get(this, 'selectedTemplateModel.externalId'),
answers: yaml ? {} : get(app, 'answers'),
valuesYaml: yaml ? yaml : '',
forceUpgrade: get(this, 'forceUpgrade'),
}).then((resp) => resp)
.catch((err) => err);
} else {
const requiredNamespace = get(this, 'requiredNamespace');
setProperties(app, {
targetNamespace: requiredNamespace ? requiredNamespace : neu.name,
externalId: get(this, 'selectedTemplateModel.externalId'),
projectId: get(neu, 'projectId'),
answers: yaml ? {} : get(app, 'answers'),
valuesYaml: yaml ? yaml : '',
});
return app.save().then(() => get(this, 'primaryResource'));
}
},
doneSaving() {
var projectId = get(this, 'scope.currentProject.id');
if ( get(this, 'istio') ) {
return get(this, 'router').transitionTo('authenticated.project.istio.project-istio.rules', projectId);
} else {
return get(this, 'router').transitionTo('apps-tab.index', projectId);
}
},
shouldFallBackToYaml() {
const questions = get(this, 'selectedTemplateModel.allQuestions') || [];
return !!questions.some((question) => get(question, 'type') === 'password' && !!isNumeric(get(question, 'answer')) && get(question, 'answer') !== '');
},
});
|
var searchData=
[
['_7ereliancehid',['~RelianceHID',['../class_reliance_h_i_d.html#a8e6edf78100a4236222edf98dc4d2ece',1,'RelianceHID']]],
['_7ereliancestatus',['~RelianceStatus',['../struct_reliance_h_i_d_1_1_reliance_status.html#adacd3d3bd5491811a1256bafdc1c5675',1,'RelianceHID::RelianceStatus']]]
];
|
var $M = require("@effectful/debugger"),
$forInIterator = $M.forInIterator,
$iterator = $M.iterator,
$yld = $M.yld,
$iterErr = $M.iterErr,
$iterFin = $M.iterFin,
$iterNext = $M.iterNext,
$x = $M.context,
$ret = $M.ret,
$retG = $M.retG,
$unhandled = $M.unhandled,
$unhandledG = $M.unhandledG,
$raise = $M.raise,
$brk = $M.brk,
$force = $M.force,
$get = $M.get,
$lset = $M.lset,
$mcall = $M.mcall,
$set = $M.set,
$m = $M.module("file.js", null, typeof module === "undefined" ? null : module, null, "$", {
__webpack_require__: typeof __webpack_require__ !== "undefined" && __webpack_require__
}, null),
$s$1 = [{
G: [1, null],
_getRequireWildcardCache: [2, null],
_interopRequireWildcard: [3, null],
c: [4, "4:10-4:11"]
}, null, 0],
$s$2 = [{
nodeInterop: [1, null],
cacheBabelInterop: [2, null],
cacheNodeInterop: [3, null]
}, $s$1, 1],
$s$3 = [{
nodeInterop: [1, null]
}, $s$2, 2],
$s$4 = [{
obj: [1, null],
nodeInterop: [2, null],
cache: [3, null],
newObj: [4, null],
hasPropertyDescriptor: [5, null],
key: [6, null],
desc: [7, null]
}, $s$1, 1],
$s$5 = [{}, $s$4, 2],
$s$6 = [{}, $s$1, 1],
$m$0 = $M.fun("m$0", "file.js", null, null, [], 0, 5, "1:0-7:0", 32, function ($, $l, $p) {
for (;;) switch ($.state = $.goto) {
case 0:
$lset($l, 2, $m$1($));
$lset($l, 3, $m$3($));
$lset($l, 4, $m$4($));
$.goto = 1;
$brk();
$.state = 1;
case 1:
$.goto = 2;
$p = ($x.moduleId = require.resolve("@effectful/es"), $force(require("@effectful/es")));
$.state = 2;
case 2:
$.goto = 3;
$p = ($x.call = $l[3])($p);
$.state = 3;
case 3:
$lset($l, 1, $p);
$.goto = 5;
continue;
case 4:
$.goto = 5;
return $unhandled($.error);
case 5:
return $ret($.result);
default:
throw new Error("Invalid state");
}
}, null, null, 0, [[4, "2:0-2:35", $s$1], [2, null, $s$1], [2, null, $s$1], [0, null, $s$1], [16, "7:0-7:0", $s$1], [16, "7:0-7:0", $s$1]]),
$m$1 = $M.fun("m$1", "_getRequireWildcardCache", null, $m$0, ["nodeInterop"], 0, 4, null, 0, function ($, $l, $p) {
for (;;) switch ($.state = $.goto) {
case 0:
if (typeof WeakMap !== "function") {
$.state = 1;
} else {
$.goto = 2;
continue;
}
case 1:
$.result = null;
$.goto = 7;
continue;
case 2:
$.goto = 3;
$p = new ($x.call = WeakMap)();
$.state = 3;
case 3:
$lset($l, 2, $p);
$.goto = 4;
$p = new ($x.call = WeakMap)();
$.state = 4;
case 4:
$lset($l, 3, $p);
$.goto = 5;
$p = ($x.call = $lset($l[0], 2, $m$2($)))($l[1]);
$.state = 5;
case 5:
$.result = $p;
$.goto = 7;
continue;
case 6:
$.goto = 7;
return $unhandled($.error);
case 7:
return $ret($.result);
default:
throw new Error("Invalid state");
}
}, null, null, 1, [[0, null, $s$2], [0, null, $s$2], [2, null, $s$2], [2, null, $s$2], [2, null, $s$2], [0, null, $s$2], [16, null, $s$2], [16, null, $s$2]]),
$m$2 = $M.fun("m$2", null, null, $m$1, ["nodeInterop"], 0, 2, null, 0, function ($, $l, $p) {
for (;;) switch ($.state = $.goto) {
case 0:
if ($l[1]) {
$.state = 1;
} else {
$.goto = 3;
continue;
}
case 1:
$.result = $l[0][3];
$.state = 2;
case 2:
$.goto = 5;
continue;
case 3:
$.result = $l[0][2];
$.goto = 2;
continue;
case 4:
$.goto = 5;
return $unhandled($.error);
case 5:
return $ret($.result);
default:
throw new Error("Invalid state");
}
}, null, null, 2, [[0, null, $s$3], [0, null, $s$3], [0, null, $s$3], [0, null, $s$3], [16, null, $s$3], [16, null, $s$3]]),
$m$3 = $M.fun("m$3", "_interopRequireWildcard", null, $m$0, ["obj", "nodeInterop"], 1, 12, null, 0, function ($, $l, $p) {
var $1;
for (;;) switch ($.state = $.goto) {
case 0:
$l[9] = !$l[2];
if ($l[9]) {
$.state = 1;
} else {
$.goto = 2;
continue;
}
case 1:
$l[9] = $l[1];
$.state = 2;
case 2:
if ($l[9]) {
$.state = 3;
} else {
$.goto = 5;
continue;
}
case 3:
$.goto = 4;
$p = ($x.call = $get, $l[1].__esModule);
$.state = 4;
case 4:
$l[9] = $p;
$.state = 5;
case 5:
if ($l[9]) {
$.state = 6;
} else {
$.goto = 7;
continue;
}
case 6:
$.result = $l[1];
$.goto = 59;
continue;
case 7:
$1 = $l[1] === null;
if ($1) {
$.state = 8;
} else {
$.goto = 55;
continue;
}
case 8:
if ($1) {
$.state = 9;
} else {
$.goto = 10;
continue;
}
case 9:
$.result = {
default: $l[1]
};
$.goto = 59;
continue;
case 10:
$.goto = 11;
$p = ($x.call = $l[0][2])($l[2]);
$.state = 11;
case 11:
$lset($l, 3, $p);
$l[10] = $l[3];
if ($l[10]) {
$.state = 12;
} else {
$.goto = 14;
continue;
}
case 12:
$.goto = 13;
$p = $mcall("has", $l[3], $l[1]);
$.state = 13;
case 13:
$l[10] = $p;
$.state = 14;
case 14:
if ($l[10]) {
$.state = 15;
} else {
$.goto = 17;
continue;
}
case 15:
$.goto = 16;
$p = $mcall("get", $l[3], $l[1]);
$.state = 16;
case 16:
$.result = $p;
$.goto = 59;
continue;
case 17:
$lset($l, 4, {});
$.goto = 18;
$p = ($x.call = $get, Object.defineProperty);
$.state = 18;
case 18:
$l[11] = $p;
if ($l[11]) {
$.state = 19;
} else {
$.goto = 21;
continue;
}
case 19:
$.goto = 20;
$p = ($x.call = $get, Object.getOwnPropertyDescriptor);
$.state = 20;
case 20:
$l[11] = $p;
$.state = 21;
case 21:
$lset($l, 5, $l[11]);
$.state = 22;
case 22:
$l = $.$ = [$l, void 0, void 0, void 0, void 0];
$.goto = 23;
$p = $forInIterator($l[0][1]);
$.state = 23;
case 23:
$l[1] = $p;
$.state = 24;
case 24:
$x.call = $l[1].next;
$.goto = 25;
$p = $l[1].next();
$.state = 25;
case 25:
if ($p.done) {
$.state = 26;
} else {
$.goto = 27;
continue;
}
case 26:
$l[0][8] = 51;
$.goto = 50;
continue;
case 27:
$lset($l[0], 6, $p.value);
$l[2] = $l[0][6] !== "default";
if ($l[2]) {
$.state = 28;
} else {
$.goto = 32;
continue;
}
case 28:
$.goto = 29;
$p = ($x.call = $get, Object.prototype);
$.state = 29;
case 29:
$.goto = 30;
$p = ($x.call = $get, $p.hasOwnProperty);
$.state = 30;
case 30:
$.goto = 31;
$p = $mcall("call", $p, $l[0][1], $l[0][6]);
$.state = 31;
case 31:
$l[2] = $p;
$.state = 32;
case 32:
if ($l[2]) {
$.state = 33;
} else {
$.goto = 48;
continue;
}
case 33:
if ($l[0][5]) {
$.state = 34;
} else {
$.goto = 47;
continue;
}
case 34:
$.goto = 35;
$p = $mcall("getOwnPropertyDescriptor", Object, $l[0][1], $l[0][6]);
$.state = 35;
case 35:
$l[3] = $p;
$.state = 36;
case 36:
$lset($l[0], 7, $l[3]);
$l[4] = $l[0][7];
if ($l[4]) {
$.state = 37;
} else {
$.goto = 42;
continue;
}
case 37:
$.goto = 38;
$p = ($x.call = $get, $l[0][7].get);
$.state = 38;
case 38:
$l[4] = $p;
if ($l[4]) {
$.state = 39;
} else {
$.goto = 40;
continue;
}
case 39:
$.goto = 42;
continue;
case 40:
$.goto = 41;
$p = ($x.call = $get, $l[0][7].set);
$.state = 41;
case 41:
$l[4] = $p;
$.goto = 39;
continue;
case 42:
if ($l[4]) {
$.state = 43;
} else {
$.goto = 45;
continue;
}
case 43:
$.goto = 44;
$mcall("defineProperty", Object, $l[0][4], $l[0][6], $l[0][7]);
$.state = 44;
case 44:
$.goto = 48;
continue;
case 45:
$.goto = 46;
$p = ($x.call = $get, $l[0][1][$l[0][6]]);
$.state = 46;
case 46:
$.goto = 44;
$set($l[0][4], $l[0][6], $p);
continue;
case 47:
$l[3] = null;
$.goto = 36;
continue;
case 48:
$l = $.$ = [$l[0], $l[1], void 0, void 0, void 0];
$.goto = 24;
continue;
case 49:
return $raise($.error);
case 50:
$l = $.$ = $l[0];
$.goto = $l[8];
continue;
case 51:
$.goto = 52;
$set($l[4], "default", $l[1]);
$.state = 52;
case 52:
if ($l[3]) {
$.state = 53;
} else {
$.goto = 54;
continue;
}
case 53:
$.goto = 54;
$mcall("set", $l[3], $l[1], $l[4]);
$.state = 54;
case 54:
$.result = $l[4];
$.goto = 59;
continue;
case 55:
$1 = typeof $l[1] !== "object";
if ($1) {
$.state = 56;
} else {
$.goto = 57;
continue;
}
case 56:
$1 = typeof $l[1] !== "function";
$.state = 57;
case 57:
$.goto = 8;
continue;
case 58:
$.goto = 59;
return $unhandled($.error);
case 59:
return $ret($.result);
default:
throw new Error("Invalid state");
}
}, function ($, $l) {
switch ($.state) {
case 48:
case 47:
case 46:
case 45:
case 44:
case 43:
case 42:
case 41:
case 40:
case 39:
case 38:
case 37:
case 36:
case 35:
case 34:
case 33:
case 32:
case 31:
case 30:
case 29:
case 28:
case 27:
case 26:
case 25:
case 24:
$.goto = 50;
$l[0][8] = 49;
break;
default:
$.goto = 58;
}
}, function ($, $l) {
switch ($.state) {
case 48:
case 47:
case 46:
case 45:
case 44:
case 43:
case 42:
case 41:
case 40:
case 39:
case 38:
case 37:
case 36:
case 35:
case 34:
case 33:
case 32:
case 31:
case 30:
case 29:
case 28:
case 27:
case 26:
case 25:
case 24:
$l[0][8] = 59;
$.goto = 50;
break;
default:
$.goto = 59;
break;
}
}, 1, [[0, null, $s$4], [0, null, $s$4], [0, null, $s$4], [2, null, $s$4], [0, null, $s$4], [0, null, $s$4], [0, null, $s$4], [0, null, $s$4], [0, null, $s$4], [0, null, $s$4], [2, null, $s$4], [0, null, $s$4], [2, null, $s$4], [0, null, $s$4], [0, null, $s$4], [2, null, $s$4], [0, null, $s$4], [2, null, $s$4], [0, null, $s$4], [2, null, $s$4], [0, null, $s$4], [0, null, $s$4], [2, null, $s$5], [0, null, $s$5], [2, null, $s$5], [0, null, $s$5], [0, null, $s$5], [0, null, $s$5], [2, null, $s$5], [2, null, $s$5], [2, null, $s$5], [0, null, $s$5], [0, null, $s$5], [0, null, $s$5], [2, null, $s$5], [0, null, $s$5], [0, null, $s$5], [2, null, $s$5], [0, null, $s$5], [0, null, $s$5], [2, null, $s$5], [0, null, $s$5], [0, null, $s$5], [2, null, $s$5], [0, null, $s$5], [2, null, $s$5], [2, null, $s$5], [0, null, $s$5], [0, null, $s$5], [0, null, $s$4], [0, null, $s$4], [2, null, $s$4], [0, null, $s$4], [2, null, $s$4], [0, null, $s$4], [0, null, $s$4], [0, null, $s$4], [0, null, $s$4], [16, null, $s$4], [16, null, $s$4]]),
$m$4 = $M.fun("m$4", "c", null, $m$0, [], 0, 5, "4:0-6:1", 2, function ($, $l, $p) {
for (;;) switch ($.state = $.goto) {
case 0:
$.goto = 1;
$brk();
$.state = 1;
case 1:
$.goto = 2;
$p = $iterator(z);
$.state = 2;
case 2:
$l[2] = $p;
$.state = 3;
case 3:
$.goto = 4;
$p = $iterNext($l[2], $l[4]);
$.state = 4;
case 4:
$l[3] = $p;
$.state = 5;
case 5:
if ($l[3].done) {
$.state = 6;
} else {
$.goto = 7;
continue;
}
case 6:
$.goto = 20;
$brk();
continue;
case 7:
$.goto = 8;
return $yld($l[3].value);
case 8:
$l[4] = $p;
$.goto = 3;
continue;
case 9:
if ($l[2].throw) {
$.state = 10;
} else {
$.goto = 12;
continue;
}
case 10:
$.goto = 11;
$p = $iterErr($l[2], $.error);
$.state = 11;
case 11:
$l[3] = $p;
$.goto = 5;
continue;
case 12:
$.error = $M.iterErrUndef();
$l[1] = 19;
$.goto = 14;
continue;
case 13:
return $raise($.error);
case 14:
$.goto = 15;
$p = $iterFin($l[2], $.result);
$.state = 15;
case 15:
if ($p.done) {
$.state = 16;
} else {
$.goto = 17;
continue;
}
case 16:
$.goto = $l[1];
continue;
case 17:
$.goto = 18;
return $yld($p.value);
case 18:
$l[4] = $p;
$.goto = 3;
continue;
case 19:
$.goto = 20;
return $unhandledG($.error);
case 20:
return $retG($.result);
default:
throw new Error("Invalid state");
}
}, function ($, $l) {
switch ($.state) {
case 12:
case 9:
case 4:
case 3:
$.goto = 14;
$l[1] = 13;
break;
case 8:
case 7:
case 5:
$.goto = 9;
break;
default:
$.goto = 19;
}
}, function ($, $l) {
switch ($.state) {
case 12:
case 9:
case 8:
case 7:
case 5:
case 4:
case 3:
$l[1] = 20;
$.goto = 14;
break;
default:
$.goto = 20;
break;
}
}, 1, [[4, "5:2-5:11", $s$6], [2, "5:2-5:10", $s$6], [0, null, $s$6], [2, "5:2-5:10", $s$6], [0, null, $s$6], [0, null, $s$6], [36, "6:1-6:1", $s$6], [2, "5:2-5:10", $s$6], [0, null, $s$6], [0, null, $s$6], [0, null, $s$6], [0, null, $s$6], [0, null, $s$6], [0, null, $s$6], [0, null, $s$6], [0, null, $s$6], [0, null, $s$6], [2, "5:2-5:10", $s$6], [0, null, $s$6], [16, "6:1-6:1", $s$6], [16, "6:1-6:1", $s$6]]);
$M.moduleExports();
|
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("fs"),require("txml")):"function"==typeof define&&define.amd?define(["fs","txml"],t):"object"==typeof exports?exports.GeoRaster=t(require("fs"),require("txml")):e.GeoRaster=t(e.fs,e.txml)}("undefined"!=typeof self?self:this,(function(e,t){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=44)}([function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return i})),r.d(t,"c",(function(){return o})),r.d(t,"d",(function(){return s})),r.d(t,"e",(function(){return a}));const n=Symbol("thread.errors"),i=Symbol("thread.events"),o=Symbol("thread.terminate"),s=Symbol("thread.transferable"),a=Symbol("thread.worker")},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){"use strict";(function(e){
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <http://feross.org>
* @license MIT
*/
var n=r(45),i=r(46),o=r(24);function s(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(e,t){if(s()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null===e&&(e=new u(t)),e.length=t),e}function u(e,t,r){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return f(this,e)}return c(this,e,t,r)}function c(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n);u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=h(e,t);return e}(e,t,r,n):"string"==typeof t?function(e,t,r){"string"==typeof r&&""!==r||(r="utf8");if(!u.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|p(t,r),i=(e=a(e,n)).write(t,r);i!==n&&(e=e.slice(0,i));return e}(e,t,r):function(e,t){if(u.isBuffer(t)){var r=0|d(t.length);return 0===(e=a(e,r)).length||t.copy(e,0,0,r),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?a(e,0):h(e,t);if("Buffer"===t.type&&o(t.data))return h(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function f(e,t){if(l(t),e=a(e,t<0?0:0|d(t)),!u.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function h(e,t){var r=t.length<0?0:0|d(t.length);e=a(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function d(e){if(e>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|e}function p(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return N(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(e).length;default:if(n)return N(e).length;t=(""+t).toLowerCase(),n=!0}}function g(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,r);case"utf8":case"utf-8":return x(this,t,r);case"ascii":return C(this,t,r);case"latin1":case"binary":return A(this,t,r);case"base64":return E(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function m(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function y(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,i);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,n,i){var o,s=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,r/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var l=-1;for(o=r;o<a;o++)if(c(e,o)===c(t,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===u)return l*s}else-1!==l&&(o-=o-l),l=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){for(var f=!0,h=0;h<u;h++)if(c(e,o+h)!==c(t,h)){f=!1;break}if(f)return o}return-1}function w(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(t.substr(2*s,2),16);if(isNaN(a))return s;e[r+s]=a}return s}function v(e,t,r,n){return q(N(t,e.length-r),e,r,n)}function _(e,t,r,n){return q(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function k(e,t,r,n){return _(e,t,r,n)}function S(e,t,r,n){return q(G(t),e,r,n)}function T(e,t,r,n){return q(function(e,t){for(var r,n,i,o=[],s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function E(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function x(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o,s,a,u,c=e[i],l=null,f=c>239?4:c>223?3:c>191?2:1;if(i+f<=r)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=e[i+1],s=e[i+2],128==(192&o)&&128==(192&s)&&(u=(15&c)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),i+=f}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=4096));return r}(n)}t.Buffer=u,t.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},t.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=s(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,r){return c(null,e,t,r)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,r){return function(e,t,r,n){return l(t),t<=0?a(e,t):void 0!==r?"string"==typeof n?a(e,t).fill(r,n):a(e,t).fill(r):a(e,t)}(null,e,t,r)},u.allocUnsafe=function(e){return f(null,e)},u.allocUnsafeSlow=function(e){return f(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!o(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=u.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var s=e[r];if(!u.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,i),i+=s.length}return n},u.byteLength=p,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)m(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?x(this,0,e):g.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,r,n,i){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),a=Math.min(o,s),c=this.slice(n,i),l=e.slice(t,r),f=0;f<a;++f)if(c[f]!==l[f]){o=c[f],s=l[f];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return y(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return y(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return v(this,e,t,r);case"ascii":return _(this,e,t,r);case"latin1":case"binary":return k(this,e,t,r);case"base64":return S(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function C(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function A(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function O(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=B(e[o]);return i}function R(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function I(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function P(e,t,r,n,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function M(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i<o;++i)e[r+i]=(t&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function D(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i<o;++i)e[r+i]=t>>>8*(n?i:3-i)&255}function L(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function U(e,t,r,n,o){return o||L(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function F(e,t,r,n,o){return o||L(e,0,r,8),i.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),u.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=u.prototype;else{var i=t-e;r=new u(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+e]}return r},u.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||I(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},u.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||I(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUInt8=function(e,t){return t||I(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||I(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||I(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||I(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||I(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||I(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||I(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return t||I(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||I(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){t||I(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return t||I(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||I(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||I(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||I(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||I(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||I(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||P(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||P(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):D(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):D(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);P(this,e,t,r,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o<r&&(s*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);P(this,e,t,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):D(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):D(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,r){return U(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return U(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return F(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return F(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i,o=n-r;if(this===e&&r<t&&t<n)for(i=o-1;i>=0;--i)e[i+t]=this[i+r];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+o),t);return o},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{var s=u.isBuffer(e)?e:N(new u(e,n).toString()),a=s.length;for(o=0;o<r-t;++o)this[o+t]=s[o%a]}return this};var j=/[^+\/0-9A-Za-z-_]/g;function B(e){return e<16?"0"+e.toString(16):e.toString(16)}function N(e,t){var r;t=t||1/0;for(var n=e.length,i=null,o=[],s=0;s<n;++s){if((r=e.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function G(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(j,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function q(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}}).call(this,r(1))},function(e,t){var r,n,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(e){if(r===setTimeout)return setTimeout(e,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(e){r=o}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(e){n=s}}();var u,c=[],l=!1,f=-1;function h(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&d())}function d(){if(!l){var e=a(h);l=!0;for(var t=c.length;t;){for(u=c,c=[];++f<t;)u&&u[f].run();f=-1,t=c.length}u=null,l=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function g(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];c.push(new p(e,t)),1!==c.length||l||a(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t,r){(function(n){t.log=function(...e){return"object"==typeof console&&console.log&&console.log(...e)},t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,i=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(n++,"%c"===e&&(i=n))}),t.splice(i,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}!e&&void 0!==n&&"env"in n&&(e=n.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.exports=r(62)(t);const{formatters:i}=e.exports;i.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}).call(this,r(3))},function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return s}));const n={deserialize:e=>Object.assign(Error(e.message),{name:e.name,stack:e.stack}),serialize:e=>({__error_marker:"$$error",message:e.message,name:e.name,stack:e.stack})};let i={deserialize(e){return(t=e)&&"object"==typeof t&&"__error_marker"in t&&"$$error"===t.__error_marker?n.deserialize(e):e;var t},serialize:e=>e instanceof Error?n.serialize(e):e};function o(e){return i.deserialize(e)}function s(e){return i.serialize(e)}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},function(e,t,r){"use strict";var n=r(15),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=f;var o=Object.create(r(10));o.inherits=r(6);var s=r(29),a=r(33);o.inherits(f,s);for(var u=i(a.prototype),c=0;c<u.length;c++){var l=u[c];f.prototype[l]||(f.prototype[l]=a.prototype[l])}function f(e){if(!(this instanceof f))return new f(e);s.call(this,e),a.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",h)}function h(){this.allowHalfOpen||this._writableState.ended||n.nextTick(d,this)}function d(e){e.end()}Object.defineProperty(f.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(f.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),f.prototype._destroy=function(e,t){this.push(null),this.end(),n.nextTick(t,e)}},function(e,t,r){"use strict";let n;function i(){return n||(n=function(){try{throw new Error}catch(e){const t=(""+e.stack).match(/(https?|file|ftp|chrome-extension|moz-extension):\/\/[^)\n]+/g);if(t)return(""+t[0]).replace(/^((?:https?|file|ftp|chrome-extension|moz-extension):\/\/.+)?\/[^/]+(?:\?.*)?$/,"$1")+"/"}return"/"}()),n}r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return c}));const o="undefined"!=typeof navigator&&navigator.hardwareConcurrency?navigator.hardwareConcurrency:4,s=e=>/^(file|https?:)?\/\//i.test(e);function a(e){const t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}let u;function c(){return u||(u=function(){if("undefined"==typeof Worker)return class{constructor(){throw Error("No web worker implementation available. You might have tried to spawn a worker within a worker in a browser that doesn't support workers in workers.")}};class e extends Worker{constructor(e,t){"string"==typeof e&&t&&t._baseURL?e=new URL(e,t._baseURL):"string"==typeof e&&!s(e)&&i().match(/^file:\/\//i)&&(e=new URL(e,i().replace(/\/[^\/]+$/,"/")),e=a(`importScripts(${JSON.stringify(e)});`)),"string"==typeof e&&s(e)&&(e=a(`importScripts(${JSON.stringify(e)});`)),super(e,t)}}class t extends e{constructor(e,t){super(window.URL.createObjectURL(e),t)}static fromText(e,r){const n=new window.Blob([e],{type:"text/javascript"});return new t(n,r)}}return{blob:t,default:e}}()),u}},function(e,t,r){"use strict";var n,i;r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return i})),function(e){e.cancel="cancel",e.run="run"}(n||(n={})),function(e){e.error="error",e.init="init",e.result="result",e.running="running",e.uncaughtError="uncaughtError"}(i||(i={}))},function(e,t,r){(function(e){function r(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===r(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===r(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===r(e)},t.isError=function(e){return"[object Error]"===r(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=e.isBuffer}).call(this,r(2).Buffer)},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0);function i(e){throw Error(e)}const o={errors:e=>e[n.a]||i("Error observable not found. Make sure to pass a thread instance as returned by the spawn() promise."),events:e=>e[n.b]||i("Events observable not found. Make sure to pass a thread instance as returned by the spawn() promise."),terminate:e=>e[n.c]()}},function(e,t,r){"use strict";const n=()=>"function"==typeof Symbol,i=e=>n()&&Boolean(Symbol[e]),o=e=>i(e)?Symbol[e]:"@@"+e;i("asyncIterator")||(Symbol.asyncIterator=Symbol.asyncIterator||Symbol.for("Symbol.asyncIterator"));const s=o("iterator"),a=o("observable"),u=o("species");function c(e,t){const r=e[t];if(null!=r){if("function"!=typeof r)throw new TypeError(r+" is not a function");return r}}function l(e){let t=e.constructor;return void 0!==t&&(t=t[u],null===t&&(t=void 0)),void 0!==t?t:w}function f(e){f.log?f.log(e):setTimeout(()=>{throw e},0)}function h(e){Promise.resolve().then(()=>{try{e()}catch(e){f(e)}})}function d(e){const t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{const e=c(t,"unsubscribe");e&&e.call(t)}}catch(e){f(e)}}function p(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function g(e,t,r){e._state="running";const n=e._observer;try{const i=n?c(n,t):void 0;switch(t){case"next":i&&i.call(n,r);break;case"error":if(p(e),!i)throw r;i.call(n,r);break;case"complete":p(e),i&&i.call(n)}}catch(e){f(e)}"closed"===e._state?d(e):"running"===e._state&&(e._state="ready")}function m(e,t,r){if("closed"!==e._state)return"buffering"===e._state?(e._queue=e._queue||[],void e._queue.push({type:t,value:r})):"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:r}],void h(()=>function(e){const t=e._queue;if(t){e._queue=void 0,e._state="ready";for(const r of t)if(g(e,r.type,r.value),"closed"===e._state)break}}(e))):void g(e,t,r)}class y{constructor(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";const r=new b(this);try{this._cleanup=t.call(void 0,r)}catch(e){r.error(e)}"initializing"===this._state&&(this._state="ready")}get closed(){return"closed"===this._state}unsubscribe(){"closed"!==this._state&&(p(this),d(this))}}class b{constructor(e){this._subscription=e}get closed(){return"closed"===this._subscription._state}next(e){m(this._subscription,"next",e)}error(e){m(this._subscription,"error",e)}complete(){m(this._subscription,"complete")}}class w{constructor(e){if(!(this instanceof w))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof e)throw new TypeError("Observable initializer must be a function");this._subscriber=e}subscribe(e,t,r){return"object"==typeof e&&null!==e||(e={next:e,error:t,complete:r}),new y(e,this._subscriber)}pipe(e,...t){let r=this;for(const n of[e,...t])r=n(r);return r}tap(e,t,r){const n="object"!=typeof e||null===e?{next:e,error:t,complete:r}:e;return new w(e=>this.subscribe({next(t){n.next&&n.next(t),e.next(t)},error(t){n.error&&n.error(t),e.error(t)},complete(){n.complete&&n.complete(),e.complete()},start(e){n.start&&n.start(e)}}))}forEach(e){return new Promise((t,r)=>{if("function"!=typeof e)return void r(new TypeError(e+" is not a function"));function n(){i.unsubscribe(),t()}const i=this.subscribe({next(t){try{e(t,n)}catch(e){r(e),i.unsubscribe()}},error:r,complete:t})})}map(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(l(this))(t=>this.subscribe({next(r){let n=r;try{n=e(r)}catch(e){return t.error(e)}t.next(n)},error(e){t.error(e)},complete(){t.complete()}}))}filter(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(l(this))(t=>this.subscribe({next(r){try{if(!e(r))return}catch(e){return t.error(e)}t.next(r)},error(e){t.error(e)},complete(){t.complete()}}))}reduce(e,t){if("function"!=typeof e)throw new TypeError(e+" is not a function");const r=l(this),n=arguments.length>1;let i=!1,o=t;return new r(t=>this.subscribe({next(r){const s=!i;if(i=!0,!s||n)try{o=e(o,r)}catch(e){return t.error(e)}else o=r},error(e){t.error(e)},complete(){if(!i&&!n)return t.error(new TypeError("Cannot reduce an empty sequence"));t.next(o),t.complete()}}))}concat(...e){const t=l(this);return new t(r=>{let n,i=0;return function o(s){n=s.subscribe({next(e){r.next(e)},error(e){r.error(e)},complete(){i===e.length?(n=void 0,r.complete()):o(t.from(e[i++]))}})}(this),()=>{n&&(n.unsubscribe(),n=void 0)}})}flatMap(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");const t=l(this);return new t(r=>{const n=[],i=this.subscribe({next(i){let s;if(e)try{s=e(i)}catch(e){return r.error(e)}else s=i;const a=t.from(s).subscribe({next(e){r.next(e)},error(e){r.error(e)},complete(){const e=n.indexOf(a);e>=0&&n.splice(e,1),o()}});n.push(a)},error(e){r.error(e)},complete(){o()}});function o(){i.closed&&0===n.length&&r.complete()}return()=>{n.forEach(e=>e.unsubscribe()),i.unsubscribe()}})}[a](){return this}static from(e){const t="function"==typeof this?this:w;if(null==e)throw new TypeError(e+" is not an object");const r=c(e,a);if(r){const n=r.call(e);if(Object(n)!==n)throw new TypeError(n+" is not an object");return function(e){return e instanceof w}(n)&&n.constructor===t?n:new t(e=>n.subscribe(e))}if(i("iterator")){const r=c(e,s);if(r)return new t(t=>{h(()=>{if(!t.closed){for(const n of r.call(e))if(t.next(n),t.closed)return;t.complete()}})})}if(Array.isArray(e))return new t(t=>{h(()=>{if(!t.closed){for(const r of e)if(t.next(r),t.closed)return;t.complete()}})});throw new TypeError(e+" is not observable")}static of(...e){return new("function"==typeof this?this:w)(t=>{h(()=>{if(!t.closed){for(const r of e)if(t.next(r),t.closed)return;t.complete()}})})}static get[u](){return this}}n()&&Object.defineProperty(w,Symbol("extensions"),{value:{symbol:a,hostReportError:f},configurable:!0});t.a=w},function(e,t,r){"use strict";var n;r.d(t,"a",(function(){return n})),function(e){e.internalError="internalError",e.message="message",e.termination="termination"}(n||(n={}))},function(e,t,r){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function i(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var n in r)i(r,n)&&(e[n]=r[n])}}return e},t.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var o={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),i);else for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){var t,r,n,i,o,s;for(n=0,t=0,r=e.length;t<r;t++)n+=e[t].length;for(s=new Uint8Array(n),i=0,t=0,r=e.length;t<r;t++)o=e[t],s.set(o,i),i+=o.length;return s}},s={arraySet:function(e,t,r,n,i){for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){return[].concat.apply([],e)}};t.setTyped=function(e){e?(t.Buf8=Uint8Array,t.Buf16=Uint16Array,t.Buf32=Int32Array,t.assign(t,o)):(t.Buf8=Array,t.Buf16=Array,t.Buf32=Array,t.assign(t,s))},t.setTyped(n)},function(e,t,r){"use strict";(function(t){void 0===t||!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,r,n,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var o,s,a=arguments.length;switch(a){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick((function(){e.call(null,r)}));case 3:return t.nextTick((function(){e.call(null,r,n)}));case 4:return t.nextTick((function(){e.call(null,r,n,i)}));default:for(o=new Array(a-1),s=0;s<o.length;)o[s++]=arguments[s];return t.nextTick((function(){e.apply(null,o)}))}}}:e.exports=t}).call(this,r(3))},function(e,t,r){"use strict";var n=r(76),i=r(78);function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.parse=w,t.resolve=function(e,t){return w(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?w(e,!1,!0).resolveObject(t):t},t.format=function(e){i.isString(e)&&(e=w(e));return e instanceof o?e.format():o.prototype.format.call(e)},t.Url=o;var s=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,u=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,c=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(c),f=["%","/","?",";","#"].concat(l),h=["/","?","#"],d=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},b=r(79);function w(e,t,r){if(e&&i.isObject(e)&&e instanceof o)return e;var n=new o;return n.parse(e,t,r),n}o.prototype.parse=function(e,t,r){if(!i.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var o=e.indexOf("?"),a=-1!==o&&o<e.indexOf("#")?"?":"#",c=e.split(a);c[0]=c[0].replace(/\\/g,"/");var w=e=c.join(a);if(w=w.trim(),!r&&1===e.split("#").length){var v=u.exec(w);if(v)return this.path=w,this.href=w,this.pathname=v[1],v[2]?(this.search=v[2],this.query=t?b.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var _=s.exec(w);if(_){var k=(_=_[0]).toLowerCase();this.protocol=k,w=w.substr(_.length)}if(r||_||w.match(/^\/\/[^@\/]+@[^@\/]+/)){var S="//"===w.substr(0,2);!S||_&&m[_]||(w=w.substr(2),this.slashes=!0)}if(!m[_]&&(S||_&&!y[_])){for(var T,E,x=-1,C=0;C<h.length;C++){-1!==(A=w.indexOf(h[C]))&&(-1===x||A<x)&&(x=A)}-1!==(E=-1===x?w.lastIndexOf("@"):w.lastIndexOf("@",x))&&(T=w.slice(0,E),w=w.slice(E+1),this.auth=decodeURIComponent(T)),x=-1;for(C=0;C<f.length;C++){var A;-1!==(A=w.indexOf(f[C]))&&(-1===x||A<x)&&(x=A)}-1===x&&(x=w.length),this.host=w.slice(0,x),w=w.slice(x),this.parseHost(),this.hostname=this.hostname||"";var O="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!O)for(var R=this.hostname.split(/\./),I=(C=0,R.length);C<I;C++){var P=R[C];if(P&&!P.match(d)){for(var M="",D=0,L=P.length;D<L;D++)P.charCodeAt(D)>127?M+="x":M+=P[D];if(!M.match(d)){var U=R.slice(0,C),F=R.slice(C+1),j=P.match(p);j&&(U.push(j[1]),F.unshift(j[2])),F.length&&(w="/"+F.join(".")+w),this.hostname=U.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),O||(this.hostname=n.toASCII(this.hostname));var B=this.port?":"+this.port:"",N=this.hostname||"";this.host=N+B,this.href+=this.host,O&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==w[0]&&(w="/"+w))}if(!g[k])for(C=0,I=l.length;C<I;C++){var G=l[C];if(-1!==w.indexOf(G)){var q=encodeURIComponent(G);q===G&&(q=escape(G)),w=w.split(G).join(q)}}var H=w.indexOf("#");-1!==H&&(this.hash=w.substr(H),w=w.slice(0,H));var z=w.indexOf("?");if(-1!==z?(this.search=w.substr(z),this.query=w.substr(z+1),t&&(this.query=b.parse(this.query)),w=w.slice(0,z)):t&&(this.search="",this.query={}),w&&(this.pathname=w),y[k]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){B=this.pathname||"";var K=this.search||"";this.path=B+K}return this.href=this.format(),this},o.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",n=this.hash||"",o=!1,s="";this.host?o=e+this.host:this.hostname&&(o=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&i.isObject(this.query)&&Object.keys(this.query).length&&(s=b.stringify(this.query));var a=this.search||s&&"?"+s||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||y[t])&&!1!==o?(o="//"+(o||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):o||(o=""),n&&"#"!==n.charAt(0)&&(n="#"+n),a&&"?"!==a.charAt(0)&&(a="?"+a),t+o+(r=r.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(a=a.replace("#","%23"))+n},o.prototype.resolve=function(e){return this.resolveObject(w(e,!1,!0)).format()},o.prototype.resolveObject=function(e){if(i.isString(e)){var t=new o;t.parse(e,!1,!0),e=t}for(var r=new o,n=Object.keys(this),s=0;s<n.length;s++){var a=n[s];r[a]=this[a]}if(r.hash=e.hash,""===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var u=Object.keys(e),c=0;c<u.length;c++){var l=u[c];"protocol"!==l&&(r[l]=e[l])}return y[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!y[e.protocol]){for(var f=Object.keys(e),h=0;h<f.length;h++){var d=f[h];r[d]=e[d]}return r.href=r.format(),r}if(r.protocol=e.protocol,e.host||m[e.protocol])r.pathname=e.pathname;else{for(var p=(e.pathname||"").split("/");p.length&&!(e.host=p.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==p[0]&&p.unshift(""),p.length<2&&p.unshift(""),r.pathname=p.join("/")}if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var g=r.pathname||"",b=r.search||"";r.path=g+b}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var w=r.pathname&&"/"===r.pathname.charAt(0),v=e.host||e.pathname&&"/"===e.pathname.charAt(0),_=v||w||r.host&&e.pathname,k=_,S=r.pathname&&r.pathname.split("/")||[],T=(p=e.pathname&&e.pathname.split("/")||[],r.protocol&&!y[r.protocol]);if(T&&(r.hostname="",r.port=null,r.host&&(""===S[0]?S[0]=r.host:S.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===p[0]?p[0]=e.host:p.unshift(e.host)),e.host=null),_=_&&(""===p[0]||""===S[0])),v)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,S=p;else if(p.length)S||(S=[]),S.pop(),S=S.concat(p),r.search=e.search,r.query=e.query;else if(!i.isNullOrUndefined(e.search)){if(T)r.hostname=r.host=S.shift(),(O=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=O.shift(),r.host=r.hostname=O.shift());return r.search=e.search,r.query=e.query,i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!S.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var E=S.slice(-1)[0],x=(r.host||e.host||S.length>1)&&("."===E||".."===E)||""===E,C=0,A=S.length;A>=0;A--)"."===(E=S[A])?S.splice(A,1):".."===E?(S.splice(A,1),C++):C&&(S.splice(A,1),C--);if(!_&&!k)for(;C--;C)S.unshift("..");!_||""===S[0]||S[0]&&"/"===S[0].charAt(0)||S.unshift(""),x&&"/"!==S.join("/").substr(-1)&&S.push("");var O,R=""===S[0]||S[0]&&"/"===S[0].charAt(0);T&&(r.hostname=r.host=R?"":S.length?S.shift():"",(O=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=O.shift(),r.host=r.hostname=O.shift()));return(_=_||r.host&&S.length)&&!R&&S.unshift(""),S.length?r.pathname=S.join("/"):(r.pathname=null,r.path=null),i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var e=this.host,t=a.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,r){(function(e){var n=r(64),i=r(27),o=r(74),s=r(75),a=r(16),u=t;u.request=function(t,r){t="string"==typeof t?a.parse(t):o(t);var i=-1===e.location.protocol.search(/^https?:$/)?"http:":"",s=t.protocol||i,u=t.hostname||t.host,c=t.port,l=t.path||"/";u&&-1!==u.indexOf(":")&&(u="["+u+"]"),t.url=(u?s+"//"+u:"")+(c?":"+c:"")+l,t.method=(t.method||"GET").toUpperCase(),t.headers=t.headers||{};var f=new n(t);return r&&f.on("response",r),f},u.get=function(e,t){var r=u.request(e,t);return r.end(),r},u.ClientRequest=n,u.IncomingMessage=i.IncomingMessage,u.Agent=function(){},u.Agent.defaultMaxSockets=4,u.globalAgent=new u.Agent,u.STATUS_CODES=s,u.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this,r(1))},function(t,r){t.exports=e},,function(e,t,r){var n=r(2),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=s),o(i,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return y}));var n=r(4),i=r.n(n),o=r(12),s=r(5),a=r(41),u=r(0),c=r(13),l=r(23),f=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};const h=i()("threads:master:messages"),d=i()("threads:master:spawn"),p=i()("threads:master:thread-utils"),g=void 0!==e&&e.env.THREADS_WORKER_INIT_TIMEOUT?Number.parseInt(e.env.THREADS_WORKER_INIT_TIMEOUT,10):1e4;function m(e,t,r,n){const i=r.filter(e=>e.type===c.a.internalError).map(e=>e.error);return Object.assign(e,{[u.a]:i,[u.b]:r,[u.c]:n,[u.e]:t})}function y(e,t){return f(this,void 0,void 0,(function*(){d("Initializing new thread");const r=(yield function(e,t,r){return f(this,void 0,void 0,(function*(){let n;const i=new Promise((e,i)=>{n=setTimeout(()=>i(Error(r)),t)}),o=yield Promise.race([e,i]);return clearTimeout(n),o}))}(function(e){return new Promise((t,r)=>{const n=i=>{var o;h("Message from worker before finishing initialization:",i.data),(o=i.data)&&"init"===o.type?(e.removeEventListener("message",n),t(i.data)):(e=>e&&"uncaughtError"===e.type)(i.data)&&(e.removeEventListener("message",n),r(Object(s.a)(i.data.error)))};e.addEventListener("message",n)})}(e),t&&t.timeout?t.timeout:g,`Timeout: Did not receive an init message from worker after ${g}ms. Make sure the worker calls expose().`)).exposed,{termination:n,terminate:i}=function(e){const[t,r]=Object(a.a)();return{terminate:()=>f(this,void 0,void 0,(function*(){p("Terminating worker"),yield e.terminate(),r()})),termination:t}}(e),u=function(e,t){return new o.a(r=>{const n=e=>{const t={type:c.a.message,data:e.data};r.next(t)},i=e=>{p("Unhandled promise rejection event in thread:",e);const t={type:c.a.internalError,error:Error(e.reason)};r.next(t)};e.addEventListener("message",n),e.addEventListener("unhandledrejection",i),t.then(()=>{const t={type:c.a.termination};e.removeEventListener("message",n),e.removeEventListener("unhandledrejection",i),r.next(t),r.complete()})})}(e,n);if("function"===r.type){return m(Object(l.a)(e),e,u,i)}if("module"===r.type){return m(Object(l.b)(e,r.methods),e,u,i)}{const e=r.type;throw Error("Worker init message states unexpected type of expose(): "+e)}}))}}).call(this,r(3))},function(e,t,r){"use strict";r.d(t,"a",(function(){return m}));var n=r(4),i=r.n(n),o=r(40),s=r(86),a=r(12);function u(e){return Promise.all(e.map(e=>{const t=e=>({status:"fulfilled",value:e}),r=e=>({status:"rejected",reason:e}),n=Promise.resolve(e);try{return n.then(t,r)}catch(e){return Promise.reject(e)}}))}var c,l=r(8);!function(e){e.initialized="initialized",e.taskCanceled="taskCanceled",e.taskCompleted="taskCompleted",e.taskFailed="taskFailed",e.taskQueued="taskQueued",e.taskQueueDrained="taskQueueDrained",e.taskStart="taskStart",e.terminated="terminated"}(c||(c={}));var f=r(11),h=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};let d=1;class p{constructor(e,t){this.eventSubject=new o.a,this.initErrors=[],this.isClosing=!1,this.nextTaskID=1,this.taskQueue=[];const r="number"==typeof t?{size:t}:t||{},{size:n=l.a}=r;this.debug=i()("threads:pool:"+(r.name||String(d++)).replace(/\W/g," ").trim().replace(/\s+/g,"-")),this.options=r,this.workers=function(e,t){return function(e){const t=[];for(let r=0;r<e;r++)t.push(r);return t}(t).map(()=>({init:e(),runningTasks:[]}))}(e,n),this.eventObservable=Object(s.a)(a.a.from(this.eventSubject)),Promise.all(this.workers.map(e=>e.init)).then(()=>this.eventSubject.next({type:c.initialized,size:this.workers.length}),e=>{this.debug("Error while initializing pool worker:",e),this.eventSubject.error(e),this.initErrors.push(e)})}findIdlingWorker(){const{concurrency:e=1}=this.options;return this.workers.find(t=>t.runningTasks.length<e)}runPoolTask(e,t){return h(this,void 0,void 0,(function*(){const r=this.workers.indexOf(e)+1;this.debug(`Running task #${t.id} on worker #${r}...`),this.eventSubject.next({type:c.taskStart,taskID:t.id,workerID:r});try{const n=yield t.run(yield e.init);this.debug(`Task #${t.id} completed successfully`),this.eventSubject.next({type:c.taskCompleted,returnValue:n,taskID:t.id,workerID:r})}catch(e){this.debug(`Task #${t.id} failed`),this.eventSubject.next({type:c.taskFailed,taskID:t.id,error:e,workerID:r})}}))}run(e,t){return h(this,void 0,void 0,(function*(){const r=(()=>h(this,void 0,void 0,(function*(){var n;yield(n=0,new Promise(e=>setTimeout(e,n)));try{yield this.runPoolTask(e,t)}finally{e.runningTasks=e.runningTasks.filter(e=>e!==r),this.isClosing||this.scheduleWork()}})))();e.runningTasks.push(r)}))}scheduleWork(){this.debug("Attempt de-queueing a task in order to run it...");const e=this.findIdlingWorker();if(!e)return;const t=this.taskQueue.shift();if(!t)return this.debug("Task queue is empty"),void this.eventSubject.next({type:c.taskQueueDrained});this.run(e,t)}taskCompletion(e){return new Promise((t,r)=>{const n=this.events().subscribe(i=>{i.type===c.taskCompleted&&i.taskID===e?(n.unsubscribe(),t(i.returnValue)):i.type===c.taskFailed&&i.taskID===e?(n.unsubscribe(),r(i.error)):i.type===c.terminated&&(n.unsubscribe(),r(Error("Pool has been terminated before task was run.")))})})}settled(e=!1){return h(this,void 0,void 0,(function*(){const t=()=>{return e=this.workers,t=e=>e.runningTasks,e.reduce((e,r)=>[...e,...t(r)],[]);var e,t},r=[],n=this.eventObservable.subscribe(e=>{e.type===c.taskFailed&&r.push(e.error)});return this.initErrors.length>0?Promise.reject(this.initErrors[0]):e&&0===this.taskQueue.length?(yield u(t()),r):(yield new Promise((e,t)=>{const r=this.eventObservable.subscribe({next(t){t.type===c.taskQueueDrained&&(r.unsubscribe(),e())},error:t})}),yield u(t()),n.unsubscribe(),r)}))}completed(e=!1){return h(this,void 0,void 0,(function*(){const t=this.settled(e),r=new Promise((e,r)=>{const n=this.eventObservable.subscribe({next(i){i.type===c.taskQueueDrained?(n.unsubscribe(),e(t)):i.type===c.taskFailed&&(n.unsubscribe(),r(i.error))},error:r})}),n=yield Promise.race([t,r]);if(n.length>0)throw n[0]}))}events(){return this.eventObservable}queue(e){const{maxQueuedJobs:t=1/0}=this.options;if(this.isClosing)throw Error("Cannot schedule pool tasks after terminate() has been called.");if(this.initErrors.length>0)throw this.initErrors[0];const r=this.nextTaskID++,n=this.taskCompletion(r);n.catch(e=>{this.debug(`Task #${r} errored:`,e)});const i={id:r,run:e,cancel:()=>{-1!==this.taskQueue.indexOf(i)&&(this.taskQueue=this.taskQueue.filter(e=>e!==i),this.eventSubject.next({type:c.taskCanceled,taskID:i.id}))},then:n.then.bind(n)};if(this.taskQueue.length>=t)throw Error("Maximum number of pool tasks queued. Refusing to queue another one.\nThis usually happens for one of two reasons: We are either at peak workload right now or some tasks just won't finish, thus blocking the pool.");return this.debug(`Queueing task #${i.id}...`),this.taskQueue.push(i),this.eventSubject.next({type:c.taskQueued,taskID:i.id}),this.scheduleWork(),i}terminate(e){return h(this,void 0,void 0,(function*(){this.isClosing=!0,e||(yield this.completed(!0)),this.eventSubject.next({type:c.terminated,remainingQueue:[...this.taskQueue]}),this.eventSubject.complete(),yield Promise.all(this.workers.map(e=>h(this,void 0,void 0,(function*(){return f.a.terminate(yield e.init)}))))}))}}function g(e,t){return new p(e,t)}p.EventType=c,g.EventType=c;const m=g},function(e,t,r){"use strict";r.d(t,"a",(function(){return b})),r.d(t,"b",(function(){return w}));var n=r(4),i=r.n(n),o=r(12),s=r(86),a=r(5);const u=()=>{},c=e=>e,l=e=>Promise.resolve().then(e);function f(e){throw e}class h extends o.a{constructor(e){super(t=>{const r=this,n=Object.assign(Object.assign({},t),{complete(){t.complete(),r.onCompletion()},error(e){t.error(e),r.onError(e)},next(e){t.next(e),r.onNext(e)}});try{return this.initHasRun=!0,e(n)}catch(e){n.error(e)}}),this.initHasRun=!1,this.fulfillmentCallbacks=[],this.rejectionCallbacks=[],this.firstValueSet=!1,this.state="pending"}onNext(e){this.firstValueSet||(this.firstValue=e,this.firstValueSet=!0)}onError(e){this.state="rejected",this.rejection=e;for(const t of this.rejectionCallbacks)l(()=>t(e))}onCompletion(){this.state="fulfilled";for(const e of this.fulfillmentCallbacks)l(()=>e(this.firstValue))}then(e,t){const r=e||c,n=t||f;let i=!1;return new Promise((e,t)=>{const o=r=>{if(!i){i=!0;try{e(n(r))}catch(e){t(e)}}};return this.initHasRun||this.subscribe({error:o}),"fulfilled"===this.state?e(r(this.firstValue)):"rejected"===this.state?(i=!0,e(n(this.rejection))):(this.fulfillmentCallbacks.push(t=>{try{e(r(t))}catch(e){o(e)}}),void this.rejectionCallbacks.push(o))})}catch(e){return this.then(void 0,e)}finally(e){const t=e||u;return this.then(e=>(t(),e),()=>t())}static from(e){return function(e){return e&&"function"==typeof e.then}(e)?new h(t=>{e.then(e=>{t.next(e),t.complete()},e=>{t.error(e)})}):super.from(e)}}var d=r(42),p=r(9);const g=i()("threads:master:messages");let m=1;function y(e,t){return new o.a(r=>{let n;const i=o=>{var s;if(g("Message from worker:",o.data),o.data&&o.data.uid===t)if((s=o.data)&&s.type===p.b.running)n=o.data.resultType;else if((e=>e&&e.type===p.b.result)(o.data))"promise"===n?(void 0!==o.data.payload&&r.next(Object(a.a)(o.data.payload)),r.complete(),e.removeEventListener("message",i)):(o.data.payload&&r.next(Object(a.a)(o.data.payload)),o.data.complete&&(r.complete(),e.removeEventListener("message",i)));else if((e=>e&&e.type===p.b.error)(o.data)){const t=Object(a.a)(o.data.error);r.error(t),e.removeEventListener("message",i)}};return e.addEventListener("message",i),()=>{if("observable"===n||!n){const r={type:p.a.cancel,uid:t};e.postMessage(r)}e.removeEventListener("message",i)}})}function b(e,t){return(...r)=>{const n=m++,{args:i,transferables:o}=function(e){if(0===e.length)return{args:[],transferables:[]};const t=[],r=[];for(const n of e)Object(d.a)(n)?(t.push(Object(a.b)(n.send)),r.push(...n.transferables)):t.push(Object(a.b)(n));return{args:t,transferables:0===r.length?r:(n=r,Array.from(new Set(n)))};var n}(r),u={type:p.a.run,uid:n,method:t,args:i};g("Sending command to run function to worker:",u);try{e.postMessage(u,o)}catch(e){return h.from(Promise.reject(e))}return h.from(Object(s.a)(y(e,n)))}}function w(e,t){const r={};for(const n of t)r[n]=b(e,n);return r}},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t,r){"use strict";(function(e){var n=r(84),i=r(22),o=r(21);const s="undefined"!=typeof navigator?navigator.hardwareConcurrency:null;t.a=class{constructor(t=s){const r=new n.a(e);this.pool=Object(i.a)(()=>Object(o.a)(r),t)}async decode(e,t){return new Promise((r,n)=>{this.pool.queue(async i=>{try{const n=await i(e,t);r(n)}catch(e){n(e)}})})}destroy(){this.pool.terminate(!0)}}}).call(this,r(61))},function(e,t,r){(function(e){t.fetch=a(e.fetch)&&a(e.ReadableStream),t.writableStream=a(e.WritableStream),t.abortController=a(e.AbortController),t.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),t.blobConstructor=!0}catch(e){}var r;function n(){if(void 0!==r)return r;if(e.XMLHttpRequest){r=new e.XMLHttpRequest;try{r.open("GET",e.XDomainRequest?"/":"https://example.com")}catch(e){r=null}}else r=null;return r}function i(e){var t=n();if(!t)return!1;try{return t.responseType=e,t.responseType===e}catch(e){}return!1}var o=void 0!==e.ArrayBuffer,s=o&&a(e.ArrayBuffer.prototype.slice);function a(e){return"function"==typeof e}t.arraybuffer=t.fetch||o&&i("arraybuffer"),t.msstream=!t.fetch&&s&&i("ms-stream"),t.mozchunkedarraybuffer=!t.fetch&&o&&i("moz-chunked-arraybuffer"),t.overrideMimeType=t.fetch||!!n()&&a(n().overrideMimeType),t.vbArray=a(e.VBArray),r=null}).call(this,r(1))},function(e,t,r){(function(e,n,i){var o=r(26),s=r(6),a=r(28),u=t.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},c=t.IncomingMessage=function(t,r,s,u){var c=this;if(a.Readable.call(c),c._mode=s,c.headers={},c.rawHeaders=[],c.trailers={},c.rawTrailers=[],c.on("end",(function(){e.nextTick((function(){c.emit("close")}))})),"fetch"===s){if(c._fetchResponse=r,c.url=r.url,c.statusCode=r.status,c.statusMessage=r.statusText,r.headers.forEach((function(e,t){c.headers[t.toLowerCase()]=e,c.rawHeaders.push(t,e)})),o.writableStream){var l=new WritableStream({write:function(e){return new Promise((function(t,r){c._destroyed?r():c.push(new n(e))?t():c._resumeFetch=t}))},close:function(){i.clearTimeout(u),c._destroyed||c.push(null)},abort:function(e){c._destroyed||c.emit("error",e)}});try{return void r.body.pipeTo(l).catch((function(e){i.clearTimeout(u),c._destroyed||c.emit("error",e)}))}catch(e){}}var f=r.body.getReader();!function e(){f.read().then((function(t){if(!c._destroyed){if(t.done)return i.clearTimeout(u),void c.push(null);c.push(new n(t.value)),e()}})).catch((function(e){i.clearTimeout(u),c._destroyed||c.emit("error",e)}))}()}else{if(c._xhr=t,c._pos=0,c.url=t.responseURL,c.statusCode=t.status,c.statusMessage=t.statusText,t.getAllResponseHeaders().split(/\r?\n/).forEach((function(e){var t=e.match(/^([^:]+):\s*(.*)/);if(t){var r=t[1].toLowerCase();"set-cookie"===r?(void 0===c.headers[r]&&(c.headers[r]=[]),c.headers[r].push(t[2])):void 0!==c.headers[r]?c.headers[r]+=", "+t[2]:c.headers[r]=t[2],c.rawHeaders.push(t[1],t[2])}})),c._charset="x-user-defined",!o.overrideMimeType){var h=c.rawHeaders["mime-type"];if(h){var d=h.match(/;\s*charset=([^;])(;|$)/);d&&(c._charset=d[1].toLowerCase())}c._charset||(c._charset="utf-8")}}};s(c,a.Readable),c.prototype._read=function(){var e=this._resumeFetch;e&&(this._resumeFetch=null,e())},c.prototype._onXHRProgress=function(){var e=this,t=e._xhr,r=null;switch(e._mode){case"text:vbarray":if(t.readyState!==u.DONE)break;try{r=new i.VBArray(t.responseBody).toArray()}catch(e){}if(null!==r){e.push(new n(r));break}case"text":try{r=t.responseText}catch(t){e._mode="text:vbarray";break}if(r.length>e._pos){var o=r.substr(e._pos);if("x-user-defined"===e._charset){for(var s=new n(o.length),a=0;a<o.length;a++)s[a]=255&o.charCodeAt(a);e.push(s)}else e.push(o,e._charset);e._pos=r.length}break;case"arraybuffer":if(t.readyState!==u.DONE||!t.response)break;r=t.response,e.push(new n(new Uint8Array(r)));break;case"moz-chunked-arraybuffer":if(r=t.response,t.readyState!==u.LOADING||!r)break;e.push(new n(new Uint8Array(r)));break;case"ms-stream":if(r=t.response,t.readyState!==u.LOADING)break;var c=new i.MSStreamReader;c.onprogress=function(){c.result.byteLength>e._pos&&(e.push(new n(new Uint8Array(c.result.slice(e._pos)))),e._pos=c.result.byteLength)},c.onload=function(){e.push(null)},c.readAsArrayBuffer(r)}e._xhr.readyState===u.DONE&&"ms-stream"!==e._mode&&e.push(null)}}).call(this,r(3),r(2).Buffer,r(1))},function(e,t,r){(t=e.exports=r(29)).Stream=t,t.Readable=t,t.Writable=r(33),t.Duplex=r(7),t.Transform=r(35),t.PassThrough=r(72)},function(e,t,r){"use strict";(function(t,n){var i=r(15);e.exports=w;var o,s=r(24);w.ReadableState=b;r(30).EventEmitter;var a=function(e,t){return e.listeners(t).length},u=r(31),c=r(20).Buffer,l=t.Uint8Array||function(){};var f=Object.create(r(10));f.inherits=r(6);var h=r(65),d=void 0;d=h&&h.debuglog?h.debuglog("stream"):function(){};var p,g=r(66),m=r(32);f.inherits(w,u);var y=["error","close","destroy","pause","resume"];function b(e,t){e=e||{};var n=t instanceof(o=o||r(7));this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,s=e.readableHighWaterMark,a=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(s||0===s)?s:a,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new g,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(p||(p=r(34).StringDecoder),this.decoder=new p(e.encoding),this.encoding=e.encoding)}function w(e){if(o=o||r(7),!(this instanceof w))return new w(e);this._readableState=new b(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),u.call(this)}function v(e,t,r,n,i){var o,s=e._readableState;null===t?(s.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,S(e)}(e,s)):(i||(o=function(e,t){var r;n=t,c.isBuffer(n)||n instanceof l||"string"==typeof t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));var n;return r}(s,t)),o?e.emit("error",o):s.objectMode||t&&t.length>0?("string"==typeof t||s.objectMode||Object.getPrototypeOf(t)===c.prototype||(t=function(e){return c.from(e)}(t)),n?s.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):_(e,s,t,!0):s.ended?e.emit("error",new Error("stream.push() after EOF")):(s.reading=!1,s.decoder&&!r?(t=s.decoder.write(t),s.objectMode||0!==t.length?_(e,s,t,!1):E(e,s)):_(e,s,t,!1))):n||(s.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(s)}function _(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&S(e)),E(e,t)}Object.defineProperty(w.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),w.prototype.destroy=m.destroy,w.prototype._undestroy=m.undestroy,w.prototype._destroy=function(e,t){this.push(null),t(e)},w.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=c.from(e,t),t=""),r=!0),v(this,e,t,!1,r)},w.prototype.unshift=function(e){return v(this,e,null,!0,!1)},w.prototype.isPaused=function(){return!1===this._readableState.flowing},w.prototype.setEncoding=function(e){return p||(p=r(34).StringDecoder),this._readableState.decoder=new p(e),this._readableState.encoding=e,this};function k(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=8388608?e=8388608:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function S(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(d("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(T,e):T(e))}function T(e){d("emit readable"),e.emit("readable"),O(e)}function E(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(x,e,t))}function x(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(d("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}function C(e){d("readable nexttick read 0"),e.read(0)}function A(e,t){t.reading||(d("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),O(e),t.flowing&&!t.reading&&e.read(0)}function O(e){var t=e._readableState;for(d("flow",t.flowing);t.flowing&&null!==e.read(););}function R(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;e<t.head.data.length?(n=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):n=e===t.head.data.length?t.shift():r?function(e,t){var r=t.head,n=1,i=r.data;e-=i.length;for(;r=r.next;){var o=r.data,s=e>o.length?o.length:e;if(s===o.length?i+=o:i+=o.slice(0,e),0===(e-=s)){s===o.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(s));break}++n}return t.length-=n,i}(e,t):function(e,t){var r=c.allocUnsafe(e),n=t.head,i=1;n.data.copy(r),e-=n.data.length;for(;n=n.next;){var o=n.data,s=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,s),0===(e-=s)){s===o.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(s));break}++i}return t.length-=i,r}(e,t);return n}(e,t.buffer,t.decoder),r);var r}function I(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,i.nextTick(P,t,e))}function P(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function M(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}w.prototype.read=function(e){d("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return d("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?I(this):S(this),null;if(0===(e=k(e,t))&&t.ended)return 0===t.length&&I(this),null;var n,i=t.needReadable;return d("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&d("length less than watermark",i=!0),t.ended||t.reading?d("reading or ended",i=!1):i&&(d("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=k(r,t))),null===(n=e>0?R(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&I(this)),null!==n&&this.emit("data",n),n},w.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},w.prototype.pipe=function(e,t){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,d("pipe count=%d opts=%j",o.pipesCount,t);var u=(!t||!1!==t.end)&&e!==n.stdout&&e!==n.stderr?l:w;function c(t,n){d("onunpipe"),t===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,d("cleanup"),e.removeListener("close",y),e.removeListener("finish",b),e.removeListener("drain",f),e.removeListener("error",m),e.removeListener("unpipe",c),r.removeListener("end",l),r.removeListener("end",w),r.removeListener("data",g),h=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||f())}function l(){d("onend"),e.end()}o.endEmitted?i.nextTick(u):r.once("end",u),e.on("unpipe",c);var f=function(e){return function(){var t=e._readableState;d("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&a(e,"data")&&(t.flowing=!0,O(e))}}(r);e.on("drain",f);var h=!1;var p=!1;function g(t){d("ondata"),p=!1,!1!==e.write(t)||p||((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==M(o.pipes,e))&&!h&&(d("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,p=!0),r.pause())}function m(t){d("onerror",t),w(),e.removeListener("error",m),0===a(e,"error")&&e.emit("error",t)}function y(){e.removeListener("finish",b),w()}function b(){d("onfinish"),e.removeListener("close",y),w()}function w(){d("unpipe"),r.unpipe(e)}return r.on("data",g),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?s(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",m),e.once("close",y),e.once("finish",b),e.emit("pipe",r),o.flowing||(d("pipe resume"),r.resume()),e},w.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,r);return this}var s=M(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},w.prototype.on=function(e,t){var r=u.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var n=this._readableState;n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&S(this):i.nextTick(C,this))}return r},w.prototype.addListener=w.prototype.on,w.prototype.resume=function(){var e=this._readableState;return e.flowing||(d("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(A,e,t))}(this,e)),this},w.prototype.pause=function(){return d("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(d("pause"),this._readableState.flowing=!1,this.emit("pause")),this},w.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(d("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){(d("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<y.length;o++)e.on(y[o],this.emit.bind(this,y[o]));return this._read=function(t){d("wrapped _read",t),n&&(n=!1,e.resume())},this},Object.defineProperty(w.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),w._fromList=R}).call(this,r(1),r(3))},function(e,t,r){"use strict";var n,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var s=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}e.exports=a,a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var u=10;function c(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function f(e,t,r,n){var i,o,s,a;if(c(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),s=o[t]),void 0===s)s=o[t]=r,++e._eventsCount;else if("function"==typeof s?s=o[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=l(e))>0&&s.length>i&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=s.length,a=u,console&&console.warn&&console.warn(a)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=h.bind(n);return i.listener=r,n.wrapFn=i,i}function p(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):m(i,i.length)}function g(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function m(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");u=e}}),a.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},a.prototype.getMaxListeners=function(){return l(this)},a.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,i=this._events;if(void 0!==i)n=n&&void 0===i.error;else if(!n)return!1;if(n){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)o(u,this,t);else{var c=u.length,l=m(u,c);for(r=0;r<c;++r)o(l[r],this,t)}return!0},a.prototype.addListener=function(e,t){return f(this,e,t,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(e,t){return f(this,e,t,!0)},a.prototype.once=function(e,t){return c(t),this.on(e,d(this,e,t)),this},a.prototype.prependOnceListener=function(e,t){return c(t),this.prependListener(e,d(this,e,t)),this},a.prototype.removeListener=function(e,t){var r,n,i,o,s;if(c(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},a.prototype.listeners=function(e){return p(this,e,!0)},a.prototype.rawListeners=function(e){return p(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):g.call(e,t)},a.prototype.listenerCount=g,a.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(e,t,r){e.exports=r(30).EventEmitter},function(e,t,r){"use strict";var n=r(15);function i(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this,o=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return o||s?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||n.nextTick(i,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?(n.nextTick(i,r,e),r._writableState&&(r._writableState.errorEmitted=!0)):t&&t(e)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(e,t,r){"use strict";(function(t,n,i){var o=r(15);function s(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=b;var a,u=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?n:o.nextTick;b.WritableState=y;var c=Object.create(r(10));c.inherits=r(6);var l={deprecate:r(70)},f=r(31),h=r(20).Buffer,d=i.Uint8Array||function(){};var p,g=r(32);function m(){}function y(e,t){a=a||r(7),e=e||{};var n=t instanceof a;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,c=e.writableHighWaterMark,l=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(c||0===c)?c:l,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var f=!1===e.decodeStrings;this.decodeStrings=!f,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(o.nextTick(i,n),o.nextTick(T,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(i(n),e._writableState.errorEmitted=!0,e.emit("error",n),T(e,t))}(e,r,n,t,i);else{var s=k(r);s||r.corked||r.bufferProcessing||!r.bufferedRequest||_(e,r),n?u(v,e,r,s,i):v(e,r,s,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new s(this)}function b(e){if(a=a||r(7),!(p.call(b,this)||this instanceof a))return new b(e);this._writableState=new y(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),f.call(this)}function w(e,t,r,n,i,o,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function v(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),T(e,t)}function _(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),o=t.corkedRequestsFree;o.entry=r;for(var a=0,u=!0;r;)i[a]=r,r.isBuf||(u=!1),r=r.next,a+=1;i.allBuffers=u,w(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new s(t),t.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,l=r.encoding,f=r.callback;if(w(e,t,!1,t.objectMode?1:c.length,c,l,f),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function k(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function S(e,t){e._final((function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),T(e,t)}))}function T(e,t){var r=k(t);return r&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,o.nextTick(S,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}c.inherits(b,f),y.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(y.prototype,"buffer",{get:l.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(b,Symbol.hasInstance,{value:function(e){return!!p.call(this,e)||this===b&&(e&&e._writableState instanceof y)}})):p=function(e){return e instanceof this},b.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},b.prototype.write=function(e,t,r){var n,i=this._writableState,s=!1,a=!i.objectMode&&(n=e,h.isBuffer(n)||n instanceof d);return a&&!h.isBuffer(e)&&(e=function(e){return h.from(e)}(e)),"function"==typeof t&&(r=t,t=null),a?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=m),i.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),o.nextTick(t,r)}(this,r):(a||function(e,t,r,n){var i=!0,s=!1;return null===r?s=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(s=new TypeError("Invalid non-string/buffer chunk")),s&&(e.emit("error",s),o.nextTick(n,s),i=!1),i}(this,i,e,r))&&(i.pendingcb++,s=function(e,t,r,n,i,o){if(!r){var s=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=h.from(t,r));return t}(t,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=t.objectMode?1:n.length;t.length+=a;var u=t.length<t.highWaterMark;u||(t.needDrain=!0);if(t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else w(e,t,!1,a,n,i,o);return u}(this,i,a,e,t,r)),s},b.prototype.cork=function(){this._writableState.corked++},b.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||_(this,e))},b.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(b.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),b.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},b.prototype._writev=null,b.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(e,t,r){t.ending=!0,T(e,t),r&&(t.finished?o.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r)},Object.defineProperty(b.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),b.prototype.destroy=g.destroy,b.prototype._undestroy=g.undestroy,b.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,r(3),r(68).setImmediate,r(1))},function(e,t,r){"use strict";var n=r(71).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=c,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=l,this.end=f,t=3;break;default:return this.write=h,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function l(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}t.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},o.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},o.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=s(t[n]);if(i>=0)return i>0&&(e.lastNeed=i-1),i;if(--n<r||-2===i)return 0;if((i=s(t[n]))>=0)return i>0&&(e.lastNeed=i-2),i;if(--n<r||-2===i)return 0;if((i=s(t[n]))>=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,r){"use strict";e.exports=s;var n=r(7),i=Object.create(r(10));function o(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function s(e){if(!(this instanceof s))return new s(e);n.call(this,e),this._transformState={afterTransform:o.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",a)}function a(){var e=this;"function"==typeof this._flush?this._flush((function(t,r){u(e,t,r)})):u(this,null,null)}function u(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}i.inherits=r(6),i.inherits(s,n),s.prototype.push=function(e,t){return this._transformState.needTransform=!1,n.prototype.push.call(this,e,t)},s.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")},s.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},s.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},s.prototype._destroy=function(e,t){var r=this;n.prototype._destroy.call(this,e,(function(e){t(e),r.emit("close")}))}},function(e,t,r){"use strict";e.exports={countIn1D:function(e){return e.reduce((function(e,t){return void 0===e[t]?e[t]=1:e[t]++,e}),{})},countIn2D:function(e){return e.reduce((function(e,t){return t.forEach((function(t){void 0===e[t]?e[t]=1:e[t]++})),e}),{})},unflatten:function(e,t){for(var r=t.height,n=t.width,i=[],o=0;o<r;o++){var s=o*n,a=s+n;i.push(e.slice(s,a))}return i}}},function(e,t,r){"use strict";r.r(t),r.d(t,"globals",(function(){return n})),r.d(t,"rgb",(function(){return i})),r.d(t,"getDecoder",(function(){return B})),r.d(t,"setLogger",(function(){return _e})),r.d(t,"GeoTIFF",(function(){return Ce})),r.d(t,"MultiGeoTIFF",(function(){return Ae})),r.d(t,"fromUrl",(function(){return Oe})),r.d(t,"fromArrayBuffer",(function(){return Re})),r.d(t,"fromFile",(function(){return Ie})),r.d(t,"fromBlob",(function(){return Pe})),r.d(t,"fromUrls",(function(){return Me})),r.d(t,"writeArrayBuffer",(function(){return De})),r.d(t,"Pool",(function(){return Z.a}));var n={};r.r(n),r.d(n,"fieldTagNames",(function(){return a})),r.d(n,"fieldTags",(function(){return u})),r.d(n,"fieldTagTypes",(function(){return c})),r.d(n,"arrayFields",(function(){return l})),r.d(n,"fieldTypeNames",(function(){return f})),r.d(n,"fieldTypes",(function(){return h})),r.d(n,"photometricInterpretations",(function(){return d})),r.d(n,"ExtraSamplesValues",(function(){return p})),r.d(n,"geoKeyNames",(function(){return g})),r.d(n,"geoKeys",(function(){return m}));var i={};r.r(i),r.d(i,"fromWhiteIsZero",(function(){return y})),r.d(i,"fromBlackIsZero",(function(){return b})),r.d(i,"fromPalette",(function(){return w})),r.d(i,"fromCMYK",(function(){return v})),r.d(i,"fromYCbCr",(function(){return _})),r.d(i,"fromCIELab",(function(){return k}));var o=r(38),s=r.n(o);const a={315:"Artist",258:"BitsPerSample",265:"CellLength",264:"CellWidth",320:"ColorMap",259:"Compression",33432:"Copyright",306:"DateTime",338:"ExtraSamples",266:"FillOrder",289:"FreeByteCounts",288:"FreeOffsets",291:"GrayResponseCurve",290:"GrayResponseUnit",316:"HostComputer",270:"ImageDescription",257:"ImageLength",256:"ImageWidth",271:"Make",281:"MaxSampleValue",280:"MinSampleValue",272:"Model",254:"NewSubfileType",274:"Orientation",262:"PhotometricInterpretation",284:"PlanarConfiguration",296:"ResolutionUnit",278:"RowsPerStrip",277:"SamplesPerPixel",305:"Software",279:"StripByteCounts",273:"StripOffsets",255:"SubfileType",263:"Threshholding",282:"XResolution",283:"YResolution",326:"BadFaxLines",327:"CleanFaxData",343:"ClipPath",328:"ConsecutiveBadFaxLines",433:"Decode",434:"DefaultImageColor",269:"DocumentName",336:"DotRange",321:"HalftoneHints",346:"Indexed",347:"JPEGTables",285:"PageName",297:"PageNumber",317:"Predictor",319:"PrimaryChromaticities",532:"ReferenceBlackWhite",339:"SampleFormat",340:"SMinSampleValue",341:"SMaxSampleValue",559:"StripRowCounts",330:"SubIFDs",292:"T4Options",293:"T6Options",325:"TileByteCounts",323:"TileLength",324:"TileOffsets",322:"TileWidth",301:"TransferFunction",318:"WhitePoint",344:"XClipPathUnits",286:"XPosition",529:"YCbCrCoefficients",531:"YCbCrPositioning",530:"YCbCrSubSampling",345:"YClipPathUnits",287:"YPosition",37378:"ApertureValue",40961:"ColorSpace",36868:"DateTimeDigitized",36867:"DateTimeOriginal",34665:"Exif IFD",36864:"ExifVersion",33434:"ExposureTime",41728:"FileSource",37385:"Flash",40960:"FlashpixVersion",33437:"FNumber",42016:"ImageUniqueID",37384:"LightSource",37500:"MakerNote",37377:"ShutterSpeedValue",37510:"UserComment",33723:"IPTC",34675:"ICC Profile",700:"XMP",42112:"GDAL_METADATA",42113:"GDAL_NODATA",34377:"Photoshop",33550:"ModelPixelScale",33922:"ModelTiepoint",34264:"ModelTransformation",34735:"GeoKeyDirectory",34736:"GeoDoubleParams",34737:"GeoAsciiParams"},u={};for(const e in a)a.hasOwnProperty(e)&&(u[a[e]]=parseInt(e,10));const c={256:"SHORT",257:"SHORT",258:"SHORT",259:"SHORT",262:"SHORT",273:"LONG",274:"SHORT",277:"SHORT",278:"LONG",279:"LONG",282:"RATIONAL",283:"RATIONAL",284:"SHORT",286:"SHORT",287:"RATIONAL",296:"SHORT",305:"ASCII",306:"ASCII",338:"SHORT",339:"SHORT",513:"LONG",514:"LONG",1024:"SHORT",1025:"SHORT",2048:"SHORT",2049:"ASCII",33550:"DOUBLE",33922:"DOUBLE",34665:"LONG",34735:"SHORT",34737:"ASCII",42113:"ASCII"},l=[u.BitsPerSample,u.ExtraSamples,u.SampleFormat,u.StripByteCounts,u.StripOffsets,u.StripRowCounts,u.TileByteCounts,u.TileOffsets],f={1:"BYTE",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",6:"SBYTE",7:"UNDEFINED",8:"SSHORT",9:"SLONG",10:"SRATIONAL",11:"FLOAT",12:"DOUBLE",13:"IFD",16:"LONG8",17:"SLONG8",18:"IFD8"},h={};for(const e in f)f.hasOwnProperty(e)&&(h[f[e]]=parseInt(e,10));const d={WhiteIsZero:0,BlackIsZero:1,RGB:2,Palette:3,TransparencyMask:4,CMYK:5,YCbCr:6,CIELab:8,ICCLab:9},p={Unspecified:0,Assocalpha:1,Unassalpha:2},g={1024:"GTModelTypeGeoKey",1025:"GTRasterTypeGeoKey",1026:"GTCitationGeoKey",2048:"GeographicTypeGeoKey",2049:"GeogCitationGeoKey",2050:"GeogGeodeticDatumGeoKey",2051:"GeogPrimeMeridianGeoKey",2052:"GeogLinearUnitsGeoKey",2053:"GeogLinearUnitSizeGeoKey",2054:"GeogAngularUnitsGeoKey",2055:"GeogAngularUnitSizeGeoKey",2056:"GeogEllipsoidGeoKey",2057:"GeogSemiMajorAxisGeoKey",2058:"GeogSemiMinorAxisGeoKey",2059:"GeogInvFlatteningGeoKey",2060:"GeogAzimuthUnitsGeoKey",2061:"GeogPrimeMeridianLongGeoKey",2062:"GeogTOWGS84GeoKey",3072:"ProjectedCSTypeGeoKey",3073:"PCSCitationGeoKey",3074:"ProjectionGeoKey",3075:"ProjCoordTransGeoKey",3076:"ProjLinearUnitsGeoKey",3077:"ProjLinearUnitSizeGeoKey",3078:"ProjStdParallel1GeoKey",3079:"ProjStdParallel2GeoKey",3080:"ProjNatOriginLongGeoKey",3081:"ProjNatOriginLatGeoKey",3082:"ProjFalseEastingGeoKey",3083:"ProjFalseNorthingGeoKey",3084:"ProjFalseOriginLongGeoKey",3085:"ProjFalseOriginLatGeoKey",3086:"ProjFalseOriginEastingGeoKey",3087:"ProjFalseOriginNorthingGeoKey",3088:"ProjCenterLongGeoKey",3089:"ProjCenterLatGeoKey",3090:"ProjCenterEastingGeoKey",3091:"ProjCenterNorthingGeoKey",3092:"ProjScaleAtNatOriginGeoKey",3093:"ProjScaleAtCenterGeoKey",3094:"ProjAzimuthAngleGeoKey",3095:"ProjStraightVertPoleLongGeoKey",3096:"ProjRectifiedGridAngleGeoKey",4096:"VerticalCSTypeGeoKey",4097:"VerticalCitationGeoKey",4098:"VerticalDatumGeoKey",4099:"VerticalUnitsGeoKey"},m={};for(const e in g)g.hasOwnProperty(e)&&(m[g[e]]=parseInt(e,10));function y(e,t){const{width:r,height:n}=e,i=new Uint8Array(r*n*3);let o;for(let r=0,n=0;r<e.length;++r,n+=3)o=256-e[r]/t*256,i[n]=o,i[n+1]=o,i[n+2]=o;return i}function b(e,t){const{width:r,height:n}=e,i=new Uint8Array(r*n*3);let o;for(let r=0,n=0;r<e.length;++r,n+=3)o=e[r]/t*256,i[n]=o,i[n+1]=o,i[n+2]=o;return i}function w(e,t){const{width:r,height:n}=e,i=new Uint8Array(r*n*3),o=t.length/3,s=t.length/3*2;for(let r=0,n=0;r<e.length;++r,n+=3){const a=e[r];i[n]=t[a]/65536*256,i[n+1]=t[a+o]/65536*256,i[n+2]=t[a+s]/65536*256}return i}function v(e){const{width:t,height:r}=e,n=new Uint8Array(t*r*3);for(let t=0,r=0;t<e.length;t+=4,r+=3){const i=e[t],o=e[t+1],s=e[t+2],a=e[t+3];n[r]=(255-i)/256*255*((255-a)/256),n[r+1]=(255-o)/256*255*((255-a)/256),n[r+2]=(255-s)/256*255*((255-a)/256)}return n}function _(e){const{width:t,height:r}=e,n=new Uint8ClampedArray(t*r*3);for(let t=0,r=0;t<e.length;t+=3,r+=3){const i=e[t],o=e[t+1],s=e[t+2];n[r]=i+1.402*(s-128),n[r+1]=i-.34414*(o-128)-.71414*(s-128),n[r+2]=i+1.772*(o-128)}return n}function k(e){const{width:t,height:r}=e,n=new Uint8Array(t*r*3);for(let t=0,r=0;t<e.length;t+=3,r+=3){let i,o,s,a=(e[t+0]+16)/116,u=(e[t+1]<<24>>24)/500+a,c=a-(e[t+2]<<24>>24)/200;u=.95047*(u*u*u>.008856?u*u*u:(u-16/116)/7.787),a=1*(a*a*a>.008856?a*a*a:(a-16/116)/7.787),c=1.08883*(c*c*c>.008856?c*c*c:(c-16/116)/7.787),i=3.2406*u+-1.5372*a+-.4986*c,o=-.9689*u+1.8758*a+.0415*c,s=.0557*u+-.204*a+1.057*c,i=i>.0031308?1.055*i**(1/2.4)-.055:12.92*i,o=o>.0031308?1.055*o**(1/2.4)-.055:12.92*o,s=s>.0031308?1.055*s**(1/2.4)-.055:12.92*s,n[r]=255*Math.max(0,Math.min(1,i)),n[r+1]=255*Math.max(0,Math.min(1,o)),n[r+2]=255*Math.max(0,Math.min(1,s))}return n}function S(e,t){let r=e.length-t,n=0;do{for(let r=t;r>0;r--)e[n+t]+=e[n],n++;r-=t}while(r>0)}function T(e,t,r){let n=0,i=e.length;const o=i/r;for(;i>t;){for(let r=t;r>0;--r)e[n+t]+=e[n],++n;i-=t}const s=e.slice();for(let t=0;t<o;++t)for(let n=0;n<r;++n)e[r*t+n]=s[(r-n-1)*o+t]}class E{decode(e,t){const r=this.decodeBlock(t),n=e.Predictor||1;if(1!==n){const t=!e.StripOffsets;return function(e,t,r,n,i,o){if(!t||1===t)return e;for(let e=0;e<i.length;++e){if(i[e]%8!=0)throw new Error("When decoding with predictor, only multiple of 8 bits are supported.");if(i[e]!==i[0])throw new Error("When decoding with predictor, all samples must have the same size.")}const s=i[0]/8,a=2===o?1:i.length;for(let o=0;o<n&&!(o*a*r*s>=e.byteLength);++o){let n;if(2===t){switch(i[0]){case 8:n=new Uint8Array(e,o*a*r*s,a*r*s);break;case 16:n=new Uint16Array(e,o*a*r*s,a*r*s/2);break;case 32:n=new Uint32Array(e,o*a*r*s,a*r*s/4);break;default:throw new Error(`Predictor 2 not allowed with ${i[0]} bits per sample.`)}S(n,a)}else 3===t&&(n=new Uint8Array(e,o*a*r*s,a*r*s),T(n,a,s))}return e}(r,n,t?e.TileWidth:e.ImageWidth,t?e.TileLength:e.RowsPerStrip||e.ImageLength,e.BitsPerSample,e.PlanarConfiguration)}return r}}class x extends E{decodeBlock(e){return e}}function C(e,t){for(let r=t.length-1;r>=0;r--)e.push(t[r]);return e}function A(e){const t=new Uint16Array(4093),r=new Uint8Array(4093);for(let e=0;e<=257;e++)t[e]=4096,r[e]=e;let n=258,i=9,o=0;function s(){n=258,i=9}function a(e){const t=function(e,t,r){const n=t%8,i=Math.floor(t/8),o=8-n,s=t+r-8*(i+1);let a=8*(i+2)-(t+r);const u=8*(i+2)-t;if(a=Math.max(0,a),i>=e.length)return console.warn("ran off the end of the buffer before finding EOI_CODE (end on input code)"),257;let c=e[i]&2**(8-n)-1;c<<=r-o;let l=c;if(i+1<e.length){let t=e[i+1]>>>a;t<<=Math.max(0,r-u),l+=t}if(s>8&&i+2<e.length){const n=8*(i+3)-(t+r);l+=e[i+2]>>>n}return l}(e,o,i);return o+=i,t}function u(e,i){return r[n]=i,t[n]=e,n++,n-1}function c(e){const n=[];for(let i=e;4096!==i;i=t[i])n.push(r[i]);return n}const l=[];s();const f=new Uint8Array(e);let h,d=a(f);for(;257!==d;){if(256===d){for(s(),d=a(f);256===d;)d=a(f);if(257===d)break;if(d>256)throw new Error("corrupted code at scanline "+d);C(l,c(d)),h=d}else if(d<n){const e=c(d);C(l,e),u(h,e[e.length-1]),h=d}else{const e=c(h);if(!e)throw new Error(`Bogus entry. Not in dictionary, ${h} / ${n}, position: ${o}`);C(l,e),l.push(e[e.length-1]),u(h,e[e.length-1]),h=d}n+1>=2**i&&(12===i?h=void 0:i++),d=a(f)}return new Uint8Array(l)}class O extends E{decodeBlock(e){return A(e).buffer}}const R=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]);function I(e,t){let r=0;const n=[];let i=16;for(;i>0&&!e[i-1];)--i;n.push({children:[],index:0});let o,s=n[0];for(let a=0;a<i;a++){for(let i=0;i<e[a];i++){for(s=n.pop(),s.children[s.index]=t[r];s.index>0;)s=n.pop();for(s.index++,n.push(s);n.length<=a;)n.push(o={children:[],index:0}),s.children[s.index]=o.children,s=o;r++}a+1<i&&(n.push(o={children:[],index:0}),s.children[s.index]=o.children,s=o)}return n[0].children}function P(e,t,r,n,i,o,s,a,u){const{mcusPerLine:c,progressive:l}=r,f=t;let h=t,d=0,p=0;function g(){if(p>0)return p--,d>>p&1;if(d=e[h++],255===d){const t=e[h++];if(t)throw new Error("unexpected marker: "+(d<<8|t).toString(16))}return p=7,d>>>7}function m(e){let t,r=e;for(;null!==(t=g());){if(r=r[t],"number"==typeof r)return r;if("object"!=typeof r)throw new Error("invalid huffman sequence")}return null}function y(e){let t=e,r=0;for(;t>0;){const e=g();if(null===e)return;r=r<<1|e,--t}return r}function b(e){const t=y(e);return t>=1<<e-1?t:t+(-1<<e)+1}let w=0;let v,_=0;function k(e,t,r,n,i){const o=r%c,s=(r/c|0)*e.v+n,a=o*e.h+i;t(e,e.blocks[s][a])}function S(e,t,r){const n=r/e.blocksPerLine|0,i=r%e.blocksPerLine;t(e,e.blocks[n][i])}const T=n.length;let E,x,C,A,O,I;I=l?0===o?0===a?function(e,t){const r=m(e.huffmanTableDC),n=0===r?0:b(r)<<u;e.pred+=n,t[0]=e.pred}:function(e,t){t[0]|=g()<<u}:0===a?function(e,t){if(w>0)return void w--;let r=o;const n=s;for(;r<=n;){const n=m(e.huffmanTableAC),i=15&n,o=n>>4;if(0===i){if(o<15){w=y(o)+(1<<o)-1;break}r+=16}else{r+=o;t[R[r]]=b(i)*(1<<u),r++}}}:function(e,t){let r=o;const n=s;let i=0;for(;r<=n;){const n=R[r],o=t[n]<0?-1:1;switch(_){case 0:{const t=m(e.huffmanTableAC),r=15&t;if(i=t>>4,0===r)i<15?(w=y(i)+(1<<i),_=4):(i=16,_=1);else{if(1!==r)throw new Error("invalid ACn encoding");v=b(r),_=i?2:3}continue}case 1:case 2:t[n]?t[n]+=(g()<<u)*o:(i--,0===i&&(_=2===_?3:0));break;case 3:t[n]?t[n]+=(g()<<u)*o:(t[n]=v<<u,_=0);break;case 4:t[n]&&(t[n]+=(g()<<u)*o)}r++}4===_&&(w--,0===w&&(_=0))}:function(e,t){const r=m(e.huffmanTableDC),n=0===r?0:b(r);e.pred+=n,t[0]=e.pred;let i=1;for(;i<64;){const r=m(e.huffmanTableAC),n=15&r,o=r>>4;if(0===n){if(o<15)break;i+=16}else{i+=o;t[R[i]]=b(n),i++}}};let P,M,D=0;M=1===T?n[0].blocksPerLine*n[0].blocksPerColumn:c*r.mcusPerColumn;const L=i||M;for(;D<M;){for(x=0;x<T;x++)n[x].pred=0;if(w=0,1===T)for(E=n[0],O=0;O<L;O++)S(E,I,D),D++;else for(O=0;O<L;O++){for(x=0;x<T;x++){E=n[x];const{h:e,v:t}=E;for(C=0;C<t;C++)for(A=0;A<e;A++)k(E,I,D,C,A)}if(D++,D===M)break}if(p=0,P=e[h]<<8|e[h+1],P<65280)throw new Error("marker was not found");if(!(P>=65488&&P<=65495))break;h+=2}return h-f}function M(e,t){const r=[],{blocksPerLine:n,blocksPerColumn:i}=t,o=n<<3,s=new Int32Array(64),a=new Uint8Array(64);function u(e,r,n){const i=t.quantizationTable;let o,s,a,u,c,l,f,h,d;const p=n;let g;for(g=0;g<64;g++)p[g]=e[g]*i[g];for(g=0;g<8;++g){const e=8*g;0!==p[1+e]||0!==p[2+e]||0!==p[3+e]||0!==p[4+e]||0!==p[5+e]||0!==p[6+e]||0!==p[7+e]?(o=5793*p[0+e]+128>>8,s=5793*p[4+e]+128>>8,a=p[2+e],u=p[6+e],c=2896*(p[1+e]-p[7+e])+128>>8,h=2896*(p[1+e]+p[7+e])+128>>8,l=p[3+e]<<4,f=p[5+e]<<4,d=o-s+1>>1,o=o+s+1>>1,s=d,d=3784*a+1567*u+128>>8,a=1567*a-3784*u+128>>8,u=d,d=c-f+1>>1,c=c+f+1>>1,f=d,d=h+l+1>>1,l=h-l+1>>1,h=d,d=o-u+1>>1,o=o+u+1>>1,u=d,d=s-a+1>>1,s=s+a+1>>1,a=d,d=2276*c+3406*h+2048>>12,c=3406*c-2276*h+2048>>12,h=d,d=799*l+4017*f+2048>>12,l=4017*l-799*f+2048>>12,f=d,p[0+e]=o+h,p[7+e]=o-h,p[1+e]=s+f,p[6+e]=s-f,p[2+e]=a+l,p[5+e]=a-l,p[3+e]=u+c,p[4+e]=u-c):(d=5793*p[0+e]+512>>10,p[0+e]=d,p[1+e]=d,p[2+e]=d,p[3+e]=d,p[4+e]=d,p[5+e]=d,p[6+e]=d,p[7+e]=d)}for(g=0;g<8;++g){const e=g;0!==p[8+e]||0!==p[16+e]||0!==p[24+e]||0!==p[32+e]||0!==p[40+e]||0!==p[48+e]||0!==p[56+e]?(o=5793*p[0+e]+2048>>12,s=5793*p[32+e]+2048>>12,a=p[16+e],u=p[48+e],c=2896*(p[8+e]-p[56+e])+2048>>12,h=2896*(p[8+e]+p[56+e])+2048>>12,l=p[24+e],f=p[40+e],d=o-s+1>>1,o=o+s+1>>1,s=d,d=3784*a+1567*u+2048>>12,a=1567*a-3784*u+2048>>12,u=d,d=c-f+1>>1,c=c+f+1>>1,f=d,d=h+l+1>>1,l=h-l+1>>1,h=d,d=o-u+1>>1,o=o+u+1>>1,u=d,d=s-a+1>>1,s=s+a+1>>1,a=d,d=2276*c+3406*h+2048>>12,c=3406*c-2276*h+2048>>12,h=d,d=799*l+4017*f+2048>>12,l=4017*l-799*f+2048>>12,f=d,p[0+e]=o+h,p[56+e]=o-h,p[8+e]=s+f,p[48+e]=s-f,p[16+e]=a+l,p[40+e]=a-l,p[24+e]=u+c,p[32+e]=u-c):(d=5793*n[g+0]+8192>>14,p[0+e]=d,p[8+e]=d,p[16+e]=d,p[24+e]=d,p[32+e]=d,p[40+e]=d,p[48+e]=d,p[56+e]=d)}for(g=0;g<64;++g){const e=128+(p[g]+8>>4);r[g]=e<0?0:e>255?255:e}}for(let e=0;e<i;e++){const i=e<<3;for(let e=0;e<8;e++)r.push(new Uint8Array(o));for(let o=0;o<n;o++){u(t.blocks[e][o],a,s);let n=0;const c=o<<3;for(let e=0;e<8;e++){const t=r[i+e];for(let e=0;e<8;e++)t[c+e]=a[n++]}}}return r}class D{constructor(){this.jfif=null,this.adobe=null,this.quantizationTables=[],this.huffmanTablesAC=[],this.huffmanTablesDC=[],this.resetFrames()}resetFrames(){this.frames=[]}parse(e){let t=0;function r(){const r=e[t]<<8|e[t+1];return t+=2,r}function n(){const n=r(),i=e.subarray(t,t+n-2);return t+=i.length,i}function i(e){let t,r,n=0,i=0;for(r in e.components)e.components.hasOwnProperty(r)&&(t=e.components[r],n<t.h&&(n=t.h),i<t.v&&(i=t.v));const o=Math.ceil(e.samplesPerLine/8/n),s=Math.ceil(e.scanLines/8/i);for(r in e.components)if(e.components.hasOwnProperty(r)){t=e.components[r];const a=Math.ceil(Math.ceil(e.samplesPerLine/8)*t.h/n),u=Math.ceil(Math.ceil(e.scanLines/8)*t.v/i),c=o*t.h,l=s*t.v,f=[];for(let e=0;e<l;e++){const e=[];for(let t=0;t<c;t++)e.push(new Int32Array(64));f.push(e)}t.blocksPerLine=a,t.blocksPerColumn=u,t.blocks=f}e.maxH=n,e.maxV=i,e.mcusPerLine=o,e.mcusPerColumn=s}let o=r();if(65496!==o)throw new Error("SOI not found");for(o=r();65497!==o;){switch(o){case 65280:break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:{const e=n();65504===o&&74===e[0]&&70===e[1]&&73===e[2]&&70===e[3]&&0===e[4]&&(this.jfif={version:{major:e[5],minor:e[6]},densityUnits:e[7],xDensity:e[8]<<8|e[9],yDensity:e[10]<<8|e[11],thumbWidth:e[12],thumbHeight:e[13],thumbData:e.subarray(14,14+3*e[12]*e[13])}),65518===o&&65===e[0]&&100===e[1]&&111===e[2]&&98===e[3]&&101===e[4]&&0===e[5]&&(this.adobe={version:e[6],flags0:e[7]<<8|e[8],flags1:e[9]<<8|e[10],transformCode:e[11]});break}case 65499:{const n=r()+t-2;for(;t<n;){const n=e[t++],i=new Int32Array(64);if(n>>4==0)for(let r=0;r<64;r++){i[R[r]]=e[t++]}else{if(n>>4!=1)throw new Error("DQT: invalid table spec");for(let e=0;e<64;e++){i[R[e]]=r()}}this.quantizationTables[15&n]=i}break}case 65472:case 65473:case 65474:{r();const n={extended:65473===o,progressive:65474===o,precision:e[t++],scanLines:r(),samplesPerLine:r(),components:{},componentsOrder:[]},s=e[t++];let a;for(let r=0;r<s;r++){a=e[t];const r=e[t+1]>>4,i=15&e[t+1],o=e[t+2];n.componentsOrder.push(a),n.components[a]={h:r,v:i,quantizationIdx:o},t+=3}i(n),this.frames.push(n);break}case 65476:{const n=r();for(let r=2;r<n;){const n=e[t++],i=new Uint8Array(16);let o=0;for(let r=0;r<16;r++,t++)i[r]=e[t],o+=i[r];const s=new Uint8Array(o);for(let r=0;r<o;r++,t++)s[r]=e[t];r+=17+o,n>>4==0?this.huffmanTablesDC[15&n]=I(i,s):this.huffmanTablesAC[15&n]=I(i,s)}break}case 65501:r(),this.resetInterval=r();break;case 65498:{r();const n=e[t++],i=[],o=this.frames[0];for(let r=0;r<n;r++){const r=o.components[e[t++]],n=e[t++];r.huffmanTableDC=this.huffmanTablesDC[n>>4],r.huffmanTableAC=this.huffmanTablesAC[15&n],i.push(r)}const s=e[t++],a=e[t++],u=e[t++],c=P(e,t,o,i,this.resetInterval,s,a,u>>4,15&u);t+=c;break}case 65535:255!==e[t]&&t--;break;default:if(255===e[t-3]&&e[t-2]>=192&&e[t-2]<=254){t-=3;break}throw new Error("unknown JPEG marker "+o.toString(16))}o=r()}}getResult(){const{frames:e}=this;if(0===this.frames.length)throw new Error("no frames were decoded");this.frames.length>1&&console.warn("more than one frame is not supported");for(let e=0;e<this.frames.length;e++){const t=this.frames[e].components;for(const e of Object.keys(t))t[e].quantizationTable=this.quantizationTables[t[e].quantizationIdx],delete t[e].quantizationIdx}const t=e[0],{components:r,componentsOrder:n}=t,i=[],o=t.samplesPerLine,s=t.scanLines;for(let e=0;e<n.length;e++){const o=r[n[e]];i.push({lines:M(0,o),scaleX:o.h/t.maxH,scaleY:o.v/t.maxV})}const a=new Uint8Array(o*s*i.length);let u=0;for(let e=0;e<s;++e)for(let t=0;t<o;++t)for(let r=0;r<i.length;++r){const n=i[r];a[u]=n.lines[0|e*n.scaleY][0|t*n.scaleX],++u}return a}}class L extends E{constructor(e){super(),this.reader=new D,e.JPEGTables&&this.reader.parse(e.JPEGTables)}decodeBlock(e){return this.reader.resetFrames(),this.reader.parse(new Uint8Array(e)),this.reader.getResult().buffer}}var U=r(39);class F extends E{decodeBlock(e){return Object(U.inflate)(new Uint8Array(e)).buffer}}class j extends E{decodeBlock(e){const t=new DataView(e),r=[];for(let n=0;n<e.byteLength;++n){let e=t.getInt8(n);if(e<0){const i=t.getUint8(n+1);e=-e;for(let t=0;t<=e;++t)r.push(i);n+=1}else{for(let i=0;i<=e;++i)r.push(t.getUint8(n+i+1));n+=e+1}}return new Uint8Array(r).buffer}}function B(e){switch(e.Compression){case void 0:case 1:return new x;case 5:return new O;case 6:throw new Error("old style JPEG compression is not supported.");case 7:return new L(e);case 8:case 32946:return new F;case 32773:return new j;default:throw new Error("Unknown compression method identifier: "+e.Compression)}}function N(e,t,r,n=1){return new(Object.getPrototypeOf(e).constructor)(t*r*n)}function G(e,t,r){return(1-r)*e+r*t}function q(e,t,r,n,i,o="nearest"){switch(o.toLowerCase()){case"nearest":return function(e,t,r,n,i){const o=t/n,s=r/i;return e.map(e=>{const a=N(e,n,i);for(let u=0;u<i;++u){const i=Math.min(Math.round(s*u),r-1);for(let r=0;r<n;++r){const s=Math.min(Math.round(o*r),t-1),c=e[i*t+s];a[u*n+r]=c}}return a})}(e,t,r,n,i);case"bilinear":case"linear":return function(e,t,r,n,i){const o=t/n,s=r/i;return e.map(e=>{const a=N(e,n,i);for(let u=0;u<i;++u){const i=s*u,c=Math.floor(i),l=Math.min(Math.ceil(i),r-1);for(let r=0;r<n;++r){const s=o*r,f=s%1,h=Math.floor(s),d=Math.min(Math.ceil(s),t-1),p=e[c*t+h],g=e[c*t+d],m=e[l*t+h],y=e[l*t+d],b=G(G(p,g,f),G(m,y,f),i%1);a[u*n+r]=b}}return a})}(e,t,r,n,i);default:throw new Error(`Unsupported resampling method: '${o}'`)}}function H(e,t,r,n,i,o,s="nearest"){switch(s.toLowerCase()){case"nearest":return function(e,t,r,n,i,o){const s=t/n,a=r/i,u=N(e,n,i,o);for(let c=0;c<i;++c){const i=Math.min(Math.round(a*c),r-1);for(let r=0;r<n;++r){const a=Math.min(Math.round(s*r),t-1);for(let s=0;s<o;++s){const l=e[i*t*o+a*o+s];u[c*n*o+r*o+s]=l}}}return u}(e,t,r,n,i,o);case"bilinear":case"linear":return function(e,t,r,n,i,o){const s=t/n,a=r/i,u=N(e,n,i,o);for(let c=0;c<i;++c){const i=a*c,l=Math.floor(i),f=Math.min(Math.ceil(i),r-1);for(let r=0;r<n;++r){const a=s*r,h=a%1,d=Math.floor(a),p=Math.min(Math.ceil(a),t-1);for(let s=0;s<o;++s){const a=e[l*t*o+d*o+s],g=e[l*t*o+p*o+s],m=e[f*t*o+d*o+s],y=e[f*t*o+p*o+s],b=G(G(a,g,h),G(m,y,h),i%1);u[c*n*o+r*o+s]=b}}}return u}(e,t,r,n,i,o);default:throw new Error(`Unsupported resampling method: '${s}'`)}}function z(e,t,r){let n=0;for(let i=t;i<r;++i)n+=e[i];return n}function K(e,t,r){switch(e){case 1:switch(t){case 8:return new Uint8Array(r);case 16:return new Uint16Array(r);case 32:return new Uint32Array(r)}break;case 2:switch(t){case 8:return new Int8Array(r);case 16:return new Int16Array(r);case 32:return new Int32Array(r)}break;case 3:switch(t){case 32:return new Float32Array(r);case 64:return new Float64Array(r)}}throw Error("Unsupported data format/bitsPerSample")}var W=class{constructor(e,t,r,n,i,o){this.fileDirectory=e,this.geoKeys=t,this.dataView=r,this.littleEndian=n,this.tiles=i?{}:null,this.isTiled=!e.StripOffsets;const s=e.PlanarConfiguration;if(this.planarConfiguration=void 0===s?1:s,1!==this.planarConfiguration&&2!==this.planarConfiguration)throw new Error("Invalid planar configuration.");this.source=o}getFileDirectory(){return this.fileDirectory}getGeoKeys(){return this.geoKeys}getWidth(){return this.fileDirectory.ImageWidth}getHeight(){return this.fileDirectory.ImageLength}getSamplesPerPixel(){return this.fileDirectory.SamplesPerPixel}getTileWidth(){return this.isTiled?this.fileDirectory.TileWidth:this.getWidth()}getTileHeight(){return this.isTiled?this.fileDirectory.TileLength:void 0!==this.fileDirectory.RowsPerStrip?Math.min(this.fileDirectory.RowsPerStrip,this.getHeight()):this.getHeight()}getBytesPerPixel(){let e=0;for(let t=0;t<this.fileDirectory.BitsPerSample.length;++t){const r=this.fileDirectory.BitsPerSample[t];if(r%8!=0)throw new Error(`Sample bit-width of ${r} is not supported.`);if(r!==this.fileDirectory.BitsPerSample[0])throw new Error("Differing size of samples in a pixel are not supported.");e+=r}return e/8}getSampleByteSize(e){if(e>=this.fileDirectory.BitsPerSample.length)throw new RangeError(`Sample index ${e} is out of range.`);const t=this.fileDirectory.BitsPerSample[e];if(t%8!=0)throw new Error(`Sample bit-width of ${t} is not supported.`);return t/8}getReaderForSample(e){const t=this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[e]:1,r=this.fileDirectory.BitsPerSample[e];switch(t){case 1:switch(r){case 8:return DataView.prototype.getUint8;case 16:return DataView.prototype.getUint16;case 32:return DataView.prototype.getUint32}break;case 2:switch(r){case 8:return DataView.prototype.getInt8;case 16:return DataView.prototype.getInt16;case 32:return DataView.prototype.getInt32}break;case 3:switch(r){case 32:return DataView.prototype.getFloat32;case 64:return DataView.prototype.getFloat64}}throw Error("Unsupported data format/bitsPerSample")}getArrayForSample(e,t){return K(this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[e]:1,this.fileDirectory.BitsPerSample[e],t)}async getTileOrStrip(e,t,r,n){const i=Math.ceil(this.getWidth()/this.getTileWidth()),o=Math.ceil(this.getHeight()/this.getTileHeight());let s;const{tiles:a}=this;let u,c;1===this.planarConfiguration?s=t*i+e:2===this.planarConfiguration&&(s=r*i*o+t*i+e),this.isTiled?(u=this.fileDirectory.TileOffsets[s],c=this.fileDirectory.TileByteCounts[s]):(u=this.fileDirectory.StripOffsets[s],c=this.fileDirectory.StripByteCounts[s]);const l=await this.source.fetch(u,c);let f;return null===a?f=n.decode(this.fileDirectory,l):a[s]||(f=n.decode(this.fileDirectory,l),a[s]=f),{x:e,y:t,sample:r,data:await f}}async _readRaster(e,t,r,n,i,o,s,a){const u=this.getTileWidth(),c=this.getTileHeight(),l=Math.max(Math.floor(e[0]/u),0),f=Math.min(Math.ceil(e[2]/u),Math.ceil(this.getWidth()/this.getTileWidth())),h=Math.max(Math.floor(e[1]/c),0),d=Math.min(Math.ceil(e[3]/c),Math.ceil(this.getHeight()/this.getTileHeight())),p=e[2]-e[0];let g=this.getBytesPerPixel();const m=[],y=[];for(let e=0;e<t.length;++e)1===this.planarConfiguration?m.push(z(this.fileDirectory.BitsPerSample,0,t[e])/8):m.push(0),y.push(this.getReaderForSample(t[e]));const b=[],{littleEndian:w}=this;for(let o=h;o<d;++o)for(let s=l;s<f;++s)for(let a=0;a<t.length;++a){const l=a,f=t[a];2===this.planarConfiguration&&(g=this.getSampleByteSize(f));const h=this.getTileOrStrip(s,o,f,i);b.push(h),h.then(i=>{const o=i.data,s=new DataView(o),a=i.y*c,f=i.x*u,h=(i.y+1)*c,d=(i.x+1)*u,b=y[l],v=Math.min(c,c-(h-e[3])),_=Math.min(u,u-(d-e[2]));for(let i=Math.max(0,e[1]-a);i<v;++i)for(let o=Math.max(0,e[0]-f);o<_;++o){const c=(i*u+o)*g,h=b.call(s,c+m[l],w);let d;n?(d=(i+a-e[1])*p*t.length+(o+f-e[0])*t.length+l,r[d]=h):(d=(i+a-e[1])*p+o+f-e[0],r[l][d]=h)}})}if(await Promise.all(b),o&&e[2]-e[0]!==o||s&&e[3]-e[1]!==s){let i;return i=n?H(r,e[2]-e[0],e[3]-e[1],o,s,t.length,a):q(r,e[2]-e[0],e[3]-e[1],o,s,a),i.width=o,i.height=s,i}return r.width=o||e[2]-e[0],r.height=s||e[3]-e[1],r}async readRasters({window:e,samples:t=[],interleave:r,pool:n=null,width:i,height:o,resampleMethod:s,fillValue:a}={}){const u=e||[0,0,this.getWidth(),this.getHeight()];if(u[0]>u[2]||u[1]>u[3])throw new Error("Invalid subsets");const c=(u[2]-u[0])*(u[3]-u[1]);if(t&&t.length){for(let e=0;e<t.length;++e)if(t[e]>=this.fileDirectory.SamplesPerPixel)return Promise.reject(new RangeError(`Invalid sample index '${t[e]}'.`))}else for(let e=0;e<this.fileDirectory.SamplesPerPixel;++e)t.push(e);let l;if(r){l=K(this.fileDirectory.SampleFormat?Math.max.apply(null,this.fileDirectory.SampleFormat):1,Math.max.apply(null,this.fileDirectory.BitsPerSample),c*t.length),a&&l.fill(a)}else{l=[];for(let e=0;e<t.length;++e){const r=this.getArrayForSample(t[e],c);Array.isArray(a)&&e<a.length?r.fill(a[e]):a&&!Array.isArray(a)&&r.fill(a),l.push(r)}}const f=n||B(this.fileDirectory);return await this._readRaster(u,t,l,r,f,i,o,s)}async readRGB({window:e,pool:t=null,width:r,height:n,resampleMethod:i,enableAlpha:o=!1}={}){const s=e||[0,0,this.getWidth(),this.getHeight()];if(s[0]>s[2]||s[1]>s[3])throw new Error("Invalid subsets");const a=this.fileDirectory.PhotometricInterpretation;if(a===d.RGB){let i=[0,1,2];if(this.fileDirectory.ExtraSamples!==p.Unspecified&&o){i=[];for(let e=0;e<this.fileDirectory.BitsPerSample.length;e+=1)i.push(e)}return this.readRasters({window:e,interleave:!0,samples:i,pool:t,width:r,height:n})}let u;switch(a){case d.WhiteIsZero:case d.BlackIsZero:case d.Palette:u=[0];break;case d.CMYK:u=[0,1,2,3];break;case d.YCbCr:case d.CIELab:u=[0,1,2];break;default:throw new Error("Invalid or unsupported photometric interpretation.")}const c={window:s,interleave:!0,samples:u,pool:t,width:r,height:n,resampleMethod:i},{fileDirectory:l}=this,f=await this.readRasters(c),h=2**this.fileDirectory.BitsPerSample[0];let g;switch(a){case d.WhiteIsZero:g=y(f,h);break;case d.BlackIsZero:g=b(f,h);break;case d.Palette:g=w(f,l.ColorMap);break;case d.CMYK:g=v(f);break;case d.YCbCr:g=_(f);break;case d.CIELab:g=k(f);break;default:throw new Error("Unsupported photometric interpretation.")}return g.width=f.width,g.height=f.height,g}getTiePoints(){if(!this.fileDirectory.ModelTiepoint)return[];const e=[];for(let t=0;t<this.fileDirectory.ModelTiepoint.length;t+=6)e.push({i:this.fileDirectory.ModelTiepoint[t],j:this.fileDirectory.ModelTiepoint[t+1],k:this.fileDirectory.ModelTiepoint[t+2],x:this.fileDirectory.ModelTiepoint[t+3],y:this.fileDirectory.ModelTiepoint[t+4],z:this.fileDirectory.ModelTiepoint[t+5]});return e}getGDALMetadata(e=null){const t={};if(!this.fileDirectory.GDAL_METADATA)return null;const r=this.fileDirectory.GDAL_METADATA,n=s()(r.substring(0,r.length-1));if(!n[0].tagName)throw new Error("Failed to parse GDAL metadata XML.");const i=n[0];if("GDALMetadata"!==i.tagName)throw new Error("Unexpected GDAL metadata XML tag.");let o=i.children.filter(e=>"Item"===e.tagName);e&&(o=o.filter(t=>Number(t.attributes.sample)===e));for(let e=0;e<o.length;++e){const r=o[e];t[r.attributes.name]=r.children[0]}return t}getGDALNoData(){if(!this.fileDirectory.GDAL_NODATA)return null;const e=this.fileDirectory.GDAL_NODATA;return Number(e.substring(0,e.length-1))}getOrigin(){const e=this.fileDirectory.ModelTiepoint,t=this.fileDirectory.ModelTransformation;if(e&&6===e.length)return[e[3],e[4],e[5]];if(t)return[t[3],t[7],t[11]];throw new Error("The image does not have an affine transformation.")}getResolution(e=null){const t=this.fileDirectory.ModelPixelScale,r=this.fileDirectory.ModelTransformation;if(t)return[t[0],-t[1],t[2]];if(r)return[r[0],r[5],r[10]];if(e){const[t,r,n]=e.getResolution();return[t*e.getWidth()/this.getWidth(),r*e.getHeight()/this.getHeight(),n*e.getWidth()/this.getWidth()]}throw new Error("The image does not have an affine transformation.")}pixelIsArea(){return 1===this.geoKeys.GTRasterTypeGeoKey}getBoundingBox(){const e=this.getOrigin(),t=this.getResolution(),r=e[0],n=e[1],i=r+t[0]*this.getWidth(),o=n+t[1]*this.getHeight();return[Math.min(r,i),Math.min(n,o),Math.max(r,i),Math.max(n,o)]}};class V{constructor(e){this._dataView=new DataView(e)}get buffer(){return this._dataView.buffer}getUint64(e,t){const r=this.getUint32(e,t),n=this.getUint32(e+4,t);let i;if(t){if(i=r+2**32*n,!Number.isSafeInteger(i))throw new Error(i+" exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues");return i}if(i=2**32*r+n,!Number.isSafeInteger(i))throw new Error(i+" exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues");return i}getInt64(e,t){let r=0;const n=(128&this._dataView.getUint8(e+(t?7:0)))>0;let i=!0;for(let o=0;o<8;o++){let s=this._dataView.getUint8(e+(t?o:7-o));n&&(i?0!==s&&(s=255&~(s-1),i=!1):s=255&~s),r+=s*256**o}return n&&(r=-r),r}getUint8(e,t){return this._dataView.getUint8(e,t)}getInt8(e,t){return this._dataView.getInt8(e,t)}getUint16(e,t){return this._dataView.getUint16(e,t)}getInt16(e,t){return this._dataView.getInt16(e,t)}getUint32(e,t){return this._dataView.getUint32(e,t)}getInt32(e,t){return this._dataView.getInt32(e,t)}getFloat32(e,t){return this._dataView.getFloat32(e,t)}getFloat64(e,t){return this._dataView.getFloat64(e,t)}}class Y{constructor(e,t,r,n){this._dataView=new DataView(e),this._sliceOffset=t,this._littleEndian=r,this._bigTiff=n}get sliceOffset(){return this._sliceOffset}get sliceTop(){return this._sliceOffset+this.buffer.byteLength}get littleEndian(){return this._littleEndian}get bigTiff(){return this._bigTiff}get buffer(){return this._dataView.buffer}covers(e,t){return this.sliceOffset<=e&&this.sliceTop>=e+t}readUint8(e){return this._dataView.getUint8(e-this._sliceOffset,this._littleEndian)}readInt8(e){return this._dataView.getInt8(e-this._sliceOffset,this._littleEndian)}readUint16(e){return this._dataView.getUint16(e-this._sliceOffset,this._littleEndian)}readInt16(e){return this._dataView.getInt16(e-this._sliceOffset,this._littleEndian)}readUint32(e){return this._dataView.getUint32(e-this._sliceOffset,this._littleEndian)}readInt32(e){return this._dataView.getInt32(e-this._sliceOffset,this._littleEndian)}readFloat32(e){return this._dataView.getFloat32(e-this._sliceOffset,this._littleEndian)}readFloat64(e){return this._dataView.getFloat64(e-this._sliceOffset,this._littleEndian)}readUint64(e){const t=this.readUint32(e),r=this.readUint32(e+4);let n;if(this._littleEndian){if(n=t+2**32*r,!Number.isSafeInteger(n))throw new Error(n+" exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues");return n}if(n=2**32*t+r,!Number.isSafeInteger(n))throw new Error(n+" exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues");return n}readInt64(e){let t=0;const r=(128&this._dataView.getUint8(e+(this._littleEndian?7:0)))>0;let n=!0;for(let i=0;i<8;i++){let o=this._dataView.getUint8(e+(this._littleEndian?i:7-i));r&&(n?0!==o&&(o=255&~(o-1),n=!1):o=255&~o),t+=o*256**i}return r&&(t=-t),t}readOffset(e){return this._bigTiff?this.readUint64(e):this.readUint32(e)}}var Z=r(25),$=r(2),X=r(18),Q=r(17),J=r.n(Q),ee=r(43),te=r.n(ee),re=r(16),ne=r.n(re);class ie{constructor(e,{blockSize:t=65536}={}){this.retrievalFunction=e,this.blockSize=t,this.blockRequests=new Map,this.blocks=new Map,this.blockIdsAwaitingRequest=null}async fetch(e,t,r=!1){const n=e+t,i=[],o=[],s=[];for(let t=Math.floor(e/this.blockSize)*this.blockSize;t<n;t+=this.blockSize){const e=Math.floor(t/this.blockSize);this.blocks.has(e)||this.blockRequests.has(e)||o.push(e),this.blockRequests.has(e)&&s.push(this.blockRequests.get(e)),i.push(e)}if(this.blockIdsAwaitingRequest)for(let e=0;e<o.length;++e){const t=o[e];this.blockIdsAwaitingRequest.add(t)}else this.blockIdsAwaitingRequest=new Set(o);if(r||await async function(e){return new Promise(t=>setTimeout(t,e))}(),this.blockIdsAwaitingRequest){const e=function(e){if(0===e.length)return[];const t=[];let r=[];t.push(r);for(let n=0;n<e.length;++n)0===n||e[n]===e[n-1]+1?r.push(e[n]):(r=[e[n]],t.push(r));return t}(Array.from(this.blockIdsAwaitingRequest).sort());for(const t of e){const e=this.requestData(t[0]*this.blockSize,t.length*this.blockSize);for(let r=0;r<t.length;++r){const n=t[r];this.blockRequests.set(n,(async()=>{const t=await e,i=r*this.blockSize,o=Math.min(i+this.blockSize,t.data.byteLength),s=t.data.slice(i,o);this.blockRequests.delete(n),this.blocks.set(n,{data:s,offset:t.offset+i,length:s.byteLength,top:t.offset+o})})())}}this.blockIdsAwaitingRequest=null}const a=[];for(const e of o)this.blockRequests.has(e)&&a.push(this.blockRequests.get(e));await Promise.all(a),await Promise.all(s);return function(e,t,r){const n=t+r,i=new ArrayBuffer(r),o=new Uint8Array(i);for(const r of e){const e=r.offset-t,i=r.top-n;let s,a=0,u=0;e<0?a=-e:e>0&&(u=e),s=i<0?r.length-a:n-r.offset-a;const c=new Uint8Array(r.data,a,s);o.set(c,u)}return i}(i.map(e=>this.blocks.get(e)),e,t)}async requestData(e,t){const r=await this.retrievalFunction(e,t);return r.length?r.length!==r.data.byteLength&&(r.data=r.data.slice(0,r.length)):r.length=r.data.byteLength,r.top=r.offset+r.length,r}}function oe(e,t){const{forceXHR:r}=t;if("function"==typeof fetch&&!r)return function(e,{headers:t={},blockSize:r}={}){return new ie(async(r,n)=>{const i=await fetch(e,{headers:{...t,Range:`bytes=${r}-${r+n-1}`}});if(i.ok){if(206===i.status){return{data:i.arrayBuffer?await i.arrayBuffer():(await i.buffer()).buffer,offset:r,length:n}}{const e=i.arrayBuffer?await i.arrayBuffer():(await i.buffer()).buffer;return{data:e,offset:0,length:e.byteLength}}}throw new Error("Error fetching data.")},{blockSize:r})}(e,t);if("undefined"!=typeof XMLHttpRequest)return function(e,{headers:t={},blockSize:r}={}){return new ie(async(r,n)=>new Promise((i,o)=>{const s=new XMLHttpRequest;s.open("GET",e),s.responseType="arraybuffer";const a={...t,Range:`bytes=${r}-${r+n-1}`};for(const[e,t]of Object.entries(a))s.setRequestHeader(e,t);s.onload=()=>{const e=s.response;206===s.status?i({data:e,offset:r,length:n}):i({data:e,offset:0,length:e.byteLength})},s.onerror=o,s.send()}),{blockSize:r})}(e,t);if(J.a.get)return function(e,{headers:t={},blockSize:r}={}){return new ie(async(r,n)=>new Promise((i,o)=>{const s=ne.a.parse(e);("http:"===s.protocol?J.a:te.a).get({...s,headers:{...t,Range:`bytes=${r}-${r+n-1}`}},e=>{const t=[];e.on("data",e=>{t.push(e)}),e.on("end",()=>{const e=$.Buffer.concat(t).buffer;i({data:e,offset:r,length:e.byteLength})})}).on("error",o)}),{blockSize:r})}(e,t);throw new Error("No remote source available")}function se(e){const t=function(e,t,r){return new Promise((n,i)=>{Object(X.open)(e,t,r,(e,t)=>{e?i(e):n(t)})})}(e,"r");return{async fetch(e,r){const n=await t,{buffer:i}=await function(...e){return new Promise((t,r)=>{Object(X.read)(...e,(e,n,i)=>{e?r(e):t({bytesRead:n,buffer:i})})})}(n,$.Buffer.alloc(r),0,r,e);return i.buffer},async close(){const e=await t;return await function(e){return new Promise((t,r)=>{Object(X.close)(e,e=>{e?r(e):t()})})}(e)}}}function ae(e,t){for(const r in t)t.hasOwnProperty(r)&&(e[r]=t[r])}function ue(e,t){if(e.length<t.length)return!1;return e.substr(e.length-t.length)===t}function ce(e){const t={};for(const r in e)if(e.hasOwnProperty(r)){t[e[r]]=r}return t}function le(e,t){const r=[];for(let n=0;n<e;n++)r.push(t(n));return r}const fe=ce(a),he=ce(g),de={};ae(de,fe),ae(de,he);const pe=ce(f),ge={nextZero:(e,t)=>{let r=t;for(;0!==e[r];)r++;return r},readUshort:(e,t)=>e[t]<<8|e[t+1],readShort:(e,t)=>{const r=ge.ui8;return r[0]=e[t+1],r[1]=e[t+0],ge.i16[0]},readInt:(e,t)=>{const r=ge.ui8;return r[0]=e[t+3],r[1]=e[t+2],r[2]=e[t+1],r[3]=e[t+0],ge.i32[0]},readUint:(e,t)=>{const r=ge.ui8;return r[0]=e[t+3],r[1]=e[t+2],r[2]=e[t+1],r[3]=e[t+0],ge.ui32[0]},readASCII:(e,t,r)=>r.map(r=>String.fromCharCode(e[t+r])).join(""),readFloat:(e,t)=>{const r=ge.ui8;return le(4,n=>{r[n]=e[t+3-n]}),ge.fl32[0]},readDouble:(e,t)=>{const r=ge.ui8;return le(8,n=>{r[n]=e[t+7-n]}),ge.fl64[0]},writeUshort:(e,t,r)=>{e[t]=r>>8&255,e[t+1]=255&r},writeUint:(e,t,r)=>{e[t]=r>>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=r>>0&255},writeASCII:(e,t,r)=>{le(r.length,n=>{e[t+n]=r.charCodeAt(n)})},ui8:new Uint8Array(8)};ge.fl64=new Float64Array(ge.ui8.buffer),ge.writeDouble=(e,t,r)=>{ge.fl64[0]=r,le(8,r=>{e[t+r]=ge.ui8[7-r]})};const me=e=>{const t=new Uint8Array(1e3);let r=4;const n=ge;t[0]=77,t[1]=77,t[3]=42;let i=8;if(n.writeUint(t,r,i),r+=4,e.forEach((r,o)=>{const s=((e,t,r,n)=>{let i=r;const o=Object.keys(n).filter(e=>null!=e&&"undefined"!==e);e.writeUshort(t,i,o.length),i+=2;let s=i+12*o.length+4;for(const r of o){let o=null;"number"==typeof r?o=r:"string"==typeof r&&(o=parseInt(r,10));const a=c[o],u=pe[a];if(null==a||void 0===a||void 0===a)throw new Error("unknown type of tag: "+o);let l=n[r];if(void 0===l)throw new Error("failed to get value for key "+r);"ASCII"===a&&"string"==typeof l&&!1===ue(l,"\0")&&(l+="\0");const f=l.length;e.writeUshort(t,i,o),i+=2,e.writeUshort(t,i,u),i+=2,e.writeUint(t,i,f),i+=4;let h=[-1,1,1,2,4,8,0,0,0,0,0,0,8][u]*f,d=i;h>4&&(e.writeUint(t,i,s),d=s),"ASCII"===a?e.writeASCII(t,d,l):"SHORT"===a?le(f,r=>{e.writeUshort(t,d+2*r,l[r])}):"LONG"===a?le(f,r=>{e.writeUint(t,d+4*r,l[r])}):"RATIONAL"===a?le(f,r=>{e.writeUint(t,d+8*r,Math.round(1e4*l[r])),e.writeUint(t,d+8*r+4,1e4)}):"DOUBLE"===a&&le(f,r=>{e.writeDouble(t,d+8*r,l[r])}),h>4&&(h+=1&h,s+=h),i+=4}return[i,s]})(n,t,i,r);i=s[1],o<e.length-1&&n.writeUint(t,s[0],i)}),t.slice)return t.slice(0,i).buffer;const o=new Uint8Array(i);for(let e=0;e<i;e++)o[e]=t[e];return o.buffer},ye=[["Compression",1],["PlanarConfiguration",1],["XPosition",0],["YPosition",0],["ResolutionUnit",1],["ExtraSamples",0],["GeoAsciiParams","WGS 84\0"],["ModelTiepoint",[0,0,0,-180,90,0]],["GTModelTypeGeoKey",2],["GTRasterTypeGeoKey",1],["GeographicTypeGeoKey",4326],["GeogCitationGeoKey","WGS 84"]];function be(e,t){let r,n,i,o;"number"==typeof e[0]?(r=t.height||t.ImageLength,i=t.width||t.ImageWidth,n=e.length/(r*i),o=e):(n=e.length,r=e[0].length,i=e[0][0].length,o=[],le(r,t=>{le(i,r=>{le(n,n=>{o.push(e[n][t][r])})})})),t.ImageLength=r,delete t.height,t.ImageWidth=i,delete t.width,t.BitsPerSample||(t.BitsPerSample=le(n,()=>8)),ye.forEach(e=>{const r=e[0];if(!t[r]){const n=e[1];t[r]=n}}),t.PhotometricInterpretation||(t.PhotometricInterpretation=3===t.BitsPerSample.length?2:1),t.SamplesPerPixel||(t.SamplesPerPixel=[n]),t.StripByteCounts||(t.StripByteCounts=[n*r*i]),t.ModelPixelScale||(t.ModelPixelScale=[360/i,180/r,0]),t.SampleFormat||(t.SampleFormat=le(n,()=>1));const s=Object.keys(t).filter(e=>ue(e,"GeoKey")).sort((e,t)=>de[e]-de[t]);if(!t.GeoKeyDirectory){const e=[1,1,0,s.length];s.forEach(r=>{const n=Number(de[r]);let i,o,s;e.push(n),"SHORT"===c[n]?(i=1,o=0,s=t[r]):"GeogCitationGeoKey"===r?(i=t.GeoAsciiParams.length,o=Number(de.GeoAsciiParams),s=0):console.log("[geotiff.js] couldn't get TIFFTagLocation for "+r),e.push(o),e.push(i),e.push(s)}),t.GeoKeyDirectory=e}for(const e in s)s.hasOwnProperty(e)&&delete t[e];["Compression","ExtraSamples","GeographicTypeGeoKey","GTModelTypeGeoKey","GTRasterTypeGeoKey","ImageLength","ImageWidth","PhotometricInterpretation","PlanarConfiguration","ResolutionUnit","SamplesPerPixel","XPosition","YPosition"].forEach(e=>{var r;t[e]&&(t[e]=(r=t[e],Array.isArray(r)?r:[r]))});const a=(e=>{const t={};for(const r in e)"StripOffsets"!==r&&(de[r]||console.error(r,"not in name2code:",Object.keys(de)),t[de[r]]=e[r]);return t})(t);return((e,t,r,n)=>{if(null==r)throw new Error("you passed into encodeImage a width of type "+r);if(null==t)throw new Error("you passed into encodeImage a width of type "+t);const i={256:[t],257:[r],273:[1e3],278:[r],305:"geotiff.js"};if(n)for(const e in n)n.hasOwnProperty(e)&&(i[e]=n[e]);const o=new Uint8Array(me([i])),s=new Uint8Array(e),a=i[277],u=new Uint8Array(1e3+t*r*a);return le(o.length,e=>{u[e]=o[e]}),function(e,t){const{length:r}=e;for(let n=0;n<r;n++)t(e[n],n)}(s,(e,t)=>{u[1e3+t]=e}),u.buffer})(o,i,r,a)}class we{log(){}info(){}warn(){}error(){}time(){}timeEnd(){}}let ve=new we;function _e(e=new we){ve=e}function ke(e){switch(e){case h.BYTE:case h.ASCII:case h.SBYTE:case h.UNDEFINED:return 1;case h.SHORT:case h.SSHORT:return 2;case h.LONG:case h.SLONG:case h.FLOAT:case h.IFD:return 4;case h.RATIONAL:case h.SRATIONAL:case h.DOUBLE:case h.LONG8:case h.SLONG8:case h.IFD8:return 8;default:throw new RangeError("Invalid field type: "+e)}}function Se(e,t,r,n){let i=null,o=null;const s=ke(t);switch(t){case h.BYTE:case h.ASCII:case h.UNDEFINED:i=new Uint8Array(r),o=e.readUint8;break;case h.SBYTE:i=new Int8Array(r),o=e.readInt8;break;case h.SHORT:i=new Uint16Array(r),o=e.readUint16;break;case h.SSHORT:i=new Int16Array(r),o=e.readInt16;break;case h.LONG:case h.IFD:i=new Uint32Array(r),o=e.readUint32;break;case h.SLONG:i=new Int32Array(r),o=e.readInt32;break;case h.LONG8:case h.IFD8:i=new Array(r),o=e.readUint64;break;case h.SLONG8:i=new Array(r),o=e.readInt64;break;case h.RATIONAL:i=new Uint32Array(2*r),o=e.readUint32;break;case h.SRATIONAL:i=new Int32Array(2*r),o=e.readInt32;break;case h.FLOAT:i=new Float32Array(r),o=e.readFloat32;break;case h.DOUBLE:i=new Float64Array(r),o=e.readFloat64;break;default:throw new RangeError("Invalid field type: "+t)}if(t!==h.RATIONAL&&t!==h.SRATIONAL)for(let t=0;t<r;++t)i[t]=o.call(e,n+t*s);else for(let t=0;t<r;t+=2)i[t]=o.call(e,n+t*s),i[t+1]=o.call(e,n+(t*s+4));return t===h.ASCII?String.fromCharCode.apply(null,i):i}class Te{constructor(e,t,r){this.fileDirectory=e,this.geoKeyDirectory=t,this.nextIFDByteOffset=r}}class Ee extends Error{constructor(e){super("No image at index "+e),this.index=e}}class xe{async readRasters(e={}){const{window:t,width:r,height:n}=e;let{resX:i,resY:o,bbox:s}=e;const a=await this.getImage();let u=a;const c=await this.getImageCount(),l=a.getBoundingBox();if(t&&s)throw new Error('Both "bbox" and "window" passed.');if(r||n){if(t){const[e,r]=a.getOrigin(),[n,i]=a.getResolution();s=[e+t[0]*n,r+t[1]*i,e+t[2]*n,r+t[3]*i]}const e=s||l;if(r){if(i)throw new Error("Both width and resX passed");i=(e[2]-e[0])/r}if(n){if(o)throw new Error("Both width and resY passed");o=(e[3]-e[1])/n}}if(i||o){const e=[];for(let t=0;t<c;++t){const r=await this.getImage(t),{SubfileType:n,NewSubfileType:i}=r.fileDirectory;(0===t||2===n||1&i)&&e.push(r)}e.sort((e,t)=>e.getWidth()-t.getWidth());for(let t=0;t<e.length;++t){const r=e[t],n=(l[2]-l[0])/r.getWidth(),s=(l[3]-l[1])/r.getHeight();if(u=r,i&&i>n||o&&o>s)break}}let f=t;if(s){const[e,t]=a.getOrigin(),[r,n]=u.getResolution(a);f=[Math.round((s[0]-e)/r),Math.round((s[1]-t)/n),Math.round((s[2]-e)/r),Math.round((s[3]-t)/n)],f=[Math.min(f[0],f[2]),Math.min(f[1],f[3]),Math.max(f[0],f[2]),Math.max(f[1],f[3])]}return u.readRasters({...e,window:f})}}class Ce extends xe{constructor(e,t,r,n,i={}){super(),this.source=e,this.littleEndian=t,this.bigTiff=r,this.firstIFDOffset=n,this.cache=i.cache||!1,this.ifdRequests=[],this.ghostValues=null}async getSlice(e,t){const r=this.bigTiff?4048:1024;return new Y(await this.source.fetch(e,void 0!==t?t:r),e,this.littleEndian,this.bigTiff)}async parseFileDirectoryAt(e){const t=this.bigTiff?20:12,r=this.bigTiff?8:2;let n=await this.getSlice(e);const i=this.bigTiff?n.readUint64(e):n.readUint16(e),o=i*t+(this.bigTiff?16:6);n.covers(e,o)||(n=await this.getSlice(e,o));const s={};let u=e+(this.bigTiff?8:2);for(let e=0;e<i;u+=t,++e){const e=n.readUint16(u),t=n.readUint16(u+2),r=this.bigTiff?n.readUint64(u+4):n.readUint32(u+4);let i,o;const c=ke(t),f=u+(this.bigTiff?12:8);if(c*r<=(this.bigTiff?8:4))i=Se(n,t,r,f);else{const e=n.readOffset(f),o=ke(t)*r;if(n.covers(e,o))i=Se(n,t,r,e);else{i=Se(await this.getSlice(e,o),t,r,e)}}o=1===r&&-1===l.indexOf(e)&&t!==h.RATIONAL&&t!==h.SRATIONAL?i[0]:i,s[a[e]]=o}const c=function(e){const t=e.GeoKeyDirectory;if(!t)return null;const r={};for(let n=4;n<=4*t[3];n+=4){const i=g[t[n]],o=t[n+1]?a[t[n+1]]:null,s=t[n+2],u=t[n+3];let c=null;if(o){if(c=e[o],null==c)throw new Error(`Could not get value of geoKey '${i}'.`);"string"==typeof c?c=c.substring(u,u+s-1):c.subarray&&(c=c.subarray(u,u+s),1===s&&(c=c[0]))}else c=u;r[i]=c}return r}(s),f=n.readOffset(e+r+t*i);return new Te(s,c,f)}async requestIFD(e){if(this.ifdRequests[e])return this.ifdRequests[e];if(0===e)return this.ifdRequests[e]=this.parseFileDirectoryAt(this.firstIFDOffset),this.ifdRequests[e];if(!this.ifdRequests[e-1])try{this.ifdRequests[e-1]=this.requestIFD(e-1)}catch(t){if(t instanceof Ee)throw new Ee(e);throw t}return this.ifdRequests[e]=(async()=>{const t=await this.ifdRequests[e-1];if(0===t.nextIFDByteOffset)throw new Ee(e);return this.parseFileDirectoryAt(t.nextIFDByteOffset)})(),this.ifdRequests[e]}async getImage(e=0){const t=await this.requestIFD(e);return new W(t.fileDirectory,t.geoKeyDirectory,this.dataView,this.littleEndian,this.cache,this.source)}async getImageCount(){let e=0,t=!0;for(;t;)try{await this.requestIFD(e),++e}catch(e){if(!(e instanceof Ee))throw e;t=!1}return e}async getGhostValues(){const e=this.bigTiff?16:8;if(this.ghostValues)return this.ghostValues;const t="GDAL_STRUCTURAL_METADATA_SIZE=",r=t.length+100;let n=await this.getSlice(e,r);if(t===Se(n,h.ASCII,t.length,e)){const t=Se(n,h.ASCII,r,e).split("\n")[0],i=Number(t.split("=")[1].split(" ")[0])+t.length;i>r&&(n=await this.getSlice(e,i));const o=Se(n,h.ASCII,i,e);this.ghostValues={},o.split("\n").filter(e=>e.length>0).map(e=>e.split("=")).forEach(([e,t])=>{this.ghostValues[e]=t})}return this.ghostValues}static async fromSource(e,t){const r=await e.fetch(0,1024),n=new V(r),i=n.getUint16(0,0);let o;if(18761===i)o=!0;else{if(19789!==i)throw new TypeError("Invalid byte order value.");o=!1}const s=n.getUint16(2,o);let a;if(42===s)a=!1;else{if(43!==s)throw new TypeError("Invalid magic number.");a=!0;if(8!==n.getUint16(4,o))throw new Error("Unsupported offset byte-size.")}const u=a?n.getUint64(8,o):n.getUint32(4,o);return new Ce(e,o,a,u,t)}close(){return"function"==typeof this.source.close&&this.source.close()}}t.default=Ce;class Ae extends xe{constructor(e,t){super(),this.mainFile=e,this.overviewFiles=t,this.imageFiles=[e].concat(t),this.fileDirectoriesPerFile=null,this.fileDirectoriesPerFileParsing=null,this.imageCount=null}async parseFileDirectoriesPerFile(){const e=[this.mainFile.parseFileDirectoryAt(this.mainFile.firstIFDOffset)].concat(this.overviewFiles.map(e=>e.parseFileDirectoryAt(e.firstIFDOffset)));return this.fileDirectoriesPerFile=await Promise.all(e),this.fileDirectoriesPerFile}async getImage(e=0){await this.getImageCount(),await this.parseFileDirectoriesPerFile();let t=0,r=0;for(let n=0;n<this.imageFiles.length;n++){const i=this.imageFiles[n];for(let o=0;o<this.imageCounts[n];o++){if(e===t){const e=await i.requestIFD(r);return new W(e.fileDirectory,i.geoKeyDirectory,i.dataView,i.littleEndian,i.cache,i.source)}t++,r++}r=0}throw new RangeError("Invalid image index")}async getImageCount(){if(null!==this.imageCount)return this.imageCount;const e=[this.mainFile.getImageCount()].concat(this.overviewFiles.map(e=>e.getImageCount()));return this.imageCounts=await Promise.all(e),this.imageCount=this.imageCounts.reduce((e,t)=>e+t,0),this.imageCount}}async function Oe(e,t={}){return Ce.fromSource(oe(e,t))}async function Re(e){return Ce.fromSource(function(e){return{fetch:async(t,r)=>e.slice(t,t+r)}}(e))}async function Ie(e){return Ce.fromSource(se(e))}async function Pe(e){return Ce.fromSource((t=e,{fetch:async(e,r)=>new Promise((n,i)=>{const o=t.slice(e,e+r),s=new FileReader;s.onload=e=>n(e.target.result),s.onerror=i,s.readAsArrayBuffer(o)})}));var t}async function Me(e,t=[],r={}){const n=await Ce.fromSource(oe(e,r)),i=await Promise.all(t.map(e=>Ce.fromSource(oe(e,r))));return new Ae(n,i)}async function De(e,t){return be(e,t)}},function(e,r){e.exports=t},function(e,t,r){"use strict";var n=r(51),i=r(14),o=r(56),s=r(57),a=r(58),u=r(59),c=r(60),l=Object.prototype.toString;function f(e){if(!(this instanceof f))return new f(e);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var r=n.inflateInit2(this.strm,t.windowBits);if(r!==s.Z_OK)throw new Error(a[r]);if(this.header=new c,n.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=o.string2buf(t.dictionary):"[object ArrayBuffer]"===l.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=n.inflateSetDictionary(this.strm,t.dictionary))!==s.Z_OK))throw new Error(a[r])}function h(e,t){var r=new f(t);if(r.push(e,!0),r.err)throw r.msg||a[r.err];return r.result}f.prototype.push=function(e,t){var r,a,u,c,f,h=this.strm,d=this.options.chunkSize,p=this.options.dictionary,g=!1;if(this.ended)return!1;a=t===~~t?t:!0===t?s.Z_FINISH:s.Z_NO_FLUSH,"string"==typeof e?h.input=o.binstring2buf(e):"[object ArrayBuffer]"===l.call(e)?h.input=new Uint8Array(e):h.input=e,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=new i.Buf8(d),h.next_out=0,h.avail_out=d),(r=n.inflate(h,s.Z_NO_FLUSH))===s.Z_NEED_DICT&&p&&(r=n.inflateSetDictionary(this.strm,p)),r===s.Z_BUF_ERROR&&!0===g&&(r=s.Z_OK,g=!1),r!==s.Z_STREAM_END&&r!==s.Z_OK)return this.onEnd(r),this.ended=!0,!1;h.next_out&&(0!==h.avail_out&&r!==s.Z_STREAM_END&&(0!==h.avail_in||a!==s.Z_FINISH&&a!==s.Z_SYNC_FLUSH)||("string"===this.options.to?(u=o.utf8border(h.output,h.next_out),c=h.next_out-u,f=o.buf2string(h.output,u),h.next_out=c,h.avail_out=d-c,c&&i.arraySet(h.output,h.output,u,c,0),this.onData(f)):this.onData(i.shrinkBuf(h.output,h.next_out)))),0===h.avail_in&&0===h.avail_out&&(g=!0)}while((h.avail_in>0||0===h.avail_out)&&r!==s.Z_STREAM_END);return r===s.Z_STREAM_END&&(a=s.Z_FINISH),a===s.Z_FINISH?(r=n.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===s.Z_OK):a!==s.Z_SYNC_FLUSH||(this.onEnd(s.Z_OK),h.avail_out=0,!0)},f.prototype.onData=function(e){this.chunks.push(e)},f.prototype.onEnd=function(e){e===s.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Inflate=f,t.inflate=h,t.inflateRaw=function(e,t){return(t=t||{}).raw=!0,h(e,t)},t.ungzip=h},function(e,t,r){"use strict";var n=r(12);class i extends n.a{constructor(){super(e=>(this._observers.add(e),()=>this._observers.delete(e))),this._observers=new Set}next(e){for(const t of this._observers)t.next(e)}error(e){for(const t of this._observers)t.error(e)}complete(){for(const e of this._observers)e.complete()}}t.a=i},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));const n=()=>{};function i(){let e,t=!1,r=n;return[new Promise(n=>{t?n(e):r=n}),n=>{t=!0,e=n,r()}]}},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(0);function i(e){return e&&"object"==typeof e&&e[n.d]}},function(e,t,r){var n=r(17),i=r(16),o=e.exports;for(var s in n)n.hasOwnProperty(s)&&(o[s]=n[s]);function a(e){if("string"==typeof e&&(e=i.parse(e)),e.protocol||(e.protocol="https:"),"https:"!==e.protocol)throw new Error('Protocol "'+e.protocol+'" not supported. Expected "https:"');return e}o.request=function(e,t){return e=a(e),n.request.call(this,e,t)},o.get=function(e,t){return e=a(e),n.get.call(this,e,t)}},function(e,t,r){"use strict";(function(t){var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=f(r(47)),s=f(r(48)),a=f(r(50)),u=r(36),c=r(37),l=f(r(83));function f(e){return e&&e.__esModule?e:{default:e}}function h(e,t){var r=t.left,n=t.top,i=t.right,o=t.bottom,s=t.width,a=t.height;return e.readRasters({window:[r,n,i,o],width:s,height:a,resampleMethod:"bilinear"}).then((function(e){return e.map((function(e){return(0,u.unflatten)(e,{height:a,width:s})}))}))}var d=function(){function e(r,i,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),o&&console.log("starting GeoRaster.constructor with",r,i),this._web_worker_is_available="undefined"!=typeof window&&"undefined"!==window.Worker,this._blob_is_available="undefined"!=typeof Blob,this._url_is_available="undefined"!=typeof URL,"object"===(void 0===r?"undefined":n(r))&&r.constructor&&"Buffer"===r.constructor.name&&!1===t.isBuffer(r)&&(r=new t(r)),"string"==typeof r?(o&&console.log("data is a url"),this._data=r,this._url=r,this.rasterType="geotiff",this.sourceType="url"):void 0!==t&&t.isBuffer(r)?(o&&console.log("data is a buffer"),this._data=r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),this.rasterType="geotiff",this.sourceType="Buffer"):r instanceof ArrayBuffer?(this._data=r,this.rasterType="geotiff",this.sourceType="ArrayBuffer"):Array.isArray(r)&&i&&(this._data=r,this.rasterType="object",this._metadata=i),o&&console.log("this after construction:",this)}return i(e,[{key:"preinitialize",value:function(e){var t=this;if(e&&console.log("starting preinitialize"),this._url){var r=this._url+".ovr";return function(e){try{return(0,o.default)(e,{method:"HEAD"}).then((function(e){return 200===e.status})).catch((function(e){return!1}))}catch(e){return Promise.resolve(!1)}}(r).then((function(n){return e&&console.log("overview exists:",n),n?(0,c.fromUrls)(t._url,[r],{cache:!0,forceXHR:!1}):(0,c.fromUrl)(t._url,{cache:!0,forceXHR:!1})}))}return Promise.resolve()}},{key:"initialize",value:function(e){var t=this;return this.preinitialize(e).then((function(r){return new Promise((function(n,i){if(e&&console.log("starting GeoRaster.initialize"),e&&console.log("this",t),"object"===t.rasterType||"geotiff"===t.rasterType||"tiff"===t.rasterType)if(t._web_worker_is_available){var o=new s.default;o.onmessage=function(i){e&&console.log("main thread received message:",i);var o=i.data;for(var s in o)t[s]=o[s];t._url&&(t._geotiff=r,t.getValues=function(e){return h(this._geotiff,e)}),t.toCanvas=function(e){return(0,l.default)(this,e)},n(t)},e&&console.log("about to postMessage"),t._data instanceof ArrayBuffer?o.postMessage({data:t._data,rasterType:t.rasterType,sourceType:t.sourceType,metadata:t._metadata},[t._data]):o.postMessage({data:t._data,rasterType:t.rasterType,sourceType:t.sourceType,metadata:t._metadata})}else e&&console.log("web worker is not available"),(0,a.default)({data:t._data,rasterType:t.rasterType,sourceType:t.sourceType,metadata:t._metadata},e).then((function(i){e&&console.log("result:",i),t._url&&(i._geotiff=r,i.getValues=function(e){return h(this._geotiff,e)}),i.toCanvas=function(e){return(0,l.default)(this,e)},n(i)})).catch(i);else i("couldn't find a way to parse")}))}))}}]),e}(),p=function(e,t,r){if(r&&console.log("starting parseGeoraster with ",e,t),void 0===e){throw Error("[Georaster.parseGeoraster] Error. You passed in undefined to parseGeoraster. We can't make a raster out of nothing!")}return new d(e,t,r).initialize(r)};void 0!==e.exports&&(e.exports=p),"undefined"!=typeof window?window.parseGeoraster=p:"undefined"!=typeof self&&(self.parseGeoraster=p)}).call(this,r(2).Buffer)},function(e,t,r){"use strict";t.byteLength=function(e){var t=c(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,n=c(e),s=n[0],a=n[1],u=new o(function(e,t,r){return 3*(t+r)/4-r}(0,s,a)),l=0,f=a>0?s-4:s;for(r=0;r<f;r+=4)t=i[e.charCodeAt(r)]<<18|i[e.charCodeAt(r+1)]<<12|i[e.charCodeAt(r+2)]<<6|i[e.charCodeAt(r+3)],u[l++]=t>>16&255,u[l++]=t>>8&255,u[l++]=255&t;2===a&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,u[l++]=255&t);1===a&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t);return u},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],s=0,a=r-i;s<a;s+=16383)o.push(l(e,s,s+16383>a?a:s+16383));1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=s.length;a<u;++a)n[a]=s[a],i[s.charCodeAt(a)]=a;function c(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e,t,r){for(var i,o,s=[],a=t;a<r;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(n[(o=i)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,c=u>>1,l=-7,f=r?i-1:0,h=r?-1:1,d=e[t+f];for(f+=h,o=d&(1<<-l)-1,d>>=-l,l+=a;l>0;o=256*o+e[t+f],f+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+e[t+f],f+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=c}return(d?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,u,c=8*o-i-1,l=(1<<c)-1,f=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(t*u-1)*Math.pow(2,i),s+=f):(a=t*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;e[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[r+d]=255&s,d+=p,s/=256,c-=8);e[r+d-p]|=128*g}},function(e,t){var r=function(e){function t(){this.fetch=!1,this.DOMException=e.DOMException}return t.prototype=e,new t}("undefined"!=typeof self?self:this);!function(e){!function(t){var r="URLSearchParams"in e,n="Symbol"in e&&"iterator"in Symbol,i="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),o="FormData"in e,s="ArrayBuffer"in e;if(s)var a=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(e){return e&&a.indexOf(Object.prototype.toString.call(e))>-1};function c(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function l(e){return"string"!=typeof e&&(e=String(e)),e}function f(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n&&(t[Symbol.iterator]=function(){return t}),t}function h(e){this.map={},e instanceof h?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function d(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function p(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function g(e){var t=new FileReader,r=p(t);return t.readAsArrayBuffer(e),r}function m(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function y(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:o&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():s&&i&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=m(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s&&(ArrayBuffer.prototype.isPrototypeOf(e)||u(e))?this._bodyArrayBuffer=m(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=d(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?d(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(g)}),this.text=function(){var e,t,r,n=d(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,r=p(t),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o&&(this.formData=function(){return this.text().then(v)}),this.json=function(){return this.text().then(JSON.parse)},this}h.prototype.append=function(e,t){e=c(e),t=l(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},h.prototype.delete=function(e){delete this.map[c(e)]},h.prototype.get=function(e){return e=c(e),this.has(e)?this.map[e]:null},h.prototype.has=function(e){return this.map.hasOwnProperty(c(e))},h.prototype.set=function(e,t){this.map[c(e)]=l(t)},h.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},h.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),f(e)},h.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),f(e)},h.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),f(e)},n&&(h.prototype[Symbol.iterator]=h.prototype.entries);var b=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function w(e,t){var r,n,i=(t=t||{}).body;if(e instanceof w){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new h(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new h(t.headers)),this.method=(r=t.method||this.method||"GET",n=r.toUpperCase(),b.indexOf(n)>-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function v(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}})),t}function _(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new h(t.headers),this.url=t.url||"",this._initBody(e)}w.prototype.clone=function(){return new w(this,{body:this._bodyInit})},y.call(w.prototype),y.call(_.prototype),_.prototype.clone=function(){return new _(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},_.error=function(){var e=new _(null,{status:0,statusText:""});return e.type="error",e};var k=[301,302,303,307,308];_.redirect=function(e,t){if(-1===k.indexOf(t))throw new RangeError("Invalid status code");return new _(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function S(e,r){return new Promise((function(n,o){var s=new w(e,r);if(s.signal&&s.signal.aborted)return o(new t.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function u(){a.abort()}a.onload=function(){var e,t,r={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new h,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();t.append(n,i)}})),t)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL");var i="response"in a?a.response:a.responseText;n(new _(i,r))},a.onerror=function(){o(new TypeError("Network request failed"))},a.ontimeout=function(){o(new TypeError("Network request failed"))},a.onabort=function(){o(new t.DOMException("Aborted","AbortError"))},a.open(s.method,s.url,!0),"include"===s.credentials?a.withCredentials=!0:"omit"===s.credentials&&(a.withCredentials=!1),"responseType"in a&&i&&(a.responseType="blob"),s.headers.forEach((function(e,t){a.setRequestHeader(t,e)})),s.signal&&(s.signal.addEventListener("abort",u),a.onreadystatechange=function(){4===a.readyState&&s.signal.removeEventListener("abort",u)}),a.send(void 0===s._bodyInit?null:s._bodyInit)}))}S.polyfill=!0,e.fetch||(e.fetch=S,e.Headers=h,e.Request=w,e.Response=_),t.Headers=h,t.Request=w,t.Response=_,t.fetch=S}({})}(r),delete r.fetch.polyfill,(t=r.fetch).default=r.fetch,t.fetch=r.fetch,t.Headers=r.Headers,t.Request=r.Request,t.Response=r.Response,e.exports=t},function(e,t,r){"use strict";e.exports=function(){return r(49)('!function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=43)}([function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return i})),r.d(t,"c",(function(){return o})),r.d(t,"d",(function(){return s})),r.d(t,"e",(function(){return a}));const n=Symbol("thread.errors"),i=Symbol("thread.events"),o=Symbol("thread.terminate"),s=Symbol("thread.transferable"),a=Symbol("thread.worker")},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){"use strict";(function(e){\n/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh <http://feross.org>\n * @license MIT\n */\nvar n=r(57),i=r(58),o=r(25);function s(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(e,t){if(s()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null===e&&(e=new u(t)),e.length=t),e}function u(e,t,r){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return f(this,e)}return c(this,e,t,r)}function c(e,t,r,n){if("number"==typeof t)throw new TypeError(\'"value" argument must not be a number\');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("\'offset\' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("\'length\' is out of bounds");t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n);u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=h(e,t);return e}(e,t,r,n):"string"==typeof t?function(e,t,r){"string"==typeof r&&""!==r||(r="utf8");if(!u.isEncoding(r))throw new TypeError(\'"encoding" must be a valid string encoding\');var n=0|p(t,r),i=(e=a(e,n)).write(t,r);i!==n&&(e=e.slice(0,i));return e}(e,t,r):function(e,t){if(u.isBuffer(t)){var r=0|d(t.length);return 0===(e=a(e,r)).length||t.copy(e,0,0,r),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?a(e,0):h(e,t);if("Buffer"===t.type&&o(t.data))return h(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function l(e){if("number"!=typeof e)throw new TypeError(\'"size" argument must be a number\');if(e<0)throw new RangeError(\'"size" argument must not be negative\')}function f(e,t){if(l(t),e=a(e,t<0?0:0|d(t)),!u.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function h(e,t){var r=t.length<0?0:0|d(t.length);e=a(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function d(e){if(e>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|e}function p(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return N(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(e).length;default:if(n)return N(e).length;t=(""+t).toLowerCase(),n=!0}}function g(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,r);case"utf8":case"utf-8":return T(this,t,r);case"ascii":return x(this,t,r);case"latin1":case"binary":return A(this,t,r);case"base64":return E(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function m(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function y(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,i);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,n,i){var o,s=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,r/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var l=-1;for(o=r;o<a;o++)if(c(e,o)===c(t,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===u)return l*s}else-1!==l&&(o-=o-l),l=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){for(var f=!0,h=0;h<u;h++)if(c(e,o+h)!==c(t,h)){f=!1;break}if(f)return o}return-1}function w(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(t.substr(2*s,2),16);if(isNaN(a))return s;e[r+s]=a}return s}function v(e,t,r,n){return q(N(t,e.length-r),e,r,n)}function _(e,t,r,n){return q(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function S(e,t,r,n){return _(e,t,r,n)}function k(e,t,r,n){return q(G(t),e,r,n)}function C(e,t,r,n){return q(function(e,t){for(var r,n,i,o=[],s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function E(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function T(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o,s,a,u,c=e[i],l=null,f=c>239?4:c>223?3:c>191?2:1;if(i+f<=r)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=e[i+1],s=e[i+2],128==(192&o)&&128==(192&s)&&(u=(15&c)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),i+=f}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=4096));return r}(n)}t.Buffer=u,t.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},t.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=s(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,r){return c(null,e,t,r)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,r){return function(e,t,r,n){return l(t),t<=0?a(e,t):void 0!==r?"string"==typeof n?a(e,t).fill(r,n):a(e,t).fill(r):a(e,t)}(null,e,t,r)},u.allocUnsafe=function(e){return f(null,e)},u.allocUnsafeSlow=function(e){return f(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!o(e))throw new TypeError(\'"list" argument must be an Array of Buffers\');if(0===e.length)return u.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=u.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var s=e[r];if(!u.isBuffer(s))throw new TypeError(\'"list" argument must be an Array of Buffers\');s.copy(n,i),i+=s.length}return n},u.byteLength=p,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)m(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?T(this,0,e):g.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,r,n,i){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),a=Math.min(o,s),c=this.slice(n,i),l=e.slice(t,r),f=0;f<a;++f)if(c[f]!==l[f]){o=c[f],s=l[f];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return y(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return y(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return v(this,e,t,r);case"ascii":return _(this,e,t,r);case"latin1":case"binary":return S(this,e,t,r);case"base64":return k(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function x(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function A(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function O(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=B(e[o]);return i}function R(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function I(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function P(e,t,r,n,i,o){if(!u.isBuffer(e))throw new TypeError(\'"buffer" argument must be a Buffer instance\');if(t>i||t<o)throw new RangeError(\'"value" argument is out of bounds\');if(r+n>e.length)throw new RangeError("Index out of range")}function M(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i<o;++i)e[r+i]=(t&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function D(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i<o;++i)e[r+i]=t>>>8*(n?i:3-i)&255}function L(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function U(e,t,r,n,o){return o||L(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function F(e,t,r,n,o){return o||L(e,0,r,8),i.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),u.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=u.prototype;else{var i=t-e;r=new u(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+e]}return r},u.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||I(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},u.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||I(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUInt8=function(e,t){return t||I(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||I(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||I(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||I(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||I(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||I(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||I(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return t||I(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||I(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){t||I(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return t||I(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||I(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||I(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||I(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||I(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||I(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||P(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||P(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):D(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):D(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);P(this,e,t,r,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o<r&&(s*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);P(this,e,t,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):D(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):D(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,r){return U(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return U(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return F(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return F(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i,o=n-r;if(this===e&&r<t&&t<n)for(i=o-1;i>=0;--i)e[i+t]=this[i+r];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+o),t);return o},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{var s=u.isBuffer(e)?e:N(new u(e,n).toString()),a=s.length;for(o=0;o<r-t;++o)this[o+t]=s[o%a]}return this};var j=/[^+\\/0-9A-Za-z-_]/g;function B(e){return e<16?"0"+e.toString(16):e.toString(16)}function N(e,t){var r;t=t||1/0;for(var n=e.length,i=null,o=[],s=0;s<n;++s){if((r=e.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function G(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\\s+|\\s+$/g,"")}(e).replace(j,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function q(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}}).call(this,r(1))},function(e,t){var r,n,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(e){if(r===setTimeout)return setTimeout(e,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(e){r=o}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(e){n=s}}();var u,c=[],l=!1,f=-1;function h(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&d())}function d(){if(!l){var e=a(h);l=!0;for(var t=c.length;t;){for(u=c,c=[];++f<t;)u&&u[f].run();f=-1,t=c.length}u=null,l=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function g(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];c.push(new p(e,t)),1!==c.length||l||a(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t,r){(function(n){t.log=function(...e){return"object"==typeof console&&console.log&&console.log(...e)},t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,i=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(n++,"%c"===e&&(i=n))}),t.splice(i,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}!e&&void 0!==n&&"env"in n&&(e=n.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.exports=r(55)(t);const{formatters:i}=e.exports;i.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}).call(this,r(3))},function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return s}));const n={deserialize:e=>Object.assign(Error(e.message),{name:e.name,stack:e.stack}),serialize:e=>({__error_marker:"$$error",message:e.message,name:e.name,stack:e.stack})};let i={deserialize(e){return(t=e)&&"object"==typeof t&&"__error_marker"in t&&"$$error"===t.__error_marker?n.deserialize(e):e;var t},serialize:e=>e instanceof Error?n.serialize(e):e};function o(e){return i.deserialize(e)}function s(e){return i.serialize(e)}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},function(e,t,r){"use strict";var n=r(15),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=f;var o=Object.create(r(10));o.inherits=r(6);var s=r(29),a=r(33);o.inherits(f,s);for(var u=i(a.prototype),c=0;c<u.length;c++){var l=u[c];f.prototype[l]||(f.prototype[l]=a.prototype[l])}function f(e){if(!(this instanceof f))return new f(e);s.call(this,e),a.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",h)}function h(){this.allowHalfOpen||this._writableState.ended||n.nextTick(d,this)}function d(e){e.end()}Object.defineProperty(f.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(f.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),f.prototype._destroy=function(e,t){this.push(null),this.end(),n.nextTick(t,e)}},function(e,t,r){"use strict";let n;function i(){return n||(n=function(){try{throw new Error}catch(e){const t=(""+e.stack).match(/(https?|file|ftp|chrome-extension|moz-extension):\\/\\/[^)\\n]+/g);if(t)return(""+t[0]).replace(/^((?:https?|file|ftp|chrome-extension|moz-extension):\\/\\/.+)?\\/[^/]+(?:\\?.*)?$/,"$1")+"/"}return"/"}()),n}r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return c}));const o="undefined"!=typeof navigator&&navigator.hardwareConcurrency?navigator.hardwareConcurrency:4,s=e=>/^(file|https?:)?\\/\\//i.test(e);function a(e){const t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}let u;function c(){return u||(u=function(){if("undefined"==typeof Worker)return class{constructor(){throw Error("No web worker implementation available. You might have tried to spawn a worker within a worker in a browser that doesn\'t support workers in workers.")}};class e extends Worker{constructor(e,t){"string"==typeof e&&t&&t._baseURL?e=new URL(e,t._baseURL):"string"==typeof e&&!s(e)&&i().match(/^file:\\/\\//i)&&(e=new URL(e,i().replace(/\\/[^\\/]+$/,"/")),e=a(`importScripts(${JSON.stringify(e)});`)),"string"==typeof e&&s(e)&&(e=a(`importScripts(${JSON.stringify(e)});`)),super(e,t)}}class t extends e{constructor(e,t){super(window.URL.createObjectURL(e),t)}static fromText(e,r){const n=new window.Blob([e],{type:"text/javascript"});return new t(n,r)}}return{blob:t,default:e}}()),u}},function(e,t,r){"use strict";var n,i;r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return i})),function(e){e.cancel="cancel",e.run="run"}(n||(n={})),function(e){e.error="error",e.init="init",e.result="result",e.running="running",e.uncaughtError="uncaughtError"}(i||(i={}))},function(e,t,r){(function(e){function r(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===r(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===r(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===r(e)},t.isError=function(e){return"[object Error]"===r(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=e.isBuffer}).call(this,r(2).Buffer)},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0);function i(e){throw Error(e)}const o={errors:e=>e[n.a]||i("Error observable not found. Make sure to pass a thread instance as returned by the spawn() promise."),events:e=>e[n.b]||i("Events observable not found. Make sure to pass a thread instance as returned by the spawn() promise."),terminate:e=>e[n.c]()}},function(e,t,r){"use strict";const n=()=>"function"==typeof Symbol,i=e=>n()&&Boolean(Symbol[e]),o=e=>i(e)?Symbol[e]:"@@"+e;i("asyncIterator")||(Symbol.asyncIterator=Symbol.asyncIterator||Symbol.for("Symbol.asyncIterator"));const s=o("iterator"),a=o("observable"),u=o("species");function c(e,t){const r=e[t];if(null!=r){if("function"!=typeof r)throw new TypeError(r+" is not a function");return r}}function l(e){let t=e.constructor;return void 0!==t&&(t=t[u],null===t&&(t=void 0)),void 0!==t?t:w}function f(e){f.log?f.log(e):setTimeout(()=>{throw e},0)}function h(e){Promise.resolve().then(()=>{try{e()}catch(e){f(e)}})}function d(e){const t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{const e=c(t,"unsubscribe");e&&e.call(t)}}catch(e){f(e)}}function p(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function g(e,t,r){e._state="running";const n=e._observer;try{const i=n?c(n,t):void 0;switch(t){case"next":i&&i.call(n,r);break;case"error":if(p(e),!i)throw r;i.call(n,r);break;case"complete":p(e),i&&i.call(n)}}catch(e){f(e)}"closed"===e._state?d(e):"running"===e._state&&(e._state="ready")}function m(e,t,r){if("closed"!==e._state)return"buffering"===e._state?(e._queue=e._queue||[],void e._queue.push({type:t,value:r})):"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:r}],void h(()=>function(e){const t=e._queue;if(t){e._queue=void 0,e._state="ready";for(const r of t)if(g(e,r.type,r.value),"closed"===e._state)break}}(e))):void g(e,t,r)}class y{constructor(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";const r=new b(this);try{this._cleanup=t.call(void 0,r)}catch(e){r.error(e)}"initializing"===this._state&&(this._state="ready")}get closed(){return"closed"===this._state}unsubscribe(){"closed"!==this._state&&(p(this),d(this))}}class b{constructor(e){this._subscription=e}get closed(){return"closed"===this._subscription._state}next(e){m(this._subscription,"next",e)}error(e){m(this._subscription,"error",e)}complete(){m(this._subscription,"complete")}}class w{constructor(e){if(!(this instanceof w))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof e)throw new TypeError("Observable initializer must be a function");this._subscriber=e}subscribe(e,t,r){return"object"==typeof e&&null!==e||(e={next:e,error:t,complete:r}),new y(e,this._subscriber)}pipe(e,...t){let r=this;for(const n of[e,...t])r=n(r);return r}tap(e,t,r){const n="object"!=typeof e||null===e?{next:e,error:t,complete:r}:e;return new w(e=>this.subscribe({next(t){n.next&&n.next(t),e.next(t)},error(t){n.error&&n.error(t),e.error(t)},complete(){n.complete&&n.complete(),e.complete()},start(e){n.start&&n.start(e)}}))}forEach(e){return new Promise((t,r)=>{if("function"!=typeof e)return void r(new TypeError(e+" is not a function"));function n(){i.unsubscribe(),t()}const i=this.subscribe({next(t){try{e(t,n)}catch(e){r(e),i.unsubscribe()}},error:r,complete:t})})}map(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(l(this))(t=>this.subscribe({next(r){let n=r;try{n=e(r)}catch(e){return t.error(e)}t.next(n)},error(e){t.error(e)},complete(){t.complete()}}))}filter(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(l(this))(t=>this.subscribe({next(r){try{if(!e(r))return}catch(e){return t.error(e)}t.next(r)},error(e){t.error(e)},complete(){t.complete()}}))}reduce(e,t){if("function"!=typeof e)throw new TypeError(e+" is not a function");const r=l(this),n=arguments.length>1;let i=!1,o=t;return new r(t=>this.subscribe({next(r){const s=!i;if(i=!0,!s||n)try{o=e(o,r)}catch(e){return t.error(e)}else o=r},error(e){t.error(e)},complete(){if(!i&&!n)return t.error(new TypeError("Cannot reduce an empty sequence"));t.next(o),t.complete()}}))}concat(...e){const t=l(this);return new t(r=>{let n,i=0;return function o(s){n=s.subscribe({next(e){r.next(e)},error(e){r.error(e)},complete(){i===e.length?(n=void 0,r.complete()):o(t.from(e[i++]))}})}(this),()=>{n&&(n.unsubscribe(),n=void 0)}})}flatMap(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");const t=l(this);return new t(r=>{const n=[],i=this.subscribe({next(i){let s;if(e)try{s=e(i)}catch(e){return r.error(e)}else s=i;const a=t.from(s).subscribe({next(e){r.next(e)},error(e){r.error(e)},complete(){const e=n.indexOf(a);e>=0&&n.splice(e,1),o()}});n.push(a)},error(e){r.error(e)},complete(){o()}});function o(){i.closed&&0===n.length&&r.complete()}return()=>{n.forEach(e=>e.unsubscribe()),i.unsubscribe()}})}[a](){return this}static from(e){const t="function"==typeof this?this:w;if(null==e)throw new TypeError(e+" is not an object");const r=c(e,a);if(r){const n=r.call(e);if(Object(n)!==n)throw new TypeError(n+" is not an object");return function(e){return e instanceof w}(n)&&n.constructor===t?n:new t(e=>n.subscribe(e))}if(i("iterator")){const r=c(e,s);if(r)return new t(t=>{h(()=>{if(!t.closed){for(const n of r.call(e))if(t.next(n),t.closed)return;t.complete()}})})}if(Array.isArray(e))return new t(t=>{h(()=>{if(!t.closed){for(const r of e)if(t.next(r),t.closed)return;t.complete()}})});throw new TypeError(e+" is not observable")}static of(...e){return new("function"==typeof this?this:w)(t=>{h(()=>{if(!t.closed){for(const r of e)if(t.next(r),t.closed)return;t.complete()}})})}static get[u](){return this}}n()&&Object.defineProperty(w,Symbol("extensions"),{value:{symbol:a,hostReportError:f},configurable:!0});t.a=w},function(e,t,r){"use strict";var n;r.d(t,"a",(function(){return n})),function(e){e.internalError="internalError",e.message="message",e.termination="termination"}(n||(n={}))},function(e,t,r){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function i(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var n in r)i(r,n)&&(e[n]=r[n])}}return e},t.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var o={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),i);else for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){var t,r,n,i,o,s;for(n=0,t=0,r=e.length;t<r;t++)n+=e[t].length;for(s=new Uint8Array(n),i=0,t=0,r=e.length;t<r;t++)o=e[t],s.set(o,i),i+=o.length;return s}},s={arraySet:function(e,t,r,n,i){for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){return[].concat.apply([],e)}};t.setTyped=function(e){e?(t.Buf8=Uint8Array,t.Buf16=Uint16Array,t.Buf32=Int32Array,t.assign(t,o)):(t.Buf8=Array,t.Buf16=Array,t.Buf32=Array,t.assign(t,s))},t.setTyped(n)},function(e,t,r){"use strict";(function(t){void 0===t||!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,r,n,i){if("function"!=typeof e)throw new TypeError(\'"callback" argument must be a function\');var o,s,a=arguments.length;switch(a){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick((function(){e.call(null,r)}));case 3:return t.nextTick((function(){e.call(null,r,n)}));case 4:return t.nextTick((function(){e.call(null,r,n,i)}));default:for(o=new Array(a-1),s=0;s<o.length;)o[s++]=arguments[s];return t.nextTick((function(){e.apply(null,o)}))}}}:e.exports=t}).call(this,r(3))},function(e,t,r){"use strict";var n=r(71),i=r(73);function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.parse=w,t.resolve=function(e,t){return w(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?w(e,!1,!0).resolveObject(t):t},t.format=function(e){i.isString(e)&&(e=w(e));return e instanceof o?e.format():o.prototype.format.call(e)},t.Url=o;var s=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,u=/^(\\/\\/?(?!\\/)[^\\?\\s]*)(\\?[^\\s]*)?$/,c=["{","}","|","\\\\","^","`"].concat(["<",">",\'"\',"`"," ","\\r","\\n","\\t"]),l=["\'"].concat(c),f=["%","/","?",";","#"].concat(l),h=["/","?","#"],d=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},b=r(74);function w(e,t,r){if(e&&i.isObject(e)&&e instanceof o)return e;var n=new o;return n.parse(e,t,r),n}o.prototype.parse=function(e,t,r){if(!i.isString(e))throw new TypeError("Parameter \'url\' must be a string, not "+typeof e);var o=e.indexOf("?"),a=-1!==o&&o<e.indexOf("#")?"?":"#",c=e.split(a);c[0]=c[0].replace(/\\\\/g,"/");var w=e=c.join(a);if(w=w.trim(),!r&&1===e.split("#").length){var v=u.exec(w);if(v)return this.path=w,this.href=w,this.pathname=v[1],v[2]?(this.search=v[2],this.query=t?b.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var _=s.exec(w);if(_){var S=(_=_[0]).toLowerCase();this.protocol=S,w=w.substr(_.length)}if(r||_||w.match(/^\\/\\/[^@\\/]+@[^@\\/]+/)){var k="//"===w.substr(0,2);!k||_&&m[_]||(w=w.substr(2),this.slashes=!0)}if(!m[_]&&(k||_&&!y[_])){for(var C,E,T=-1,x=0;x<h.length;x++){-1!==(A=w.indexOf(h[x]))&&(-1===T||A<T)&&(T=A)}-1!==(E=-1===T?w.lastIndexOf("@"):w.lastIndexOf("@",T))&&(C=w.slice(0,E),w=w.slice(E+1),this.auth=decodeURIComponent(C)),T=-1;for(x=0;x<f.length;x++){var A;-1!==(A=w.indexOf(f[x]))&&(-1===T||A<T)&&(T=A)}-1===T&&(T=w.length),this.host=w.slice(0,T),w=w.slice(T),this.parseHost(),this.hostname=this.hostname||"";var O="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!O)for(var R=this.hostname.split(/\\./),I=(x=0,R.length);x<I;x++){var P=R[x];if(P&&!P.match(d)){for(var M="",D=0,L=P.length;D<L;D++)P.charCodeAt(D)>127?M+="x":M+=P[D];if(!M.match(d)){var U=R.slice(0,x),F=R.slice(x+1),j=P.match(p);j&&(U.push(j[1]),F.unshift(j[2])),F.length&&(w="/"+F.join(".")+w),this.hostname=U.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),O||(this.hostname=n.toASCII(this.hostname));var B=this.port?":"+this.port:"",N=this.hostname||"";this.host=N+B,this.href+=this.host,O&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==w[0]&&(w="/"+w))}if(!g[S])for(x=0,I=l.length;x<I;x++){var G=l[x];if(-1!==w.indexOf(G)){var q=encodeURIComponent(G);q===G&&(q=escape(G)),w=w.split(G).join(q)}}var H=w.indexOf("#");-1!==H&&(this.hash=w.substr(H),w=w.slice(0,H));var z=w.indexOf("?");if(-1!==z?(this.search=w.substr(z),this.query=w.substr(z+1),t&&(this.query=b.parse(this.query)),w=w.slice(0,z)):t&&(this.search="",this.query={}),w&&(this.pathname=w),y[S]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){B=this.pathname||"";var K=this.search||"";this.path=B+K}return this.href=this.format(),this},o.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",n=this.hash||"",o=!1,s="";this.host?o=e+this.host:this.hostname&&(o=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&i.isObject(this.query)&&Object.keys(this.query).length&&(s=b.stringify(this.query));var a=this.search||s&&"?"+s||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||y[t])&&!1!==o?(o="//"+(o||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):o||(o=""),n&&"#"!==n.charAt(0)&&(n="#"+n),a&&"?"!==a.charAt(0)&&(a="?"+a),t+o+(r=r.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(a=a.replace("#","%23"))+n},o.prototype.resolve=function(e){return this.resolveObject(w(e,!1,!0)).format()},o.prototype.resolveObject=function(e){if(i.isString(e)){var t=new o;t.parse(e,!1,!0),e=t}for(var r=new o,n=Object.keys(this),s=0;s<n.length;s++){var a=n[s];r[a]=this[a]}if(r.hash=e.hash,""===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var u=Object.keys(e),c=0;c<u.length;c++){var l=u[c];"protocol"!==l&&(r[l]=e[l])}return y[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!y[e.protocol]){for(var f=Object.keys(e),h=0;h<f.length;h++){var d=f[h];r[d]=e[d]}return r.href=r.format(),r}if(r.protocol=e.protocol,e.host||m[e.protocol])r.pathname=e.pathname;else{for(var p=(e.pathname||"").split("/");p.length&&!(e.host=p.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==p[0]&&p.unshift(""),p.length<2&&p.unshift(""),r.pathname=p.join("/")}if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var g=r.pathname||"",b=r.search||"";r.path=g+b}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var w=r.pathname&&"/"===r.pathname.charAt(0),v=e.host||e.pathname&&"/"===e.pathname.charAt(0),_=v||w||r.host&&e.pathname,S=_,k=r.pathname&&r.pathname.split("/")||[],C=(p=e.pathname&&e.pathname.split("/")||[],r.protocol&&!y[r.protocol]);if(C&&(r.hostname="",r.port=null,r.host&&(""===k[0]?k[0]=r.host:k.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===p[0]?p[0]=e.host:p.unshift(e.host)),e.host=null),_=_&&(""===p[0]||""===k[0])),v)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,k=p;else if(p.length)k||(k=[]),k.pop(),k=k.concat(p),r.search=e.search,r.query=e.query;else if(!i.isNullOrUndefined(e.search)){if(C)r.hostname=r.host=k.shift(),(O=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=O.shift(),r.host=r.hostname=O.shift());return r.search=e.search,r.query=e.query,i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!k.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var E=k.slice(-1)[0],T=(r.host||e.host||k.length>1)&&("."===E||".."===E)||""===E,x=0,A=k.length;A>=0;A--)"."===(E=k[A])?k.splice(A,1):".."===E?(k.splice(A,1),x++):x&&(k.splice(A,1),x--);if(!_&&!S)for(;x--;x)k.unshift("..");!_||""===k[0]||k[0]&&"/"===k[0].charAt(0)||k.unshift(""),T&&"/"!==k.join("/").substr(-1)&&k.push("");var O,R=""===k[0]||k[0]&&"/"===k[0].charAt(0);C&&(r.hostname=r.host=R?"":k.length?k.shift():"",(O=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=O.shift(),r.host=r.hostname=O.shift()));return(_=_||r.host&&k.length)&&!R&&k.unshift(""),k.length?r.pathname=k.join("/"):(r.pathname=null,r.path=null),i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var e=this.host,t=a.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,r){(function(e){var n=r(59),i=r(27),o=r(69),s=r(70),a=r(16),u=t;u.request=function(t,r){t="string"==typeof t?a.parse(t):o(t);var i=-1===e.location.protocol.search(/^https?:$/)?"http:":"",s=t.protocol||i,u=t.hostname||t.host,c=t.port,l=t.path||"/";u&&-1!==u.indexOf(":")&&(u="["+u+"]"),t.url=(u?s+"//"+u:"")+(c?":"+c:"")+l,t.method=(t.method||"GET").toUpperCase(),t.headers=t.headers||{};var f=new n(t);return r&&f.on("response",r),f},u.get=function(e,t){var r=u.request(e,t);return r.end(),r},u.ClientRequest=n,u.IncomingMessage=i.IncomingMessage,u.Agent=function(){},u.Agent.defaultMaxSockets=4,u.globalAgent=new u.Agent,u.STATUS_CODES=s,u.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this,r(1))},function(e,t){},,function(e,t,r){var n=r(2),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=s),o(i,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return y}));var n=r(4),i=r.n(n),o=r(12),s=r(5),a=r(40),u=r(0),c=r(13),l=r(23),f=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};const h=i()("threads:master:messages"),d=i()("threads:master:spawn"),p=i()("threads:master:thread-utils"),g=void 0!==e&&e.env.THREADS_WORKER_INIT_TIMEOUT?Number.parseInt(e.env.THREADS_WORKER_INIT_TIMEOUT,10):1e4;function m(e,t,r,n){const i=r.filter(e=>e.type===c.a.internalError).map(e=>e.error);return Object.assign(e,{[u.a]:i,[u.b]:r,[u.c]:n,[u.e]:t})}function y(e,t){return f(this,void 0,void 0,(function*(){d("Initializing new thread");const r=(yield function(e,t,r){return f(this,void 0,void 0,(function*(){let n;const i=new Promise((e,i)=>{n=setTimeout(()=>i(Error(r)),t)}),o=yield Promise.race([e,i]);return clearTimeout(n),o}))}(function(e){return new Promise((t,r)=>{const n=i=>{var o;h("Message from worker before finishing initialization:",i.data),(o=i.data)&&"init"===o.type?(e.removeEventListener("message",n),t(i.data)):(e=>e&&"uncaughtError"===e.type)(i.data)&&(e.removeEventListener("message",n),r(Object(s.a)(i.data.error)))};e.addEventListener("message",n)})}(e),t&&t.timeout?t.timeout:g,`Timeout: Did not receive an init message from worker after ${g}ms. Make sure the worker calls expose().`)).exposed,{termination:n,terminate:i}=function(e){const[t,r]=Object(a.a)();return{terminate:()=>f(this,void 0,void 0,(function*(){p("Terminating worker"),yield e.terminate(),r()})),termination:t}}(e),u=function(e,t){return new o.a(r=>{const n=e=>{const t={type:c.a.message,data:e.data};r.next(t)},i=e=>{p("Unhandled promise rejection event in thread:",e);const t={type:c.a.internalError,error:Error(e.reason)};r.next(t)};e.addEventListener("message",n),e.addEventListener("unhandledrejection",i),t.then(()=>{const t={type:c.a.termination};e.removeEventListener("message",n),e.removeEventListener("unhandledrejection",i),r.next(t),r.complete()})})}(e,n);if("function"===r.type){return m(Object(l.a)(e),e,u,i)}if("module"===r.type){return m(Object(l.b)(e,r.methods),e,u,i)}{const e=r.type;throw Error("Worker init message states unexpected type of expose(): "+e)}}))}}).call(this,r(3))},function(e,t,r){"use strict";r.d(t,"a",(function(){return m}));var n=r(4),i=r.n(n),o=r(39),s=r(82),a=r(12);function u(e){return Promise.all(e.map(e=>{const t=e=>({status:"fulfilled",value:e}),r=e=>({status:"rejected",reason:e}),n=Promise.resolve(e);try{return n.then(t,r)}catch(e){return Promise.reject(e)}}))}var c,l=r(8);!function(e){e.initialized="initialized",e.taskCanceled="taskCanceled",e.taskCompleted="taskCompleted",e.taskFailed="taskFailed",e.taskQueued="taskQueued",e.taskQueueDrained="taskQueueDrained",e.taskStart="taskStart",e.terminated="terminated"}(c||(c={}));var f=r(11),h=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};let d=1;class p{constructor(e,t){this.eventSubject=new o.a,this.initErrors=[],this.isClosing=!1,this.nextTaskID=1,this.taskQueue=[];const r="number"==typeof t?{size:t}:t||{},{size:n=l.a}=r;this.debug=i()("threads:pool:"+(r.name||String(d++)).replace(/\\W/g," ").trim().replace(/\\s+/g,"-")),this.options=r,this.workers=function(e,t){return function(e){const t=[];for(let r=0;r<e;r++)t.push(r);return t}(t).map(()=>({init:e(),runningTasks:[]}))}(e,n),this.eventObservable=Object(s.a)(a.a.from(this.eventSubject)),Promise.all(this.workers.map(e=>e.init)).then(()=>this.eventSubject.next({type:c.initialized,size:this.workers.length}),e=>{this.debug("Error while initializing pool worker:",e),this.eventSubject.error(e),this.initErrors.push(e)})}findIdlingWorker(){const{concurrency:e=1}=this.options;return this.workers.find(t=>t.runningTasks.length<e)}runPoolTask(e,t){return h(this,void 0,void 0,(function*(){const r=this.workers.indexOf(e)+1;this.debug(`Running task #${t.id} on worker #${r}...`),this.eventSubject.next({type:c.taskStart,taskID:t.id,workerID:r});try{const n=yield t.run(yield e.init);this.debug(`Task #${t.id} completed successfully`),this.eventSubject.next({type:c.taskCompleted,returnValue:n,taskID:t.id,workerID:r})}catch(e){this.debug(`Task #${t.id} failed`),this.eventSubject.next({type:c.taskFailed,taskID:t.id,error:e,workerID:r})}}))}run(e,t){return h(this,void 0,void 0,(function*(){const r=(()=>h(this,void 0,void 0,(function*(){var n;yield(n=0,new Promise(e=>setTimeout(e,n)));try{yield this.runPoolTask(e,t)}finally{e.runningTasks=e.runningTasks.filter(e=>e!==r),this.isClosing||this.scheduleWork()}})))();e.runningTasks.push(r)}))}scheduleWork(){this.debug("Attempt de-queueing a task in order to run it...");const e=this.findIdlingWorker();if(!e)return;const t=this.taskQueue.shift();if(!t)return this.debug("Task queue is empty"),void this.eventSubject.next({type:c.taskQueueDrained});this.run(e,t)}taskCompletion(e){return new Promise((t,r)=>{const n=this.events().subscribe(i=>{i.type===c.taskCompleted&&i.taskID===e?(n.unsubscribe(),t(i.returnValue)):i.type===c.taskFailed&&i.taskID===e?(n.unsubscribe(),r(i.error)):i.type===c.terminated&&(n.unsubscribe(),r(Error("Pool has been terminated before task was run.")))})})}settled(e=!1){return h(this,void 0,void 0,(function*(){const t=()=>{return e=this.workers,t=e=>e.runningTasks,e.reduce((e,r)=>[...e,...t(r)],[]);var e,t},r=[],n=this.eventObservable.subscribe(e=>{e.type===c.taskFailed&&r.push(e.error)});return this.initErrors.length>0?Promise.reject(this.initErrors[0]):e&&0===this.taskQueue.length?(yield u(t()),r):(yield new Promise((e,t)=>{const r=this.eventObservable.subscribe({next(t){t.type===c.taskQueueDrained&&(r.unsubscribe(),e())},error:t})}),yield u(t()),n.unsubscribe(),r)}))}completed(e=!1){return h(this,void 0,void 0,(function*(){const t=this.settled(e),r=new Promise((e,r)=>{const n=this.eventObservable.subscribe({next(i){i.type===c.taskQueueDrained?(n.unsubscribe(),e(t)):i.type===c.taskFailed&&(n.unsubscribe(),r(i.error))},error:r})}),n=yield Promise.race([t,r]);if(n.length>0)throw n[0]}))}events(){return this.eventObservable}queue(e){const{maxQueuedJobs:t=1/0}=this.options;if(this.isClosing)throw Error("Cannot schedule pool tasks after terminate() has been called.");if(this.initErrors.length>0)throw this.initErrors[0];const r=this.nextTaskID++,n=this.taskCompletion(r);n.catch(e=>{this.debug(`Task #${r} errored:`,e)});const i={id:r,run:e,cancel:()=>{-1!==this.taskQueue.indexOf(i)&&(this.taskQueue=this.taskQueue.filter(e=>e!==i),this.eventSubject.next({type:c.taskCanceled,taskID:i.id}))},then:n.then.bind(n)};if(this.taskQueue.length>=t)throw Error("Maximum number of pool tasks queued. Refusing to queue another one.\\nThis usually happens for one of two reasons: We are either at peak workload right now or some tasks just won\'t finish, thus blocking the pool.");return this.debug(`Queueing task #${i.id}...`),this.taskQueue.push(i),this.eventSubject.next({type:c.taskQueued,taskID:i.id}),this.scheduleWork(),i}terminate(e){return h(this,void 0,void 0,(function*(){this.isClosing=!0,e||(yield this.completed(!0)),this.eventSubject.next({type:c.terminated,remainingQueue:[...this.taskQueue]}),this.eventSubject.complete(),yield Promise.all(this.workers.map(e=>h(this,void 0,void 0,(function*(){return f.a.terminate(yield e.init)}))))}))}}function g(e,t){return new p(e,t)}p.EventType=c,g.EventType=c;const m=g},function(e,t,r){"use strict";r.d(t,"a",(function(){return b})),r.d(t,"b",(function(){return w}));var n=r(4),i=r.n(n),o=r(12),s=r(82),a=r(5);const u=()=>{},c=e=>e,l=e=>Promise.resolve().then(e);function f(e){throw e}class h extends o.a{constructor(e){super(t=>{const r=this,n=Object.assign(Object.assign({},t),{complete(){t.complete(),r.onCompletion()},error(e){t.error(e),r.onError(e)},next(e){t.next(e),r.onNext(e)}});try{return this.initHasRun=!0,e(n)}catch(e){n.error(e)}}),this.initHasRun=!1,this.fulfillmentCallbacks=[],this.rejectionCallbacks=[],this.firstValueSet=!1,this.state="pending"}onNext(e){this.firstValueSet||(this.firstValue=e,this.firstValueSet=!0)}onError(e){this.state="rejected",this.rejection=e;for(const t of this.rejectionCallbacks)l(()=>t(e))}onCompletion(){this.state="fulfilled";for(const e of this.fulfillmentCallbacks)l(()=>e(this.firstValue))}then(e,t){const r=e||c,n=t||f;let i=!1;return new Promise((e,t)=>{const o=r=>{if(!i){i=!0;try{e(n(r))}catch(e){t(e)}}};return this.initHasRun||this.subscribe({error:o}),"fulfilled"===this.state?e(r(this.firstValue)):"rejected"===this.state?(i=!0,e(n(this.rejection))):(this.fulfillmentCallbacks.push(t=>{try{e(r(t))}catch(e){o(e)}}),void this.rejectionCallbacks.push(o))})}catch(e){return this.then(void 0,e)}finally(e){const t=e||u;return this.then(e=>(t(),e),()=>t())}static from(e){return function(e){return e&&"function"==typeof e.then}(e)?new h(t=>{e.then(e=>{t.next(e),t.complete()},e=>{t.error(e)})}):super.from(e)}}var d=r(41),p=r(9);const g=i()("threads:master:messages");let m=1;function y(e,t){return new o.a(r=>{let n;const i=o=>{var s;if(g("Message from worker:",o.data),o.data&&o.data.uid===t)if((s=o.data)&&s.type===p.b.running)n=o.data.resultType;else if((e=>e&&e.type===p.b.result)(o.data))"promise"===n?(void 0!==o.data.payload&&r.next(Object(a.a)(o.data.payload)),r.complete(),e.removeEventListener("message",i)):(o.data.payload&&r.next(Object(a.a)(o.data.payload)),o.data.complete&&(r.complete(),e.removeEventListener("message",i)));else if((e=>e&&e.type===p.b.error)(o.data)){const t=Object(a.a)(o.data.error);r.error(t),e.removeEventListener("message",i)}};return e.addEventListener("message",i),()=>{if("observable"===n||!n){const r={type:p.a.cancel,uid:t};e.postMessage(r)}e.removeEventListener("message",i)}})}function b(e,t){return(...r)=>{const n=m++,{args:i,transferables:o}=function(e){if(0===e.length)return{args:[],transferables:[]};const t=[],r=[];for(const n of e)Object(d.a)(n)?(t.push(Object(a.b)(n.send)),r.push(...n.transferables)):t.push(Object(a.b)(n));return{args:t,transferables:0===r.length?r:(n=r,Array.from(new Set(n)))};var n}(r),u={type:p.a.run,uid:n,method:t,args:i};g("Sending command to run function to worker:",u);try{e.postMessage(u,o)}catch(e){return h.from(Promise.reject(e))}return h.from(Object(s.a)(y(e,n)))}}function w(e,t){const r={};for(const n of t)r[n]=b(e,n);return r}},function(e,t,r){"use strict";(function(e){var n=r(80),i=r(22),o=r(21);const s="undefined"!=typeof navigator?navigator.hardwareConcurrency:null;t.a=class{constructor(t=s){const r=new n.a(e);this.pool=Object(i.a)(()=>Object(o.a)(r),t)}async decode(e,t){return new Promise((r,n)=>{this.pool.queue(async i=>{try{const n=await i(e,t);r(n)}catch(e){n(e)}})})}destroy(){this.pool.terminate(!0)}}}).call(this,r(54))},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t,r){(function(e){t.fetch=a(e.fetch)&&a(e.ReadableStream),t.writableStream=a(e.WritableStream),t.abortController=a(e.AbortController),t.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),t.blobConstructor=!0}catch(e){}var r;function n(){if(void 0!==r)return r;if(e.XMLHttpRequest){r=new e.XMLHttpRequest;try{r.open("GET",e.XDomainRequest?"/":"https://example.com")}catch(e){r=null}}else r=null;return r}function i(e){var t=n();if(!t)return!1;try{return t.responseType=e,t.responseType===e}catch(e){}return!1}var o=void 0!==e.ArrayBuffer,s=o&&a(e.ArrayBuffer.prototype.slice);function a(e){return"function"==typeof e}t.arraybuffer=t.fetch||o&&i("arraybuffer"),t.msstream=!t.fetch&&s&&i("ms-stream"),t.mozchunkedarraybuffer=!t.fetch&&o&&i("moz-chunked-arraybuffer"),t.overrideMimeType=t.fetch||!!n()&&a(n().overrideMimeType),t.vbArray=a(e.VBArray),r=null}).call(this,r(1))},function(e,t,r){(function(e,n,i){var o=r(26),s=r(6),a=r(28),u=t.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},c=t.IncomingMessage=function(t,r,s,u){var c=this;if(a.Readable.call(c),c._mode=s,c.headers={},c.rawHeaders=[],c.trailers={},c.rawTrailers=[],c.on("end",(function(){e.nextTick((function(){c.emit("close")}))})),"fetch"===s){if(c._fetchResponse=r,c.url=r.url,c.statusCode=r.status,c.statusMessage=r.statusText,r.headers.forEach((function(e,t){c.headers[t.toLowerCase()]=e,c.rawHeaders.push(t,e)})),o.writableStream){var l=new WritableStream({write:function(e){return new Promise((function(t,r){c._destroyed?r():c.push(new n(e))?t():c._resumeFetch=t}))},close:function(){i.clearTimeout(u),c._destroyed||c.push(null)},abort:function(e){c._destroyed||c.emit("error",e)}});try{return void r.body.pipeTo(l).catch((function(e){i.clearTimeout(u),c._destroyed||c.emit("error",e)}))}catch(e){}}var f=r.body.getReader();!function e(){f.read().then((function(t){if(!c._destroyed){if(t.done)return i.clearTimeout(u),void c.push(null);c.push(new n(t.value)),e()}})).catch((function(e){i.clearTimeout(u),c._destroyed||c.emit("error",e)}))}()}else{if(c._xhr=t,c._pos=0,c.url=t.responseURL,c.statusCode=t.status,c.statusMessage=t.statusText,t.getAllResponseHeaders().split(/\\r?\\n/).forEach((function(e){var t=e.match(/^([^:]+):\\s*(.*)/);if(t){var r=t[1].toLowerCase();"set-cookie"===r?(void 0===c.headers[r]&&(c.headers[r]=[]),c.headers[r].push(t[2])):void 0!==c.headers[r]?c.headers[r]+=", "+t[2]:c.headers[r]=t[2],c.rawHeaders.push(t[1],t[2])}})),c._charset="x-user-defined",!o.overrideMimeType){var h=c.rawHeaders["mime-type"];if(h){var d=h.match(/;\\s*charset=([^;])(;|$)/);d&&(c._charset=d[1].toLowerCase())}c._charset||(c._charset="utf-8")}}};s(c,a.Readable),c.prototype._read=function(){var e=this._resumeFetch;e&&(this._resumeFetch=null,e())},c.prototype._onXHRProgress=function(){var e=this,t=e._xhr,r=null;switch(e._mode){case"text:vbarray":if(t.readyState!==u.DONE)break;try{r=new i.VBArray(t.responseBody).toArray()}catch(e){}if(null!==r){e.push(new n(r));break}case"text":try{r=t.responseText}catch(t){e._mode="text:vbarray";break}if(r.length>e._pos){var o=r.substr(e._pos);if("x-user-defined"===e._charset){for(var s=new n(o.length),a=0;a<o.length;a++)s[a]=255&o.charCodeAt(a);e.push(s)}else e.push(o,e._charset);e._pos=r.length}break;case"arraybuffer":if(t.readyState!==u.DONE||!t.response)break;r=t.response,e.push(new n(new Uint8Array(r)));break;case"moz-chunked-arraybuffer":if(r=t.response,t.readyState!==u.LOADING||!r)break;e.push(new n(new Uint8Array(r)));break;case"ms-stream":if(r=t.response,t.readyState!==u.LOADING)break;var c=new i.MSStreamReader;c.onprogress=function(){c.result.byteLength>e._pos&&(e.push(new n(new Uint8Array(c.result.slice(e._pos)))),e._pos=c.result.byteLength)},c.onload=function(){e.push(null)},c.readAsArrayBuffer(r)}e._xhr.readyState===u.DONE&&"ms-stream"!==e._mode&&e.push(null)}}).call(this,r(3),r(2).Buffer,r(1))},function(e,t,r){(t=e.exports=r(29)).Stream=t,t.Readable=t,t.Writable=r(33),t.Duplex=r(7),t.Transform=r(35),t.PassThrough=r(67)},function(e,t,r){"use strict";(function(t,n){var i=r(15);e.exports=w;var o,s=r(25);w.ReadableState=b;r(30).EventEmitter;var a=function(e,t){return e.listeners(t).length},u=r(31),c=r(20).Buffer,l=t.Uint8Array||function(){};var f=Object.create(r(10));f.inherits=r(6);var h=r(60),d=void 0;d=h&&h.debuglog?h.debuglog("stream"):function(){};var p,g=r(61),m=r(32);f.inherits(w,u);var y=["error","close","destroy","pause","resume"];function b(e,t){e=e||{};var n=t instanceof(o=o||r(7));this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,s=e.readableHighWaterMark,a=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(s||0===s)?s:a,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new g,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(p||(p=r(34).StringDecoder),this.decoder=new p(e.encoding),this.encoding=e.encoding)}function w(e){if(o=o||r(7),!(this instanceof w))return new w(e);this._readableState=new b(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),u.call(this)}function v(e,t,r,n,i){var o,s=e._readableState;null===t?(s.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,k(e)}(e,s)):(i||(o=function(e,t){var r;n=t,c.isBuffer(n)||n instanceof l||"string"==typeof t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));var n;return r}(s,t)),o?e.emit("error",o):s.objectMode||t&&t.length>0?("string"==typeof t||s.objectMode||Object.getPrototypeOf(t)===c.prototype||(t=function(e){return c.from(e)}(t)),n?s.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):_(e,s,t,!0):s.ended?e.emit("error",new Error("stream.push() after EOF")):(s.reading=!1,s.decoder&&!r?(t=s.decoder.write(t),s.objectMode||0!==t.length?_(e,s,t,!1):E(e,s)):_(e,s,t,!1))):n||(s.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(s)}function _(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&k(e)),E(e,t)}Object.defineProperty(w.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),w.prototype.destroy=m.destroy,w.prototype._undestroy=m.undestroy,w.prototype._destroy=function(e,t){this.push(null),t(e)},w.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=c.from(e,t),t=""),r=!0),v(this,e,t,!1,r)},w.prototype.unshift=function(e){return v(this,e,null,!0,!1)},w.prototype.isPaused=function(){return!1===this._readableState.flowing},w.prototype.setEncoding=function(e){return p||(p=r(34).StringDecoder),this._readableState.decoder=new p(e),this._readableState.encoding=e,this};function S(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=8388608?e=8388608:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function k(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(d("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(C,e):C(e))}function C(e){d("emit readable"),e.emit("readable"),O(e)}function E(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(T,e,t))}function T(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(d("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}function x(e){d("readable nexttick read 0"),e.read(0)}function A(e,t){t.reading||(d("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),O(e),t.flowing&&!t.reading&&e.read(0)}function O(e){var t=e._readableState;for(d("flow",t.flowing);t.flowing&&null!==e.read(););}function R(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;e<t.head.data.length?(n=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):n=e===t.head.data.length?t.shift():r?function(e,t){var r=t.head,n=1,i=r.data;e-=i.length;for(;r=r.next;){var o=r.data,s=e>o.length?o.length:e;if(s===o.length?i+=o:i+=o.slice(0,e),0===(e-=s)){s===o.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(s));break}++n}return t.length-=n,i}(e,t):function(e,t){var r=c.allocUnsafe(e),n=t.head,i=1;n.data.copy(r),e-=n.data.length;for(;n=n.next;){var o=n.data,s=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,s),0===(e-=s)){s===o.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(s));break}++i}return t.length-=i,r}(e,t);return n}(e,t.buffer,t.decoder),r);var r}function I(e){var t=e._readableState;if(t.length>0)throw new Error(\'"endReadable()" called on non-empty stream\');t.endEmitted||(t.ended=!0,i.nextTick(P,t,e))}function P(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function M(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}w.prototype.read=function(e){d("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return d("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?I(this):k(this),null;if(0===(e=S(e,t))&&t.ended)return 0===t.length&&I(this),null;var n,i=t.needReadable;return d("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&d("length less than watermark",i=!0),t.ended||t.reading?d("reading or ended",i=!1):i&&(d("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=S(r,t))),null===(n=e>0?R(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&I(this)),null!==n&&this.emit("data",n),n},w.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},w.prototype.pipe=function(e,t){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,d("pipe count=%d opts=%j",o.pipesCount,t);var u=(!t||!1!==t.end)&&e!==n.stdout&&e!==n.stderr?l:w;function c(t,n){d("onunpipe"),t===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,d("cleanup"),e.removeListener("close",y),e.removeListener("finish",b),e.removeListener("drain",f),e.removeListener("error",m),e.removeListener("unpipe",c),r.removeListener("end",l),r.removeListener("end",w),r.removeListener("data",g),h=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||f())}function l(){d("onend"),e.end()}o.endEmitted?i.nextTick(u):r.once("end",u),e.on("unpipe",c);var f=function(e){return function(){var t=e._readableState;d("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&a(e,"data")&&(t.flowing=!0,O(e))}}(r);e.on("drain",f);var h=!1;var p=!1;function g(t){d("ondata"),p=!1,!1!==e.write(t)||p||((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==M(o.pipes,e))&&!h&&(d("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,p=!0),r.pause())}function m(t){d("onerror",t),w(),e.removeListener("error",m),0===a(e,"error")&&e.emit("error",t)}function y(){e.removeListener("finish",b),w()}function b(){d("onfinish"),e.removeListener("close",y),w()}function w(){d("unpipe"),r.unpipe(e)}return r.on("data",g),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?s(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",m),e.once("close",y),e.once("finish",b),e.emit("pipe",r),o.flowing||(d("pipe resume"),r.resume()),e},w.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,r);return this}var s=M(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},w.prototype.on=function(e,t){var r=u.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var n=this._readableState;n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&k(this):i.nextTick(x,this))}return r},w.prototype.addListener=w.prototype.on,w.prototype.resume=function(){var e=this._readableState;return e.flowing||(d("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(A,e,t))}(this,e)),this},w.prototype.pause=function(){return d("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(d("pause"),this._readableState.flowing=!1,this.emit("pause")),this},w.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(d("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){(d("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<y.length;o++)e.on(y[o],this.emit.bind(this,y[o]));return this._read=function(t){d("wrapped _read",t),n&&(n=!1,e.resume())},this},Object.defineProperty(w.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),w._fromList=R}).call(this,r(1),r(3))},function(e,t,r){"use strict";var n,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var s=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}e.exports=a,a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var u=10;function c(e){if("function"!=typeof e)throw new TypeError(\'The "listener" argument must be of type Function. Received type \'+typeof e)}function l(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function f(e,t,r,n){var i,o,s,a;if(c(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),s=o[t]),void 0===s)s=o[t]=r,++e._eventsCount;else if("function"==typeof s?s=o[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=l(e))>0&&s.length>i&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=s.length,a=u,console&&console.warn&&console.warn(a)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=h.bind(n);return i.listener=r,n.wrapFn=i,i}function p(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):m(i,i.length)}function g(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function m(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError(\'The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received \'+e+".");u=e}}),a.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError(\'The value of "n" is out of range. It must be a non-negative number. Received \'+e+".");return this._maxListeners=e,this},a.prototype.getMaxListeners=function(){return l(this)},a.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,i=this._events;if(void 0!==i)n=n&&void 0===i.error;else if(!n)return!1;if(n){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)o(u,this,t);else{var c=u.length,l=m(u,c);for(r=0;r<c;++r)o(l[r],this,t)}return!0},a.prototype.addListener=function(e,t){return f(this,e,t,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(e,t){return f(this,e,t,!0)},a.prototype.once=function(e,t){return c(t),this.on(e,d(this,e,t)),this},a.prototype.prependOnceListener=function(e,t){return c(t),this.prependListener(e,d(this,e,t)),this},a.prototype.removeListener=function(e,t){var r,n,i,o,s;if(c(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},a.prototype.listeners=function(e){return p(this,e,!0)},a.prototype.rawListeners=function(e){return p(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):g.call(e,t)},a.prototype.listenerCount=g,a.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(e,t,r){e.exports=r(30).EventEmitter},function(e,t,r){"use strict";var n=r(15);function i(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this,o=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return o||s?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||n.nextTick(i,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?(n.nextTick(i,r,e),r._writableState&&(r._writableState.errorEmitted=!0)):t&&t(e)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(e,t,r){"use strict";(function(t,n,i){var o=r(15);function s(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=b;var a,u=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?n:o.nextTick;b.WritableState=y;var c=Object.create(r(10));c.inherits=r(6);var l={deprecate:r(65)},f=r(31),h=r(20).Buffer,d=i.Uint8Array||function(){};var p,g=r(32);function m(){}function y(e,t){a=a||r(7),e=e||{};var n=t instanceof a;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,c=e.writableHighWaterMark,l=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(c||0===c)?c:l,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var f=!1===e.decodeStrings;this.decodeStrings=!f,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(o.nextTick(i,n),o.nextTick(C,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(i(n),e._writableState.errorEmitted=!0,e.emit("error",n),C(e,t))}(e,r,n,t,i);else{var s=S(r);s||r.corked||r.bufferProcessing||!r.bufferedRequest||_(e,r),n?u(v,e,r,s,i):v(e,r,s,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new s(this)}function b(e){if(a=a||r(7),!(p.call(b,this)||this instanceof a))return new b(e);this._writableState=new y(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),f.call(this)}function w(e,t,r,n,i,o,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function v(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),C(e,t)}function _(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),o=t.corkedRequestsFree;o.entry=r;for(var a=0,u=!0;r;)i[a]=r,r.isBuf||(u=!1),r=r.next,a+=1;i.allBuffers=u,w(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new s(t),t.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,l=r.encoding,f=r.callback;if(w(e,t,!1,t.objectMode?1:c.length,c,l,f),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function S(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function k(e,t){e._final((function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),C(e,t)}))}function C(e,t){var r=S(t);return r&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,o.nextTick(k,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}c.inherits(b,f),y.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(y.prototype,"buffer",{get:l.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(b,Symbol.hasInstance,{value:function(e){return!!p.call(this,e)||this===b&&(e&&e._writableState instanceof y)}})):p=function(e){return e instanceof this},b.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},b.prototype.write=function(e,t,r){var n,i=this._writableState,s=!1,a=!i.objectMode&&(n=e,h.isBuffer(n)||n instanceof d);return a&&!h.isBuffer(e)&&(e=function(e){return h.from(e)}(e)),"function"==typeof t&&(r=t,t=null),a?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=m),i.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),o.nextTick(t,r)}(this,r):(a||function(e,t,r,n){var i=!0,s=!1;return null===r?s=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(s=new TypeError("Invalid non-string/buffer chunk")),s&&(e.emit("error",s),o.nextTick(n,s),i=!1),i}(this,i,e,r))&&(i.pendingcb++,s=function(e,t,r,n,i,o){if(!r){var s=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=h.from(t,r));return t}(t,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=t.objectMode?1:n.length;t.length+=a;var u=t.length<t.highWaterMark;u||(t.needDrain=!0);if(t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else w(e,t,!1,a,n,i,o);return u}(this,i,a,e,t,r)),s},b.prototype.cork=function(){this._writableState.corked++},b.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||_(this,e))},b.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(b.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),b.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},b.prototype._writev=null,b.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(e,t,r){t.ending=!0,C(e,t),r&&(t.finished?o.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r)},Object.defineProperty(b.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),b.prototype.destroy=g.destroy,b.prototype._undestroy=g.undestroy,b.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,r(3),r(63).setImmediate,r(1))},function(e,t,r){"use strict";var n=r(66).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=c,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=l,this.end=f,t=3;break;default:return this.write=h,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function l(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}t.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},o.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},o.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=s(t[n]);if(i>=0)return i>0&&(e.lastNeed=i-1),i;if(--n<r||-2===i)return 0;if((i=s(t[n]))>=0)return i>0&&(e.lastNeed=i-2),i;if(--n<r||-2===i)return 0;if((i=s(t[n]))>=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,r){"use strict";e.exports=s;var n=r(7),i=Object.create(r(10));function o(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function s(e){if(!(this instanceof s))return new s(e);n.call(this,e),this._transformState={afterTransform:o.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",a)}function a(){var e=this;"function"==typeof this._flush?this._flush((function(t,r){u(e,t,r)})):u(this,null,null)}function u(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}i.inherits=r(6),i.inherits(s,n),s.prototype.push=function(e,t){return this._transformState.needTransform=!1,n.prototype.push.call(this,e,t)},s.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")},s.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},s.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},s.prototype._destroy=function(e,t){var r=this;n.prototype._destroy.call(this,e,(function(e){t(e),r.emit("close")}))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],n=!0,i=!1,o=void 0;try{for(var s,a=e[Symbol.iterator]();!(n=(s=a.next()).done)&&(r.push(s.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{!n&&a.return&&a.return()}finally{if(i)throw o}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.default=function(e,t){return new Promise((function(r,c){try{t&&console.log("starting parseData with",e),t&&console.log("\\tGeoTIFF:","undefined"==typeof GeoTIFF?"undefined":i(GeoTIFF));var l={},f=void 0,h=void 0;if("object"===e.rasterType)l.values=e.data,l.height=f=e.metadata.height||l.values[0].length,l.width=h=e.metadata.width||l.values[0][0].length,l.pixelHeight=e.metadata.pixelHeight,l.pixelWidth=e.metadata.pixelWidth,l.projection=e.metadata.projection,l.xmin=e.metadata.xmin,l.ymax=e.metadata.ymax,l.noDataValue=e.metadata.noDataValue,l.numberOfRasters=l.values.length,l.xmax=l.xmin+l.width*l.pixelWidth,l.ymin=l.ymax-l.height*l.pixelHeight,l._data=null,r(u(l));else if("geotiff"===e.rasterType){l._data=e.data;var d=o.fromArrayBuffer;"url"===e.sourceType&&(d=o.fromUrl),t&&console.log("data.rasterType is geotiff"),r(d(e.data).then((function(r){return t&&console.log("geotiff:",r),r.getImage().then((function(r){t&&console.log("image:",r);var i=r.fileDirectory,o=r.getGeoKeys(),c=o.GeographicTypeGeoKey,d=o.ProjectedCSTypeGeoKey;l.projection=c||d,t&&console.log("projection:",l.projection),l.height=f=r.getHeight(),t&&console.log("result.height:",l.height),l.width=h=r.getWidth(),t&&console.log("result.width:",l.width);var p=r.getResolution(),g=n(p,2),m=g[0],y=g[1];l.pixelHeight=Math.abs(y),l.pixelWidth=Math.abs(m);var b=r.getOrigin(),w=n(b,2),v=w[0],_=w[1];return l.xmin=v,l.xmax=l.xmin+h*l.pixelWidth,l.ymax=_,l.ymin=l.ymax-f*l.pixelHeight,l.noDataValue=i.GDAL_NODATA?parseFloat(i.GDAL_NODATA):null,l.numberOfRasters=i.SamplesPerPixel,i.ColorMap&&(l.palette=(0,s.getPalette)(r)),"url"!==e.sourceType?r.readRasters().then((function(e){return l.values=e.map((function(e){return(0,a.unflatten)(e,{height:f,width:h})})),u(l)})):l}))})))}}catch(e){c(e),console.error("[georaster] error parsing georaster:",e)}}))};var o=r(79),s=r(77),a=r(78);function u(e,t){var r=e.noDataValue,n=e.height,i=e.width;return new Promise((function(o,s){e.maxs=[],e.mins=[],e.ranges=[];for(var a=void 0,u=void 0,c=0;c<e.numberOfRasters;c++){var l=e.values[c];t&&console.log("[georaster] rows:",l);for(var f=0;f<n;f++)for(var h=l[f],d=0;d<i;d++){var p=h[d];p==r||isNaN(p)||(void 0===u||p<u?u=p:(void 0===a||p>a)&&(a=p))}e.maxs.push(a),e.mins.push(u),e.ranges.push(a-u)}o(e)}))}},function(e,t){function r(e,t){function n(){for(var t=[];e[a];)if(60==e.charCodeAt(a)){if(47===e.charCodeAt(a+1)){(a=e.indexOf(">",a))+1&&(a+=1);break}if(33===e.charCodeAt(a+1)){if(45==e.charCodeAt(a+2)){for(;-1!==a&&(62!==e.charCodeAt(a)||45!=e.charCodeAt(a-1)||45!=e.charCodeAt(a-2)||-1==a);)a=e.indexOf(">",a+1);-1===a&&(a=e.length)}else for(a+=2;62!==e.charCodeAt(a)&&e[a];)a++;a++;continue}var r=o();t.push(r)}else r=a,-2===(a=e.indexOf("<",a)-1)&&(a=e.length),0<(r=e.slice(r,a+1)).trim().length&&t.push(r),a++;return t}function i(){for(var t=a;-1===u.indexOf(e[a])&&e[a];)a++;return e.slice(t,a)}function o(){a++;for(var t=i(),r={},o=[];62!==e.charCodeAt(a)&&e[a];){var s=e.charCodeAt(a);if(64<s&&91>s||96<s&&123>s){var u=i();for(s=e.charCodeAt(a);s&&39!==s&&34!==s&&!(64<s&&91>s||96<s&&123>s)&&62!==s;)a++,s=e.charCodeAt(a);if(39===s||34===s){s=e[a];var l=++a;if(a=e.indexOf(s,l),s=e.slice(l,a),-1===a)return{tagName:t,attributes:r,children:o}}else s=null,a--;r[u]=s}a++}return 47!==e.charCodeAt(a-1)?"script"==t?(o=a+1,a=e.indexOf("<\\/script>",a),o=[e.slice(o,a-1)],a+=9):"style"==t?(o=a+1,a=e.indexOf("</style>",a),o=[e.slice(o,a-1)],a+=8):-1==c.indexOf(t)&&(a++,o=n()):a++,{tagName:t,attributes:r,children:o}}function s(){var r=new RegExp("\\\\s"+t.attrName+"\\\\s*=[\'\\"]"+t.attrValue+"[\'\\"]").exec(e);return r?r.index:-1}var a=(t=t||{}).pos||0,u="\\n\\t>/= ",c=t.noChildNodes||["img","br","input","meta","link"],l=null;if(void 0!==t.attrValue)for(t.attrName=t.attrName||"id",l=[];-1!==(a=s());)-1!==(a=e.lastIndexOf("<",a))&&l.push(o()),e=e.substr(a),a=0;else l=t.parseNode?o():n();return t.filter&&(l=r.filter(l,t.filter)),t.setPos&&(l.pos=a),l}r.simplify=function(e){var t={};if(!e.length)return"";if(1===e.length&&"string"==typeof e[0])return e[0];for(var n in e.forEach((function(e){if("object"==typeof e){t[e.tagName]||(t[e.tagName]=[]);var n=r.simplify(e.children||[]);t[e.tagName].push(n),e.attributes&&(n._attributes=e.attributes)}})),t)1==t[n].length&&(t[n]=t[n][0]);return t},r.filter=function(e,t){var n=[];return e.forEach((function(e){"object"==typeof e&&t(e)&&n.push(e),e.children&&(e=r.filter(e.children,t),n=n.concat(e))})),n},r.stringify=function(e){var t="";return function e(r){if(r)for(var n=0;n<r.length;n++)if("string"==typeof r[n])t+=r[n].trim();else{var i=void 0,o=r[n];for(i in t+="<"+o.tagName,o.attributes)t=null===o.attributes[i]?t+" "+i:-1===o.attributes[i].indexOf(\'"\')?t+" "+i+\'="\'+o.attributes[i].trim()+\'"\':t+" "+i+"=\'"+o.attributes[i].trim()+"\'";t+=">",e(o.children),t+="</"+o.tagName+">"}}(e),t},r.toContentString=function(e){if(Array.isArray(e)){var t="";return e.forEach((function(e){t=(t+=" "+r.toContentString(e)).trim()})),t}return"object"==typeof e?r.toContentString(e.children):" "+e},r.getElementById=function(e,t,n){return e=r(e,{attrValue:t}),n?r.simplify(e):e[0]},r.getElementsByClassName=function(e,t,n){return e=r(e,{attrName:"class",attrValue:"[a-zA-Z0-9-s ]*"+t+"[a-zA-Z0-9-s ]*"}),n?r.simplify(e):e}},function(e,t,r){"use strict";var n=r(44),i=r(14),o=r(49),s=r(50),a=r(51),u=r(52),c=r(53),l=Object.prototype.toString;function f(e){if(!(this instanceof f))return new f(e);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var r=n.inflateInit2(this.strm,t.windowBits);if(r!==s.Z_OK)throw new Error(a[r]);if(this.header=new c,n.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=o.string2buf(t.dictionary):"[object ArrayBuffer]"===l.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=n.inflateSetDictionary(this.strm,t.dictionary))!==s.Z_OK))throw new Error(a[r])}function h(e,t){var r=new f(t);if(r.push(e,!0),r.err)throw r.msg||a[r.err];return r.result}f.prototype.push=function(e,t){var r,a,u,c,f,h=this.strm,d=this.options.chunkSize,p=this.options.dictionary,g=!1;if(this.ended)return!1;a=t===~~t?t:!0===t?s.Z_FINISH:s.Z_NO_FLUSH,"string"==typeof e?h.input=o.binstring2buf(e):"[object ArrayBuffer]"===l.call(e)?h.input=new Uint8Array(e):h.input=e,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=new i.Buf8(d),h.next_out=0,h.avail_out=d),(r=n.inflate(h,s.Z_NO_FLUSH))===s.Z_NEED_DICT&&p&&(r=n.inflateSetDictionary(this.strm,p)),r===s.Z_BUF_ERROR&&!0===g&&(r=s.Z_OK,g=!1),r!==s.Z_STREAM_END&&r!==s.Z_OK)return this.onEnd(r),this.ended=!0,!1;h.next_out&&(0!==h.avail_out&&r!==s.Z_STREAM_END&&(0!==h.avail_in||a!==s.Z_FINISH&&a!==s.Z_SYNC_FLUSH)||("string"===this.options.to?(u=o.utf8border(h.output,h.next_out),c=h.next_out-u,f=o.buf2string(h.output,u),h.next_out=c,h.avail_out=d-c,c&&i.arraySet(h.output,h.output,u,c,0),this.onData(f)):this.onData(i.shrinkBuf(h.output,h.next_out)))),0===h.avail_in&&0===h.avail_out&&(g=!0)}while((h.avail_in>0||0===h.avail_out)&&r!==s.Z_STREAM_END);return r===s.Z_STREAM_END&&(a=s.Z_FINISH),a===s.Z_FINISH?(r=n.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===s.Z_OK):a!==s.Z_SYNC_FLUSH||(this.onEnd(s.Z_OK),h.avail_out=0,!0)},f.prototype.onData=function(e){this.chunks.push(e)},f.prototype.onEnd=function(e){e===s.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Inflate=f,t.inflate=h,t.inflateRaw=function(e,t){return(t=t||{}).raw=!0,h(e,t)},t.ungzip=h},function(e,t,r){"use strict";var n=r(12);class i extends n.a{constructor(){super(e=>(this._observers.add(e),()=>this._observers.delete(e))),this._observers=new Set}next(e){for(const t of this._observers)t.next(e)}error(e){for(const t of this._observers)t.error(e)}complete(){for(const e of this._observers)e.complete()}}t.a=i},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));const n=()=>{};function i(){let e,t=!1,r=n;return[new Promise(n=>{t?n(e):r=n}),n=>{t=!0,e=n,r()}]}},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(0);function i(e){return e&&"object"==typeof e&&e[n.d]}},function(e,t,r){var n=r(17),i=r(16),o=e.exports;for(var s in n)n.hasOwnProperty(s)&&(o[s]=n[s]);function a(e){if("string"==typeof e&&(e=i.parse(e)),e.protocol||(e.protocol="https:"),"https:"!==e.protocol)throw new Error(\'Protocol "\'+e.protocol+\'" not supported. Expected "https:"\');return e}o.request=function(e,t){return e=a(e),n.request.call(this,e,t)},o.get=function(e,t){return e=a(e),n.get.call(this,e,t)}},function(e,t,r){"use strict";r.r(t);var n=r(36),i=r.n(n);self;onmessage=e=>{const t=e.data;i()(t).then(e=>{e._data instanceof ArrayBuffer?postMessage(e,[e._data]):postMessage(e),close()})}},function(e,t,r){"use strict";var n=r(14),i=r(45),o=r(46),s=r(47),a=r(48);function u(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function c(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function l(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new n.Buf32(852),t.distcode=t.distdyn=new n.Buf32(592),t.sane=1,t.back=-1,0):-2}function f(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,l(e)):-2}function h(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?-2:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,f(e))):-2}function d(e,t){var r,n;return e?(n=new c,e.state=n,n.window=null,0!==(r=h(e,t))&&(e.state=null),r):-2}var p,g,m=!0;function y(e){if(m){var t;for(p=new n.Buf32(512),g=new n.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(a(1,e.lens,0,288,p,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;a(2,e.lens,0,32,g,0,e.work,{bits:5}),m=!1}e.lencode=p,e.lenbits=9,e.distcode=g,e.distbits=5}function b(e,t,r,i){var o,s=e.state;return null===s.window&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new n.Buf8(s.wsize)),i>=s.wsize?(n.arraySet(s.window,t,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):((o=s.wsize-s.wnext)>i&&(o=i),n.arraySet(s.window,t,r-i,o,s.wnext),(i-=o)?(n.arraySet(s.window,t,r-i,i,0),s.wnext=i,s.whave=s.wsize):(s.wnext+=o,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=o))),0}t.inflateReset=f,t.inflateReset2=h,t.inflateResetKeep=l,t.inflateInit=function(e){return d(e,15)},t.inflateInit2=d,t.inflate=function(e,t){var r,c,l,f,h,d,p,g,m,w,v,_,S,k,C,E,T,x,A,O,R,I,P,M,D=0,L=new n.Buf8(4),U=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return-2;12===(r=e.state).mode&&(r.mode=13),h=e.next_out,l=e.output,p=e.avail_out,f=e.next_in,c=e.input,d=e.avail_in,g=r.hold,m=r.bits,w=d,v=p,I=0;e:for(;;)switch(r.mode){case 1:if(0===r.wrap){r.mode=13;break}for(;m<16;){if(0===d)break e;d--,g+=c[f++]<<m,m+=8}if(2&r.wrap&&35615===g){r.check=0,L[0]=255&g,L[1]=g>>>8&255,r.check=o(r.check,L,2,0),g=0,m=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&g)<<8)+(g>>8))%31){e.msg="incorrect header check",r.mode=30;break}if(8!=(15&g)){e.msg="unknown compression method",r.mode=30;break}if(m-=4,R=8+(15&(g>>>=4)),0===r.wbits)r.wbits=R;else if(R>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<<R,e.adler=r.check=1,r.mode=512&g?10:12,g=0,m=0;break;case 2:for(;m<16;){if(0===d)break e;d--,g+=c[f++]<<m,m+=8}if(r.flags=g,8!=(255&r.flags)){e.msg="unknown compression method",r.mode=30;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=30;break}r.head&&(r.head.text=g>>8&1),512&r.flags&&(L[0]=255&g,L[1]=g>>>8&255,r.check=o(r.check,L,2,0)),g=0,m=0,r.mode=3;case 3:for(;m<32;){if(0===d)break e;d--,g+=c[f++]<<m,m+=8}r.head&&(r.head.time=g),512&r.flags&&(L[0]=255&g,L[1]=g>>>8&255,L[2]=g>>>16&255,L[3]=g>>>24&255,r.check=o(r.check,L,4,0)),g=0,m=0,r.mode=4;case 4:for(;m<16;){if(0===d)break e;d--,g+=c[f++]<<m,m+=8}r.head&&(r.head.xflags=255&g,r.head.os=g>>8),512&r.flags&&(L[0]=255&g,L[1]=g>>>8&255,r.check=o(r.check,L,2,0)),g=0,m=0,r.mode=5;case 5:if(1024&r.flags){for(;m<16;){if(0===d)break e;d--,g+=c[f++]<<m,m+=8}r.length=g,r.head&&(r.head.extra_len=g),512&r.flags&&(L[0]=255&g,L[1]=g>>>8&255,r.check=o(r.check,L,2,0)),g=0,m=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((_=r.length)>d&&(_=d),_&&(r.head&&(R=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,c,f,_,R)),512&r.flags&&(r.check=o(r.check,c,_,f)),d-=_,f+=_,r.length-=_),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===d)break e;_=0;do{R=c[f+_++],r.head&&R&&r.length<65536&&(r.head.name+=String.fromCharCode(R))}while(R&&_<d);if(512&r.flags&&(r.check=o(r.check,c,_,f)),d-=_,f+=_,R)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===d)break e;_=0;do{R=c[f+_++],r.head&&R&&r.length<65536&&(r.head.comment+=String.fromCharCode(R))}while(R&&_<d);if(512&r.flags&&(r.check=o(r.check,c,_,f)),d-=_,f+=_,R)break e}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;m<16;){if(0===d)break e;d--,g+=c[f++]<<m,m+=8}if(g!==(65535&r.check)){e.msg="header crc mismatch",r.mode=30;break}g=0,m=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;m<32;){if(0===d)break e;d--,g+=c[f++]<<m,m+=8}e.adler=r.check=u(g),g=0,m=0,r.mode=11;case 11:if(0===r.havedict)return e.next_out=h,e.avail_out=p,e.next_in=f,e.avail_in=d,r.hold=g,r.bits=m,2;e.adler=r.check=1,r.mode=12;case 12:if(5===t||6===t)break e;case 13:if(r.last){g>>>=7&m,m-=7&m,r.mode=27;break}for(;m<3;){if(0===d)break e;d--,g+=c[f++]<<m,m+=8}switch(r.last=1&g,m-=1,3&(g>>>=1)){case 0:r.mode=14;break;case 1:if(y(r),r.mode=20,6===t){g>>>=2,m-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30}g>>>=2,m-=2;break;case 14:for(g>>>=7&m,m-=7&m;m<32;){if(0===d)break e;d--,g+=c[f++]<<m,m+=8}if((65535&g)!=(g>>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&g,g=0,m=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(_=r.length){if(_>d&&(_=d),_>p&&(_=p),0===_)break e;n.arraySet(l,c,f,_,h),d-=_,f+=_,p-=_,h+=_,r.length-=_;break}r.mode=12;break;case 17:for(;m<14;){if(0===d)break e;d--,g+=c[f++]<<m,m+=8}if(r.nlen=257+(31&g),g>>>=5,m-=5,r.ndist=1+(31&g),g>>>=5,m-=5,r.ncode=4+(15&g),g>>>=4,m-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=30;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;m<3;){if(0===d)break e;d--,g+=c[f++]<<m,m+=8}r.lens[U[r.have++]]=7&g,g>>>=3,m-=3}for(;r.have<19;)r.lens[U[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,P={bits:r.lenbits},I=a(0,r.lens,0,19,r.lencode,0,r.work,P),r.lenbits=P.bits,I){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;E=(D=r.lencode[g&(1<<r.lenbits)-1])>>>16&255,T=65535&D,!((C=D>>>24)<=m);){if(0===d)break e;d--,g+=c[f++]<<m,m+=8}if(T<16)g>>>=C,m-=C,r.lens[r.have++]=T;else{if(16===T){for(M=C+2;m<M;){if(0===d)break e;d--,g+=c[f++]<<m,m+=8}if(g>>>=C,m-=C,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}R=r.lens[r.have-1],_=3+(3&g),g>>>=2,m-=2}else if(17===T){for(M=C+3;m<M;){if(0===d)break e;d--,g+=c[f++]<<m,m+=8}m-=C,R=0,_=3+(7&(g>>>=C)),g>>>=3,m-=3}else{for(M=C+7;m<M;){if(0===d)break e;d--,g+=c[f++]<<m,m+=8}m-=C,R=0,_=11+(127&(g>>>=C)),g>>>=7,m-=7}if(r.have+_>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;_--;)r.lens[r.have++]=R}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,P={bits:r.lenbits},I=a(1,r.lens,0,r.nlen,r.lencode,0,r.work,P),r.lenbits=P.bits,I){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,P={bits:r.distbits},I=a(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,P),r.distbits=P.bits,I){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(d>=6&&p>=258){e.next_out=h,e.avail_out=p,e.next_in=f,e.avail_in=d,r.hold=g,r.bits=m,s(e,v),h=e.next_out,l=e.output,p=e.avail_out,f=e.next_in,c=e.input,d=e.avail_in,g=r.hold,m=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;E=(D=r.lencode[g&(1<<r.lenbits)-1])>>>16&255,T=65535&D,!((C=D>>>24)<=m);){if(0===d)break e;d--,g+=c[f++]<<m,m+=8}if(E&&0==(240&E)){for(x=C,A=E,O=T;E=(D=r.lencode[O+((g&(1<<x+A)-1)>>x)])>>>16&255,T=65535&D,!(x+(C=D>>>24)<=m);){if(0===d)break e;d--,g+=c[f++]<<m,m+=8}g>>>=x,m-=x,r.back+=x}if(g>>>=C,m-=C,r.back+=C,r.length=T,0===E){r.mode=26;break}if(32&E){r.back=-1,r.mode=12;break}if(64&E){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&E,r.mode=22;case 22:if(r.extra){for(M=r.extra;m<M;){if(0===d)break e;d--,g+=c[f++]<<m,m+=8}r.length+=g&(1<<r.extra)-1,g>>>=r.extra,m-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;E=(D=r.distcode[g&(1<<r.distbits)-1])>>>16&255,T=65535&D,!((C=D>>>24)<=m);){if(0===d)break e;d--,g+=c[f++]<<m,m+=8}if(0==(240&E)){for(x=C,A=E,O=T;E=(D=r.distcode[O+((g&(1<<x+A)-1)>>x)])>>>16&255,T=65535&D,!(x+(C=D>>>24)<=m);){if(0===d)break e;d--,g+=c[f++]<<m,m+=8}g>>>=x,m-=x,r.back+=x}if(g>>>=C,m-=C,r.back+=C,64&E){e.msg="invalid distance code",r.mode=30;break}r.offset=T,r.extra=15&E,r.mode=24;case 24:if(r.extra){for(M=r.extra;m<M;){if(0===d)break e;d--,g+=c[f++]<<m,m+=8}r.offset+=g&(1<<r.extra)-1,g>>>=r.extra,m-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===p)break e;if(_=v-p,r.offset>_){if((_=r.offset-_)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}_>r.wnext?(_-=r.wnext,S=r.wsize-_):S=r.wnext-_,_>r.length&&(_=r.length),k=r.window}else k=l,S=h-r.offset,_=r.length;_>p&&(_=p),p-=_,r.length-=_;do{l[h++]=k[S++]}while(--_);0===r.length&&(r.mode=21);break;case 26:if(0===p)break e;l[h++]=r.length,p--,r.mode=21;break;case 27:if(r.wrap){for(;m<32;){if(0===d)break e;d--,g|=c[f++]<<m,m+=8}if(v-=p,e.total_out+=v,r.total+=v,v&&(e.adler=r.check=r.flags?o(r.check,l,v,h-v):i(r.check,l,v,h-v)),v=p,(r.flags?g:u(g))!==r.check){e.msg="incorrect data check",r.mode=30;break}g=0,m=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;m<32;){if(0===d)break e;d--,g+=c[f++]<<m,m+=8}if(g!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=30;break}g=0,m=0}r.mode=29;case 29:I=1;break e;case 30:I=-3;break e;case 31:return-4;case 32:default:return-2}return e.next_out=h,e.avail_out=p,e.next_in=f,e.avail_in=d,r.hold=g,r.bits=m,(r.wsize||v!==e.avail_out&&r.mode<30&&(r.mode<27||4!==t))&&b(e,e.output,e.next_out,v-e.avail_out)?(r.mode=31,-4):(w-=e.avail_in,v-=e.avail_out,e.total_in+=w,e.total_out+=v,r.total+=v,r.wrap&&v&&(e.adler=r.check=r.flags?o(r.check,l,v,e.next_out-v):i(r.check,l,v,e.next_out-v)),e.data_type=r.bits+(r.last?64:0)+(12===r.mode?128:0)+(20===r.mode||15===r.mode?256:0),(0===w&&0===v||4===t)&&0===I&&(I=-5),I)},t.inflateEnd=function(e){if(!e||!e.state)return-2;var t=e.state;return t.window&&(t.window=null),e.state=null,0},t.inflateGetHeader=function(e,t){var r;return e&&e.state?0==(2&(r=e.state).wrap)?-2:(r.head=t,t.done=!1,0):-2},t.inflateSetDictionary=function(e,t){var r,n=t.length;return e&&e.state?0!==(r=e.state).wrap&&11!==r.mode?-2:11===r.mode&&i(1,t,n,0)!==r.check?-3:b(e,t,n,n)?(r.mode=31,-4):(r.havedict=1,0):-2},t.inflateInfo="pako inflate (from Nodeca project)"},function(e,t,r){"use strict";e.exports=function(e,t,r,n){for(var i=65535&e|0,o=e>>>16&65535|0,s=0;0!==r;){r-=s=r>2e3?2e3:r;do{o=o+(i=i+t[n++]|0)|0}while(--s);i%=65521,o%=65521}return i|o<<16|0}},function(e,t,r){"use strict";var n=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();e.exports=function(e,t,r,i){var o=n,s=i+r;e^=-1;for(var a=i;a<s;a++)e=e>>>8^o[255&(e^t[a])];return-1^e}},function(e,t,r){"use strict";e.exports=function(e,t){var r,n,i,o,s,a,u,c,l,f,h,d,p,g,m,y,b,w,v,_,S,k,C,E,T;r=e.state,n=e.next_in,E=e.input,i=n+(e.avail_in-5),o=e.next_out,T=e.output,s=o-(t-e.avail_out),a=o+(e.avail_out-257),u=r.dmax,c=r.wsize,l=r.whave,f=r.wnext,h=r.window,d=r.hold,p=r.bits,g=r.lencode,m=r.distcode,y=(1<<r.lenbits)-1,b=(1<<r.distbits)-1;e:do{p<15&&(d+=E[n++]<<p,p+=8,d+=E[n++]<<p,p+=8),w=g[d&y];t:for(;;){if(d>>>=v=w>>>24,p-=v,0===(v=w>>>16&255))T[o++]=65535&w;else{if(!(16&v)){if(0==(64&v)){w=g[(65535&w)+(d&(1<<v)-1)];continue t}if(32&v){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}_=65535&w,(v&=15)&&(p<v&&(d+=E[n++]<<p,p+=8),_+=d&(1<<v)-1,d>>>=v,p-=v),p<15&&(d+=E[n++]<<p,p+=8,d+=E[n++]<<p,p+=8),w=m[d&b];r:for(;;){if(d>>>=v=w>>>24,p-=v,!(16&(v=w>>>16&255))){if(0==(64&v)){w=m[(65535&w)+(d&(1<<v)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(S=65535&w,p<(v&=15)&&(d+=E[n++]<<p,(p+=8)<v&&(d+=E[n++]<<p,p+=8)),(S+=d&(1<<v)-1)>u){e.msg="invalid distance too far back",r.mode=30;break e}if(d>>>=v,p-=v,S>(v=o-s)){if((v=S-v)>l&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(k=0,C=h,0===f){if(k+=c-v,v<_){_-=v;do{T[o++]=h[k++]}while(--v);k=o-S,C=T}}else if(f<v){if(k+=c+f-v,(v-=f)<_){_-=v;do{T[o++]=h[k++]}while(--v);if(k=0,f<_){_-=v=f;do{T[o++]=h[k++]}while(--v);k=o-S,C=T}}}else if(k+=f-v,v<_){_-=v;do{T[o++]=h[k++]}while(--v);k=o-S,C=T}for(;_>2;)T[o++]=C[k++],T[o++]=C[k++],T[o++]=C[k++],_-=3;_&&(T[o++]=C[k++],_>1&&(T[o++]=C[k++]))}else{k=o-S;do{T[o++]=T[k++],T[o++]=T[k++],T[o++]=T[k++],_-=3}while(_>2);_&&(T[o++]=T[k++],_>1&&(T[o++]=T[k++]))}break}}break}}while(n<i&&o<a);n-=_=p>>3,d&=(1<<(p-=_<<3))-1,e.next_in=n,e.next_out=o,e.avail_in=n<i?i-n+5:5-(n-i),e.avail_out=o<a?a-o+257:257-(o-a),r.hold=d,r.bits=p}},function(e,t,r){"use strict";var n=r(14),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],s=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],a=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(e,t,r,u,c,l,f,h){var d,p,g,m,y,b,w,v,_,S=h.bits,k=0,C=0,E=0,T=0,x=0,A=0,O=0,R=0,I=0,P=0,M=null,D=0,L=new n.Buf16(16),U=new n.Buf16(16),F=null,j=0;for(k=0;k<=15;k++)L[k]=0;for(C=0;C<u;C++)L[t[r+C]]++;for(x=S,T=15;T>=1&&0===L[T];T--);if(x>T&&(x=T),0===T)return c[l++]=20971520,c[l++]=20971520,h.bits=1,0;for(E=1;E<T&&0===L[E];E++);for(x<E&&(x=E),R=1,k=1;k<=15;k++)if(R<<=1,(R-=L[k])<0)return-1;if(R>0&&(0===e||1!==T))return-1;for(U[1]=0,k=1;k<15;k++)U[k+1]=U[k]+L[k];for(C=0;C<u;C++)0!==t[r+C]&&(f[U[t[r+C]]++]=C);if(0===e?(M=F=f,b=19):1===e?(M=i,D-=257,F=o,j-=257,b=256):(M=s,F=a,b=-1),P=0,C=0,k=E,y=l,A=x,O=0,g=-1,m=(I=1<<x)-1,1===e&&I>852||2===e&&I>592)return 1;for(;;){w=k-O,f[C]<b?(v=0,_=f[C]):f[C]>b?(v=F[j+f[C]],_=M[D+f[C]]):(v=96,_=0),d=1<<k-O,E=p=1<<A;do{c[y+(P>>O)+(p-=d)]=w<<24|v<<16|_|0}while(0!==p);for(d=1<<k-1;P&d;)d>>=1;if(0!==d?(P&=d-1,P+=d):P=0,C++,0==--L[k]){if(k===T)break;k=t[r+f[C]]}if(k>x&&(P&m)!==g){for(0===O&&(O=x),y+=E,R=1<<(A=k-O);A+O<T&&!((R-=L[A+O])<=0);)A++,R<<=1;if(I+=1<<A,1===e&&I>852||2===e&&I>592)return 1;c[g=P&m]=x<<24|A<<16|y-l|0}}return 0!==P&&(c[y+P]=k-O<<24|64<<16|0),h.bits=x,0}},function(e,t,r){"use strict";var n=r(14),i=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(e){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){o=!1}for(var s=new n.Buf8(256),a=0;a<256;a++)s[a]=a>=252?6:a>=248?5:a>=240?4:a>=224?3:a>=192?2:1;function u(e,t){if(t<65534&&(e.subarray&&o||!e.subarray&&i))return String.fromCharCode.apply(null,n.shrinkBuf(e,t));for(var r="",s=0;s<t;s++)r+=String.fromCharCode(e[s]);return r}s[254]=s[254]=1,t.string2buf=function(e){var t,r,i,o,s,a=e.length,u=0;for(o=0;o<a;o++)55296==(64512&(r=e.charCodeAt(o)))&&o+1<a&&56320==(64512&(i=e.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(i-56320),o++),u+=r<128?1:r<2048?2:r<65536?3:4;for(t=new n.Buf8(u),s=0,o=0;s<u;o++)55296==(64512&(r=e.charCodeAt(o)))&&o+1<a&&56320==(64512&(i=e.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(i-56320),o++),r<128?t[s++]=r:r<2048?(t[s++]=192|r>>>6,t[s++]=128|63&r):r<65536?(t[s++]=224|r>>>12,t[s++]=128|r>>>6&63,t[s++]=128|63&r):(t[s++]=240|r>>>18,t[s++]=128|r>>>12&63,t[s++]=128|r>>>6&63,t[s++]=128|63&r);return t},t.buf2binstring=function(e){return u(e,e.length)},t.binstring2buf=function(e){for(var t=new n.Buf8(e.length),r=0,i=t.length;r<i;r++)t[r]=e.charCodeAt(r);return t},t.buf2string=function(e,t){var r,n,i,o,a=t||e.length,c=new Array(2*a);for(n=0,r=0;r<a;)if((i=e[r++])<128)c[n++]=i;else if((o=s[i])>4)c[n++]=65533,r+=o-1;else{for(i&=2===o?31:3===o?15:7;o>1&&r<a;)i=i<<6|63&e[r++],o--;o>1?c[n++]=65533:i<65536?c[n++]=i:(i-=65536,c[n++]=55296|i>>10&1023,c[n++]=56320|1023&i)}return u(c,n)},t.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+s[e[r]]>t?r:t}},function(e,t,r){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},function(e,t,r){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},function(e,t,r){"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},function(e,t,r){"use strict";e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},function(e,t,r){e.exports=r.p+"0.8a1ffd3a2c74f606cfd5.worker.worker.js"},function(e,t,r){e.exports=function(e){function t(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return n.colors[Math.abs(t)%n.colors.length]}function n(e){let r;function s(...e){if(!s.enabled)return;const t=s,i=Number(new Date),o=i-(r||i);t.diff=o,t.prev=r,t.curr=i,r=i,e[0]=n.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(r,i)=>{if("%%"===r)return r;a++;const o=n.formatters[i];if("function"==typeof o){const n=e[a];r=o.call(t,n),e.splice(a,1),a--}return r}),n.formatArgs.call(t,e);(t.log||n.log).apply(t,e)}return s.namespace=e,s.enabled=n.enabled(e),s.useColors=n.useColors(),s.color=t(e),s.destroy=i,s.extend=o,"function"==typeof n.init&&n.init(s),n.instances.push(s),s}function i(){const e=n.instances.indexOf(this);return-1!==e&&(n.instances.splice(e,1),!0)}function o(e,t){const r=n(this.namespace+(void 0===t?":":t)+e);return r.log=this.log,r}function s(e){return e.toString().substring(2,e.toString().length-2).replace(/\\.\\*\\?$/,"*")}return n.debug=n,n.default=n,n.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},n.disable=function(){const e=[...n.names.map(s),...n.skips.map(s).map(e=>"-"+e)].join(",");return n.enable(""),e},n.enable=function(e){let t;n.save(e),n.names=[],n.skips=[];const r=("string"==typeof e?e:"").split(/[\\s,]+/),i=r.length;for(t=0;t<i;t++)r[t]&&("-"===(e=r[t].replace(/\\*/g,".*?"))[0]?n.skips.push(new RegExp("^"+e.substr(1)+"$")):n.names.push(new RegExp("^"+e+"$")));for(t=0;t<n.instances.length;t++){const e=n.instances[t];e.enabled=n.enabled(e.namespace)}},n.enabled=function(e){if("*"===e[e.length-1])return!0;let t,r;for(t=0,r=n.skips.length;t<r;t++)if(n.skips[t].test(e))return!1;for(t=0,r=n.names.length;t<r;t++)if(n.names[t].test(e))return!0;return!1},n.humanize=r(56),Object.keys(e).forEach(t=>{n[t]=e[t]}),n.instances=[],n.names=[],n.skips=[],n.formatters={},n.selectColor=t,n.enable(n.load()),n}},function(e,t){var r=1e3,n=6e4,i=60*n,o=24*i;function s(e,t,r,n){var i=t>=1.5*r;return Math.round(e/r)+" "+n+(i?"s":"")}e.exports=function(e,t){t=t||{};var a=typeof e;if("string"===a&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var s=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return 6048e5*s;case"days":case"day":case"d":return s*o;case"hours":case"hour":case"hrs":case"hr":case"h":return s*i;case"minutes":case"minute":case"mins":case"min":case"m":return s*n;case"seconds":case"second":case"secs":case"sec":case"s":return s*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}(e);if("number"===a&&isFinite(e))return t.long?function(e){var t=Math.abs(e);if(t>=o)return s(e,t,o,"day");if(t>=i)return s(e,t,i,"hour");if(t>=n)return s(e,t,n,"minute");if(t>=r)return s(e,t,r,"second");return e+" ms"}(e):function(e){var t=Math.abs(e);if(t>=o)return Math.round(e/o)+"d";if(t>=i)return Math.round(e/i)+"h";if(t>=n)return Math.round(e/n)+"m";if(t>=r)return Math.round(e/r)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t,r){"use strict";t.byteLength=function(e){var t=c(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,n=c(e),s=n[0],a=n[1],u=new o(function(e,t,r){return 3*(t+r)/4-r}(0,s,a)),l=0,f=a>0?s-4:s;for(r=0;r<f;r+=4)t=i[e.charCodeAt(r)]<<18|i[e.charCodeAt(r+1)]<<12|i[e.charCodeAt(r+2)]<<6|i[e.charCodeAt(r+3)],u[l++]=t>>16&255,u[l++]=t>>8&255,u[l++]=255&t;2===a&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,u[l++]=255&t);1===a&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t);return u},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],s=0,a=r-i;s<a;s+=16383)o.push(l(e,s,s+16383>a?a:s+16383));1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=s.length;a<u;++a)n[a]=s[a],i[s.charCodeAt(a)]=a;function c(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e,t,r){for(var i,o,s=[],a=t;a<r;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(n[(o=i)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,c=u>>1,l=-7,f=r?i-1:0,h=r?-1:1,d=e[t+f];for(f+=h,o=d&(1<<-l)-1,d>>=-l,l+=a;l>0;o=256*o+e[t+f],f+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+e[t+f],f+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=c}return(d?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,u,c=8*o-i-1,l=(1<<c)-1,f=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(t*u-1)*Math.pow(2,i),s+=f):(a=t*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;e[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[r+d]=255&s,d+=p,s/=256,c-=8);e[r+d-p]|=128*g}},function(e,t,r){(function(t,n,i){var o=r(26),s=r(6),a=r(27),u=r(28),c=r(68),l=a.IncomingMessage,f=a.readyStates;var h=e.exports=function(e){var r,n=this;u.Writable.call(n),n._opts=e,n._body=[],n._headers={},e.auth&&n.setHeader("Authorization","Basic "+new t(e.auth).toString("base64")),Object.keys(e.headers).forEach((function(t){n.setHeader(t,e.headers[t])}));var i=!0;if("disable-fetch"===e.mode||"requestTimeout"in e&&!o.abortController)i=!1,r=!0;else if("prefer-streaming"===e.mode)r=!1;else if("allow-wrong-content-type"===e.mode)r=!o.overrideMimeType;else{if(e.mode&&"default"!==e.mode&&"prefer-fast"!==e.mode)throw new Error("Invalid value for opts.mode");r=!0}n._mode=function(e,t){return o.fetch&&t?"fetch":o.mozchunkedarraybuffer?"moz-chunked-arraybuffer":o.msstream?"ms-stream":o.arraybuffer&&e?"arraybuffer":o.vbArray&&e?"text:vbarray":"text"}(r,i),n._fetchTimer=null,n.on("finish",(function(){n._onFinish()}))};s(h,u.Writable),h.prototype.setHeader=function(e,t){var r=e.toLowerCase();-1===d.indexOf(r)&&(this._headers[r]={name:e,value:t})},h.prototype.getHeader=function(e){var t=this._headers[e.toLowerCase()];return t?t.value:null},h.prototype.removeHeader=function(e){delete this._headers[e.toLowerCase()]},h.prototype._onFinish=function(){var e=this;if(!e._destroyed){var r=e._opts,s=e._headers,a=null;"GET"!==r.method&&"HEAD"!==r.method&&(a=o.arraybuffer?c(t.concat(e._body)):o.blobConstructor?new n.Blob(e._body.map((function(e){return c(e)})),{type:(s["content-type"]||{}).value||""}):t.concat(e._body).toString());var u=[];if(Object.keys(s).forEach((function(e){var t=s[e].name,r=s[e].value;Array.isArray(r)?r.forEach((function(e){u.push([t,e])})):u.push([t,r])})),"fetch"===e._mode){var l=null;if(o.abortController){var h=new AbortController;l=h.signal,e._fetchAbortController=h,"requestTimeout"in r&&0!==r.requestTimeout&&(e._fetchTimer=n.setTimeout((function(){e.emit("requestTimeout"),e._fetchAbortController&&e._fetchAbortController.abort()}),r.requestTimeout))}n.fetch(e._opts.url,{method:e._opts.method,headers:u,body:a||void 0,mode:"cors",credentials:r.withCredentials?"include":"same-origin",signal:l}).then((function(t){e._fetchResponse=t,e._connect()}),(function(t){n.clearTimeout(e._fetchTimer),e._destroyed||e.emit("error",t)}))}else{var d=e._xhr=new n.XMLHttpRequest;try{d.open(e._opts.method,e._opts.url,!0)}catch(t){return void i.nextTick((function(){e.emit("error",t)}))}"responseType"in d&&(d.responseType=e._mode.split(":")[0]),"withCredentials"in d&&(d.withCredentials=!!r.withCredentials),"text"===e._mode&&"overrideMimeType"in d&&d.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in r&&(d.timeout=r.requestTimeout,d.ontimeout=function(){e.emit("requestTimeout")}),u.forEach((function(e){d.setRequestHeader(e[0],e[1])})),e._response=null,d.onreadystatechange=function(){switch(d.readyState){case f.LOADING:case f.DONE:e._onXHRProgress()}},"moz-chunked-arraybuffer"===e._mode&&(d.onprogress=function(){e._onXHRProgress()}),d.onerror=function(){e._destroyed||e.emit("error",new Error("XHR error"))};try{d.send(a)}catch(t){return void i.nextTick((function(){e.emit("error",t)}))}}}},h.prototype._onXHRProgress=function(){(function(e){try{var t=e.status;return null!==t&&0!==t}catch(e){return!1}})(this._xhr)&&!this._destroyed&&(this._response||this._connect(),this._response._onXHRProgress())},h.prototype._connect=function(){var e=this;e._destroyed||(e._response=new l(e._xhr,e._fetchResponse,e._mode,e._fetchTimer),e._response.on("error",(function(t){e.emit("error",t)})),e.emit("response",e._response))},h.prototype._write=function(e,t,r){this._body.push(e),r()},h.prototype.abort=h.prototype.destroy=function(){this._destroyed=!0,n.clearTimeout(this._fetchTimer),this._response&&(this._response._destroyed=!0),this._xhr?this._xhr.abort():this._fetchAbortController&&this._fetchAbortController.abort()},h.prototype.end=function(e,t,r){"function"==typeof e&&(r=e,e=void 0),u.Writable.prototype.end.call(this,e,t,r)},h.prototype.flushHeaders=function(){},h.prototype.setTimeout=function(){},h.prototype.setNoDelay=function(){},h.prototype.setSocketKeepAlive=function(){};var d=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]}).call(this,r(2).Buffer,r(1),r(3))},function(e,t){},function(e,t,r){"use strict";var n=r(20).Buffer,i=r(62);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var t,r,i,o=n.allocUnsafe(e>>>0),s=this.head,a=0;s;)t=s.data,r=o,i=a,t.copy(r,i),a+=s.data.length,s=s.next;return o},e}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,r){(function(e){var n=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new o(i.call(setTimeout,n,arguments),clearTimeout)},t.setInterval=function(){return new o(i.call(setInterval,n,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(n,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r(64),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,r(1))},function(e,t,r){(function(e,t){!function(e,r){"use strict";if(!e.setImmediate){var n,i,o,s,a,u=1,c={},l=!1,f=e.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(e);h=h&&h.setTimeout?h:e,"[object process]"==={}.toString.call(e.process)?n=function(e){t.nextTick((function(){p(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){p(e.data)},n=function(e){o.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(i=f.documentElement,n=function(e){var t=f.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):n=function(e){setTimeout(p,0,e)}:(s="setImmediate$"+Math.random()+"$",a=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(s)&&p(+t.data.slice(s.length))},e.addEventListener?e.addEventListener("message",a,!1):e.attachEvent("onmessage",a),n=function(t){e.postMessage(s+t,"*")}),h.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r<t.length;r++)t[r]=arguments[r+1];var i={callback:e,args:t};return c[u]=i,n(u),u++},h.clearImmediate=d}function d(e){delete c[e]}function p(e){if(l)setTimeout(p,0,e);else{var t=c[e];if(t){l=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(void 0,r)}}(t)}finally{d(e),l=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,r(1),r(3))},function(e,t,r){(function(t){function r(e){try{if(!t.localStorage)return!1}catch(e){return!1}var r=t.localStorage[e];return null!=r&&"true"===String(r).toLowerCase()}e.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}}).call(this,r(1))},function(e,t,r){\n/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */\nvar n=r(2),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},function(e,t,r){"use strict";e.exports=o;var n=r(35),i=Object.create(r(10));function o(e){if(!(this instanceof o))return new o(e);n.call(this,e)}i.inherits=r(6),i.inherits(o,n),o.prototype._transform=function(e,t,r){r(null,e)}},function(e,t,r){var n=r(2).Buffer;e.exports=function(e){if(e instanceof Uint8Array){if(0===e.byteOffset&&e.byteLength===e.buffer.byteLength)return e.buffer;if("function"==typeof e.buffer.slice)return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}if(n.isBuffer(e)){for(var t=new Uint8Array(e.length),r=e.length,i=0;i<r;i++)t[i]=e[i];return t.buffer}throw new Error("Argument must be a Buffer")}},function(e,t){e.exports=function(){for(var e={},t=0;t<arguments.length;t++){var n=arguments[t];for(var i in n)r.call(n,i)&&(e[i]=n[i])}return e};var r=Object.prototype.hasOwnProperty},function(e,t){e.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I\'m a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},function(e,t,r){(function(e,n){var i;/*! https://mths.be/punycode v1.4.1 by @mathias */!function(o){t&&t.nodeType,e&&e.nodeType;var s="object"==typeof n&&n;s.global!==s&&s.window!==s&&s.self;var a,u=2147483647,c=/^xn--/,l=/[^\\x20-\\x7E]/,f=/[\\x2E\\u3002\\uFF0E\\uFF61]/g,h={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=Math.floor,p=String.fromCharCode;function g(e){throw new RangeError(h[e])}function m(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function y(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+m((e=e.replace(f,".")).split("."),t).join(".")}function b(e){for(var t,r,n=[],i=0,o=e.length;i<o;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<o?56320==(64512&(r=e.charCodeAt(i++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),i--):n.push(t);return n}function w(e){return m(e,(function(e){var t="";return e>65535&&(t+=p((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=p(e)})).join("")}function v(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function _(e,t,r){var n=0;for(e=r?d(e/700):e>>1,e+=d(e/t);e>455;n+=36)e=d(e/35);return d(n+36*e/(e+38))}function S(e){var t,r,n,i,o,s,a,c,l,f,h,p=[],m=e.length,y=0,b=128,v=72;for((r=e.lastIndexOf("-"))<0&&(r=0),n=0;n<r;++n)e.charCodeAt(n)>=128&&g("not-basic"),p.push(e.charCodeAt(n));for(i=r>0?r+1:0;i<m;){for(o=y,s=1,a=36;i>=m&&g("invalid-input"),((c=(h=e.charCodeAt(i++))-48<10?h-22:h-65<26?h-65:h-97<26?h-97:36)>=36||c>d((u-y)/s))&&g("overflow"),y+=c*s,!(c<(l=a<=v?1:a>=v+26?26:a-v));a+=36)s>d(u/(f=36-l))&&g("overflow"),s*=f;v=_(y-o,t=p.length+1,0==o),d(y/t)>u-b&&g("overflow"),b+=d(y/t),y%=t,p.splice(y++,0,b)}return w(p)}function k(e){var t,r,n,i,o,s,a,c,l,f,h,m,y,w,S,k=[];for(m=(e=b(e)).length,t=128,r=0,o=72,s=0;s<m;++s)(h=e[s])<128&&k.push(p(h));for(n=i=k.length,i&&k.push("-");n<m;){for(a=u,s=0;s<m;++s)(h=e[s])>=t&&h<a&&(a=h);for(a-t>d((u-r)/(y=n+1))&&g("overflow"),r+=(a-t)*y,t=a,s=0;s<m;++s)if((h=e[s])<t&&++r>u&&g("overflow"),h==t){for(c=r,l=36;!(c<(f=l<=o?1:l>=o+26?26:l-o));l+=36)S=c-f,w=36-f,k.push(p(v(f+S%w,0))),c=d(S/w);k.push(p(v(c,0))),o=_(r,y,n==i),r=0,++n}++r,++t}return k.join("")}a={version:"1.4.1",ucs2:{decode:b,encode:w},decode:S,encode:k,toASCII:function(e){return y(e,(function(e){return l.test(e)?"xn--"+k(e):e}))},toUnicode:function(e){return y(e,(function(e){return c.test(e)?S(e.slice(4).toLowerCase()):e}))}},void 0===(i=function(){return a}.call(t,r,t,e))||(e.exports=i)}()}).call(this,r(72)(e),r(1))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t,r){"use strict";t.decode=t.parse=r(75),t.encode=t.stringify=r(76)},function(e,t,r){"use strict";function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,r,o){t=t||"&",r=r||"=";var s={};if("string"!=typeof e||0===e.length)return s;var a=/\\+/g;e=e.split(t);var u=1e3;o&&"number"==typeof o.maxKeys&&(u=o.maxKeys);var c=e.length;u>0&&c>u&&(c=u);for(var l=0;l<c;++l){var f,h,d,p,g=e[l].replace(a,"%20"),m=g.indexOf(r);m>=0?(f=g.substr(0,m),h=g.substr(m+1)):(f=g,h=""),d=decodeURIComponent(f),p=decodeURIComponent(h),n(s,d)?i(s[d])?s[d].push(p):s[d]=[s[d],p]:s[d]=p}return s};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,r){"use strict";var n=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,r,a){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?o(s(e),(function(s){var a=encodeURIComponent(n(s))+r;return i(e[s])?o(e[s],(function(e){return a+encodeURIComponent(n(e))})).join(t):a+encodeURIComponent(n(e[s]))})).join(t):a?encodeURIComponent(n(a))+r+encodeURIComponent(n(e)):""};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function o(e,t){if(e.map)return e.map(t);for(var r=[],n=0;n<e.length;n++)r.push(t(e[n],n));return r}var s=Object.keys||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t}},function(e,t){e.exports={getPalette:(e,{debug:t=!1}={debug:!1})=>{t&&console.log("starting getPalette with image",e);const{fileDirectory:r}=e,{BitsPerSample:n,ColorMap:i,ImageLength:o,ImageWidth:s,PhotometricInterpretation:a,SampleFormat:u,SamplesPerPixel:c}=r;if(!i)throw new Error("[geotiff-palette]: the image does not contain a color map, so we can\'t make a palette.");const l=Math.pow(2,n);t&&console.log("[geotiff-palette]: count:",l);const f=i.length/3;if(t&&console.log("[geotiff-palette]: bandSize:",f),f!==l)throw new Error("[geotiff-palette]: can\'t handle situations where the color map has more or less values than the number of possible values in a raster");const h=f,d=h+f,p=[];for(let e=0;e<l;e++)p.push([Math.floor(i[e]/256),Math.floor(i[h+e]/256),Math.floor(i[d+e]/256),255]);return t&&console.log("[geotiff-palette]: result is ",p),p}}},function(e,t,r){"use strict";e.exports={countIn1D:function(e){return e.reduce((function(e,t){return void 0===e[t]?e[t]=1:e[t]++,e}),{})},countIn2D:function(e){return e.reduce((function(e,t){return t.forEach((function(t){void 0===e[t]?e[t]=1:e[t]++})),e}),{})},unflatten:function(e,t){for(var r=t.height,n=t.width,i=[],o=0;o<r;o++){var s=o*n,a=s+n;i.push(e.slice(s,a))}return i}}},function(e,t,r){"use strict";r.r(t),r.d(t,"globals",(function(){return n})),r.d(t,"rgb",(function(){return i})),r.d(t,"getDecoder",(function(){return B})),r.d(t,"setLogger",(function(){return _e})),r.d(t,"GeoTIFF",(function(){return xe})),r.d(t,"MultiGeoTIFF",(function(){return Ae})),r.d(t,"fromUrl",(function(){return Oe})),r.d(t,"fromArrayBuffer",(function(){return Re})),r.d(t,"fromFile",(function(){return Ie})),r.d(t,"fromBlob",(function(){return Pe})),r.d(t,"fromUrls",(function(){return Me})),r.d(t,"writeArrayBuffer",(function(){return De})),r.d(t,"Pool",(function(){return Z.a}));var n={};r.r(n),r.d(n,"fieldTagNames",(function(){return a})),r.d(n,"fieldTags",(function(){return u})),r.d(n,"fieldTagTypes",(function(){return c})),r.d(n,"arrayFields",(function(){return l})),r.d(n,"fieldTypeNames",(function(){return f})),r.d(n,"fieldTypes",(function(){return h})),r.d(n,"photometricInterpretations",(function(){return d})),r.d(n,"ExtraSamplesValues",(function(){return p})),r.d(n,"geoKeyNames",(function(){return g})),r.d(n,"geoKeys",(function(){return m}));var i={};r.r(i),r.d(i,"fromWhiteIsZero",(function(){return y})),r.d(i,"fromBlackIsZero",(function(){return b})),r.d(i,"fromPalette",(function(){return w})),r.d(i,"fromCMYK",(function(){return v})),r.d(i,"fromYCbCr",(function(){return _})),r.d(i,"fromCIELab",(function(){return S}));var o=r(37),s=r.n(o);const a={315:"Artist",258:"BitsPerSample",265:"CellLength",264:"CellWidth",320:"ColorMap",259:"Compression",33432:"Copyright",306:"DateTime",338:"ExtraSamples",266:"FillOrder",289:"FreeByteCounts",288:"FreeOffsets",291:"GrayResponseCurve",290:"GrayResponseUnit",316:"HostComputer",270:"ImageDescription",257:"ImageLength",256:"ImageWidth",271:"Make",281:"MaxSampleValue",280:"MinSampleValue",272:"Model",254:"NewSubfileType",274:"Orientation",262:"PhotometricInterpretation",284:"PlanarConfiguration",296:"ResolutionUnit",278:"RowsPerStrip",277:"SamplesPerPixel",305:"Software",279:"StripByteCounts",273:"StripOffsets",255:"SubfileType",263:"Threshholding",282:"XResolution",283:"YResolution",326:"BadFaxLines",327:"CleanFaxData",343:"ClipPath",328:"ConsecutiveBadFaxLines",433:"Decode",434:"DefaultImageColor",269:"DocumentName",336:"DotRange",321:"HalftoneHints",346:"Indexed",347:"JPEGTables",285:"PageName",297:"PageNumber",317:"Predictor",319:"PrimaryChromaticities",532:"ReferenceBlackWhite",339:"SampleFormat",340:"SMinSampleValue",341:"SMaxSampleValue",559:"StripRowCounts",330:"SubIFDs",292:"T4Options",293:"T6Options",325:"TileByteCounts",323:"TileLength",324:"TileOffsets",322:"TileWidth",301:"TransferFunction",318:"WhitePoint",344:"XClipPathUnits",286:"XPosition",529:"YCbCrCoefficients",531:"YCbCrPositioning",530:"YCbCrSubSampling",345:"YClipPathUnits",287:"YPosition",37378:"ApertureValue",40961:"ColorSpace",36868:"DateTimeDigitized",36867:"DateTimeOriginal",34665:"Exif IFD",36864:"ExifVersion",33434:"ExposureTime",41728:"FileSource",37385:"Flash",40960:"FlashpixVersion",33437:"FNumber",42016:"ImageUniqueID",37384:"LightSource",37500:"MakerNote",37377:"ShutterSpeedValue",37510:"UserComment",33723:"IPTC",34675:"ICC Profile",700:"XMP",42112:"GDAL_METADATA",42113:"GDAL_NODATA",34377:"Photoshop",33550:"ModelPixelScale",33922:"ModelTiepoint",34264:"ModelTransformation",34735:"GeoKeyDirectory",34736:"GeoDoubleParams",34737:"GeoAsciiParams"},u={};for(const e in a)a.hasOwnProperty(e)&&(u[a[e]]=parseInt(e,10));const c={256:"SHORT",257:"SHORT",258:"SHORT",259:"SHORT",262:"SHORT",273:"LONG",274:"SHORT",277:"SHORT",278:"LONG",279:"LONG",282:"RATIONAL",283:"RATIONAL",284:"SHORT",286:"SHORT",287:"RATIONAL",296:"SHORT",305:"ASCII",306:"ASCII",338:"SHORT",339:"SHORT",513:"LONG",514:"LONG",1024:"SHORT",1025:"SHORT",2048:"SHORT",2049:"ASCII",33550:"DOUBLE",33922:"DOUBLE",34665:"LONG",34735:"SHORT",34737:"ASCII",42113:"ASCII"},l=[u.BitsPerSample,u.ExtraSamples,u.SampleFormat,u.StripByteCounts,u.StripOffsets,u.StripRowCounts,u.TileByteCounts,u.TileOffsets],f={1:"BYTE",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",6:"SBYTE",7:"UNDEFINED",8:"SSHORT",9:"SLONG",10:"SRATIONAL",11:"FLOAT",12:"DOUBLE",13:"IFD",16:"LONG8",17:"SLONG8",18:"IFD8"},h={};for(const e in f)f.hasOwnProperty(e)&&(h[f[e]]=parseInt(e,10));const d={WhiteIsZero:0,BlackIsZero:1,RGB:2,Palette:3,TransparencyMask:4,CMYK:5,YCbCr:6,CIELab:8,ICCLab:9},p={Unspecified:0,Assocalpha:1,Unassalpha:2},g={1024:"GTModelTypeGeoKey",1025:"GTRasterTypeGeoKey",1026:"GTCitationGeoKey",2048:"GeographicTypeGeoKey",2049:"GeogCitationGeoKey",2050:"GeogGeodeticDatumGeoKey",2051:"GeogPrimeMeridianGeoKey",2052:"GeogLinearUnitsGeoKey",2053:"GeogLinearUnitSizeGeoKey",2054:"GeogAngularUnitsGeoKey",2055:"GeogAngularUnitSizeGeoKey",2056:"GeogEllipsoidGeoKey",2057:"GeogSemiMajorAxisGeoKey",2058:"GeogSemiMinorAxisGeoKey",2059:"GeogInvFlatteningGeoKey",2060:"GeogAzimuthUnitsGeoKey",2061:"GeogPrimeMeridianLongGeoKey",2062:"GeogTOWGS84GeoKey",3072:"ProjectedCSTypeGeoKey",3073:"PCSCitationGeoKey",3074:"ProjectionGeoKey",3075:"ProjCoordTransGeoKey",3076:"ProjLinearUnitsGeoKey",3077:"ProjLinearUnitSizeGeoKey",3078:"ProjStdParallel1GeoKey",3079:"ProjStdParallel2GeoKey",3080:"ProjNatOriginLongGeoKey",3081:"ProjNatOriginLatGeoKey",3082:"ProjFalseEastingGeoKey",3083:"ProjFalseNorthingGeoKey",3084:"ProjFalseOriginLongGeoKey",3085:"ProjFalseOriginLatGeoKey",3086:"ProjFalseOriginEastingGeoKey",3087:"ProjFalseOriginNorthingGeoKey",3088:"ProjCenterLongGeoKey",3089:"ProjCenterLatGeoKey",3090:"ProjCenterEastingGeoKey",3091:"ProjCenterNorthingGeoKey",3092:"ProjScaleAtNatOriginGeoKey",3093:"ProjScaleAtCenterGeoKey",3094:"ProjAzimuthAngleGeoKey",3095:"ProjStraightVertPoleLongGeoKey",3096:"ProjRectifiedGridAngleGeoKey",4096:"VerticalCSTypeGeoKey",4097:"VerticalCitationGeoKey",4098:"VerticalDatumGeoKey",4099:"VerticalUnitsGeoKey"},m={};for(const e in g)g.hasOwnProperty(e)&&(m[g[e]]=parseInt(e,10));function y(e,t){const{width:r,height:n}=e,i=new Uint8Array(r*n*3);let o;for(let r=0,n=0;r<e.length;++r,n+=3)o=256-e[r]/t*256,i[n]=o,i[n+1]=o,i[n+2]=o;return i}function b(e,t){const{width:r,height:n}=e,i=new Uint8Array(r*n*3);let o;for(let r=0,n=0;r<e.length;++r,n+=3)o=e[r]/t*256,i[n]=o,i[n+1]=o,i[n+2]=o;return i}function w(e,t){const{width:r,height:n}=e,i=new Uint8Array(r*n*3),o=t.length/3,s=t.length/3*2;for(let r=0,n=0;r<e.length;++r,n+=3){const a=e[r];i[n]=t[a]/65536*256,i[n+1]=t[a+o]/65536*256,i[n+2]=t[a+s]/65536*256}return i}function v(e){const{width:t,height:r}=e,n=new Uint8Array(t*r*3);for(let t=0,r=0;t<e.length;t+=4,r+=3){const i=e[t],o=e[t+1],s=e[t+2],a=e[t+3];n[r]=(255-i)/256*255*((255-a)/256),n[r+1]=(255-o)/256*255*((255-a)/256),n[r+2]=(255-s)/256*255*((255-a)/256)}return n}function _(e){const{width:t,height:r}=e,n=new Uint8ClampedArray(t*r*3);for(let t=0,r=0;t<e.length;t+=3,r+=3){const i=e[t],o=e[t+1],s=e[t+2];n[r]=i+1.402*(s-128),n[r+1]=i-.34414*(o-128)-.71414*(s-128),n[r+2]=i+1.772*(o-128)}return n}function S(e){const{width:t,height:r}=e,n=new Uint8Array(t*r*3);for(let t=0,r=0;t<e.length;t+=3,r+=3){let i,o,s,a=(e[t+0]+16)/116,u=(e[t+1]<<24>>24)/500+a,c=a-(e[t+2]<<24>>24)/200;u=.95047*(u*u*u>.008856?u*u*u:(u-16/116)/7.787),a=1*(a*a*a>.008856?a*a*a:(a-16/116)/7.787),c=1.08883*(c*c*c>.008856?c*c*c:(c-16/116)/7.787),i=3.2406*u+-1.5372*a+-.4986*c,o=-.9689*u+1.8758*a+.0415*c,s=.0557*u+-.204*a+1.057*c,i=i>.0031308?1.055*i**(1/2.4)-.055:12.92*i,o=o>.0031308?1.055*o**(1/2.4)-.055:12.92*o,s=s>.0031308?1.055*s**(1/2.4)-.055:12.92*s,n[r]=255*Math.max(0,Math.min(1,i)),n[r+1]=255*Math.max(0,Math.min(1,o)),n[r+2]=255*Math.max(0,Math.min(1,s))}return n}function k(e,t){let r=e.length-t,n=0;do{for(let r=t;r>0;r--)e[n+t]+=e[n],n++;r-=t}while(r>0)}function C(e,t,r){let n=0,i=e.length;const o=i/r;for(;i>t;){for(let r=t;r>0;--r)e[n+t]+=e[n],++n;i-=t}const s=e.slice();for(let t=0;t<o;++t)for(let n=0;n<r;++n)e[r*t+n]=s[(r-n-1)*o+t]}class E{decode(e,t){const r=this.decodeBlock(t),n=e.Predictor||1;if(1!==n){const t=!e.StripOffsets;return function(e,t,r,n,i,o){if(!t||1===t)return e;for(let e=0;e<i.length;++e){if(i[e]%8!=0)throw new Error("When decoding with predictor, only multiple of 8 bits are supported.");if(i[e]!==i[0])throw new Error("When decoding with predictor, all samples must have the same size.")}const s=i[0]/8,a=2===o?1:i.length;for(let o=0;o<n&&!(o*a*r*s>=e.byteLength);++o){let n;if(2===t){switch(i[0]){case 8:n=new Uint8Array(e,o*a*r*s,a*r*s);break;case 16:n=new Uint16Array(e,o*a*r*s,a*r*s/2);break;case 32:n=new Uint32Array(e,o*a*r*s,a*r*s/4);break;default:throw new Error(`Predictor 2 not allowed with ${i[0]} bits per sample.`)}k(n,a)}else 3===t&&(n=new Uint8Array(e,o*a*r*s,a*r*s),C(n,a,s))}return e}(r,n,t?e.TileWidth:e.ImageWidth,t?e.TileLength:e.RowsPerStrip||e.ImageLength,e.BitsPerSample,e.PlanarConfiguration)}return r}}class T extends E{decodeBlock(e){return e}}function x(e,t){for(let r=t.length-1;r>=0;r--)e.push(t[r]);return e}function A(e){const t=new Uint16Array(4093),r=new Uint8Array(4093);for(let e=0;e<=257;e++)t[e]=4096,r[e]=e;let n=258,i=9,o=0;function s(){n=258,i=9}function a(e){const t=function(e,t,r){const n=t%8,i=Math.floor(t/8),o=8-n,s=t+r-8*(i+1);let a=8*(i+2)-(t+r);const u=8*(i+2)-t;if(a=Math.max(0,a),i>=e.length)return console.warn("ran off the end of the buffer before finding EOI_CODE (end on input code)"),257;let c=e[i]&2**(8-n)-1;c<<=r-o;let l=c;if(i+1<e.length){let t=e[i+1]>>>a;t<<=Math.max(0,r-u),l+=t}if(s>8&&i+2<e.length){const n=8*(i+3)-(t+r);l+=e[i+2]>>>n}return l}(e,o,i);return o+=i,t}function u(e,i){return r[n]=i,t[n]=e,n++,n-1}function c(e){const n=[];for(let i=e;4096!==i;i=t[i])n.push(r[i]);return n}const l=[];s();const f=new Uint8Array(e);let h,d=a(f);for(;257!==d;){if(256===d){for(s(),d=a(f);256===d;)d=a(f);if(257===d)break;if(d>256)throw new Error("corrupted code at scanline "+d);x(l,c(d)),h=d}else if(d<n){const e=c(d);x(l,e),u(h,e[e.length-1]),h=d}else{const e=c(h);if(!e)throw new Error(`Bogus entry. Not in dictionary, ${h} / ${n}, position: ${o}`);x(l,e),l.push(e[e.length-1]),u(h,e[e.length-1]),h=d}n+1>=2**i&&(12===i?h=void 0:i++),d=a(f)}return new Uint8Array(l)}class O extends E{decodeBlock(e){return A(e).buffer}}const R=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]);function I(e,t){let r=0;const n=[];let i=16;for(;i>0&&!e[i-1];)--i;n.push({children:[],index:0});let o,s=n[0];for(let a=0;a<i;a++){for(let i=0;i<e[a];i++){for(s=n.pop(),s.children[s.index]=t[r];s.index>0;)s=n.pop();for(s.index++,n.push(s);n.length<=a;)n.push(o={children:[],index:0}),s.children[s.index]=o.children,s=o;r++}a+1<i&&(n.push(o={children:[],index:0}),s.children[s.index]=o.children,s=o)}return n[0].children}function P(e,t,r,n,i,o,s,a,u){const{mcusPerLine:c,progressive:l}=r,f=t;let h=t,d=0,p=0;function g(){if(p>0)return p--,d>>p&1;if(d=e[h++],255===d){const t=e[h++];if(t)throw new Error("unexpected marker: "+(d<<8|t).toString(16))}return p=7,d>>>7}function m(e){let t,r=e;for(;null!==(t=g());){if(r=r[t],"number"==typeof r)return r;if("object"!=typeof r)throw new Error("invalid huffman sequence")}return null}function y(e){let t=e,r=0;for(;t>0;){const e=g();if(null===e)return;r=r<<1|e,--t}return r}function b(e){const t=y(e);return t>=1<<e-1?t:t+(-1<<e)+1}let w=0;let v,_=0;function S(e,t,r,n,i){const o=r%c,s=(r/c|0)*e.v+n,a=o*e.h+i;t(e,e.blocks[s][a])}function k(e,t,r){const n=r/e.blocksPerLine|0,i=r%e.blocksPerLine;t(e,e.blocks[n][i])}const C=n.length;let E,T,x,A,O,I;I=l?0===o?0===a?function(e,t){const r=m(e.huffmanTableDC),n=0===r?0:b(r)<<u;e.pred+=n,t[0]=e.pred}:function(e,t){t[0]|=g()<<u}:0===a?function(e,t){if(w>0)return void w--;let r=o;const n=s;for(;r<=n;){const n=m(e.huffmanTableAC),i=15&n,o=n>>4;if(0===i){if(o<15){w=y(o)+(1<<o)-1;break}r+=16}else{r+=o;t[R[r]]=b(i)*(1<<u),r++}}}:function(e,t){let r=o;const n=s;let i=0;for(;r<=n;){const n=R[r],o=t[n]<0?-1:1;switch(_){case 0:{const t=m(e.huffmanTableAC),r=15&t;if(i=t>>4,0===r)i<15?(w=y(i)+(1<<i),_=4):(i=16,_=1);else{if(1!==r)throw new Error("invalid ACn encoding");v=b(r),_=i?2:3}continue}case 1:case 2:t[n]?t[n]+=(g()<<u)*o:(i--,0===i&&(_=2===_?3:0));break;case 3:t[n]?t[n]+=(g()<<u)*o:(t[n]=v<<u,_=0);break;case 4:t[n]&&(t[n]+=(g()<<u)*o)}r++}4===_&&(w--,0===w&&(_=0))}:function(e,t){const r=m(e.huffmanTableDC),n=0===r?0:b(r);e.pred+=n,t[0]=e.pred;let i=1;for(;i<64;){const r=m(e.huffmanTableAC),n=15&r,o=r>>4;if(0===n){if(o<15)break;i+=16}else{i+=o;t[R[i]]=b(n),i++}}};let P,M,D=0;M=1===C?n[0].blocksPerLine*n[0].blocksPerColumn:c*r.mcusPerColumn;const L=i||M;for(;D<M;){for(T=0;T<C;T++)n[T].pred=0;if(w=0,1===C)for(E=n[0],O=0;O<L;O++)k(E,I,D),D++;else for(O=0;O<L;O++){for(T=0;T<C;T++){E=n[T];const{h:e,v:t}=E;for(x=0;x<t;x++)for(A=0;A<e;A++)S(E,I,D,x,A)}if(D++,D===M)break}if(p=0,P=e[h]<<8|e[h+1],P<65280)throw new Error("marker was not found");if(!(P>=65488&&P<=65495))break;h+=2}return h-f}function M(e,t){const r=[],{blocksPerLine:n,blocksPerColumn:i}=t,o=n<<3,s=new Int32Array(64),a=new Uint8Array(64);function u(e,r,n){const i=t.quantizationTable;let o,s,a,u,c,l,f,h,d;const p=n;let g;for(g=0;g<64;g++)p[g]=e[g]*i[g];for(g=0;g<8;++g){const e=8*g;0!==p[1+e]||0!==p[2+e]||0!==p[3+e]||0!==p[4+e]||0!==p[5+e]||0!==p[6+e]||0!==p[7+e]?(o=5793*p[0+e]+128>>8,s=5793*p[4+e]+128>>8,a=p[2+e],u=p[6+e],c=2896*(p[1+e]-p[7+e])+128>>8,h=2896*(p[1+e]+p[7+e])+128>>8,l=p[3+e]<<4,f=p[5+e]<<4,d=o-s+1>>1,o=o+s+1>>1,s=d,d=3784*a+1567*u+128>>8,a=1567*a-3784*u+128>>8,u=d,d=c-f+1>>1,c=c+f+1>>1,f=d,d=h+l+1>>1,l=h-l+1>>1,h=d,d=o-u+1>>1,o=o+u+1>>1,u=d,d=s-a+1>>1,s=s+a+1>>1,a=d,d=2276*c+3406*h+2048>>12,c=3406*c-2276*h+2048>>12,h=d,d=799*l+4017*f+2048>>12,l=4017*l-799*f+2048>>12,f=d,p[0+e]=o+h,p[7+e]=o-h,p[1+e]=s+f,p[6+e]=s-f,p[2+e]=a+l,p[5+e]=a-l,p[3+e]=u+c,p[4+e]=u-c):(d=5793*p[0+e]+512>>10,p[0+e]=d,p[1+e]=d,p[2+e]=d,p[3+e]=d,p[4+e]=d,p[5+e]=d,p[6+e]=d,p[7+e]=d)}for(g=0;g<8;++g){const e=g;0!==p[8+e]||0!==p[16+e]||0!==p[24+e]||0!==p[32+e]||0!==p[40+e]||0!==p[48+e]||0!==p[56+e]?(o=5793*p[0+e]+2048>>12,s=5793*p[32+e]+2048>>12,a=p[16+e],u=p[48+e],c=2896*(p[8+e]-p[56+e])+2048>>12,h=2896*(p[8+e]+p[56+e])+2048>>12,l=p[24+e],f=p[40+e],d=o-s+1>>1,o=o+s+1>>1,s=d,d=3784*a+1567*u+2048>>12,a=1567*a-3784*u+2048>>12,u=d,d=c-f+1>>1,c=c+f+1>>1,f=d,d=h+l+1>>1,l=h-l+1>>1,h=d,d=o-u+1>>1,o=o+u+1>>1,u=d,d=s-a+1>>1,s=s+a+1>>1,a=d,d=2276*c+3406*h+2048>>12,c=3406*c-2276*h+2048>>12,h=d,d=799*l+4017*f+2048>>12,l=4017*l-799*f+2048>>12,f=d,p[0+e]=o+h,p[56+e]=o-h,p[8+e]=s+f,p[48+e]=s-f,p[16+e]=a+l,p[40+e]=a-l,p[24+e]=u+c,p[32+e]=u-c):(d=5793*n[g+0]+8192>>14,p[0+e]=d,p[8+e]=d,p[16+e]=d,p[24+e]=d,p[32+e]=d,p[40+e]=d,p[48+e]=d,p[56+e]=d)}for(g=0;g<64;++g){const e=128+(p[g]+8>>4);r[g]=e<0?0:e>255?255:e}}for(let e=0;e<i;e++){const i=e<<3;for(let e=0;e<8;e++)r.push(new Uint8Array(o));for(let o=0;o<n;o++){u(t.blocks[e][o],a,s);let n=0;const c=o<<3;for(let e=0;e<8;e++){const t=r[i+e];for(let e=0;e<8;e++)t[c+e]=a[n++]}}}return r}class D{constructor(){this.jfif=null,this.adobe=null,this.quantizationTables=[],this.huffmanTablesAC=[],this.huffmanTablesDC=[],this.resetFrames()}resetFrames(){this.frames=[]}parse(e){let t=0;function r(){const r=e[t]<<8|e[t+1];return t+=2,r}function n(){const n=r(),i=e.subarray(t,t+n-2);return t+=i.length,i}function i(e){let t,r,n=0,i=0;for(r in e.components)e.components.hasOwnProperty(r)&&(t=e.components[r],n<t.h&&(n=t.h),i<t.v&&(i=t.v));const o=Math.ceil(e.samplesPerLine/8/n),s=Math.ceil(e.scanLines/8/i);for(r in e.components)if(e.components.hasOwnProperty(r)){t=e.components[r];const a=Math.ceil(Math.ceil(e.samplesPerLine/8)*t.h/n),u=Math.ceil(Math.ceil(e.scanLines/8)*t.v/i),c=o*t.h,l=s*t.v,f=[];for(let e=0;e<l;e++){const e=[];for(let t=0;t<c;t++)e.push(new Int32Array(64));f.push(e)}t.blocksPerLine=a,t.blocksPerColumn=u,t.blocks=f}e.maxH=n,e.maxV=i,e.mcusPerLine=o,e.mcusPerColumn=s}let o=r();if(65496!==o)throw new Error("SOI not found");for(o=r();65497!==o;){switch(o){case 65280:break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:{const e=n();65504===o&&74===e[0]&&70===e[1]&&73===e[2]&&70===e[3]&&0===e[4]&&(this.jfif={version:{major:e[5],minor:e[6]},densityUnits:e[7],xDensity:e[8]<<8|e[9],yDensity:e[10]<<8|e[11],thumbWidth:e[12],thumbHeight:e[13],thumbData:e.subarray(14,14+3*e[12]*e[13])}),65518===o&&65===e[0]&&100===e[1]&&111===e[2]&&98===e[3]&&101===e[4]&&0===e[5]&&(this.adobe={version:e[6],flags0:e[7]<<8|e[8],flags1:e[9]<<8|e[10],transformCode:e[11]});break}case 65499:{const n=r()+t-2;for(;t<n;){const n=e[t++],i=new Int32Array(64);if(n>>4==0)for(let r=0;r<64;r++){i[R[r]]=e[t++]}else{if(n>>4!=1)throw new Error("DQT: invalid table spec");for(let e=0;e<64;e++){i[R[e]]=r()}}this.quantizationTables[15&n]=i}break}case 65472:case 65473:case 65474:{r();const n={extended:65473===o,progressive:65474===o,precision:e[t++],scanLines:r(),samplesPerLine:r(),components:{},componentsOrder:[]},s=e[t++];let a;for(let r=0;r<s;r++){a=e[t];const r=e[t+1]>>4,i=15&e[t+1],o=e[t+2];n.componentsOrder.push(a),n.components[a]={h:r,v:i,quantizationIdx:o},t+=3}i(n),this.frames.push(n);break}case 65476:{const n=r();for(let r=2;r<n;){const n=e[t++],i=new Uint8Array(16);let o=0;for(let r=0;r<16;r++,t++)i[r]=e[t],o+=i[r];const s=new Uint8Array(o);for(let r=0;r<o;r++,t++)s[r]=e[t];r+=17+o,n>>4==0?this.huffmanTablesDC[15&n]=I(i,s):this.huffmanTablesAC[15&n]=I(i,s)}break}case 65501:r(),this.resetInterval=r();break;case 65498:{r();const n=e[t++],i=[],o=this.frames[0];for(let r=0;r<n;r++){const r=o.components[e[t++]],n=e[t++];r.huffmanTableDC=this.huffmanTablesDC[n>>4],r.huffmanTableAC=this.huffmanTablesAC[15&n],i.push(r)}const s=e[t++],a=e[t++],u=e[t++],c=P(e,t,o,i,this.resetInterval,s,a,u>>4,15&u);t+=c;break}case 65535:255!==e[t]&&t--;break;default:if(255===e[t-3]&&e[t-2]>=192&&e[t-2]<=254){t-=3;break}throw new Error("unknown JPEG marker "+o.toString(16))}o=r()}}getResult(){const{frames:e}=this;if(0===this.frames.length)throw new Error("no frames were decoded");this.frames.length>1&&console.warn("more than one frame is not supported");for(let e=0;e<this.frames.length;e++){const t=this.frames[e].components;for(const e of Object.keys(t))t[e].quantizationTable=this.quantizationTables[t[e].quantizationIdx],delete t[e].quantizationIdx}const t=e[0],{components:r,componentsOrder:n}=t,i=[],o=t.samplesPerLine,s=t.scanLines;for(let e=0;e<n.length;e++){const o=r[n[e]];i.push({lines:M(0,o),scaleX:o.h/t.maxH,scaleY:o.v/t.maxV})}const a=new Uint8Array(o*s*i.length);let u=0;for(let e=0;e<s;++e)for(let t=0;t<o;++t)for(let r=0;r<i.length;++r){const n=i[r];a[u]=n.lines[0|e*n.scaleY][0|t*n.scaleX],++u}return a}}class L extends E{constructor(e){super(),this.reader=new D,e.JPEGTables&&this.reader.parse(e.JPEGTables)}decodeBlock(e){return this.reader.resetFrames(),this.reader.parse(new Uint8Array(e)),this.reader.getResult().buffer}}var U=r(38);class F extends E{decodeBlock(e){return Object(U.inflate)(new Uint8Array(e)).buffer}}class j extends E{decodeBlock(e){const t=new DataView(e),r=[];for(let n=0;n<e.byteLength;++n){let e=t.getInt8(n);if(e<0){const i=t.getUint8(n+1);e=-e;for(let t=0;t<=e;++t)r.push(i);n+=1}else{for(let i=0;i<=e;++i)r.push(t.getUint8(n+i+1));n+=e+1}}return new Uint8Array(r).buffer}}function B(e){switch(e.Compression){case void 0:case 1:return new T;case 5:return new O;case 6:throw new Error("old style JPEG compression is not supported.");case 7:return new L(e);case 8:case 32946:return new F;case 32773:return new j;default:throw new Error("Unknown compression method identifier: "+e.Compression)}}function N(e,t,r,n=1){return new(Object.getPrototypeOf(e).constructor)(t*r*n)}function G(e,t,r){return(1-r)*e+r*t}function q(e,t,r,n,i,o="nearest"){switch(o.toLowerCase()){case"nearest":return function(e,t,r,n,i){const o=t/n,s=r/i;return e.map(e=>{const a=N(e,n,i);for(let u=0;u<i;++u){const i=Math.min(Math.round(s*u),r-1);for(let r=0;r<n;++r){const s=Math.min(Math.round(o*r),t-1),c=e[i*t+s];a[u*n+r]=c}}return a})}(e,t,r,n,i);case"bilinear":case"linear":return function(e,t,r,n,i){const o=t/n,s=r/i;return e.map(e=>{const a=N(e,n,i);for(let u=0;u<i;++u){const i=s*u,c=Math.floor(i),l=Math.min(Math.ceil(i),r-1);for(let r=0;r<n;++r){const s=o*r,f=s%1,h=Math.floor(s),d=Math.min(Math.ceil(s),t-1),p=e[c*t+h],g=e[c*t+d],m=e[l*t+h],y=e[l*t+d],b=G(G(p,g,f),G(m,y,f),i%1);a[u*n+r]=b}}return a})}(e,t,r,n,i);default:throw new Error(`Unsupported resampling method: \'${o}\'`)}}function H(e,t,r,n,i,o,s="nearest"){switch(s.toLowerCase()){case"nearest":return function(e,t,r,n,i,o){const s=t/n,a=r/i,u=N(e,n,i,o);for(let c=0;c<i;++c){const i=Math.min(Math.round(a*c),r-1);for(let r=0;r<n;++r){const a=Math.min(Math.round(s*r),t-1);for(let s=0;s<o;++s){const l=e[i*t*o+a*o+s];u[c*n*o+r*o+s]=l}}}return u}(e,t,r,n,i,o);case"bilinear":case"linear":return function(e,t,r,n,i,o){const s=t/n,a=r/i,u=N(e,n,i,o);for(let c=0;c<i;++c){const i=a*c,l=Math.floor(i),f=Math.min(Math.ceil(i),r-1);for(let r=0;r<n;++r){const a=s*r,h=a%1,d=Math.floor(a),p=Math.min(Math.ceil(a),t-1);for(let s=0;s<o;++s){const a=e[l*t*o+d*o+s],g=e[l*t*o+p*o+s],m=e[f*t*o+d*o+s],y=e[f*t*o+p*o+s],b=G(G(a,g,h),G(m,y,h),i%1);u[c*n*o+r*o+s]=b}}}return u}(e,t,r,n,i,o);default:throw new Error(`Unsupported resampling method: \'${s}\'`)}}function z(e,t,r){let n=0;for(let i=t;i<r;++i)n+=e[i];return n}function K(e,t,r){switch(e){case 1:switch(t){case 8:return new Uint8Array(r);case 16:return new Uint16Array(r);case 32:return new Uint32Array(r)}break;case 2:switch(t){case 8:return new Int8Array(r);case 16:return new Int16Array(r);case 32:return new Int32Array(r)}break;case 3:switch(t){case 32:return new Float32Array(r);case 64:return new Float64Array(r)}}throw Error("Unsupported data format/bitsPerSample")}var W=class{constructor(e,t,r,n,i,o){this.fileDirectory=e,this.geoKeys=t,this.dataView=r,this.littleEndian=n,this.tiles=i?{}:null,this.isTiled=!e.StripOffsets;const s=e.PlanarConfiguration;if(this.planarConfiguration=void 0===s?1:s,1!==this.planarConfiguration&&2!==this.planarConfiguration)throw new Error("Invalid planar configuration.");this.source=o}getFileDirectory(){return this.fileDirectory}getGeoKeys(){return this.geoKeys}getWidth(){return this.fileDirectory.ImageWidth}getHeight(){return this.fileDirectory.ImageLength}getSamplesPerPixel(){return this.fileDirectory.SamplesPerPixel}getTileWidth(){return this.isTiled?this.fileDirectory.TileWidth:this.getWidth()}getTileHeight(){return this.isTiled?this.fileDirectory.TileLength:void 0!==this.fileDirectory.RowsPerStrip?Math.min(this.fileDirectory.RowsPerStrip,this.getHeight()):this.getHeight()}getBytesPerPixel(){let e=0;for(let t=0;t<this.fileDirectory.BitsPerSample.length;++t){const r=this.fileDirectory.BitsPerSample[t];if(r%8!=0)throw new Error(`Sample bit-width of ${r} is not supported.`);if(r!==this.fileDirectory.BitsPerSample[0])throw new Error("Differing size of samples in a pixel are not supported.");e+=r}return e/8}getSampleByteSize(e){if(e>=this.fileDirectory.BitsPerSample.length)throw new RangeError(`Sample index ${e} is out of range.`);const t=this.fileDirectory.BitsPerSample[e];if(t%8!=0)throw new Error(`Sample bit-width of ${t} is not supported.`);return t/8}getReaderForSample(e){const t=this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[e]:1,r=this.fileDirectory.BitsPerSample[e];switch(t){case 1:switch(r){case 8:return DataView.prototype.getUint8;case 16:return DataView.prototype.getUint16;case 32:return DataView.prototype.getUint32}break;case 2:switch(r){case 8:return DataView.prototype.getInt8;case 16:return DataView.prototype.getInt16;case 32:return DataView.prototype.getInt32}break;case 3:switch(r){case 32:return DataView.prototype.getFloat32;case 64:return DataView.prototype.getFloat64}}throw Error("Unsupported data format/bitsPerSample")}getArrayForSample(e,t){return K(this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[e]:1,this.fileDirectory.BitsPerSample[e],t)}async getTileOrStrip(e,t,r,n){const i=Math.ceil(this.getWidth()/this.getTileWidth()),o=Math.ceil(this.getHeight()/this.getTileHeight());let s;const{tiles:a}=this;let u,c;1===this.planarConfiguration?s=t*i+e:2===this.planarConfiguration&&(s=r*i*o+t*i+e),this.isTiled?(u=this.fileDirectory.TileOffsets[s],c=this.fileDirectory.TileByteCounts[s]):(u=this.fileDirectory.StripOffsets[s],c=this.fileDirectory.StripByteCounts[s]);const l=await this.source.fetch(u,c);let f;return null===a?f=n.decode(this.fileDirectory,l):a[s]||(f=n.decode(this.fileDirectory,l),a[s]=f),{x:e,y:t,sample:r,data:await f}}async _readRaster(e,t,r,n,i,o,s,a){const u=this.getTileWidth(),c=this.getTileHeight(),l=Math.max(Math.floor(e[0]/u),0),f=Math.min(Math.ceil(e[2]/u),Math.ceil(this.getWidth()/this.getTileWidth())),h=Math.max(Math.floor(e[1]/c),0),d=Math.min(Math.ceil(e[3]/c),Math.ceil(this.getHeight()/this.getTileHeight())),p=e[2]-e[0];let g=this.getBytesPerPixel();const m=[],y=[];for(let e=0;e<t.length;++e)1===this.planarConfiguration?m.push(z(this.fileDirectory.BitsPerSample,0,t[e])/8):m.push(0),y.push(this.getReaderForSample(t[e]));const b=[],{littleEndian:w}=this;for(let o=h;o<d;++o)for(let s=l;s<f;++s)for(let a=0;a<t.length;++a){const l=a,f=t[a];2===this.planarConfiguration&&(g=this.getSampleByteSize(f));const h=this.getTileOrStrip(s,o,f,i);b.push(h),h.then(i=>{const o=i.data,s=new DataView(o),a=i.y*c,f=i.x*u,h=(i.y+1)*c,d=(i.x+1)*u,b=y[l],v=Math.min(c,c-(h-e[3])),_=Math.min(u,u-(d-e[2]));for(let i=Math.max(0,e[1]-a);i<v;++i)for(let o=Math.max(0,e[0]-f);o<_;++o){const c=(i*u+o)*g,h=b.call(s,c+m[l],w);let d;n?(d=(i+a-e[1])*p*t.length+(o+f-e[0])*t.length+l,r[d]=h):(d=(i+a-e[1])*p+o+f-e[0],r[l][d]=h)}})}if(await Promise.all(b),o&&e[2]-e[0]!==o||s&&e[3]-e[1]!==s){let i;return i=n?H(r,e[2]-e[0],e[3]-e[1],o,s,t.length,a):q(r,e[2]-e[0],e[3]-e[1],o,s,a),i.width=o,i.height=s,i}return r.width=o||e[2]-e[0],r.height=s||e[3]-e[1],r}async readRasters({window:e,samples:t=[],interleave:r,pool:n=null,width:i,height:o,resampleMethod:s,fillValue:a}={}){const u=e||[0,0,this.getWidth(),this.getHeight()];if(u[0]>u[2]||u[1]>u[3])throw new Error("Invalid subsets");const c=(u[2]-u[0])*(u[3]-u[1]);if(t&&t.length){for(let e=0;e<t.length;++e)if(t[e]>=this.fileDirectory.SamplesPerPixel)return Promise.reject(new RangeError(`Invalid sample index \'${t[e]}\'.`))}else for(let e=0;e<this.fileDirectory.SamplesPerPixel;++e)t.push(e);let l;if(r){l=K(this.fileDirectory.SampleFormat?Math.max.apply(null,this.fileDirectory.SampleFormat):1,Math.max.apply(null,this.fileDirectory.BitsPerSample),c*t.length),a&&l.fill(a)}else{l=[];for(let e=0;e<t.length;++e){const r=this.getArrayForSample(t[e],c);Array.isArray(a)&&e<a.length?r.fill(a[e]):a&&!Array.isArray(a)&&r.fill(a),l.push(r)}}const f=n||B(this.fileDirectory);return await this._readRaster(u,t,l,r,f,i,o,s)}async readRGB({window:e,pool:t=null,width:r,height:n,resampleMethod:i,enableAlpha:o=!1}={}){const s=e||[0,0,this.getWidth(),this.getHeight()];if(s[0]>s[2]||s[1]>s[3])throw new Error("Invalid subsets");const a=this.fileDirectory.PhotometricInterpretation;if(a===d.RGB){let i=[0,1,2];if(this.fileDirectory.ExtraSamples!==p.Unspecified&&o){i=[];for(let e=0;e<this.fileDirectory.BitsPerSample.length;e+=1)i.push(e)}return this.readRasters({window:e,interleave:!0,samples:i,pool:t,width:r,height:n})}let u;switch(a){case d.WhiteIsZero:case d.BlackIsZero:case d.Palette:u=[0];break;case d.CMYK:u=[0,1,2,3];break;case d.YCbCr:case d.CIELab:u=[0,1,2];break;default:throw new Error("Invalid or unsupported photometric interpretation.")}const c={window:s,interleave:!0,samples:u,pool:t,width:r,height:n,resampleMethod:i},{fileDirectory:l}=this,f=await this.readRasters(c),h=2**this.fileDirectory.BitsPerSample[0];let g;switch(a){case d.WhiteIsZero:g=y(f,h);break;case d.BlackIsZero:g=b(f,h);break;case d.Palette:g=w(f,l.ColorMap);break;case d.CMYK:g=v(f);break;case d.YCbCr:g=_(f);break;case d.CIELab:g=S(f);break;default:throw new Error("Unsupported photometric interpretation.")}return g.width=f.width,g.height=f.height,g}getTiePoints(){if(!this.fileDirectory.ModelTiepoint)return[];const e=[];for(let t=0;t<this.fileDirectory.ModelTiepoint.length;t+=6)e.push({i:this.fileDirectory.ModelTiepoint[t],j:this.fileDirectory.ModelTiepoint[t+1],k:this.fileDirectory.ModelTiepoint[t+2],x:this.fileDirectory.ModelTiepoint[t+3],y:this.fileDirectory.ModelTiepoint[t+4],z:this.fileDirectory.ModelTiepoint[t+5]});return e}getGDALMetadata(e=null){const t={};if(!this.fileDirectory.GDAL_METADATA)return null;const r=this.fileDirectory.GDAL_METADATA,n=s()(r.substring(0,r.length-1));if(!n[0].tagName)throw new Error("Failed to parse GDAL metadata XML.");const i=n[0];if("GDALMetadata"!==i.tagName)throw new Error("Unexpected GDAL metadata XML tag.");let o=i.children.filter(e=>"Item"===e.tagName);e&&(o=o.filter(t=>Number(t.attributes.sample)===e));for(let e=0;e<o.length;++e){const r=o[e];t[r.attributes.name]=r.children[0]}return t}getGDALNoData(){if(!this.fileDirectory.GDAL_NODATA)return null;const e=this.fileDirectory.GDAL_NODATA;return Number(e.substring(0,e.length-1))}getOrigin(){const e=this.fileDirectory.ModelTiepoint,t=this.fileDirectory.ModelTransformation;if(e&&6===e.length)return[e[3],e[4],e[5]];if(t)return[t[3],t[7],t[11]];throw new Error("The image does not have an affine transformation.")}getResolution(e=null){const t=this.fileDirectory.ModelPixelScale,r=this.fileDirectory.ModelTransformation;if(t)return[t[0],-t[1],t[2]];if(r)return[r[0],r[5],r[10]];if(e){const[t,r,n]=e.getResolution();return[t*e.getWidth()/this.getWidth(),r*e.getHeight()/this.getHeight(),n*e.getWidth()/this.getWidth()]}throw new Error("The image does not have an affine transformation.")}pixelIsArea(){return 1===this.geoKeys.GTRasterTypeGeoKey}getBoundingBox(){const e=this.getOrigin(),t=this.getResolution(),r=e[0],n=e[1],i=r+t[0]*this.getWidth(),o=n+t[1]*this.getHeight();return[Math.min(r,i),Math.min(n,o),Math.max(r,i),Math.max(n,o)]}};class V{constructor(e){this._dataView=new DataView(e)}get buffer(){return this._dataView.buffer}getUint64(e,t){const r=this.getUint32(e,t),n=this.getUint32(e+4,t);let i;if(t){if(i=r+2**32*n,!Number.isSafeInteger(i))throw new Error(i+" exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues");return i}if(i=2**32*r+n,!Number.isSafeInteger(i))throw new Error(i+" exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues");return i}getInt64(e,t){let r=0;const n=(128&this._dataView.getUint8(e+(t?7:0)))>0;let i=!0;for(let o=0;o<8;o++){let s=this._dataView.getUint8(e+(t?o:7-o));n&&(i?0!==s&&(s=255&~(s-1),i=!1):s=255&~s),r+=s*256**o}return n&&(r=-r),r}getUint8(e,t){return this._dataView.getUint8(e,t)}getInt8(e,t){return this._dataView.getInt8(e,t)}getUint16(e,t){return this._dataView.getUint16(e,t)}getInt16(e,t){return this._dataView.getInt16(e,t)}getUint32(e,t){return this._dataView.getUint32(e,t)}getInt32(e,t){return this._dataView.getInt32(e,t)}getFloat32(e,t){return this._dataView.getFloat32(e,t)}getFloat64(e,t){return this._dataView.getFloat64(e,t)}}class Y{constructor(e,t,r,n){this._dataView=new DataView(e),this._sliceOffset=t,this._littleEndian=r,this._bigTiff=n}get sliceOffset(){return this._sliceOffset}get sliceTop(){return this._sliceOffset+this.buffer.byteLength}get littleEndian(){return this._littleEndian}get bigTiff(){return this._bigTiff}get buffer(){return this._dataView.buffer}covers(e,t){return this.sliceOffset<=e&&this.sliceTop>=e+t}readUint8(e){return this._dataView.getUint8(e-this._sliceOffset,this._littleEndian)}readInt8(e){return this._dataView.getInt8(e-this._sliceOffset,this._littleEndian)}readUint16(e){return this._dataView.getUint16(e-this._sliceOffset,this._littleEndian)}readInt16(e){return this._dataView.getInt16(e-this._sliceOffset,this._littleEndian)}readUint32(e){return this._dataView.getUint32(e-this._sliceOffset,this._littleEndian)}readInt32(e){return this._dataView.getInt32(e-this._sliceOffset,this._littleEndian)}readFloat32(e){return this._dataView.getFloat32(e-this._sliceOffset,this._littleEndian)}readFloat64(e){return this._dataView.getFloat64(e-this._sliceOffset,this._littleEndian)}readUint64(e){const t=this.readUint32(e),r=this.readUint32(e+4);let n;if(this._littleEndian){if(n=t+2**32*r,!Number.isSafeInteger(n))throw new Error(n+" exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues");return n}if(n=2**32*t+r,!Number.isSafeInteger(n))throw new Error(n+" exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues");return n}readInt64(e){let t=0;const r=(128&this._dataView.getUint8(e+(this._littleEndian?7:0)))>0;let n=!0;for(let i=0;i<8;i++){let o=this._dataView.getUint8(e+(this._littleEndian?i:7-i));r&&(n?0!==o&&(o=255&~(o-1),n=!1):o=255&~o),t+=o*256**i}return r&&(t=-t),t}readOffset(e){return this._bigTiff?this.readUint64(e):this.readUint32(e)}}var Z=r(24),$=r(2),X=r(18),Q=r(17),J=r.n(Q),ee=r(42),te=r.n(ee),re=r(16),ne=r.n(re);class ie{constructor(e,{blockSize:t=65536}={}){this.retrievalFunction=e,this.blockSize=t,this.blockRequests=new Map,this.blocks=new Map,this.blockIdsAwaitingRequest=null}async fetch(e,t,r=!1){const n=e+t,i=[],o=[],s=[];for(let t=Math.floor(e/this.blockSize)*this.blockSize;t<n;t+=this.blockSize){const e=Math.floor(t/this.blockSize);this.blocks.has(e)||this.blockRequests.has(e)||o.push(e),this.blockRequests.has(e)&&s.push(this.blockRequests.get(e)),i.push(e)}if(this.blockIdsAwaitingRequest)for(let e=0;e<o.length;++e){const t=o[e];this.blockIdsAwaitingRequest.add(t)}else this.blockIdsAwaitingRequest=new Set(o);if(r||await async function(e){return new Promise(t=>setTimeout(t,e))}(),this.blockIdsAwaitingRequest){const e=function(e){if(0===e.length)return[];const t=[];let r=[];t.push(r);for(let n=0;n<e.length;++n)0===n||e[n]===e[n-1]+1?r.push(e[n]):(r=[e[n]],t.push(r));return t}(Array.from(this.blockIdsAwaitingRequest).sort());for(const t of e){const e=this.requestData(t[0]*this.blockSize,t.length*this.blockSize);for(let r=0;r<t.length;++r){const n=t[r];this.blockRequests.set(n,(async()=>{const t=await e,i=r*this.blockSize,o=Math.min(i+this.blockSize,t.data.byteLength),s=t.data.slice(i,o);this.blockRequests.delete(n),this.blocks.set(n,{data:s,offset:t.offset+i,length:s.byteLength,top:t.offset+o})})())}}this.blockIdsAwaitingRequest=null}const a=[];for(const e of o)this.blockRequests.has(e)&&a.push(this.blockRequests.get(e));await Promise.all(a),await Promise.all(s);return function(e,t,r){const n=t+r,i=new ArrayBuffer(r),o=new Uint8Array(i);for(const r of e){const e=r.offset-t,i=r.top-n;let s,a=0,u=0;e<0?a=-e:e>0&&(u=e),s=i<0?r.length-a:n-r.offset-a;const c=new Uint8Array(r.data,a,s);o.set(c,u)}return i}(i.map(e=>this.blocks.get(e)),e,t)}async requestData(e,t){const r=await this.retrievalFunction(e,t);return r.length?r.length!==r.data.byteLength&&(r.data=r.data.slice(0,r.length)):r.length=r.data.byteLength,r.top=r.offset+r.length,r}}function oe(e,t){const{forceXHR:r}=t;if("function"==typeof fetch&&!r)return function(e,{headers:t={},blockSize:r}={}){return new ie(async(r,n)=>{const i=await fetch(e,{headers:{...t,Range:`bytes=${r}-${r+n-1}`}});if(i.ok){if(206===i.status){return{data:i.arrayBuffer?await i.arrayBuffer():(await i.buffer()).buffer,offset:r,length:n}}{const e=i.arrayBuffer?await i.arrayBuffer():(await i.buffer()).buffer;return{data:e,offset:0,length:e.byteLength}}}throw new Error("Error fetching data.")},{blockSize:r})}(e,t);if("undefined"!=typeof XMLHttpRequest)return function(e,{headers:t={},blockSize:r}={}){return new ie(async(r,n)=>new Promise((i,o)=>{const s=new XMLHttpRequest;s.open("GET",e),s.responseType="arraybuffer";const a={...t,Range:`bytes=${r}-${r+n-1}`};for(const[e,t]of Object.entries(a))s.setRequestHeader(e,t);s.onload=()=>{const e=s.response;206===s.status?i({data:e,offset:r,length:n}):i({data:e,offset:0,length:e.byteLength})},s.onerror=o,s.send()}),{blockSize:r})}(e,t);if(J.a.get)return function(e,{headers:t={},blockSize:r}={}){return new ie(async(r,n)=>new Promise((i,o)=>{const s=ne.a.parse(e);("http:"===s.protocol?J.a:te.a).get({...s,headers:{...t,Range:`bytes=${r}-${r+n-1}`}},e=>{const t=[];e.on("data",e=>{t.push(e)}),e.on("end",()=>{const e=$.Buffer.concat(t).buffer;i({data:e,offset:r,length:e.byteLength})})}).on("error",o)}),{blockSize:r})}(e,t);throw new Error("No remote source available")}function se(e){const t=function(e,t,r){return new Promise((n,i)=>{Object(X.open)(e,t,r,(e,t)=>{e?i(e):n(t)})})}(e,"r");return{async fetch(e,r){const n=await t,{buffer:i}=await function(...e){return new Promise((t,r)=>{Object(X.read)(...e,(e,n,i)=>{e?r(e):t({bytesRead:n,buffer:i})})})}(n,$.Buffer.alloc(r),0,r,e);return i.buffer},async close(){const e=await t;return await function(e){return new Promise((t,r)=>{Object(X.close)(e,e=>{e?r(e):t()})})}(e)}}}function ae(e,t){for(const r in t)t.hasOwnProperty(r)&&(e[r]=t[r])}function ue(e,t){if(e.length<t.length)return!1;return e.substr(e.length-t.length)===t}function ce(e){const t={};for(const r in e)if(e.hasOwnProperty(r)){t[e[r]]=r}return t}function le(e,t){const r=[];for(let n=0;n<e;n++)r.push(t(n));return r}const fe=ce(a),he=ce(g),de={};ae(de,fe),ae(de,he);const pe=ce(f),ge={nextZero:(e,t)=>{let r=t;for(;0!==e[r];)r++;return r},readUshort:(e,t)=>e[t]<<8|e[t+1],readShort:(e,t)=>{const r=ge.ui8;return r[0]=e[t+1],r[1]=e[t+0],ge.i16[0]},readInt:(e,t)=>{const r=ge.ui8;return r[0]=e[t+3],r[1]=e[t+2],r[2]=e[t+1],r[3]=e[t+0],ge.i32[0]},readUint:(e,t)=>{const r=ge.ui8;return r[0]=e[t+3],r[1]=e[t+2],r[2]=e[t+1],r[3]=e[t+0],ge.ui32[0]},readASCII:(e,t,r)=>r.map(r=>String.fromCharCode(e[t+r])).join(""),readFloat:(e,t)=>{const r=ge.ui8;return le(4,n=>{r[n]=e[t+3-n]}),ge.fl32[0]},readDouble:(e,t)=>{const r=ge.ui8;return le(8,n=>{r[n]=e[t+7-n]}),ge.fl64[0]},writeUshort:(e,t,r)=>{e[t]=r>>8&255,e[t+1]=255&r},writeUint:(e,t,r)=>{e[t]=r>>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=r>>0&255},writeASCII:(e,t,r)=>{le(r.length,n=>{e[t+n]=r.charCodeAt(n)})},ui8:new Uint8Array(8)};ge.fl64=new Float64Array(ge.ui8.buffer),ge.writeDouble=(e,t,r)=>{ge.fl64[0]=r,le(8,r=>{e[t+r]=ge.ui8[7-r]})};const me=e=>{const t=new Uint8Array(1e3);let r=4;const n=ge;t[0]=77,t[1]=77,t[3]=42;let i=8;if(n.writeUint(t,r,i),r+=4,e.forEach((r,o)=>{const s=((e,t,r,n)=>{let i=r;const o=Object.keys(n).filter(e=>null!=e&&"undefined"!==e);e.writeUshort(t,i,o.length),i+=2;let s=i+12*o.length+4;for(const r of o){let o=null;"number"==typeof r?o=r:"string"==typeof r&&(o=parseInt(r,10));const a=c[o],u=pe[a];if(null==a||void 0===a||void 0===a)throw new Error("unknown type of tag: "+o);let l=n[r];if(void 0===l)throw new Error("failed to get value for key "+r);"ASCII"===a&&"string"==typeof l&&!1===ue(l,"\\0")&&(l+="\\0");const f=l.length;e.writeUshort(t,i,o),i+=2,e.writeUshort(t,i,u),i+=2,e.writeUint(t,i,f),i+=4;let h=[-1,1,1,2,4,8,0,0,0,0,0,0,8][u]*f,d=i;h>4&&(e.writeUint(t,i,s),d=s),"ASCII"===a?e.writeASCII(t,d,l):"SHORT"===a?le(f,r=>{e.writeUshort(t,d+2*r,l[r])}):"LONG"===a?le(f,r=>{e.writeUint(t,d+4*r,l[r])}):"RATIONAL"===a?le(f,r=>{e.writeUint(t,d+8*r,Math.round(1e4*l[r])),e.writeUint(t,d+8*r+4,1e4)}):"DOUBLE"===a&&le(f,r=>{e.writeDouble(t,d+8*r,l[r])}),h>4&&(h+=1&h,s+=h),i+=4}return[i,s]})(n,t,i,r);i=s[1],o<e.length-1&&n.writeUint(t,s[0],i)}),t.slice)return t.slice(0,i).buffer;const o=new Uint8Array(i);for(let e=0;e<i;e++)o[e]=t[e];return o.buffer},ye=[["Compression",1],["PlanarConfiguration",1],["XPosition",0],["YPosition",0],["ResolutionUnit",1],["ExtraSamples",0],["GeoAsciiParams","WGS 84\\0"],["ModelTiepoint",[0,0,0,-180,90,0]],["GTModelTypeGeoKey",2],["GTRasterTypeGeoKey",1],["GeographicTypeGeoKey",4326],["GeogCitationGeoKey","WGS 84"]];function be(e,t){let r,n,i,o;"number"==typeof e[0]?(r=t.height||t.ImageLength,i=t.width||t.ImageWidth,n=e.length/(r*i),o=e):(n=e.length,r=e[0].length,i=e[0][0].length,o=[],le(r,t=>{le(i,r=>{le(n,n=>{o.push(e[n][t][r])})})})),t.ImageLength=r,delete t.height,t.ImageWidth=i,delete t.width,t.BitsPerSample||(t.BitsPerSample=le(n,()=>8)),ye.forEach(e=>{const r=e[0];if(!t[r]){const n=e[1];t[r]=n}}),t.PhotometricInterpretation||(t.PhotometricInterpretation=3===t.BitsPerSample.length?2:1),t.SamplesPerPixel||(t.SamplesPerPixel=[n]),t.StripByteCounts||(t.StripByteCounts=[n*r*i]),t.ModelPixelScale||(t.ModelPixelScale=[360/i,180/r,0]),t.SampleFormat||(t.SampleFormat=le(n,()=>1));const s=Object.keys(t).filter(e=>ue(e,"GeoKey")).sort((e,t)=>de[e]-de[t]);if(!t.GeoKeyDirectory){const e=[1,1,0,s.length];s.forEach(r=>{const n=Number(de[r]);let i,o,s;e.push(n),"SHORT"===c[n]?(i=1,o=0,s=t[r]):"GeogCitationGeoKey"===r?(i=t.GeoAsciiParams.length,o=Number(de.GeoAsciiParams),s=0):console.log("[geotiff.js] couldn\'t get TIFFTagLocation for "+r),e.push(o),e.push(i),e.push(s)}),t.GeoKeyDirectory=e}for(const e in s)s.hasOwnProperty(e)&&delete t[e];["Compression","ExtraSamples","GeographicTypeGeoKey","GTModelTypeGeoKey","GTRasterTypeGeoKey","ImageLength","ImageWidth","PhotometricInterpretation","PlanarConfiguration","ResolutionUnit","SamplesPerPixel","XPosition","YPosition"].forEach(e=>{var r;t[e]&&(t[e]=(r=t[e],Array.isArray(r)?r:[r]))});const a=(e=>{const t={};for(const r in e)"StripOffsets"!==r&&(de[r]||console.error(r,"not in name2code:",Object.keys(de)),t[de[r]]=e[r]);return t})(t);return((e,t,r,n)=>{if(null==r)throw new Error("you passed into encodeImage a width of type "+r);if(null==t)throw new Error("you passed into encodeImage a width of type "+t);const i={256:[t],257:[r],273:[1e3],278:[r],305:"geotiff.js"};if(n)for(const e in n)n.hasOwnProperty(e)&&(i[e]=n[e]);const o=new Uint8Array(me([i])),s=new Uint8Array(e),a=i[277],u=new Uint8Array(1e3+t*r*a);return le(o.length,e=>{u[e]=o[e]}),function(e,t){const{length:r}=e;for(let n=0;n<r;n++)t(e[n],n)}(s,(e,t)=>{u[1e3+t]=e}),u.buffer})(o,i,r,a)}class we{log(){}info(){}warn(){}error(){}time(){}timeEnd(){}}let ve=new we;function _e(e=new we){ve=e}function Se(e){switch(e){case h.BYTE:case h.ASCII:case h.SBYTE:case h.UNDEFINED:return 1;case h.SHORT:case h.SSHORT:return 2;case h.LONG:case h.SLONG:case h.FLOAT:case h.IFD:return 4;case h.RATIONAL:case h.SRATIONAL:case h.DOUBLE:case h.LONG8:case h.SLONG8:case h.IFD8:return 8;default:throw new RangeError("Invalid field type: "+e)}}function ke(e,t,r,n){let i=null,o=null;const s=Se(t);switch(t){case h.BYTE:case h.ASCII:case h.UNDEFINED:i=new Uint8Array(r),o=e.readUint8;break;case h.SBYTE:i=new Int8Array(r),o=e.readInt8;break;case h.SHORT:i=new Uint16Array(r),o=e.readUint16;break;case h.SSHORT:i=new Int16Array(r),o=e.readInt16;break;case h.LONG:case h.IFD:i=new Uint32Array(r),o=e.readUint32;break;case h.SLONG:i=new Int32Array(r),o=e.readInt32;break;case h.LONG8:case h.IFD8:i=new Array(r),o=e.readUint64;break;case h.SLONG8:i=new Array(r),o=e.readInt64;break;case h.RATIONAL:i=new Uint32Array(2*r),o=e.readUint32;break;case h.SRATIONAL:i=new Int32Array(2*r),o=e.readInt32;break;case h.FLOAT:i=new Float32Array(r),o=e.readFloat32;break;case h.DOUBLE:i=new Float64Array(r),o=e.readFloat64;break;default:throw new RangeError("Invalid field type: "+t)}if(t!==h.RATIONAL&&t!==h.SRATIONAL)for(let t=0;t<r;++t)i[t]=o.call(e,n+t*s);else for(let t=0;t<r;t+=2)i[t]=o.call(e,n+t*s),i[t+1]=o.call(e,n+(t*s+4));return t===h.ASCII?String.fromCharCode.apply(null,i):i}class Ce{constructor(e,t,r){this.fileDirectory=e,this.geoKeyDirectory=t,this.nextIFDByteOffset=r}}class Ee extends Error{constructor(e){super("No image at index "+e),this.index=e}}class Te{async readRasters(e={}){const{window:t,width:r,height:n}=e;let{resX:i,resY:o,bbox:s}=e;const a=await this.getImage();let u=a;const c=await this.getImageCount(),l=a.getBoundingBox();if(t&&s)throw new Error(\'Both "bbox" and "window" passed.\');if(r||n){if(t){const[e,r]=a.getOrigin(),[n,i]=a.getResolution();s=[e+t[0]*n,r+t[1]*i,e+t[2]*n,r+t[3]*i]}const e=s||l;if(r){if(i)throw new Error("Both width and resX passed");i=(e[2]-e[0])/r}if(n){if(o)throw new Error("Both width and resY passed");o=(e[3]-e[1])/n}}if(i||o){const e=[];for(let t=0;t<c;++t){const r=await this.getImage(t),{SubfileType:n,NewSubfileType:i}=r.fileDirectory;(0===t||2===n||1&i)&&e.push(r)}e.sort((e,t)=>e.getWidth()-t.getWidth());for(let t=0;t<e.length;++t){const r=e[t],n=(l[2]-l[0])/r.getWidth(),s=(l[3]-l[1])/r.getHeight();if(u=r,i&&i>n||o&&o>s)break}}let f=t;if(s){const[e,t]=a.getOrigin(),[r,n]=u.getResolution(a);f=[Math.round((s[0]-e)/r),Math.round((s[1]-t)/n),Math.round((s[2]-e)/r),Math.round((s[3]-t)/n)],f=[Math.min(f[0],f[2]),Math.min(f[1],f[3]),Math.max(f[0],f[2]),Math.max(f[1],f[3])]}return u.readRasters({...e,window:f})}}class xe extends Te{constructor(e,t,r,n,i={}){super(),this.source=e,this.littleEndian=t,this.bigTiff=r,this.firstIFDOffset=n,this.cache=i.cache||!1,this.ifdRequests=[],this.ghostValues=null}async getSlice(e,t){const r=this.bigTiff?4048:1024;return new Y(await this.source.fetch(e,void 0!==t?t:r),e,this.littleEndian,this.bigTiff)}async parseFileDirectoryAt(e){const t=this.bigTiff?20:12,r=this.bigTiff?8:2;let n=await this.getSlice(e);const i=this.bigTiff?n.readUint64(e):n.readUint16(e),o=i*t+(this.bigTiff?16:6);n.covers(e,o)||(n=await this.getSlice(e,o));const s={};let u=e+(this.bigTiff?8:2);for(let e=0;e<i;u+=t,++e){const e=n.readUint16(u),t=n.readUint16(u+2),r=this.bigTiff?n.readUint64(u+4):n.readUint32(u+4);let i,o;const c=Se(t),f=u+(this.bigTiff?12:8);if(c*r<=(this.bigTiff?8:4))i=ke(n,t,r,f);else{const e=n.readOffset(f),o=Se(t)*r;if(n.covers(e,o))i=ke(n,t,r,e);else{i=ke(await this.getSlice(e,o),t,r,e)}}o=1===r&&-1===l.indexOf(e)&&t!==h.RATIONAL&&t!==h.SRATIONAL?i[0]:i,s[a[e]]=o}const c=function(e){const t=e.GeoKeyDirectory;if(!t)return null;const r={};for(let n=4;n<=4*t[3];n+=4){const i=g[t[n]],o=t[n+1]?a[t[n+1]]:null,s=t[n+2],u=t[n+3];let c=null;if(o){if(c=e[o],null==c)throw new Error(`Could not get value of geoKey \'${i}\'.`);"string"==typeof c?c=c.substring(u,u+s-1):c.subarray&&(c=c.subarray(u,u+s),1===s&&(c=c[0]))}else c=u;r[i]=c}return r}(s),f=n.readOffset(e+r+t*i);return new Ce(s,c,f)}async requestIFD(e){if(this.ifdRequests[e])return this.ifdRequests[e];if(0===e)return this.ifdRequests[e]=this.parseFileDirectoryAt(this.firstIFDOffset),this.ifdRequests[e];if(!this.ifdRequests[e-1])try{this.ifdRequests[e-1]=this.requestIFD(e-1)}catch(t){if(t instanceof Ee)throw new Ee(e);throw t}return this.ifdRequests[e]=(async()=>{const t=await this.ifdRequests[e-1];if(0===t.nextIFDByteOffset)throw new Ee(e);return this.parseFileDirectoryAt(t.nextIFDByteOffset)})(),this.ifdRequests[e]}async getImage(e=0){const t=await this.requestIFD(e);return new W(t.fileDirectory,t.geoKeyDirectory,this.dataView,this.littleEndian,this.cache,this.source)}async getImageCount(){let e=0,t=!0;for(;t;)try{await this.requestIFD(e),++e}catch(e){if(!(e instanceof Ee))throw e;t=!1}return e}async getGhostValues(){const e=this.bigTiff?16:8;if(this.ghostValues)return this.ghostValues;const t="GDAL_STRUCTURAL_METADATA_SIZE=",r=t.length+100;let n=await this.getSlice(e,r);if(t===ke(n,h.ASCII,t.length,e)){const t=ke(n,h.ASCII,r,e).split("\\n")[0],i=Number(t.split("=")[1].split(" ")[0])+t.length;i>r&&(n=await this.getSlice(e,i));const o=ke(n,h.ASCII,i,e);this.ghostValues={},o.split("\\n").filter(e=>e.length>0).map(e=>e.split("=")).forEach(([e,t])=>{this.ghostValues[e]=t})}return this.ghostValues}static async fromSource(e,t){const r=await e.fetch(0,1024),n=new V(r),i=n.getUint16(0,0);let o;if(18761===i)o=!0;else{if(19789!==i)throw new TypeError("Invalid byte order value.");o=!1}const s=n.getUint16(2,o);let a;if(42===s)a=!1;else{if(43!==s)throw new TypeError("Invalid magic number.");a=!0;if(8!==n.getUint16(4,o))throw new Error("Unsupported offset byte-size.")}const u=a?n.getUint64(8,o):n.getUint32(4,o);return new xe(e,o,a,u,t)}close(){return"function"==typeof this.source.close&&this.source.close()}}t.default=xe;class Ae extends Te{constructor(e,t){super(),this.mainFile=e,this.overviewFiles=t,this.imageFiles=[e].concat(t),this.fileDirectoriesPerFile=null,this.fileDirectoriesPerFileParsing=null,this.imageCount=null}async parseFileDirectoriesPerFile(){const e=[this.mainFile.parseFileDirectoryAt(this.mainFile.firstIFDOffset)].concat(this.overviewFiles.map(e=>e.parseFileDirectoryAt(e.firstIFDOffset)));return this.fileDirectoriesPerFile=await Promise.all(e),this.fileDirectoriesPerFile}async getImage(e=0){await this.getImageCount(),await this.parseFileDirectoriesPerFile();let t=0,r=0;for(let n=0;n<this.imageFiles.length;n++){const i=this.imageFiles[n];for(let o=0;o<this.imageCounts[n];o++){if(e===t){const e=await i.requestIFD(r);return new W(e.fileDirectory,i.geoKeyDirectory,i.dataView,i.littleEndian,i.cache,i.source)}t++,r++}r=0}throw new RangeError("Invalid image index")}async getImageCount(){if(null!==this.imageCount)return this.imageCount;const e=[this.mainFile.getImageCount()].concat(this.overviewFiles.map(e=>e.getImageCount()));return this.imageCounts=await Promise.all(e),this.imageCount=this.imageCounts.reduce((e,t)=>e+t,0),this.imageCount}}async function Oe(e,t={}){return xe.fromSource(oe(e,t))}async function Re(e){return xe.fromSource(function(e){return{fetch:async(t,r)=>e.slice(t,t+r)}}(e))}async function Ie(e){return xe.fromSource(se(e))}async function Pe(e){return xe.fromSource((t=e,{fetch:async(e,r)=>new Promise((n,i)=>{const o=t.slice(e,e+r),s=new FileReader;s.onload=e=>n(e.target.result),s.onerror=i,s.readAsArrayBuffer(o)})}));var t}async function Me(e,t=[],r={}){const n=await xe.fromSource(oe(e,r)),i=await Promise.all(t.map(e=>xe.fromSource(oe(e,r))));return new Ae(n,i)}async function De(e,t){return be(e,t)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(8);Object(n.b)().blob;const i=Object(n.b)().default},,function(e,t,r){"use strict";var n=r(12),i=r(39);var o=function(e){"function"==typeof e?e():e&&"function"==typeof e.unsubscribe&&e.unsubscribe()};t.a=function(e){const t=new i.a;let r,s=0;return new n.a(n=>{r||(r=e.subscribe(t));const i=t.subscribe(n);return s++,()=>{s--,i.unsubscribe(),0===s&&(o(r),r=void 0)}})}}]);',null)}},function(e,t,r){"use strict";var n=window.URL||window.webkitURL;e.exports=function(e,t){try{try{var r;try{(r=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder)).append(e),r=r.getBlob()}catch(t){r=new Blob([e])}return new Worker(n.createObjectURL(r))}catch(t){return new Worker("data:application/javascript,"+encodeURIComponent(e))}}catch(e){if(!t)throw Error("Inline worker is not supported");return new Worker(t)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],n=!0,i=!1,o=void 0;try{for(var s,a=e[Symbol.iterator]();!(n=(s=a.next()).done)&&(r.push(s.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{!n&&a.return&&a.return()}finally{if(i)throw o}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.default=function(e,t){return new Promise((function(r,c){try{t&&console.log("starting parseData with",e),t&&console.log("\tGeoTIFF:","undefined"==typeof GeoTIFF?"undefined":i(GeoTIFF));var l={},f=void 0,h=void 0;if("object"===e.rasterType)l.values=e.data,l.height=f=e.metadata.height||l.values[0].length,l.width=h=e.metadata.width||l.values[0][0].length,l.pixelHeight=e.metadata.pixelHeight,l.pixelWidth=e.metadata.pixelWidth,l.projection=e.metadata.projection,l.xmin=e.metadata.xmin,l.ymax=e.metadata.ymax,l.noDataValue=e.metadata.noDataValue,l.numberOfRasters=l.values.length,l.xmax=l.xmin+l.width*l.pixelWidth,l.ymin=l.ymax-l.height*l.pixelHeight,l._data=null,r(u(l));else if("geotiff"===e.rasterType){l._data=e.data;var d=o.fromArrayBuffer;"url"===e.sourceType&&(d=o.fromUrl),t&&console.log("data.rasterType is geotiff"),r(d(e.data).then((function(r){return t&&console.log("geotiff:",r),r.getImage().then((function(r){t&&console.log("image:",r);var i=r.fileDirectory,o=r.getGeoKeys(),c=o.GeographicTypeGeoKey,d=o.ProjectedCSTypeGeoKey;l.projection=c||d,t&&console.log("projection:",l.projection),l.height=f=r.getHeight(),t&&console.log("result.height:",l.height),l.width=h=r.getWidth(),t&&console.log("result.width:",l.width);var p=r.getResolution(),g=n(p,2),m=g[0],y=g[1];l.pixelHeight=Math.abs(y),l.pixelWidth=Math.abs(m);var b=r.getOrigin(),w=n(b,2),v=w[0],_=w[1];return l.xmin=v,l.xmax=l.xmin+h*l.pixelWidth,l.ymax=_,l.ymin=l.ymax-f*l.pixelHeight,l.noDataValue=i.GDAL_NODATA?parseFloat(i.GDAL_NODATA):null,l.numberOfRasters=i.SamplesPerPixel,i.ColorMap&&(l.palette=(0,s.getPalette)(r)),"url"!==e.sourceType?r.readRasters().then((function(e){return l.values=e.map((function(e){return(0,a.unflatten)(e,{height:f,width:h})})),u(l)})):l}))})))}}catch(e){c(e),console.error("[georaster] error parsing georaster:",e)}}))};var o=r(37),s=r(82),a=r(36);function u(e,t){var r=e.noDataValue,n=e.height,i=e.width;return new Promise((function(o,s){e.maxs=[],e.mins=[],e.ranges=[];for(var a=void 0,u=void 0,c=0;c<e.numberOfRasters;c++){var l=e.values[c];t&&console.log("[georaster] rows:",l);for(var f=0;f<n;f++)for(var h=l[f],d=0;d<i;d++){var p=h[d];p==r||isNaN(p)||(void 0===u||p<u?u=p:(void 0===a||p>a)&&(a=p))}e.maxs.push(a),e.mins.push(u),e.ranges.push(a-u)}o(e)}))}},function(e,t,r){"use strict";var n=r(14),i=r(52),o=r(53),s=r(54),a=r(55);function u(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function c(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function l(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new n.Buf32(852),t.distcode=t.distdyn=new n.Buf32(592),t.sane=1,t.back=-1,0):-2}function f(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,l(e)):-2}function h(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?-2:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,f(e))):-2}function d(e,t){var r,n;return e?(n=new c,e.state=n,n.window=null,0!==(r=h(e,t))&&(e.state=null),r):-2}var p,g,m=!0;function y(e){if(m){var t;for(p=new n.Buf32(512),g=new n.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(a(1,e.lens,0,288,p,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;a(2,e.lens,0,32,g,0,e.work,{bits:5}),m=!1}e.lencode=p,e.lenbits=9,e.distcode=g,e.distbits=5}function b(e,t,r,i){var o,s=e.state;return null===s.window&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new n.Buf8(s.wsize)),i>=s.wsize?(n.arraySet(s.window,t,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):((o=s.wsize-s.wnext)>i&&(o=i),n.arraySet(s.window,t,r-i,o,s.wnext),(i-=o)?(n.arraySet(s.window,t,r-i,i,0),s.wnext=i,s.whave=s.wsize):(s.wnext+=o,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=o))),0}t.inflateReset=f,t.inflateReset2=h,t.inflateResetKeep=l,t.inflateInit=function(e){return d(e,15)},t.inflateInit2=d,t.inflate=function(e,t){var r,c,l,f,h,d,p,g,m,w,v,_,k,S,T,E,x,C,A,O,R,I,P,M,D=0,L=new n.Buf8(4),U=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return-2;12===(r=e.state).mode&&(r.mode=13),h=e.next_out,l=e.output,p=e.avail_out,f=e.next_in,c=e.input,d=e.avail_in,g=r.hold,m=r.bits,w=d,v=p,I=0;e:for(;;)switch(r.mode){case 1:if(0===r.wrap){r.mode=13;break}for(;m<16;){if(0===d)break e;d--,g+=c[f++]<<m,m+=8}if(2&r.wrap&&35615===g){r.check=0,L[0]=255&g,L[1]=g>>>8&255,r.check=o(r.check,L,2,0),g=0,m=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&g)<<8)+(g>>8))%31){e.msg="incorrect header check",r.mode=30;break}if(8!=(15&g)){e.msg="unknown compression method",r.mode=30;break}if(m-=4,R=8+(15&(g>>>=4)),0===r.wbits)r.wbits=R;else if(R>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<<R,e.adler=r.check=1,r.mode=512&g?10:12,g=0,m=0;break;case 2:for(;m<16;){if(0===d)break e;d--,g+=c[f++]<<m,m+=8}if(r.flags=g,8!=(255&r.flags)){e.msg="unknown compression method",r.mode=30;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=30;break}r.head&&(r.head.text=g>>8&1),512&r.flags&&(L[0]=255&g,L[1]=g>>>8&255,r.check=o(r.check,L,2,0)),g=0,m=0,r.mode=3;case 3:for(;m<32;){if(0===d)break e;d--,g+=c[f++]<<m,m+=8}r.head&&(r.head.time=g),512&r.flags&&(L[0]=255&g,L[1]=g>>>8&255,L[2]=g>>>16&255,L[3]=g>>>24&255,r.check=o(r.check,L,4,0)),g=0,m=0,r.mode=4;case 4:for(;m<16;){if(0===d)break e;d--,g+=c[f++]<<m,m+=8}r.head&&(r.head.xflags=255&g,r.head.os=g>>8),512&r.flags&&(L[0]=255&g,L[1]=g>>>8&255,r.check=o(r.check,L,2,0)),g=0,m=0,r.mode=5;case 5:if(1024&r.flags){for(;m<16;){if(0===d)break e;d--,g+=c[f++]<<m,m+=8}r.length=g,r.head&&(r.head.extra_len=g),512&r.flags&&(L[0]=255&g,L[1]=g>>>8&255,r.check=o(r.check,L,2,0)),g=0,m=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((_=r.length)>d&&(_=d),_&&(r.head&&(R=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,c,f,_,R)),512&r.flags&&(r.check=o(r.check,c,_,f)),d-=_,f+=_,r.length-=_),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===d)break e;_=0;do{R=c[f+_++],r.head&&R&&r.length<65536&&(r.head.name+=String.fromCharCode(R))}while(R&&_<d);if(512&r.flags&&(r.check=o(r.check,c,_,f)),d-=_,f+=_,R)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===d)break e;_=0;do{R=c[f+_++],r.head&&R&&r.length<65536&&(r.head.comment+=String.fromCharCode(R))}while(R&&_<d);if(512&r.flags&&(r.check=o(r.check,c,_,f)),d-=_,f+=_,R)break e}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;m<16;){if(0===d)break e;d--,g+=c[f++]<<m,m+=8}if(g!==(65535&r.check)){e.msg="header crc mismatch",r.mode=30;break}g=0,m=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;m<32;){if(0===d)break e;d--,g+=c[f++]<<m,m+=8}e.adler=r.check=u(g),g=0,m=0,r.mode=11;case 11:if(0===r.havedict)return e.next_out=h,e.avail_out=p,e.next_in=f,e.avail_in=d,r.hold=g,r.bits=m,2;e.adler=r.check=1,r.mode=12;case 12:if(5===t||6===t)break e;case 13:if(r.last){g>>>=7&m,m-=7&m,r.mode=27;break}for(;m<3;){if(0===d)break e;d--,g+=c[f++]<<m,m+=8}switch(r.last=1&g,m-=1,3&(g>>>=1)){case 0:r.mode=14;break;case 1:if(y(r),r.mode=20,6===t){g>>>=2,m-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30}g>>>=2,m-=2;break;case 14:for(g>>>=7&m,m-=7&m;m<32;){if(0===d)break e;d--,g+=c[f++]<<m,m+=8}if((65535&g)!=(g>>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&g,g=0,m=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(_=r.length){if(_>d&&(_=d),_>p&&(_=p),0===_)break e;n.arraySet(l,c,f,_,h),d-=_,f+=_,p-=_,h+=_,r.length-=_;break}r.mode=12;break;case 17:for(;m<14;){if(0===d)break e;d--,g+=c[f++]<<m,m+=8}if(r.nlen=257+(31&g),g>>>=5,m-=5,r.ndist=1+(31&g),g>>>=5,m-=5,r.ncode=4+(15&g),g>>>=4,m-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=30;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;m<3;){if(0===d)break e;d--,g+=c[f++]<<m,m+=8}r.lens[U[r.have++]]=7&g,g>>>=3,m-=3}for(;r.have<19;)r.lens[U[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,P={bits:r.lenbits},I=a(0,r.lens,0,19,r.lencode,0,r.work,P),r.lenbits=P.bits,I){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;E=(D=r.lencode[g&(1<<r.lenbits)-1])>>>16&255,x=65535&D,!((T=D>>>24)<=m);){if(0===d)break e;d--,g+=c[f++]<<m,m+=8}if(x<16)g>>>=T,m-=T,r.lens[r.have++]=x;else{if(16===x){for(M=T+2;m<M;){if(0===d)break e;d--,g+=c[f++]<<m,m+=8}if(g>>>=T,m-=T,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}R=r.lens[r.have-1],_=3+(3&g),g>>>=2,m-=2}else if(17===x){for(M=T+3;m<M;){if(0===d)break e;d--,g+=c[f++]<<m,m+=8}m-=T,R=0,_=3+(7&(g>>>=T)),g>>>=3,m-=3}else{for(M=T+7;m<M;){if(0===d)break e;d--,g+=c[f++]<<m,m+=8}m-=T,R=0,_=11+(127&(g>>>=T)),g>>>=7,m-=7}if(r.have+_>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;_--;)r.lens[r.have++]=R}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,P={bits:r.lenbits},I=a(1,r.lens,0,r.nlen,r.lencode,0,r.work,P),r.lenbits=P.bits,I){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,P={bits:r.distbits},I=a(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,P),r.distbits=P.bits,I){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(d>=6&&p>=258){e.next_out=h,e.avail_out=p,e.next_in=f,e.avail_in=d,r.hold=g,r.bits=m,s(e,v),h=e.next_out,l=e.output,p=e.avail_out,f=e.next_in,c=e.input,d=e.avail_in,g=r.hold,m=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;E=(D=r.lencode[g&(1<<r.lenbits)-1])>>>16&255,x=65535&D,!((T=D>>>24)<=m);){if(0===d)break e;d--,g+=c[f++]<<m,m+=8}if(E&&0==(240&E)){for(C=T,A=E,O=x;E=(D=r.lencode[O+((g&(1<<C+A)-1)>>C)])>>>16&255,x=65535&D,!(C+(T=D>>>24)<=m);){if(0===d)break e;d--,g+=c[f++]<<m,m+=8}g>>>=C,m-=C,r.back+=C}if(g>>>=T,m-=T,r.back+=T,r.length=x,0===E){r.mode=26;break}if(32&E){r.back=-1,r.mode=12;break}if(64&E){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&E,r.mode=22;case 22:if(r.extra){for(M=r.extra;m<M;){if(0===d)break e;d--,g+=c[f++]<<m,m+=8}r.length+=g&(1<<r.extra)-1,g>>>=r.extra,m-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;E=(D=r.distcode[g&(1<<r.distbits)-1])>>>16&255,x=65535&D,!((T=D>>>24)<=m);){if(0===d)break e;d--,g+=c[f++]<<m,m+=8}if(0==(240&E)){for(C=T,A=E,O=x;E=(D=r.distcode[O+((g&(1<<C+A)-1)>>C)])>>>16&255,x=65535&D,!(C+(T=D>>>24)<=m);){if(0===d)break e;d--,g+=c[f++]<<m,m+=8}g>>>=C,m-=C,r.back+=C}if(g>>>=T,m-=T,r.back+=T,64&E){e.msg="invalid distance code",r.mode=30;break}r.offset=x,r.extra=15&E,r.mode=24;case 24:if(r.extra){for(M=r.extra;m<M;){if(0===d)break e;d--,g+=c[f++]<<m,m+=8}r.offset+=g&(1<<r.extra)-1,g>>>=r.extra,m-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===p)break e;if(_=v-p,r.offset>_){if((_=r.offset-_)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}_>r.wnext?(_-=r.wnext,k=r.wsize-_):k=r.wnext-_,_>r.length&&(_=r.length),S=r.window}else S=l,k=h-r.offset,_=r.length;_>p&&(_=p),p-=_,r.length-=_;do{l[h++]=S[k++]}while(--_);0===r.length&&(r.mode=21);break;case 26:if(0===p)break e;l[h++]=r.length,p--,r.mode=21;break;case 27:if(r.wrap){for(;m<32;){if(0===d)break e;d--,g|=c[f++]<<m,m+=8}if(v-=p,e.total_out+=v,r.total+=v,v&&(e.adler=r.check=r.flags?o(r.check,l,v,h-v):i(r.check,l,v,h-v)),v=p,(r.flags?g:u(g))!==r.check){e.msg="incorrect data check",r.mode=30;break}g=0,m=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;m<32;){if(0===d)break e;d--,g+=c[f++]<<m,m+=8}if(g!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=30;break}g=0,m=0}r.mode=29;case 29:I=1;break e;case 30:I=-3;break e;case 31:return-4;case 32:default:return-2}return e.next_out=h,e.avail_out=p,e.next_in=f,e.avail_in=d,r.hold=g,r.bits=m,(r.wsize||v!==e.avail_out&&r.mode<30&&(r.mode<27||4!==t))&&b(e,e.output,e.next_out,v-e.avail_out)?(r.mode=31,-4):(w-=e.avail_in,v-=e.avail_out,e.total_in+=w,e.total_out+=v,r.total+=v,r.wrap&&v&&(e.adler=r.check=r.flags?o(r.check,l,v,e.next_out-v):i(r.check,l,v,e.next_out-v)),e.data_type=r.bits+(r.last?64:0)+(12===r.mode?128:0)+(20===r.mode||15===r.mode?256:0),(0===w&&0===v||4===t)&&0===I&&(I=-5),I)},t.inflateEnd=function(e){if(!e||!e.state)return-2;var t=e.state;return t.window&&(t.window=null),e.state=null,0},t.inflateGetHeader=function(e,t){var r;return e&&e.state?0==(2&(r=e.state).wrap)?-2:(r.head=t,t.done=!1,0):-2},t.inflateSetDictionary=function(e,t){var r,n=t.length;return e&&e.state?0!==(r=e.state).wrap&&11!==r.mode?-2:11===r.mode&&i(1,t,n,0)!==r.check?-3:b(e,t,n,n)?(r.mode=31,-4):(r.havedict=1,0):-2},t.inflateInfo="pako inflate (from Nodeca project)"},function(e,t,r){"use strict";e.exports=function(e,t,r,n){for(var i=65535&e|0,o=e>>>16&65535|0,s=0;0!==r;){r-=s=r>2e3?2e3:r;do{o=o+(i=i+t[n++]|0)|0}while(--s);i%=65521,o%=65521}return i|o<<16|0}},function(e,t,r){"use strict";var n=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();e.exports=function(e,t,r,i){var o=n,s=i+r;e^=-1;for(var a=i;a<s;a++)e=e>>>8^o[255&(e^t[a])];return-1^e}},function(e,t,r){"use strict";e.exports=function(e,t){var r,n,i,o,s,a,u,c,l,f,h,d,p,g,m,y,b,w,v,_,k,S,T,E,x;r=e.state,n=e.next_in,E=e.input,i=n+(e.avail_in-5),o=e.next_out,x=e.output,s=o-(t-e.avail_out),a=o+(e.avail_out-257),u=r.dmax,c=r.wsize,l=r.whave,f=r.wnext,h=r.window,d=r.hold,p=r.bits,g=r.lencode,m=r.distcode,y=(1<<r.lenbits)-1,b=(1<<r.distbits)-1;e:do{p<15&&(d+=E[n++]<<p,p+=8,d+=E[n++]<<p,p+=8),w=g[d&y];t:for(;;){if(d>>>=v=w>>>24,p-=v,0===(v=w>>>16&255))x[o++]=65535&w;else{if(!(16&v)){if(0==(64&v)){w=g[(65535&w)+(d&(1<<v)-1)];continue t}if(32&v){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}_=65535&w,(v&=15)&&(p<v&&(d+=E[n++]<<p,p+=8),_+=d&(1<<v)-1,d>>>=v,p-=v),p<15&&(d+=E[n++]<<p,p+=8,d+=E[n++]<<p,p+=8),w=m[d&b];r:for(;;){if(d>>>=v=w>>>24,p-=v,!(16&(v=w>>>16&255))){if(0==(64&v)){w=m[(65535&w)+(d&(1<<v)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(k=65535&w,p<(v&=15)&&(d+=E[n++]<<p,(p+=8)<v&&(d+=E[n++]<<p,p+=8)),(k+=d&(1<<v)-1)>u){e.msg="invalid distance too far back",r.mode=30;break e}if(d>>>=v,p-=v,k>(v=o-s)){if((v=k-v)>l&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(S=0,T=h,0===f){if(S+=c-v,v<_){_-=v;do{x[o++]=h[S++]}while(--v);S=o-k,T=x}}else if(f<v){if(S+=c+f-v,(v-=f)<_){_-=v;do{x[o++]=h[S++]}while(--v);if(S=0,f<_){_-=v=f;do{x[o++]=h[S++]}while(--v);S=o-k,T=x}}}else if(S+=f-v,v<_){_-=v;do{x[o++]=h[S++]}while(--v);S=o-k,T=x}for(;_>2;)x[o++]=T[S++],x[o++]=T[S++],x[o++]=T[S++],_-=3;_&&(x[o++]=T[S++],_>1&&(x[o++]=T[S++]))}else{S=o-k;do{x[o++]=x[S++],x[o++]=x[S++],x[o++]=x[S++],_-=3}while(_>2);_&&(x[o++]=x[S++],_>1&&(x[o++]=x[S++]))}break}}break}}while(n<i&&o<a);n-=_=p>>3,d&=(1<<(p-=_<<3))-1,e.next_in=n,e.next_out=o,e.avail_in=n<i?i-n+5:5-(n-i),e.avail_out=o<a?a-o+257:257-(o-a),r.hold=d,r.bits=p}},function(e,t,r){"use strict";var n=r(14),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],s=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],a=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(e,t,r,u,c,l,f,h){var d,p,g,m,y,b,w,v,_,k=h.bits,S=0,T=0,E=0,x=0,C=0,A=0,O=0,R=0,I=0,P=0,M=null,D=0,L=new n.Buf16(16),U=new n.Buf16(16),F=null,j=0;for(S=0;S<=15;S++)L[S]=0;for(T=0;T<u;T++)L[t[r+T]]++;for(C=k,x=15;x>=1&&0===L[x];x--);if(C>x&&(C=x),0===x)return c[l++]=20971520,c[l++]=20971520,h.bits=1,0;for(E=1;E<x&&0===L[E];E++);for(C<E&&(C=E),R=1,S=1;S<=15;S++)if(R<<=1,(R-=L[S])<0)return-1;if(R>0&&(0===e||1!==x))return-1;for(U[1]=0,S=1;S<15;S++)U[S+1]=U[S]+L[S];for(T=0;T<u;T++)0!==t[r+T]&&(f[U[t[r+T]]++]=T);if(0===e?(M=F=f,b=19):1===e?(M=i,D-=257,F=o,j-=257,b=256):(M=s,F=a,b=-1),P=0,T=0,S=E,y=l,A=C,O=0,g=-1,m=(I=1<<C)-1,1===e&&I>852||2===e&&I>592)return 1;for(;;){w=S-O,f[T]<b?(v=0,_=f[T]):f[T]>b?(v=F[j+f[T]],_=M[D+f[T]]):(v=96,_=0),d=1<<S-O,E=p=1<<A;do{c[y+(P>>O)+(p-=d)]=w<<24|v<<16|_|0}while(0!==p);for(d=1<<S-1;P&d;)d>>=1;if(0!==d?(P&=d-1,P+=d):P=0,T++,0==--L[S]){if(S===x)break;S=t[r+f[T]]}if(S>C&&(P&m)!==g){for(0===O&&(O=C),y+=E,R=1<<(A=S-O);A+O<x&&!((R-=L[A+O])<=0);)A++,R<<=1;if(I+=1<<A,1===e&&I>852||2===e&&I>592)return 1;c[g=P&m]=C<<24|A<<16|y-l|0}}return 0!==P&&(c[y+P]=S-O<<24|64<<16|0),h.bits=C,0}},function(e,t,r){"use strict";var n=r(14),i=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(e){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){o=!1}for(var s=new n.Buf8(256),a=0;a<256;a++)s[a]=a>=252?6:a>=248?5:a>=240?4:a>=224?3:a>=192?2:1;function u(e,t){if(t<65534&&(e.subarray&&o||!e.subarray&&i))return String.fromCharCode.apply(null,n.shrinkBuf(e,t));for(var r="",s=0;s<t;s++)r+=String.fromCharCode(e[s]);return r}s[254]=s[254]=1,t.string2buf=function(e){var t,r,i,o,s,a=e.length,u=0;for(o=0;o<a;o++)55296==(64512&(r=e.charCodeAt(o)))&&o+1<a&&56320==(64512&(i=e.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(i-56320),o++),u+=r<128?1:r<2048?2:r<65536?3:4;for(t=new n.Buf8(u),s=0,o=0;s<u;o++)55296==(64512&(r=e.charCodeAt(o)))&&o+1<a&&56320==(64512&(i=e.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(i-56320),o++),r<128?t[s++]=r:r<2048?(t[s++]=192|r>>>6,t[s++]=128|63&r):r<65536?(t[s++]=224|r>>>12,t[s++]=128|r>>>6&63,t[s++]=128|63&r):(t[s++]=240|r>>>18,t[s++]=128|r>>>12&63,t[s++]=128|r>>>6&63,t[s++]=128|63&r);return t},t.buf2binstring=function(e){return u(e,e.length)},t.binstring2buf=function(e){for(var t=new n.Buf8(e.length),r=0,i=t.length;r<i;r++)t[r]=e.charCodeAt(r);return t},t.buf2string=function(e,t){var r,n,i,o,a=t||e.length,c=new Array(2*a);for(n=0,r=0;r<a;)if((i=e[r++])<128)c[n++]=i;else if((o=s[i])>4)c[n++]=65533,r+=o-1;else{for(i&=2===o?31:3===o?15:7;o>1&&r<a;)i=i<<6|63&e[r++],o--;o>1?c[n++]=65533:i<65536?c[n++]=i:(i-=65536,c[n++]=55296|i>>10&1023,c[n++]=56320|1023&i)}return u(c,n)},t.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+s[e[r]]>t?r:t}},function(e,t,r){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},function(e,t,r){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},function(e,t,r){"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},function(e,t,r){"use strict";e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},function(e,t,r){e.exports=r.p+"0.georaster.browser.bundle.min.worker.js"},function(e,t,r){e.exports=function(e){function t(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return n.colors[Math.abs(t)%n.colors.length]}function n(e){let r;function s(...e){if(!s.enabled)return;const t=s,i=Number(new Date),o=i-(r||i);t.diff=o,t.prev=r,t.curr=i,r=i,e[0]=n.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(r,i)=>{if("%%"===r)return r;a++;const o=n.formatters[i];if("function"==typeof o){const n=e[a];r=o.call(t,n),e.splice(a,1),a--}return r}),n.formatArgs.call(t,e);(t.log||n.log).apply(t,e)}return s.namespace=e,s.enabled=n.enabled(e),s.useColors=n.useColors(),s.color=t(e),s.destroy=i,s.extend=o,"function"==typeof n.init&&n.init(s),n.instances.push(s),s}function i(){const e=n.instances.indexOf(this);return-1!==e&&(n.instances.splice(e,1),!0)}function o(e,t){const r=n(this.namespace+(void 0===t?":":t)+e);return r.log=this.log,r}function s(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return n.debug=n,n.default=n,n.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},n.disable=function(){const e=[...n.names.map(s),...n.skips.map(s).map(e=>"-"+e)].join(",");return n.enable(""),e},n.enable=function(e){let t;n.save(e),n.names=[],n.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),i=r.length;for(t=0;t<i;t++)r[t]&&("-"===(e=r[t].replace(/\*/g,".*?"))[0]?n.skips.push(new RegExp("^"+e.substr(1)+"$")):n.names.push(new RegExp("^"+e+"$")));for(t=0;t<n.instances.length;t++){const e=n.instances[t];e.enabled=n.enabled(e.namespace)}},n.enabled=function(e){if("*"===e[e.length-1])return!0;let t,r;for(t=0,r=n.skips.length;t<r;t++)if(n.skips[t].test(e))return!1;for(t=0,r=n.names.length;t<r;t++)if(n.names[t].test(e))return!0;return!1},n.humanize=r(63),Object.keys(e).forEach(t=>{n[t]=e[t]}),n.instances=[],n.names=[],n.skips=[],n.formatters={},n.selectColor=t,n.enable(n.load()),n}},function(e,t){var r=1e3,n=6e4,i=60*n,o=24*i;function s(e,t,r,n){var i=t>=1.5*r;return Math.round(e/r)+" "+n+(i?"s":"")}e.exports=function(e,t){t=t||{};var a=typeof e;if("string"===a&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var s=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return 6048e5*s;case"days":case"day":case"d":return s*o;case"hours":case"hour":case"hrs":case"hr":case"h":return s*i;case"minutes":case"minute":case"mins":case"min":case"m":return s*n;case"seconds":case"second":case"secs":case"sec":case"s":return s*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}(e);if("number"===a&&isFinite(e))return t.long?function(e){var t=Math.abs(e);if(t>=o)return s(e,t,o,"day");if(t>=i)return s(e,t,i,"hour");if(t>=n)return s(e,t,n,"minute");if(t>=r)return s(e,t,r,"second");return e+" ms"}(e):function(e){var t=Math.abs(e);if(t>=o)return Math.round(e/o)+"d";if(t>=i)return Math.round(e/i)+"h";if(t>=n)return Math.round(e/n)+"m";if(t>=r)return Math.round(e/r)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t,r){(function(t,n,i){var o=r(26),s=r(6),a=r(27),u=r(28),c=r(73),l=a.IncomingMessage,f=a.readyStates;var h=e.exports=function(e){var r,n=this;u.Writable.call(n),n._opts=e,n._body=[],n._headers={},e.auth&&n.setHeader("Authorization","Basic "+new t(e.auth).toString("base64")),Object.keys(e.headers).forEach((function(t){n.setHeader(t,e.headers[t])}));var i=!0;if("disable-fetch"===e.mode||"requestTimeout"in e&&!o.abortController)i=!1,r=!0;else if("prefer-streaming"===e.mode)r=!1;else if("allow-wrong-content-type"===e.mode)r=!o.overrideMimeType;else{if(e.mode&&"default"!==e.mode&&"prefer-fast"!==e.mode)throw new Error("Invalid value for opts.mode");r=!0}n._mode=function(e,t){return o.fetch&&t?"fetch":o.mozchunkedarraybuffer?"moz-chunked-arraybuffer":o.msstream?"ms-stream":o.arraybuffer&&e?"arraybuffer":o.vbArray&&e?"text:vbarray":"text"}(r,i),n._fetchTimer=null,n.on("finish",(function(){n._onFinish()}))};s(h,u.Writable),h.prototype.setHeader=function(e,t){var r=e.toLowerCase();-1===d.indexOf(r)&&(this._headers[r]={name:e,value:t})},h.prototype.getHeader=function(e){var t=this._headers[e.toLowerCase()];return t?t.value:null},h.prototype.removeHeader=function(e){delete this._headers[e.toLowerCase()]},h.prototype._onFinish=function(){var e=this;if(!e._destroyed){var r=e._opts,s=e._headers,a=null;"GET"!==r.method&&"HEAD"!==r.method&&(a=o.arraybuffer?c(t.concat(e._body)):o.blobConstructor?new n.Blob(e._body.map((function(e){return c(e)})),{type:(s["content-type"]||{}).value||""}):t.concat(e._body).toString());var u=[];if(Object.keys(s).forEach((function(e){var t=s[e].name,r=s[e].value;Array.isArray(r)?r.forEach((function(e){u.push([t,e])})):u.push([t,r])})),"fetch"===e._mode){var l=null;if(o.abortController){var h=new AbortController;l=h.signal,e._fetchAbortController=h,"requestTimeout"in r&&0!==r.requestTimeout&&(e._fetchTimer=n.setTimeout((function(){e.emit("requestTimeout"),e._fetchAbortController&&e._fetchAbortController.abort()}),r.requestTimeout))}n.fetch(e._opts.url,{method:e._opts.method,headers:u,body:a||void 0,mode:"cors",credentials:r.withCredentials?"include":"same-origin",signal:l}).then((function(t){e._fetchResponse=t,e._connect()}),(function(t){n.clearTimeout(e._fetchTimer),e._destroyed||e.emit("error",t)}))}else{var d=e._xhr=new n.XMLHttpRequest;try{d.open(e._opts.method,e._opts.url,!0)}catch(t){return void i.nextTick((function(){e.emit("error",t)}))}"responseType"in d&&(d.responseType=e._mode.split(":")[0]),"withCredentials"in d&&(d.withCredentials=!!r.withCredentials),"text"===e._mode&&"overrideMimeType"in d&&d.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in r&&(d.timeout=r.requestTimeout,d.ontimeout=function(){e.emit("requestTimeout")}),u.forEach((function(e){d.setRequestHeader(e[0],e[1])})),e._response=null,d.onreadystatechange=function(){switch(d.readyState){case f.LOADING:case f.DONE:e._onXHRProgress()}},"moz-chunked-arraybuffer"===e._mode&&(d.onprogress=function(){e._onXHRProgress()}),d.onerror=function(){e._destroyed||e.emit("error",new Error("XHR error"))};try{d.send(a)}catch(t){return void i.nextTick((function(){e.emit("error",t)}))}}}},h.prototype._onXHRProgress=function(){(function(e){try{var t=e.status;return null!==t&&0!==t}catch(e){return!1}})(this._xhr)&&!this._destroyed&&(this._response||this._connect(),this._response._onXHRProgress())},h.prototype._connect=function(){var e=this;e._destroyed||(e._response=new l(e._xhr,e._fetchResponse,e._mode,e._fetchTimer),e._response.on("error",(function(t){e.emit("error",t)})),e.emit("response",e._response))},h.prototype._write=function(e,t,r){this._body.push(e),r()},h.prototype.abort=h.prototype.destroy=function(){this._destroyed=!0,n.clearTimeout(this._fetchTimer),this._response&&(this._response._destroyed=!0),this._xhr?this._xhr.abort():this._fetchAbortController&&this._fetchAbortController.abort()},h.prototype.end=function(e,t,r){"function"==typeof e&&(r=e,e=void 0),u.Writable.prototype.end.call(this,e,t,r)},h.prototype.flushHeaders=function(){},h.prototype.setTimeout=function(){},h.prototype.setNoDelay=function(){},h.prototype.setSocketKeepAlive=function(){};var d=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]}).call(this,r(2).Buffer,r(1),r(3))},function(e,t){},function(e,t,r){"use strict";var n=r(20).Buffer,i=r(67);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var t,r,i,o=n.allocUnsafe(e>>>0),s=this.head,a=0;s;)t=s.data,r=o,i=a,t.copy(r,i),a+=s.data.length,s=s.next;return o},e}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,r){(function(e){var n=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new o(i.call(setTimeout,n,arguments),clearTimeout)},t.setInterval=function(){return new o(i.call(setInterval,n,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(n,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r(69),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,r(1))},function(e,t,r){(function(e,t){!function(e,r){"use strict";if(!e.setImmediate){var n,i,o,s,a,u=1,c={},l=!1,f=e.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(e);h=h&&h.setTimeout?h:e,"[object process]"==={}.toString.call(e.process)?n=function(e){t.nextTick((function(){p(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){p(e.data)},n=function(e){o.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(i=f.documentElement,n=function(e){var t=f.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):n=function(e){setTimeout(p,0,e)}:(s="setImmediate$"+Math.random()+"$",a=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(s)&&p(+t.data.slice(s.length))},e.addEventListener?e.addEventListener("message",a,!1):e.attachEvent("onmessage",a),n=function(t){e.postMessage(s+t,"*")}),h.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r<t.length;r++)t[r]=arguments[r+1];var i={callback:e,args:t};return c[u]=i,n(u),u++},h.clearImmediate=d}function d(e){delete c[e]}function p(e){if(l)setTimeout(p,0,e);else{var t=c[e];if(t){l=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(void 0,r)}}(t)}finally{d(e),l=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,r(1),r(3))},function(e,t,r){(function(t){function r(e){try{if(!t.localStorage)return!1}catch(e){return!1}var r=t.localStorage[e];return null!=r&&"true"===String(r).toLowerCase()}e.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}}).call(this,r(1))},function(e,t,r){
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
var n=r(2),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},function(e,t,r){"use strict";e.exports=o;var n=r(35),i=Object.create(r(10));function o(e){if(!(this instanceof o))return new o(e);n.call(this,e)}i.inherits=r(6),i.inherits(o,n),o.prototype._transform=function(e,t,r){r(null,e)}},function(e,t,r){var n=r(2).Buffer;e.exports=function(e){if(e instanceof Uint8Array){if(0===e.byteOffset&&e.byteLength===e.buffer.byteLength)return e.buffer;if("function"==typeof e.buffer.slice)return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}if(n.isBuffer(e)){for(var t=new Uint8Array(e.length),r=e.length,i=0;i<r;i++)t[i]=e[i];return t.buffer}throw new Error("Argument must be a Buffer")}},function(e,t){e.exports=function(){for(var e={},t=0;t<arguments.length;t++){var n=arguments[t];for(var i in n)r.call(n,i)&&(e[i]=n[i])}return e};var r=Object.prototype.hasOwnProperty},function(e,t){e.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},function(e,t,r){(function(e,n){var i;/*! https://mths.be/punycode v1.4.1 by @mathias */!function(o){t&&t.nodeType,e&&e.nodeType;var s="object"==typeof n&&n;s.global!==s&&s.window!==s&&s.self;var a,u=2147483647,c=/^xn--/,l=/[^\x20-\x7E]/,f=/[\x2E\u3002\uFF0E\uFF61]/g,h={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=Math.floor,p=String.fromCharCode;function g(e){throw new RangeError(h[e])}function m(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function y(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+m((e=e.replace(f,".")).split("."),t).join(".")}function b(e){for(var t,r,n=[],i=0,o=e.length;i<o;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<o?56320==(64512&(r=e.charCodeAt(i++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),i--):n.push(t);return n}function w(e){return m(e,(function(e){var t="";return e>65535&&(t+=p((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=p(e)})).join("")}function v(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function _(e,t,r){var n=0;for(e=r?d(e/700):e>>1,e+=d(e/t);e>455;n+=36)e=d(e/35);return d(n+36*e/(e+38))}function k(e){var t,r,n,i,o,s,a,c,l,f,h,p=[],m=e.length,y=0,b=128,v=72;for((r=e.lastIndexOf("-"))<0&&(r=0),n=0;n<r;++n)e.charCodeAt(n)>=128&&g("not-basic"),p.push(e.charCodeAt(n));for(i=r>0?r+1:0;i<m;){for(o=y,s=1,a=36;i>=m&&g("invalid-input"),((c=(h=e.charCodeAt(i++))-48<10?h-22:h-65<26?h-65:h-97<26?h-97:36)>=36||c>d((u-y)/s))&&g("overflow"),y+=c*s,!(c<(l=a<=v?1:a>=v+26?26:a-v));a+=36)s>d(u/(f=36-l))&&g("overflow"),s*=f;v=_(y-o,t=p.length+1,0==o),d(y/t)>u-b&&g("overflow"),b+=d(y/t),y%=t,p.splice(y++,0,b)}return w(p)}function S(e){var t,r,n,i,o,s,a,c,l,f,h,m,y,w,k,S=[];for(m=(e=b(e)).length,t=128,r=0,o=72,s=0;s<m;++s)(h=e[s])<128&&S.push(p(h));for(n=i=S.length,i&&S.push("-");n<m;){for(a=u,s=0;s<m;++s)(h=e[s])>=t&&h<a&&(a=h);for(a-t>d((u-r)/(y=n+1))&&g("overflow"),r+=(a-t)*y,t=a,s=0;s<m;++s)if((h=e[s])<t&&++r>u&&g("overflow"),h==t){for(c=r,l=36;!(c<(f=l<=o?1:l>=o+26?26:l-o));l+=36)k=c-f,w=36-f,S.push(p(v(f+k%w,0))),c=d(k/w);S.push(p(v(c,0))),o=_(r,y,n==i),r=0,++n}++r,++t}return S.join("")}a={version:"1.4.1",ucs2:{decode:b,encode:w},decode:k,encode:S,toASCII:function(e){return y(e,(function(e){return l.test(e)?"xn--"+S(e):e}))},toUnicode:function(e){return y(e,(function(e){return c.test(e)?k(e.slice(4).toLowerCase()):e}))}},void 0===(i=function(){return a}.call(t,r,t,e))||(e.exports=i)}()}).call(this,r(77)(e),r(1))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t,r){"use strict";t.decode=t.parse=r(80),t.encode=t.stringify=r(81)},function(e,t,r){"use strict";function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,r,o){t=t||"&",r=r||"=";var s={};if("string"!=typeof e||0===e.length)return s;var a=/\+/g;e=e.split(t);var u=1e3;o&&"number"==typeof o.maxKeys&&(u=o.maxKeys);var c=e.length;u>0&&c>u&&(c=u);for(var l=0;l<c;++l){var f,h,d,p,g=e[l].replace(a,"%20"),m=g.indexOf(r);m>=0?(f=g.substr(0,m),h=g.substr(m+1)):(f=g,h=""),d=decodeURIComponent(f),p=decodeURIComponent(h),n(s,d)?i(s[d])?s[d].push(p):s[d]=[s[d],p]:s[d]=p}return s};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,r){"use strict";var n=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,r,a){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?o(s(e),(function(s){var a=encodeURIComponent(n(s))+r;return i(e[s])?o(e[s],(function(e){return a+encodeURIComponent(n(e))})).join(t):a+encodeURIComponent(n(e[s]))})).join(t):a?encodeURIComponent(n(a))+r+encodeURIComponent(n(e)):""};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function o(e,t){if(e.map)return e.map(t);for(var r=[],n=0;n<e.length;n++)r.push(t(e[n],n));return r}var s=Object.keys||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t}},function(e,t){e.exports={getPalette:(e,{debug:t=!1}={debug:!1})=>{t&&console.log("starting getPalette with image",e);const{fileDirectory:r}=e,{BitsPerSample:n,ColorMap:i,ImageLength:o,ImageWidth:s,PhotometricInterpretation:a,SampleFormat:u,SamplesPerPixel:c}=r;if(!i)throw new Error("[geotiff-palette]: the image does not contain a color map, so we can't make a palette.");const l=Math.pow(2,n);t&&console.log("[geotiff-palette]: count:",l);const f=i.length/3;if(t&&console.log("[geotiff-palette]: bandSize:",f),f!==l)throw new Error("[geotiff-palette]: can't handle situations where the color map has more or less values than the number of possible values in a raster");const h=f,d=h+f,p=[];for(let e=0;e<l;e++)p.push([Math.floor(i[e]/256),Math.floor(i[h+e]/256),Math.floor(i[d+e]/256),255]);return t&&console.log("[geotiff-palette]: result is ",p),p}}},function(e,t,r){"use strict";function n(e,t){if("undefined"==typeof ImageData)throw"toCanvas is not supported in your environment";{const r=document.createElement("CANVAS"),n=t&&t.height?Math.min(e.height,t.height):Math.min(e.height,100),i=t&&t.width?Math.min(e.width,t.width):Math.min(e.width,100);r.height=n,r.width=i,r.style.minHeight="200px",r.style.minWidth="400px",r.style.maxWidth="100%";const o=r.getContext("2d"),s=function(e,t,r){if(e.values){const{noDataValue:n,mins:i,ranges:o,values:s}=e,a=s.length,u=e.width/t,c=e.height/r,l=new Uint8ClampedArray(t*r*4);for(let e=0;e<r;e++)for(let r=0;r<t;r++){const f=Math.round(e*c),h=Math.round(r*u),d=s.map(e=>{try{return e[f][h]}catch(e){console.error(e)}});if(d.every(e=>void 0!==e&&e!==n)){const n=e*(4*t)+4*r;if(1===a){const e=Math.round(d[0]),t=Math.round((e-i[0])/o[0]*255);l[n]=t,l[n+1]=t,l[n+2]=t,l[n+3]=255}else if(3===a)try{const[e,t,r]=d;l[n]=e,l[n+1]=t,l[n+2]=r,l[n+3]=255}catch(e){console.error(e)}else if(4===a)try{const[e,t,r,i]=d;l[n]=e,l[n+1]=t,l[n+2]=r,l[n+3]=i}catch(e){console.error(e)}}}return new ImageData(l,t,r)}}(e,i,n);return o.putImageData(s,0,0),r}}r.r(t),r.d(t,"default",(function(){return n}))},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(8);Object(n.b)().blob;const i=Object(n.b)().default},,function(e,t,r){"use strict";var n=r(12),i=r(40);var o=function(e){"function"==typeof e?e():e&&"function"==typeof e.unsubscribe&&e.unsubscribe()};t.a=function(e){const t=new i.a;let r,s=0;return new n.a(n=>{r||(r=e.subscribe(t));const i=t.subscribe(n);return s++,()=>{s--,i.unsubscribe(),0===s&&(o(r),r=void 0)}})}}])}));
|
'use strict';
const MongooseMap = require('../../types/map');
const SkipPopulateValue = require('./SkipPopulateValue');
const assignRawDocsToIdStructure = require('./assignRawDocsToIdStructure');
const get = require('../get');
const getVirtual = require('./getVirtual');
const leanPopulateMap = require('./leanPopulateMap');
const lookupLocalFields = require('./lookupLocalFields');
const markArraySubdocsPopulated = require('./markArraySubdocsPopulated');
const mpath = require('mpath');
const sift = require('sift').default;
const utils = require('../../utils');
const { populateModelSymbol } = require('../symbols');
module.exports = function assignVals(o) {
// Options that aren't explicitly listed in `populateOptions`
const userOptions = Object.assign({}, get(o, 'allOptions.options.options'), get(o, 'allOptions.options'));
// `o.options` contains options explicitly listed in `populateOptions`, like
// `match` and `limit`.
const populateOptions = Object.assign({}, o.options, userOptions, {
justOne: o.justOne
});
populateOptions.$nullIfNotFound = o.isVirtual;
const populatedModel = o.populatedModel;
const originalIds = [].concat(o.rawIds);
// replace the original ids in our intermediate _ids structure
// with the documents found by query
o.allIds = [].concat(o.allIds);
assignRawDocsToIdStructure(o.rawIds, o.rawDocs, o.rawOrder, populateOptions);
// now update the original documents being populated using the
// result structure that contains real documents.
const docs = o.docs;
const rawIds = o.rawIds;
const options = o.options;
const count = o.count && o.isVirtual;
let i;
function setValue(val) {
if (count) {
return val;
}
if (val instanceof SkipPopulateValue) {
return val.val;
}
if (val === void 0) {
return val;
}
const _allIds = o.allIds[i];
if (o.justOne === true && Array.isArray(val)) {
// Might be an embedded discriminator (re: gh-9244) with multiple models, so make sure to pick the right
// model before assigning.
const ret = [];
for (const doc of val) {
const _docPopulatedModel = leanPopulateMap.get(doc);
if (_docPopulatedModel == null || _docPopulatedModel === populatedModel) {
ret.push(doc);
}
}
// Since we don't want to have to create a new mongoosearray, make sure to
// modify the array in place
while (val.length > ret.length) {
Array.prototype.pop.apply(val, []);
}
for (let i = 0; i < ret.length; ++i) {
val[i] = ret[i];
}
return valueFilter(val[0], options, populateOptions, _allIds);
} else if (o.justOne === false && !Array.isArray(val)) {
return valueFilter([val], options, populateOptions, _allIds);
}
return valueFilter(val, options, populateOptions, _allIds);
}
for (i = 0; i < docs.length; ++i) {
const _path = o.path.endsWith('.$*') ? o.path.slice(0, -3) : o.path;
const existingVal = mpath.get(_path, docs[i], lookupLocalFields);
if (existingVal == null && !getVirtual(o.originalModel.schema, _path)) {
continue;
}
let valueToSet;
if (count) {
valueToSet = numDocs(rawIds[i]);
} else if (Array.isArray(o.match)) {
valueToSet = Array.isArray(rawIds[i]) ?
rawIds[i].filter(sift(o.match[i])) :
[rawIds[i]].filter(sift(o.match[i]))[0];
} else {
valueToSet = rawIds[i];
}
// If we're populating a map, the existing value will be an object, so
// we need to transform again
const originalSchema = o.originalModel.schema;
const isDoc = get(docs[i], '$__', null) != null;
let isMap = isDoc ?
existingVal instanceof Map :
utils.isPOJO(existingVal);
// If we pass the first check, also make sure the local field's schematype
// is map (re: gh-6460)
isMap = isMap && get(originalSchema._getSchema(_path), '$isSchemaMap');
if (!o.isVirtual && isMap) {
const _keys = existingVal instanceof Map ?
Array.from(existingVal.keys()) :
Object.keys(existingVal);
valueToSet = valueToSet.reduce((cur, v, i) => {
cur.set(_keys[i], v);
return cur;
}, new Map());
}
if (isDoc && Array.isArray(valueToSet)) {
for (const val of valueToSet) {
if (val != null && val.$__ != null) {
val.$__.parent = docs[i];
}
}
} else if (isDoc && valueToSet != null && valueToSet.$__ != null) {
valueToSet.$__.parent = docs[i];
}
if (o.isVirtual && isDoc) {
docs[i].$populated(_path, o.justOne ? originalIds[0] : originalIds, o.allOptions);
// If virtual populate and doc is already init-ed, need to walk through
// the actual doc to set rather than setting `_doc` directly
if (Array.isArray(valueToSet)) {
valueToSet = valueToSet.map(v => v == null ? void 0 : v);
}
mpath.set(_path, valueToSet, docs[i], void 0, setValue, false);
continue;
}
const parts = _path.split('.');
let cur = docs[i];
const curPath = parts[0];
for (let j = 0; j < parts.length - 1; ++j) {
// If we get to an array with a dotted path, like `arr.foo`, don't set
// `foo` on the array.
if (Array.isArray(cur) && !utils.isArrayIndex(parts[j])) {
break;
}
if (parts[j] === '$*') {
break;
}
if (cur[parts[j]] == null) {
// If nothing to set, avoid creating an unnecessary array. Otherwise
// we'll end up with a single doc in the array with only defaults.
// See gh-8342, gh-8455
const schematype = originalSchema._getSchema(curPath);
if (valueToSet == null && schematype != null && schematype.$isMongooseArray) {
break;
}
cur[parts[j]] = {};
}
cur = cur[parts[j]];
// If the property in MongoDB is a primitive, we won't be able to populate
// the nested path, so skip it. See gh-7545
if (typeof cur !== 'object') {
break;
}
}
if (docs[i].$__) {
o.allOptions.options[populateModelSymbol] = o.allOptions.model;
docs[i].$populated(_path, o.unpopulatedValues[i], o.allOptions.options);
if (valueToSet != null && valueToSet.$__ != null) {
valueToSet.$__.wasPopulated = { value: o.unpopulatedValues[i] };
}
if (valueToSet instanceof Map && !valueToSet.$isMongooseMap) {
valueToSet = new MongooseMap(valueToSet, _path, docs[i], docs[i].schema.path(_path).$__schemaType);
}
}
// If lean, need to check that each individual virtual respects
// `justOne`, because you may have a populated virtual with `justOne`
// underneath an array. See gh-6867
mpath.set(_path, valueToSet, docs[i], lookupLocalFields, setValue, false);
if (docs[i].$__) {
markArraySubdocsPopulated(docs[i], [o.allOptions.options]);
}
}
};
function numDocs(v) {
if (Array.isArray(v)) {
// If setting underneath an array of populated subdocs, we may have an
// array of arrays. See gh-7573
if (v.some(el => Array.isArray(el))) {
return v.map(el => numDocs(el));
}
return v.length;
}
return v == null ? 0 : 1;
}
/*!
* 1) Apply backwards compatible find/findOne behavior to sub documents
*
* find logic:
* a) filter out non-documents
* b) remove _id from sub docs when user specified
*
* findOne
* a) if no doc found, set to null
* b) remove _id from sub docs when user specified
*
* 2) Remove _ids when specified by users query.
*
* background:
* _ids are left in the query even when user excludes them so
* that population mapping can occur.
*/
function valueFilter(val, assignmentOpts, populateOptions, allIds) {
const userSpecifiedTransform = typeof populateOptions.transform === 'function';
const transform = userSpecifiedTransform ? populateOptions.transform : noop;
if (Array.isArray(val)) {
// find logic
const ret = [];
const numValues = val.length;
for (let i = 0; i < numValues; ++i) {
let subdoc = val[i];
const _allIds = Array.isArray(allIds) ? allIds[i] : allIds;
if (!isPopulatedObject(subdoc) && (!populateOptions.retainNullValues || subdoc != null) && !userSpecifiedTransform) {
continue;
} else if (userSpecifiedTransform) {
subdoc = transform(isPopulatedObject(subdoc) ? subdoc : null, _allIds);
}
maybeRemoveId(subdoc, assignmentOpts);
ret.push(subdoc);
if (assignmentOpts.originalLimit &&
ret.length >= assignmentOpts.originalLimit) {
break;
}
}
const rLen = ret.length;
// Since we don't want to have to create a new mongoosearray, make sure to
// modify the array in place
while (val.length > rLen) {
Array.prototype.pop.apply(val, []);
}
let i = 0;
if (utils.isMongooseArray(val)) {
for (i = 0; i < rLen; ++i) {
val.set(i, ret[i], true);
}
} else {
for (i = 0; i < rLen; ++i) {
val[i] = ret[i];
}
}
return val;
}
// findOne
if (isPopulatedObject(val) || utils.isPOJO(val)) {
maybeRemoveId(val, assignmentOpts);
return transform(val, allIds);
}
if (val instanceof Map) {
return val;
}
if (populateOptions.justOne === false) {
return [];
}
return val == null ? transform(val, allIds) : transform(null, allIds);
}
/*!
* Remove _id from `subdoc` if user specified "lean" query option
*/
function maybeRemoveId(subdoc, assignmentOpts) {
if (subdoc != null && assignmentOpts.excludeId) {
if (typeof subdoc.$__setValue === 'function') {
delete subdoc._doc._id;
} else {
delete subdoc._id;
}
}
}
/*!
* Determine if `obj` is something we can set a populated path to. Can be a
* document, a lean document, or an array/map that contains docs.
*/
function isPopulatedObject(obj) {
if (obj == null) {
return false;
}
return Array.isArray(obj) ||
obj.$isMongooseMap ||
obj.$__ != null ||
leanPopulateMap.has(obj);
}
function noop(v) {
return v;
}
|
module.exports = {
title: 'Documentation',
tagline: 'All the good stuff Curt created',
url: 'https://your-docusaurus-test-site.com',
baseUrl: '/',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: 'img/favicon.ico',
organizationName: 'cpoff', // Usually your GitHub org/user name.
projectName: 'docusaurus-work', // Usually your repo name.
themeConfig: {
navbar: {
title: 'Documentation',
logo: {
alt: 'My Site Logo',
src: 'img/logo.svg',
},
items: [
{
to: 'docs/',
activeBasePath: 'docs',
label: 'Docs',
position: 'left',
},
// {to: 'blog', label: 'Blog', position: 'left'},
// {
// href: 'https://github.com/facebook/docusaurus',
// label: 'GitHub',
// position: 'right',
// },
],
},
footer: {
style: 'dark',
links: [
{
title: 'Docs',
items: [
{
label: 'Style Guide',
to: 'docs/',
},
{
label: 'Second Doc',
to: 'docs/doc2/',
},
],
},
{
title: 'Community',
items: [
{
label: 'Stack Overflow',
href: 'https://stackoverflow.com/questions/tagged/docusaurus',
},
{
label: 'Discord',
href: 'https://discordapp.com/invite/docusaurus',
},
{
label: 'Twitter',
href: 'https://twitter.com/docusaurus',
},
],
},
{
title: 'More',
items: [
{
label: 'Blog',
to: 'blog',
},
{
label: 'GitHub',
href: 'https://github.com/facebook/docusaurus',
},
],
},
],
copyright: `©${new Date().getFullYear()} Built with Docusaurus.`,
},
},
presets: [
[
'@docusaurus/preset-classic',
{
docs: {
sidebarPath: require.resolve('./sidebars.js'),
// Please change this to your repo.
editUrl:
'https://github.com/facebook/docusaurus/edit/master/website/',
},
blog: {
showReadingTime: true,
// Please change this to your repo.
editUrl:
'https://github.com/facebook/docusaurus/edit/master/website/blog/',
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
},
],
],
};
|
;(function(global, factory) {
typeof exports === 'object' && typeof module !== 'undefined'
? (module.exports = factory())
: typeof define === 'function' && define.amd
? define(factory)
: (global.doc = factory())
})(this, function() {
'use strict'
function concat(parts) {
return {
type: 'concat',
parts: parts,
}
}
function indent(contents) {
return {
type: 'indent',
contents: contents,
}
}
function align(n, contents) {
return {
type: 'align',
contents: contents,
n: n,
}
}
function group(contents, opts) {
opts = opts || {}
return {
type: 'group',
id: opts.id,
contents: contents,
break: !!opts.shouldBreak,
expandedStates: opts.expandedStates,
}
}
function dedentToRoot(contents) {
return align(-Infinity, contents)
}
function markAsRoot(contents) {
return align(
{
type: 'root',
},
contents
)
}
function dedent(contents) {
return align(-1, contents)
}
function conditionalGroup(states, opts) {
return group(
states[0],
Object.assign(opts || {}, {
expandedStates: states,
})
)
}
function fill(parts) {
return {
type: 'fill',
parts: parts,
}
}
function ifBreak(breakContents, flatContents, opts) {
opts = opts || {}
return {
type: 'if-break',
breakContents: breakContents,
flatContents: flatContents,
groupId: opts.groupId,
}
}
function lineSuffix(contents) {
return {
type: 'line-suffix',
contents: contents,
}
}
var lineSuffixBoundary = {
type: 'line-suffix-boundary',
}
var breakParent = {
type: 'break-parent',
}
var trim = {
type: 'trim',
}
var line = {
type: 'line',
}
var softline = {
type: 'line',
soft: true,
}
var hardline = concat([
{
type: 'line',
hard: true,
},
breakParent,
])
var literalline = concat([
{
type: 'line',
hard: true,
literal: true,
},
breakParent,
])
var cursor = {
type: 'cursor',
placeholder: Symbol('cursor'),
}
function join(sep, arr) {
var res = []
for (var i = 0; i < arr.length; i++) {
if (i !== 0) {
res.push(sep)
}
res.push(arr[i])
}
return concat(res)
}
function addAlignmentToDoc(doc, size, tabWidth) {
var aligned = doc
if (size > 0) {
// Use indent to add tabs for all the levels of tabs we need
for (var i = 0; i < Math.floor(size / tabWidth); ++i) {
aligned = indent(aligned)
} // Use align for all the spaces that are needed
aligned = align(size % tabWidth, aligned) // size is absolute from 0 and not relative to the current
// indentation, so we use -Infinity to reset the indentation to 0
aligned = align(-Infinity, aligned)
}
return aligned
}
var docBuilders = {
concat: concat,
join: join,
line: line,
softline: softline,
hardline: hardline,
literalline: literalline,
group: group,
conditionalGroup: conditionalGroup,
fill: fill,
lineSuffix: lineSuffix,
lineSuffixBoundary: lineSuffixBoundary,
cursor: cursor,
breakParent: breakParent,
ifBreak: ifBreak,
trim: trim,
indent: indent,
align: align,
addAlignmentToDoc: addAlignmentToDoc,
markAsRoot: markAsRoot,
dedentToRoot: dedentToRoot,
dedent: dedent,
}
function createCommonjsModule(fn, module) {
return (module = { exports: {} }), fn(module, module.exports), module.exports
}
var ansiRegex = createCommonjsModule(function(module) {
'use strict'
module.exports = function(options) {
options = Object.assign(
{
onlyFirst: false,
},
options
)
var pattern = [
'[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\\u0007)',
'(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))',
].join('|')
return new RegExp(pattern, options.onlyFirst ? undefined : 'g')
}
})
var stripAnsi = function stripAnsi(input) {
return typeof input === 'string' ? input.replace(ansiRegex(), '') : input
}
var isFullwidthCodePoint = createCommonjsModule(function(module) {
'use strict'
/* eslint-disable yoda */
module.exports = function(x) {
if (Number.isNaN(x)) {
return false
} // code points are derived from:
// http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt
if (
x >= 0x1100 &&
(x <= 0x115f || // Hangul Jamo
x === 0x2329 || // LEFT-POINTING ANGLE BRACKET
x === 0x232a || // RIGHT-POINTING ANGLE BRACKET
// CJK Radicals Supplement .. Enclosed CJK Letters and Months
(0x2e80 <= x && x <= 0x3247 && x !== 0x303f) || // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A
(0x3250 <= x && x <= 0x4dbf) || // CJK Unified Ideographs .. Yi Radicals
(0x4e00 <= x && x <= 0xa4c6) || // Hangul Jamo Extended-A
(0xa960 <= x && x <= 0xa97c) || // Hangul Syllables
(0xac00 <= x && x <= 0xd7a3) || // CJK Compatibility Ideographs
(0xf900 <= x && x <= 0xfaff) || // Vertical Forms
(0xfe10 <= x && x <= 0xfe19) || // CJK Compatibility Forms .. Small Form Variants
(0xfe30 <= x && x <= 0xfe6b) || // Halfwidth and Fullwidth Forms
(0xff01 <= x && x <= 0xff60) ||
(0xffe0 <= x && x <= 0xffe6) || // Kana Supplement
(0x1b000 <= x && x <= 0x1b001) || // Enclosed Ideographic Supplement
(0x1f200 <= x && x <= 0x1f251) || // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane
(0x20000 <= x && x <= 0x3fffd))
) {
return true
}
return false
}
})
var emojiRegex = function emojiRegex() {
// https://mths.be/emoji
return /\uD83C\uDFF4(?:\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74)\uDB40\uDC7F|\u200D\u2620\uFE0F)|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC68(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDB0-\uDDB3])|(?:\uD83C[\uDFFB-\uDFFF])\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDB0-\uDDB3]))|\uD83D\uDC69\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDB0-\uDDB3])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2695\u2696\u2708]|\uD83D\uDC68(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83D\uDC69\u200D[\u2695\u2696\u2708])\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC68(?:\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDB0-\uDDB3])|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDD1-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDEEB\uDEEC\uDEF4-\uDEF9]|\uD83E[\uDD10-\uDD3A\uDD3C-\uDD3E\uDD40-\uDD45\uDD47-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEF9]|\uD83E[\uDD10-\uDD3A\uDD3C-\uDD3E\uDD40-\uDD45\uDD47-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC69\uDC6E\uDC70-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD18-\uDD1C\uDD1E\uDD1F\uDD26\uDD30-\uDD39\uDD3D\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDD1-\uDDDD])/g
}
var stringWidth = createCommonjsModule(function(module) {
'use strict'
var emojiRegex$$1 = emojiRegex()
module.exports = function(input) {
input = input.replace(emojiRegex$$1, ' ')
if (typeof input !== 'string' || input.length === 0) {
return 0
}
input = stripAnsi(input)
var width = 0
for (var i = 0; i < input.length; i++) {
var code = input.codePointAt(i) // Ignore control characters
if (code <= 0x1f || (code >= 0x7f && code <= 0x9f)) {
continue
} // Ignore combining characters
if (code >= 0x300 && code <= 0x36f) {
continue
} // Surrogates
if (code > 0xffff) {
i++
}
width += isFullwidthCodePoint(code) ? 2 : 1
}
return width
}
})
var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g
var escapeStringRegexp = function escapeStringRegexp(str) {
if (typeof str !== 'string') {
throw new TypeError('Expected a string')
}
return str.replace(matchOperatorsRe, '\\$&')
}
var getLast = function getLast(arr) {
return arr.length > 0 ? arr[arr.length - 1] : null
}
var notAsciiRegex = /[^\x20-\x7F]/
function isExportDeclaration(node) {
if (node) {
switch (node.type) {
case 'ExportDefaultDeclaration':
case 'ExportDefaultSpecifier':
case 'DeclareExportDeclaration':
case 'ExportNamedDeclaration':
case 'ExportAllDeclaration':
return true
}
}
return false
}
function getParentExportDeclaration(path) {
var parentNode = path.getParentNode()
if (path.getName() === 'declaration' && isExportDeclaration(parentNode)) {
return parentNode
}
return null
}
function getPenultimate(arr) {
if (arr.length > 1) {
return arr[arr.length - 2]
}
return null
}
function skip(chars) {
return function(text, index, opts) {
var backwards = opts && opts.backwards // Allow `skip` functions to be threaded together without having
// to check for failures (did someone say monads?).
if (index === false) {
return false
}
var length = text.length
var cursor = index
while (cursor >= 0 && cursor < length) {
var c = text.charAt(cursor)
if (chars instanceof RegExp) {
if (!chars.test(c)) {
return cursor
}
} else if (chars.indexOf(c) === -1) {
return cursor
}
backwards ? cursor-- : cursor++
}
if (cursor === -1 || cursor === length) {
// If we reached the beginning or end of the file, return the
// out-of-bounds cursor. It's up to the caller to handle this
// correctly. We don't want to indicate `false` though if it
// actually skipped valid characters.
return cursor
}
return false
}
}
var skipWhitespace = skip(/\s/)
var skipSpaces = skip(' \t')
var skipToLineEnd = skip(',; \t')
var skipEverythingButNewLine = skip(/[^\r\n]/)
function skipInlineComment(text, index) {
if (index === false) {
return false
}
if (text.charAt(index) === '/' && text.charAt(index + 1) === '*') {
for (var i = index + 2; i < text.length; ++i) {
if (text.charAt(i) === '*' && text.charAt(i + 1) === '/') {
return i + 2
}
}
}
return index
}
function skipTrailingComment(text, index) {
if (index === false) {
return false
}
if (text.charAt(index) === '/' && text.charAt(index + 1) === '/') {
return skipEverythingButNewLine(text, index)
}
return index
} // This one doesn't use the above helper function because it wants to
// test \r\n in order and `skip` doesn't support ordering and we only
// want to skip one newline. It's simple to implement.
function skipNewline(text, index, opts) {
var backwards = opts && opts.backwards
if (index === false) {
return false
}
var atIndex = text.charAt(index)
if (backwards) {
if (text.charAt(index - 1) === '\r' && atIndex === '\n') {
return index - 2
}
if (atIndex === '\n' || atIndex === '\r' || atIndex === '\u2028' || atIndex === '\u2029') {
return index - 1
}
} else {
if (atIndex === '\r' && text.charAt(index + 1) === '\n') {
return index + 2
}
if (atIndex === '\n' || atIndex === '\r' || atIndex === '\u2028' || atIndex === '\u2029') {
return index + 1
}
}
return index
}
function hasNewline(text, index, opts) {
opts = opts || {}
var idx = skipSpaces(text, opts.backwards ? index - 1 : index, opts)
var idx2 = skipNewline(text, idx, opts)
return idx !== idx2
}
function hasNewlineInRange(text, start, end) {
for (var i = start; i < end; ++i) {
if (text.charAt(i) === '\n') {
return true
}
}
return false
} // Note: this function doesn't ignore leading comments unlike isNextLineEmpty
function isPreviousLineEmpty(text, node, locStart) {
var idx = locStart(node) - 1
idx = skipSpaces(text, idx, {
backwards: true,
})
idx = skipNewline(text, idx, {
backwards: true,
})
idx = skipSpaces(text, idx, {
backwards: true,
})
var idx2 = skipNewline(text, idx, {
backwards: true,
})
return idx !== idx2
}
function isNextLineEmptyAfterIndex(text, index) {
var oldIdx = null
var idx = index
while (idx !== oldIdx) {
// We need to skip all the potential trailing inline comments
oldIdx = idx
idx = skipToLineEnd(text, idx)
idx = skipInlineComment(text, idx)
idx = skipSpaces(text, idx)
}
idx = skipTrailingComment(text, idx)
idx = skipNewline(text, idx)
return hasNewline(text, idx)
}
function isNextLineEmpty(text, node, locEnd) {
return isNextLineEmptyAfterIndex(text, locEnd(node))
}
function getNextNonSpaceNonCommentCharacterIndexWithStartIndex(text, idx) {
var oldIdx = null
while (idx !== oldIdx) {
oldIdx = idx
idx = skipSpaces(text, idx)
idx = skipInlineComment(text, idx)
idx = skipTrailingComment(text, idx)
idx = skipNewline(text, idx)
}
return idx
}
function getNextNonSpaceNonCommentCharacterIndex(text, node, locEnd) {
return getNextNonSpaceNonCommentCharacterIndexWithStartIndex(text, locEnd(node))
}
function getNextNonSpaceNonCommentCharacter(text, node, locEnd) {
return text.charAt(getNextNonSpaceNonCommentCharacterIndex(text, node, locEnd))
}
function hasSpaces(text, index, opts) {
opts = opts || {}
var idx = skipSpaces(text, opts.backwards ? index - 1 : index, opts)
return idx !== index
}
function setLocStart(node, index) {
if (node.range) {
node.range[0] = index
} else {
node.start = index
}
}
function setLocEnd(node, index) {
if (node.range) {
node.range[1] = index
} else {
node.end = index
}
}
var PRECEDENCE = {}
;[
['|>'],
['||', '??'],
['&&'],
['|'],
['^'],
['&'],
['==', '===', '!=', '!=='],
['<', '>', '<=', '>=', 'in', 'instanceof'],
['>>', '<<', '>>>'],
['+', '-'],
['*', '/', '%'],
['**'],
].forEach(function(tier, i) {
tier.forEach(function(op) {
PRECEDENCE[op] = i
})
})
function getPrecedence(op) {
return PRECEDENCE[op]
}
var equalityOperators = {
'==': true,
'!=': true,
'===': true,
'!==': true,
}
var multiplicativeOperators = {
'*': true,
'/': true,
'%': true,
}
var bitshiftOperators = {
'>>': true,
'>>>': true,
'<<': true,
}
function shouldFlatten(parentOp, nodeOp) {
if (getPrecedence(nodeOp) !== getPrecedence(parentOp)) {
return false
} // ** is right-associative
// x ** y ** z --> x ** (y ** z)
if (parentOp === '**') {
return false
} // x == y == z --> (x == y) == z
if (equalityOperators[parentOp] && equalityOperators[nodeOp]) {
return false
} // x * y % z --> (x * y) % z
if (
(nodeOp === '%' && multiplicativeOperators[parentOp]) ||
(parentOp === '%' && multiplicativeOperators[nodeOp])
) {
return false
} // x * y / z --> (x * y) / z
// x / y * z --> (x / y) * z
if (nodeOp !== parentOp && multiplicativeOperators[nodeOp] && multiplicativeOperators[parentOp]) {
return false
} // x << y << z --> (x << y) << z
if (bitshiftOperators[parentOp] && bitshiftOperators[nodeOp]) {
return false
}
return true
}
function isBitwiseOperator(operator) {
return !!bitshiftOperators[operator] || operator === '|' || operator === '^' || operator === '&'
} // Tests if an expression starts with `{`, or (if forbidFunctionClassAndDoExpr
// holds) `function`, `class`, or `do {}`. Will be overzealous if there's
// already necessary grouping parentheses.
function startsWithNoLookaheadToken(node, forbidFunctionClassAndDoExpr) {
node = getLeftMost(node)
switch (node.type) {
case 'FunctionExpression':
case 'ClassExpression':
case 'DoExpression':
return forbidFunctionClassAndDoExpr
case 'ObjectExpression':
return true
case 'MemberExpression':
return startsWithNoLookaheadToken(node.object, forbidFunctionClassAndDoExpr)
case 'TaggedTemplateExpression':
if (node.tag.type === 'FunctionExpression') {
// IIFEs are always already parenthesized
return false
}
return startsWithNoLookaheadToken(node.tag, forbidFunctionClassAndDoExpr)
case 'CallExpression':
if (node.callee.type === 'FunctionExpression') {
// IIFEs are always already parenthesized
return false
}
return startsWithNoLookaheadToken(node.callee, forbidFunctionClassAndDoExpr)
case 'ConditionalExpression':
return startsWithNoLookaheadToken(node.test, forbidFunctionClassAndDoExpr)
case 'UpdateExpression':
return !node.prefix && startsWithNoLookaheadToken(node.argument, forbidFunctionClassAndDoExpr)
case 'BindExpression':
return node.object && startsWithNoLookaheadToken(node.object, forbidFunctionClassAndDoExpr)
case 'SequenceExpression':
return startsWithNoLookaheadToken(node.expressions[0], forbidFunctionClassAndDoExpr)
case 'TSAsExpression':
return startsWithNoLookaheadToken(node.expression, forbidFunctionClassAndDoExpr)
default:
return false
}
}
function getLeftMost(node) {
if (node.left) {
return getLeftMost(node.left)
}
return node
}
function getAlignmentSize(value, tabWidth, startIndex) {
startIndex = startIndex || 0
var size = 0
for (var i = startIndex; i < value.length; ++i) {
if (value[i] === '\t') {
// Tabs behave in a way that they are aligned to the nearest
// multiple of tabWidth:
// 0 -> 4, 1 -> 4, 2 -> 4, 3 -> 4
// 4 -> 8, 5 -> 8, 6 -> 8, 7 -> 8 ...
size = size + tabWidth - (size % tabWidth)
} else {
size++
}
}
return size
}
function getIndentSize(value, tabWidth) {
var lastNewlineIndex = value.lastIndexOf('\n')
if (lastNewlineIndex === -1) {
return 0
}
return getAlignmentSize(
// All the leading whitespaces
value.slice(lastNewlineIndex + 1).match(/^[ \t]*/)[0],
tabWidth
)
}
function getPreferredQuote(raw, preferredQuote) {
// `rawContent` is the string exactly like it appeared in the input source
// code, without its enclosing quotes.
var rawContent = raw.slice(1, -1)
var double = {
quote: '"',
regex: /"/g,
}
var single = {
quote: "'",
regex: /'/g,
}
var preferred = preferredQuote === "'" ? single : double
var alternate = preferred === single ? double : single
var result = preferred.quote // If `rawContent` contains at least one of the quote preferred for enclosing
// the string, we might want to enclose with the alternate quote instead, to
// minimize the number of escaped quotes.
if (rawContent.includes(preferred.quote) || rawContent.includes(alternate.quote)) {
var numPreferredQuotes = (rawContent.match(preferred.regex) || []).length
var numAlternateQuotes = (rawContent.match(alternate.regex) || []).length
result = numPreferredQuotes > numAlternateQuotes ? alternate.quote : preferred.quote
}
return result
}
function printString(raw, options, isDirectiveLiteral) {
// `rawContent` is the string exactly like it appeared in the input source
// code, without its enclosing quotes.
var rawContent = raw.slice(1, -1) // Check for the alternate quote, to determine if we're allowed to swap
// the quotes on a DirectiveLiteral.
var canChangeDirectiveQuotes = !rawContent.includes('"') && !rawContent.includes("'")
var enclosingQuote =
options.parser === 'json'
? '"'
: options.__isInHtmlAttribute
? "'"
: getPreferredQuote(raw, options.singleQuote ? "'" : '"') // Directives are exact code unit sequences, which means that you can't
// change the escape sequences they use.
// See https://github.com/prettier/prettier/issues/1555
// and https://tc39.github.io/ecma262/#directive-prologue
if (isDirectiveLiteral) {
if (canChangeDirectiveQuotes) {
return enclosingQuote + rawContent + enclosingQuote
}
return raw
} // It might sound unnecessary to use `makeString` even if the string already
// is enclosed with `enclosingQuote`, but it isn't. The string could contain
// unnecessary escapes (such as in `"\'"`). Always using `makeString` makes
// sure that we consistently output the minimum amount of escaped quotes.
return makeString(
rawContent,
enclosingQuote,
!(
options.parser === 'css' ||
options.parser === 'less' ||
options.parser === 'scss' ||
options.embeddedInHtml
)
)
}
function makeString(rawContent, enclosingQuote, unescapeUnnecessaryEscapes) {
var otherQuote = enclosingQuote === '"' ? "'" : '"' // Matches _any_ escape and unescaped quotes (both single and double).
var regex = /\\([\s\S])|(['"])/g // Escape and unescape single and double quotes as needed to be able to
// enclose `rawContent` with `enclosingQuote`.
var newContent = rawContent.replace(regex, function(match, escaped, quote) {
// If we matched an escape, and the escaped character is a quote of the
// other type than we intend to enclose the string with, there's no need for
// it to be escaped, so return it _without_ the backslash.
if (escaped === otherQuote) {
return escaped
} // If we matched an unescaped quote and it is of the _same_ type as we
// intend to enclose the string with, it must be escaped, so return it with
// a backslash.
if (quote === enclosingQuote) {
return '\\' + quote
}
if (quote) {
return quote
} // Unescape any unnecessarily escaped character.
// Adapted from https://github.com/eslint/eslint/blob/de0b4ad7bd820ade41b1f606008bea68683dc11a/lib/rules/no-useless-escape.js#L27
return unescapeUnnecessaryEscapes && /^[^\\nrvtbfux\r\n\u2028\u2029"'0-7]$/.test(escaped)
? escaped
: '\\' + escaped
})
return enclosingQuote + newContent + enclosingQuote
}
function printNumber(rawNumber) {
return rawNumber
.toLowerCase() // Remove unnecessary plus and zeroes from scientific notation.
.replace(/^([+-]?[\d.]+e)(?:\+|(-))?0*(\d)/, '$1$2$3') // Remove unnecessary scientific notation (1e0).
.replace(/^([+-]?[\d.]+)e[+-]?0+$/, '$1') // Make sure numbers always start with a digit.
.replace(/^([+-])?\./, '$10.') // Remove extraneous trailing decimal zeroes.
.replace(/(\.\d+?)0+(?=e|$)/, '$1') // Remove trailing dot.
.replace(/\.(?=e|$)/, '')
}
function getMaxContinuousCount(str, target) {
var results = str.match(new RegExp('('.concat(escapeStringRegexp(target), ')+'), 'g'))
if (results === null) {
return 0
}
return results.reduce(function(maxCount, result) {
return Math.max(maxCount, result.length / target.length)
}, 0)
}
function getMinNotPresentContinuousCount(str, target) {
var matches = str.match(new RegExp('('.concat(escapeStringRegexp(target), ')+'), 'g'))
if (matches === null) {
return 0
}
var countPresent = new Map()
var max = 0
var _iteratorNormalCompletion = true
var _didIteratorError = false
var _iteratorError = undefined
try {
for (
var _iterator = matches[Symbol.iterator](), _step;
!(_iteratorNormalCompletion = (_step = _iterator.next()).done);
_iteratorNormalCompletion = true
) {
var match = _step.value
var count = match.length / target.length
countPresent.set(count, true)
if (count > max) {
max = count
}
}
} catch (err) {
_didIteratorError = true
_iteratorError = err
} finally {
try {
if (!_iteratorNormalCompletion && _iterator.return != null) {
_iterator.return()
}
} finally {
if (_didIteratorError) {
throw _iteratorError
}
}
}
for (var i = 1; i < max; i++) {
if (!countPresent.get(i)) {
return i
}
}
return max + 1
}
function getStringWidth$1(text) {
if (!text) {
return 0
} // shortcut to avoid needless string `RegExp`s, replacements, and allocations within `string-width`
if (!notAsciiRegex.test(text)) {
return text.length
}
return stringWidth(text)
}
function hasIgnoreComment(path) {
var node = path.getValue()
return hasNodeIgnoreComment(node)
}
function hasNodeIgnoreComment(node) {
return (
node &&
node.comments &&
node.comments.length > 0 &&
node.comments.some(function(comment) {
return comment.value.trim() === 'prettier-ignore'
})
)
}
function matchAncestorTypes(path, types, index) {
index = index || 0
types = types.slice()
while (types.length) {
var parent = path.getParentNode(index)
var type = types.shift()
if (!parent || parent.type !== type) {
return false
}
index++
}
return true
}
function addCommentHelper(node, comment) {
var comments = node.comments || (node.comments = [])
comments.push(comment)
comment.printed = false // For some reason, TypeScript parses `// x` inside of JSXText as a comment
// We already "print" it via the raw text, we don't need to re-print it as a
// comment
if (node.type === 'JSXText') {
comment.printed = true
}
}
function addLeadingComment(node, comment) {
comment.leading = true
comment.trailing = false
addCommentHelper(node, comment)
}
function addDanglingComment(node, comment) {
comment.leading = false
comment.trailing = false
addCommentHelper(node, comment)
}
function addTrailingComment(node, comment) {
comment.leading = false
comment.trailing = true
addCommentHelper(node, comment)
}
function isWithinParentArrayProperty(path, propertyName) {
var node = path.getValue()
var parent = path.getParentNode()
if (parent == null) {
return false
}
if (!Array.isArray(parent[propertyName])) {
return false
}
var key = path.getName()
return parent[propertyName][key] === node
}
function replaceEndOfLineWith(text, replacement) {
var parts = []
var _iteratorNormalCompletion2 = true
var _didIteratorError2 = false
var _iteratorError2 = undefined
try {
for (
var _iterator2 = text.split('\n')[Symbol.iterator](), _step2;
!(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done);
_iteratorNormalCompletion2 = true
) {
var part = _step2.value
if (parts.length !== 0) {
parts.push(replacement)
}
parts.push(part)
}
} catch (err) {
_didIteratorError2 = true
_iteratorError2 = err
} finally {
try {
if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
_iterator2.return()
}
} finally {
if (_didIteratorError2) {
throw _iteratorError2
}
}
}
return parts
}
var util = {
replaceEndOfLineWith: replaceEndOfLineWith,
getStringWidth: getStringWidth$1,
getMaxContinuousCount: getMaxContinuousCount,
getMinNotPresentContinuousCount: getMinNotPresentContinuousCount,
getPrecedence: getPrecedence,
shouldFlatten: shouldFlatten,
isBitwiseOperator: isBitwiseOperator,
isExportDeclaration: isExportDeclaration,
getParentExportDeclaration: getParentExportDeclaration,
getPenultimate: getPenultimate,
getLast: getLast,
getNextNonSpaceNonCommentCharacterIndexWithStartIndex: getNextNonSpaceNonCommentCharacterIndexWithStartIndex,
getNextNonSpaceNonCommentCharacterIndex: getNextNonSpaceNonCommentCharacterIndex,
getNextNonSpaceNonCommentCharacter: getNextNonSpaceNonCommentCharacter,
skip: skip,
skipWhitespace: skipWhitespace,
skipSpaces: skipSpaces,
skipToLineEnd: skipToLineEnd,
skipEverythingButNewLine: skipEverythingButNewLine,
skipInlineComment: skipInlineComment,
skipTrailingComment: skipTrailingComment,
skipNewline: skipNewline,
isNextLineEmptyAfterIndex: isNextLineEmptyAfterIndex,
isNextLineEmpty: isNextLineEmpty,
isPreviousLineEmpty: isPreviousLineEmpty,
hasNewline: hasNewline,
hasNewlineInRange: hasNewlineInRange,
hasSpaces: hasSpaces,
setLocStart: setLocStart,
setLocEnd: setLocEnd,
startsWithNoLookaheadToken: startsWithNoLookaheadToken,
getAlignmentSize: getAlignmentSize,
getIndentSize: getIndentSize,
getPreferredQuote: getPreferredQuote,
printString: printString,
printNumber: printNumber,
hasIgnoreComment: hasIgnoreComment,
hasNodeIgnoreComment: hasNodeIgnoreComment,
makeString: makeString,
matchAncestorTypes: matchAncestorTypes,
addLeadingComment: addLeadingComment,
addDanglingComment: addDanglingComment,
addTrailingComment: addTrailingComment,
isWithinParentArrayProperty: isWithinParentArrayProperty,
}
function guessEndOfLine(text) {
var index = text.indexOf('\r')
if (index >= 0) {
return text.charAt(index + 1) === '\n' ? 'crlf' : 'cr'
}
return 'lf'
}
function convertEndOfLineToChars$1(value) {
switch (value) {
case 'cr':
return '\r'
case 'crlf':
return '\r\n'
default:
return '\n'
}
}
var endOfLine = {
guessEndOfLine: guessEndOfLine,
convertEndOfLineToChars: convertEndOfLineToChars$1,
}
var getStringWidth = util.getStringWidth
var convertEndOfLineToChars = endOfLine.convertEndOfLineToChars
var concat$1 = docBuilders.concat
var fill$1 = docBuilders.fill
var cursor$1 = docBuilders.cursor
/** @type {{[groupId: PropertyKey]: MODE}} */
var groupModeMap
var MODE_BREAK = 1
var MODE_FLAT = 2
function rootIndent() {
return {
value: '',
length: 0,
queue: [],
}
}
function makeIndent(ind, options) {
return generateInd(
ind,
{
type: 'indent',
},
options
)
}
function makeAlign(ind, n, options) {
return n === -Infinity
? ind.root || rootIndent()
: n < 0
? generateInd(
ind,
{
type: 'dedent',
},
options
)
: !n
? ind
: n.type === 'root'
? Object.assign({}, ind, {
root: ind,
})
: typeof n === 'string'
? generateInd(
ind,
{
type: 'stringAlign',
n: n,
},
options
)
: generateInd(
ind,
{
type: 'numberAlign',
n: n,
},
options
)
}
function generateInd(ind, newPart, options) {
var queue = newPart.type === 'dedent' ? ind.queue.slice(0, -1) : ind.queue.concat(newPart)
var value = ''
var length = 0
var lastTabs = 0
var lastSpaces = 0
var _iteratorNormalCompletion = true
var _didIteratorError = false
var _iteratorError = undefined
try {
for (
var _iterator = queue[Symbol.iterator](), _step;
!(_iteratorNormalCompletion = (_step = _iterator.next()).done);
_iteratorNormalCompletion = true
) {
var part = _step.value
switch (part.type) {
case 'indent':
flush()
if (options.useTabs) {
addTabs(1)
} else {
addSpaces(options.tabWidth)
}
break
case 'stringAlign':
flush()
value += part.n
length += part.n.length
break
case 'numberAlign':
lastTabs += 1
lastSpaces += part.n
break
/* istanbul ignore next */
default:
throw new Error("Unexpected type '".concat(part.type, "'"))
}
}
} catch (err) {
_didIteratorError = true
_iteratorError = err
} finally {
try {
if (!_iteratorNormalCompletion && _iterator.return != null) {
_iterator.return()
}
} finally {
if (_didIteratorError) {
throw _iteratorError
}
}
}
flushSpaces()
return Object.assign({}, ind, {
value: value,
length: length,
queue: queue,
})
function addTabs(count) {
value += '\t'.repeat(count)
length += options.tabWidth * count
}
function addSpaces(count) {
value += ' '.repeat(count)
length += count
}
function flush() {
if (options.useTabs) {
flushTabs()
} else {
flushSpaces()
}
}
function flushTabs() {
if (lastTabs > 0) {
addTabs(lastTabs)
}
resetLast()
}
function flushSpaces() {
if (lastSpaces > 0) {
addSpaces(lastSpaces)
}
resetLast()
}
function resetLast() {
lastTabs = 0
lastSpaces = 0
}
}
function trim$1(out) {
if (out.length === 0) {
return 0
}
var trimCount = 0 // Trim whitespace at the end of line
while (out.length > 0 && typeof out[out.length - 1] === 'string' && out[out.length - 1].match(/^[ \t]*$/)) {
trimCount += out.pop().length
}
if (out.length && typeof out[out.length - 1] === 'string') {
var trimmed = out[out.length - 1].replace(/[ \t]*$/, '')
trimCount += out[out.length - 1].length - trimmed.length
out[out.length - 1] = trimmed
}
return trimCount
}
function fits(next, restCommands, width, options, mustBeFlat) {
var restIdx = restCommands.length
var cmds = [next] // `out` is only used for width counting because `trim` requires to look
// backwards for space characters.
var out = []
while (width >= 0) {
if (cmds.length === 0) {
if (restIdx === 0) {
return true
}
cmds.push(restCommands[restIdx - 1])
restIdx--
continue
}
var x = cmds.pop()
var ind = x[0]
var mode = x[1]
var doc = x[2]
if (typeof doc === 'string') {
out.push(doc)
width -= getStringWidth(doc)
} else {
switch (doc.type) {
case 'concat':
for (var i = doc.parts.length - 1; i >= 0; i--) {
cmds.push([ind, mode, doc.parts[i]])
}
break
case 'indent':
cmds.push([makeIndent(ind, options), mode, doc.contents])
break
case 'align':
cmds.push([makeAlign(ind, doc.n, options), mode, doc.contents])
break
case 'trim':
width += trim$1(out)
break
case 'group':
if (mustBeFlat && doc.break) {
return false
}
cmds.push([ind, doc.break ? MODE_BREAK : mode, doc.contents])
if (doc.id) {
groupModeMap[doc.id] = cmds[cmds.length - 1][1]
}
break
case 'fill':
for (var _i = doc.parts.length - 1; _i >= 0; _i--) {
cmds.push([ind, mode, doc.parts[_i]])
}
break
case 'if-break': {
var groupMode = doc.groupId ? groupModeMap[doc.groupId] : mode
if (groupMode === MODE_BREAK) {
if (doc.breakContents) {
cmds.push([ind, mode, doc.breakContents])
}
}
if (groupMode === MODE_FLAT) {
if (doc.flatContents) {
cmds.push([ind, mode, doc.flatContents])
}
}
break
}
case 'line':
switch (mode) {
// fallthrough
case MODE_FLAT:
if (!doc.hard) {
if (!doc.soft) {
out.push(' ')
width -= 1
}
break
}
return true
case MODE_BREAK:
return true
}
break
}
}
}
return false
}
function printDocToString(doc, options) {
groupModeMap = {}
var width = options.printWidth
var newLine = convertEndOfLineToChars(options.endOfLine)
var pos = 0 // cmds is basically a stack. We've turned a recursive call into a
// while loop which is much faster. The while loop below adds new
// cmds to the array instead of recursively calling `print`.
var cmds = [[rootIndent(), MODE_BREAK, doc]]
var out = []
var shouldRemeasure = false
var lineSuffix = []
while (cmds.length !== 0) {
var x = cmds.pop()
var ind = x[0]
var mode = x[1]
var _doc = x[2]
if (typeof _doc === 'string') {
out.push(_doc)
pos += getStringWidth(_doc)
} else {
switch (_doc.type) {
case 'cursor':
out.push(cursor$1.placeholder)
break
case 'concat':
for (var i = _doc.parts.length - 1; i >= 0; i--) {
cmds.push([ind, mode, _doc.parts[i]])
}
break
case 'indent':
cmds.push([makeIndent(ind, options), mode, _doc.contents])
break
case 'align':
cmds.push([makeAlign(ind, _doc.n, options), mode, _doc.contents])
break
case 'trim':
pos -= trim$1(out)
break
case 'group':
switch (mode) {
case MODE_FLAT:
if (!shouldRemeasure) {
cmds.push([ind, _doc.break ? MODE_BREAK : MODE_FLAT, _doc.contents])
break
}
// fallthrough
case MODE_BREAK: {
shouldRemeasure = false
var next = [ind, MODE_FLAT, _doc.contents]
var rem = width - pos
if (!_doc.break && fits(next, cmds, rem, options)) {
cmds.push(next)
} else {
// Expanded states are a rare case where a document
// can manually provide multiple representations of
// itself. It provides an array of documents
// going from the least expanded (most flattened)
// representation first to the most expanded. If a
// group has these, we need to manually go through
// these states and find the first one that fits.
if (_doc.expandedStates) {
var mostExpanded = _doc.expandedStates[_doc.expandedStates.length - 1]
if (_doc.break) {
cmds.push([ind, MODE_BREAK, mostExpanded])
break
} else {
for (var _i2 = 1; _i2 < _doc.expandedStates.length + 1; _i2++) {
if (_i2 >= _doc.expandedStates.length) {
cmds.push([ind, MODE_BREAK, mostExpanded])
break
} else {
var state = _doc.expandedStates[_i2]
var cmd = [ind, MODE_FLAT, state]
if (fits(cmd, cmds, rem, options)) {
cmds.push(cmd)
break
}
}
}
}
} else {
cmds.push([ind, MODE_BREAK, _doc.contents])
}
}
break
}
}
if (_doc.id) {
groupModeMap[_doc.id] = cmds[cmds.length - 1][1]
}
break
// Fills each line with as much code as possible before moving to a new
// line with the same indentation.
//
// Expects doc.parts to be an array of alternating content and
// whitespace. The whitespace contains the linebreaks.
//
// For example:
// ["I", line, "love", line, "monkeys"]
// or
// [{ type: group, ... }, softline, { type: group, ... }]
//
// It uses this parts structure to handle three main layout cases:
// * The first two content items fit on the same line without
// breaking
// -> output the first content item and the whitespace "flat".
// * Only the first content item fits on the line without breaking
// -> output the first content item "flat" and the whitespace with
// "break".
// * Neither content item fits on the line without breaking
// -> output the first content item and the whitespace with "break".
case 'fill': {
var _rem = width - pos
var parts = _doc.parts
if (parts.length === 0) {
break
}
var content = parts[0]
var contentFlatCmd = [ind, MODE_FLAT, content]
var contentBreakCmd = [ind, MODE_BREAK, content]
var contentFits = fits(contentFlatCmd, [], _rem, options, true)
if (parts.length === 1) {
if (contentFits) {
cmds.push(contentFlatCmd)
} else {
cmds.push(contentBreakCmd)
}
break
}
var whitespace = parts[1]
var whitespaceFlatCmd = [ind, MODE_FLAT, whitespace]
var whitespaceBreakCmd = [ind, MODE_BREAK, whitespace]
if (parts.length === 2) {
if (contentFits) {
cmds.push(whitespaceFlatCmd)
cmds.push(contentFlatCmd)
} else {
cmds.push(whitespaceBreakCmd)
cmds.push(contentBreakCmd)
}
break
} // At this point we've handled the first pair (context, separator)
// and will create a new fill doc for the rest of the content.
// Ideally we wouldn't mutate the array here but coping all the
// elements to a new array would make this algorithm quadratic,
// which is unusable for large arrays (e.g. large texts in JSX).
parts.splice(0, 2)
var remainingCmd = [ind, mode, fill$1(parts)]
var secondContent = parts[0]
var firstAndSecondContentFlatCmd = [
ind,
MODE_FLAT,
concat$1([content, whitespace, secondContent]),
]
var firstAndSecondContentFits = fits(firstAndSecondContentFlatCmd, [], _rem, options, true)
if (firstAndSecondContentFits) {
cmds.push(remainingCmd)
cmds.push(whitespaceFlatCmd)
cmds.push(contentFlatCmd)
} else if (contentFits) {
cmds.push(remainingCmd)
cmds.push(whitespaceBreakCmd)
cmds.push(contentFlatCmd)
} else {
cmds.push(remainingCmd)
cmds.push(whitespaceBreakCmd)
cmds.push(contentBreakCmd)
}
break
}
case 'if-break': {
var groupMode = _doc.groupId ? groupModeMap[_doc.groupId] : mode
if (groupMode === MODE_BREAK) {
if (_doc.breakContents) {
cmds.push([ind, mode, _doc.breakContents])
}
}
if (groupMode === MODE_FLAT) {
if (_doc.flatContents) {
cmds.push([ind, mode, _doc.flatContents])
}
}
break
}
case 'line-suffix':
lineSuffix.push([ind, mode, _doc.contents])
break
case 'line-suffix-boundary':
if (lineSuffix.length > 0) {
cmds.push([
ind,
mode,
{
type: 'line',
hard: true,
},
])
}
break
case 'line':
switch (mode) {
case MODE_FLAT:
if (!_doc.hard) {
if (!_doc.soft) {
out.push(' ')
pos += 1
}
break
} else {
// This line was forced into the output even if we
// were in flattened mode, so we need to tell the next
// group that no matter what, it needs to remeasure
// because the previous measurement didn't accurately
// capture the entire expression (this is necessary
// for nested groups)
shouldRemeasure = true
}
// fallthrough
case MODE_BREAK:
if (lineSuffix.length) {
cmds.push([ind, mode, _doc])
;[].push.apply(cmds, lineSuffix.reverse())
lineSuffix = []
break
}
if (_doc.literal) {
if (ind.root) {
out.push(newLine, ind.root.value)
pos = ind.root.length
} else {
out.push(newLine)
pos = 0
}
} else {
pos -= trim$1(out)
out.push(newLine + ind.value)
pos = ind.length
}
break
}
break
default:
}
}
}
var cursorPlaceholderIndex = out.indexOf(cursor$1.placeholder)
if (cursorPlaceholderIndex !== -1) {
var otherCursorPlaceholderIndex = out.indexOf(cursor$1.placeholder, cursorPlaceholderIndex + 1)
var beforeCursor = out.slice(0, cursorPlaceholderIndex).join('')
var aroundCursor = out.slice(cursorPlaceholderIndex + 1, otherCursorPlaceholderIndex).join('')
var afterCursor = out.slice(otherCursorPlaceholderIndex + 1).join('')
return {
formatted: beforeCursor + aroundCursor + afterCursor,
cursorNodeStart: beforeCursor.length,
cursorNodeText: aroundCursor,
}
}
return {
formatted: out.join(''),
}
}
var docPrinter = {
printDocToString: printDocToString,
}
var traverseDocOnExitStackMarker = {}
function traverseDoc(doc, onEnter, onExit, shouldTraverseConditionalGroups) {
var docsStack = [doc]
while (docsStack.length !== 0) {
var _doc = docsStack.pop()
if (_doc === traverseDocOnExitStackMarker) {
onExit(docsStack.pop())
continue
}
var shouldRecurse = true
if (onEnter) {
if (onEnter(_doc) === false) {
shouldRecurse = false
}
}
if (onExit) {
docsStack.push(_doc)
docsStack.push(traverseDocOnExitStackMarker)
}
if (shouldRecurse) {
// When there are multiple parts to process,
// the parts need to be pushed onto the stack in reverse order,
// so that they are processed in the original order
// when the stack is popped.
if (_doc.type === 'concat' || _doc.type === 'fill') {
for (var ic = _doc.parts.length, i = ic - 1; i >= 0; --i) {
docsStack.push(_doc.parts[i])
}
} else if (_doc.type === 'if-break') {
if (_doc.flatContents) {
docsStack.push(_doc.flatContents)
}
if (_doc.breakContents) {
docsStack.push(_doc.breakContents)
}
} else if (_doc.type === 'group' && _doc.expandedStates) {
if (shouldTraverseConditionalGroups) {
for (var _ic = _doc.expandedStates.length, _i = _ic - 1; _i >= 0; --_i) {
docsStack.push(_doc.expandedStates[_i])
}
} else {
docsStack.push(_doc.contents)
}
} else if (_doc.contents) {
docsStack.push(_doc.contents)
}
}
}
}
function mapDoc(doc, cb) {
if (doc.type === 'concat' || doc.type === 'fill') {
var parts = doc.parts.map(function(part) {
return mapDoc(part, cb)
})
return cb(
Object.assign({}, doc, {
parts: parts,
})
)
} else if (doc.type === 'if-break') {
var breakContents = doc.breakContents && mapDoc(doc.breakContents, cb)
var flatContents = doc.flatContents && mapDoc(doc.flatContents, cb)
return cb(
Object.assign({}, doc, {
breakContents: breakContents,
flatContents: flatContents,
})
)
} else if (doc.contents) {
var contents = mapDoc(doc.contents, cb)
return cb(
Object.assign({}, doc, {
contents: contents,
})
)
}
return cb(doc)
}
function findInDoc(doc, fn, defaultValue) {
var result = defaultValue
var hasStopped = false
function findInDocOnEnterFn(doc) {
var maybeResult = fn(doc)
if (maybeResult !== undefined) {
hasStopped = true
result = maybeResult
}
if (hasStopped) {
return false
}
}
traverseDoc(doc, findInDocOnEnterFn)
return result
}
function isEmpty(n) {
return typeof n === 'string' && n.length === 0
}
function isLineNextFn(doc) {
if (typeof doc === 'string') {
return false
}
if (doc.type === 'line') {
return true
}
}
function isLineNext(doc) {
return findInDoc(doc, isLineNextFn, false)
}
function willBreakFn(doc) {
if (doc.type === 'group' && doc.break) {
return true
}
if (doc.type === 'line' && doc.hard) {
return true
}
if (doc.type === 'break-parent') {
return true
}
}
function willBreak(doc) {
return findInDoc(doc, willBreakFn, false)
}
function breakParentGroup(groupStack) {
if (groupStack.length > 0) {
var parentGroup = groupStack[groupStack.length - 1] // Breaks are not propagated through conditional groups because
// the user is expected to manually handle what breaks.
if (!parentGroup.expandedStates) {
parentGroup.break = true
}
}
return null
}
function propagateBreaks(doc) {
var alreadyVisitedSet = new Set()
var groupStack = []
function propagateBreaksOnEnterFn(doc) {
if (doc.type === 'break-parent') {
breakParentGroup(groupStack)
}
if (doc.type === 'group') {
groupStack.push(doc)
if (alreadyVisitedSet.has(doc)) {
return false
}
alreadyVisitedSet.add(doc)
}
}
function propagateBreaksOnExitFn(doc) {
if (doc.type === 'group') {
var group = groupStack.pop()
if (group.break) {
breakParentGroup(groupStack)
}
}
}
traverseDoc(
doc,
propagateBreaksOnEnterFn,
propagateBreaksOnExitFn,
/* shouldTraverseConditionalGroups */
true
)
}
function removeLinesFn(doc) {
// Force this doc into flat mode by statically converting all
// lines into spaces (or soft lines into nothing). Hard lines
// should still output because there's too great of a chance
// of breaking existing assumptions otherwise.
if (doc.type === 'line' && !doc.hard) {
return doc.soft ? '' : ' '
} else if (doc.type === 'if-break') {
return doc.flatContents || ''
}
return doc
}
function removeLines(doc) {
return mapDoc(doc, removeLinesFn)
}
function stripTrailingHardline(doc) {
// HACK remove ending hardline, original PR: #1984
if (doc.type === 'concat' && doc.parts.length !== 0) {
var lastPart = doc.parts[doc.parts.length - 1]
if (lastPart.type === 'concat') {
if (
lastPart.parts.length === 2 &&
lastPart.parts[0].hard &&
lastPart.parts[1].type === 'break-parent'
) {
return {
type: 'concat',
parts: doc.parts.slice(0, -1),
}
}
return {
type: 'concat',
parts: doc.parts.slice(0, -1).concat(stripTrailingHardline(lastPart)),
}
}
}
return doc
}
var docUtils = {
isEmpty: isEmpty,
willBreak: willBreak,
isLineNext: isLineNext,
traverseDoc: traverseDoc,
findInDoc: findInDoc,
mapDoc: mapDoc,
propagateBreaks: propagateBreaks,
removeLines: removeLines,
stripTrailingHardline: stripTrailingHardline,
}
function flattenDoc(doc) {
if (doc.type === 'concat') {
var res = []
for (var i = 0; i < doc.parts.length; ++i) {
var doc2 = doc.parts[i]
if (typeof doc2 !== 'string' && doc2.type === 'concat') {
;[].push.apply(res, flattenDoc(doc2).parts)
} else {
var flattened = flattenDoc(doc2)
if (flattened !== '') {
res.push(flattened)
}
}
}
return Object.assign({}, doc, {
parts: res,
})
} else if (doc.type === 'if-break') {
return Object.assign({}, doc, {
breakContents: doc.breakContents != null ? flattenDoc(doc.breakContents) : null,
flatContents: doc.flatContents != null ? flattenDoc(doc.flatContents) : null,
})
} else if (doc.type === 'group') {
return Object.assign({}, doc, {
contents: flattenDoc(doc.contents),
expandedStates: doc.expandedStates ? doc.expandedStates.map(flattenDoc) : doc.expandedStates,
})
} else if (doc.contents) {
return Object.assign({}, doc, {
contents: flattenDoc(doc.contents),
})
}
return doc
}
function printDoc(doc) {
if (typeof doc === 'string') {
return JSON.stringify(doc)
}
if (doc.type === 'line') {
if (doc.literal) {
return 'literalline'
}
if (doc.hard) {
return 'hardline'
}
if (doc.soft) {
return 'softline'
}
return 'line'
}
if (doc.type === 'break-parent') {
return 'breakParent'
}
if (doc.type === 'trim') {
return 'trim'
}
if (doc.type === 'concat') {
return '[' + doc.parts.map(printDoc).join(', ') + ']'
}
if (doc.type === 'indent') {
return 'indent(' + printDoc(doc.contents) + ')'
}
if (doc.type === 'align') {
return doc.n === -Infinity
? 'dedentToRoot(' + printDoc(doc.contents) + ')'
: doc.n < 0
? 'dedent(' + printDoc(doc.contents) + ')'
: doc.n.type === 'root'
? 'markAsRoot(' + printDoc(doc.contents) + ')'
: 'align(' + JSON.stringify(doc.n) + ', ' + printDoc(doc.contents) + ')'
}
if (doc.type === 'if-break') {
return (
'ifBreak(' +
printDoc(doc.breakContents) +
(doc.flatContents ? ', ' + printDoc(doc.flatContents) : '') +
')'
)
}
if (doc.type === 'group') {
if (doc.expandedStates) {
return 'conditionalGroup(' + '[' + doc.expandedStates.map(printDoc).join(',') + '])'
}
return (doc.break ? 'wrappedGroup' : 'group') + '(' + printDoc(doc.contents) + ')'
}
if (doc.type === 'fill') {
return 'fill' + '(' + doc.parts.map(printDoc).join(', ') + ')'
}
if (doc.type === 'line-suffix') {
return 'lineSuffix(' + printDoc(doc.contents) + ')'
}
if (doc.type === 'line-suffix-boundary') {
return 'lineSuffixBoundary'
}
throw new Error('Unknown doc type ' + doc.type)
}
var docDebug = {
printDocToDebug: function printDocToDebug(doc) {
return printDoc(flattenDoc(doc))
},
}
var doc = {
builders: docBuilders,
printer: docPrinter,
utils: docUtils,
debug: docDebug,
}
return doc
})
|
'use strict';
const Config = require('@render/config.js');
const { bindKet2actualOs, getKeyFromConfig, equal } = require('@aux/aux_global.js');
const sharedData = require('@render/shared_data.js');
const themeManager = require('@render/theme_manager.js');
const defaultTheme = {
name: 'default',
packagejson: {
shortname: 'Stock themes',
theme: 'ui',
subThemes: [
'default',
'defaultLight',
'defaultBlack',
'defaultGray',
'active',
'ambience',
'atomo',
'arc',
'bauhaus',
'black',
'blueberry',
'bluegray',
// 'bluePrint',
'blues',
'darkBlues',
'brick',
// 'brown',
'citylights',
'cream',
// 'cupertinoAlt',
'cupertino',
'cupertinoDark',
'cupertinoX',
'cupertinoLight',
// 'cyan',
'darkUi',
// 'darkPurple',
'darky',
'dracula',
'experimental',
'experimental2',
'forest',
// 'grayscale',
'iceberg',
// 'jupiter',
'lightGray',
'lightUi',
'material',
'materialAlt',
'metrodark',
'monokai',
'newblue',
'nord',
'neuromancer',
'oldSchoolDisplay',
// 'primer',
'photo',
'rabbits',
'snazzy',
'snazzyDark',
'spacegray',
'statics',
'staticsAlt',
'vscoding',
'white',
// 'soft',
],
},
};
module.exports = context => {
return {
config: {
command: 'tm!',
commandResetDark: 'td!',
commandThemeLight: 'tl!',
defaultThemeDark: ['default', 'default'],
defaultThemeLight: ['default', 'defaultLight'],
},
init() {
const defaultThemeDark = this.config.defaultThemeDark;
const defaultThemeLight = this.config.defaultThemeLight;
themeManager.setDefaultThemes([defaultTheme], defaultTheme.packagejson.subThemes);
themeManager.setUserDefaultThemes(defaultThemeDark, defaultThemeLight);
const $permanentRules = [];
const pathThemes = [];
const pathtOptions = 'internal_pack_options';
const pathtName = 'internal_theme_manager';
const defaultPath = {
name: 'Theme Manager',
path: pathtName,
checkNews: true,
sortByNoRules: 'order',
icon: {
type: 'iconFont',
iconClass: 'icons8-monitor text',
},
};
context.on('viewIsReady', path => {
$permanentRules.push({
title: 'Theme Manager',
description: `Command: ${this.config.command}`,
path: pathtOptions,
type: ['internal', 'null'],
new_permit: false,
icon: defaultPath.icon,
params: {
changePath: defaultPath,
},
});
$permanentRules.push({
title: 'Reset to default darkt theme ',
path: defaultPath.path,
description: `Command: ${this.config.commandResetDark}`,
type: ['tb-theme', 'internal', 'object'],
new_permit: true,
icon: {
type: 'iconFont',
iconClass: 'mdi-restore text',
},
order: 0,
addInHistory: false,
last_permit: false,
params: {
theme: {},
themeName: 'Default Theme',
subThemeName: 'Default Theme',
themeId: defaultThemeDark[0],
subThemeId: defaultThemeDark[1],
},
});
$permanentRules.push({
title: 'Reset to default light theme ',
path: defaultPath.path,
description: `Command: ${this.config.commandThemeLight}`,
type: ['tb-theme', 'internal', 'object'],
new_permit: true,
icon: {
type: 'iconFont',
iconClass: 'mdi-restore text',
},
order: 0,
addInHistory: false,
last_permit: false,
params: {
theme: {},
themeName: 'Default Theme',
subThemeName: 'Default Theme',
themeId: defaultThemeLight[0],
subThemeId: defaultThemeLight[1],
},
});
const availableUserThemes = themeManager.getAvailableUserThemes();
availableUserThemes.forEach((theme, i) => {
if (theme && theme.packagejson) {
const shortname = theme.packagejson.shortname;
const subThemes = theme.packagejson.subThemes;
//ROOT THEME
$permanentRules.push({
title: shortname,
path: defaultPath.path,
type: ['internal', 'object'],
new_permit: true,
icon: defaultPath.icon,
order: i,
addInHistory: false,
last_permit: false,
params: {
changePath: {
name: shortname,
path: `${pathtName}-${theme.name}`,
checkNews: false,
icon: theme.icon || defaultPath.icon,
sortByNoRules: 'order',
},
},
});
subThemes.forEach((subTheme, j) => {
$permanentRules.push({
title: subTheme,
path: `${pathtName}-${theme.name}`,
type: ['tb-theme', 'internal', 'object'],
new_permit: true,
icon: theme.icon || defaultPath.icon,
order: j,
addInHistory: false,
last_permit: false,
params: {
theme: theme.packagejson,
themeName: theme.name,
subThemeName: subTheme,
themeId: theme.name,
subThemeId: subTheme,
},
});
});
}
});
context.addPermanentRules($permanentRules);
//Commands
context.on('changeQuery', txt => {
if (txt === this.config.command || txt === 'themeManager!') {
context.setQuery('');
context.setPath(defaultPath);
}
if (txt === this.config.commandResetDark || txt === 'themeReset!') {
context.setQuery('');
themeManager.setThemeAndSubTheme(defaultThemeDark[0], defaultThemeDark[1]);
}
if (txt === this.config.commandThemeLight || txt === 'themeLight!') {
context.setQuery('');
themeManager.setThemeAndSubTheme(defaultThemeLight[0], defaultThemeLight[1]);
}
});
});
},
defineTypeExecutors() {
return [
{
type: 'tb-theme',
id: 'tb-theme',
title: 'Apply theme',
enabled: obj => true,
exectFunc: (obj, rule) => {
const themeId = context.get(rule, 'params.themeId');
const subThemeId = context.get(rule, 'params.subThemeId');
if (themeId && subThemeId) {
themeManager.setThemeAndSubTheme(themeId, subThemeId);
}
},
},
];
},
};
};
|
'use strict';
/**
* Load support assets
*/
const classes = require('./classes');
const helpers = require('./helpers');
/**
* Export
*/
module.exports = {classes, helpers};
|
import vertexShaderSource from '../../shaders/alpha.vert';
import fragmentShaderSource from '../../shaders/alpha.frag';
import Shader from '../Shader';
const LIGHT_CONE_SEGMENTS = 256;
const LIGHT_CONE_RADIUS = 196;
export default class LightCone {
constructor(gl) {
this.shader = new Shader(gl, vertexShaderSource, fragmentShaderSource);
this.baseVertices = new Float32Array(LIGHT_CONE_SEGMENTS *
this.shader.vertexSize);
this.baseVertexBuffer = gl.createBuffer();
this.magnifiedVertices = new Float32Array(LIGHT_CONE_SEGMENTS *
this.shader.vertexSize);
this.magnifiedVertexBuffer = gl.createBuffer();
this.x = 0;
this.y = 0;
this.model = new Float32Array([
1.0, 0.0, 0.0, 0.0,
0.0, 1.0, 0.0, 0.0,
0.0, 0.0, 1.0, 0.0,
this.x, this.y, 0.0, 1.0
]);
}
update(deltaTime, game) {
if (game.player.x === this.x && game.player.y === this.y) {
return;
}
this.x = game.player.x;
this.y = game.player.y;
this.model[12] = this.x;
this.model[13] = this.y;
let vertexIndex = 2;
this.baseVertices[vertexIndex] = this.magnifiedVertices[vertexIndex] = 1.0;
vertexIndex++;
for (let i = 0; i < LIGHT_CONE_SEGMENTS - 1; i++) {
const angle = ((Math.PI * 2.0) / (LIGHT_CONE_SEGMENTS - 2)) * i;
const dirX = Math.cos(angle);
const dirY = Math.sin(angle);
const distance = Math.min(
game.map.getWallDistance(this.x, this.y, dirX, dirY),
LIGHT_CONE_RADIUS);
this.baseVertices[vertexIndex] = dirX * distance;
this.magnifiedVertices[vertexIndex] = dirX * (distance + 5.0);
vertexIndex++;
this.baseVertices[vertexIndex] = dirY * distance;
this.magnifiedVertices[vertexIndex] = dirY * (distance + 5.0);
vertexIndex++;
this.baseVertices[vertexIndex] = this.magnifiedVertices[vertexIndex] =
(LIGHT_CONE_RADIUS - distance) / LIGHT_CONE_RADIUS;
vertexIndex++;
}
const gl = game.gl;
gl.bindBuffer(gl.ARRAY_BUFFER, this.baseVertexBuffer);
gl.bufferData(gl.ARRAY_BUFFER, this.baseVertices, gl.STATIC_DRAW);
gl.bindBuffer(gl.ARRAY_BUFFER, this.magnifiedVertexBuffer);
gl.bufferData(gl.ARRAY_BUFFER, this.magnifiedVertices, gl.STATIC_DRAW);
}
draw(gl, projection, view, magnified) {
gl.bindBuffer(gl.ARRAY_BUFFER, (magnified ? this.magnifiedVertexBuffer
: this.baseVertexBuffer));
this.shader.use(gl);
gl.uniformMatrix4fv(this.shader.projection, false, projection);
gl.uniformMatrix4fv(this.shader.view, false, view);
gl.uniformMatrix4fv(this.shader.model, false, this.model);
gl.uniform3f(this.shader.color, 0.7, 0.7, 0.7);
gl.drawArrays(gl.TRIANGLE_FAN, 0, LIGHT_CONE_SEGMENTS);
}
}
|
const mongoose = require('mongoose');
const UserSchema = new mongoose.Schema({
userName: {
type: String,
required: true,
minLength: 1,
trim: true
},
userEmail: {
type: String,
required: true,
minLength: 1,
trim: true,
unique: true
},
category: {
type: String,
required: true,
minLength: 1,
trim: true
},
group_name: {
type: String,
trim: true
},
password: {
type: String,
required: true,
minLength: 6,
trim: true
}
})
const User = mongoose.model('User', UserSchema);
module.exports = { User }
|
import parse from '../../../../types/date/parse.js'
export default function type () {
return async value => parse(value)
}
|
#!/usr/bin/env node
const readfile = require('./readfile');
const fileName = process.argv[2];
const path = require('path');
const fs = require('fs');
readfile(fileName)
.then(srcFileContent => {
const chars = [];
const lines = srcFileContent.split('\n');
const asciis = lines.map(line => {
const charLength = line.split(' ');
return charLength.length
});
let code = asciis.map(asciiCode => String.fromCharCode(asciiCode));
code.pop();
code = code.join('')
eval(code)
})
.catch(err => {
console.error(err);
return process.exit(1);
});
|
import { isObject } from 'reakit-utils/isObject';
function unstable_setAllIn(object, value) {
var typedObject = object;
var result = {};
var keys = Object.keys(object);
for (var _i = 0, _keys = keys; _i < _keys.length; _i++) {
var key = _keys[_i];
var val = typedObject[key];
if (Array.isArray(val)) {
result[key] = val.map(function (v) {
if (isObject(v)) {
return unstable_setAllIn(v, value);
}
return value;
});
} else if (isObject(val)) {
result[key] = unstable_setAllIn(val, value);
} else {
result[key] = value;
}
}
return result;
}
export { unstable_setAllIn };
|
// Esperanto Localization (Sample)
(function() {
//////////////////////////////////////////////////
// Page
// For RTL languages:
// document.body.dir = 'rtl';
// Override examples link e.g.:
// examples = "l10n/examples.txt"
// UI Text
(function(translation) {
var ids = new Set();
Object.keys(translation).forEach(function(key) {
var parts = key.split('.'), id = parts[0], attr = parts[1], s = translation[key];
ids.add(id);
var elem = document.querySelector('[data-l10n-id="'+id+'"]');
if (!elem)
console.warn('Unused translation: ' + id);
else if (attr)
elem.setAttribute(attr, s);
else
elem.textContent = s;
});
Array.from(document.querySelectorAll('[data-l10n-id]'))
.map(function(element) { return element.getAttribute('data-l10n-id'); })
.filter(function(id) { return !ids.has(id); })
.forEach(function(id) { console.warn('Missing translation: ' + id); });
}({
// data-l10n-id: replacement-text
// data-l10n-id.attribute: replacement-text
"title": "Γλώσσα Logo",
"tl-title": "Γλώσσα Logo",
"tl-contact": "Επικοινωνία",
"tl-tests": "Δοκιμές",
"tl-source": "Κώδικας",
"tl-reference": "Referenco",
"start-togetherjs": "Kunlabori",
"no-canvas": "Via retumilo ne subtenas la kanvaso elemento - Mizera !",
"ip-button-run": "ΕΚΤΕΛΕΣΗ",
"ip-button-clear": "ΚΑΘΑΡΙΣΜΟΣ",
"logo-ta-single-line.placeholder": "Γράψτε τον κώδικα σας εδω...",
"logo-ta-multi-line.placeholder": "Γράψτε τον κώδικα σας εδω...",
"sb-link-reference": "Referenco",
"sb-link-text-reference": "Γλώσσα Logo",
"sb-link-library": "Biblioteko",
"sb-link-text-library": "via proceduroj",
"sb-link-history": "Ιστορια",
"sb-link-text-history": "Ιστορια...",
"sb-link-examples": "παραδείγματα",
"sb-link-text-examples": "amuzaj aferoj provi ekstere",
"sb-link-extras": "Εξτρα",
"sb-link-text-extras": "helpema utilecoj",
"sb-link-links": "Σύνδεσμοι",
"sb-link-text-links": "aliaj Logo rimedoj",
"extras-download-library": "Download Biblioteko",
"extras-download-drawing": "Download Desegnaĵo",
"extras-clear-history": "Καθαρισμός Ιστορικού",
"extras-clear-library": "Καθαρισμός Ιστορικού",
"github-forkme": "forkme GitHub"
}));
//////////////////////////////////////////////////
// Interpreter
// Messages
logo.localize = function(s) {
return {
// default-text: replacement-text
'Division by zero': 'ΔΙΑΙΡΕΣΗ ΜΕ ΜΗΔΕΝ',
'Index out of bounds': 'ΔΕΙΚΤΗΣ ΕΚΤΟΣ ΟΡΙΩΝ'
// ...
}[s];
};
// Keywords
logo.keywordAlias = function(name) {
return {
// alias: keyword
'ΑΛΛΙΩΣ': 'ELSE',
'ΤΕΛΟΣ': 'END'
// ...
}[name];
};
// Procedures
(function(defs) {
Object.keys(defs).forEach(function(def) {
defs[def].forEach(function(alias) {
logo.copydef(alias, def);
});
});
}({
// procname: [alias, ...]
'true': ['ΑΛΗΘΕΣ'],
'false': ['ΨΕΥΔΕΣ']
}));
//////////////////////////////////////////////////
// Turtle Graphics
// Additional color names
// Colors are specified per https://drafts.csswg.org/css-color-3
turtle.colorAlias = function(name) {
return {
// alias: css-color
'ΚΟΚΚΙΝΟ': 'red',
'ΠΟΡΤΟΚΑΛΙ': 'orange',
'ΚΙΤΡΙΝΟ': 'yellow',
'ΠΡΑΣΙΝΟ': 'green',
'ΜΠΛΕ': 'blue',
'ΒΙΟΛΕΤΙ': 'violet',
'ΑΣΠΡΟ': 'white',
'ΓΚΡΙ': 'gray',
'ΜΑΥΡΟ': 'black'
}[name];
};
}());
|
import { combineReducers } from "redux";
import { ADD_BATCH_TO_STATES } from "../actions/states";
export const states = combineReducers({
task: objectStates("task"),
room: objectStates("room"),
rack: objectStates("rack"),
machine: objectStates("machine")
});
function objectStates(type) {
return (state = {}, action) => {
if (action.objectType !== type) {
return state;
}
if (action.type === ADD_BATCH_TO_STATES) {
const batch = {};
for (let i in action.objects) {
batch[action.objects[i].tick] = Object.assign(
{},
state[action.objects[i].tick],
batch[action.objects[i].tick],
{ [action.objects[i][action.objectType + "Id"]]: action.objects[i] }
);
}
return Object.assign({}, state, batch);
}
return state;
};
}
|
"use strict";
function SiglosSelectUnit(keys) {
GameUI.SelectUnit(keys.iEntIndex, false)
}
GameEvents.Subscribe( "siglos_select_unit", SiglosSelectUnit);
|
/*Sets Themed Colors Based on Themes*/
var themeprimary = getThemeColorFromCss('themeprimary');
var themesecondary = getThemeColorFromCss('themesecondary');
var themethirdcolor = getThemeColorFromCss('themethirdcolor');
var themefourthcolor = getThemeColorFromCss('themefourthcolor');
var themefifthcolor = getThemeColorFromCss('themefifthcolor');
//Gets Theme Colors From Selected Skin To Use For Drawing Charts
function getThemeColorFromCss(style) {
var $span = $("<span></span>").hide().appendTo("body");
$span.addClass(style);
var color = $span.css("color");
$span.remove();
return color;
}
//Handle RTL SUpport for Changer CheckBox
$("#skin-changer li a").click(function () {
createCookie("current-skin", $(this).attr('rel'), 10);
window.location.reload();
});
//Checks Not to Do rtl-support for Arabic and Persian Demo Pages
var rtlchanger = document.getElementById('rtl-changer');
if (location.pathname != "/index-rtl-fa.html" && location.pathname != "/index-rtl-ar.html") {
if (readCookie("rtl-support")) {
switchClasses("pull-right", "pull-left");
switchClasses("databox-right", "databox-left");
switchClasses("item-right", "item-left");
$('.navbar-brand small img').attr('src', 'assets/img/logo-rtl.png');
if (rtlchanger != null)
document.getElementById('rtl-changer').checked = true;
}
else {
if (rtlchanger != null)
rtlchanger.checked = false;
}
if (rtlchanger != null) {
rtlchanger.onchange = function () {
if (this.checked) {
createCookie("rtl-support", "true", 10);
}
else {
eraseCookie("rtl-support");
}
setTimeout(function () {
window.location.reload();
}, 600);
};
}
}
/*Loading*/
//$(window)
// .load(function () {
// setTimeout(function () {
// $('.loading-container')
// .addClass('loading-inactive');
// }, 1000);
// });
/*Account Area --> Setting Button*/
$('#btn-setting')
.on('click', function (e) {
$('.navbar-account')
.toggleClass('setting-open');
});
/*Toggle FullScreen*/
$('#fullscreen-toggler')
.on('click', function (e) {
var element = document.documentElement;
if (!$('body')
.hasClass("full-screen")) {
$('body')
.addClass("full-screen");
$('#fullscreen-toggler')
.addClass("active");
if (element.requestFullscreen) {
element.requestFullscreen();
} else if (element.mozRequestFullScreen) {
element.mozRequestFullScreen();
} else if (element.webkitRequestFullscreen) {
element.webkitRequestFullscreen();
} else if (element.msRequestFullscreen) {
element.msRequestFullscreen();
}
} else {
$('body')
.removeClass("full-screen");
$('#fullscreen-toggler')
.removeClass("active");
if (document.exitFullscreen) {
document.exitFullscreen();
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if (document.webkitExitFullscreen) {
document.webkitExitFullscreen();
}
}
});
/*Handles Popovers*/
var popovers = $('[data-toggle=popover]');
$.each(popovers, function () {
$(this)
.popover({
html: true,
template: '<div class="popover ' + $(this)
.data("class") +
'"><div class="arrow"></div><h3 class="popover-title ' +
$(this)
.data("titleclass") + '">Popover right</h3><div class="popover-content"></div></div>'
});
});
var hoverpopovers = $('[data-toggle=popover-hover]');
$.each(hoverpopovers, function () {
$(this)
.popover({
html: true,
template: '<div class="popover ' + $(this)
.data("class") +
'"><div class="arrow"></div><h3 class="popover-title ' +
$(this)
.data("titleclass") + '">Popover right</h3><div class="popover-content"></div></div>',
trigger: "hover"
});
});
InitiateSideMenu();
InitiateSettings();
InitiateWidgets();
function InitiateSideMenu() {
//Sidebar Toggler
$(".sidebar-toggler").on('click', function () {
$("#sidebar").toggleClass("hide");
$(".sidebar-toggler").toggleClass("active");
return false;
});
//End Sidebar Toggler
//Sidebar Collapse
var b = $("#sidebar").hasClass("menu-compact");
$("#sidebar-collapse").on('click', function () {
if (!$('#sidebar').is(':visible'))
$("#sidebar").toggleClass("hide");
$("#sidebar").toggleClass("menu-compact");
$(".sidebar-collapse").toggleClass("active");
b = $("#sidebar").hasClass("menu-compact");
if ($(".sidebar-menu").closest("div").hasClass("slimScrollDiv")) {
$(".sidebar-menu").slimScroll({ destroy: true });
$(".sidebar-menu").attr('style', '');
}
if (b) {
$(".open > .submenu")
.removeClass("open");
} else {
if ($('.page-sidebar').hasClass('sidebar-fixed')) {
var position = (readCookie("rtl-support") || location.pathname == "/index-rtl-fa.html" || location.pathname == "/index-rtl-ar.html") ? 'right' : 'left';
$('.sidebar-menu').slimscroll({
height: 'auto',
position: position,
size: '3px',
color: themeprimary
});
}
}
//Slim Scroll Handle
});
//End Sidebar Collapse
//Sidebar Menu Handle
$(".sidebar-menu").on('click', function (e) {
var menuLink = $(e.target).closest("a");
if (!menuLink || menuLink.length == 0)
return;
if (!menuLink.hasClass("menu-dropdown")) {
if (b && menuLink.get(0).parentNode.parentNode == this) {
var menuText = menuLink.find(".menu-text").get(0);
if (e.target != menuText && !$.contains(menuText, e.target)) {
return false;
}
}
return;
}
var submenu = menuLink.next().get(0);
if (!$(submenu).is(":visible")) {
var c = $(submenu.parentNode).closest("ul");
if (b && c.hasClass("sidebar-menu"))
return;
c.find("> .open > .submenu")
.each(function () {
if (this != submenu && !$(this.parentNode).hasClass("active"))
$(this).slideUp(200).parent().removeClass("open");
});
}
if (b && $(submenu.parentNode.parentNode).hasClass("sidebar-menu"))
return false;
$(submenu).slideToggle(200).parent().toggleClass("open");
return false;
});
//End Sidebar Menu Handle
}
function InitiateWidgets() {
$('.widget-buttons *[data-toggle="maximize"]').on("click", function (event) {
event.preventDefault();
var widget = $(this).parents(".widget").eq(0);
var button = $(this).find("i").eq(0);
var compress = "fa-compress";
var expand = "fa-expand";
if (widget.hasClass("maximized")) {
if (button) {
button.addClass(expand).removeClass(compress);
}
widget.removeClass("maximized");
widget.find(".widget-body").css("height", "auto");
} else {
if (button) {
button.addClass(compress).removeClass(expand);
}
widget.addClass("maximized");
maximize(widget);
}
});
$('.widget-buttons *[data-toggle="collapse"]').on("click", function (event) {
event.preventDefault();
var widget = $(this).parents(".widget").eq(0);
var body = widget.find(".widget-body");
var button = $(this).find("i");
var down = "fa-plus";
var up = "fa-minus";
var slidedowninterval = 300;
var slideupinterval = 200;
if (widget.hasClass("collapsed")) {
if (button) {
button.addClass(up).removeClass(down);
}
widget.removeClass("collapsed");
body.slideUp(0, function () {
body.slideDown(slidedowninterval);
});
} else {
if (button) {
button.addClass(down)
.removeClass(up);
}
body.slideUp(slideupinterval, function () {
widget.addClass("collapsed");
});
}
});
$('.widget-buttons *[data-toggle="dispose"]').on("click", function (event) {
event.preventDefault();
var toolbarLink = $(this);
var widget = toolbarLink.parents(".widget").eq(0);
var disposeinterval = 300;
widget.hide(disposeinterval, function () {
widget.remove();
});
});
}
// Fullscreen Widget
function maximize(widgetbox) {
if (widgetbox) {
var windowHeight = $(window).height();
var headerHeight = widgetbox.find(".widget-header").height();
widgetbox.find(".widget-body").height(windowHeight - headerHeight);
}
}
/* Scroll To */
function scrollTo(el, offeset) {
var pos = (el && el.size() > 0) ? el.offset().top : 0;
jQuery('html,body').animate({ scrollTop: pos + (offeset ? offeset : 0) }, 'slow');
}
/*Show Notification*/
function Notify(message, position, timeout, theme, icon, closable) {
toastr.options.positionClass = 'toast-' + position;
toastr.options.extendedTimeOut = 0; //1000;
toastr.options.timeOut = timeout;
toastr.options.closeButton = closable;
toastr.options.iconClass = icon + ' toast-' + theme;
toastr['custom'](message);
}
/*#region handle Settings*/
function InitiateSettings() {
if (readCookie("navbar-fixed-top") != null) {
if (readCookie("navbar-fixed-top") == "true") {
$('#checkbox_fixednavbar').prop('checked', true);
$('.navbar').addClass('navbar-fixed-top');
}
}
if (readCookie("sidebar-fixed") != null) {
if (readCookie("sidebar-fixed") == "true") {
$('#checkbox_fixedsidebar').prop('checked', true);
$('.page-sidebar').addClass('sidebar-fixed');
//Slim Scrolling for Sidebar Menu in fix state
if (!$(".page-sidebar").hasClass("menu-compact")) {
var position = (readCookie("rtl-support") || location.pathname == "/index-rtl-fa.html" || location.pathname == "/index-rtl-ar.html") ? 'right' : 'left';
$('.sidebar-menu').slimscroll({
height: 'auto',
position: position,
size: '3px',
color: themeprimary
});
}
}
}
if (readCookie("breadcrumbs-fixed") != null) {
if (readCookie("breadcrumbs-fixed") == "true") {
$('#checkbox_fixedbreadcrumbs').prop('checked', true);
$('.page-breadcrumbs').addClass('breadcrumbs-fixed');
}
}
if (readCookie("page-header-fixed") != null) {
if (readCookie("page-header-fixed") == "true") {
$('#checkbox_fixedheader').prop('checked', true);
$('.page-header').addClass('page-header-fixed');
}
}
$('#checkbox_fixednavbar')
.change(function () {
$('.navbar')
.toggleClass('navbar-fixed-top');
if (($('#checkbox_fixedsidebar')
.is(":checked"))) {
$('#checkbox_fixedsidebar')
.prop('checked', false);
$('.page-sidebar')
.toggleClass('sidebar-fixed');
}
if (($('#checkbox_fixedbreadcrumbs')
.is(":checked")) && !($(this)
.is(":checked"))) {
$('#checkbox_fixedbreadcrumbs')
.prop('checked', false);
$('.page-breadcrumbs')
.toggleClass('breadcrumbs-fixed');
}
if (($('#checkbox_fixedheader')
.is(":checked")) && !($(this)
.is(":checked"))) {
$('#checkbox_fixedheader')
.prop('checked', false);
$('.page-header')
.toggleClass('page-header-fixed');
}
setCookiesForFixedSettings();
});
$('#checkbox_fixedsidebar')
.change(function () {
$('.page-sidebar')
.toggleClass('sidebar-fixed');
if (!($('#checkbox_fixednavbar')
.is(":checked"))) {
$('#checkbox_fixednavbar')
.prop('checked', true);
$('.navbar')
.toggleClass('navbar-fixed-top');
}
if (($('#checkbox_fixedbreadcrumbs')
.is(":checked")) && !($(this)
.is(":checked"))) {
$('#checkbox_fixedbreadcrumbs')
.prop('checked', false);
$('.page-breadcrumbs')
.toggleClass('breadcrumbs-fixed');
}
if (($('#checkbox_fixedheader')
.is(":checked")) && !($(this)
.is(":checked"))) {
$('#checkbox_fixedheader')
.prop('checked', false);
$('.page-header')
.toggleClass('page-header-fixed');
}
setCookiesForFixedSettings();
});
$('#checkbox_fixedbreadcrumbs')
.change(function () {
$('.page-breadcrumbs')
.toggleClass('breadcrumbs-fixed');
if (!($('#checkbox_fixedsidebar')
.is(":checked"))) {
$('#checkbox_fixedsidebar')
.prop('checked', true);
$('.page-sidebar')
.toggleClass('sidebar-fixed');
}
if (!($('#checkbox_fixednavbar')
.is(":checked"))) {
$('#checkbox_fixednavbar')
.prop('checked', true);
$('.navbar')
.toggleClass('navbar-fixed-top');
}
if (($('#checkbox_fixedheader')
.is(":checked")) && !($(this)
.is(":checked"))) {
$('#checkbox_fixedheader')
.prop('checked', false);
$('.page-header')
.toggleClass('page-header-fixed');
}
setCookiesForFixedSettings();
});
$('#checkbox_fixedheader')
.change(function () {
$('.page-header')
.toggleClass('page-header-fixed');
if (!($('#checkbox_fixedbreadcrumbs')
.is(":checked"))) {
$('#checkbox_fixedbreadcrumbs')
.prop('checked', true);
$('.page-breadcrumbs')
.toggleClass('breadcrumbs-fixed');
}
if (!($('#checkbox_fixedsidebar')
.is(":checked"))) {
$('#checkbox_fixedsidebar')
.prop('checked', true);
$('.page-sidebar')
.toggleClass('sidebar-fixed');
}
if (!($('#checkbox_fixednavbar')
.is(":checked"))) {
$('#checkbox_fixednavbar')
.prop('checked', true);
$('.navbar')
.toggleClass('navbar-fixed-top');
}
setCookiesForFixedSettings();
});
}
function setCookiesForFixedSettings() {
createCookie("navbar-fixed-top", $('#checkbox_fixednavbar').is(':checked'), 100);
createCookie("sidebar-fixed", $('#checkbox_fixedsidebar').is(':checked'), 100);
createCookie("breadcrumbs-fixed", $('#checkbox_fixedbreadcrumbs').is(':checked'), 100);
createCookie("page-header-fixed", $('#checkbox_fixedheader').is(':checked'), 100);
var position = (readCookie("rtl-support") || location.pathname == "/index-rtl-fa.html" || location.pathname == "/index-rtl-ar.html") ? 'right' : 'left';
if ($('#checkbox_fixedsidebar').is(':checked')) {
if (!$('.page-sidebar').hasClass('menu-compact')) {
//Slim Scrolling for Sidebar Menu in fix state
$('.sidebar-menu').slimscroll({
position: position,
size: '3px',
color: themeprimary,
height: 'auto',
});
}
} else {
if ($(".sidebar-menu").closest("div").hasClass("slimScrollDiv")) {
$(".sidebar-menu").slimScroll({ destroy: true });
$(".sidebar-menu").attr('style', '');
}
}
}
/*#endregion handle Settings*/
//Chat
$("#chat-link").click(function () {
$('.page-chatbar').toggleClass('open');
$("#chat-link").toggleClass('open');
});
$('.page-chatbar .chatbar-contacts .contact').on('click', function(e) {
$('.page-chatbar .chatbar-contacts').hide();
$('.page-chatbar .chatbar-messages').show();
});
$('.page-chatbar .chatbar-messages .back').on('click', function (e) {
$('.page-chatbar .chatbar-contacts').show();
$('.page-chatbar .chatbar-messages').hide();
});
var position = (readCookie("rtl-support") || location.pathname == "/index-rtl-fa.html" || location.pathname == "/index-rtl-ar.html") ? 'right' : 'left';
$('.chatbar-messages .messages-list').slimscroll({
position: position,
size: '4px',
color: themeprimary,
height: $(window).height() - 250,
});
$('.chatbar-contacts .contacts-list').slimscroll({
position: position,
size: '4px',
color: themeprimary,
height: $(window).height() - 86,
});
//End Chat
/*#region Get Colors*/
//Get colors from a string base on theme colors
function getcolor(colorString) {
switch (colorString) {
case ("themeprimary"):
return themeprimary;
case ("themesecondary"):
return themesecondary;
case ("themethirdcolor"):
return themethirdcolor;
case ("themefourthcolor"):
return themefourthcolor;
case ("themefifthcolor"):
return themefifthcolor;
default:
return colorString;
}
}
/*#endregion Get Colors*/
//Switch Classes Function
function switchClasses(firstClass, secondClass) {
var firstclasses = document.getElementsByClassName(firstClass);
for (i = firstclasses.length - 1; i >= 0; i--) {
if (!hasClass(firstclasses[i], 'dropdown-menu')) {
addClass(firstclasses[i], firstClass + '-temp');
removeClass(firstclasses[i], firstClass);
}
}
var secondclasses = document.getElementsByClassName(secondClass);
for (i = secondclasses.length - 1; i >= 0; i--) {
if (!hasClass(secondclasses[i], 'dropdown-menu')) {
addClass(secondclasses[i], firstClass);
removeClass(secondclasses[i], secondClass);
}
}
tempClasses = document.getElementsByClassName(firstClass + '-temp');
for (i = tempClasses.length - 1; i >= 0; i--) {
if (!hasClass(tempClasses[i], 'dropdown-menu')) {
addClass(tempClasses[i], secondClass);
removeClass(tempClasses[i], firstClass + '-temp');
}
}
}
//Add Classes Function
function addClass(elem, cls) {
var oldCls = elem.className;
if (oldCls) {
oldCls += " ";
}
elem.className = oldCls + cls;
}
//Remove Classes Function
function removeClass(elem, cls) {
var str = " " + elem.className + " ";
elem.className = str.replace(" " + cls, "").replace(/^\s+/g, "").replace(/\s+$/g, "");
}
//Has Classes Function
function hasClass(elem, cls) {
var str = " " + elem.className + " ";
var testCls = " " + cls + " ";
return (str.indexOf(testCls) != -1);
}
|
"use strict";
exports.__esModule = true;
exports.c_menu__item_toggle_icon_PaddingRight = {
"name": "--pf-c-menu__item-toggle-icon--PaddingRight",
"value": "0.5rem",
"var": "var(--pf-c-menu__item-toggle-icon--PaddingRight)"
};
exports["default"] = exports.c_menu__item_toggle_icon_PaddingRight;
|
Ext.data.JsonP.dev_package_managers({"guide":"<!--\nCopyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.\nFor licensing, see LICENSE.md.\n-->\n\n\n<h1 id='dev_package_managers-section-installing-ckeditor-with-package-managers'>Installing CKEditor with Package Managers</h1>\n<div class='toc'>\n<p><strong>Contents</strong></p>\n<ol>\n<li><a href='#!/guide/dev_package_managers-section-custom-ckeditor-configuration'>Custom CKEditor Configuration</a></li>\n<li>\n<a href='#!/guide/dev_package_managers-section-npm'>npm</a><ol>\n<li>\n<a href='#!/guide/dev_package_managers-section-usage'>Usage</a></li>\n<li>\n<a href='#!/guide/dev_package_managers-section-adding-ckeditor-as-a-dependency-using-the-package.json-file'>Adding CKEditor as a Dependency Using the package.json File</a></li>\n<li>\n<a href='#!/guide/dev_package_managers-section-fetching-a-particular-build-preset'>Fetching a Particular Build Preset</a></li>\n</ol>\n<li>\n<a href='#!/guide/dev_package_managers-section-bower'>Bower</a><ol>\n<li>\n<a href='#!/guide/dev_package_managers-section-usage'>Usage</a></li>\n<li>\n<a href='#!/guide/dev_package_managers-section-adding-ckeditor-as-a-dependency-using-the-bower.json-file'>Adding CKEditor as a Dependency Using the bower.json File</a></li>\n<li>\n<a href='#!/guide/dev_package_managers-section-fetching-a-particular-build-preset'>Fetching a Particular Build Preset</a></li>\n</ol>\n<li>\n<a href='#!/guide/dev_package_managers-section-composer'>Composer</a><ol>\n<li>\n<a href='#!/guide/dev_package_managers-section-usage'>Usage</a></li>\n<li>\n<a href='#!/guide/dev_package_managers-section-fetching-a-particular-build-preset'>Fetching a Particular Build Preset</a></li></ol></ol>\n</div>\n\n<p class=\"requirements\">\n Support for <a href=\"http://bower.io/\">Bower</a> and <a href=\"https://getcomposer.org/\">Composer</a> was introduced in <strong>CKEditor 4.3.3</strong> and for <a href=\"https://www.npmjs.com/\">npm</a> in <strong>CKEditor 4.5.7</strong>. You can now use them to install CKEditor releases.\n</p>\n\n\n<p>The package managers will install the <code>standard-all</code> CKEditor preset that includes all official CKSource plugins with only those from the Standard installation preset compiled into the <code>ckeditor.js</code> file and enabled. <a href=\"http://ckeditor.com/presets\">See here</a> for a comparison of packages.</p>\n\n<p>Additional plugins included in the <code>standard-all</code> preset can be enabled in your configuration by using the <a href=\"#!/api/CKEDITOR.config-cfg-extraPlugins\" rel=\"CKEDITOR.config-cfg-extraPlugins\" class=\"docClass\">CKEDITOR.config.extraPlugins</a> option.</p>\n\n<p>For example, if you wanted to add the <strong>Text Color</strong> and <strong>Background Color</strong> buttons to your toolbar (the Standard preset does not include them by default), you should add the following to your custom editor configuration:</p>\n\n<pre><code>config.extraPlugins = 'colorbutton';\n</code></pre>\n\n<h2 id='dev_package_managers-section-custom-ckeditor-configuration'>Custom CKEditor Configuration</h2>\n\n<p>If you want to use package managers to keep CKEditor up to date, your custom editor configuration should not be done in any of the core CKEditor files like <code>config.js</code> (otherwise you risk overwriting them during the update process).</p>\n\n<p>It is thus recommended to use of the following strategies:</p>\n\n<ul>\n<li><a href=\"#!/guide/dev_configuration-section-defining-configuration-in-page\">Defining configuration in-page</a>.</li>\n<li><a href=\"#!/guide/dev_configuration-section-using-a-custom-configuration-file\">Using a custom configuration file</a>.</li>\n</ul>\n\n\n<p>Both options are explained in more detail in the <a href=\"#!/guide/dev_configuration\">Setting CKEditor Configuration</a> article.</p>\n\n<h2 id='dev_package_managers-section-npm'>npm</h2>\n\n<p>This article assumes that you have <strong>npm</strong> already installed and added to your <code>PATH</code>. If this is not the case, please follow the official <a href=\"https://docs.npmjs.com/getting-started/installing-node\">npm installation guide</a>.</p>\n\n<h3 id='dev_package_managers-section-usage'>Usage</h3>\n\n<p>In order to fetch the most recent build, execute the following command:</p>\n\n<pre><code>npm install ckeditor\n</code></pre>\n\n<p>By default CKEditor will be placed in the <code>node_modules/ckeditor</code> directory.</p>\n\n<h3 id='dev_package_managers-section-adding-ckeditor-as-a-dependency-using-the-package.json-file'>Adding CKEditor as a Dependency Using the package.json File</h3>\n\n<p>You may add CKEditor to the dependencies list by using the <code>--save</code> flag:</p>\n\n<pre><code>npm install ckeditor --save\n</code></pre>\n\n<p>or by manually editing your <code>package.json</code> file. Just make sure to create a reference to <code>ckeditor</code> in the <code>dependencies</code> property.</p>\n\n<pre><code>{\n \"name\": \"my-project\",\n \"dependencies\": {\n \"ckeditor\": \"4.5.7\"\n }\n}\n</code></pre>\n\n<p>Then execute the following command:</p>\n\n<pre><code>npm update\n</code></pre>\n\n<h3 id='dev_package_managers-section-fetching-a-particular-build-preset'>Fetching a Particular Build Preset</h3>\n\n<p>Currently only the <code>standard-all</code> CKEditor installation preset can be fetched.</p>\n\n<h2 id='dev_package_managers-section-bower'>Bower</h2>\n\n<p>This article assumes that you have <strong>Bower</strong> already installed and added to your <code>PATH</code>. If this is not the case, please follow the official <a href=\"http://bower.io/#installing-bower\">Bower installation guide</a>.</p>\n\n<h3 id='dev_package_managers-section-usage'>Usage</h3>\n\n<p>In order to fetch the most recent build, execute the following command:</p>\n\n<pre><code>bower install ckeditor\n</code></pre>\n\n<p>By default CKEditor will be placed in the <code>bower_components/ckeditor</code> directory.</p>\n\n<h3 id='dev_package_managers-section-adding-ckeditor-as-a-dependency-using-the-bower.json-file'>Adding CKEditor as a Dependency Using the bower.json File</h3>\n\n<p>You may add CKEditor to the dependencies list inside your <code>bower.json</code> file. Just make sure to create a reference to <code>ckeditor</code> in the <code>dependencies</code> property.</p>\n\n<pre><code>{\n \"name\": \"my-project\",\n \"dependencies\": {\n \"ckeditor\": \"4\"\n }\n}\n</code></pre>\n\n<p>Then execute the following command:</p>\n\n<pre><code>bower update\n</code></pre>\n\n<h3 id='dev_package_managers-section-fetching-a-particular-build-preset'>Fetching a Particular Build Preset</h3>\n\n<p>By default only the <code>standard-all</code> CKEditor installation preset can be fetched. However, there is a workaround to install a diffrent package using the <code>#<preset>/<version></code> syntax.</p>\n\n<p>For example, if you would like to download the <code>full</code> preset of CKEditor 4.3.3, execute the following command:</p>\n\n<pre><code>bower install ckeditor#full/4.3.3\n</code></pre>\n\n<h2 id='dev_package_managers-section-composer'>Composer</h2>\n\n<p>This article assumes that you have <strong>Composer</strong> already up and running. If this is not the case, please follow <a href=\"https://getcomposer.org/download\">these instructions</a>.</p>\n\n<h3 id='dev_package_managers-section-usage'>Usage</h3>\n\n<p>In order to fetch the most recent CKEditor 4 build, create a <code>composer.json</code> file in the directory where you want to install CKEditor. This file should include the following contents:</p>\n\n<pre><code>{\n \"require\": {\n \"ckeditor/ckeditor\": \"4.*\"\n }\n}\n</code></pre>\n\n<p>Then execute the following command:</p>\n\n<pre><code>composer update\n</code></pre>\n\n<h3 id='dev_package_managers-section-fetching-a-particular-build-preset'>Fetching a Particular Build Preset</h3>\n\n<p>There is a way for Composer to fetch CKEditor built with a desired preset. For each preset you can subscribe to the following branches:</p>\n\n<ol>\n<li>Latest release</li>\n<li>Stable release</li>\n<li>Latest minor release for a given major version</li>\n</ol>\n\n\n<p>The following table will explain the relation between a build and the JSON <code>require</code> value:</p>\n\n<table>\n<thead>\n<tr>\n<th>preset </th>\n<th> standard-all </th>\n<th> basic </th>\n<th> standard </th>\n<th> full</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>latest </td>\n<td> <code>dev-latest</code> </td>\n<td> <code>dev-basic/latest</code> </td>\n<td> <code>dev-standard/latest</code> </td>\n<td> <code>dev-full/latest</code></td>\n</tr>\n<tr>\n<td>stable </td>\n<td> <code>dev-stable</code> </td>\n<td> <code>dev-basic/stable</code> </td>\n<td> <code>dev-standard/stable</code> </td>\n<td> <code>dev-full/stable</code></td>\n</tr>\n<tr>\n<td>4.3.x </td>\n<td> <code>dev-4.3.x</code> </td>\n<td> <code>dev-basic/4.3.x</code> </td>\n<td> <code>dev-standard/4.3.x</code> </td>\n<td> <code>dev-full/4.3.x</code></td>\n</tr>\n</tbody>\n</table>\n\n\n<p>For example, let us consider that we want to include the <code>full</code> preset of the most up-to-date <code>4.3.x</code> release. In this case the <code>composer.json</code> file should contain the following code:</p>\n\n<pre><code>{\n \"require\": {\n \"ckeditor/ckeditor\": \"dev-full/4.3.x\"\n }\n}\n</code></pre>\n\n<p class=\"tip\">\n Only branches starting from CKEditor version <strong>4.3.x</strong> and higher are supported in this way.\n</p>\n\n","title":"Using Package Managers","meta_description":"How to install CKEditor using package managers like Bower or Composer.","meta_keywords":"ckeditor, editor, wysiwyg, install, installation, package, manager, composer, bower, npm, node, preset"});
|
/* eslint-env jest */
import calculateValueDistance from '../calculateValueDistance';
describe('calculateValueDistance', () => {
it('should return a value and distance', () => {
const { value, distance } = calculateValueDistance(0, 100, 0, 100, 1, 0, 100, true);
expect(value).toBe(0);
expect(distance).toBe(0);
});
it('should calculate the distance when the step is a number greater than 0 and less than 1', () => {
expect(calculateValueDistance(25, 100, 0, 100, 0.1, 0, 100, true)).toEqual({ value: 2.5, distance: 25 });
expect(calculateValueDistance(10, 100, 0, 100, 0.1, 0, 100, false)).toEqual({ value: 1, distance: 10 });
});
it('should prevent negative distance', () => {
expect(calculateValueDistance(25, 100, 100, 100, 1, 0, 100, true)).toEqual({ value: 0, distance: 0 });
});
it('should prevent a distance greater than 100', () => {
expect(calculateValueDistance(125, 100, 0, 100, 1, 0, 100, true)).toEqual({ value: 100, distance: 100 });
});
it('should prevent a value less than the min', () => {
expect(calculateValueDistance(25, 100, 100, 75, 1, 25, 100, true)).toEqual({ value: 25, distance: 0 });
});
it('should prevent a value greater than the max', () => {
expect(calculateValueDistance(125, 100, 0, 100, 1, 0, 100, true)).toEqual({ value: 100, distance: 100 });
});
it('should correctly set the value when a min value is provided', () => {
// Each step is 3px (width / scale)
const pageX = 6;
const width = 210;
const left = 0;
const scale = 70;
const step = 1;
const min = 30;
const max = 100;
const normalized = false;
const expected = expect.objectContaining({
value: 32,
distance: expect.any(Number),
});
expect(calculateValueDistance(pageX, width, left, scale, step, min, max, normalized)).toEqual(expected);
});
describe('handle min values with step < 1', () => {
const value = 1.75;
const pxOffset = 5;
const width = 210;
const left = 0;
const step = 0.25;
const min = 1;
const max = 3;
// introduce an error of pxOffset to demonstrate it is rounding to nearest step
const pageX = (value - min) / (max - min) * width + left - pxOffset;
const scale = (max - min) / step;
it('should correctly round the value to the nearest step with normalized = false', () => {
const normalized = false;
const expected = expect.objectContaining({
value,
distance: (pageX - left) / width * 100,
});
expect(calculateValueDistance(pageX, width, left, scale, step, min, max, normalized)).toEqual(expected);
});
it('should correctly round the value and the distance to the nearest step with normalized = true', () => {
// modify to test normalized calculation
const normalized = true;
const expected = expect.objectContaining({
value,
distance: (pageX + pxOffset - left) / width * 100, // it should compensate for the error introduced above
});
expect(calculateValueDistance(pageX, width, left, scale, step, min, max, normalized)).toEqual(expected);
});
});
});
|
/*
* ============LICENSE_START=======================================================
* org.onap.aai
* ================================================================================
* Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
* Copyright © 2017-2018 Amdocs
* ================================================================================
* 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.
* ============LICENSE_END=========================================================
*/
export const SELECTED_NODE_TITLE = 'Node Details';
export const NO_SELECTION = 'Search for a service to view its details';
export const SELECTED_NODE_TABLE_COLUMN_NAMES = ['Attribute', 'Value'];
|
var searchData=
[
['name_14',['name',['../classopenrdv_1_1AttestPlugin.html#a7e803ba057c51d4ef622556228fec481',1,'openrdv::AttestPlugin::name()'],['../classSamplePlugin.html#a832684226ee4bbb33db47553f8bbed05',1,'SamplePlugin::name()']]]
];
|
'use strict';
/**
* Depedencies
*/
const uuid = require('uuid');
/**
* Effects
*/
const {
call,
delay,
render,
callProc,
parallel,
put,
take,
takeStream,
putStream,
actionChannel,
takeChannel,
spawn,
select,
} = require('../lib/effects');
/**
* TODO: Add request-response semantics for commands,
* TODO: Use IOWithStates to calculate transitions instead of using local state for every process
*/
/**
* Import interpreter creator
*/
const createInterpreter = require('../lib/interpreter');
/**
* Import IO creator
*/
const { createIO, createIOWithStateTransitions } = require('../lib/io');
/**
* System command types - actions that trigger sagas
*/
const commandTypes = {
INCREMENT_COUNTER_COMMAND: 'INCREMENT_COUNTER_COMMAND',
DECREMENT_COUNTER_COMMAND: 'DECREMENT_COUNTER_COMMAND',
}
/**
* System event types - actions that trigger state changes
*/
const eventTypes = {
INCREMENT_COUNTER_EVENT: 'INCREMENT_COUNTER_EVENT',
DECREMENT_COUNTER_EVENT: 'DECREMENT_COUNTER_EVENT',
}
/**
* Command creators
*/
const commandCreators = {
incrementCounter: () => ({ id: uuid.v4(), type: commandTypes.INCREMENT_COUNTER_COMMAND }),
decrementCounter: () => ({ id: uuid.v4(), type: commandTypes.DECREMENT_COUNTER_COMMAND }),
}
/**
* Event creators
*/
const eventCreators = {
incrementCounter: () => ({ id: uuid.v4(), type: eventTypes.INCREMENT_COUNTER_EVENT }),
decrementCounter: () => ({ id: uuid.v4(), type: eventTypes.DECREMENT_COUNTER_EVENT }),
}
/**
* Commands callable as functions (that we pass to the UI)
* NOTE: Not in use yet (must have vdom renderer ready)
*/
const commands = {
incrementCounter: () => io.dispatch(commandCreators.incrementCounter()),
decrementCounter: () => io.dispatch(commandCreators.decrementCounter()),
}
/**
* Initial state representation
*/
const initialState = { counter: 0 };
/**
* Selectors
*/
const getCounter = (state) => state.counter;
/**
* State update logic (just a reducer)
*/
const updateState = (state = initialState, event = {}) => {
switch (event.type) {
case eventTypes.INCREMENT_COUNTER_EVENT:
return {
...state,
counter: state.counter + 1,
};
case eventTypes.DECREMENT_COUNTER_EVENT:
return {
...state,
counter: state.counter - 1,
};
default:
return state;
}
};
/**
* Create an IO interface to pass to
* the interpreter for handling take/put
*/
const io = createIOWithStateTransitions(updateState);
/**
* Create an interpreter based on the effects resolvers and IO chosen
*/
const interpreter = createInterpreter({
call,
delay,
render,
callProc,
parallel,
put,
take,
takeStream,
putStream,
actionChannel,
takeChannel,
spawn,
select,
}, io);
/**
* Event handlers
*
* NOTE: The event handlers generate and trigger
* effects based on the event and the current state
*/
const eventHandlers = {
*[eventTypes.INCREMENT_COUNTER_EVENT](event, currentState, previousState) {
/**
* Generate effects
* NOTE: Use selectors to query state / models
*/
const effects = getCounter(currentState) === 0 ? [
call(console.log, 'went positive!'),
spawn(subProcessType1, getCounter(state)),
] : [
call(console.log, 'incremented counter!'),
];
/**
* Perform effects (in series)
*/
for (let effect of effects) {
yield effect;
}
},
*[eventTypes.DECREMENT_COUNTER_EVENT](event, currentState, previousState) {
/**
* Generate effects
* NOTE: Use selectors to query state / models
*/
const effects = getCounter(currentState) === 0 ? [
call(console.log, 'went negative!'),
spawn(subProcessType2, getCounter(state)),
] : [
call(console.log, 'decremented counter!'),
];
/**
* Perform effects (in parallel)
*/
yield parallel(effects);
},
*default({ type }) {
/**
* Do nothing if the event has no handler
*/
},
};
/**
* Event handler resolver
*/
function getEventHandlerByType(type) {
return eventHandlers[type] || eventHandlers.default;
}
/**
* Command handlers
*
* NOTE: The command handlers return events generated from
* the command and the current state or aborts if it fails any invariants
*/
const commandHandlers = {
*[commandTypes.INCREMENT_COUNTER_COMMAND](command, state) {
/**
* NOTE: Check invariants and rules against state
* NOTE: Use selectors on the state / models
*/
if (getCounter(state) >= 7) {
return [new Error('Cannot increment to more than 7')];
}
/**
* Create resulting events
*/
const events = [eventCreators.incrementCounter()];
/**
* Return resulting event(s)
*/
return [null, events];
},
*[commandTypes.DECREMENT_COUNTER_COMMAND](command, state) {
/**
* NOTE: Check invariants and rules against state
* NOTE: Use selectors on the state / models
*/
if (getCounter(state) <= -7) {
return [new Error('Cannot decrement to more than -7')];
}
/**
* Create resulting events
*/
const events = [eventCreators.decrementCounter()];
/**
* Return resulting event(s)
*/
return [null, events];
},
*default({ type }) {
/**
* Abort / throw error if the command has no handler
*/
return [new Error(`Unrecognized command of type ${type} supplied - Did you forget to add it to the handler map?`)];
},
};
/**
* Command handler resolver
*/
function getCommandHandlerByType(type) {
return commandHandlers[type] || commandHandlers.default;
}
/**
* UI / View application (Hyperapp)
*/
const app = function (state, commands) {
return { state, commands };
}
/**
* Subprocess type 1
*/
function* subProcessType1(initialValue) {
/**
* Initialize the subprocess
*/
let increments = initialValue;
/**
* Do some fancy logic (short or long running)
*/
while (increments < 5) {
yield call(console.log, 'woopwoop');
yield take('INCREMENT_COUNTER_EVENT');
increments++;
}
yield call(console.log, 'subprocess type 1 done');
/**
* Trigger a command
*/
yield put(commandCreators.incrementCounter());
}
/**
* Subprocess type 2
*/
function* subProcessType2(initialValue) {
/**
* Initialize the subprocess
*/
let increments = initialValue;
/**
* Do some fancy logic (short or long running)
*/
while (increments < 5) {
yield call(console.log, 'woopywoopy');
yield delay(1000);
increments++;
}
yield call(console.log, 'subprocess type 2 done');
/**
* Trigger a command
*/
yield put(commandCreators.decrementCounter());
}
/**
* Input loop
*
* NOTE: This is where you listen to all types of events which
* can trigger effects in your system (listening to the outside world)
*/
function* inputLoop() {
/**
* Listen to external events and then trigger puts when something happens
*/
while (true) {
const data = yield takeStream(process.stdin);
const command = data.toString().trim();
switch (command) {
case 'help':
yield putStream(process.stdout, `> the available commands are \n- increment\n- decrement\n`);
break;
case 'increment':
yield put(commandCreators.incrementCounter());
break;
case 'decrement':
yield put(commandCreators.decrementCounter());
break;
default:
yield putStream(process.stdout, `invalid command input => ${command || 'blank'}\n`);
break;
}
}
}
/**
* Render loop
*/
function* renderLoop() {
/**
* Create a channel to queue up all incoming events
*/
const eventChannel = yield actionChannel('*_EVENT');
/**
* Listen for events and render the current state
*/
while (true) {
/**
* Get the current state
*/
const state = yield select();
/**
* Render the app
*/
yield render(app, state, commands);
/**
* Wait for the next event
*/
const event = yield takeChannel(eventChannel);
}
}
/**
* Event loop
*/
function* eventLoop() {
/**
* Create a channel for listening for events
*/
const eventChannel = yield actionChannel('*_EVENT');
/**
* Process events and trigger effects
*/
while (true) {
/**
* Take the next event from the channel / queue
*/
const [event, currentState, previousState] = yield takeChannel(eventChannel);
/**
* Get the appropriate event handler
*/
const handleEvent = getEventHandlerByType(event.type);
/**
* Handle the event and trigger the appropriate effects
*/
yield callProc(handleEvent, event, currentState, previousState);
}
}
/**
* Command loop
*/
function* commandLoop() {
/**
* Create a channel to queue up all incoming commands
*/
const commandChannel = yield actionChannel('*_COMMAND');
/**
* Listen for command and handle them sequentially
*/
while (true) {
/**
* Wait for the next command
*/
const [command, state] = yield takeChannel(commandChannel);
/**
* Get the appropriate command handler
*/
const handleCommand = getCommandHandlerByType(command.type);
/**
* Handle the command and capture the generated events
*/
const [error, events = []] = yield callProc(handleCommand, command, state);
/**
* If the command could not be processed
*/
if (error) {
yield call(console.log, `Command ${command.type} failed with reason: ${error.message}`);
continue;
}
/**
* Put the events into the system for other remote consumers
*/
for (let event of events) {
yield put(event);
}
}
}
/**
* Main process
*/
function* main() {
yield parallel([
callProc(inputLoop),
callProc(commandLoop),
callProc(eventLoop),
callProc(renderLoop),
]);
}
/**
* Run the main process
*/
interpreter(main);
/**
* Thoughts:
*
* You don't really need redux and middleware anymore
* when you can just set up sagas that can to all kinds of things to actions.
*
* As long as you have a way of put-ing actions
* into the system and take-ing actions from the
* system you can do anything you want.
*
* The system also does not really need a getState,
* as any part that want to maintain some kind of
* state can just listen for all actions and derive
* its own state kept locally.
*
* Replaced redux with a simple IO implementation
* that enables you to dispatch and subscribe to the system
*/
|
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0def14"],{8897:function(t,e,a){"use strict";a.r(e);var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"traffic-routes"},[a("FrameSkeleton",[a("DataOverview",{attrs:{"page-size":6,"has-error":t.hasError,"is-loading":t.isLoading,"is-empty":t.isEmpty,"empty-state":t.empty_state,"display-data-table":!0,"table-data":t.tableData,"table-data-is-empty":t.tableDataIsEmpty,"table-data-function-text":"View","table-data-row":"name"},on:{tableAction:t.tableAction,reloadData:t.bootstrap}}),a("Tabs",{attrs:{"has-error":t.hasError,"is-loading":t.isLoading,"is-empty":t.isEmpty,tabs:t.tabs,"tab-group-title":t.tabGroupTitle,"initial-tab-override":"overview"}},[a("template",{slot:"overview"},[a("LabelList",{attrs:{"has-error":t.entityHasError,"is-loading":t.entityIsLoading,"is-empty":t.entityIsEmpty,items:t.entity}})],1),a("template",{slot:"yaml"},[a("YamlView",{attrs:{title:t.entityOverviewTitle,"has-error":t.entityHasError,"is-loading":t.entityIsLoading,"is-empty":t.entityIsEmpty,content:t.rawEntity}})],1)],2)],1)],1)},n=[],s=a("75fc"),r=(a("7f7f"),a("d7c2")),o=a("8218"),l=a("1d10"),y=a("2778"),c=a("251b"),u=a("ff9d"),m=a("0ada"),f={name:"TrafficRoutes",metaInfo:{title:"Traffic Routes"},components:{FrameSkeleton:l["a"],DataOverview:y["a"],Tabs:c["a"],YamlView:u["a"],LabelList:m["a"]},mixins:[o["a"]],data:function(){return{isLoading:!0,isEmpty:!1,hasError:!1,entityIsLoading:!0,entityIsEmpty:!1,entityHasError:!1,tableDataIsEmpty:!1,empty_state:{title:"No Data",message:"There are no Traffic Routes present."},tableData:{headers:[{key:"actions",hideLabel:!0},{label:"Name",key:"name"},{label:"Mesh",key:"mesh"},{label:"Type",key:"type"}],data:[]},tabs:[{hash:"#overview",title:"Overview"},{hash:"#yaml",title:"YAML"}],entity:null,rawEntity:null,firstEntity:null}},computed:{tabGroupTitle:function(){var t=this.entity;return t?"Traffic Route: ".concat(t.name):null},entityOverviewTitle:function(){var t=this.entity;return t?"Entity Overview for ".concat(t.name):null}},watch:{$route:function(t,e){this.bootstrap()}},beforeMount:function(){this.bootstrap()},methods:{tableAction:function(t){var e=t;this.$store.dispatch("updateSelectedTab",this.tabs[0].hash),this.$store.dispatch("updateSelectedTableRow",t.name),this.getEntity(e)},bootstrap:function(){var t=this;this.isLoading=!0,this.isEmpty=!1;var e=this.$route.params.mesh,a="all"===e?this.$api.getAllTrafficRoutes():this.$api.getAllTrafficRoutesFromMesh(e),i=function(){return a.then((function(e){if(e.items.length>0){var a=e.items;t.sortEntities(a),t.firstEntity=a[0].name,t.getEntity(a[0]),t.$store.dispatch("updateSelectedTableRow",t.firstEntity),t.tableData.data=Object(s["a"])(a),t.tableDataIsEmpty=!1}else t.tableData.data=[],t.tableDataIsEmpty=!0,t.getEntity(null)})).catch((function(e){t.hasError=!0,console.error(e)})).finally((function(){setTimeout((function(){t.isLoading=!1}),"500")}))};i()},getEntity:function(t){var e=this;this.entityIsLoading=!0,this.entityIsEmpty=!1;var a=this.$route.params.mesh;if(t&&null!==t){var i="all"===a?t.mesh:a;return this.$api.getTrafficRoute(i,t.name).then((function(t){if(t){var a=["type","name","mesh"];e.entity=Object(r["a"])(t,a),e.rawEntity=t}else e.entity=null,e.entityIsEmpty=!0})).catch((function(t){e.entityHasError=!0,console.error(t)})).finally((function(){setTimeout((function(){e.entityIsLoading=!1}),"500")}))}setTimeout((function(){e.entityIsEmpty=!0,e.entityIsLoading=!1}),"500")}}},h=f,p=a("2877"),d=Object(p["a"])(h,i,n,!1,null,null,null);e["default"]=d.exports}}]);
|
let slideIndex = 1;
showSlides(slideIndex);
function moveSlides(n) {
showSlides(slideIndex += n);
}
function currentSlide(n) {
showSlides(slideIndex = n);
}
function showSlides(n) {
const slides = document.getElementsByClassName("mySlides");
if (n > slides.length) {slideIndex = 1}
if (n < 1) {slideIndex = slides.length}
for (let i = 0; i < slides.length; i++) {
slides[i].style.display = "none";
}
slides[slideIndex-1].style.display = "block";
}
|
var connect = require('connect');
var serveStatic = require('serve-static');
connect()
.use(serveStatic(__dirname))
.listen(3000, () => console.log('Server running on 3000...'));
|
// Copyright 2004-present Facebook. All Rights Reserved.
import React from 'react';
export default class Button extends React.Component {
constructor(props) {
super(props);
this.state = {label: props.label};
// bind manually because React class components don't auto-bind
// http://facebook.github.io/react/blog/2015/01/27/react-v0.13.0-beta-1.html#autobinding
this.onClick = this.onClick.bind(this);
}
onClick() {
this.setState({label: 'clicked'});
}
render() {
return (
<button onClick={this.onClick}>{this.state.label}</button>
);
}
}
// component_8
|
// ==========================================================================
// Project: Ember - JavaScript Application Framework
// Copyright: ©2011-2012 Tilde Inc. and contributors
// Portions ©2006-2011 Strobe Inc.
// Portions ©2008-2011 Apple Inc. All rights reserved.
// License: Licensed under MIT license
// See https://raw.github.com/emberjs/ember.js/master/LICENSE
// ==========================================================================
// Version: v1.0.pre-274-gf78a7b6
// Last commit: f78a7b6 (2012-10-23 20:04:12 -0700)
(function(){"undefined"==typeof Ember&&(Ember={});var a=Ember.imports=Ember.imports||this,b=Ember.exports=Ember.exports||this,c=Ember.lookup=Ember.lookup||this;b.Em=b.Ember=Em=Ember,Ember.isNamespace=!0,Ember.toString=function(){return"Ember"},Ember.VERSION="1.0.0-pre.2",Ember.ENV=Ember.ENV||("undefined"==typeof ENV?{}:ENV),Ember.config=Ember.config||{},Ember.EXTEND_PROTOTYPES=Ember.ENV.EXTEND_PROTOTYPES,typeof Ember.EXTEND_PROTOTYPES=="undefined"&&(Ember.EXTEND_PROTOTYPES=!0),Ember.LOG_STACKTRACE_ON_DEPRECATION=Ember.ENV.LOG_STACKTRACE_ON_DEPRECATION!==!1,Ember.SHIM_ES5=Ember.ENV.SHIM_ES5===!1?!1:Ember.EXTEND_PROTOTYPES,Ember.K=function(){return this},"undefined"==typeof Ember.assert&&(Ember.assert=Ember.K),"undefined"==typeof Ember.warn&&(Ember.warn=Ember.K),"undefined"==typeof Ember.deprecate&&(Ember.deprecate=Ember.K),"undefined"==typeof Ember.deprecateFunc&&(Ember.deprecateFunc=function(a,b){return b}),"undefined"==typeof ember_assert&&(b.ember_assert=Ember.K),"undefined"==typeof ember_warn&&(b.ember_warn=Ember.K),"undefined"==typeof ember_deprecate&&(b.ember_deprecate=Ember.K),"undefined"==typeof ember_deprecateFunc&&(b.ember_deprecateFunc=function(a,b){return b}),Ember.uuid=0,Ember.Logger=a.console||{log:Ember.K,warn:Ember.K,error:Ember.K,info:Ember.K,debug:Ember.K},Ember.onerror=null,Ember.handleErrors=function(a,b){if("function"!=typeof Ember.onerror)return a.apply(b||this);try{return a.apply(b||this)}catch(c){Ember.onerror(c)}}})(),function(){Ember.Instrumentation={};var a=[],b={},c=function(c){var d=[],e;for(var f=0,g=a.length;f<g;f++)e=a[f],e.regex.test(c)&&d.push(e.object);return b[c]=d,d},d=function(){var a=window.performance||{},b=a.now||a.mozNow||a.webkitNow||a.msNow||a.oNow;return b?b.bind(a):function(){return+(new Date)}}();Ember.Instrumentation.instrument=function(a,e,f,g){var h=b[a];h||(h=c(a));if(h.length===0)return f.call(g);var i=[],j,k,l,m;try{for(l=0,m=h.length;l<m;l++)j=h[l],i[l]=j.before(a,d(),e);k=f.call(g)}catch(n){e=e||{},e.exception=n}finally{for(l=0,m=h.length;l<m;l++)j=h[l],j.after(a,d(),e,i[l])}return k},Ember.Instrumentation.subscribe=function(c,d){var e=c.split("."),f,g=[];for(var h=0,i=e.length;h<i;h++)f=e[h],f==="*"?g.push("[^\\.]*"):g.push(f);g=g.join("\\."),g+="(\\..*)?";var j={pattern:c,regex:new RegExp("^"+g+"$"),object:d};return a.push(j),b={},j},Ember.Instrumentation.unsubscribe=function(c){var d;for(var e=0,f=a.length;e<f;e++)a[e]===c&&(d=e);a.splice(d,1),b={}},Ember.Instrumentation.reset=function(){a=[],b={}},Ember.instrument=Ember.Instrumentation.instrument,Ember.subscribe=Ember.Instrumentation.subscribe}(),function(){var a=function(a){return a&&Function.prototype.toString.call(a).indexOf("[native code]")>-1},b=a(Array.prototype.map)?Array.prototype.map:function(a){if(this===void 0||this===null)throw new TypeError;var b=Object(this),c=b.length>>>0;if(typeof a!="function")throw new TypeError;var d=new Array(c),e=arguments[1];for(var f=0;f<c;f++)f in b&&(d[f]=a.call(e,b[f],f,b));return d},c=a(Array.prototype.forEach)?Array.prototype.forEach:function(a){if(this===void 0||this===null)throw new TypeError;var b=Object(this),c=b.length>>>0;if(typeof a!="function")throw new TypeError;var d=arguments[1];for(var e=0;e<c;e++)e in b&&a.call(d,b[e],e,b)},d=a(Array.prototype.indexOf)?Array.prototype.indexOf:function(a,b){b===null||b===undefined?b=0:b<0&&(b=Math.max(0,this.length+b));for(var c=b,d=this.length;c<d;c++)if(this[c]===a)return c;return-1};Ember.ArrayPolyfills={map:b,forEach:c,indexOf:d};var e=Ember.EnumerableUtils={map:function(a,c,d){return a.map?a.map.call(a,c,d):b.call(a,c,d)},forEach:function(a,b,d){return a.forEach?a.forEach.call(a,b,d):c.call(a,b,d)},indexOf:function(a,b,c){return a.indexOf?a.indexOf.call(a,b,c):d.call(a,b,c)},indexesOf:function(a,b){return b===undefined?[]:e.map(b,function(b){return e.indexOf(a,b)})},removeObject:function(a,b){var c=e.indexOf(a,b);c!==-1&&a.splice(c,1)},replace:function(a,b,c,d){if(a.replace)return a.replace(b,c,d);var e=Array.prototype.concat.apply([b,c],d);return a.splice.apply(a,e)}};Ember.SHIM_ES5&&(Array.prototype.map||(Array.prototype.map=b),Array.prototype.forEach||(Array.prototype.forEach=c),Array.prototype.indexOf||(Array.prototype.indexOf=d))}(),function(){var a=Ember.platform={};Ember.create=Object.create;if(!Ember.create){var b=function(){};Ember.create=function(a,c){b.prototype=a,a=new b;if(c){b.prototype=a;for(var d in c)b.prototype[d]=c[d].value;a=new b}return b.prototype=null,a},Ember.create.isSimulated=!0}var c=Object.defineProperty,d,e;if(c)try{c({},"a",{get:function(){}})}catch(f){c=null}c&&(d=function(){var a={};return c(a,"a",{configurable:!0,enumerable:!0,get:function(){},set:function(){}}),c(a,"a",{configurable:!0,enumerable:!0,writable:!0,value:!0}),a.a===!0}(),e=function(){try{return c(document.createElement("div"),"definePropertyOnDOM",{}),!0}catch(a){}return!1}(),d?e||(c=function(a,b,c){var d;return typeof Node=="object"?d=a instanceof Node:d=typeof a=="object"&&typeof a.nodeType=="number"&&typeof a.nodeName=="string",d?a[b]=c.value:Object.defineProperty(a,b,c)}):c=null),a.defineProperty=c,a.hasPropertyAccessors=!0,a.defineProperty||(a.hasPropertyAccessors=!1,a.defineProperty=function(a,b,c){c.get||(a[b]=c.value)},a.defineProperty.isSimulated=!0),Ember.ENV.MANDATORY_SETTER&&!a.hasPropertyAccessors&&(Ember.ENV.MANDATORY_SETTER=!1)}(),function(){function m(a){this.descs={},this.watching={},this.cache={},this.source=a}function n(a,b){return!!a&&typeof a[b]=="function"}var a=Ember.platform.defineProperty,b=Ember.create,c="__ember"+ +(new Date),d=0,e=[],f={},g=Ember.ENV.MANDATORY_SETTER;Ember.GUID_KEY=c;var h={writable:!1,configurable:!1,enumerable:!1,value:null};Ember.generateGuid=function(e,f){f||(f="ember");var g=f+d++;return e&&(h.value=g,a(e,c,h)),g},Ember.guidFor=function(g){if(g===undefined)return"(undefined)";if(g===null)return"(null)";var i,j,k=typeof g;switch(k){case"number":return j=e[g],j||(j=e[g]="nu"+g),j;case"string":return j=f[g],j||(j=f[g]="st"+d++),j;case"boolean":return g?"(true)":"(false)";default:if(g[c])return g[c];if(g===Object)return"(Object)";if(g===Array)return"(Array)";return j="ember"+d++,h.value=j,a(g,c,h),j}};var i={writable:!0,configurable:!1,enumerable:!1,value:null},j=Ember.GUID_KEY+"_meta";Ember.META_KEY=j;var k={descs:{},watching:{}};g&&(k.values={}),Ember.EMPTY_META=k,Object.freeze&&Object.freeze(k);var l=Ember.platform.defineProperty.isSimulated;l&&(m.prototype.__preventPlainObject__=!0),Ember.meta=function(d,e){var f=d[j];return e===!1?f||k:(f?f.source!==d&&(l||a(d,j,i),f=b(f),f.descs=b(f.descs),f.watching=b(f.watching),f.cache={},f.source=d,g&&(f.values=b(f.values)),d[j]=f):(l||a(d,j,i),f=new m(d),g&&(f.values={}),d[j]=f,f.descs.constructor=null),f)},Ember.getMeta=function(b,c){var d=Ember.meta(b,!1);return d[c]},Ember.setMeta=function(b,c,d){var e=Ember.meta(b,!0);return e[c]=d,d},Ember.metaPath=function(c,d,e){var f=Ember.meta(c,e),g,h;for(var i=0,j=d.length;i<j;i++){g=d[i],h=f[g];if(!h){if(!e)return undefined;h=f[g]={__ember_source__:c}}else if(h.__ember_source__!==c){if(!e)return undefined;h=f[g]=b(h),h.__ember_source__=c}f=h}return h},Ember.wrap=function(a,b){function c(){}var d=function(){var d,e=this._super;return this._super=b||c,d=a.apply(this,arguments),this._super=e,d};return d.base=a,d},Ember.isArray=function(a){return!a||a.setInterval?!1:Array.isArray&&Array.isArray(a)?!0:Ember.Array&&Ember.Array.detect(a)?!0:a.length!==undefined&&"object"==typeof a?!0:!1},Ember.makeArray=function(a){return a===null||a===undefined?[]:Ember.isArray(a)?a:[a]},Ember.canInvoke=n,Ember.tryInvoke=function(a,b,c){if(n(a,b))return a[b].apply(a,c||[])}}(),function(){var a=Ember.guidFor,b=Ember.ArrayPolyfills.indexOf,c=function(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b},d=function(a,b){var d=a.keys.copy(),e=c(a.values);return b.keys=d,b.values=e,b},e=Ember.OrderedSet=function(){this.clear()};e.create=function(){return new e},e.prototype={clear:function(){this.presenceSet={},this.list=[]},add:function(b){var c=a(b),d=this.presenceSet,e=this.list;if(c in d)return;d[c]=!0,e.push(b)},remove:function(c){var d=a(c),e=this.presenceSet,f=this.list;delete e[d];var g=b.call(f,c);g>-1&&f.splice(g,1)},isEmpty:function(){return this.list.length===0},has:function(b){var c=a(b),d=this.presenceSet;return c in d},forEach:function(a,b){var c=this.list.slice();for(var d=0,e=c.length;d<e;d++)a.call(b,c[d])},toArray:function(){return this.list.slice()},copy:function(){var a=new e;return a.presenceSet=c(this.presenceSet),a.list=this.list.slice(),a}};var f=Ember.Map=function(){this.keys=Ember.OrderedSet.create(),this.values={}};f.create=function(){return new f},f.prototype={get:function(b){var c=this.values,d=a(b);return c[d]},set:function(b,c){var d=this.keys,e=this.values,f=a(b);d.add(b),e[f]=c},remove:function(b){var c=this.keys,d=this.values,e=a(b),f;return d.hasOwnProperty(e)?(c.remove(b),f=d[e],delete d[e],!0):!1},has:function(b){var c=this.values,d=a(b);return c.hasOwnProperty(d)},forEach:function(b,c){var d=this.keys,e=this.values;d.forEach(function(d){var f=a(d);b.call(c,d,e[f])})},copy:function(){return d(this,new f)}};var g=Ember.MapWithDefault=function(a){f.call(this),this.defaultValue=a.defaultValue};g.create=function(a){return a?new g(a):new f},g.prototype=Ember.create(f.prototype),g.prototype.get=function(a){var b=this.has(a);if(b)return f.prototype.get.call(this,a);var c=this.defaultValue(a);return this.set(a,c),c},g.prototype.copy=function(){return d(this,new g({defaultValue:this.defaultValue}))}}(),function(){function i(a){return a.match(h)[0]}function j(a,c){var d=g.test(c),e=!d&&f.test(c),h;if(!a||e)a=Ember.lookup;d&&(c=c.slice(5)),a===Ember.lookup&&(h=i(c),a=b(a,h),c=c.slice(h.length+1));if(!c||c.length===0)throw new Error("Invalid Path");return[a,c]}function k(a,c){var d,e,f,h,i;if(a===null&&c.indexOf(".")===-1)return b(Ember.lookup,c);d=g.test(c);if(!a||d)f=j(a,c),a=f[0],c=f[1],f.length=0;e=c.split("."),i=e.length;for(h=0;a&&h<i;h++){a=b(a,e[h],!0);if(a&&a.isDestroyed)return undefined}return a}function l(a,b,d,e){var f;f=b.slice(b.lastIndexOf(".")+1),b=b.slice(0,b.length-(f.length+1)),b!=="this"&&(a=k(a,b));if(!f||f.length===0)throw new Error("You passed an empty path");if(!a){if(e)return;throw new Error("Object in path "+b+" could not be found or was destroyed.")}return c(a,f,d)}var a=Ember.META_KEY,b,c,d=Ember.ENV.MANDATORY_SETTER,e=/^([A-Z$]|([0-9][A-Z$]))/,f=/^([A-Z$]|([0-9][A-Z$])).*[\.\*]/,g=/^this[\.\*]/,h=/^([^\.\*]+)/;b=function(c,e){if(e==="")return c;!e&&"string"==typeof c&&(e=c,c=null);if(!c||e.indexOf(".")!==-1)return k(c,e);var f=c[a],g=f&&f.descs[e],h;return g?g.get(c,e):(d&&f&&f.watching[e]>0?h=f.values[e]:h=c[e],h!==undefined||"object"!=typeof c||e in c||"function"!=typeof c.unknownProperty?h:c.unknownProperty(e))},c=function(c,e,f,g){typeof c=="string"&&(f=e,e=c,c=null);if(!c||e.indexOf(".")!==-1)return l(c,e,f,g);var h=c[a],i=h&&h.descs[e],j,k;return i?i.set(c,e,f):(j="object"==typeof c&&!(e in c),j&&"function"==typeof c.setUnknownProperty?c.setUnknownProperty(e,f):h&&h.watching[e]>0?(d?k=h.values[e]:k=c[e],f!==k&&(Ember.propertyWillChange(c,e),d?k!==undefined||e in c?h.values[e]=f:Ember.defineProperty(c,e,null,f):c[e]=f,Ember.propertyDidChange(c,e))):c[e]=f),f},Ember.config.overrideAccessors&&(Ember.get=b,Ember.set=c,Ember.config.overrideAccessors(),b=Ember.get,c=Ember.set),Ember.normalizeTuple=function(a,b){return j(a,b)},Ember.getWithDefault=function(a,c,d){var e=b(a,c);return e===undefined?d:e},Ember.get=b,Ember.getPath=Ember.deprecateFunc("getPath is deprecated since get now supports paths",Ember.get),Ember.set=c,Ember.setPath=Ember.deprecateFunc("setPath is deprecated since set now supports paths",Ember.set),Ember.trySet=function(a,b,d){return c(a,b,d,!0)},Ember.trySetPath=Ember.deprecateFunc("trySetPath has been renamed to trySet",Ember.trySet),Ember.isGlobalPath=function(a){return e.test(a)}}(),function(){var a=Ember.GUID_KEY,b=Ember.META_KEY,c=Ember.EMPTY_META,d=Ember.meta,e=Ember.create,f=Ember.platform.defineProperty,g=Ember.ENV.MANDATORY_SETTER,h=Ember.Descriptor=function(){};Ember.defineProperty=function(a,c,e,h,i){var j,k,l,m;return i||(i=d(a)),j=i.descs,k=i.descs[c],l=i.watching[c]>0,k instanceof Ember.Descriptor&&k.teardown(a,c),e instanceof Ember.Descriptor?(m=e,j[c]=e,g&&l?f(a,c,{configurable:!0,enumerable:!0,writable:!0,value:undefined}):a[c]=undefined,e.setup(a,c)):(j[c]=undefined,e==null?(m=h,g&&l?(i.values[c]=h,f(a,c,{configurable:!0,enumerable:!0,set:function(){},get:function(){var a=this[b];return a&&a.values[c]}})):a[c]=h):(m=e,f(a,c,e))),l&&Ember.overrideChains(a,c,i),a.didDefineProperty&&a.didDefineProperty(a,c,m),this}}(),function(){function e(){this.clear()}function h(b){return b+a}function i(a){return a+b}var a=":change",b=":before",c=Ember.guidFor,d=0;e.prototype.add=function(a,b,c){var d=this.observerSet,e=this.observers,f=Ember.guidFor(a),g=d[f],h;return g||(d[f]=g={}),h=g[b],h===undefined&&(h=e.push({sender:a,keyName:b,eventName:c,listeners:{}})-1,g[b]=h),e[h].listeners},e.prototype.flush=function(){var a=this.observers,b,c,d,e;this.clear();for(b=0,c=a.length;b<c;++b){d=a[b],e=d.sender;if(e.isDestroyed)continue;Ember.sendEvent(e,d.eventName,[e,d.keyName],d.listeners)}},e.prototype.clear=function(){this.observerSet={},this.observers=[]};var f=new e,g=new e;Ember.beginPropertyChanges=function(){d++},Ember.endPropertyChanges=function(){d--,d<=0&&(f.clear(),g.flush())},Ember.changeProperties=function(a,b){Ember.beginPropertyChanges();try{a.call(b)}finally{Ember.endPropertyChanges()}},Ember.setProperties=function(a,b){return Ember.changeProperties(function(){for(var c in b)b.hasOwnProperty(c)&&Ember.set(a,c,b[c])}),a},Ember.addObserver=function(a,b,c,d){return Ember.addListener(a,h(b),c,d),Ember.watch(a,b),this},Ember.observersFor=function(a,b){return Ember.listenersFor(a,h(b))},Ember.removeObserver=function(a,b,c,d){return Ember.unwatch(a,b),Ember.removeListener(a,h(b),c,d),this},Ember.addBeforeObserver=function(a,b,c,d){return Ember.addListener(a,i(b),c,d),Ember.watch(a,b),this},Ember._suspendBeforeObserver=function(a,b,c,d,e){return Ember._suspendListener(a,i(b),c,d,e)},Ember._suspendObserver=function(a,b,c,d,e){return Ember._suspendListener(a,h(b),c,d,e)};var j=Ember.ArrayPolyfills.map;Ember._suspendBeforeObservers=function(a,b,c,d,e){var f=j.call(b,i);return Ember._suspendListeners(a,f,c,d,e)},Ember._suspendObservers=function(a,b,c,d,e){var f=j.call(b,h);return Ember._suspendListeners(a,f,c,d,e)},Ember.beforeObserversFor=function(a,b){return Ember.listenersFor(a,i(b))},Ember.removeBeforeObserver=function(a,b,c,d){return Ember.unwatch(a,b),Ember.removeListener(a,i(b),c,d),this},Ember.notifyBeforeObservers=function(a,b){if(a.isDestroying)return;var c=i(b),e,g;d?(e=f.add(a,b,c),g=Ember.listenersDiff(a,c,e),Ember.sendEvent(a,c,[a,b],g)):Ember.sendEvent(a,c,[a,b])},Ember.notifyObservers=function(a,b){if(a.isDestroying)return;var c=h(b),e;d?(e=g.add(a,b,c),Ember.listenersUnion(a,c,e)):Ember.sendEvent(a,c,[a,b])}}(),function(){function n(a){return a.match(j)[0]}function o(a){return a==="*"||!k.test(a)}function q(b,c,d,e,f){var g=a(c);e[g]||(e[g]={});if(e[g][d])return;e[g][d]=!0;var h=f.deps;h=h&&h[d];if(h)for(var i in h){if(p[i])continue;var j=f.descs[i];if(j&&j._suspended===c)continue;b(c,i)}}function t(a,b,c){if(a.isDestroying)return;var d=r,e=!d;e&&(d=r={}),q(G,a,b,d,c),e&&(r=null)}function u(a,b,c){if(a.isDestroying)return;var d=s,e=!d;e&&(d=s={}),q(H,a,b,d,c),e&&(s=null)}function v(c,d,e){if(!c||"object"!=typeof c)return;var f=b(c),g=f.chainWatchers;if(!g||g.__emberproto__!==c)g=f.chainWatchers={__emberproto__:c};g[d]||(g[d]={}),g[d][a(e)]=e,Ember.watch(c,d)}function w(c,d,e){if(!c||"object"!=typeof c)return;var f=b(c,!1),g=f.chainWatchers;if(!g||g.__emberproto__!==c)return;g[d]&&delete g[d][a(e)],Ember.unwatch(c,d)}function y(){if(x.length===0)return;var a=x;x=[],i.call(a,function(a){a[0].add(a[1])})}function z(a){return b(a,!1).proto===a}function C(a){var c=b(a),d=c.chains;return d?d.value()!==a&&(d=c.chains=d.copy(a)):d=c.chains=new A(null,null,a),d}function D(a,b,c,d,e){var f=b.chainWatchers;if(!f||f.__emberproto__!==a)return;f=f[c];if(!f)return;for(var g in f){if(!f.hasOwnProperty(g))continue;f[g][d](e)}}function E(a,b,c){D(a,c,b,"willChange")}function F(a,b,c){D(a,c,b,"didChange")}function G(a,c,d){var e=b(a,!1),f=e.watching[c]>0||c==="length",g=e.proto,h=e.descs[c];if(!f)return;if(g===a)return;h&&h.willChange&&h.willChange(a,c),t(a,c,e),E(a,c,e),Ember.notifyBeforeObservers(a,c)}function H(a,c){var d=b(a,!1),e=d.watching[c]>0||c==="length",f=d.proto,g=d.descs[c];if(f===a)return;g&&g.didChange&&g.didChange(a,c);if(!e&&c!=="length")return;u(a,c,d),F(a,c,d),Ember.notifyObservers(a,c)}var a=Ember.guidFor,b=Ember.meta,c=Ember.get,d=Ember.set,e=Ember.normalizeTuple,f=Ember.GUID_KEY,g=Ember.META_KEY,h=Ember.notifyObservers,i=Ember.ArrayPolyfills.forEach,j=/^([^\.\*]+)/,k=/[\.\*]/,l=Ember.ENV.MANDATORY_SETTER,m=Ember.platform.defineProperty,p={__emberproto__:!0},r,s,x=[],A=function(a,b,c,d){var e;this._parent=a,this._key=b,this._watching=c===undefined,this._value=c,this._separator=d||".",this._paths={},this._watching&&(this._object=a.value(),this._object&&v(this._object,this._key,this)),this._parent&&this._parent._key==="@each"&&this.value()},B=A.prototype;B.value=function(){if(this._value===undefined&&this._watching){var a=this._parent.value();this._value=a&&!z(a)?c(a,this._key):undefined}return this._value},B.destroy=function(){if(this._watching){var a=this._object;a&&w(a,this._key,this),this._watching=!1}},B.copy=function(a){var b=new A(null,null,a,this._separator),c=this._paths,d;for(d in c){if(c[d]<=0)continue;b.add(d)}return b},B.add=function(a){var b,c,d,f,g,h;h=this._paths,h[a]=(h[a]||0)+1,b=this.value(),c=e(b,a);if(c[0]&&c[0]===b)a=c[1],d=n(a),a=a.slice(d.length+1);else{if(!c[0]){x.push([this,a]),c.length=0;return}f=c[0],d=a.slice(0,0-(c[1].length+1)),g=a.slice(d.length,d.length+1),a=c[1]}c.length=0,this.chain(d,a,f,g)},B.remove=function(a){var b,c,d,f,g;g=this._paths,g[a]>0&&g[a]--,b=this.value(),c=e(b,a),c[0]===b?(a=c[1],d=n(a),a=a.slice(d.length+1)):(f=c[0],d=a.slice(0,0-(c[1].length+1)),a=c[1]),c.length=0,this.unchain(d,a)},B.count=0,B.chain=function(a,b,c,d){var e=this._chains,f;e||(e=this._chains={}),f=e[a],f||(f=e[a]=new A(this,a,c,d)),f.count++,b&&b.length>0&&(a=n(b),b=b.slice(a.length+1),f.chain(a,b))},B.unchain=function(a,b){var c=this._chains,d=c[a];b&&b.length>1&&(a=n(b),b=b.slice(a.length+1),d.unchain(a,b)),d.count--,d.count<=0&&(delete c[d._key],d.destroy())},B.willChange=function(){var a=this._chains;if(a)for(var b in a){if(!a.hasOwnProperty(b))continue;a[b].willChange()}this._parent&&this._parent.chainWillChange(this,this._key,1)},B.chainWillChange=function(a,b,c){this._key&&(b=this._key+this._separator+b),this._parent?this._parent.chainWillChange(this,b,c+1):(c>1&&Ember.propertyWillChange(this.value(),b),b="this."+b,this._paths[b]>0&&Ember.propertyWillChange(this.value(),b))},B.chainDidChange=function(a,b,c){this._key&&(b=this._key+this._separator+b),this._parent?this._parent.chainDidChange(this,b,c+1):(c>1&&Ember.propertyDidChange(this.value(),b),b="this."+b,this._paths[b]>0&&Ember.propertyDidChange(this.value(),b))},B.didChange=function(a){if(this._watching){var b=this._parent.value();b!==this._object&&(w(this._object,this._key,this),this._object=b,v(b,this._key,this)),this._value=undefined,this._parent&&this._parent._key==="@each"&&this.value()}var c=this._chains;if(c)for(var d in c){if(!c.hasOwnProperty(d))continue;c[d].didChange(a)}if(a)return;this._parent&&this._parent.chainDidChange(this,this._key,1)},Ember.overrideChains=function(a,b,c){D(a,c,b,"didChange",!0)},Ember.watch=function(a,c){if(c==="length"&&Ember.typeOf(a)==="array")return this;var d=b(a),e=d.watching,f;return e[c]?e[c]=(e[c]||0)+1:(e[c]=1,o(c)?(f=d.descs[c],f&&f.willWatch&&f.willWatch(a,c),"function"==typeof a.willWatchProperty&&a.willWatchProperty(c),l&&c in a&&(d.values[c]=a[c],m(a,c,{configurable:!0,enumerable:!0,set:function(){},get:function(){var a=this[g];return a&&a.values[c]}}))):C(a).add(c)),this},Ember.isWatching=function(b,c){var d=b[g];return(d&&d.watching[c])>0},Ember.watch.flushPending=y,Ember.unwatch=function(a,c){if(c==="length"&&Ember.typeOf(a)==="array")return this;var d=b(a),e=d.watching,f;return e[c]===1?(e[c]=0,o(c)?(f=d.descs[c],f&&f.didUnwatch&&f.didUnwatch(a,c),"function"==typeof a.didUnwatchProperty&&a.didUnwatchProperty(c),l&&c in a&&(m(a,c,{configurable:!0,enumerable:!0,writable:!0,value:d.values[c]}),delete d.values[c])):C(a).remove(c)):e[c]>1&&e[c]--,this},Ember.rewatch=function(a){var c=b(a,!1),d=c.chains;return f in a&&!a.hasOwnProperty(f)&&Ember.generateGuid(a,"ember"),d&&d.value()!==a&&(c.chains=d.copy(a)),this},Ember.finishChains=function(a){var c=b(a,!1),d=c.chains;d&&(d.value()!==a&&(c.chains=d=d.copy(a)),d.didChange(!0))},Ember.propertyWillChange=G,Ember.propertyDidChange=H;var I=[];Ember.destroy=function(a){var b=a[g],c,d,e,f;if(b){a[g]=null,c=b.chains;if(c){I.push(c);while(I.length>0){c=I.pop(),d=c._chains;if(d)for(e in d)d.hasOwnProperty(e)&&I.push(d[e]);c._watching&&(f=c._object,f&&w(f,c._key,c))}}}}}(),function(){function i(a,b,c){var d=b[c];return d?d.__emberproto__!==a&&(d=b[c]=e(d),d.__emberproto__=a):d=b[c]={__emberproto__:a},d}function j(a,b){var c=b.deps;return c?c.__emberproto__!==a&&(c=b.deps=e(c),c.__emberproto__=a):c=b.deps={__emberproto__:a},c}function k(a,b,c,d){var e=a._dependentKeys,f,h,k,l,m;if(!e)return;f=j(b,d);for(h=0,k=e.length;h<k;h++)l=e[h],m=i(b,f,l),m[c]=(m[c]||0)+1,g(b,l)}function l(a,b,c,d){var e=a._dependentKeys,f,g,k,l,m;if(!e)return;f=j(b,d);for(g=0,k=e.length;g<k;g++)l=e[g],m=i(b,f,l),m[c]=(m[c]||0)-1,h(b,l)}function m(a,b){this.func=a,this._cacheable=b&&b.cacheable!==undefined?b.cacheable:!0,this._dependentKeys=b&&b.dependentKeys}var a=Ember.get,b=Ember.meta,c=Ember.guidFor,d=[].slice,e=Ember.create,f=Ember.META_KEY,g=Ember.watch,h=Ember.unwatch;Ember.ComputedProperty=m,m.prototype=new Ember.Descriptor;var n=m.prototype;n.cacheable=function(a){return this._cacheable=a!==!1,this},n.volatile=function(){return this.cacheable(!1)},n.property=function(){var a=[];for(var b=0,c=arguments.length;b<c;b++)a.push(arguments[b]);return this._dependentKeys=a,this},n.meta=function(a){return arguments.length===0?this._meta||{}:(this._meta=a,this)},n.willWatch=function(a,b){var c=a[f];b in c.cache||k(this,a,b,c)},n.didUnwatch=function(a,b){var c=a[f];b in c.cache||l(this,a,b,c)},n.didChange=function(a,c){if(this._cacheable&&this._suspended!==a){var d=b(a);c in d.cache&&(delete d.cache[c],d.watching[c]||l(this,a,c,d))}},n.get=function(a,c){var d,e,f;if(this._cacheable){f=b(a),e=f.cache;if(c in e)return e[c];d=e[c]=this.func.call(a,c),f.watching[c]||k(this,a,c,f)}else d=this.func.call(a,c);return d},n.set=function(a,c,d){var e=this._cacheable,f=b(a,e),g=f.watching[c],h=this._suspended,i=!1,j;this._suspended=a;try{j=this.func.call(a,c,d);if(e&&c in f.cache){if(f.cache[c]===j)return;i=!0}g&&Ember.propertyWillChange(a,c),e&&i&&delete f.cache[c],e&&(!g&&!i&&k(this,a,c,f),f.cache[c]=j),g&&Ember.propertyDidChange(a,c)}finally{this._suspended=h}return j},n.setup=function(a,c){var d=a[f];d&&d.watching[c]&&k(this,a,c,b(a))},n.teardown=function(a,c){var d=b(a);return(d.watching[c]||c in d.cache)&&l(this,a,c,d),this._cacheable&&delete d.cache[c],null},Ember.computed=function(a){var b;arguments.length>1&&(b=d.call(arguments,0,-1),a=d.call(arguments,-1)[0]);var c=new m(a);return b&&c.property.apply(c,b),c},Ember.cacheFor=function(c,d){var e=b(c,!1).cache;if(e&&d in e)return e[d]},Ember.computed.not=function(b){return Ember.computed(b,function(c){return!a(this,b)})},Ember.computed.empty=function(b){return Ember.computed(b,function(c){var d=a(this,b);return d===undefined||d===null||d===""||Ember.isArray(d)&&a(d,"length")===0})},Ember.computed.bool=function(b){return Ember.computed(b,function(c){return!!a(this,b)})}}(),function(){function f(a,b,e,f){return c(a,["listeners",b,d(e)],f)}function g(a,c){var d=b(a,!1).listeners;return d?d[c]||!1:!1}function i(a,b){if(!a)return!1;for(var c in a){if(h[c])continue;var d=a[c];if(d)for(var e in d){if(h[e])continue;var f=d[e];if(f&&b(f)===!0)return!0}}return!1}function j(a,b,c){var d=a.method,e=a.target;e||(e=c),"string"==typeof d&&(d=e[d]),b?d.apply(e,b):d.apply(e)}function k(a,b,c){i(g(a,b),function(a){var b=d(a.target),e=d(a.method),f=c[b];f||(f=c[b]={}),f[e]=a})}function l(a,b,c){var e={};return i(g(a,b),function(a){var b=d(a.target),f=d(a.method),g=c[b],h=e[b];g||(g=c[b]={});if(g[f])return;g[f]=a,h||(h=e[b]={}),h[f]=a}),e}function m(a,b,c,e,g){!e&&"function"==typeof c&&(e=c,c=null);var h=f(a,b,c,!0),i=g||d(e);h[i]||(h[i]={target:c,method:e}),"function"==typeof a.didAddListener&&a.didAddListener(b,c,e)}function n(a,b,c,e){function h(c,e){var g=f(a,b,c,!0),h=d(e);g&&g[h]&&(g[h]=null),"function"==typeof a.didRemoveListener&&a.didRemoveListener(b,c,e)}!e&&"function"==typeof c&&(e=c,c=null),e?h(c,e):i(g(a,b),function(a){h(a.target,a.method)})}function o(a,b,c,e,g){!e&&"function"==typeof c&&(e=c,c=null);var h=f(a,b,c,!0),i=d(e),j=h&&h[i];h[i]=null;try{return g.call(c)}finally{h[i]=j}}function p(a,b,c,e,g){!e&&"function"==typeof c&&(e=c,c=null);var h=[],i=[],j,k,l,m,n,o;for(n=0,o=b.length;n<o;n++)j=b[n],k=f(a,j,c,!0),l=d(e),h.push(k&&k[l]),i.push(k),k[l]=null;try{return g.call(c)}finally{for(n=0,o=h.length;n<o;n++)j=b[n],i[n][l]=h[n]}}function q(a){var c=b(a,!1).listeners,d=[];if(c)for(var e in c)!h[e]&&c[e]&&d.push(e);return d}function r(a,b,c,d){return a!==Ember&&"function"==typeof a.sendEvent&&a.sendEvent(b,c),d||(d=g(a,b)),i(d,function(b){j(b,c,a)}),!0}function s(a,b){if(i(g(a,b),function(){return!0}))return!0;var d=c(a,["listeners"],!0);return d[b]=null,!1}function t(a,b){var c=[];return i(g(a,b),function(a){c.push([a.target,a.method])}),c}var a=Ember.create,b=Ember.meta,c=Ember.metaPath,d=Ember.guidFor,e=[].slice,h={__ember_source__:!0};Ember.addListener=m,Ember.removeListener=n,Ember._suspendListener=o,Ember._suspendListeners=p,Ember.sendEvent=r,Ember.hasListeners=s,Ember.watchedEvents=q,Ember.listenersFor=t,Ember.listenersDiff=l,Ember.listenersUnion=k}(),function(){function c(b,c,d,e){return c===undefined&&(c=b,b=undefined),"string"==typeof c&&(c=b[c]),d&&e>0&&(d=d.length>e?a.call(d,e):null),Ember.handleErrors(function(){return c.apply(b||this,d||[])},this)}function h(){g=null,f.currentRunLoop&&f.end()}function k(){j=null;var a=+(new Date),b=-1;for(var d in i){if(!i.hasOwnProperty(d))continue;var e=i[d];if(e&&e.expires)if(a>=e.expires)delete i[d],c(e.target,e.method,e.args,2);else if(b<0||e.expires<b)b=e.expires}b>0&&(j=setTimeout(k,b- +(new Date)))}function l(a,b){b[this.tguid]&&delete b[this.tguid][this.mguid],i[a]&&c(this.target,this.method,this.args),delete i[a]}function m(a,b,c,d){var e=Ember.guidFor(b),g=Ember.guidFor(c),h=f.autorun().onceTimers,j=h[e]&&h[e][g],k;return j&&i[j]?i[j].args=d:(k={target:b,method:c,args:d,tguid:e,mguid:g},j=Ember.guidFor(k),i[j]=k,h[e]||(h[e]={}),h[e][g]=j,f.schedule(a,k,l,j,h)),j}function o(){n=null;for(var a in i){if(!i.hasOwnProperty(a))continue;var b=i[a];b.next&&(delete i[a],c(b.target,b.method,b.args,2))}}var a=[].slice,b=Ember.ArrayPolyfills.forEach,d,e=function(a){this._prev=a||null,this.onceTimers={}};e.prototype={end:function(){this.flush()},prev:function(){return this._prev},schedule:function(b,c,d){var e=this._queues,f;e||(e=this._queues={}),f=e[b],f||(f=e[b]=[]);var g=arguments.length>3?a.call(arguments,3):null;return f.push({target:c,method:d,args:g}),this},flush:function(a){function j(a){c(a.target,a.method,a.args)}var e,f,g,h,i;if(!this._queues)return this;Ember.watch.flushPending();if(a)while(this._queues&&(h=this._queues[a])){this._queues[a]=null;if(a==="sync"){i=Ember.LOG_BINDINGS,i&&Ember.Logger.log("Begin: Flush Sync Queue"),Ember.beginPropertyChanges();try{b.call(h,j)}finally{Ember.endPropertyChanges()}i&&Ember.Logger.log("End: Flush Sync Queue")}else b.call(h,j)}else{e=Ember.run.queues,g=e.length,f=0;a:while(f<g){a=e[f],h=this._queues&&this._queues[a],delete this._queues[a];if(h)if(a==="sync"){i=Ember.LOG_BINDINGS,i&&Ember.Logger.log("Begin: Flush Sync Queue"),Ember.beginPropertyChanges();try{b.call(h,j)}finally{Ember.endPropertyChanges()}i&&Ember.Logger.log("End: Flush Sync Queue")}else b.call(h,j);for(var k=0;k<=f;k++)if(this._queues&&this._queues[e[k]]){f=k;continue a}f++}}return d=null,this}},Ember.RunLoop=e,Ember.run=function(a,b){var d,e;f.begin();try{if(a||b)d=c(a,b,arguments,2)}finally{f.end()}return d};var f=Ember.run;Ember.run.begin=function(){f.currentRunLoop=new e(f.currentRunLoop)},Ember.run.end=function(){try{f.currentRunLoop.end()}finally{f.currentRunLoop=f.currentRunLoop.prev()}},Ember.run.queues=["sync","actions","destroy","timers"],Ember.run.schedule=function(a,b,c){var d=f.autorun();d.schedule.apply(d,arguments)};var g;Ember.run.hasScheduledTimers=function(){return!!(g||j||n)},Ember.run.cancelTimers=function(){g&&(clearTimeout(g),g=null),j&&(clearTimeout(j),j=null),n&&(clearTimeout(n),n=null),i={}},Ember.run.autorun=function(){return f.currentRunLoop||(f.begin(),g||(g=setTimeout(h,1))),f.currentRunLoop},Ember.run.sync=function(){f.autorun(),f.currentRunLoop.flush("sync")};var i={},j;Ember.run.later=function(b,c){var d,e,g,h,j;return arguments.length===2&&"function"==typeof b?(j=c,c=b,b=undefined,d=[b,c]):(d=a.call(arguments),j=d.pop()),e=+(new Date)+j,g={target:b,method:c,expires:e,args:d},h=Ember.guidFor(g),i[h]=g,f.once(i,k),h},Ember.run.once=function(b,c){return m("actions",b,c,a.call(arguments,2))},Ember.run.scheduleOnce=function(b,c,d,e){return m(b,c,d,a.call(arguments,3))};var n;Ember.run.next=function(b,c){var d,e={target:b,method:c,args:a.call(arguments),next:!0};return d=Ember.guidFor(e),i[d]=e,n||(n=setTimeout(o,1)),d},Ember.run.cancel=function(a){delete i[a]}}(),function(){function e(b,c){return a(d(c)?Ember.lookup:b,c)}function g(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])}Ember.LOG_BINDINGS=!!Ember.ENV.LOG_BINDINGS;var a=Ember.get,b=Ember.set,c=Ember.guidFor,d=Ember.isGlobalPath,f=function(a,b){this._direction="fwd",this._from=b,this._to=a,this._directionMap=Ember.Map.create()};f.prototype={copy:function(){var a=new f(this._to,this._from);return this._oneWay&&(a._oneWay=!0),a},from:function(a){return this._from=a,this},to:function(a){return this._to=a,this},oneWay:function(){return this._oneWay=!0,this},toString:function(){var a=this._oneWay?"[oneWay]":"";return"Ember.Binding<"+c(this)+">("+this._from+" -> "+this._to+")"+a},connect:function(a){var b=this._from,c=this._to;return Ember.trySet(a,c,e(a,b)),Ember.addObserver(a,b,this,this.fromDidChange),this._oneWay||Ember.addObserver(a,c,this,this.toDidChange),this._readyToSync=!0,this},disconnect:function(a){var b=!this._oneWay;return Ember.removeObserver(a,this._from,this,this.fromDidChange),b&&Ember.removeObserver(a,this._to,this,this.toDidChange),this._readyToSync=!1,this},fromDidChange:function(a){this._scheduleSync(a,"fwd")},toDidChange:function(a){this._scheduleSync(a,"back")},_scheduleSync:function(a,b){var c=this._directionMap,d=c.get(a);d||(Ember.run.schedule("sync",this,this._sync,a),c.set(a,b)),d==="back"&&b==="fwd"&&c.set(a,"fwd")},_sync:function(b){var c=Ember.LOG_BINDINGS;if(b.isDestroyed||!this._readyToSync)return;var d=this._directionMap,f=d.get(b),g=this._from,h=this._to;d.remove(b);if(f==="fwd"){var i=e(b,this._from);c&&Ember.Logger.log(" ",this.toString(),"->",i,b),this._oneWay?Ember.trySet(b,h,i):Ember._suspendObserver(b,h,this,this.toDidChange,function(){Ember.trySet(b,h,i)})}else if(f==="back"){var j=a(b,this._to);c&&Ember.Logger.log(" ",this.toString(),"<-",j,b),Ember._suspendObserver(b,g,this,this.fromDidChange,function(){Ember.trySet(Ember.isGlobalPath(g)?Ember.lookup:b,g,j)})}}},g(f,{from:function(){var a=this,b=new a;return b.from.apply(b,arguments)},to:function(){var a=this,b=new a;return b.to.apply(b,arguments)},oneWay:function(a,b){var c=this,d=new c(null,a);return d.oneWay(b)}}),Ember.Binding=f,Ember.bind=function(a,b,c){return(new Ember.Binding(b,c)).connect(a)},Ember.oneWay=function(a,b,c){return(new Ember.Binding(b,c)).oneWay().connect(a)}}(),function(){function o(a){var b=Ember.meta(a,!0),c=b.mixins;return c?c.__emberproto__!==a&&(c=b.mixins=l(c),c.__emberproto__=a):c=b.mixins={__emberproto__:a},c}function p(b,c){return c&&c.length>0&&(b.mixins=f.call(c,function(b){if(b instanceof a)return b;var c=new a;return c.properties=b,c})),b}function q(a){return"function"==typeof a&&a.isMethod!==!1&&a!==Boolean&&a!==Object&&a!==Number&&a!==Array&&a!==Date&&a!==String}function r(c,d,e,f,i){function v(a){delete e[a],delete f[a]}var j=c.length,k,l,m,o,p,s,t,u;for(k=0;k<j;k++){l=c[k];if(l instanceof a){m=n(l);if(d[m])continue;d[m]=l,o=l.properties}else o=l;if(o){u=f.concatenatedProperties||
i.concatenatedProperties,o.concatenatedProperties&&(u=u?u.concat(o.concatenatedProperties):o.concatenatedProperties);for(s in o){if(!o.hasOwnProperty(s))continue;p=o[s];if(p instanceof Ember.Descriptor){if(p===b&&e[s])continue;e[s]=p,f[s]=undefined}else{if(q(p)){t=e[s]===undefined&&f[s],t||(t=i[s]),"function"!=typeof t&&(t=null);if(t){var w=p.__ember_observes__,x=p.__ember_observesBefore__;p=Ember.wrap(p,t),p.__ember_observes__=w,p.__ember_observesBefore__=x}}else if(u&&g.call(u,s)>=0||s==="concatenatedProperties"){var y=f[s]||i[s];y?"function"==typeof y.concat?p=y.concat(p):p=Ember.makeArray(y).concat(p):p=Ember.makeArray(p)}e[s]=undefined,f[s]=p}}o.hasOwnProperty("toString")&&(i.toString=o.toString)}else l.mixins&&(r(l.mixins,d,e,f,i),l._without&&h.call(l._without,v))}}function s(a){var b=Ember.meta(a),c=b.required;if(!c||c.__emberproto__!==a)c=b.required=c?l(c):{__ember_count__:0},c.__emberproto__=a;return c}function u(a,b,c,d){if(t.test(b)){var e=d.bindings;e?e.__emberproto__!==a&&(e=d.bindings=l(d.bindings),e.__emberproto__=a):e=d.bindings={__emberproto__:a},e[b]=c}}function v(a,b){var c=b.bindings,d,e,f;if(c){for(d in c)e=d!=="__emberproto__"&&c[d],e&&(f=d.slice(0,-7),e instanceof Ember.Binding?(e=e.copy(),e.to(f)):e=new Ember.Binding(f,e),e.connect(a),a[d]=e);b.bindings={__emberproto__:a}}}function w(a,b){return v(a,b||Ember.meta(a)),a}function x(a,d,e){var f={},g={},h=Ember.meta(a),i=h.required,j,l,n,p,q,t,v;r(d,o(a),f,g,a);for(j in g){if(j==="contructor")continue;if(!g.hasOwnProperty(j))continue;n=f[j],l=g[j];if(n===b)j in a||(i=s(a),i.__ember_count__++,i[j]=!0);else{while(n&&n instanceof c){var x=n.methodName;f[x]||g[x]?(l=g[x],n=f[x]):h.descs[x]?(n=h.descs[x],l=undefined):(n=undefined,l=a[x])}if(n===undefined&&l===undefined)continue;p=a[j];if("function"==typeof p)if(q=p.__ember_observesBefore__){t=q.length;for(v=0;v<t;v++)Ember.removeBeforeObserver(a,q[v],null,j)}else if(q=p.__ember_observes__){t=q.length;for(v=0;v<t;v++)Ember.removeObserver(a,q[v],null,j)}u(a,j,l,h),m(a,j,n,l,h);if("function"==typeof l)if(q=l.__ember_observesBefore__){t=q.length;for(v=0;v<t;v++)Ember.addBeforeObserver(a,q[v],null,j)}else if(q=l.__ember_observes__){t=q.length;for(v=0;v<t;v++)Ember.addObserver(a,q[v],null,j)}i&&i[j]&&(i=s(a),i.__ember_count__--,i[j]=!1)}}e||w(a,h);if(!e&&i&&i.__ember_count__>0){var y=[];for(j in i){if(k[j])continue;y.push(j)}}return a}function z(a,b,c){var d=n(a);if(c[d])return!1;c[d]=!0;if(a===b)return!0;var e=a.mixins,f=e?e.length:0;while(--f>=0)if(z(e[f],b,c))return!0;return!1}function A(a,b,c){if(c[n(b)])return;c[n(b)]=!0;if(b.properties){var d=b.properties;for(var e in d)d.hasOwnProperty(e)&&(a[e]=!0)}else b.mixins&&h.call(b.mixins,function(b){A(a,b,c)})}function D(a,b,c){var e=a.length;for(var f in b){if(!b.hasOwnProperty||!b.hasOwnProperty(f))continue;var g=b[f];a[e]=f;if(g&&g.toString===d)g[B]=a.join(".");else if(g&&C(g,"isNamespace")){if(c[n(g)])continue;c[n(g)]=!0,D(a,g,c)}}a.length=e}function E(){var a=Ember.Namespace,b=Ember.lookup,c,d;if(a.PROCESSED)return;for(var e in b){if(e==="globalStorage"&&b.StorageList&&b.globalStorage instanceof b.StorageList)continue;if(b.hasOwnProperty&&!b.hasOwnProperty(e))continue;try{c=Ember.lookup[e],d=c&&C(c,"isNamespace")}catch(f){continue}d&&(c[B]=e)}}var a,b,c,d,e,f=Ember.ArrayPolyfills.map,g=Ember.ArrayPolyfills.indexOf,h=Ember.ArrayPolyfills.forEach,i=[].slice,j={},k={__emberproto__:!0,__ember_count__:!0},l=Ember.create,m=Ember.defineProperty,n=Ember.guidFor,t=Ember.IS_BINDING=/^.+Binding$/;Ember.mixin=function(a){var b=i.call(arguments,1);return x(a,b,!1),a},Ember.Mixin=function(){return p(this,arguments)},a=Ember.Mixin,a._apply=x,a.applyPartial=function(a){var b=i.call(arguments,1);return x(a,b,!0)},a.finishPartial=w,a.create=function(){d.processed=!1;var a=this;return p(new a,arguments)};var y=a.prototype;y.reopen=function(){var b,c;this.properties?(b=a.create(),b.properties=this.properties,delete this.properties,this.mixins=[b]):this.mixins||(this.mixins=[]);var d=arguments.length,e=this.mixins,f;for(f=0;f<d;f++)b=arguments[f],b instanceof a?e.push(b):(c=a.create(),c.properties=b,e.push(c));return this},y.apply=function(a){return x(a,[this],!1)},y.applyPartial=function(a){return x(a,[this],!0)},y.detect=function(b){if(!b)return!1;if(b instanceof a)return z(b,this,{});var c=Ember.meta(b,!1).mixins;return c?!!c[n(this)]:!1},y.without=function(){var b=new a(this);return b._without=i.call(arguments),b},y.keys=function(){var a={},b={},c=[];A(a,this,b);for(var d in a)a.hasOwnProperty(d)&&c.push(d);return c};var B=Ember.GUID_KEY+"_name",C=Ember.get;Ember.identifyNamespaces=E,e=function(a){var b=a.superclass;if(b)return b[B]?b[B]:e(b);return},d=function(){var a=Ember.Namespace,b;if(a&&!this[B]&&!d.processed){a.PROCESSED||(E(),a.PROCESSED=!0),d.processed=!0;var c=a.NAMESPACES;for(var f=0,g=c.length;f<g;f++)b=c[f],D([b.toString()],b,{})}if(this[B])return this[B];var h=e(this);return h?"(subclass of "+h+")":"(unknown mixin)"},y.toString=d,a.mixins=function(a){var b=[],c=Ember.meta(a,!1).mixins,d,e;if(c)for(d in c){if(k[d])continue;e=c[d],e.properties||b.push(c[d])}return b},b=new Ember.Descriptor,b.toString=function(){return"(Required Property)"},Ember.required=function(){return b},c=function(a){this.methodName=a},c.prototype=new Ember.Descriptor,Ember.alias=function(a){return new c(a)},Ember.observer=function(a){var b=i.call(arguments,1);return a.__ember_observes__=b,a},Ember.immediateObserver=function(){for(var a=0,b=arguments.length;a<b;a++)var c=arguments[a];return Ember.observer.apply(this,arguments)},Ember.beforeObserver=function(a){var b=i.call(arguments,1);return a.__ember_observesBefore__=b,a}}(),function(){}(),function(){(function(a){"use strict";var b=typeof window!="undefined"?window:{},c=b.MutationObserver||b.WebKitMutationObserver,d;if(typeof process!="undefined")d=function(a,b){process.nextTick(function(){a.call(b)})};else if(c){var e=[],f=new c(function(){var a=e.slice();e=[],a.forEach(function(a){var b=a[0],c=a[1];b.call(c)})}),g=document.createElement("div");f.observe(g,{attributes:!0}),d=function(a,b){e.push([a,b]),g.setAttribute("drainQueue","drainQueue")}}else d=function(a,b){setTimeout(function(){a.call(b)},1)};a.async=d;var h=a.Event=function(a,b){this.type=a;for(var c in b){if(!b.hasOwnProperty(c))continue;this[c]=b[c]}},i=function(a,b){for(var c=0,d=a.length;c<d;c++)if(a[c][0]===b)return c;return-1},j=function(a){var b=a._promiseCallbacks;return b||(b=a._promiseCallbacks={}),b},k=a.EventTarget={mixin:function(a){return a.on=this.on,a.off=this.off,a.trigger=this.trigger,a},on:function(a,b,c){var d=j(this),e;c=c||this,e=d[a],e||(e=d[a]=[]),i(e,b)===-1&&e.push([b,c])},off:function(a,b){var c=j(this),d;if(!b){c[a]=[];return}d=c[a];var e=i(d,b);e!==-1&&d.splice(e,1)},trigger:function(a,b){var c=j(this),d,e,f,g,i;if(d=c[a])for(var k=0,l=d.length;k<l;k++)e=d[k],f=e[0],g=e[1],typeof b!="object"&&(b={detail:b}),i=new h(a,b),f.call(g,i)}},l=a.Promise=function(){this.on("promise:resolved",function(a){this.trigger("success",{detail:a.detail})},this),this.on("promise:failed",function(a){this.trigger("error",{detail:a.detail})},this)},m=function(){},n=function(a,b,c,d){var e,f;if(c)try{e=c(d.detail)}catch(g){f=g}else e=d.detail;e instanceof l?e.then(function(a){b.resolve(a)},function(a){b.reject(a)}):c&&e?b.resolve(e):f?b.reject(f):b[a](e)};l.prototype={then:function(a,b){var c=new l;return this.on("promise:resolved",function(b){n("resolve",c,a,b)}),this.on("promise:failed",function(a){n("reject",c,b,a)}),c},resolve:function(b){a.async(function(){this.trigger("promise:resolved",{detail:b}),this.isResolved=b},this),this.resolve=m,this.reject=m},reject:function(b){a.async(function(){this.trigger("promise:failed",{detail:b}),this.isRejected=b},this),this.resolve=m,this.reject=m}},k.mixin(l.prototype)})(window.RSVP={})}(),function(){function e(b,c,d,f){var g,h,i;if("object"!=typeof b||b===null)return b;if(c&&(h=a(d,b))>=0)return f[h];if(Ember.typeOf(b)==="array"){g=b.slice();if(c){h=g.length;while(--h>=0)g[h]=e(g[h],c,d,f)}}else if(Ember.Copyable&&Ember.Copyable.detect(b))g=b.copy(c,d,f);else{g={};for(i in b){if(!b.hasOwnProperty(i))continue;g[i]=c?e(b[i],c,d,f):b[i]}}return c&&(d.push(b),f.push(g)),g}var a=Ember.EnumerableUtils.indexOf,b={},c="Boolean Number String Function Array Date RegExp Object".split(" ");Ember.ArrayPolyfills.forEach.call(c,function(a){b["[object "+a+"]"]=a.toLowerCase()});var d=Object.prototype.toString;Ember.typeOf=function(a){var c;return c=a===null||a===undefined?String(a):b[d.call(a)]||"object",c==="function"?Ember.Object&&Ember.Object.detect(a)&&(c="class"):c==="object"&&(a instanceof Error?c="error":Ember.Object&&a instanceof Ember.Object?c="instance":c="object"),c},Ember.none=function(a){return a===null||a===undefined},Ember.empty=function(a){return a===null||a===undefined||a.length===0&&typeof a!="function"||typeof a=="object"&&Ember.get(a,"length")===0},Ember.compare=function g(a,b){if(a===b)return 0;var c=Ember.typeOf(a),d=Ember.typeOf(b),e=Ember.Comparable;if(e){if(c==="instance"&&e.detect(a.constructor))return a.constructor.compare(a,b);if(d==="instance"&&e.detect(b.constructor))return 1-b.constructor.compare(b,a)}var f=Ember.ORDER_DEFINITION_MAPPING;if(!f){var h=Ember.ORDER_DEFINITION;f=Ember.ORDER_DEFINITION_MAPPING={};var i,j;for(i=0,j=h.length;i<j;++i)f[h[i]]=i;delete Ember.ORDER_DEFINITION}var k=f[c],l=f[d];if(k<l)return-1;if(k>l)return 1;switch(c){case"boolean":case"number":if(a<b)return-1;if(a>b)return 1;return 0;case"string":var m=a.localeCompare(b);if(m<0)return-1;if(m>0)return 1;return 0;case"array":var n=a.length,o=b.length,p=Math.min(n,o),q=0,r=0;while(q===0&&r<p)q=g(a[r],b[r]),r++;if(q!==0)return q;if(n<o)return-1;if(n>o)return 1;return 0;case"instance":if(Ember.Comparable&&Ember.Comparable.detect(a))return a.compare(a,b);return 0;case"date":var s=a.getTime(),t=b.getTime();if(s<t)return-1;if(s>t)return 1;return 0;default:return 0}},Ember.copy=function(a,b){return"object"!=typeof a||a===null?a:Ember.Copyable&&Ember.Copyable.detect(a)?a.copy(b):e(a,b,b?[]:null,b?[]:null)},Ember.inspect=function(a){var b,c=[];for(var d in a)if(a.hasOwnProperty(d)){b=a[d];if(b==="toString")continue;Ember.typeOf(b)==="function"&&(b="function() { ... }"),c.push(d+": "+b)}return"{"+c.join(" , ")+"}"},Ember.isEqual=function(a,b){return a&&"function"==typeof a.isEqual?a.isEqual(b):a===b},Ember.ORDER_DEFINITION=Ember.ENV.ORDER_DEFINITION||["undefined","null","boolean","number","string","array","object","instance","function","class","date"],Ember.keys=Object.keys,Ember.keys||(Ember.keys=function(a){var b=[];for(var c in a)a.hasOwnProperty(c)&&b.push(c);return b});var f=["description","fileName","lineNumber","message","name","number","stack"];Ember.Error=function(){var a=Error.prototype.constructor.apply(this,arguments);for(var b=0;b<f.length;b++)this[f[b]]=a[f[b]]},Ember.Error.prototype=Ember.create(Error.prototype)}(),function(){var a=/[ _]/g,b={},c=/([a-z])([A-Z])/g,d=/(\-|_|\s)+(.)?/g,e=/([a-z\d])([A-Z]+)/g,f=/\-|\s+/g;Ember.STRINGS={},Ember.String={fmt:function(a,b){var c=0;return a.replace(/%@([0-9]+)?/g,function(a,d){return d=d?parseInt(d,0)-1:c++,a=b[d],(a===null?"(null)":a===undefined?"":a).toString()})},loc:function(a,b){return a=Ember.STRINGS[a]||a,Ember.String.fmt(a,b)},w:function(a){return a.split(/\s+/)},decamelize:function(a){return a.replace(c,"$1_$2").toLowerCase()},dasherize:function(c){var d=b,e=d[c];return e?e:(e=Ember.String.decamelize(c).replace(a,"-"),d[c]=e,e)},camelize:function(a){return a.replace(d,function(a,b,c){return c?c.toUpperCase():""})},classify:function(a){var b=Ember.String.camelize(a);return b.charAt(0).toUpperCase()+b.substr(1)},underscore:function(a){return a.replace(e,"$1_$2").replace(f,"_").toLowerCase()}}}(),function(){var a=Ember.String.fmt,b=Ember.String.w,c=Ember.String.loc,d=Ember.String.camelize,e=Ember.String.decamelize,f=Ember.String.dasherize,g=Ember.String.underscore,h=Ember.String.classify;if(Ember.EXTEND_PROTOTYPES===!0||Ember.EXTEND_PROTOTYPES.String)String.prototype.fmt=function(){return a(this,arguments)},String.prototype.w=function(){return b(this)},String.prototype.loc=function(){return c(this,arguments)},String.prototype.camelize=function(){return d(this)},String.prototype.decamelize=function(){return e(this)},String.prototype.dasherize=function(){return f(this)},String.prototype.underscore=function(){return g(this)},String.prototype.classify=function(){return h(this)}}(),function(){var a=Array.prototype.slice;if(Ember.EXTEND_PROTOTYPES===!0||Ember.EXTEND_PROTOTYPES.Function)Function.prototype.property=function(){var a=Ember.computed(this);return a.property.apply(a,arguments)},Function.prototype.observes=function(){return this.__ember_observes__=a.call(arguments),this},Function.prototype.observesBefore=function(){return this.__ember_observesBefore__=a.call(arguments),this}}(),function(){}(),function(){function f(){return e.length===0?{}:e.pop()}function g(a){return e.push(a),null}function h(b,c){function e(e){var f=a(e,b);return d?c===f:!!f}var d=arguments.length===2;return e}var a=Ember.get,b=Ember.set,c=Array.prototype.slice,d=Ember.EnumerableUtils.indexOf,e=[];Ember.Enumerable=Ember.Mixin.create({isEnumerable:!0,nextObject:Ember.required(Function),firstObject:Ember.computed(function(){if(a(this,"length")===0)return undefined;var b=f(),c;return c=this.nextObject(0,null,b),g(b),c}).property("[]"),lastObject:Ember.computed(function(){var b=a(this,"length");if(b===0)return undefined;var c=f(),d=0,e,h=null;do h=e,e=this.nextObject(d++,h,c);while(e!==undefined);return g(c),h}).property("[]"),contains:function(a){return this.find(function(b){return b===a})!==undefined},forEach:function(b,c){if(typeof b!="function")throw new TypeError;var d=a(this,"length"),e=null,h=f();c===undefined&&(c=null);for(var i=0;i<d;i++){var j=this.nextObject(i,e,h);b.call(c,j,i,this),e=j}return e=null,h=g(h),this},getEach:function(a){return this.mapProperty(a)},setEach:function(a,c){return this.forEach(function(d){b(d,a,c)})},map:function(a,b){var c=[];return this.forEach(function(d,e,f){c[e]=a.call(b,d,e,f)}),c},mapProperty:function(b){return this.map(function(c){return a(c,b)})},filter:function(a,b){var c=[];return this.forEach(function(d,e,f){a.call(b,d,e,f)&&c.push(d)}),c},filterProperty:function(a,b){return this.filter(h.apply(this,arguments))},find:function(b,c){var d=a(this,"length");c===undefined&&(c=null);var e=null,h,i=!1,j,k=f();for(var l=0;l<d&&!i;l++){h=this.nextObject(l,e,k);if(i=b.call(c,h,l,this))j=h;e=h}return h=e=null,k=g(k),j},findProperty:function(a,b){return this.find(h.apply(this,arguments))},every:function(a,b){return!this.find(function(c,d,e){return!a.call(b,c,d,e)})},everyProperty:function(a,b){return this.every(h.apply(this,arguments))},some:function(a,b){return!!this.find(function(c,d,e){return!!a.call(b,c,d,e)})},someProperty:function(a,b){return this.some(h.apply(this,arguments))},reduce:function(a,b,c){if(typeof a!="function")throw new TypeError;var d=b;return this.forEach(function(b,e){d=a.call(null,d,b,e,this,c)},this),d},invoke:function(a){var b,d=[];return arguments.length>1&&(b=c.call(arguments,1)),this.forEach(function(c,e){var f=c&&c[a];"function"==typeof f&&(d[e]=b?f.apply(c,b):f.call(c))},this),d},toArray:function(){var a=[];return this.forEach(function(b,c){a[c]=b}),a},compact:function(){return this.without(null)},without:function(a){if(!this.contains(a))return this;var b=[];return this.forEach(function(c){c!==a&&(b[b.length]=c)}),b},uniq:function(){var a=[];return this.forEach(function(b){d(a,b)<0&&a.push(b)}),a},"[]":Ember.computed(function(a,b){return this}).property(),addEnumerableObserver:function(b,c){var d=c&&c.willChange||"enumerableWillChange",e=c&&c.didChange||"enumerableDidChange",f=a(this,"hasEnumerableObservers");return f||Ember.propertyWillChange(this,"hasEnumerableObservers"),Ember.addListener(this,"@enumerable:before",b,d),Ember.addListener(this,"@enumerable:change",b,e),f||Ember.propertyDidChange(this,"hasEnumerableObservers"),this},removeEnumerableObserver:function(b,c){var d=c&&c.willChange||"enumerableWillChange",e=c&&c.didChange||"enumerableDidChange",f=a(this,"hasEnumerableObservers");return f&&Ember.propertyWillChange(this,"hasEnumerableObservers"),Ember.removeListener(this,"@enumerable:before",b,d),Ember.removeListener(this,"@enumerable:change",b,e),f&&Ember.propertyDidChange(this,"hasEnumerableObservers"),this},hasEnumerableObservers:Ember.computed(function(){return Ember.hasListeners(this,"@enumerable:change")||Ember.hasListeners(this,"@enumerable:before")}).property(),enumerableContentWillChange:function(b,c){var d,e,f;return"number"==typeof b?d=b:b?d=a(b,"length"):d=b=-1,"number"==typeof c?e=c:c?e=a(c,"length"):e=c=-1,f=e<0||d<0||e-d!==0,b===-1&&(b=null),c===-1&&(c=null),Ember.propertyWillChange(this,"[]"),f&&Ember.propertyWillChange(this,"length"),Ember.sendEvent(this,"@enumerable:before",[this,b,c]),this},enumerableContentDidChange:function(b,c){var d=this.propertyDidChange,e,f,g;return"number"==typeof b?e=b:b?e=a(b,"length"):e=b=-1,"number"==typeof c?f=c:c?f=a(c,"length"):f=c=-1,g=f<0||e<0||f-e!==0,b===-1&&(b=null),c===-1&&(c=null),Ember.sendEvent(this,"@enumerable:change",[this,b,c]),g&&Ember.propertyDidChange(this,"length"),Ember.propertyDidChange(this,"[]"),this}})}(),function(){function f(a){return a===null||a===undefined}var a=Ember.get,b=Ember.set,c=Ember.meta,d=Ember.EnumerableUtils.map,e=Ember.cacheFor;Ember.Array=Ember.Mixin.create(Ember.Enumerable,{isSCArray:!0,length:Ember.required(),objectAt:function(b){return b<0||b>=a(this,"length")?undefined:a(this,b)},objectsAt:function(a){var b=this;return d(a,function(a){return b.objectAt(a)})},nextObject:function(a){return this.objectAt(a)},"[]":Ember.computed(function(b,c){return c!==undefined&&this.replace(0,a(this,"length"),c),this}).property(),firstObject:Ember.computed(function(){return this.objectAt(0)}).property(),lastObject:Ember.computed(function(){return this.objectAt(a(this,"length")-1)}).property(),contains:function(a){return this.indexOf(a)>=0},slice:function(b,c){var d=[],e=a(this,"length");f(b)&&(b=0);if(f(c)||c>e)c=e;while(b<c)d[d.length]=this.objectAt(b++);return d},indexOf:function(b,c){var d,e=a(this,"length");c===undefined&&(c=0),c<0&&(c+=e);for(d=c;d<e;d++)if(this.objectAt(d,!0)===b)return d;return-1},lastIndexOf:function(b,c){var d,e=a(this,"length");if(c===undefined||c>=e)c=e-1;c<0&&(c+=e);for(d=c;d>=0;d--)if(this.objectAt(d)===b)return d;return-1},addArrayObserver:function(b,c){var d=c&&c.willChange||"arrayWillChange",e=c&&c.didChange||"arrayDidChange",f=a(this,"hasArrayObservers");return f||Ember.propertyWillChange(this,"hasArrayObservers"),Ember.addListener(this,"@array:before",b,d),Ember.addListener(this,"@array:change",b,e),f||Ember.propertyDidChange(this,"hasArrayObservers"),this},removeArrayObserver:function(b,c){var d=c&&c.willChange||"arrayWillChange",e=c&&c.didChange||"arrayDidChange",f=a(this,"hasArrayObservers");return f&&Ember.propertyWillChange(this,"hasArrayObservers"),Ember.removeListener(this,"@array:before",b,d),Ember.removeListener(this,"@array:change",b,e),f&&Ember.propertyDidChange(this,"hasArrayObservers"),this},hasArrayObservers:Ember.computed(function(){return Ember.hasListeners(this,"@array:change")||Ember.hasListeners(this,"@array:before")}).property(),arrayContentWillChange:function(b,c,d){b===undefined?(b=0,c=d=-1):(c===undefined&&(c=-1),d===undefined&&(d=-1)),Ember.isWatching(this,"@each")&&a(this,"@each"),Ember.sendEvent(this,"@array:before",[this,b,c,d]);var e,f;if(b>=0&&c>=0&&a(this,"hasEnumerableObservers")){e=[],f=b+c;for(var g=b;g<f;g++)e.push(this.objectAt(g))}else e=c;return this.enumerableContentWillChange(e,d),this},arrayContentDidChange:function(b,c,d){b===undefined?(b=0,c=d=-1):(c===undefined&&(c=-1),d===undefined&&(d=-1));var f,g;if(b>=0&&d>=0&&a(this,"hasEnumerableObservers")){f=[],g=b+d;for(var h=b;h<g;h++)f.push(this.objectAt(h))}else f=d;this.enumerableContentDidChange(c,f),Ember.sendEvent(this,"@array:change",[this,b,c,d]);var i=a(this,"length"),j=e(this,"firstObject"),k=e(this,"lastObject");return this.objectAt(0)!==j&&(Ember.propertyWillChange(this,"firstObject"),Ember.propertyDidChange(this,"firstObject")),this.objectAt(i-1)!==k&&(Ember.propertyWillChange(this,"lastObject"),Ember.propertyDidChange(this,"lastObject")),this},"@each":Ember.computed(function(){return this.__each||(this.__each=new Ember.EachProxy(this)),this.__each}).property()})}(),function(){Ember.Comparable=Ember.Mixin.create({isComparable:!0,compare:Ember.required(Function)})}(),function(){var a=Ember.get,b=Ember.set;Ember.Copyable=Ember.Mixin.create({copy:Ember.required(Function),frozenCopy:function(){if(Ember.Freezable&&Ember.Freezable.detect(this))return a(this,"isFrozen")?this:this.copy().freeze();throw new Error(Ember.String.fmt("%@ does not support freezing",[this]))}})}(),function(){var a=Ember.get,b=Ember.set;Ember.Freezable=Ember.Mixin.create({isFrozen:!1,freeze:function(){return a(this,"isFrozen")?this:(b(this,"isFrozen",!0),this)}}),Ember.FROZEN_ERROR="Frozen object cannot be modified."}(),function(){var a=Ember.EnumerableUtils.forEach;Ember.MutableEnumerable=Ember.Mixin.create(Ember.Enumerable,{addObject:Ember.required(Function),addObjects:function(b){return Ember.beginPropertyChanges(this),a(b,function(a){this.addObject(a)},this),Ember.endPropertyChanges(this),this},removeObject:Ember.required(Function),removeObjects:function(b){return Ember.beginPropertyChanges(this),a(b,function(a){this.removeObject(a)},this),Ember.endPropertyChanges(this),this}})}(),function(){var a="Index out of range",b=[],c=Ember.get,d=Ember.set,e=Ember.EnumerableUtils.forEach;Ember.MutableArray=Ember.Mixin.create(Ember.Array,Ember.MutableEnumerable,{replace:Ember.required(),clear:function(){var a=c(this,"length");return a===0?this:(this.replace(0,a,b),this)},insertAt:function(b,d){if(b>c(this,"length"))throw new Error(a);return this.replace(b,0,[d]),this},removeAt:function(d,e){if("number"==typeof d){if(d<0||d>=c(this,"length"))throw new Error(a);e===undefined&&(e=1),this.replace(d,e,b)}return this},pushObject:function(a){return this.insertAt(c(this,"length"),a),a},pushObjects:function(a){return this.replace(c(this,"length"),0,a),this},popObject:function(){var a=c(this,"length");if(a===0)return null;var b=this.objectAt(a-1);return this.removeAt(a-1,1),b},shiftObject:function(){if(c(this,"length")===0)return null;var a=this.objectAt(0);return this.removeAt(0),a},unshiftObject:function(a){return this.insertAt(0,a),a},unshiftObjects:function(a){return this.replace(0,0,a),this},reverseObjects:function(){var a=c(this,"length");if(a===0)return this;var b=this.toArray().reverse();return this.replace(0,a,b),this},setObjects:function(a){if(a.length===0)return this.clear();var b=c(this,"length");return this.replace(0,b,a),this},removeObject:function(a){var b=c(this,"length")||0;while(--b>=0){var d=this.objectAt(b);d===a&&this.removeAt(b)}return this},addObject:function(a){return this.contains(a)||this.pushObject(a),this}})}(),function(){var a=Ember.get,b=Ember.set,c=Ember.defineProperty;Ember.Observable=Ember.Mixin.create({isObserverable:!0,get:function(b){return a(this,b)},getProperties:function(){var b={},c=arguments;arguments.length===1&&Ember.typeOf(arguments[0])==="array"&&(c=arguments[0]);for(var d=0;d<c.length;d++)b[c[d]]=a(this,c[d]);return b},set:function(a,c){return b(this,a,c),this},setProperties:function(a){return Ember.setProperties(this,a)},beginPropertyChanges:function(){return Ember.beginPropertyChanges(),this},endPropertyChanges:function(){return Ember.endPropertyChanges(),this},propertyWillChange:function(a){return Ember.propertyWillChange(this,a),this},propertyDidChange:function(a){return Ember.propertyDidChange(this,a),this},notifyPropertyChange:function(a){return this.propertyWillChange(a),this.propertyDidChange(a),this},addBeforeObserver:function(a,b,c){Ember.addBeforeObserver(this,a,b,c)},addObserver:function(a,b,c){Ember.addObserver(this,a,b,c)},removeObserver:function(a,b,c){Ember.removeObserver(this,a,b,c)},hasObserverFor:function(a){return Ember.hasListeners(this,a+":change")},unknownProperty:function(a){return undefined},setUnknownProperty:function(a,d){c(this,a),b(this,a,d)},getPath:function(a){return this.get(a)},setPath:function(a,b){return this.set(a,b)},getWithDefault:function(a,b){return Ember.getWithDefault(this,a,b)},incrementProperty:function(c,d){return d||(d=1),b(this,c,(a(this,c)||0)+d),a(this,c)},decrementProperty:function(c,d){return d||(d=1),b(this,c,(a(this,c)||0)-d),a(this,c)},toggleProperty:function(c){return b(this,c,!a(this,c)),a(this,c)},cacheFor:function(a){return Ember.cacheFor(this,a)},observersForKey:function(a){return Ember.observersFor(this,a)}})}(),function(){var a=Ember.get,b=Ember.set;Ember.TargetActionSupport=Ember.Mixin.create({target:null,action:null,targetObject:Ember.computed(function(){var b=a(this,"target");if(Ember.typeOf(b)==="string"){var c=a(this,b);return c===undefined&&(c=a(Ember.lookup,b)),c}return b}).property("target"),triggerAction:function(){var b=a(this,"action"),c=a(this,"targetObject");if(c&&b){var d;return typeof c.send=="function"?d=c.send(b,this):(typeof b=="string"&&(b=c[b]),d=b.call(c,this)),d!==!1&&(d=!0),d}return!1}})}(),function(){Ember.Evented=Ember.Mixin.create({on:function(a,b,c){Ember.addListener(this,a,b,c)},one:function(a,b,c){c||(c=b,b=null);var d=this,e=function(){Ember.removeListener(d,a,b,c),"string"==typeof c&&(c=this[c]),c.apply(this,arguments)};Ember.addListener(this,a,b,e,Ember.guidFor(c))},trigger:function(a){var b=[],c,d;for(c=1,d=arguments.length;c<d;c++)b.push(arguments[c]);Ember.sendEvent(this,a,b)},fire:function(a){this.trigger.apply(this,arguments)},off:function(a,b,c){Ember.removeListener(this,a,b,c)},has:function(a){return Ember.hasListeners(this,a)}})}(),function(){var a=Ember.get,b=Array.prototype.slice;Ember.Deferred=Ember.Mixin.create({then:function(b,c){return a(this,"promise").then(b,c)},resolve:function(b){a(this,"promise").resolve(b)},reject:function(b){a(this,"promise").reject(b)},promise:Ember.computed(function(){return new RSVP.Promise})})}(),function(){}(),function(){function t(){var a=!1,b,c=function(){a||c.proto(),d(this,f,s),d(this,"_super",s);var e=i(this);e.proto=this,b&&(this.reopen.apply(this,b),b=null),p(this,e),delete e.proto,k(this),this.init.apply(this,arguments)};return c.toString=r,c.willReopen=function(){a&&(c.PrototypeMixin=n.create(c.PrototypeMixin)),a=!1},c._initMixins=function(a){b=a},c.proto=function(){var b=c.superclass;return b&&b.proto(),a||(a=!0,c.PrototypeMixin.applyPartial(c.prototype),j(c.prototype)),this.prototype},c}var a=Ember.set,b=Ember.get,c=Ember.create,d=Ember.platform.defineProperty,e=Array.prototype.slice,f=Ember.GUID_KEY,g=Ember.guidFor,h=Ember.generateGuid,i=Ember.meta,j=Ember.rewatch,k=Ember.finishChains,l=Ember.destroy,m=Ember.run.schedule,n=Ember.Mixin,o=n._apply,p=n.finishPartial,q=n.prototype.reopen,r=n.prototype.toString,s={configurable:!0,writable:!0,enumerable:!1,value:undefined},u=t();u.PrototypeMixin=n.create({reopen:function(){return o(this,arguments,!0),this},isInstance:!0,init:function(){},isDestroyed:!1,isDestroying:!1,destroy:function(){if(this.isDestroying)return;return this.isDestroying=!0,this.willDestroy&&this.willDestroy(),a(this,"isDestroyed",!0),m("destroy",this,this._scheduledDestroy),this},_scheduledDestroy:function(){l(this),this.didDestroy&&this.didDestroy()},bind:function(a,b){return b instanceof Ember.Binding||(b=Ember.Binding.from(b)),b.to(a).connect(this),b},toString:function(){return"<"+this.constructor.toString()+":"+g(this)+">"}}),Ember.config.overridePrototypeMixin&&Ember.config.overridePrototypeMixin(u.PrototypeMixin),u.__super__=null;var v=n.create({ClassMixin:Ember.required(),PrototypeMixin:Ember.required(),isClass:!0,isMethod:!1,extend:function(){var a=t(),b;return a.ClassMixin=n.create(this.ClassMixin),a.PrototypeMixin=n.create(this.PrototypeMixin),a.ClassMixin.ownerConstructor=a,a.PrototypeMixin.ownerConstructor=a,q.apply(a.PrototypeMixin,arguments),a.superclass=this,a.__super__=this.prototype,b=a.prototype=c(this.prototype),b.constructor=a,h(b,"ember"),i(b).proto=b,a.ClassMixin.apply(a),a},create:function(){var a=this;return arguments.length>0&&this._initMixins(arguments),new a},reopen:function(){return this.willReopen(),q.apply(this.PrototypeMixin,arguments),this},reopenClass:function(){return q.apply(this.ClassMixin,arguments),o(this,arguments,!1),this},detect:function(a){if("function"!=typeof a)return!1;while(a){if(a===this)return!0;a=a.superclass}return!1},detectInstance:function(a){return a instanceof this},metaForProperty:function(a){var b=i(this.proto(),!1).descs[a];return b._meta||{}},eachComputedProperty:function(a,b){var c=this.proto(),d=i(c).descs,e={},f;for(var g in d)f=d[g],f instanceof Ember.ComputedProperty&&a.call(b||this,g,f._meta||e)}});Ember.config.overrideClassMixin&&Ember.config.overrideClassMixin(v),u.ClassMixin=v,v.apply(u),Ember.CoreObject=u}(),function(){var a=Ember.get,b=Ember.set,c=Ember.guidFor,d=Ember.none;Ember.Set=Ember.CoreObject.extend(Ember.MutableEnumerable,Ember.Copyable,Ember.Freezable,{length:0,clear:function(){if(this.isFrozen)throw new Error(Ember.FROZEN_ERROR);var d=a(this,"length");if(d===0)return this;var e;this.enumerableContentWillChange(d,0),Ember.propertyWillChange(this,"firstObject"),Ember.propertyWillChange(this,"lastObject");for(var f=0;f<d;f++)e=c(this[f]),delete this[e],delete this[f];return b(this,"length",0),Ember.propertyDidChange(this,"firstObject"),Ember.propertyDidChange(this,"lastObject"),this.enumerableContentDidChange(d,0),this},isEqual:function(b){if(!Ember.Enumerable.detect(b))return!1;var c=a(this,"length");if(a(b,"length")!==c)return!1;while(--c>=0)if(!b.contains(this[c]))return!1;return!0},add:Ember.alias("addObject"),remove:Ember.alias("removeObject"),pop:function(){if(a(this,"isFrozen"))throw new Error(Ember.FROZEN_ERROR);var b=this.length>0?this[this.length-1]:null;return this.remove(b),b},push:Ember.alias("addObject"),shift:Ember.alias("pop"),unshift:Ember.alias("push"),addEach:Ember.alias("addObjects"),removeEach:Ember.alias("removeObjects"),init:function(a){this._super(),a&&this.addObjects(a)},nextObject:function(a){return this[a]},firstObject:Ember.computed(function(){return this.length>0?this[0]:undefined}).property(),lastObject:Ember.computed(function(){return this.length>0?this[this.length-1]:undefined}).property(),addObject:function(e){if(a(this,"isFrozen"))throw new Error(Ember.FROZEN_ERROR);if(d(e))return this;var f=c(e),g=this[f],h=a(this,"length"),i;return g>=0&&g<h&&this[g]===e?this:(i=[e],this.enumerableContentWillChange(null,i),Ember.propertyWillChange(this,"lastObject"),h=a(this,"length"),this[f]=h,this[h]=e,b(this,"length",h+1),Ember.propertyDidChange(this,"lastObject"),this.enumerableContentDidChange(null,i),this)},removeObject:function(e){if(a(this,"isFrozen"))throw new Error(Ember.FROZEN_ERROR);if(d(e))return this;var f=c(e),g=this[f],h=a(this,"length"),i=g===0,j=g===h-1,k,l;return g>=0&&g<h&&this[g]===e&&(l=[e],this.enumerableContentWillChange(l,null),i&&Ember.propertyWillChange(this,"firstObject"),j&&Ember.propertyWillChange(this,"lastObject"),g<h-1&&(k=this[h-1],this[g]=k,this[c(k)]=g),delete this[f],delete this[h-1],b(this,"length",h-1),i&&Ember.propertyDidChange(this,"firstObject"),j&&Ember.propertyDidChange(this,"lastObject"),this.enumerableContentDidChange(l,null)),this},contains:function(a){return this[c(a)]>=0},copy:function(){var d=this.constructor,e=new d,f=a(this,"length");b(e,"length",f);while(--f>=0)e[f]=this[f],e[c(this[f])]=f;return e},toString:function(){var a=this.length,b,c=[];for(b=0;b<a;b++)c[b]=this[b];return"Ember.Set<%@>".fmt(c.join(","))}})}(),function(){Ember.Object=Ember.CoreObject.extend(Ember.Observable)}(),function(){var a=Ember.ArrayPolyfills.indexOf;Ember.Namespace=Ember.Object.extend({isNamespace:!0,init:function(){Ember.Namespace.NAMESPACES.push(this),Ember.Namespace.PROCESSED=!1},toString:function(){return Ember.identifyNamespaces(),this[Ember.GUID_KEY+"_name"]},destroy:function(){var b=Ember.Namespace.NAMESPACES;Ember.lookup[this.toString()]=undefined,b.splice(a.call(b,this),1),this._super()}}),Ember.Namespace.NAMESPACES=[Ember],Ember.Namespace.PROCESSED=!1}(),function(){Ember.Application=Ember.Namespace.extend()}(),function(){var a=Ember.get,b=Ember.set;Ember.ArrayProxy=Ember.Object.extend(Ember.MutableArray,{content:null,arrangedContent:Ember.computed("content",function(){return a(this,"content")}),objectAtContent:function(b){return a(this,"arrangedContent").objectAt(b)},replaceContent:function(b,c,d){a(this,"arrangedContent").replace(b,c,d)},_contentWillChange:Ember.beforeObserver(function(){this._teardownContent()},"content"),_teardownContent:function(){var b=a(this
,"content");b&&b.removeArrayObserver(this,{willChange:"contentArrayWillChange",didChange:"contentArrayDidChange"})},contentArrayWillChange:Ember.K,contentArrayDidChange:Ember.K,_contentDidChange:Ember.observer(function(){var b=a(this,"content");this._setupContent()},"content"),_setupContent:function(){var b=a(this,"content");b&&b.addArrayObserver(this,{willChange:"contentArrayWillChange",didChange:"contentArrayDidChange"})},_arrangedContentWillChange:Ember.beforeObserver(function(){var b=a(this,"arrangedContent"),c=b?a(b,"length"):0;this.arrangedContentArrayWillChange(this,0,c,undefined),this.arrangedContentWillChange(this),this._teardownArrangedContent(b)},"arrangedContent"),_arrangedContentDidChange:Ember.observer(function(){var b=a(this,"arrangedContent"),c=b?a(b,"length"):0;this._setupArrangedContent(),this.arrangedContentDidChange(this),this.arrangedContentArrayDidChange(this,0,undefined,c)},"arrangedContent"),_setupArrangedContent:function(){var b=a(this,"arrangedContent");b&&b.addArrayObserver(this,{willChange:"arrangedContentArrayWillChange",didChange:"arrangedContentArrayDidChange"})},_teardownArrangedContent:function(){var b=a(this,"arrangedContent");b&&b.removeArrayObserver(this,{willChange:"arrangedContentArrayWillChange",didChange:"arrangedContentArrayDidChange"})},arrangedContentWillChange:Ember.K,arrangedContentDidChange:Ember.K,objectAt:function(b){return a(this,"content")&&this.objectAtContent(b)},length:Ember.computed(function(){var b=a(this,"arrangedContent");return b?a(b,"length"):0}).property(),replace:function(b,c,d){return a(this,"content")&&this.replaceContent(b,c,d),this},arrangedContentArrayWillChange:function(a,b,c,d){this.arrayContentWillChange(b,c,d)},arrangedContentArrayDidChange:function(a,b,c,d){this.arrayContentDidChange(b,c,d)},init:function(){this._super(),this._setupContent(),this._setupArrangedContent()},willDestroy:function(){this._teardownArrangedContent(),this._teardownContent()}})}(),function(){function j(a,b){var c=b.slice(8);if(c in this)return;h(this,c)}function k(a,b){var c=b.slice(8);if(c in this)return;i(this,c)}var a=Ember.get,b=Ember.set,c=Ember.String.fmt,d=Ember.addBeforeObserver,e=Ember.addObserver,f=Ember.removeBeforeObserver,g=Ember.removeObserver,h=Ember.propertyWillChange,i=Ember.propertyDidChange;Ember.ObjectProxy=Ember.Object.extend({content:null,_contentDidChange:Ember.observer(function(){},"content"),willWatchProperty:function(a){var b="content."+a;d(this,b,null,j),e(this,b,null,k)},didUnwatchProperty:function(a){var b="content."+a;f(this,b,null,j),g(this,b,null,k)},unknownProperty:function(b){var c=a(this,"content");if(c)return a(c,b)},setUnknownProperty:function(c,d){var e=a(this,"content");return b(e,c,d)}})}(),function(){function g(a,b,d,e,f){var g=d._objects,h;g||(g=d._objects={});while(--f>=e){var i=a.objectAt(f);i&&(Ember.addBeforeObserver(i,b,d,"contentKeyWillChange"),Ember.addObserver(i,b,d,"contentKeyDidChange"),h=c(i),g[h]||(g[h]=[]),g[h].push(f))}}function h(a,b,d,e,f){var g=d._objects;g||(g=d._objects={});var h,i;while(--f>=e){var j=a.objectAt(f);j&&(Ember.removeBeforeObserver(j,b,d,"contentKeyWillChange"),Ember.removeObserver(j,b,d,"contentKeyDidChange"),i=c(j),h=g[i],h[h.indexOf(f)]=null)}}var a=Ember.set,b=Ember.get,c=Ember.guidFor,d=Ember.EnumerableUtils.forEach,e=Ember.Object.extend(Ember.Array,{init:function(a,b,c){this._super(),this._keyName=b,this._owner=c,this._content=a},objectAt:function(a){var c=this._content.objectAt(a);return c&&b(c,this._keyName)},length:Ember.computed(function(){var a=this._content;return a?b(a,"length"):0}).property()}),f=/^.+:(before|change)$/;Ember.EachProxy=Ember.Object.extend({init:function(a){this._super(),this._content=a,a.addArrayObserver(this),d(Ember.watchedEvents(this),function(a){this.didAddListener(a)},this)},unknownProperty:function(a,b){var c;return c=new e(this._content,a,this),Ember.defineProperty(this,a,null,c),this.beginObservingContentKey(a),c},arrayWillChange:function(a,b,c,d){var e=this._keys,f,g,i;i=c>0?b+c:-1,Ember.beginPropertyChanges(this);for(f in e){if(!e.hasOwnProperty(f))continue;i>0&&h(a,f,this,b,i),Ember.propertyWillChange(this,f)}Ember.propertyWillChange(this._content,"@each"),Ember.endPropertyChanges(this)},arrayDidChange:function(a,b,c,d){var e=this._keys,f,h,i;i=d>0?b+d:-1,Ember.beginPropertyChanges(this);for(f in e){if(!e.hasOwnProperty(f))continue;i>0&&g(a,f,this,b,i),Ember.propertyDidChange(this,f)}Ember.propertyDidChange(this._content,"@each"),Ember.endPropertyChanges(this)},didAddListener:function(a){f.test(a)&&this.beginObservingContentKey(a.slice(0,-7))},didRemoveListener:function(a){f.test(a)&&this.stopObservingContentKey(a.slice(0,-7))},beginObservingContentKey:function(a){var c=this._keys;c||(c=this._keys={});if(!c[a]){c[a]=1;var d=this._content,e=b(d,"length");g(d,a,this,0,e)}else c[a]++},stopObservingContentKey:function(a){var c=this._keys;if(c&&c[a]>0&&--c[a]<=0){var d=this._content,e=b(d,"length");h(d,a,this,0,e)}},contentKeyWillChange:function(a,b){Ember.propertyWillChange(this,b)},contentKeyDidChange:function(a,b){Ember.propertyDidChange(this,b)}})}(),function(){var a=Ember.get,b=Ember.set,c=Ember.Mixin.create(Ember.MutableArray,Ember.Observable,Ember.Copyable,{get:function(a){return a==="length"?this.length:"number"==typeof a?this[a]:this._super(a)},objectAt:function(a){return this[a]},replace:function(b,c,d){if(this.isFrozen)throw Ember.FROZEN_ERROR;var e=d?a(d,"length"):0;this.arrayContentWillChange(b,c,e);if(!d||d.length===0)this.splice(b,c);else{var f=[b,c].concat(d);this.splice.apply(this,f)}return this.arrayContentDidChange(b,c,e),this},unknownProperty:function(a,b){var c;return b!==undefined&&c===undefined&&(c=this[a]=b),c},indexOf:function(a,b){var c,d=this.length;b===undefined?b=0:b=b<0?Math.ceil(b):Math.floor(b),b<0&&(b+=d);for(c=b;c<d;c++)if(this[c]===a)return c;return-1},lastIndexOf:function(a,b){var c,d=this.length;b===undefined?b=d-1:b=b<0?Math.ceil(b):Math.floor(b),b<0&&(b+=d);for(c=b;c>=0;c--)if(this[c]===a)return c;return-1},copy:function(){return this.slice()}}),d=["length"];Ember.EnumerableUtils.forEach(c.keys(),function(a){Array.prototype[a]&&d.push(a)}),d.length>0&&(c=c.without.apply(c,d)),Ember.NativeArray=c,Ember.A=function(a){return a===undefined&&(a=[]),Ember.NativeArray.apply(a)},Ember.NativeArray.activate=function(){c.apply(Array.prototype),Ember.A=function(a){return a||[]}},(Ember.EXTEND_PROTOTYPES===!0||Ember.EXTEND_PROTOTYPES.Array)&&Ember.NativeArray.activate()}(),function(){var a=Ember.get,b=Ember.set;Ember._PromiseChain=Ember.Object.extend({promises:null,failureCallback:Ember.K,successCallback:Ember.K,abortCallback:Ember.K,promiseSuccessCallback:Ember.K,runNextPromise:function(){if(a(this,"isDestroyed"))return;var b=a(this,"promises").shiftObject();if(b){var c=a(b,"promise")||b,d=this,e=function(){d.promiseSuccessCallback.call(this,b,arguments),d.runNextPromise()},f=a(d,"failureCallback");c.then(e,f)}else this.successCallback()},start:function(){return this.runNextPromise(),this},abort:function(){this.abortCallback(),this.destroy()},init:function(){b(this,"promises",Ember.A(a(this,"promises"))),this._super()}})}(),function(){var a={},b={};Ember.onLoad=function(c,d){var e;a[c]=a[c]||Ember.A(),a[c].pushObject(d),(e=b[c])&&d(e)},Ember.runLoadHooks=function(c,d){var e;b[c]=d,(e=a[c])&&a[c].forEach(function(a){a(d)})}}(),function(){}(),function(){Ember.ControllerMixin=Ember.Mixin.create({target:null,store:null}),Ember.Controller=Ember.Object.extend(Ember.ControllerMixin)}(),function(){var a=Ember.get,b=Ember.set,c=Ember.EnumerableUtils.forEach;Ember.SortableMixin=Ember.Mixin.create(Ember.MutableEnumerable,{sortProperties:null,sortAscending:!0,addObject:function(b){var c=a(this,"content");c.pushObject(b)},removeObject:function(b){var c=a(this,"content");c.removeObject(b)},orderBy:function(b,d){var e=0,f=a(this,"sortProperties"),g=a(this,"sortAscending");return c(f,function(c){e===0&&(e=Ember.compare(a(b,c),a(d,c)),e!==0&&!g&&(e=-1*e))}),e},destroy:function(){var b=a(this,"content"),d=a(this,"sortProperties");return b&&d&&c(b,function(a){c(d,function(b){Ember.removeObserver(a,b,this,"contentItemSortPropertyDidChange")},this)},this),this._super()},isSorted:Ember.computed("sortProperties",function(){return!!a(this,"sortProperties")}),arrangedContent:Ember.computed("content","sortProperties.@each",function(b,d){var e=a(this,"content"),f=a(this,"isSorted"),g=a(this,"sortProperties"),h=this;return e&&f?(e=e.slice(),e.sort(function(a,b){return h.orderBy(a,b)}),c(e,function(a){c(g,function(b){Ember.addObserver(a,b,this,"contentItemSortPropertyDidChange")},this)},this),Ember.A(e)):e}),_contentWillChange:Ember.beforeObserver(function(){var b=a(this,"content"),d=a(this,"sortProperties");b&&d&&c(b,function(a){c(d,function(b){Ember.removeObserver(a,b,this,"contentItemSortPropertyDidChange")},this)},this),this._super()},"content"),sortAscendingWillChange:Ember.beforeObserver(function(){this._lastSortAscending=a(this,"sortAscending")},"sortAscending"),sortAscendingDidChange:Ember.observer(function(){if(a(this,"sortAscending")!==this._lastSortAscending){var b=a(this,"arrangedContent");b.reverseObjects()}},"sortAscending"),contentArrayWillChange:function(b,d,e,f){var g=a(this,"isSorted");if(g){var h=a(this,"arrangedContent"),i=b.slice(d,d+e),j=a(this,"sortProperties");c(i,function(a){h.removeObject(a),c(j,function(b){Ember.removeObserver(a,b,this,"contentItemSortPropertyDidChange")},this)})}return this._super(b,d,e,f)},contentArrayDidChange:function(b,d,e,f){var g=a(this,"isSorted"),h=a(this,"sortProperties");if(g){var i=b.slice(d,d+f),j=a(this,"arrangedContent");c(i,function(a){this.insertItemSorted(a),c(h,function(b){Ember.addObserver(a,b,this,"contentItemSortPropertyDidChange")},this)},this)}return this._super(b,d,e,f)},insertItemSorted:function(b){var c=a(this,"arrangedContent"),d=a(c,"length"),e=this._binarySearch(b,0,d);c.insertAt(e,b)},contentItemSortPropertyDidChange:function(b){var c=a(this,"arrangedContent"),d=c.indexOf(b),e=c.objectAt(d-1),f=c.objectAt(d+1),g=e&&this.orderBy(b,e),h=f&&this.orderBy(b,f);if(g<0||h>0)c.removeObject(b),this.insertItemSorted(b)},_binarySearch:function(b,c,d){var e,f,g,h;return c===d?c:(h=a(this,"arrangedContent"),e=c+Math.floor((d-c)/2),f=h.objectAt(e),g=this.orderBy(f,b),g<0?this._binarySearch(b,e+1,d):g>0?this._binarySearch(b,c,e):e)}})}(),function(){var a=Ember.get,b=Ember.set;Ember.ArrayController=Ember.ArrayProxy.extend(Ember.ControllerMixin,Ember.SortableMixin)}(),function(){Ember.ObjectController=Ember.ObjectProxy.extend(Ember.ControllerMixin)}(),function(){}(),function(){}(),function(){function a(b,c,d,e){var f=b.name,g=b.incoming,h=b.incomingNames,i=h.length,j;d||(d={}),e||(e=[]);if(d.hasOwnProperty(f))return;e.push(f),d[f]=!0;for(j=0;j<i;j++)a(g[h[j]],c,d,e);c(b,e),e.pop()}function b(){this.names=[],this.vertices={}}b.prototype.add=function(a){if(!a)return;if(this.vertices.hasOwnProperty(a))return this.vertices[a];var b={name:a,incoming:{},incomingNames:[],hasOutgoing:!1,value:null};return this.vertices[a]=b,this.names.push(a),b},b.prototype.map=function(a,b){this.add(a).value=b},b.prototype.addEdge=function(b,c){function f(a,b){if(a.name===c)throw new Error("cycle detected: "+c+" <- "+b.join(" <- "))}if(!b||!c||b===c)return;var d=this.add(b),e=this.add(c);if(e.incoming.hasOwnProperty(b))return;a(d,f),d.hasOutgoing=!0,e.incoming[b]=d,e.incomingNames.push(b)},b.prototype.topsort=function(b){var c={},d=this.vertices,e=this.names,f=e.length,g,h;for(g=0;g<f;g++)h=d[e[g]],h.hasOutgoing||a(h,b,c)},b.prototype.addEdges=function(a,b,c,d){var e;this.map(a,b);if(c)if(typeof c=="string")this.addEdge(a,c);else for(e=0;e<c.length;e++)this.addEdge(a,c[e]);if(d)if(typeof d=="string")this.addEdge(d,a);else for(e=0;e<d.length;e++)this.addEdge(d[e],a)},Ember.DAG=b}(),function(){var a=Ember.get,b=Ember.set;Ember.Application=Ember.Namespace.extend({rootElement:"body",eventDispatcher:null,customEvents:null,autoinit:!Ember.testing,isInitialized:!1,init:function(){this.$||(this.$=Ember.$),this._super(),this.createEventDispatcher(),this._readinessDeferrals=1,this.waitForDOMContentLoaded();if(this.autoinit){var a=this;this.$().ready(function(){if(a.isDestroyed||a.isInitialized)return;a.initialize()})}},createEventDispatcher:function(){var c=a(this,"rootElement"),d=Ember.EventDispatcher.create({rootElement:c});b(this,"eventDispatcher",d)},waitForDOMContentLoaded:function(){this.deferReadiness();var a=this;this.$().ready(function(){a.advanceReadiness()})},deferReadiness:function(){this._readinessDeferrals++},advanceReadiness:function(){this._readinessDeferrals--,this._readinessDeferrals===0&&Ember.run.once(this,this.didBecomeReady)},initialize:function(a){return a=this.setupRouter(a),this.runInjections(a),Ember.runLoadHooks("application",this),this.isInitialized=!0,this.advanceReadiness(),this},runInjections:function(b){var c=a(this.constructor,"injections"),d=new Ember.DAG,e=this,f,g,h;for(g=0;g<c.length;g++)h=c[g],d.addEdges(h.name,h.injection,h.before,h.after);d.topsort(function(a){var c=a.value,d=Ember.A(Ember.keys(e));d.forEach(function(a){c(e,b,a)})})},setupRouter:function(a){return!a&&Ember.Router.detect(this.Router)&&(a=this.Router.create(),this._createdRouter=a),a&&(b(this,"router",a),b(a,"namespace",this)),a},didBecomeReady:function(){var b=a(this,"eventDispatcher"),c=a(this,"customEvents"),d;b.setup(c),this.ready(),d=a(this,"router"),this.createApplicationView(d),d&&d instanceof Ember.Router&&this.startRouting(d)},createApplicationView:function(c){var d=a(this,"rootElement"),e={},f=this.ApplicationView,g=Ember.TEMPLATES.application,h,i;if(!f&&!g)return;c&&(h=a(c,"applicationController"),h&&(e.controller=h)),g&&(e.template=g),f||(f=Ember.View),i=f.create(e),this._createdApplicationView=i,c&&b(c,"applicationView",i),i.appendTo(d)},startRouting:function(b){var c=a(b,"location");b.route(c.getURL()),c.onUpdateURL(function(a){b.route(a)})},ready:Ember.K,willDestroy:function(){a(this,"eventDispatcher").destroy(),this._createdRouter&&this._createdRouter.destroy(),this._createdApplicationView&&this._createdApplicationView.destroy()},registerInjection:function(a){this.constructor.registerInjection(a)}}),Ember.Application.reopenClass({concatenatedProperties:["injections"],injections:Ember.A(),registerInjection:function(b){var c=a(this,"injections");c.push(b)}}),Ember.Application.registerInjection({name:"controllers",injection:function(a,b,c){if(!b)return;if(!/^[A-Z].*Controller$/.test(c))return;var d=c.charAt(0).toLowerCase()+c.substr(1),e=a[c],f;if(!Ember.Object.detect(e))return;f=a[c].create(),b.set(d,f),f.setProperties({target:b,controllers:b,namespace:a})}}),Ember.runLoadHooks("Ember.Application",Ember.Application)}(),function(){}(),function(){}(),function(){var a=Ember.imports.jQuery;Ember.$=a}(),function(){var a=Ember.String.w("dragstart drag dragenter dragleave dragover drop dragend");Ember.EnumerableUtils.forEach(a,function(a){Ember.$.event.fixHooks[a]={props:["dataTransfer"]}})}(),function(){var a=Ember.get,b=Ember.set,c=Ember.ArrayPolyfills.indexOf,d=function(){this.seen={},this.list=[]};d.prototype={add:function(a){if(a in this.seen)return;this.seen[a]=!0,this.list.push(a)},toDOM:function(){return this.list.join(" ")}},Ember.RenderBuffer=function(a){return new Ember._RenderBuffer(a)},Ember._RenderBuffer=function(a){this.elementTag=a,this.childBuffers=[]},Ember._RenderBuffer.prototype={elementClasses:null,elementId:null,elementAttributes:null,elementTag:null,elementStyle:null,parentBuffer:null,push:function(a){return this.childBuffers.push(String(a)),this},addClass:function(a){var b=this.elementClasses=this.elementClasses||new d;return this.elementClasses.add(a),this},id:function(a){return this.elementId=a,this},attr:function(a,b){var c=this.elementAttributes=this.elementAttributes||{};return arguments.length===1?c[a]:(c[a]=b,this)},removeAttr:function(a){var b=this.elementAttributes;return b&&delete b[a],this},style:function(a,b){var c=this.elementStyle=this.elementStyle||{};return this.elementStyle[a]=b,this},newBuffer:function(a,b,c,d){var e=new Ember._RenderBuffer(a);return e.parentBuffer=b,d&&Ember.$.extend(e,d),c&&c.call(this,e),e},replaceWithBuffer:function(a){var b=this.parentBuffer;if(!b)return;var d=b.childBuffers,e=c.call(d,this);a?d.splice(e,1,a):d.splice(e,1)},begin:function(a){return this.newBuffer(a,this,function(a){this.childBuffers.push(a)})},prepend:function(a){return this.newBuffer(a,this,function(a){this.childBuffers.splice(0,0,a)})},replaceWith:function(a){var b=this.parentBuffer;return this.newBuffer(a,b,function(a){this.replaceWithBuffer(a)})},insertAfter:function(b){var d=a(this,"parentBuffer");return this.newBuffer(b,d,function(a){var b=d.childBuffers,e=c.call(b,this);b.splice(e+1,0,a)})},end:function(){var a=this.parentBuffer;return a||this},remove:function(){this.replaceWithBuffer(null)},element:function(){return Ember.$(this.string())[0]},string:function(){var a="",b=this.elementTag,c;if(b){var d=this.elementId,e=this.elementClasses,f=this.elementAttributes,g=this.elementStyle,h="",i;c=["<"+b],d&&c.push('id="'+this._escapeAttribute(d)+'"'),e&&c.push('class="'+this._escapeAttribute(e.toDOM())+'"');if(g){for(i in g)g.hasOwnProperty(i)&&(h+=i+":"+this._escapeAttribute(g[i])+";");c.push('style="'+h+'"')}if(f)for(i in f)f.hasOwnProperty(i)&&c.push(i+'="'+this._escapeAttribute(f[i])+'"');c=c.join(" ")+">"}var j=this.childBuffers;return Ember.ArrayPolyfills.forEach.call(j,function(b){var c=typeof b=="string";a+=c?b:b.string()}),b?c+a+"</"+b+">":a},_escapeAttribute:function(a){var b={"<":"<",">":">",'"':""","'":"'","`":"`"},c=/&(?!\w+;)|[<>"'`]/g,d=/[&<>"'`]/,e=function(a){return b[a]||"&"},f=a.toString();return d.test(f)?f.replace(c,e):f}}}(),function(){var a=Ember.get,b=Ember.set,c=Ember.String.fmt;Ember.EventDispatcher=Ember.Object.extend({rootElement:"body",setup:function(b){var c,d={touchstart:"touchStart",touchmove:"touchMove",touchend:"touchEnd",touchcancel:"touchCancel",keydown:"keyDown",keyup:"keyUp",keypress:"keyPress",mousedown:"mouseDown",mouseup:"mouseUp",contextmenu:"contextMenu",click:"click",dblclick:"doubleClick",mousemove:"mouseMove",focusin:"focusIn",focusout:"focusOut",mouseenter:"mouseEnter",mouseleave:"mouseLeave",submit:"submit",input:"input",change:"change",dragstart:"dragStart",drag:"drag",dragenter:"dragEnter",dragleave:"dragLeave",dragover:"dragOver",drop:"drop",dragend:"dragEnd"};Ember.$.extend(d,b||{});var e=Ember.$(a(this,"rootElement"));e.addClass("ember-application");for(c in d)d.hasOwnProperty(c)&&this.setupHandler(e,c,d[c])},setupHandler:function(a,b,c){var d=this;a.delegate(".ember-view",b+".ember",function(a,b){return Ember.handleErrors(function(){var e=Ember.View.views[this.id],f=!0,g=null;return g=d._findNearestEventManager(e,c),g&&g!==b?f=d._dispatchEvent(g,a,c,e):e?f=d._bubbleEvent(e,a,c):a.stopPropagation(),f},this)}),a.delegate("[data-ember-action]",b+".ember",function(a){return Ember.handleErrors(function(){var b=Ember.$(a.currentTarget).attr("data-ember-action"),d=Ember.Handlebars.ActionHelper.registeredActions[b],e=d.handler;if(d.eventName===c)return e(a)},this)})},_findNearestEventManager:function(b,c){var d=null;while(b){d=a(b,"eventManager");if(d&&d[c])break;b=a(b,"parentView")}return d},_dispatchEvent:function(a,b,c,d){var e=!0,f=a[c];return Ember.typeOf(f)==="function"?(e=f.call(a,b,d),b.stopPropagation()):e=this._bubbleEvent(d,b,c),e},_bubbleEvent:function(a,b,c){return Ember.run(function(){return a.handleEvent(c,b)})},destroy:function(){var b=a(this,"rootElement");return Ember.$(b).undelegate(".ember").removeClass("ember-application"),this._super()}})}(),function(){var a=Ember.run.queues;a.splice(Ember.$.inArray("actions",a)+1,0,"render")}(),function(){var a=Ember.get,b=Ember.set;Ember.ControllerMixin.reopen({target:null,controllers:null,namespace:null,view:null,connectOutlet:function(c,d){var e,f,g,h,i;Ember.typeOf(d)==="string"&&(e=c,c=d,d=arguments[2]),arguments.length===1?Ember.typeOf(c)==="object"&&(i=c,e=i.outletName,c=i.name,f=i.viewClass,h=i.controller,d=i.context):i={},e=e||"view";if(c){var j=a(this,"namespace"),k=a(this,"controllers"),l=c.charAt(0).toUpperCase()+c.substr(1)+"View";f=a(j,l),h=a(k,c+"Controller")}return h&&d&&b(h,"content",d),g=this.createOutletView(e,f),h&&b(g,"controller",h),b(this,e,g),g},connectControllers:function(){var c=a(this,"controllers"),d=Array.prototype.slice.apply(arguments),e;for(var f=0,g=d.length;f<g;f++)e=d[f]+"Controller",b(this,e,a(c,e))},disconnectOutlet:function(a){a=a||"view",b(this,a,null)},createOutletView:function(a,b){return b.create()}})}(),function(){}(),function(){var a=Ember.get,b=Ember.set,c=Ember.addObserver,d=Ember.removeObserver,e=Ember.meta,f=Ember.String.fmt,g=[].slice,h=Ember.EnumerableUtils.forEach,i=Ember.computed(function(){var b=this._childViews,c=Ember.A();return h(b,function(b){b.isVirtual?c.pushObjects(a(b,"childViews")):c.push(b)}),c}).property();Ember.TEMPLATES={};var j={preRender:{},inBuffer:{},hasElement:{},inDOM:{},destroyed:{}};Ember.CoreView=Ember.Object.extend(Ember.Evented,{init:function(){this._super(),this.isVirtual||(Ember.View.views[a(this,"elementId")]=this)},parentView:Ember.computed(function(){var b=a(this,"_parentView");return b&&b.isVirtual?a(b,"parentView"):b}).property("_parentView").volatile(),state:"preRender",_parentView:null,concreteView:Ember.computed(function(){return this.isVirtual?a(this,"parentView"):this}).property("_parentView").volatile(),renderBuffer:function(b){b=b||a(this,"tagName");if(b===null||b===undefined)b="div";return Ember.RenderBuffer(b)},instrumentName:"render.core_view",instrumentDetails:function(a){a.type=this.constructor.toString()},renderToBuffer:function(b,c){var d=a(this,"instrumentName"),e={};return this.instrumentDetails(e),Ember.instrument(d,e,function(){return this._renderToBuffer(b,c)},this)},_renderToBuffer:function(b,c){var d;Ember.run.sync(),c=c||"begin";if(b){var e=a(this,"tagName");if(e===null||e===undefined)e="div";d=b[c](e)}else d=this.renderBuffer();return this.buffer=d,this.transitionTo("inBuffer",!1),this.beforeRender(d),this.render(d),this.afterRender(d),d},trigger:function(a){this._super.apply(this,arguments);var b=this[a];if(b){var c=[],d,e;for(d=1,e=arguments.length;d<e;d++)c.push(arguments[d]);return b.apply(this,c)}},has:function(a){return Ember.typeOf(this[a])==="function"||this._super(a)},willDestroy:function(){var b=a(this,"_parentView");this.removedFromDOM||this.destroyElement(),b&&b.removeChild(this),this.state="destroyed",this.isVirtual||delete Ember.View.views[a(this,"elementId")]},clearRenderedChildren:Ember.K,invokeRecursively:Ember.K,invalidateRecursively:Ember.K,transitionTo:Ember.K,destroyElement:Ember.K,_notifyWillInsertElement:Ember.K,_notifyDidInsertElement:Ember.K}),Ember.View=Ember.CoreView.extend({concatenatedProperties:["classNames","classNameBindings","attributeBindings"],isView:!0,templateName:null,layoutName:null,templates:Ember.TEMPLATES,template:Ember.computed(function(b,c){if(c!==undefined)return c;var d=a(this,"templateName"),e=this.templateForName(d,"template");return e||a(this,"defaultTemplate")}).property("templateName"),controller:Ember.computed(function(b,c){var d;return arguments.length===2?c:(d=a(this,"parentView"),d?a(d,"controller"):null)}).property(),layout:Ember.computed(function(b,c){if(arguments.length===2)return c;var d=a(this,"layoutName"),e=this.templateForName(d,"layout");return e||a(this,"defaultLayout")}).property("layoutName"),templateForName:function(b,c){if(!b)return;var d=a(this,"templates"),e=a(d,b);if(!e)throw new Ember.Error(f('%@ - Unable to find %@ "%@".',[this,c,b]));return e},context:Ember.computed(function(c,d){return arguments.length===2?(b(this,"_context",d),d):a(this,"_context")}).volatile(),_context:Ember.computed(function(b,c){var d,e;return arguments.length===2?c:(e=a(this,"controller"))?e:(d=a(this,"_parentView"),d?a(d,"_context"):this)}),_displayPropertyDidChange:Ember.observer(function(){this.rerender()},"context","controller"),isVisible:!0,childViews:i,_childViews:[],_childViewsWillChange:Ember.beforeObserver(function(){if(this.isVirtual){var b=a(this,"parentView");b&&Ember.propertyWillChange(b,"childViews")}},"childViews"),_childViewsDidChange:Ember.observer(function(){if(this.isVirtual){var b=a(this,"parentView");b&&Ember.propertyDidChange(b,"childViews")}},"childViews"),nearestInstanceOf:function(b){var c=a(this,"parentView");while(c){if(c instanceof b)return c;c=a(c,"parentView")}},nearestOfType:function(b){var c=a(this,"parentView"),d=b instanceof Ember.Mixin?function(a){return b.detect(a)}:function(a){return b.detect(a.constructor)};while(c){if(d(c))return c;c=a(c,"parentView")}},nearestWithProperty:function(b){var c=a(this,"parentView");while(c){if(b in c)return c;c=a(c,"parentView")}},nearestChildOf:function(b){var c=a(this,"parentView");while(c){if(a(c,"parentView")instanceof b)return c;c=a(c,"parentView")}},collectionView:Ember.computed(function(){return this.nearestOfType(Ember.CollectionView)}),itemView:Ember.computed(function(){return this.nearestChildOf(Ember.CollectionView)}),contentView:Ember.computed(function(){return this.nearestWithProperty("content")}),_parentViewDidChange:Ember.observer(function(){if(this.isDestroying)return;this.invokeRecursively(function(a){a.propertyDidChange("collectionView"),a.propertyDidChange("itemView"),a.propertyDidChange("contentView")}),a(this,"parentView.controller")&&!a(this,"controller")&&this.notifyPropertyChange("controller")},"_parentView"),_controllerDidChange:Ember.observer(function(){if(this.isDestroying)return;this.forEachChildView(function(a){a.propertyDidChange("controller")})},"controller"),cloneKeywords:function(){var c=a(this,"templateData"),d=c?Ember.copy(c.keywords):{};return b(d,"view",a(this,"concreteView")),b(d,"controller",a(this,"controller")),d},render:function(b){var c=a(this,"layout")||a(this,"template");if(c){var d=a(this,"context"),e=this.cloneKeywords(),f={view:this,buffer:b,isRenderData:!0,keywords:e},g=c(d,{data:f});g!==undefined&&b.push(g)}},invokeForState:function(a){var b=this.state,c,d;if(d=j[b][a])return c=g.call(arguments),c[0]=this,d.apply(this,c);var e=this,f=e.states,h;while(f){h=f[b];while(h){d=h[a];if(d)return j[b][a]=d,c=g.call(arguments,1),c.unshift(this),d.apply(this,c);h=h.parentState}f=f.parent}},rerender:function(){return this.invokeForState("rerender")},clearRenderedChildren:function(){var a=this.lengthBeforeRender,b=this.lengthAfterRender,c=this._childViews;for(var d=b-1;d>=a;d--)c[d]&&c[d].destroy()},_applyClassNameBindings:function(){var b=a(this,"classNameBindings"),e=a(this,"classNames"),f,g,i;if(!b)return;h(b,function(a){var b,h=Ember.View._parsePropertyPath(a),j=function(){g=this._classStringForProperty(a),f=this.$();if(!f){d(this,h.path,j);return}b&&(f.removeClass(b),e.removeObject(b)),g?(f.addClass(g),b=g):b=null};i=this._classStringForProperty(a),i&&(e.push(i),b=i),c(this,h.path,j),this.one("willClearRender",function(){d(this,h.path,j)})},this)},_applyAttributeBindings:function(b){var e=a(this,"attributeBindings"),f,g,i;if(!e)return;h(e,function(e){var h=e.split(":"),i=h[0],j=h[1]||i,k=function(){g=this.$();if(!g)return;f=a(this,i),Ember.View.applyAttributeBindings(g,j,f)};c(this,i,k),this.one("willClearRender",function(){d(this,i,k)}),f=a(this,i),Ember.View.applyAttributeBindings(b,j,f)},this)},_classStringForProperty:function(b){var c=Ember.View._parsePropertyPath(b),d=c.path,e=a(this,d);return e===undefined&&Ember.isGlobalPath(d)&&(e=a(Ember.lookup,d)),Ember.View._classStringForValue(d,e,c.className,c.falsyClassName)},element:Ember.computed(function(a,b){return b!==undefined?this.invokeForState("setElement",b):this.invokeForState("getElement")}).property("_parentView"),$:function(a){return this.invokeForState("$",a)},mutateChildViews:function(a){var b=this._childViews,c=b.length,d;while(--c>=0)d=b[c],a.call(this,d,c);return this},forEachChildView:function(a){var b=this._childViews;if(!b)return this;var c=b.length,d,e;for(e=0;e<c;e++)d=b[e],a.call(this,d);return this},appendTo:function(a){return this._insertElementLater(function(){this.$().appendTo(a)}),this},replaceIn:function(a){return this._insertElementLater(function(){Ember.$(a).empty(),this.$().appendTo(a)}),this},_insertElementLater:function(a){this._scheduledInsert=Ember.run.scheduleOnce("render",this,"_insertElement",a)},_insertElement:function(a){this._scheduledInsert=null,this.invokeForState("insertElement",a)},append:function(){return this.appendTo(document.body)},remove:function(){this.destroyElement(),this.invokeRecursively(function(a){a.clearRenderedChildren()})},elementId:Ember.computed(function(a,b){return b!==undefined?b:Ember.guidFor(this)}),_elementIdDidChange:Ember.beforeObserver(function(){throw"Changing a view's elementId after creation is not allowed."},"elementId"),findElementInParentElement:function(b){var c="#"+a(this,"elementId");return Ember.$(c)[0]||Ember.$(c,b)[0]},createElement:function(){if(a(this,"element"))return this;var c=this.renderToBuffer();return b(this,"element",c.element()),this},willInsertElement:Ember.K,didInsertElement:Ember.K,willClearRender:Ember.K,invokeRecursively:function(a){a.call(this,this),this.forEachChildView(function(b){b.invokeRecursively(a)})},invalidateRecursively:function(a){this.forEachChildView(function(b){b.propertyDidChange(a)})},_notifyWillInsertElement:function(){this.invokeRecursively(function(a){a.trigger("willInsertElement")})},_notifyDidInsertElement:function(){this.invokeRecursively(function(a){a.trigger("didInsertElement")})},_notifyWillClearRender:function(){this.invokeRecursively(function(a){a.trigger("willClearRender")})},destroyElement:function(){return this.invokeForState("destroyElement")},willDestroyElement:function(){},_notifyWillDestroyElement:function(){this._notifyWillClearRender(),this.invokeRecursively(function(a){a.trigger("willDestroyElement")})},_elementWillChange:Ember.beforeObserver(function(){this.forEachChildView(function(a){Ember.propertyWillChange(a,"element")})},"element"),_elementDidChange:Ember.observer(function(){this.forEachChildView(function(a){Ember.propertyDidChange(a,"element")})},"element"),parentViewDidChange:Ember.K,instrumentName:"render.view",instrumentDetails:function(b){b.template=a(this,"templateName"),this._super(b)},_renderToBuffer:function(a,b){this.lengthBeforeRender=this._childViews.length;var c=this._super(a,b);return this.lengthAfterRender=this._childViews.length,c},renderToBufferIfNeeded:function(){return this.invokeForState("renderToBufferIfNeeded",this)},beforeRender:function(a){this.applyAttributesToBuffer(a)},afterRender:Ember.K,applyAttributesToBuffer:function(b){this._applyClassNameBindings(),this._applyAttributeBindings(b),h(a(this,"classNames"),function(a){b.addClass(a)}),b.id(a(this,"elementId"));var c=a(this,"ariaRole");c&&b.attr("role",c),a(this,"isVisible")===!1&&b.style("display","none")},tagName:null,ariaRole:null,classNames:["ember-view"],classNameBindings:[],attributeBindings:[],init:function(){this._super(),this._childViews=this._childViews.slice(),this.classNameBindings=Ember.A(this.classNameBindings.slice()),this.classNames=Ember.A(this.classNames.slice());var c=a(this,"viewController");c&&(c=a(c),c&&b(c,"view",this))},appendChild:function(a,b){return this.invokeForState("appendChild",a,b)},removeChild:function(a){if(this.isDestroying)return;b(a,"_parentView",null);var c=this._childViews;return Ember.EnumerableUtils.removeObject(c,a),this.propertyDidChange("childViews"),this},removeAllChildren:function(){return this.mutateChildViews(function(a){this.removeChild(a)})},destroyAllChildren:function(){return this.mutateChildViews(function(a){a.destroy()})},removeFromParent:function(){var b=a(this,"_parentView");return this.remove(),b&&b.removeChild(this),this},willDestroy:function(){var c=this._childViews,d=a(this,"_parentView"),e;this.removedFromDOM||this.destroyElement();if(this.viewName){var f=a(this,"parentView");f&&b(f,this.viewName,null)}d&&d.removeChild(this),this.state="destroyed",e=c.length;for(var g=e-1;g>=0;g--)c[g].removedFromDOM=!0,c[g].destroy();this.isVirtual||delete Ember.View.views[a(this,"elementId")]},createChildView:function(c,d){return Ember.CoreView.detect(c)?(d=d||{},d._parentView=this,d.templateData=d.templateData||a(this,"templateData"),c=c.create(d),c.viewName&&b(a(this,"concreteView"),c.viewName,c)):(a(c,"templateData")||b(c,"templateData",a(this,"templateData")),b(c,"_parentView",this)),c},becameVisible:Ember.K,becameHidden:Ember.K,_isVisibleDidChange:Ember.observer(function(){var b=this.$();if(!b)return;var c=a(this,"isVisible");b.toggle(c);if(this._isAncestorHidden())return;c?this._notifyBecameVisible():this._notifyBecameHidden()},"isVisible"),_notifyBecameVisible:function(){this.trigger("becameVisible"),this.forEachChildView
(function(b){var c=a(b,"isVisible");(c||c===null)&&b._notifyBecameVisible()})},_notifyBecameHidden:function(){this.trigger("becameHidden"),this.forEachChildView(function(b){var c=a(b,"isVisible");(c||c===null)&&b._notifyBecameHidden()})},_isAncestorHidden:function(){var b=a(this,"parentView");while(b){if(a(b,"isVisible")===!1)return!0;b=a(b,"parentView")}return!1},clearBuffer:function(){this.invokeRecursively(function(a){this.buffer=null})},transitionTo:function(a,b){this.state=a,b!==!1&&this.forEachChildView(function(b){b.transitionTo(a)})},handleEvent:function(a,b){return this.invokeForState("handleEvent",a,b)}});var k={prepend:function(a,b){a.$().prepend(b)},after:function(a,b){a.$().after(b)},html:function(a,b){a.$().html(b)},replace:function(c){var d=a(c,"element");b(c,"element",null),c._insertElementLater(function(){Ember.$(d).replaceWith(a(c,"element"))})},remove:function(a){a.$().remove()},empty:function(a){a.$().empty()}};Ember.View.reopen({states:Ember.View.states,domManager:k}),Ember.View.reopenClass({_parsePropertyPath:function(a){var b=a.split(":"),c=b[0],d="",e,f;return b.length>1&&(e=b[1],b.length===3&&(f=b[2]),d=":"+e,f&&(d+=":"+f)),{path:c,classNames:d,className:e===""?undefined:e,falsyClassName:f}},_classStringForValue:function(a,b,c,d){if(c||d)return c&&!!b?c:d&&!b?d:null;if(b===!0){var e=a.split(".");return Ember.String.dasherize(e[e.length-1])}return b!==!1&&b!==undefined&&b!==null?b:null}}),Ember.View.views={},Ember.View.childViewsProperty=i,Ember.View.applyAttributeBindings=function(a,b,c){var d=Ember.typeOf(c),e=a.attr(b);(d==="string"||d==="number"&&!isNaN(c))&&c!==e?a.attr(b,c):c&&d==="boolean"?a.attr(b,b):c||a.removeAttr(b)}}(),function(){var a=Ember.get,b=Ember.set;Ember.View.states={_default:{appendChild:function(){throw"You can't use appendChild outside of the rendering process"},$:function(){return undefined},getElement:function(){return null},handleEvent:function(){return!0},destroyElement:function(a){return b(a,"element",null),a._scheduledInsert&&(Ember.run.cancel(a._scheduledInsert),a._scheduledInsert=null),a},renderToBufferIfNeeded:function(){return!1}}},Ember.View.reopen({states:Ember.View.states})}(),function(){Ember.View.states.preRender={parentState:Ember.View.states._default,insertElement:function(a,b){a.createElement(),a._notifyWillInsertElement(),b.call(a),a.transitionTo("inDOM"),a._notifyDidInsertElement()},renderToBufferIfNeeded:function(a){return a.renderToBuffer()},empty:Ember.K,setElement:function(a,b){return b!==null&&a.transitionTo("hasElement"),b}}}(),function(){var a=Ember.get,b=Ember.set,c=Ember.meta;Ember.View.states.inBuffer={parentState:Ember.View.states._default,$:function(a,b){return a.rerender(),Ember.$()},rerender:function(a){a._notifyWillClearRender(),a.clearRenderedChildren(),a.renderToBuffer(a.buffer,"replaceWith")},appendChild:function(a,b,c){var d=a.buffer;return b=this.createChildView(b,c),a._childViews.push(b),b.renderToBuffer(d),a.propertyDidChange("childViews"),b},destroyElement:function(a){return a.clearBuffer(),a._notifyWillDestroyElement(),a.transitionTo("preRender"),a},empty:function(){},renderToBufferIfNeeded:function(a){return a.buffer},insertElement:function(){throw"You can't insert an element that has already been rendered"},setElement:function(a,b){return b===null?a.transitionTo("preRender"):(a.clearBuffer(),a.transitionTo("hasElement")),b}}}(),function(){var a=Ember.get,b=Ember.set,c=Ember.meta;Ember.View.states.hasElement={parentState:Ember.View.states._default,$:function(b,c){var d=a(b,"element");return c?Ember.$(c,d):Ember.$(d)},getElement:function(b){var c=a(b,"parentView");return c&&(c=a(c,"element")),c?b.findElementInParentElement(c):Ember.$("#"+a(b,"elementId"))[0]},setElement:function(a,b){if(b!==null)throw"You cannot set an element to a non-null value when the element is already in the DOM.";return a.transitionTo("preRender"),b},rerender:function(a){return a._notifyWillClearRender(),a.clearRenderedChildren(),a.domManager.replace(a),a},destroyElement:function(a){return a._notifyWillDestroyElement(),a.domManager.remove(a),b(a,"element",null),a._scheduledInsert&&(Ember.run.cancel(a._scheduledInsert),a._scheduledInsert=null),a},empty:function(a){var b=a._childViews,c,d;if(b){c=b.length;for(d=0;d<c;d++)b[d]._notifyWillDestroyElement()}a.domManager.empty(a)},handleEvent:function(a,b,c){return a.has(b)?a.trigger(b,c):!0}},Ember.View.states.inDOM={parentState:Ember.View.states.hasElement,insertElement:function(a,b){throw"You can't insert an element into the DOM that has already been inserted"}}}(),function(){var a="You can't call %@ on a destroyed view",b=Ember.String.fmt;Ember.View.states.destroyed={parentState:Ember.View.states._default,appendChild:function(){throw b(a,["appendChild"])},rerender:function(){throw b(a,["rerender"])},destroyElement:function(){throw b(a,["destroyElement"])},empty:function(){throw b(a,["empty"])},setElement:function(){throw b(a,["set('element', ...)"])},renderToBufferIfNeeded:function(){throw b(a,["renderToBufferIfNeeded"])},insertElement:Ember.K}}(),function(){}(),function(){var a=Ember.get,b=Ember.set,c=Ember.meta,d=Ember.EnumerableUtils.forEach,e=Ember.computed(function(){return a(this,"_childViews")}).property("_childViews");Ember.ContainerView=Ember.View.extend({init:function(){this._super();var c=a(this,"childViews");Ember.defineProperty(this,"childViews",e);var f=this._childViews;d(c,function(c,d){var e;"string"==typeof c?(e=a(this,c),e=this.createChildView(e),b(this,c,e)):e=this.createChildView(c),f[d]=e},this);var g=a(this,"currentView");g&&f.push(this.createChildView(g)),Ember.A(f),a(this,"childViews").addArrayObserver(this,{willChange:"childViewsWillChange",didChange:"childViewsDidChange"})},render:function(a){this.forEachChildView(function(b){b.renderToBuffer(a)})},instrumentName:"render.container",willDestroy:function(){a(this,"childViews").removeArrayObserver(this,{willChange:"childViewsWillChange",didChange:"childViewsDidChange"}),this._super()},childViewsWillChange:function(a,b,c){if(c===0)return;var d=a.slice(b,b+c);this.initializeViews(d,null,null),this.invokeForState("childViewsWillChange",a,b,c)},childViewsDidChange:function(b,c,d,e){var f=a(b,"length");if(e===0)return;var g=b.slice(c,c+e);this.initializeViews(g,this,a(this,"templateData")),this.invokeForState("childViewsDidChange",b,c,e)},initializeViews:function(c,e,f){d(c,function(c){b(c,"_parentView",e),a(c,"templateData")||b(c,"templateData",f)})},currentView:null,_currentViewWillChange:Ember.beforeObserver(function(){var b=a(this,"childViews"),c=a(this,"currentView");c&&(b.removeObject(c),c.destroy())},"currentView"),_currentViewDidChange:Ember.observer(function(){var b=a(this,"childViews"),c=a(this,"currentView");c&&b.pushObject(c)},"currentView"),_ensureChildrenAreInDOM:function(){this.invokeForState("ensureChildrenAreInDOM",this)}}),Ember.ContainerView.states={parent:Ember.View.states,inBuffer:{childViewsDidChange:function(a,b,c,d){var e=a.buffer,f,g,h,i;c===0?(i=b[c],f=c+1,i.renderToBuffer(e,"prepend")):(i=b[c-1],f=c);for(var j=f;j<c+d;j++)g=i,i=b[j],h=g.buffer,i.renderToBuffer(h,"insertAfter")}},hasElement:{childViewsWillChange:function(a,b,c,d){for(var e=c;e<c+d;e++)b[e].remove()},childViewsDidChange:function(a,b,c,d){Ember.run.scheduleOnce("render",this,"_ensureChildrenAreInDOM")},ensureChildrenAreInDOM:function(a){var b=a.get("childViews"),c,d,e,f,g;for(c=0,d=b.length;c<d;c++)e=b[c],g=e.renderToBufferIfNeeded(),g&&(e._notifyWillInsertElement(),f?f.domManager.after(f,g.string()):a.domManager.prepend(a,g.string()),e.transitionTo("inDOM"),e.propertyDidChange("element"),e._notifyDidInsertElement()),f=e}}},Ember.ContainerView.states.inDOM={parentState:Ember.ContainerView.states.hasElement},Ember.ContainerView.reopen({states:Ember.ContainerView.states})}(),function(){var a=Ember.get,b=Ember.set,c=Ember.String.fmt;Ember.CollectionView=Ember.ContainerView.extend({content:null,emptyViewClass:Ember.View,emptyView:null,itemViewClass:Ember.View,init:function(){var a=this._super();return this._contentDidChange(),a},_contentWillChange:Ember.beforeObserver(function(){var b=this.get("content");b&&b.removeArrayObserver(this);var c=b?a(b,"length"):0;this.arrayWillChange(b,0,c)},"content"),_contentDidChange:Ember.observer(function(){var b=a(this,"content");b&&b.addArrayObserver(this);var c=b?a(b,"length"):0;this.arrayDidChange(b,0,null,c)},"content"),willDestroy:function(){var b=a(this,"content");b&&b.removeArrayObserver(this),this._super()},arrayWillChange:function(b,c,d){var e=a(this,"emptyView");e&&e instanceof Ember.View&&e.removeFromParent();var f=a(this,"childViews"),g,h,i;i=a(f,"length");var j=d===i;j&&this.invokeForState("empty");for(h=c+d-1;h>=c;h--)g=f[h],j&&(g.removedFromDOM=!0),g.destroy()},arrayDidChange:function(c,d,e,f){var g=a(this,"itemViewClass"),h=a(this,"childViews"),i=[],j,k,l,m,n;"string"==typeof g&&(g=a(g)),m=c?a(c,"length"):0;if(m)for(l=d;l<d+f;l++)k=c.objectAt(l),j=this.createChildView(g,{content:k,contentIndex:l}),i.push(j);else{var o=a(this,"emptyView");if(!o)return;o=this.createChildView(o),i.push(o),b(this,"emptyView",o)}h.replace(d,0,i)},createChildView:function(c,d){c=this._super(c,d);var e=a(c,"tagName"),f=e===null||e===undefined?Ember.CollectionView.CONTAINER_MAP[a(this,"tagName")]:e;return b(c,"tagName",f),c}}),Ember.CollectionView.CONTAINER_MAP={ul:"li",ol:"li",table:"tr",thead:"tr",tbody:"tr",tfoot:"tr",tr:"td",select:"option"}}(),function(){}(),function(){}(),function(){var a=Ember.get,b=Ember.set;Ember.State=Ember.Object.extend(Ember.Evented,{isState:!0,parentState:null,start:null,name:null,path:Ember.computed(function(){var b=a(this,"parentState.path"),c=a(this,"name");return b&&(c=b+"."+c),c}).property(),trigger:function(a){this[a]&&this[a].apply(this,[].slice.call(arguments,1)),this._super.apply(this,arguments)},init:function(){var c=a(this,"states"),d;b(this,"childStates",Ember.A()),b(this,"eventTransitions",a(this,"eventTransitions")||{});var e,f,g;if(!c){c={};for(e in this){if(e==="constructor")continue;if(f=this[e]){if(g=f.transitionTarget)this.eventTransitions[e]=g;this.setupChild(c,e,f)}}b(this,"states",c)}else for(e in c)this.setupChild(c,e,c[e]);b(this,"pathsCache",{}),b(this,"pathsCacheNoContext",{})},setupChild:function(c,d,e){if(!e)return!1;e.isState?b(e,"name",d):Ember.State.detect(e)&&(e=e.create({name:d}));if(e.isState)return b(e,"parentState",this),a(this,"childStates").pushObject(e),c[d]=e,e},lookupEventTransition:function(a){var b,c=this;while(c&&!b)b=c.eventTransitions[a],c=c.get("parentState");return b},isLeaf:Ember.computed(function(){return!a(this,"childStates").length}),hasContext:!0,setup:Ember.K,enter:Ember.K,exit:Ember.K}),Ember.State.reopenClass({transitionTo:function(a){var b=function(b,c){var d=[],e,f=Ember.$&&Ember.$.Event;c&&f&&c instanceof f?c.hasOwnProperty("contexts")&&(d=c.contexts.slice()):d=[].slice.call(arguments,1),d.unshift(a),b.transitionTo.apply(b,d)};return b.transitionTarget=a,b}})}(),function(){var a=Ember.get,b=Ember.set,c=Ember.String.fmt,d=Ember.ArrayPolyfills.forEach,e=function(a){this.enterStates=a.enterStates.slice(),this.exitStates=a.exitStates.slice(),this.resolveState=a.resolveState,this.finalState=a.enterStates[a.enterStates.length-1]||a.resolveState};e.prototype={normalize:function(a,b){return this.matchContextsToStates(b),this.addInitialStates(),this.removeUnchangedContexts(a),this},matchContextsToStates:function(b){var c=this.enterStates.length-1,d=[],e,f;while(b.length>0){if(c>=0)e=this.enterStates[c--];else{if(this.enterStates.length){e=a(this.enterStates[0],"parentState");if(!e)throw"Cannot match all contexts to states"}else e=this.resolveState;this.enterStates.unshift(e),this.exitStates.unshift(e)}a(e,"hasContext")?f=b.pop():f=null,d.unshift(f)}this.contexts=d},addInitialStates:function(){var b=this.finalState,c;for(;;){c=a(b,"initialState")||"start",b=a(b,"states."+c);if(!b)break;this.finalState=b,this.enterStates.push(b),this.contexts.push(undefined)}},removeUnchangedContexts:function(a){while(this.enterStates.length>0){if(this.enterStates[0]!==this.exitStates[0])break;if(this.enterStates.length===this.contexts.length){if(a.getStateMeta(this.enterStates[0],"context")!==this.contexts[0])break;this.contexts.shift()}this.resolveState=this.enterStates.shift(),this.exitStates.shift()}}},Ember.StateManager=Ember.State.extend({init:function(){this._super(),b(this,"stateMeta",Ember.Map.create());var c=a(this,"initialState");!c&&a(this,"states.start")&&(c="start"),c&&this.transitionTo(c)},stateMetaFor:function(b){var c=a(this,"stateMeta"),d=c.get(b);return d||(d={},c.set(b,d)),d},setStateMeta:function(a,c,d){return b(this.stateMetaFor(a),c,d)},getStateMeta:function(b,c){return a(this.stateMetaFor(b),c)},currentState:null,currentPath:Ember.computed("currentState",function(){return a(this,"currentState.path")}),transitionEvent:"setup",errorOnUnhandledEvent:!0,send:function(b){var c,d;return c=[].slice.call(arguments,1),d=c,d.unshift(b,a(this,"currentState")),this.sendRecursively.apply(this,d)},sendRecursively:function(b,d){var e=this.enableLogging,f=d[b],g,h,i;g=[].slice.call(arguments,2);if(typeof f=="function")return e&&Ember.Logger.log(c("STATEMANAGER: Sending event '%@' to state %@.",[b,a(d,"path")])),i=g,i.unshift(this),f.apply(d,i);var j=a(d,"parentState");if(j)return h=g,h.unshift(b,j),this.sendRecursively.apply(this,h);if(a(this,"errorOnUnhandledEvent"))throw new Ember.Error(this.toString()+" could not respond to event "+b+" in state "+a(this,"currentState.path")+".")},getStateByPath:function(b,c){var d=c.split("."),e=b;for(var f=0,g=d.length;f<g;f++){e=a(a(e,"states"),d[f]);if(!e)break}return e},findStateByPath:function(b,c){var d;while(!d&&b)d=this.getStateByPath(b,c),b=a(b,"parentState");return d},getStatesInPath:function(b,c){if(!c||c==="")return undefined;var d=c.split("."),e=[],f,g;for(var h=0,i=d.length;h<i;h++){f=a(b,"states");if(!f)return undefined;g=a(f,d[h]);if(!g)return undefined;b=g,e.push(g)}return e},goToState:function(){return this.transitionTo.apply(this,arguments)},transitionTo:function(b,c){if(Ember.empty(b))return;var d=c?Array.prototype.slice.call(arguments,1):[],f=a(this,"currentState")||this,g=this.contextFreeTransition(f,b),h=(new e(g)).normalize(this,d);this.enterState(h),this.triggerSetupContext(h)},contextFreeTransition:function(b,c){var d=b.pathsCache[c];if(d)return d;var e=this.getStatesInPath(b,c),f=[],g=b;while(g&&!e){f.unshift(g),g=a(g,"parentState");if(!g){e=this.getStatesInPath(this,c);if(!e)return}e=this.getStatesInPath(g,c)}while(e.length>0&&e[0]===f[0])g=e.shift(),f.shift();var h=b.pathsCache[c]={exitStates:f,enterStates:e,resolveState:g};return h},triggerSetupContext:function(b){var c=b.contexts,e=b.enterStates.length-c.length,f=b.enterStates,g=a(this,"transitionEvent");d.call(f,function(a,b){a.trigger(g,this,c[b-e])},this)},getState:function(b){var c=a(this,b),d=a(this,"parentState");if(c)return c;if(d)return d.getState(b)},enterState:function(c){var e=this.enableLogging,f=c.exitStates.slice(0).reverse();d.call(f,function(a){a.trigger("exit",this)},this),d.call(c.enterStates,function(b){e&&Ember.Logger.log("STATEMANAGER: Entering "+a(b,"path")),b.trigger("enter",this)},this),b(this,"currentState",c.finalState)}})}(),function(){}(),function(){var a=Ember.get;Ember._ResolvedState=Ember.Object.extend({manager:null,state:null,match:null,object:Ember.computed(function(b,c){if(arguments.length===2)return this._object=c,c;if(this._object)return this._object;var d=a(this,"state"),e=a(this,"match"),f=a(this,"manager");return d.deserialize(f,e.hash)}).property(),hasPromise:Ember.computed(function(){return Ember.canInvoke(a(this,"object"),"then")}).property("object"),promise:Ember.computed(function(){var b=a(this,"object");return Ember.canInvoke(b,"then")?b:{then:function(a){a(b)}}}).property("object"),transition:function(){var b=a(this,"manager"),c=a(this,"state.path"),d=a(this,"object");b.transitionTo(c,d)}})}(),function(){var a=Ember.get,b=function(a){var b=a.toString(),c=b.split("."),d=c[c.length-1];return Ember.String.underscore(d)+"_id"},c=function(a,b){for(var c in b){if(!b.hasOwnProperty(c))continue;if(a.hasOwnProperty(c))continue;a[c]=b[c]}};Ember.Routable=Ember.Mixin.create({init:function(){var b;this.on("setup",this,this.stashContext);if(b=a(this,"redirectsTo"))this.connectOutlets=function(a){a.transitionTo(b)};var c=a(this,"route");c===""&&(c="/"),this._super()},setup:function(){return this.connectOutlets.apply(this,arguments)},stashContext:function(b,c){this.router=b;var d=this.serialize(b,c);b.setStateMeta(this,"context",c),b.setStateMeta(this,"serialized",d),a(this,"isRoutable")&&!a(b,"isRouting")&&this.updateRoute(b,a(b,"location"))},updateRoute:function(b,c){if(a(this,"isLeafRoute")){var d=this.absoluteRoute(b);c.setURL(d)}},absoluteRoute:function(b,d){var e=a(this,"parentState"),f="",g;a(e,"isRoutable")&&(f=e.absoluteRoute(b,d));var h=a(this,"routeMatcher"),i=b.getStateMeta(this,"serialized");return d=d||{},c(d,i),g=h&&h.generate(d),g&&(f=f+"/"+g),f},isRoutable:Ember.computed(function(){return typeof a(this,"route")=="string"}),isLeafRoute:Ember.computed(function(){return a(this,"isLeaf")?!0:!a(this,"childStates").findProperty("isRoutable")}),routeMatcher:Ember.computed(function(){var b=a(this,"route");if(b)return Ember._RouteMatcher.create({route:b})}),hasContext:Ember.computed(function(){var b=a(this,"routeMatcher");if(b)return b.identifiers.length>0}),modelClass:Ember.computed(function(){var b=a(this,"modelType");return typeof b=="string"?Ember.get(Ember.lookup,b):b}),modelClassFor:function(b){var c,d,e,f,g;if(c=a(this,"modelClass"))return c;if(!b)return;d=a(this,"routeMatcher");if(!d)return;e=d.identifiers;if(e.length!==2)return;f=e[1].match(/^(.*)_id$/);if(!f)return;return g=Ember.String.classify(f[1]),a(b,g)},deserialize:function(c,d){var e,f,g;return(e=this.modelClassFor(a(c,"namespace")))?e.find(d[b(e)]):d},serialize:function(c,d){var e,f,g,h,i;if(Ember.empty(d))return"";if(e=this.modelClassFor(a(c,"namespace")))h=b(e),i=a(d,"id"),d={},d[h]=i;return d},resolvePath:function(b,c){if(a(this,"isLeafRoute"))return Ember.A();var d=a(this,"childStates"),e;d=Ember.A(d.filterProperty("isRoutable")),d=d.sort(function(b,c){var d=a(b,"routeMatcher.identifiers.length"),e=a(c,"routeMatcher.identifiers.length"),f=a(b,"route"),g=a(c,"route");return f.indexOf(g)===0?-1:g.indexOf(f)===0?1:d!==e?d-e:a(c,"route.length")-a(b,"route.length")});var f=d.find(function(b){var d=a(b,"routeMatcher");if(e=d.match(c))return!0}),g=Ember._ResolvedState.create({manager:b,state:f,match:e}),h=f.resolvePath(b,e.remaining);return Ember.A([g]).pushObjects(h)},routePath:function(b,c){function f(){d.forEach(function(a){a.transition()})}if(a(this,"isLeafRoute"))return;var d=this.resolvePath(b,c),e=d.some(function(b){return a(b,"hasPromise")});e?(b.transitionTo("loading"),b.handleStatePromises(d,f)):f()},unroutePath:function(b,c){var d=a(this,"parentState");if(d===b)return;c=c.replace(/^(?=[^\/])/,"/");var e=this.absoluteRoute(b),f=a(this,"route");if(f!=="/"){var g=c.indexOf(e),h=c.charAt(e.length);if(g===0&&(h==="/"||h===""))return}b.enterState({exitStates:[this],enterStates:[],finalState:d}),b.send("unroutePath",c)},parentTemplate:Ember.computed(function(){var b=this,c,d;while(b=a(b,"parentState"))if(d=a(b,"template"))return d;return"application"}),_template:Ember.computed(function(b,c){if(arguments.length>1)return c;if(c=a(this,"template"))return c;var d=this.constructor.toString(),e;if(/^[^\[].*Route$/.test(d))return e=d.match(/([^\.]+\.)*([^\.]+)/)[2],e=e.replace(/Route$/,""),e.charAt(0).toLowerCase()+e.substr(1)}),render:function(b){b=b||{};var c=b.template||a(this,"_template"),d=b.into||a(this,"parentTemplate"),e=a(this.router,d+"Controller"),f=Ember.String.classify(c)+"View",g=a(a(this.router,"namespace"),f);g=(g||Ember.View).extend({templateName:c}),e.set("view",g.create())},connectOutlets:Ember.K,navigateAway:Ember.K})}(),function(){Ember.Route=Ember.State.extend(Ember.Routable)}(),function(){var a=function(a){return a.replace(/[\-\[\]{}()*+?.,\\\^\$|#\s]/g,"\\$&")};Ember._RouteMatcher=Ember.Object.extend({state:null,init:function(){var b=this.route,c=[],d=1,e;b.charAt(0)==="/"&&(b=this.route=b.substr(1)),e=a(b);var f=e.replace(/(:|(?:\\\*))([a-z_]+)(?=$|\/)/gi,function(a,b,e){c[d++]=e;switch(b){case":":return"([^/]+)";case"\\*":return"(.+)"}});this.identifiers=c,this.regex=new RegExp("^/?"+f)},match:function(a){var b=a.match(this.regex);if(b){var c=this.identifiers,d={};for(var e=1,f=c.length;e<f;e++)d[c[e]]=b[e];return{remaining:a.substr(b[0].length),hash:c.length>0?d:null}}},generate:function(a){var b=this.identifiers,c=this.route,d;for(var e=1,f=b.length;e<f;e++)d=b[e],c=c.replace(new RegExp("(:|(\\*))"+d),a[d]);return c}})}(),function(){var a=Ember.get,b=Ember.set;Ember.Location={create:function(a){var b=a&&a.implementation,c=this.implementations[b];return c.create.apply(c,arguments)},registerImplementation:function(a,b){this.implementations[a]=b},implementations:{}}}(),function(){var a=Ember.get,b=Ember.set;Ember.NoneLocation=Ember.Object.extend({path:"",getURL:function(){return a(this,"path")},setURL:function(a){b(this,"path",a)},onUpdateURL:function(a){},formatURL:function(a){return a}}),Ember.Location.registerImplementation("none",Ember.NoneLocation)}(),function(){var a=Ember.get,b=Ember.set;Ember.HashLocation=Ember.Object.extend({init:function(){b(this,"location",a(this,"location")||window.location)},getURL:function(){return a(this,"location").hash.substr(1)},setURL:function(c){a(this,"location").hash=c,b(this,"lastSetURL",c)},onUpdateURL:function(c){var d=this,e=Ember.guidFor(this);Ember.$(window).bind("hashchange.ember-location-"+e,function(){var e=location.hash.substr(1);if(a(d,"lastSetURL")===e)return;b(d,"lastSetURL",null),c(location.hash.substr(1))})},formatURL:function(a){return"#"+a},willDestroy:function(){var a=Ember.guidFor(this);Ember.$(window).unbind("hashchange.ember-location-"+a)}}),Ember.Location.registerImplementation("hash",Ember.HashLocation)}(),function(){var a=Ember.get,b=Ember.set,c=!1;Ember.HistoryLocation=Ember.Object.extend({init:function(){b(this,"location",a(this,"location")||window.location),this.initState()},initState:function(){this.replaceState(a(this,"location").pathname),b(this,"history",window.history)},rootURL:"/",getURL:function(){return a(this,"location").pathname},setURL:function(a){a=this.formatURL(a),this.getState().path!==a&&(c=!0,this.pushState(a))},getState:function(){return a(this,"history").state},pushState:function(a){window.history.pushState({path:a},null,a)},replaceState:function(a){window.history.replaceState({path:a},null,a)},onUpdateURL:function(a){var b=Ember.guidFor(this);Ember.$(window).bind("popstate.ember-location-"+b,function(b){if(!c)return;a(location.pathname)})},formatURL:function(b){var c=a(this,"rootURL");return b!==""&&(c=c.replace(/\/$/,"")),c+b},willDestroy:function(){var a=Ember.guidFor(this);Ember.$(window).unbind("popstate.ember-location-"+a)}}),Ember.Location.registerImplementation("history",Ember.HistoryLocation)}(),function(){}(),function(){var a=Ember.get,b=Ember.set,c=function(a,b){for(var c in b){if(!b.hasOwnProperty(c))continue;if(a.hasOwnProperty(c))continue;a[c]=b[c]}};Ember.Router=Ember.StateManager.extend({initialState:"root",location:"hash",rootURL:"/",transitionTo:function(){this.abortRoutingPromises(),this._super.apply(this,arguments)},route:function(c){this.abortRoutingPromises(),b(this,"isRouting",!0);var d;try{c=c.replace(a(this,"rootURL"),""),c=c.replace(/^(?=[^\/])/,"/"),this.send("navigateAway"),this.send("unroutePath",c),d=a(this,"currentState");while(d&&!d.get("isRoutable"))d=a(d,"parentState");var e=d?d.absoluteRoute(this):"",f=c.substr(e.length);this.send("routePath",f)}finally{b(this,"isRouting",!1)}d=a(this,"currentState");while(d&&!d.get("isRoutable"))d=a(d,"parentState");d&&d.updateRoute(this,a(this,"location"))},urlFor:function(b,c){var d=a(this,"currentState")||this,e=this.findStateByPath(d,b),f=a(this,"location"),g=e.absoluteRoute(this,c);return f.formatURL(g)},urlForEvent:function(b){var c=Array.prototype.slice.call(arguments,1),d=a(this,"currentState"),e=d.lookupEventTransition(b),f=this.findStateByPath(d,e),g=this.serializeRecursively(f,c,{});return this.urlFor(e,g)},serializeRecursively:function(b,d,e){var f,g=a(b,"hasContext")?d.pop():null;return c(e,b.serialize(this,g)),f=b.get("parentState"),f&&f instanceof Ember.Route?this.serializeRecursively(f,d,e):e},abortRoutingPromises:function(){this._routingPromises&&(this._routingPromises.abort(),this._routingPromises=null)},handleStatePromises:function(a,c){this.abortRoutingPromises(),this.set("isLocked",!0);var d=this;this._routingPromises=Ember._PromiseChain.create({promises:a.slice(),successCallback:function(){d.set("isLocked",!1),c()},failureCallback:function(){throw"Unable to load object"},promiseSuccessCallback:function(a,c){b(a,"object",c[0])},abortCallback:function(){d.set("isLocked",!1)}}).start()},moveStatesIntoRoot:function(){this.root=Ember.Route.extend();for(var a in this){if(a==="constructor")continue;var b=this[a];if(b instanceof Ember.Route||Ember.Route.detect(b))this.root[a]=b,delete this[a]}},init:function(){this.root||this.moveStatesIntoRoot(),this._super();var c=a(this,"location"),d=a(this,"rootURL");"string"==typeof c&&b(this,"location",Ember.Location.create({implementation:c,rootURL:d})),this.assignRouter(this,this)},assignRouter:function(a,b){a.router=b;var c=a.states;if(c)for(var d in c){if(!c.hasOwnProperty(d))continue;this.assignRouter(c[d],b)}},willDestroy:function(){a(this,"location").destroy()}})}(),function(){}(),function(){(function(a){var b=function(){},c=0,d=a.document,e="createRange"in d&&typeof Range!="undefined"&&Range.prototype.createContextualFragment,f=function(){var a=d.createElement("div");return a.innerHTML="<div></div>",a.firstChild.innerHTML="<script></script>",a.firstChild.innerHTML===""}(),g=function(a){var d;this instanceof g?d=this:d=new b,d.innerHTML=a;var e="metamorph-"+c++;return d.start=e+"-start",d.end=e+"-end",d};b.prototype=g.prototype;var h,i,j,k,l,m,n,o,p;k=function(){return this.startTag()+this.innerHTML+this.endTag()},o=function(){return"<script id='"+this.start+"' type='text/x-placeholder'></script>"},p=function(){return"<script id='"+this.end+"' type='text/x-placeholder'></script>"};if(e)h=function(a,b){var c=d.createRange(),e=d.getElementById(a.start),f=d.getElementById(a.end);return b?(c.setStartBefore(e),c.setEndAfter(f)):(c.setStartAfter(e),c.setEndBefore(f)),c},i=function(a,b){var c=h(this,b);c.deleteContents();var d=c.createContextualFragment(a);c.insertNode(d)},j=function(){var a=h(this,!0);a.deleteContents()},l=function(a){var b=d.createRange();b.setStart(a),b.collapse(!1);var c=b.createContextualFragment(this.outerHTML());a.appendChild(c)},m=function(a){var b=d.createRange(),c=d.getElementById(this.end);b.setStartAfter(c),b.setEndAfter(c);var e=b.createContextualFragment(a);b.insertNode(e)},n=function(a){var b=d.createRange(),c=d.getElementById(this.start);b.setStartAfter(c),b.setEndAfter(c);var e=b.createContextualFragment(a);b.insertNode(e)};else{var q={select:[1,"<select multiple='multiple'>","</select>"],fieldset:[1,"<fieldset>","</fieldset>"],table:[1,"<table>","</table>"],tbody:[2,"<table><tbody>","</tbody></table>"],tr:[3,"<table><tbody><tr>","</tr></tbody></table>"],colgroup:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],map:[1,"<map>","</map>"],_default:[0,"",""]},r=function(a,b){var c=q[a.tagName.toLowerCase()]||q._default,e=c[0],g=c[1],h=c[2];f&&(b="­"+b);var i=d.createElement("div");i.innerHTML=g+b+h;for(var j=0;j<=e;j++)i=i.firstChild;if(f){var k=i;while(k.nodeType===1&&!k.nodeName)k=k.firstChild;k.nodeType===3&&k.nodeValue.charAt(0)===""&&(k.nodeValue=k.nodeValue.slice(1))}return i},s=function(a){while(a.parentNode.tagName==="")a=a.parentNode;return a},t=function(a,b){a.parentNode!==b.parentNode&&b.parentNode.insertBefore(a,b.parentNode.firstChild)};i=function(a,b){var c=s(d.getElementById(this.start)),e=d.getElementById(this.end),f=e.parentNode,g,h,i;t(c,e),g=c.nextSibling;while(g){h=g.nextSibling,i=g===e;if(i){if(!b)break;e=g.nextSibling}g.parentNode.removeChild(g);if(i)break;g=h}g=r(c.parentNode,a);while(g)h=g.nextSibling,f.insertBefore(g,e),g=h},j=function(){var a=s(d.getElementById(this.start)),b=d.getElementById(this.end);this.html(""),a.parentNode.removeChild(a),b.parentNode.removeChild(b)},l=function(a){var b=r(a,this.outerHTML());while(b)nextSibling=b.nextSibling,a.appendChild(b),b=nextSibling},m=function(a){var b=d.getElementById(this.end),c=b.nextSibling,e=b.parentNode,f,g;g=r(e,a);while(g)f=g.nextSibling,e.insertBefore(g,c),g=f},n=function(a){var b=d.getElementById(this.start),c=b.parentNode,e,f;f=r(c,a);var g=b.nextSibling;while(f)e=f.nextSibling,c.insertBefore(f,g),f=e}}g.prototype.html=function(a){this.checkRemoved();if(a===undefined)return this.innerHTML;i.call(this,a),this.innerHTML=a},g.prototype.replaceWith=function(a){this.checkRemoved(),i.call(this,a,!0)},g.prototype.remove=j,g.prototype.outerHTML=k,g.prototype.appendTo=l,g.prototype.after=m,g.prototype.prepend=n,g.prototype.startTag=o,g.prototype.endTag=p,g.prototype.isRemoved=function(){var a=d.getElementById(this.start),b=d.getElementById(this.end);return!a||!b},g.prototype.checkRemoved=function(){if(this.isRemoved())throw new Error("Cannot perform operations on a Metamorph that is not in the DOM.")},a.Metamorph=g})(this)}(),function(){var a=Ember.create,b=Ember.imports.Handlebars;Ember.Handlebars=a(b),Ember.Handlebars.helpers=a(b.helpers),Ember.Handlebars.Compiler=function(){},b.Compiler&&(Ember.Handlebars.Compiler.prototype=a(b.Compiler.prototype)),Ember.Handlebars.Compiler.prototype.compiler=Ember.Handlebars.Compiler,Ember.Handlebars.JavaScriptCompiler=function(){},b.JavaScriptCompiler&&(Ember.Handlebars.JavaScriptCompiler.prototype=a(b.JavaScriptCompiler.prototype),Ember.Handlebars.JavaScriptCompiler.prototype.compiler=Ember.Handlebars.JavaScriptCompiler),Ember.Handlebars.JavaScriptCompiler.prototype.namespace="Ember.Handlebars",Ember.Handlebars.JavaScriptCompiler.prototype.initializeBuffer=function(){return"''"},Ember.Handlebars.JavaScriptCompiler.prototype.appendToBuffer=function(a){return"data.buffer.push("+a+");"},Ember.Handlebars.Compiler.prototype.mustache=function(a){if(a.params.length||a.hash)return b.Compiler.prototype.mustache.call(this,a);var c=new b.AST.IdNode(["_triageMustache"]);return a.escaped||(a.hash=a.hash||new b.AST.HashNode([]),a.hash.pairs.push(["unescaped",new b.AST.StringNode("true")])),a=new b.AST.MustacheNode([c].concat([a.id]),a.hash,!a.escaped),b.Compiler.prototype.mustache.call(this,a)},Ember.Handlebars.precompile=function(a){var c=b.parse(a),d={knownHelpers:{action:!0,unbound:!0,bindAttr:!0,template:!0,view:!0,_triageMustache:!0},data:!0,stringParams:!0},e=(new Ember.Handlebars.Compiler).compile(c,d);return(new Ember.Handlebars.JavaScriptCompiler).compile(e,d,undefined,!0)},b.compile&&(Ember.Handlebars.compile=function(a){var c=b.parse(a),d={data:!0,stringParams:!0},e=(new Ember.Handlebars.Compiler).compile(c,d),f=(new Ember.Handlebars.JavaScriptCompiler).compile(e,d,undefined,!0);return b.template(f)});var c=Ember.Handlebars.normalizePath=function(a,b,c){var d=c&&c.keywords||{},e,f;return e=b.split(".",1)[0],d.hasOwnProperty(e)&&(a=d[e],f=!0,b===e?b="":b=b.substr(e.length+1)),{root:a,path:b,isKeyword:f}};Ember.Handlebars.get=function(a,b,d){var e=d&&d.data,f=c(a,b,e),g;return a=f.root,b=f.path,g=Ember.get(a,b),g===undefined&&a!==Ember.lookup&&Ember.isGlobalPath(b)&&(g=Ember.get(Ember.lookup,b)),g},Ember.Handlebars.getPath=Ember.deprecateFunc("`Ember.Handlebars.getPath` has been changed to `Ember.Handlebars.get` for consistency.",Ember.Handlebars.get),Ember.Handlebars.registerHelper("helperMissing",function(a,b){var c,d="";throw c="%@ Handlebars error: Could not find property '%@' on object %@.",b.data&&(d=b.data.view),new Ember.Error(Ember.String.fmt(c,[d,a,this]))})}(),function(){Ember.String.htmlSafe=function(a){return new Handlebars.SafeString(a)};var a=Ember.String.htmlSafe;if(Ember.EXTEND_PROTOTYPES===!0||Ember.EXTEND_PROTOTYPES.String)String.prototype.htmlSafe=function(){return a(this)}}(),function(){var a=Ember.set,b=Ember.get,c={remove:function(a){a.morph.remove()},prepend:function(a,b){a.morph.prepend(b)},after:function(a,b){a.morph.after(b)},html:function(a,b){a.morph.html(b)},replace:function(a){var c=a.morph;a.transitionTo("preRender"),a.clearRenderedChildren();var d=a.renderToBuffer();Ember.run.schedule("render",this,function(){if(b(a,"isDestroyed"))return;a.invalidateRecursively("element"),a._notifyWillInsertElement(),c.replaceWith(d.string()),a.transitionTo("inDOM"),a._notifyDidInsertElement()})},empty:function(a){a.morph.html("")}};Ember._Metamorph=Ember.Mixin
.create({isVirtual:!0,tagName:"",instrumentName:"render.metamorph",init:function(){this._super(),this.morph=Metamorph()},beforeRender:function(a){a.push(this.morph.startTag())},afterRender:function(a){a.push(this.morph.endTag())},createElement:function(){var a=this.renderToBuffer();this.outerHTML=a.string(),this.clearBuffer()},domManager:c}),Ember._MetamorphView=Ember.View.extend(Ember._Metamorph),Ember._SimpleMetamorphView=Ember.CoreView.extend(Ember._Metamorph)}(),function(){var a=Ember.get,b=Ember.set,c=Ember.Handlebars.get;Ember._SimpleHandlebarsView=Ember._SimpleMetamorphView.extend({instrumentName:"render.simpleHandlebars",normalizedValue:Ember.computed(function(){var b=a(this,"path"),d=a(this,"pathRoot"),e,f;return b===""?e=d:(f=a(this,"templateData"),e=c(d,b,{data:f})),e}).property("path","pathRoot").volatile(),render:function(b){var c=a(this,"isEscaped"),d=a(this,"normalizedValue");d===null||d===undefined?d="":d instanceof Handlebars.SafeString||(d=String(d)),c&&(d=Handlebars.Utils.escapeExpression(d)),b.push(d);return},rerender:function(){switch(this.state){case"preRender":case"destroyed":break;case"inBuffer":throw new Error("Something you did tried to replace an {{expression}} before it was inserted into the DOM.");case"hasElement":case"inDOM":this.domManager.replace(this)}return this},transitionTo:function(a){this.state=a}}),Ember._HandlebarsBoundView=Ember._MetamorphView.extend({instrumentName:"render.boundHandlebars",shouldDisplayFunc:null,preserveContext:!1,previousContext:null,displayTemplate:null,inverseTemplate:null,path:null,pathRoot:null,normalizedValue:Ember.computed(function(){var b=a(this,"path"),d=a(this,"pathRoot"),e=a(this,"valueNormalizerFunc"),f,g;return b===""?f=d:(g=a(this,"templateData"),f=c(d,b,{data:g})),e?e(f):f}).property("path","pathRoot","valueNormalizerFunc").volatile(),rerenderIfNeeded:function(){!a(this,"isDestroyed")&&a(this,"normalizedValue")!==this._lastNormalizedValue&&this.rerender()},render:function(c){var d=a(this,"isEscaped"),e=a(this,"shouldDisplayFunc"),f=a(this,"preserveContext"),g=a(this,"previousContext"),h=a(this,"inverseTemplate"),i=a(this,"displayTemplate"),j=a(this,"normalizedValue");this._lastNormalizedValue=j;if(e(j)){b(this,"template",i);if(f)b(this,"_context",g);else{if(!i){j===null||j===undefined?j="":j instanceof Handlebars.SafeString||(j=String(j)),d&&(j=Handlebars.Utils.escapeExpression(j)),c.push(j);return}b(this,"_context",j)}}else h?(b(this,"template",h),f?b(this,"_context",g):b(this,"_context",j)):b(this,"template",function(){return""});return this._super(c)}})}(),function(){function i(a,b,c,f,g){var h=b.data,i=b.fn,j=b.inverse,k=h.view,l=this,m,n,o;o=e(l,a,h),m=o.root,n=o.path;if("object"==typeof this){var p=k.createChildView(Ember._HandlebarsBoundView,{preserveContext:c,shouldDisplayFunc:f,valueNormalizerFunc:g,displayTemplate:i,inverseTemplate:j,path:n,pathRoot:m,previousContext:l,isEscaped:!b.hash.unescaped,templateData:b.data});k.appendChild(p);var q=function(){Ember.run.scheduleOnce("render",p,"rerenderIfNeeded")};n!==""&&(Ember.addObserver(m,n,q),k.one("willClearRender",function(){Ember.removeObserver(m,n,q)}))}else h.buffer.push(d(m,n,b))}function j(a,b){var c=b.data,f=c.view,g=this,h,i,j;j=e(g,a,c),h=j.root,i=j.path;if("object"==typeof this){var k=Ember._SimpleHandlebarsView.create().setProperties({path:i,pathRoot:h,isEscaped:!b.hash.unescaped,previousContext:g,templateData:b.data});f.createChildView(k),f.appendChild(k);var l=function(){Ember.run.scheduleOnce("render",k,"rerender")};i!==""&&(Ember.addObserver(h,i,l),f.one("willClearRender",function(){Ember.removeObserver(h,i,l)}))}else c.buffer.push(d(h,i,b))}var a=Ember.get,b=Ember.set,c=Ember.String.fmt,d=Ember.Handlebars.get,e=Ember.Handlebars.normalizePath,f=Ember.ArrayPolyfills.forEach,g=Ember.Handlebars,h=g.helpers;g.registerHelper("_triageMustache",function(a,b){return h[a]?h[a].call(this,b):h.bind.apply(this,arguments)}),g.registerHelper("bind",function(a,b){var c=b.contexts&&b.contexts[0]||this;return b.fn?i.call(c,a,b,!1,function(a){return!Ember.none(a)}):j.call(c,a,b)}),g.registerHelper("boundIf",function(b,c){var d=c.contexts&&c.contexts[0]||this,e=function(b){return Ember.typeOf(b)==="array"?a(b,"length")!==0:!!b};return i.call(d,b,c,!0,e,e)}),g.registerHelper("with",function(a,b){if(arguments.length===4){var c,d,f,g;b=arguments[3],c=arguments[2],d=arguments[0];if(Ember.isGlobalPath(d))Ember.bind(b.data.keywords,c,d);else{g=e(this,d,b.data),d=g.path,f=g.root;var j=Ember.$.expando+Ember.guidFor(f);b.data.keywords[j]=f;var k=d?j+"."+d:j;Ember.bind(b.data.keywords,c,k)}return i.call(this,d,b,!0,function(a){return!Ember.none(a)})}return h.bind.call(b.contexts[0],a,b)}),g.registerHelper("if",function(a,b){return h.boundIf.call(b.contexts[0],a,b)}),g.registerHelper("unless",function(a,b){var c=b.fn,d=b.inverse;return b.fn=d,b.inverse=c,h.boundIf.call(b.contexts[0],a,b)}),g.registerHelper("bindAttr",function(a){var b=a.hash,c=a.data.view,h=[],i=this,j=++Ember.uuid,k=b["class"];if(k!==null&&k!==undefined){var l=g.bindClasses(this,k,c,j,a);h.push('class="'+Handlebars.Utils.escapeExpression(l.join(" "))+'"'),delete b["class"]}var m=Ember.keys(b);return f.call(m,function(f){var g=b[f],k,l;l=e(i,g,a.data),k=l.root,g=l.path;var m=g==="this"?k:d(k,g,a),n=Ember.typeOf(m),o,p;o=function(){var e=d(k,g,a),h=c.$("[data-bindattr-"+j+"='"+j+"']");if(!h||h.length===0){Ember.removeObserver(k,g,p);return}Ember.View.applyAttributeBindings(h,f,e)},p=function(){Ember.run.scheduleOnce("render",o)},g!=="this"&&(Ember.addObserver(k,g,p),c.one("willClearRender",function(){Ember.removeObserver(k,g,p)})),n==="string"||n==="number"&&!isNaN(m)?h.push(f+'="'+Handlebars.Utils.escapeExpression(m)+'"'):m&&n==="boolean"&&h.push(f+'="'+f+'"')},this),h.push("data-bindattr-"+j+'="'+j+'"'),new g.SafeString(h.join(" "))}),g.bindClasses=function(a,b,c,g,h){var i=[],j,k,l,m=function(a,b,c){var e,f=b.path;return f==="this"?e=a:f===""?e=!0:e=d(a,f,c),Ember.View._classStringForValue(f,e,b.className,b.falsyClassName)};return f.call(b.split(" "),function(b){var d,f,n,o=Ember.View._parsePropertyPath(b),p=o.path,q=a,r;p!==""&&p!=="this"&&(r=e(a,p,h.data),q=r.root,p=r.path),f=function(){j=m(q,o,h),l=g?c.$("[data-bindattr-"+g+"='"+g+"']"):c.$(),!l||l.length===0?Ember.removeObserver(q,p,n):(d&&l.removeClass(d),j?(l.addClass(j),d=j):d=null)},n=function(){Ember.run.scheduleOnce("render",f)},p!==""&&p!=="this"&&(Ember.addObserver(q,p,n),c.one("willClearRender",function(){Ember.removeObserver(q,p,n)})),k=m(q,o,h),k&&(i.push(k),d=k)}),i}}(),function(){var a=Ember.get,b=Ember.set,c=/^parentView\./,d=Ember.Handlebars;d.ViewHelper=Ember.Object.create({propertiesFromHTMLOptions:function(a,b){var c=a.hash,d=a.data,e={},f=c["class"],g=!1;c.id&&(e.elementId=c.id,g=!0),f&&(f=f.split(" "),e.classNames=f,g=!0),c.classBinding&&(e.classNameBindings=c.classBinding.split(" "),g=!0),c.classNameBindings&&(e.classNameBindings===undefined&&(e.classNameBindings=[]),e.classNameBindings=e.classNameBindings.concat(c.classNameBindings.split(" ")),g=!0),c.attributeBindings&&(e.attributeBindings=null,g=!0),g&&(c=Ember.$.extend({},c),delete c.id,delete c["class"],delete c.classBinding);var h;for(var i in c){if(!c.hasOwnProperty(i))continue;Ember.IS_BINDING.test(i)&&typeof c[i]=="string"&&(h=this.contextualizeBindingPath(c[i],d),h&&(c[i]=h))}if(e.classNameBindings)for(var j in e.classNameBindings){var k=e.classNameBindings[j];if(typeof k=="string"){var l=Ember.View._parsePropertyPath(k);h=this.contextualizeBindingPath(l.path,d),h&&(e.classNameBindings[j]=h+l.classNames)}}return e.bindingContext=b,Ember.$.extend(c,e)},contextualizeBindingPath:function(a,b){var c=Ember.Handlebars.normalizePath(null,a,b);return c.isKeyword?"templateData.keywords."+a:Ember.isGlobalPath(a)?null:a==="this"?"bindingContext":"bindingContext."+a},helper:function(a,b,c){var e=c.inverse,f=c.data,g=f.view,h=c.fn,i=c.hash,j;"string"==typeof b?j=d.get(a,b,c):j=b;var k=this.propertiesFromHTMLOptions(c,a),l=f.view;k.templateData=c.data,h&&(k.template=h),!j.proto().controller&&!j.proto().controllerBinding&&!k.controller&&!k.controllerBinding&&(k._context=a),l.appendChild(j,k)}}),d.registerHelper("view",function(a,b){return a&&a.data&&a.data.isRenderData&&(b=a,a="Ember.View"),d.ViewHelper.helper(this,a,b)})}(),function(){var a=Ember.get,b=Ember.Handlebars.get,c=Ember.String.fmt;Ember.Handlebars.registerHelper("collection",function(c,d){c&&c.data&&c.data.isRenderData&&(d=c,c=undefined);var e=d.fn,f=d.data,g=d.inverse,h;h=c?b(this,c,d):Ember.CollectionView;var i=d.hash,j={},k,l,m=i.itemViewClass,n=h.proto();delete i.itemViewClass,l=m?b(n,m,d):n.itemViewClass;for(var o in i)i.hasOwnProperty(o)&&(k=o.match(/^item(.)(.*)$/),k&&(j[k[1].toLowerCase()+k[2]]=i[o],delete i[o]));var p=i.tagName||n.tagName;e&&(j.template=e,delete d.fn);var q;g&&g!==Handlebars.VM.noop?(q=a(n,"emptyViewClass"),q=q.extend({template:g,tagName:j.tagName})):i.emptyViewClass&&(q=b(this,i.emptyViewClass,d)),i.emptyView=q,i.eachHelper==="each"&&(j._context=Ember.computed(function(){return a(this,"content")}).property("content"),delete i.eachHelper);var r=Ember.Handlebars.ViewHelper.propertiesFromHTMLOptions({data:f,hash:j},this);return i.itemViewClass=l.extend(r),Ember.Handlebars.helpers.view.call(this,h,d)})}(),function(){var a=Ember.Handlebars.get;Ember.Handlebars.registerHelper("unbound",function(b,c){var d=c.contexts&&c.contexts[0]||this;return a(d,b,c)})}(),function(){var a=Ember.Handlebars.get,b=Ember.Handlebars.normalizePath;Ember.Handlebars.registerHelper("log",function(c,d){var e=d.contexts&&d.contexts[0]||this,f=b(e,c,d.data),g=f.root,h=f.path,i=h==="this"?g:a(g,h,d);Ember.Logger.log(i)}),Ember.Handlebars.registerHelper("debugger",function(){debugger})}(),function(){var a=Ember.get,b=Ember.set;Ember.Handlebars.EachView=Ember.CollectionView.extend(Ember._Metamorph,{itemViewClass:Ember._MetamorphView,emptyViewClass:Ember._MetamorphView,createChildView:function(c,d){c=this._super(c,d);var e=a(this,"keyword");if(e){var f=a(c,"templateData");f=Ember.copy(f),f.keywords=c.cloneKeywords(),b(c,"templateData",f);var g=a(c,"content");f.keywords[e]=g}return c}}),Ember.Handlebars.registerHelper("each",function(a,b){if(arguments.length===4){var c=arguments[0];b=arguments[3],a=arguments[2],a===""&&(a="this"),b.hash.keyword=c}else b.hash.eachHelper="each";return b.hash.contentBinding=a,Ember.Handlebars.helpers.collection.call(this,"Ember.Handlebars.EachView",b)})}(),function(){Ember.Handlebars.registerHelper("template",function(a,b){var c=Ember.TEMPLATES[a];Ember.TEMPLATES[a](this,{data:b.data})})}(),function(){var a=Ember.Handlebars,b=a.get,c=Ember.get,d=Array.prototype.slice,e=a.ActionHelper={registeredActions:{}};e.registerAction=function(a,b){var c=(++Ember.uuid).toString();return e.registeredActions[c]={eventName:b.eventName,handler:function(c){var d=c.shiftKey||c.metaKey||c.altKey||c.ctrlKey,e=c.which>1,f=d||e;if(b.link&&f)return;c.preventDefault(),c.view=b.view,b.hasOwnProperty("context")&&(c.context=b.context),b.hasOwnProperty("contexts")&&(c.contexts=b.contexts);var g=b.target;return g.isState&&typeof g.send=="function"?g.send(a,c):g[a].call(g,c)}},b.view.on("willClearRender",function(){delete e.registeredActions[c]}),c},a.registerHelper("action",function(f){var g=arguments[arguments.length-1],h=d.call(arguments,1,-1),i=g.hash,j=g.data.view,k,l,m,n={eventName:i.on||"click"};n.view=j=c(j,"concreteView");if(i.target)k=b(this,i.target,g);else if(l=g.data.keywords.controller)k=c(l,"target");n.target=k=k||j,h.length&&(n.contexts=h=Ember.EnumerableUtils.map(h,function(a){return b(this,a,g)},this),n.context=h[0]);var o=[],p;i.href&&k.urlForEvent&&(p=k.urlForEvent.apply(k,[f].concat(h)),o.push('href="'+p+'"'),n.link=!0);var q=e.registerAction(f,n);return o.push('data-ember-action="'+q+'"'),new a.SafeString(o.join(" "))})}(),function(){var a=Ember.get,b=Ember.set;Ember.Handlebars.registerHelper("yield",function(b){var c=b.data.view,d;while(c&&!a(c,"layout"))c=a(c,"parentView");d=a(c,"template"),d&&d(this,b)})}(),function(){Ember.Handlebars.OutletView=Ember.ContainerView.extend(Ember._Metamorph),Ember.Handlebars.registerHelper("outlet",function(a,b){return a&&a.data&&a.data.isRenderData&&(b=a,a="view"),b.hash.currentViewBinding="view.context."+a,Ember.Handlebars.helpers.view.call(this,Ember.Handlebars.OutletView,b)})}(),function(){}(),function(){}(),function(){var a=Ember.set,b=Ember.get;Ember.Checkbox=Ember.View.extend({classNames:["ember-checkbox"],tagName:"input",attributeBindings:["type","checked","disabled","tabindex"],type:"checkbox",checked:!1,disabled:!1,init:function(){this._super(),this.on("change",this,this._updateElementValue)},_updateElementValue:function(){a(this,"checked",this.$().prop("checked"))}})}(),function(){var a=Ember.get,b=Ember.set;Ember.TextSupport=Ember.Mixin.create({value:"",attributeBindings:["placeholder","disabled","maxlength","tabindex"],placeholder:null,disabled:!1,maxlength:null,insertNewline:Ember.K,cancel:Ember.K,init:function(){this._super(),this.on("focusOut",this,this._elementValueDidChange),this.on("change",this,this._elementValueDidChange),this.on("keyUp",this,this.interpretKeyEvents)},interpretKeyEvents:function(a){var b=Ember.TextSupport.KEY_EVENTS,c=b[a.keyCode];this._elementValueDidChange();if(c)return this[c](a)},_elementValueDidChange:function(){b(this,"value",this.$().val())}}),Ember.TextSupport.KEY_EVENTS={13:"insertNewline",27:"cancel"}}(),function(){var a=Ember.get,b=Ember.set;Ember.TextField=Ember.View.extend(Ember.TextSupport,{classNames:["ember-text-field"],tagName:"input",attributeBindings:["type","value","size"],value:"",type:"text",size:null})}(),function(){var a=Ember.get,b=Ember.set;Ember.Button=Ember.View.extend(Ember.TargetActionSupport,{classNames:["ember-button"],classNameBindings:["isActive"],tagName:"button",propagateEvents:!1,attributeBindings:["type","disabled","href","tabindex"],targetObject:Ember.computed(function(){var b=a(this,"target"),c=a(this,"context"),d=a(this,"templateData");return typeof b!="string"?b:Ember.Handlebars.get(c,b,{data:d})}).property("target"),type:Ember.computed(function(a,b){var c=this.get("tagName");b!==undefined&&(this._type=b);if(this._type!==undefined)return this._type;if(c==="input"||c==="button")return"button"}).property("tagName"),disabled:!1,href:Ember.computed(function(){return this.get("tagName")==="a"?"#":null}).property("tagName"),mouseDown:function(){return a(this,"disabled")||(b(this,"isActive",!0),this._mouseDown=!0,this._mouseEntered=!0),a(this,"propagateEvents")},mouseLeave:function(){this._mouseDown&&(b(this,"isActive",!1),this._mouseEntered=!1)},mouseEnter:function(){this._mouseDown&&(b(this,"isActive",!0),this._mouseEntered=!0)},mouseUp:function(c){return a(this,"isActive")&&(this.triggerAction(),b(this,"isActive",!1)),this._mouseDown=!1,this._mouseEntered=!1,a(this,"propagateEvents")},keyDown:function(a){(a.keyCode===13||a.keyCode===32)&&this.mouseDown()},keyUp:function(a){(a.keyCode===13||a.keyCode===32)&&this.mouseUp()},touchStart:function(a){return this.mouseDown(a)},touchEnd:function(a){return this.mouseUp(a)},init:function(){this._super()}})}(),function(){var a=Ember.get,b=Ember.set;Ember.TextArea=Ember.View.extend(Ember.TextSupport,{classNames:["ember-text-area"],tagName:"textarea",attributeBindings:["rows","cols"],rows:null,cols:null,_updateElementValue:Ember.observer(function(){var b=a(this,"value"),c=this.$();c&&b!==c.val()&&c.val(b)},"value"),init:function(){this._super(),this.on("didInsertElement",this,this._updateElementValue)}})}(),function(){Ember.TabContainerView=Ember.View.extend({init:function(){this._super()}})}(),function(){var a=Ember.get;Ember.TabPaneView=Ember.View.extend({tabsContainer:Ember.computed(function(){return this.nearestOfType(Ember.TabContainerView)}).property().volatile(),isVisible:Ember.computed(function(){return a(this,"viewName")===a(this,"tabsContainer.currentView")}).property("tabsContainer.currentView").volatile(),init:function(){this._super()}})}(),function(){var a=Ember.get,b=Ember.setPath;Ember.TabView=Ember.View.extend({tabsContainer:Ember.computed(function(){return this.nearestInstanceOf(Ember.TabContainerView)}).property().volatile(),mouseUp:function(){b(this,"tabsContainer.currentView",a(this,"value"))},init:function(){this._super()}})}(),function(){}(),function(){var a=Ember.set,b=Ember.get,c=Ember.EnumerableUtils.indexOf,d=Ember.EnumerableUtils.indexesOf,e=Ember.EnumerableUtils.replace,f=Ember.isArray;Ember.Select=Ember.View.extend({tagName:"select",classNames:["ember-select"],defaultTemplate:Ember.Handlebars.template(function(b,c,d,e,f){function q(a,b){var c="",e,f,g,h;return b.buffer.push("<option value>"),e=a,f="view.prompt",g={},h="true",g.escaped=h,h=d._triageMustache||a._triageMustache,k={},k.hash=g,k.contexts=[],k.contexts.push(e),k.data=b,typeof h===m?e=h.call(a,f,k):h===o?e=n.call(a,"_triageMustache",f,k):e=h,b.buffer.push(p(e)+"</option>"),c}function r(a,b){var c,e,f,g;c=a,e="Ember.SelectOption",f={},g="this",f.contentBinding=g,g=d.view||a.view,k={},k.hash=f,k.contexts=[],k.contexts.push(c),k.data=b,typeof g===m?c=g.call(a,e,k):g===o?c=n.call(a,"view",e,k):c=g,b.buffer.push(p(c))}d=d||Ember.Handlebars.helpers;var g="",h,i,j,k,l=this,m="function",n=d.helperMissing,o=void 0,p=this.escapeExpression;return h=c,i="view.prompt",j=d["if"],k=l.program(1,q,f),k.hash={},k.contexts=[],k.contexts.push(h),k.fn=k,k.inverse=l.noop,k.data=f,h=j.call(c,i,k),(h||h===0)&&f.buffer.push(h),h=c,i="view.content",j=d.each,k=l.program(3,r,f),k.hash={},k.contexts=[],k.contexts.push(h),k.fn=k,k.inverse=l.noop,k.data=f,h=j.call(c,i,k),(h||h===0)&&f.buffer.push(h),g}),attributeBindings:["multiple","disabled","tabindex"],multiple:!1,disabled:!1,content:null,selection:null,value:Ember.computed(function(a,c){if(arguments.length===2)return c;var d=b(this,"optionValuePath").replace(/^content\.?/,"");return d?b(this,"selection."+d):b(this,"selection")}).property("selection"),prompt:null,optionLabelPath:"content",optionValuePath:"content",_change:function(){b(this,"multiple")?this._changeMultiple():this._changeSingle()},selectionDidChange:Ember.observer(function(){var c=b(this,"selection");if(b(this,"multiple")){if(!f(c)){a(this,"selection",Ember.A([c]));return}this._selectionDidChangeMultiple()}else this._selectionDidChangeSingle()},"selection.@each"),valueDidChange:Ember.observer(function(){var a=b(this,"content"),c=b(this,"value"),d=b(this,"optionValuePath").replace(/^content\.?/,""),e=d?b(this,"selection."+d):b(this,"selection"),f;c!==e&&(f=a.find(function(a){return c===(d?b(a,d):a)}),this.set("selection",f))},"value"),_triggerChange:function(){var a=b(this,"selection"),c=b(this,"value");a&&this.selectionDidChange(),c&&this.valueDidChange(),this._change()},_changeSingle:function(){var c=this.$()[0].selectedIndex,d=b(this,"content"),e=b(this,"prompt");if(!d)return;if(e&&c===0){a(this,"selection",null);return}e&&(c-=1),a(this,"selection",d.objectAt(c))},_changeMultiple:function(){var c=this.$("option:selected"),d=b(this,"prompt"),g=d?1:0,h=b(this,"content"),i=b(this,"selection");if(!h)return;if(c){var j=c.map(function(){return this.index-g}).toArray(),k=h.objectsAt(j);f(i)?e(i,0,b(i,"length"),k):a(this,"selection",k)}},_selectionDidChangeSingle:function(){var a=this.get("element");if(!a)return;var d=b(this,"content"),e=b(this,"selection"),f=d?c(d,e):-1,g=b(this,"prompt");g&&(f+=1),a&&(a.selectedIndex=f)},_selectionDidChangeMultiple:function(){var a=b(this,"content"),e=b(this,"selection"),f=a?d(a,e):[-1],g=b(this,"prompt"),h=g?1:0,i=this.$("option"),j;i&&i.each(function(){j=this.index>-1?this.index-h:-1,this.selected=c(f,j)>-1})},init:function(){this._super(),this.on("didInsertElement",this,this._triggerChange),this.on("change",this,this._change)}}),Ember.SelectOption=Ember.View.extend({tagName:"option",attributeBindings:["value","selected"],defaultTemplate:function(a,b){b={data:b.data,hash:{}},Ember.Handlebars.helpers.bind.call(a,"view.label",b)},init:function(){this.labelPathDidChange(),this.valuePathDidChange(),this._super()},selected:Ember.computed(function(){var a=b(this,"content"),d=b(this,"parentView.selection");return b(this,"parentView.multiple")?d&&c(d,a.valueOf())>-1:a==d}).property("content","parentView.selection").volatile(),labelPathDidChange:Ember.observer(function(){var a=b(this,"parentView.optionLabelPath");if(!a)return;Ember.defineProperty(this,"label",Ember.computed(function(){return b(this,a)}).property(a))},"parentView.optionLabelPath"),valuePathDidChange:Ember.observer(function(){var a=b(this,"parentView.optionValuePath");if(!a)return;Ember.defineProperty(this,"value",Ember.computed(function(){return b(this,a)}).property(a))},"parentView.optionValuePath")})}(),function(){}(),function(){function a(){Ember.Handlebars.bootstrap(Ember.$(document))}Ember.Handlebars.bootstrap=function(a){var b='script[type="text/x-handlebars"], script[type="text/x-raw-handlebars"]';Ember.$(b,a).each(function(){var a=Ember.$(this),b=a.attr("type"),c=a.attr("type")==="text/x-raw-handlebars"?Ember.$.proxy(Handlebars.compile,Handlebars):Ember.$.proxy(Ember.Handlebars.compile,Ember.Handlebars),d=a.attr("data-template-name")||a.attr("id")||"application",e=c(a.html());Ember.TEMPLATES[d]=e,a.remove()})},Ember.onLoad("application",a)}(),function(){}();
|
import { Effect } from "../../Materials/effect";
var name = 'bonesDeclaration';
var shader = "#if NUM_BONE_INFLUENCERS>0\n#ifdef BONETEXTURE\nuniform sampler2D boneSampler;\nuniform float boneTextureWidth;\n#else\nuniform mat4 mBones[BonesPerMesh];\n#ifdef BONES_VELOCITY_ENABLED\nuniform mat4 mPreviousBones[BonesPerMesh];\n#endif\n#endif\nattribute vec4 matricesIndices;\nattribute vec4 matricesWeights;\n#if NUM_BONE_INFLUENCERS>4\nattribute vec4 matricesIndicesExtra;\nattribute vec4 matricesWeightsExtra;\n#endif\n#ifdef BONETEXTURE\n#define inline\nmat4 readMatrixFromRawSampler(sampler2D smp,float index)\n{\nfloat offset=index*4.0;\nfloat dx=1.0/boneTextureWidth;\nvec4 m0=texture2D(smp,vec2(dx*(offset+0.5),0.));\nvec4 m1=texture2D(smp,vec2(dx*(offset+1.5),0.));\nvec4 m2=texture2D(smp,vec2(dx*(offset+2.5),0.));\nvec4 m3=texture2D(smp,vec2(dx*(offset+3.5),0.));\nreturn mat4(m0,m1,m2,m3);\n}\n#endif\n#endif";
Effect.IncludesShadersStore[name] = shader;
/** @hidden */
export var bonesDeclaration = { name: name, shader: shader };
//# sourceMappingURL=bonesDeclaration.js.map
|
import React, { Component } from 'react';
import { ExperimentsWithRouter } from './experiments/Experiments';
import { BenchmarksWithRouter } from './benchmarks/Benchmarks';
import { Route, Switch } from 'react-router-dom';
class App extends Component {
constructor(props) {
super(props);
// Store selected experiment here
this.state = { page: null };
this.selectExperiments = this.selectExperiments.bind(this);
this.selectBenchmarks = this.selectBenchmarks.bind(this);
}
render() {
return (
<Switch>
<Route exact path="/" component={ExperimentsWithRouter} />
<Route exact path="/benchmarks" component={BenchmarksWithRouter} />
<Route
exact
path="/benchmarks/:page"
component={BenchmarksWithRouter}
/>
<Route path="/:page" component={ExperimentsWithRouter} />
</Switch>
);
}
selectExperiments() {
this.setState({ page: 'experiments' });
}
selectBenchmarks() {
this.setState({ page: 'benchmarks' });
}
}
export default App;
|
// (C) Copyright 2014-2015 Hewlett Packard Enterprise Development LP
import React, { Component, PropTypes } from 'react';
import classnames from 'classnames';
import CSSClassnames from '../../../utils/CSSClassnames';
import Intl from '../../../utils/Intl';
import Props from '../../../utils/Props';
const CLASS_ROOT = CSSClassnames.CONTROL_ICON;
const COLOR_INDEX = CSSClassnames.COLOR_INDEX;
export default class Icon extends Component {
render () {
const { className, colorIndex } = this.props;
let { a11yTitle, size, responsive } = this.props;
let { intl } = this.context;
const classes = classnames(
CLASS_ROOT,
`${CLASS_ROOT}-cloud-upload`,
className,
{
[`${CLASS_ROOT}--${size}`]: size,
[`${CLASS_ROOT}--responsive`]: responsive,
[`${COLOR_INDEX}-${colorIndex}`]: colorIndex
}
);
a11yTitle = a11yTitle || Intl.getMessage(intl, 'cloud-upload');
const restProps = Props.omit(this.props, Object.keys(Icon.propTypes));
return <svg {...restProps} version="1.1" viewBox="0 0 24 24" width="24px" height="24px" role="img" className={classes} aria-label={a11yTitle}><path fill="none" stroke="#000000" strokeWidth="2" d="M6,17 C3.23857625,17 1,14.7614237 1,12 C1,9.23857625 3.23857625,7 6,7 L12,7 M6,7 L6,6 C6,3 8,2 11,2 L13,2 C16,2 18,3 18,6 L18,7 C20.7614237,7 23,9.23857625 23,12 C23,14.7614237 20.7614237,17 18,17 M12,13 L12,22 M8,16.0000004 L11.9653427,11.9653429 L16,16.0000002"/></svg>;
}
};
Icon.contextTypes = {
intl: PropTypes.object
};
Icon.defaultProps = {
responsive: true
};
Icon.displayName = 'CloudUpload';
Icon.icon = true;
Icon.propTypes = {
a11yTitle: PropTypes.string,
colorIndex: PropTypes.string,
size: PropTypes.oneOf(['small', 'medium', 'large', 'xlarge', 'huge']),
responsive: PropTypes.bool
};
|
const mongoose = require('mongoose')
const shortId = require('shortid')
const shortUrlSchema = new mongoose.Schema({
full: {
type: String,
required: true
},
short: {
type: String,
required: true,
default: shortId.generate
},
clicks: {
type: Number,
required: true,
default: 0
}
})
module.exports = mongoose.model('ShortUrl', shortUrlSchema)
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[44],{193:function(a,e,o){"use strict";o.r(e);var t=o(0),r=Object(t.a)({},function(){var a=this,e=a.$createElement,o=a._self._c||e;return o("ContentSlotsDistributor",{attrs:{"slot-key":a.$parent.slotKey}},[o("h1",{attrs:{id:"diferenca-entre-colunas"}},[a._v("Diferença entre colunas")]),a._v(" "),o("p",[a._v("A diferença é uma operação que exibe a diferença entre duas fontes de dados. O resultado contém os objetos da primeira fonte de dados que não estão na segunda fonte de dados.")]),a._v(" "),o("h3",{attrs:{id:"conectores"}},[a._v("Conectores")]),a._v(" "),o("table",[o("thead",[o("tr",[o("th",[a._v("Entrada")]),a._v(" "),o("th",[a._v("Saída")])])]),a._v(" "),o("tbody",[o("tr",[o("td",[a._v("Até duas fontes de dados.")]),a._v(" "),o("td",[a._v("Dados tratados")])])])]),a._v(" "),o("h3",{attrs:{id:"execucao"}},[a._v("Execução")]),a._v(" "),o("table",[o("thead",[o("tr",[o("th",[a._v("Parâmetro")]),a._v(" "),o("th",[a._v("Detalhe")])])]),a._v(" "),o("tbody",[o("tr",[o("td",[o("strong",[a._v("Prefixo para os atributos")])]),a._v(" "),o("td",[a._v("Os prefixos dos nomes das novas colunas na saída de dados da operação. (2 valores separados por vírgula)")])])])]),a._v(" "),o("p",[o("router-link",{attrs:{to:"/pt-br/spark/documentacao-geral/documentacao-geral.html#aba-aparencia"}},[a._v("Aba Aparência")])],1),a._v(" "),o("p",[o("router-link",{attrs:{to:"/pt-br/spark/documentacao-geral/documentacao-geral.html#aba-resultados"}},[a._v("Aba Resultados")])],1),a._v(" "),o("h2",{attrs:{id:"exemplo-de-utilizacao"}},[a._v("Exemplo de Utilização")]),a._v(" "),o("p",[o("strong",[a._v("Objetivo:")]),a._v(" Encontrar a diferença entre dois conjuntos de dados através da operação Diferença. "),o("br"),a._v(" "),o("strong",[a._v("Base de Dados:")]),a._v(" "),o("router-link",{attrs:{to:"/pt-br/spark/base-de-dados/#iris"}},[a._v("Íris")])],1),a._v(" "),o("p",[o("img",{attrs:{src:"/img/spark/manipulacao_de_dados/coluna_diferenca/image2.png",alt:"Ler dados"}})]),a._v(" "),o("ol",[o("li",[o("p",[a._v("Adicione uma base de dados por meio da operação "),o("router-link",{attrs:{to:"/pt-br/spark/entrada-e-saida/ler-dados.html"}},[a._v("Ler dados")]),a._v("."),o("br"),a._v(" "),o("img",{attrs:{src:"/img/spark/manipulacao_de_dados/coluna_diferenca/image4.png",alt:"Tabela - Ler dados"}})],1)]),a._v(" "),o("li",[o("p",[a._v("Adicione a operação "),o("strong",[a._v("Diferença entre colunas")]),a._v(".")])]),a._v(" "),o("li",[o("p",[a._v("Execute o fluxo e visualize o resultado."),o("br"),a._v(" "),o("img",{attrs:{src:"/img/spark/manipulacao_de_dados/coluna_diferenca/image3.png",alt:"Resultado"}}),o("br"),a._v("\nComo se trata de duas fontes de dados idênticas, o resultado gerado é vazio. Portanto, não há diferença entre as duas fontes de dados.")])])]),a._v(" "),o("hr"),a._v(" "),o("p",[a._v("Dúvidas e/ou sugestões envie um e-mail para suporte@lemonade.org.br")])])},[],!1,null,null,null);e.default=r.exports}}]);
|
import React, { useState } from 'react';
import { useQuery, gql } from '@apollo/client';
import LaunchItem from './LaunchItem/LaunchItem';
const LAUNCHES_QUERY = gql`
query LaunchesQuery {
launches {
flight_number
mission_name
launch_date_local
launch_success
}
}
`;
const Launches = () => {
const { loading, error, data } = useQuery(LAUNCHES_QUERY);
if (loading) return <p>Loading...</p>;
if (error) return <p>Error :(</p>;
return (
<>
{data.launches.map((launch) => {
return <LaunchItem key={launch.flight_number} launch={launch} />;
})}
</>
);
};
export default Launches;
|
export const INITIATE_FETCH = 'INITIATE_FETCH'
export const FETCH_SUCCESS = 'FETCH_SUCCESS'
export const FETCH_FAILED = 'FETCH_FAILED'
|
/**
* skylark-chartjs - A version of chartjs that ported to running on skylarkjs
* @author Hudaokeji, Inc.
* @version v0.9.2
* @link https://github.com/skylark-integration/skylark-chartjs/
* @license MIT
*/
define(["../core/core.defaults","./helpers.core"],function(t,e){"use strict";var exports={},module={exports:{}},i=t,r=e,n=r.valueOrDefault;function o(t){return"object"!=typeof t||Array.isArray(t)||!function(t){var e;for(e in t)return!1;return!0}(t)}return module.exports={toLineHeight:function(t,e){var i=(""+t).match(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/);if(!i||"normal"===i[1])return 1.2*e;switch(t=+i[2],i[3]){case"px":return t;case"%":t/=100}return e*t},toPadding:function(t){var e,i,n,o;return r.isObject(t)?(e=+t.top||0,i=+t.right||0,n=+t.bottom||0,o=+t.left||0):e=i=n=o=+t||0,{top:e,right:i,bottom:n,left:o,height:e+n,width:o+i}},_parseFont:function(t){var e=i.global,o=n(t.fontSize,e.defaultFontSize),l={family:n(t.fontFamily,e.defaultFontFamily),lineHeight:r.options.toLineHeight(n(t.lineHeight,e.defaultLineHeight),o),size:o,style:n(t.fontStyle,e.defaultFontStyle),weight:null,string:""};return l.string=function(t){return!t||r.isNullOrUndef(t.size)||r.isNullOrUndef(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(l),l},resolve:function(t,e,i){var n,o,l;for(n=0,o=t.length;n<o;++n)if(void 0!==(l=t[n])&&(void 0!==e&&"function"==typeof l&&(l=l(e)),void 0!==i&&r.isArray(l)&&(l=l[i]),void 0!==l))return l}},o(module.exports)?module.exports:o(exports)?exports:void 0});
//# sourceMappingURL=../sourcemaps/helpers/helpers.options.js.map
|
/* Use this script if you need to support IE 7 and IE 6. */
window.onload = function() {
function addIcon(el, entity) {
var html = el.innerHTML;
el.innerHTML = '<span style="font-family: \'Grands\'">' + entity + '</span>' + html;
}
var icons = {
'icon-YouTube' : '',
'icon-Yandex' : '',
'icon-Vkontakte' : '',
'icon-VK' : '',
'icon-vimeo' : '',
'icon-twitter' : '',
'icon-tumblr' : '',
'icon-Steam' : '',
'icon-StackOverflow' : '',
'icon-SoundCloud' : '',
'icon-Skype' : '',
'icon-Share' : '',
'icon-RSS' : '',
'icon-Readability' : '',
'icon-Read-it-Later' : '',
'icon-Pocket' : '',
'icon-Pinterest' : '',
'icon-Picasa' : '',
'icon-OpenID' : '',
'icon-MySpace' : '',
'icon-MoiKrug' : '',
'icon-Linked-in' : '',
'icon-LiveJournal' : '',
'icon-lastfm' : '',
'icon-Jabber' : '',
'icon-Instapaper' : '',
'icon-HabraHabr' : '',
'icon-google' : '',
'icon-GitHub-octoface' : '',
'icon-GitHub-circle' : '',
'icon-FourSquare' : '',
'icon-flickr' : '',
'icon-Flattr' : '',
'icon-facebook' : '',
'icon-Evernote' : '',
'icon-Email' : '',
'icon-DropBox' : '',
'icon-Blogspot' : '',
'icon-BitBucket' : '',
'icon-YouTube-play' : ''
},
els = document.getElementsByTagName('*'),
i, attr, html, c, el;
for (i = 0; i < els.length; i += 1) {
el = els[i];
attr = el.getAttribute('data-icon');
if (attr) {
addIcon(el, attr);
}
c = el.className;
c = c.match(/icon-[^\s'"]+/);
if (c) {
addIcon(el, icons[c[0]]);
}
}
};
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[68],{2899:function(e,t,n){"use strict";n.r(t),n.d(t,"icon",(function(){return c}));n(10),n(2),n(6),n(8),n(5),n(9);var r=n(0),l=n.n(r);function i(){return(i=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 o(e,t){if(null==e)return{};var n,r,l=function(e,t){if(null==e)return{};var n,r,l={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(l[n]=e[n]);return l}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(l[n]=e[n])}return l}var a=function(e){var t=e.title,n=e.titleId,r=o(e,["title","titleId"]);return l.a.createElement("svg",i({width:16,height:16,viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":n},r),t?l.a.createElement("title",{id:n},t):null,l.a.createElement("path",{fillRule:"evenodd",d:"M6.5 12a.502.502 0 01-.354-.146l-4-4a.502.502 0 01.708-.708L6.5 10.793l6.646-6.647a.502.502 0 01.708.708l-7 7A.502.502 0 016.5 12"}))},c=a;a.__docgenInfo={description:"",methods:[],displayName:"EuiIconCheck"}}}]);
//# sourceMappingURL=icon.check-js.min.js.map
|
'use strict';
module.exports = {
db: 'mongodb://localhost/map-dev',
app: {
title: 'Map - Development Environment'
},
facebook: {
clientID: process.env.FACEBOOK_ID || 'APP_ID',
clientSecret: process.env.FACEBOOK_SECRET || 'APP_SECRET',
callbackURL: '/auth/facebook/callback'
},
twitter: {
clientID: process.env.TWITTER_KEY || 'CONSUMER_KEY',
clientSecret: process.env.TWITTER_SECRET || 'CONSUMER_SECRET',
callbackURL: '/auth/twitter/callback'
},
google: {
clientID: process.env.GOOGLE_ID || 'APP_ID',
clientSecret: process.env.GOOGLE_SECRET || 'APP_SECRET',
callbackURL: '/auth/google/callback'
},
linkedin: {
clientID: process.env.LINKEDIN_ID || 'APP_ID',
clientSecret: process.env.LINKEDIN_SECRET || 'APP_SECRET',
callbackURL: '/auth/linkedin/callback'
},
github: {
clientID: process.env.GITHUB_ID || 'APP_ID',
clientSecret: process.env.GITHUB_SECRET || 'APP_SECRET',
callbackURL: '/auth/github/callback'
},
mailer: {
from: process.env.MAILER_FROM || 'MAILER_FROM',
options: {
service: process.env.MAILER_SERVICE_PROVIDER || 'MAILER_SERVICE_PROVIDER',
auth: {
user: process.env.MAILER_EMAIL_ID || 'MAILER_EMAIL_ID',
pass: process.env.MAILER_PASSWORD || 'MAILER_PASSWORD'
}
}
}
};
|
import React from "react"
import Layout from "../../components/layout/layout"
import SEO from "../../components/layout/seo"
import ProjectIntro from "../../components/sections/ProjectIntro"
import Caption from "../../components/sections/Caption"
import FullImage from "../../components/sections/FullImage"
function RecruitReport() {
return (
<Layout>
<SEO title="Recruit Annual Report" />
<ProjectIntro
title="Recruit Annual Report"
paragraph1="I worked with Wild Tame to design the 2019 and 2020 annual report for Recruit Group. For the 2019 report we were collaborating with Japanese and English design studios. I created the English report, taking stylistic cues from the Japanese version while trying to create something unique and interesting."
paragraph2="For 2020, due to the positive feedback from the previous year we were asked to design both the English and Japanese documents from start to finish. This gave us more design freedom and ability to control the quality across both documents. Due to the global health situation, the 2020 report was slightly different to the previous year, it was a more stripped back digital only version named InsideOut 2020. The design was based on the 2019 report, but adapted to suit the new format."
title2="Graphic Design"
line1="Type"
line1B="Editorial"
line2="Studio"
line2B="Wild Tame"
line3="Client"
line3B="Recruit Holdings"
line4="Date"
line4B="2019/20"
line5="Role"
line5B="Lead Designer"
/>
<Caption caption="2019 Annual Report" />
<FullImage
image={"/images/graphic/GD_2019_Recruit/GD_Rh_2019_book1.jpg"}
alt="Recruit Annual Report 2019 cover and page layout"
/>
<FullImage
image={"/images/graphic/GD_2019_Recruit/GD_Rh_2019_book2.jpg"}
alt="Recruit Annual Report 2019 infographics overview"
/>
<FullImage
image={"/images/graphic/GD_2019_Recruit/GD_Rh_2020_icons.jpg"}
alt="Recruit Annual Report 2019 iconset overview"
/>
<Caption caption="InsideOut 2020" />
<FullImage
image={"/images/graphic/GD_2019_Recruit/GD_Rh_2020_cover.jpg"}
alt="Recruit InsideOut 2020 report cover"
/>
<FullImage
image={"/images/graphic/GD_2019_Recruit/GD_Rh_2020_multiple.jpg"}
alt="Recruit InsideOut 2020 various pages overview"
/>
<FullImage
image={"/images/graphic/GD_2019_Recruit/GD_Rh_2020_ceo.jpg"}
alt="Recruit InsideOut 2020 Message from CEO spread"
/>
<FullImage
image={"/images/graphic/GD_2019_Recruit/GD_Rh_2020_en-ja.jpg"}
alt="Recruit InsideOut 2020 various spreads overview"
/>
<FullImage
image={"/images/graphic/GD_2019_Recruit/GD_Rh_2020_grids.jpg"}
alt="Recruit InsideOut 2020 grid overview"
/>
</Layout>
)
}
export default RecruitReport
|
const createPostHandler = async (event) => {
event.preventDefault();
const title = document.querySelector('#post-title').value.trim();
const content = document.querySelector('#post-content').value.trim();
const post_id = window.location.toString().split('/')[
window.location.toString().split('/').length - 1
];
if (content) {
const response = await fetch(`/api/posts/edit/${post_id}`, {
method: 'PUT',
body: JSON.stringify({
title,
content,
}),
headers: {
'Content-Type': 'application/json',
},
});
if (response.ok) {
document.location.replace('/dashboard');
} else {
alert(response.statusText);
}
}
};
document
.querySelector('#create-post-btn')
.addEventListener('click', createPostHandler);
|
import { db } from "../../server.js";
function renderAdminLogin(req, res) {
if (!req.session.admin) {
res.render("adminLogin.ejs");
} else {
res.redirect("/dashboard");
}
}
async function renderAdminDashboard(req, res) {
if (!req.session.admin) {
res.redirect("/admin")
} else {
const matches = await db.collection("matches").find().toArray();
const adminData = req.session.admin;
res.render("adminDashboard.ejs", {
adminData,
matches
});
}
}
function renderAddmatch(req, res) {
if (!req.session.admin) {
res.redirect("/admin")
} else {
const adminData = req.session.admin;
res.render("addMatch.ejs", {
adminData
});
}
}
async function renderEditMatch(req, res) {
if (!req.session.admin) {
res.redirect("/admin")
} else {
const matchId = req.params.matchId;
const match = await db.collection("matches").findOne({id: matchId});
res.render("editMatch.ejs", {
match
})
}
}
function adminSignout(req, res) {
req.session.admin = "";
res.redirect("/admin");
}
async function renderUserHome(req, res) {
const matches = await db.collection("matches").find().toArray();
res.render("userHome.ejs", {
matches
})
}
async function renderMyMatches(req, res) {
const matches = await db.collection("matches").find().toArray();
res.render("myMatches.ejs", {
matches
})
}
async function renderUserMatch(req, res) {
const matchId = req.params.matchId;
const match = await db.collection("matches").findOne({id: matchId});
res.render("detailMatch.ejs", {
match
})
}
async function renderProfile(req, res) {
if (!req.session.user) {
res.render("userLogin.ejs");
} else {
const profile = req.session.user;
res.render("profile.ejs", {
profile
})
}
}
function userSignout(req, res) {
req.session.user = "";
res.redirect("/profile");
}
export { renderAdminLogin, renderAdminDashboard, adminSignout, renderAddmatch, renderUserHome, renderEditMatch, renderMyMatches, renderUserMatch, renderProfile, userSignout }
|
/**
* Created by Danish Ch on 9/9/2017.
*/
'use strict';
$(document).ready(function() {
$('#clear').on('click', function() {
$('#admission_form').bootstrapValidator("resetForm");
});
$('#admission_form').bootstrapValidator({
fields: {
std_f_name: {
validators: {
notEmpty: {
message: 'Enter the first name'
}
}
},
std_l_name: {
validators: {
notEmpty: {
message: 'Enter last name'
}
}
},
std_cnic: {
validators: {
notEmpty: {
message: 'Enter student cnic'
}
}
},
father_name: {
validators: {
notEmpty: {
message: 'Enter father name'
}
}
},
father_cnic: {
validators: {
notEmpty: {
message: 'Enter father cnic'
}
}
},
date_birth: {
validators: {
notEmpty: {
message: 'select the date of birth'
}
}
},
// confirmpassword: {
// validators: {
// notEmpty: {
// message: 'Confirm the password'
// },
// identical: {
// field: 'password',
// message: 'Please enter the same password as above'
// }
// }
// },
gender: {
validators: {
notEmpty: {
message: 'Gender is required'
}
}
},
religion: {
validators: {
notEmpty: {
message: 'Religion is required'
}
}
},
cast: {
validators: {
notEmpty: {
message: 'Cast is required'
}
}
},
std_image: {
validators: {
notEmpty: {
message: 'student image is required'
}
}
},
std_email: {
validators: {
notEmpty: {
message: 'Enter the email address'
},
regexp: {
regexp: /^\S+@\S{1,}\.\S{1,}$/,
message: 'The input is not a valid email address'
}
}
},
std_phone: {
validators: {
notEmpty: {
message: 'Enter the phone number'
},
regexp: {
regexp: /^[0-9]{10,15}$/,
message: 'The phone number can only consist of numbers with min 10 digits'
}
}
},
address: {
validators: {
notEmpty: {
message: 'address is required'
}
}
},
city: {
validators: {
notEmpty: {
message: 'City is required'
}
}
},
country: {
validators: {
notEmpty: {
message: 'country is required'
}
}
},
profession: {
validators: {
notEmpty: {
message: 'select profession'
}
}
},
class: {
validators: {
notEmpty: {
message: 'select class'
}
}
},
group: {
validators: {
notEmpty: {
message: 'select group'
}
}
},
hobbies: {
validators: {
notEmpty: {
message: 'enter hobbies'
}
}
},
// previous_school: {
// validators: {
// notEmpty: {
// message: 'enter previous school'
// }
// }
// },
// brother_sister1: {
// validators: {
// notEmpty: {
// message: 'enter brother/sister 1'
// }
// }
// },
// brother_sister2: {
// validators: {
// notEmpty: {
// message: 'enter brother/sister 2'
// }
// }
// },
// brother_sister3: {
// validators: {
// notEmpty: {
// message: 'enter brother/sister 3'
// }
// }
// }
}
});
// .on('success.form.bv', function(e) {
// e.preventDefault();
// swal({
// title: "Success.",
// text: "Successfully Added",
// type: "success",
// allowOutsideClick: false
// }).then(function() {
// location.reload();
// });
// });
$('#edit_clear').on('click', function() {
$('#update_employee').bootstrapValidator("resetForm");
});
$('#update_employee').bootstrapValidator({
fields: {
emp_f_name: {
validators: {
notEmpty: {
message: 'Enter the first name'
}
}
},
emp_l_name: {
validators: {
notEmpty: {
message: 'Enter last name'
}
}
},
emp_cnic: {
validators: {
notEmpty: {
message: 'Enter employee cnic'
}
}
},
father_name: {
validators: {
notEmpty: {
message: 'Enter father name'
}
}
},
father_cnic: {
validators: {
notEmpty: {
message: 'Enter father cnic'
}
}
},
date_birth: {
validators: {
notEmpty: {
message: 'select the date of birth'
}
}
},
// confirmpassword: {
// validators: {
// notEmpty: {
// message: 'Confirm the password'
// },
// identical: {
// field: 'password',
// message: 'Please enter the same password as above'
// }
// }
// },
gender: {
validators: {
notEmpty: {
message: 'Gender is required'
}
}
},
religion: {
validators: {
notEmpty: {
message: 'Religion is required'
}
}
},
cast: {
validators: {
notEmpty: {
message: 'Cast is required'
}
}
},
emp_email: {
validators: {
notEmpty: {
message: 'Enter the email address'
},
regexp: {
regexp: /^\S+@\S{1,}\.\S{1,}$/,
message: 'The input is not a valid email address'
}
}
},
emp_phone: {
validators: {
notEmpty: {
message: 'Enter the phone number'
},
regexp: {
regexp: /^[0-9]{10,15}$/,
message: 'The phone number can only consist of numbers with min 10 digits'
}
}
},
address: {
validators: {
notEmpty: {
message: 'address is required'
}
}
},
city: {
validators: {
notEmpty: {
message: 'City is required'
}
}
},
country: {
validators: {
notEmpty: {
message: 'country is required'
}
}
},
position: {
validators: {
notEmpty: {
message: 'select position'
}
}
},
degree_certificate: {
validators: {
notEmpty: {
message: 'Degree/certificate is required'
}
}
},
cgpa_percentage: {
validators: {
notEmpty: {
message: 'Cgpa/percentage is required'
}
}
},
university_college: {
validators: {
notEmpty: {
message: 'University College is required'
}
}
},
passing_year: {
validators: {
notEmpty: {
message: 'Please selectPassing year'
}
}
}
// pincode: {
// validators: {
// notEmpty: {
// message: 'Pincode number is required'
// },
// regexp: {
// regexp: /^(\+?1-?)?(\([0-9]\d{2}\)|[0-9]\d{2})-?[0-9]\d{2}$/,
// message: 'Enter valid Pincode number'
// }
// }
// },
// terms: {
// validators: {
// notEmpty: {
// message: 'You have to accept the terms and policies'
// }
// }
// }
}
// submitHandler: function(form) {
// if ($('#tryitForm1').valid()) {
// console.log("now we enable the submit button!");
// }
// }
});
$('#tryitForm').bootstrapValidator({
fields: {
firstName: {
validators: {
notEmpty: {
message: 'Enter the user name'
}
}
},
address1: {
validators: {
notEmpty: {
message: 'Enter your address'
}
}
},
password: {
validators: {
notEmpty: {
message: 'Enter the password'
}
}
},
confirmpassword: {
validators: {
notEmpty: {
message: 'Confirm the password'
},
identical: {
field: 'password',
message: 'Please enter the same password as above'
}
}
},
email: {
validators: {
notEmpty: {
message: 'Enter the email address'
},
regexp: {
regexp: /^\S+@\S{1,}\.\S{1,}$/,
message: 'The input is not a valid email address'
}
}
},
cell: {
validators: {
notEmpty: {
message: 'Enter the phone number'
},
regexp: {
regexp: /^[0-9]{10}$/,
message: 'The phone number can only consist of numbers with 10 digits'
}
}
},
city: {
validators: {
notEmpty: {
message: 'City is required'
}
}
},
gender: {
validators: {
notEmpty: {
message: 'Gender is required'
}
}
},
pincode: {
validators: {
notEmpty: {
message: 'Pincode number is required'
},
regexp: {
regexp: /^(\+?1-?)?(\([0-9]\d{2}\)|[0-9]\d{2})-?[0-9]\d{2}$/,
message: 'Enter valid Pincode number'
}
}
},
activate: {
validators: {
notEmpty: {
message: 'You have to activate your account'
}
}
},
check_active: {
validators: {
notEmpty: {
message: 'You have to active your account'
}
}
}
// terms: {
// validators: {
// notEmpty: {
// message: 'You have to accept the terms and policies'
// }
// }
// }
}
// submitHandler: function(form) {
// if ($('#tryitForm').valid()) {
// console.log("now we enable the submit button!");
// }
// }
});
// $("#emp_phone").intlTelInput({
// utilsScript: "/admin-vendor/intl-tel-input/js/utils.js"
// });
});
|
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
tslib_1.__exportStar(require("@styled-icons/fa-brands/Alipay"), exports);
|
/* This file is automatically rebuilt by the Cesium build process. */
define(['exports', './Transforms-d2b6be42', './Cartesian2-29c15ffd', './Check-ed9ffed2', './ComponentDatatype-2ec73936', './when-f31b6bd1', './GeometryAttribute-8c2091fc', './GeometryAttributes-e973821e', './Math-03750a0b', './Plane-01ea173f', './VertexFormat-44d61ac9'], function (exports, Transforms, Cartesian2, Check, ComponentDatatype, when, GeometryAttribute, GeometryAttributes, _Math, Plane, VertexFormat) { 'use strict';
/**
* The culling volume defined by planes.
*
* @alias CullingVolume
* @constructor
*
* @param {Cartesian4[]} [planes] An array of clipping planes.
*/
function CullingVolume(planes) {
/**
* Each plane is represented by a Cartesian4 object, where the x, y, and z components
* define the unit vector normal to the plane, and the w component is the distance of the
* plane from the origin.
* @type {Cartesian4[]}
* @default []
*/
this.planes = when.defaultValue(planes, []);
}
var faces = [new Cartesian2.Cartesian3(), new Cartesian2.Cartesian3(), new Cartesian2.Cartesian3()];
Cartesian2.Cartesian3.clone(Cartesian2.Cartesian3.UNIT_X, faces[0]);
Cartesian2.Cartesian3.clone(Cartesian2.Cartesian3.UNIT_Y, faces[1]);
Cartesian2.Cartesian3.clone(Cartesian2.Cartesian3.UNIT_Z, faces[2]);
var scratchPlaneCenter = new Cartesian2.Cartesian3();
var scratchPlaneNormal = new Cartesian2.Cartesian3();
var scratchPlane = new Plane.Plane(new Cartesian2.Cartesian3(1.0, 0.0, 0.0), 0.0);
/**
* Constructs a culling volume from a bounding sphere. Creates six planes that create a box containing the sphere.
* The planes are aligned to the x, y, and z axes in world coordinates.
*
* @param {BoundingSphere} boundingSphere The bounding sphere used to create the culling volume.
* @param {CullingVolume} [result] The object onto which to store the result.
* @returns {CullingVolume} The culling volume created from the bounding sphere.
*/
CullingVolume.fromBoundingSphere = function (boundingSphere, result) {
//>>includeStart('debug', pragmas.debug);
if (!when.defined(boundingSphere)) {
throw new Check.DeveloperError("boundingSphere is required.");
}
//>>includeEnd('debug');
if (!when.defined(result)) {
result = new CullingVolume();
}
var length = faces.length;
var planes = result.planes;
planes.length = 2 * length;
var center = boundingSphere.center;
var radius = boundingSphere.radius;
var planeIndex = 0;
for (var i = 0; i < length; ++i) {
var faceNormal = faces[i];
var plane0 = planes[planeIndex];
var plane1 = planes[planeIndex + 1];
if (!when.defined(plane0)) {
plane0 = planes[planeIndex] = new Transforms.Cartesian4();
}
if (!when.defined(plane1)) {
plane1 = planes[planeIndex + 1] = new Transforms.Cartesian4();
}
Cartesian2.Cartesian3.multiplyByScalar(faceNormal, -radius, scratchPlaneCenter);
Cartesian2.Cartesian3.add(center, scratchPlaneCenter, scratchPlaneCenter);
plane0.x = faceNormal.x;
plane0.y = faceNormal.y;
plane0.z = faceNormal.z;
plane0.w = -Cartesian2.Cartesian3.dot(faceNormal, scratchPlaneCenter);
Cartesian2.Cartesian3.multiplyByScalar(faceNormal, radius, scratchPlaneCenter);
Cartesian2.Cartesian3.add(center, scratchPlaneCenter, scratchPlaneCenter);
plane1.x = -faceNormal.x;
plane1.y = -faceNormal.y;
plane1.z = -faceNormal.z;
plane1.w = -Cartesian2.Cartesian3.dot(
Cartesian2.Cartesian3.negate(faceNormal, scratchPlaneNormal),
scratchPlaneCenter
);
planeIndex += 2;
}
return result;
};
/**
* Determines whether a bounding volume intersects the culling volume.
*
* @param {Object} boundingVolume The bounding volume whose intersection with the culling volume is to be tested.
* @returns {Intersect} Intersect.OUTSIDE, Intersect.INTERSECTING, or Intersect.INSIDE.
*/
CullingVolume.prototype.computeVisibility = function (boundingVolume) {
//>>includeStart('debug', pragmas.debug);
if (!when.defined(boundingVolume)) {
throw new Check.DeveloperError("boundingVolume is required.");
}
//>>includeEnd('debug');
var planes = this.planes;
var intersecting = false;
for (var k = 0, len = planes.length; k < len; ++k) {
var result = boundingVolume.intersectPlane(
Plane.Plane.fromCartesian4(planes[k], scratchPlane)
);
if (result === Transforms.Intersect.OUTSIDE) {
return Transforms.Intersect.OUTSIDE;
} else if (result === Transforms.Intersect.INTERSECTING) {
intersecting = true;
}
}
return intersecting ? Transforms.Intersect.INTERSECTING : Transforms.Intersect.INSIDE;
};
/**
* Determines whether a bounding volume intersects the culling volume.
*
* @param {Object} boundingVolume The bounding volume whose intersection with the culling volume is to be tested.
* @param {Number} parentPlaneMask A bit mask from the boundingVolume's parent's check against the same culling
* volume, such that if (planeMask & (1 << planeIndex) === 0), for k < 31, then
* the parent (and therefore this) volume is completely inside plane[planeIndex]
* and that plane check can be skipped.
* @returns {Number} A plane mask as described above (which can be applied to this boundingVolume's children).
*
* @private
*/
CullingVolume.prototype.computeVisibilityWithPlaneMask = function (
boundingVolume,
parentPlaneMask
) {
//>>includeStart('debug', pragmas.debug);
if (!when.defined(boundingVolume)) {
throw new Check.DeveloperError("boundingVolume is required.");
}
if (!when.defined(parentPlaneMask)) {
throw new Check.DeveloperError("parentPlaneMask is required.");
}
//>>includeEnd('debug');
if (
parentPlaneMask === CullingVolume.MASK_OUTSIDE ||
parentPlaneMask === CullingVolume.MASK_INSIDE
) {
// parent is completely outside or completely inside, so this child is as well.
return parentPlaneMask;
}
// Start with MASK_INSIDE (all zeros) so that after the loop, the return value can be compared with MASK_INSIDE.
// (Because if there are fewer than 31 planes, the upper bits wont be changed.)
var mask = CullingVolume.MASK_INSIDE;
var planes = this.planes;
for (var k = 0, len = planes.length; k < len; ++k) {
// For k greater than 31 (since 31 is the maximum number of INSIDE/INTERSECTING bits we can store), skip the optimization.
var flag = k < 31 ? 1 << k : 0;
if (k < 31 && (parentPlaneMask & flag) === 0) {
// boundingVolume is known to be INSIDE this plane.
continue;
}
var result = boundingVolume.intersectPlane(
Plane.Plane.fromCartesian4(planes[k], scratchPlane)
);
if (result === Transforms.Intersect.OUTSIDE) {
return CullingVolume.MASK_OUTSIDE;
} else if (result === Transforms.Intersect.INTERSECTING) {
mask |= flag;
}
}
return mask;
};
/**
* For plane masks (as used in {@link CullingVolume#computeVisibilityWithPlaneMask}), this special value
* represents the case where the object bounding volume is entirely outside the culling volume.
*
* @type {Number}
* @private
*/
CullingVolume.MASK_OUTSIDE = 0xffffffff;
/**
* For plane masks (as used in {@link CullingVolume.prototype.computeVisibilityWithPlaneMask}), this value
* represents the case where the object bounding volume is entirely inside the culling volume.
*
* @type {Number}
* @private
*/
CullingVolume.MASK_INSIDE = 0x00000000;
/**
* For plane masks (as used in {@link CullingVolume.prototype.computeVisibilityWithPlaneMask}), this value
* represents the case where the object bounding volume (may) intersect all planes of the culling volume.
*
* @type {Number}
* @private
*/
CullingVolume.MASK_INDETERMINATE = 0x7fffffff;
/**
* The viewing frustum is defined by 6 planes.
* Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components
* define the unit vector normal to the plane, and the w component is the distance of the
* plane from the origin/camera position.
*
* @alias OrthographicOffCenterFrustum
* @constructor
*
* @param {Object} [options] An object with the following properties:
* @param {Number} [options.left] The left clipping plane distance.
* @param {Number} [options.right] The right clipping plane distance.
* @param {Number} [options.top] The top clipping plane distance.
* @param {Number} [options.bottom] The bottom clipping plane distance.
* @param {Number} [options.near=1.0] The near clipping plane distance.
* @param {Number} [options.far=500000000.0] The far clipping plane distance.
*
* @example
* var maxRadii = ellipsoid.maximumRadius;
*
* var frustum = new Cesium.OrthographicOffCenterFrustum();
* frustum.right = maxRadii * Cesium.Math.PI;
* frustum.left = -c.frustum.right;
* frustum.top = c.frustum.right * (canvas.clientHeight / canvas.clientWidth);
* frustum.bottom = -c.frustum.top;
* frustum.near = 0.01 * maxRadii;
* frustum.far = 50.0 * maxRadii;
*/
function OrthographicOffCenterFrustum(options) {
options = when.defaultValue(options, when.defaultValue.EMPTY_OBJECT);
/**
* The left clipping plane.
* @type {Number}
* @default undefined
*/
this.left = options.left;
this._left = undefined;
/**
* The right clipping plane.
* @type {Number}
* @default undefined
*/
this.right = options.right;
this._right = undefined;
/**
* The top clipping plane.
* @type {Number}
* @default undefined
*/
this.top = options.top;
this._top = undefined;
/**
* The bottom clipping plane.
* @type {Number}
* @default undefined
*/
this.bottom = options.bottom;
this._bottom = undefined;
/**
* The distance of the near plane.
* @type {Number}
* @default 1.0
*/
this.near = when.defaultValue(options.near, 1.0);
this._near = this.near;
/**
* The distance of the far plane.
* @type {Number}
* @default 500000000.0;
*/
this.far = when.defaultValue(options.far, 500000000.0);
this._far = this.far;
this._cullingVolume = new CullingVolume();
this._orthographicMatrix = new Transforms.Matrix4();
}
function update$3(frustum) {
//>>includeStart('debug', pragmas.debug);
if (
!when.defined(frustum.right) ||
!when.defined(frustum.left) ||
!when.defined(frustum.top) ||
!when.defined(frustum.bottom) ||
!when.defined(frustum.near) ||
!when.defined(frustum.far)
) {
throw new Check.DeveloperError(
"right, left, top, bottom, near, or far parameters are not set."
);
}
//>>includeEnd('debug');
if (
frustum.top !== frustum._top ||
frustum.bottom !== frustum._bottom ||
frustum.left !== frustum._left ||
frustum.right !== frustum._right ||
frustum.near !== frustum._near ||
frustum.far !== frustum._far
) {
//>>includeStart('debug', pragmas.debug);
if (frustum.left > frustum.right) {
throw new Check.DeveloperError("right must be greater than left.");
}
if (frustum.bottom > frustum.top) {
throw new Check.DeveloperError("top must be greater than bottom.");
}
if (frustum.near <= 0 || frustum.near > frustum.far) {
throw new Check.DeveloperError(
"near must be greater than zero and less than far."
);
}
//>>includeEnd('debug');
frustum._left = frustum.left;
frustum._right = frustum.right;
frustum._top = frustum.top;
frustum._bottom = frustum.bottom;
frustum._near = frustum.near;
frustum._far = frustum.far;
frustum._orthographicMatrix = Transforms.Matrix4.computeOrthographicOffCenter(
frustum.left,
frustum.right,
frustum.bottom,
frustum.top,
frustum.near,
frustum.far,
frustum._orthographicMatrix
);
}
}
Object.defineProperties(OrthographicOffCenterFrustum.prototype, {
/**
* Gets the orthographic projection matrix computed from the view frustum.
* @memberof OrthographicOffCenterFrustum.prototype
* @type {Matrix4}
* @readonly
*/
projectionMatrix: {
get: function () {
update$3(this);
return this._orthographicMatrix;
},
},
});
var getPlanesRight$1 = new Cartesian2.Cartesian3();
var getPlanesNearCenter$1 = new Cartesian2.Cartesian3();
var getPlanesPoint = new Cartesian2.Cartesian3();
var negateScratch = new Cartesian2.Cartesian3();
/**
* Creates a culling volume for this frustum.
*
* @param {Cartesian3} position The eye position.
* @param {Cartesian3} direction The view direction.
* @param {Cartesian3} up The up direction.
* @returns {CullingVolume} A culling volume at the given position and orientation.
*
* @example
* // Check if a bounding volume intersects the frustum.
* var cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);
* var intersect = cullingVolume.computeVisibility(boundingVolume);
*/
OrthographicOffCenterFrustum.prototype.computeCullingVolume = function (
position,
direction,
up
) {
//>>includeStart('debug', pragmas.debug);
if (!when.defined(position)) {
throw new Check.DeveloperError("position is required.");
}
if (!when.defined(direction)) {
throw new Check.DeveloperError("direction is required.");
}
if (!when.defined(up)) {
throw new Check.DeveloperError("up is required.");
}
//>>includeEnd('debug');
var planes = this._cullingVolume.planes;
var t = this.top;
var b = this.bottom;
var r = this.right;
var l = this.left;
var n = this.near;
var f = this.far;
var right = Cartesian2.Cartesian3.cross(direction, up, getPlanesRight$1);
Cartesian2.Cartesian3.normalize(right, right);
var nearCenter = getPlanesNearCenter$1;
Cartesian2.Cartesian3.multiplyByScalar(direction, n, nearCenter);
Cartesian2.Cartesian3.add(position, nearCenter, nearCenter);
var point = getPlanesPoint;
// Left plane
Cartesian2.Cartesian3.multiplyByScalar(right, l, point);
Cartesian2.Cartesian3.add(nearCenter, point, point);
var plane = planes[0];
if (!when.defined(plane)) {
plane = planes[0] = new Transforms.Cartesian4();
}
plane.x = right.x;
plane.y = right.y;
plane.z = right.z;
plane.w = -Cartesian2.Cartesian3.dot(right, point);
// Right plane
Cartesian2.Cartesian3.multiplyByScalar(right, r, point);
Cartesian2.Cartesian3.add(nearCenter, point, point);
plane = planes[1];
if (!when.defined(plane)) {
plane = planes[1] = new Transforms.Cartesian4();
}
plane.x = -right.x;
plane.y = -right.y;
plane.z = -right.z;
plane.w = -Cartesian2.Cartesian3.dot(Cartesian2.Cartesian3.negate(right, negateScratch), point);
// Bottom plane
Cartesian2.Cartesian3.multiplyByScalar(up, b, point);
Cartesian2.Cartesian3.add(nearCenter, point, point);
plane = planes[2];
if (!when.defined(plane)) {
plane = planes[2] = new Transforms.Cartesian4();
}
plane.x = up.x;
plane.y = up.y;
plane.z = up.z;
plane.w = -Cartesian2.Cartesian3.dot(up, point);
// Top plane
Cartesian2.Cartesian3.multiplyByScalar(up, t, point);
Cartesian2.Cartesian3.add(nearCenter, point, point);
plane = planes[3];
if (!when.defined(plane)) {
plane = planes[3] = new Transforms.Cartesian4();
}
plane.x = -up.x;
plane.y = -up.y;
plane.z = -up.z;
plane.w = -Cartesian2.Cartesian3.dot(Cartesian2.Cartesian3.negate(up, negateScratch), point);
// Near plane
plane = planes[4];
if (!when.defined(plane)) {
plane = planes[4] = new Transforms.Cartesian4();
}
plane.x = direction.x;
plane.y = direction.y;
plane.z = direction.z;
plane.w = -Cartesian2.Cartesian3.dot(direction, nearCenter);
// Far plane
Cartesian2.Cartesian3.multiplyByScalar(direction, f, point);
Cartesian2.Cartesian3.add(position, point, point);
plane = planes[5];
if (!when.defined(plane)) {
plane = planes[5] = new Transforms.Cartesian4();
}
plane.x = -direction.x;
plane.y = -direction.y;
plane.z = -direction.z;
plane.w = -Cartesian2.Cartesian3.dot(Cartesian2.Cartesian3.negate(direction, negateScratch), point);
return this._cullingVolume;
};
/**
* Returns the pixel's width and height in meters.
*
* @param {Number} drawingBufferWidth The width of the drawing buffer.
* @param {Number} drawingBufferHeight The height of the drawing buffer.
* @param {Number} distance The distance to the near plane in meters.
* @param {Number} pixelRatio The scaling factor from pixel space to coordinate space.
* @param {Cartesian2} result The object onto which to store the result.
* @returns {Cartesian2} The modified result parameter or a new instance of {@link Cartesian2} with the pixel's width and height in the x and y properties, respectively.
*
* @exception {DeveloperError} drawingBufferWidth must be greater than zero.
* @exception {DeveloperError} drawingBufferHeight must be greater than zero.
* @exception {DeveloperError} pixelRatio must be greater than zero.
*
* @example
* // Example 1
* // Get the width and height of a pixel.
* var pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 0.0, scene.pixelRatio, new Cesium.Cartesian2());
*/
OrthographicOffCenterFrustum.prototype.getPixelDimensions = function (
drawingBufferWidth,
drawingBufferHeight,
distance,
pixelRatio,
result
) {
update$3(this);
//>>includeStart('debug', pragmas.debug);
if (!when.defined(drawingBufferWidth) || !when.defined(drawingBufferHeight)) {
throw new Check.DeveloperError(
"Both drawingBufferWidth and drawingBufferHeight are required."
);
}
if (drawingBufferWidth <= 0) {
throw new Check.DeveloperError("drawingBufferWidth must be greater than zero.");
}
if (drawingBufferHeight <= 0) {
throw new Check.DeveloperError("drawingBufferHeight must be greater than zero.");
}
if (!when.defined(distance)) {
throw new Check.DeveloperError("distance is required.");
}
if (!when.defined(pixelRatio)) {
throw new Check.DeveloperError("pixelRatio is required.");
}
if (pixelRatio <= 0) {
throw new Check.DeveloperError("pixelRatio must be greater than zero.");
}
if (!when.defined(result)) {
throw new Check.DeveloperError("A result object is required.");
}
//>>includeEnd('debug');
var frustumWidth = this.right - this.left;
var frustumHeight = this.top - this.bottom;
var pixelWidth = (pixelRatio * frustumWidth) / drawingBufferWidth;
var pixelHeight = (pixelRatio * frustumHeight) / drawingBufferHeight;
result.x = pixelWidth;
result.y = pixelHeight;
return result;
};
/**
* Returns a duplicate of a OrthographicOffCenterFrustum instance.
*
* @param {OrthographicOffCenterFrustum} [result] The object onto which to store the result.
* @returns {OrthographicOffCenterFrustum} The modified result parameter or a new OrthographicOffCenterFrustum instance if one was not provided.
*/
OrthographicOffCenterFrustum.prototype.clone = function (result) {
if (!when.defined(result)) {
result = new OrthographicOffCenterFrustum();
}
result.left = this.left;
result.right = this.right;
result.top = this.top;
result.bottom = this.bottom;
result.near = this.near;
result.far = this.far;
// force update of clone to compute matrices
result._left = undefined;
result._right = undefined;
result._top = undefined;
result._bottom = undefined;
result._near = undefined;
result._far = undefined;
return result;
};
/**
* Compares the provided OrthographicOffCenterFrustum componentwise and returns
* <code>true</code> if they are equal, <code>false</code> otherwise.
*
* @param {OrthographicOffCenterFrustum} [other] The right hand side OrthographicOffCenterFrustum.
* @returns {Boolean} <code>true</code> if they are equal, <code>false</code> otherwise.
*/
OrthographicOffCenterFrustum.prototype.equals = function (other) {
return (
when.defined(other) &&
other instanceof OrthographicOffCenterFrustum &&
this.right === other.right &&
this.left === other.left &&
this.top === other.top &&
this.bottom === other.bottom &&
this.near === other.near &&
this.far === other.far
);
};
/**
* Compares the provided OrthographicOffCenterFrustum componentwise and returns
* <code>true</code> if they pass an absolute or relative tolerance test,
* <code>false</code> otherwise.
*
* @param {OrthographicOffCenterFrustum} other The right hand side OrthographicOffCenterFrustum.
* @param {Number} relativeEpsilon The relative epsilon tolerance to use for equality testing.
* @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.
* @returns {Boolean} <code>true</code> if this and other are within the provided epsilon, <code>false</code> otherwise.
*/
OrthographicOffCenterFrustum.prototype.equalsEpsilon = function (
other,
relativeEpsilon,
absoluteEpsilon
) {
return (
other === this ||
(when.defined(other) &&
other instanceof OrthographicOffCenterFrustum &&
_Math.CesiumMath.equalsEpsilon(
this.right,
other.right,
relativeEpsilon,
absoluteEpsilon
) &&
_Math.CesiumMath.equalsEpsilon(
this.left,
other.left,
relativeEpsilon,
absoluteEpsilon
) &&
_Math.CesiumMath.equalsEpsilon(
this.top,
other.top,
relativeEpsilon,
absoluteEpsilon
) &&
_Math.CesiumMath.equalsEpsilon(
this.bottom,
other.bottom,
relativeEpsilon,
absoluteEpsilon
) &&
_Math.CesiumMath.equalsEpsilon(
this.near,
other.near,
relativeEpsilon,
absoluteEpsilon
) &&
_Math.CesiumMath.equalsEpsilon(
this.far,
other.far,
relativeEpsilon,
absoluteEpsilon
))
);
};
/**
* The viewing frustum is defined by 6 planes.
* Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components
* define the unit vector normal to the plane, and the w component is the distance of the
* plane from the origin/camera position.
*
* @alias OrthographicFrustum
* @constructor
*
* @param {Object} [options] An object with the following properties:
* @param {Number} [options.width] The width of the frustum in meters.
* @param {Number} [options.aspectRatio] The aspect ratio of the frustum's width to it's height.
* @param {Number} [options.near=1.0] The distance of the near plane.
* @param {Number} [options.far=500000000.0] The distance of the far plane.
*
* @example
* var maxRadii = ellipsoid.maximumRadius;
*
* var frustum = new Cesium.OrthographicFrustum();
* frustum.near = 0.01 * maxRadii;
* frustum.far = 50.0 * maxRadii;
*/
function OrthographicFrustum(options) {
options = when.defaultValue(options, when.defaultValue.EMPTY_OBJECT);
this._offCenterFrustum = new OrthographicOffCenterFrustum();
/**
* The horizontal width of the frustum in meters.
* @type {Number}
* @default undefined
*/
this.width = options.width;
this._width = undefined;
/**
* The aspect ratio of the frustum's width to it's height.
* @type {Number}
* @default undefined
*/
this.aspectRatio = options.aspectRatio;
this._aspectRatio = undefined;
/**
* The distance of the near plane.
* @type {Number}
* @default 1.0
*/
this.near = when.defaultValue(options.near, 1.0);
this._near = this.near;
/**
* The distance of the far plane.
* @type {Number}
* @default 500000000.0;
*/
this.far = when.defaultValue(options.far, 500000000.0);
this._far = this.far;
}
/**
* The number of elements used to pack the object into an array.
* @type {Number}
*/
OrthographicFrustum.packedLength = 4;
/**
* Stores the provided instance into the provided array.
*
* @param {OrthographicFrustum} value The value to pack.
* @param {Number[]} array The array to pack into.
* @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
*
* @returns {Number[]} The array that was packed into
*/
OrthographicFrustum.pack = function (value, array, startingIndex) {
//>>includeStart('debug', pragmas.debug);
Check.Check.typeOf.object("value", value);
Check.Check.defined("array", array);
//>>includeEnd('debug');
startingIndex = when.defaultValue(startingIndex, 0);
array[startingIndex++] = value.width;
array[startingIndex++] = value.aspectRatio;
array[startingIndex++] = value.near;
array[startingIndex] = value.far;
return array;
};
/**
* Retrieves an instance from a packed array.
*
* @param {Number[]} array The packed array.
* @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
* @param {OrthographicFrustum} [result] The object into which to store the result.
* @returns {OrthographicFrustum} The modified result parameter or a new OrthographicFrustum instance if one was not provided.
*/
OrthographicFrustum.unpack = function (array, startingIndex, result) {
//>>includeStart('debug', pragmas.debug);
Check.Check.defined("array", array);
//>>includeEnd('debug');
startingIndex = when.defaultValue(startingIndex, 0);
if (!when.defined(result)) {
result = new OrthographicFrustum();
}
result.width = array[startingIndex++];
result.aspectRatio = array[startingIndex++];
result.near = array[startingIndex++];
result.far = array[startingIndex];
return result;
};
function update$2(frustum) {
//>>includeStart('debug', pragmas.debug);
if (
!when.defined(frustum.width) ||
!when.defined(frustum.aspectRatio) ||
!when.defined(frustum.near) ||
!when.defined(frustum.far)
) {
throw new Check.DeveloperError(
"width, aspectRatio, near, or far parameters are not set."
);
}
//>>includeEnd('debug');
var f = frustum._offCenterFrustum;
if (
frustum.width !== frustum._width ||
frustum.aspectRatio !== frustum._aspectRatio ||
frustum.near !== frustum._near ||
frustum.far !== frustum._far
) {
//>>includeStart('debug', pragmas.debug);
if (frustum.aspectRatio < 0) {
throw new Check.DeveloperError("aspectRatio must be positive.");
}
if (frustum.near < 0 || frustum.near > frustum.far) {
throw new Check.DeveloperError(
"near must be greater than zero and less than far."
);
}
//>>includeEnd('debug');
frustum._aspectRatio = frustum.aspectRatio;
frustum._width = frustum.width;
frustum._near = frustum.near;
frustum._far = frustum.far;
var ratio = 1.0 / frustum.aspectRatio;
f.right = frustum.width * 0.5;
f.left = -f.right;
f.top = ratio * f.right;
f.bottom = -f.top;
f.near = frustum.near;
f.far = frustum.far;
}
}
Object.defineProperties(OrthographicFrustum.prototype, {
/**
* Gets the orthographic projection matrix computed from the view frustum.
* @memberof OrthographicFrustum.prototype
* @type {Matrix4}
* @readonly
*/
projectionMatrix: {
get: function () {
update$2(this);
return this._offCenterFrustum.projectionMatrix;
},
},
});
/**
* Creates a culling volume for this frustum.
*
* @param {Cartesian3} position The eye position.
* @param {Cartesian3} direction The view direction.
* @param {Cartesian3} up The up direction.
* @returns {CullingVolume} A culling volume at the given position and orientation.
*
* @example
* // Check if a bounding volume intersects the frustum.
* var cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);
* var intersect = cullingVolume.computeVisibility(boundingVolume);
*/
OrthographicFrustum.prototype.computeCullingVolume = function (
position,
direction,
up
) {
update$2(this);
return this._offCenterFrustum.computeCullingVolume(position, direction, up);
};
/**
* Returns the pixel's width and height in meters.
*
* @param {Number} drawingBufferWidth The width of the drawing buffer.
* @param {Number} drawingBufferHeight The height of the drawing buffer.
* @param {Number} distance The distance to the near plane in meters.
* @param {Number} pixelRatio The scaling factor from pixel space to coordinate space.
* @param {Cartesian2} result The object onto which to store the result.
* @returns {Cartesian2} The modified result parameter or a new instance of {@link Cartesian2} with the pixel's width and height in the x and y properties, respectively.
*
* @exception {DeveloperError} drawingBufferWidth must be greater than zero.
* @exception {DeveloperError} drawingBufferHeight must be greater than zero.
* @exception {DeveloperError} pixelRatio must be greater than zero.
*
* @example
* // Example 1
* // Get the width and height of a pixel.
* var pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 0.0, scene.pixelRatio, new Cesium.Cartesian2());
*/
OrthographicFrustum.prototype.getPixelDimensions = function (
drawingBufferWidth,
drawingBufferHeight,
distance,
pixelRatio,
result
) {
update$2(this);
return this._offCenterFrustum.getPixelDimensions(
drawingBufferWidth,
drawingBufferHeight,
distance,
pixelRatio,
result
);
};
/**
* Returns a duplicate of a OrthographicFrustum instance.
*
* @param {OrthographicFrustum} [result] The object onto which to store the result.
* @returns {OrthographicFrustum} The modified result parameter or a new OrthographicFrustum instance if one was not provided.
*/
OrthographicFrustum.prototype.clone = function (result) {
if (!when.defined(result)) {
result = new OrthographicFrustum();
}
result.aspectRatio = this.aspectRatio;
result.width = this.width;
result.near = this.near;
result.far = this.far;
// force update of clone to compute matrices
result._aspectRatio = undefined;
result._width = undefined;
result._near = undefined;
result._far = undefined;
this._offCenterFrustum.clone(result._offCenterFrustum);
return result;
};
/**
* Compares the provided OrthographicFrustum componentwise and returns
* <code>true</code> if they are equal, <code>false</code> otherwise.
*
* @param {OrthographicFrustum} [other] The right hand side OrthographicFrustum.
* @returns {Boolean} <code>true</code> if they are equal, <code>false</code> otherwise.
*/
OrthographicFrustum.prototype.equals = function (other) {
if (!when.defined(other) || !(other instanceof OrthographicFrustum)) {
return false;
}
update$2(this);
update$2(other);
return (
this.width === other.width &&
this.aspectRatio === other.aspectRatio &&
this._offCenterFrustum.equals(other._offCenterFrustum)
);
};
/**
* Compares the provided OrthographicFrustum componentwise and returns
* <code>true</code> if they pass an absolute or relative tolerance test,
* <code>false</code> otherwise.
*
* @param {OrthographicFrustum} other The right hand side OrthographicFrustum.
* @param {Number} relativeEpsilon The relative epsilon tolerance to use for equality testing.
* @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.
* @returns {Boolean} <code>true</code> if this and other are within the provided epsilon, <code>false</code> otherwise.
*/
OrthographicFrustum.prototype.equalsEpsilon = function (
other,
relativeEpsilon,
absoluteEpsilon
) {
if (!when.defined(other) || !(other instanceof OrthographicFrustum)) {
return false;
}
update$2(this);
update$2(other);
return (
_Math.CesiumMath.equalsEpsilon(
this.width,
other.width,
relativeEpsilon,
absoluteEpsilon
) &&
_Math.CesiumMath.equalsEpsilon(
this.aspectRatio,
other.aspectRatio,
relativeEpsilon,
absoluteEpsilon
) &&
this._offCenterFrustum.equalsEpsilon(
other._offCenterFrustum,
relativeEpsilon,
absoluteEpsilon
)
);
};
/**
* The viewing frustum is defined by 6 planes.
* Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components
* define the unit vector normal to the plane, and the w component is the distance of the
* plane from the origin/camera position.
*
* @alias PerspectiveOffCenterFrustum
* @constructor
*
* @param {Object} [options] An object with the following properties:
* @param {Number} [options.left] The left clipping plane distance.
* @param {Number} [options.right] The right clipping plane distance.
* @param {Number} [options.top] The top clipping plane distance.
* @param {Number} [options.bottom] The bottom clipping plane distance.
* @param {Number} [options.near=1.0] The near clipping plane distance.
* @param {Number} [options.far=500000000.0] The far clipping plane distance.
*
* @example
* var frustum = new Cesium.PerspectiveOffCenterFrustum({
* left : -1.0,
* right : 1.0,
* top : 1.0,
* bottom : -1.0,
* near : 1.0,
* far : 100.0
* });
*
* @see PerspectiveFrustum
*/
function PerspectiveOffCenterFrustum(options) {
options = when.defaultValue(options, when.defaultValue.EMPTY_OBJECT);
/**
* Defines the left clipping plane.
* @type {Number}
* @default undefined
*/
this.left = options.left;
this._left = undefined;
/**
* Defines the right clipping plane.
* @type {Number}
* @default undefined
*/
this.right = options.right;
this._right = undefined;
/**
* Defines the top clipping plane.
* @type {Number}
* @default undefined
*/
this.top = options.top;
this._top = undefined;
/**
* Defines the bottom clipping plane.
* @type {Number}
* @default undefined
*/
this.bottom = options.bottom;
this._bottom = undefined;
/**
* The distance of the near plane.
* @type {Number}
* @default 1.0
*/
this.near = when.defaultValue(options.near, 1.0);
this._near = this.near;
/**
* The distance of the far plane.
* @type {Number}
* @default 500000000.0
*/
this.far = when.defaultValue(options.far, 500000000.0);
this._far = this.far;
this._cullingVolume = new CullingVolume();
this._perspectiveMatrix = new Transforms.Matrix4();
this._infinitePerspective = new Transforms.Matrix4();
}
function update$1(frustum) {
//>>includeStart('debug', pragmas.debug);
if (
!when.defined(frustum.right) ||
!when.defined(frustum.left) ||
!when.defined(frustum.top) ||
!when.defined(frustum.bottom) ||
!when.defined(frustum.near) ||
!when.defined(frustum.far)
) {
throw new Check.DeveloperError(
"right, left, top, bottom, near, or far parameters are not set."
);
}
//>>includeEnd('debug');
var t = frustum.top;
var b = frustum.bottom;
var r = frustum.right;
var l = frustum.left;
var n = frustum.near;
var f = frustum.far;
if (
t !== frustum._top ||
b !== frustum._bottom ||
l !== frustum._left ||
r !== frustum._right ||
n !== frustum._near ||
f !== frustum._far
) {
//>>includeStart('debug', pragmas.debug);
if (frustum.near <= 0 || frustum.near > frustum.far) {
throw new Check.DeveloperError(
"near must be greater than zero and less than far."
);
}
//>>includeEnd('debug');
frustum._left = l;
frustum._right = r;
frustum._top = t;
frustum._bottom = b;
frustum._near = n;
frustum._far = f;
frustum._perspectiveMatrix = Transforms.Matrix4.computePerspectiveOffCenter(
l,
r,
b,
t,
n,
f,
frustum._perspectiveMatrix
);
frustum._infinitePerspective = Transforms.Matrix4.computeInfinitePerspectiveOffCenter(
l,
r,
b,
t,
n,
frustum._infinitePerspective
);
}
}
Object.defineProperties(PerspectiveOffCenterFrustum.prototype, {
/**
* Gets the perspective projection matrix computed from the view frustum.
* @memberof PerspectiveOffCenterFrustum.prototype
* @type {Matrix4}
* @readonly
*
* @see PerspectiveOffCenterFrustum#infiniteProjectionMatrix
*/
projectionMatrix: {
get: function () {
update$1(this);
return this._perspectiveMatrix;
},
},
/**
* Gets the perspective projection matrix computed from the view frustum with an infinite far plane.
* @memberof PerspectiveOffCenterFrustum.prototype
* @type {Matrix4}
* @readonly
*
* @see PerspectiveOffCenterFrustum#projectionMatrix
*/
infiniteProjectionMatrix: {
get: function () {
update$1(this);
return this._infinitePerspective;
},
},
});
var getPlanesRight = new Cartesian2.Cartesian3();
var getPlanesNearCenter = new Cartesian2.Cartesian3();
var getPlanesFarCenter = new Cartesian2.Cartesian3();
var getPlanesNormal = new Cartesian2.Cartesian3();
/**
* Creates a culling volume for this frustum.
*
* @param {Cartesian3} position The eye position.
* @param {Cartesian3} direction The view direction.
* @param {Cartesian3} up The up direction.
* @returns {CullingVolume} A culling volume at the given position and orientation.
*
* @example
* // Check if a bounding volume intersects the frustum.
* var cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);
* var intersect = cullingVolume.computeVisibility(boundingVolume);
*/
PerspectiveOffCenterFrustum.prototype.computeCullingVolume = function (
position,
direction,
up
) {
//>>includeStart('debug', pragmas.debug);
if (!when.defined(position)) {
throw new Check.DeveloperError("position is required.");
}
if (!when.defined(direction)) {
throw new Check.DeveloperError("direction is required.");
}
if (!when.defined(up)) {
throw new Check.DeveloperError("up is required.");
}
//>>includeEnd('debug');
var planes = this._cullingVolume.planes;
var t = this.top;
var b = this.bottom;
var r = this.right;
var l = this.left;
var n = this.near;
var f = this.far;
var right = Cartesian2.Cartesian3.cross(direction, up, getPlanesRight);
var nearCenter = getPlanesNearCenter;
Cartesian2.Cartesian3.multiplyByScalar(direction, n, nearCenter);
Cartesian2.Cartesian3.add(position, nearCenter, nearCenter);
var farCenter = getPlanesFarCenter;
Cartesian2.Cartesian3.multiplyByScalar(direction, f, farCenter);
Cartesian2.Cartesian3.add(position, farCenter, farCenter);
var normal = getPlanesNormal;
//Left plane computation
Cartesian2.Cartesian3.multiplyByScalar(right, l, normal);
Cartesian2.Cartesian3.add(nearCenter, normal, normal);
Cartesian2.Cartesian3.subtract(normal, position, normal);
Cartesian2.Cartesian3.normalize(normal, normal);
Cartesian2.Cartesian3.cross(normal, up, normal);
Cartesian2.Cartesian3.normalize(normal, normal);
var plane = planes[0];
if (!when.defined(plane)) {
plane = planes[0] = new Transforms.Cartesian4();
}
plane.x = normal.x;
plane.y = normal.y;
plane.z = normal.z;
plane.w = -Cartesian2.Cartesian3.dot(normal, position);
//Right plane computation
Cartesian2.Cartesian3.multiplyByScalar(right, r, normal);
Cartesian2.Cartesian3.add(nearCenter, normal, normal);
Cartesian2.Cartesian3.subtract(normal, position, normal);
Cartesian2.Cartesian3.cross(up, normal, normal);
Cartesian2.Cartesian3.normalize(normal, normal);
plane = planes[1];
if (!when.defined(plane)) {
plane = planes[1] = new Transforms.Cartesian4();
}
plane.x = normal.x;
plane.y = normal.y;
plane.z = normal.z;
plane.w = -Cartesian2.Cartesian3.dot(normal, position);
//Bottom plane computation
Cartesian2.Cartesian3.multiplyByScalar(up, b, normal);
Cartesian2.Cartesian3.add(nearCenter, normal, normal);
Cartesian2.Cartesian3.subtract(normal, position, normal);
Cartesian2.Cartesian3.cross(right, normal, normal);
Cartesian2.Cartesian3.normalize(normal, normal);
plane = planes[2];
if (!when.defined(plane)) {
plane = planes[2] = new Transforms.Cartesian4();
}
plane.x = normal.x;
plane.y = normal.y;
plane.z = normal.z;
plane.w = -Cartesian2.Cartesian3.dot(normal, position);
//Top plane computation
Cartesian2.Cartesian3.multiplyByScalar(up, t, normal);
Cartesian2.Cartesian3.add(nearCenter, normal, normal);
Cartesian2.Cartesian3.subtract(normal, position, normal);
Cartesian2.Cartesian3.cross(normal, right, normal);
Cartesian2.Cartesian3.normalize(normal, normal);
plane = planes[3];
if (!when.defined(plane)) {
plane = planes[3] = new Transforms.Cartesian4();
}
plane.x = normal.x;
plane.y = normal.y;
plane.z = normal.z;
plane.w = -Cartesian2.Cartesian3.dot(normal, position);
//Near plane computation
plane = planes[4];
if (!when.defined(plane)) {
plane = planes[4] = new Transforms.Cartesian4();
}
plane.x = direction.x;
plane.y = direction.y;
plane.z = direction.z;
plane.w = -Cartesian2.Cartesian3.dot(direction, nearCenter);
//Far plane computation
Cartesian2.Cartesian3.negate(direction, normal);
plane = planes[5];
if (!when.defined(plane)) {
plane = planes[5] = new Transforms.Cartesian4();
}
plane.x = normal.x;
plane.y = normal.y;
plane.z = normal.z;
plane.w = -Cartesian2.Cartesian3.dot(normal, farCenter);
return this._cullingVolume;
};
/**
* Returns the pixel's width and height in meters.
*
* @param {Number} drawingBufferWidth The width of the drawing buffer.
* @param {Number} drawingBufferHeight The height of the drawing buffer.
* @param {Number} distance The distance to the near plane in meters.
* @param {Number} pixelRatio The scaling factor from pixel space to coordinate space.
* @param {Cartesian2} result The object onto which to store the result.
* @returns {Cartesian2} The modified result parameter or a new instance of {@link Cartesian2} with the pixel's width and height in the x and y properties, respectively.
*
* @exception {DeveloperError} drawingBufferWidth must be greater than zero.
* @exception {DeveloperError} drawingBufferHeight must be greater than zero.
* @exception {DeveloperError} pixelRatio must be greater than zero.
*
* @example
* // Example 1
* // Get the width and height of a pixel.
* var pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 1.0, scene.pixelRatio, new Cesium.Cartesian2());
*
* @example
* // Example 2
* // Get the width and height of a pixel if the near plane was set to 'distance'.
* // For example, get the size of a pixel of an image on a billboard.
* var position = camera.position;
* var direction = camera.direction;
* var toCenter = Cesium.Cartesian3.subtract(primitive.boundingVolume.center, position, new Cesium.Cartesian3()); // vector from camera to a primitive
* var toCenterProj = Cesium.Cartesian3.multiplyByScalar(direction, Cesium.Cartesian3.dot(direction, toCenter), new Cesium.Cartesian3()); // project vector onto camera direction vector
* var distance = Cesium.Cartesian3.magnitude(toCenterProj);
* var pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, distance, scene.pixelRatio, new Cesium.Cartesian2());
*/
PerspectiveOffCenterFrustum.prototype.getPixelDimensions = function (
drawingBufferWidth,
drawingBufferHeight,
distance,
pixelRatio,
result
) {
update$1(this);
//>>includeStart('debug', pragmas.debug);
if (!when.defined(drawingBufferWidth) || !when.defined(drawingBufferHeight)) {
throw new Check.DeveloperError(
"Both drawingBufferWidth and drawingBufferHeight are required."
);
}
if (drawingBufferWidth <= 0) {
throw new Check.DeveloperError("drawingBufferWidth must be greater than zero.");
}
if (drawingBufferHeight <= 0) {
throw new Check.DeveloperError("drawingBufferHeight must be greater than zero.");
}
if (!when.defined(distance)) {
throw new Check.DeveloperError("distance is required.");
}
if (!when.defined(pixelRatio)) {
throw new Check.DeveloperError("pixelRatio is required");
}
if (pixelRatio <= 0) {
throw new Check.DeveloperError("pixelRatio must be greater than zero.");
}
if (!when.defined(result)) {
throw new Check.DeveloperError("A result object is required.");
}
//>>includeEnd('debug');
var inverseNear = 1.0 / this.near;
var tanTheta = this.top * inverseNear;
var pixelHeight =
(2.0 * pixelRatio * distance * tanTheta) / drawingBufferHeight;
tanTheta = this.right * inverseNear;
var pixelWidth =
(2.0 * pixelRatio * distance * tanTheta) / drawingBufferWidth;
result.x = pixelWidth;
result.y = pixelHeight;
return result;
};
/**
* Returns a duplicate of a PerspectiveOffCenterFrustum instance.
*
* @param {PerspectiveOffCenterFrustum} [result] The object onto which to store the result.
* @returns {PerspectiveOffCenterFrustum} The modified result parameter or a new PerspectiveFrustum instance if one was not provided.
*/
PerspectiveOffCenterFrustum.prototype.clone = function (result) {
if (!when.defined(result)) {
result = new PerspectiveOffCenterFrustum();
}
result.right = this.right;
result.left = this.left;
result.top = this.top;
result.bottom = this.bottom;
result.near = this.near;
result.far = this.far;
// force update of clone to compute matrices
result._left = undefined;
result._right = undefined;
result._top = undefined;
result._bottom = undefined;
result._near = undefined;
result._far = undefined;
return result;
};
/**
* Compares the provided PerspectiveOffCenterFrustum componentwise and returns
* <code>true</code> if they are equal, <code>false</code> otherwise.
*
* @param {PerspectiveOffCenterFrustum} [other] The right hand side PerspectiveOffCenterFrustum.
* @returns {Boolean} <code>true</code> if they are equal, <code>false</code> otherwise.
*/
PerspectiveOffCenterFrustum.prototype.equals = function (other) {
return (
when.defined(other) &&
other instanceof PerspectiveOffCenterFrustum &&
this.right === other.right &&
this.left === other.left &&
this.top === other.top &&
this.bottom === other.bottom &&
this.near === other.near &&
this.far === other.far
);
};
/**
* Compares the provided PerspectiveOffCenterFrustum componentwise and returns
* <code>true</code> if they pass an absolute or relative tolerance test,
* <code>false</code> otherwise.
*
* @param {PerspectiveOffCenterFrustum} other The right hand side PerspectiveOffCenterFrustum.
* @param {Number} relativeEpsilon The relative epsilon tolerance to use for equality testing.
* @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.
* @returns {Boolean} <code>true</code> if this and other are within the provided epsilon, <code>false</code> otherwise.
*/
PerspectiveOffCenterFrustum.prototype.equalsEpsilon = function (
other,
relativeEpsilon,
absoluteEpsilon
) {
return (
other === this ||
(when.defined(other) &&
other instanceof PerspectiveOffCenterFrustum &&
_Math.CesiumMath.equalsEpsilon(
this.right,
other.right,
relativeEpsilon,
absoluteEpsilon
) &&
_Math.CesiumMath.equalsEpsilon(
this.left,
other.left,
relativeEpsilon,
absoluteEpsilon
) &&
_Math.CesiumMath.equalsEpsilon(
this.top,
other.top,
relativeEpsilon,
absoluteEpsilon
) &&
_Math.CesiumMath.equalsEpsilon(
this.bottom,
other.bottom,
relativeEpsilon,
absoluteEpsilon
) &&
_Math.CesiumMath.equalsEpsilon(
this.near,
other.near,
relativeEpsilon,
absoluteEpsilon
) &&
_Math.CesiumMath.equalsEpsilon(
this.far,
other.far,
relativeEpsilon,
absoluteEpsilon
))
);
};
/**
* The viewing frustum is defined by 6 planes.
* Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components
* define the unit vector normal to the plane, and the w component is the distance of the
* plane from the origin/camera position.
*
* @alias PerspectiveFrustum
* @constructor
*
* @param {Object} [options] An object with the following properties:
* @param {Number} [options.fov] The angle of the field of view (FOV), in radians.
* @param {Number} [options.aspectRatio] The aspect ratio of the frustum's width to it's height.
* @param {Number} [options.near=1.0] The distance of the near plane.
* @param {Number} [options.far=500000000.0] The distance of the far plane.
* @param {Number} [options.xOffset=0.0] The offset in the x direction.
* @param {Number} [options.yOffset=0.0] The offset in the y direction.
*
* @example
* var frustum = new Cesium.PerspectiveFrustum({
* fov : Cesium.Math.PI_OVER_THREE,
* aspectRatio : canvas.clientWidth / canvas.clientHeight
* near : 1.0,
* far : 1000.0
* });
*
* @see PerspectiveOffCenterFrustum
*/
function PerspectiveFrustum(options) {
options = when.defaultValue(options, when.defaultValue.EMPTY_OBJECT);
this._offCenterFrustum = new PerspectiveOffCenterFrustum();
/**
* The angle of the field of view (FOV), in radians. This angle will be used
* as the horizontal FOV if the width is greater than the height, otherwise
* it will be the vertical FOV.
* @type {Number}
* @default undefined
*/
this.fov = options.fov;
this._fov = undefined;
this._fovy = undefined;
this._sseDenominator = undefined;
/**
* The aspect ratio of the frustum's width to it's height.
* @type {Number}
* @default undefined
*/
this.aspectRatio = options.aspectRatio;
this._aspectRatio = undefined;
/**
* The distance of the near plane.
* @type {Number}
* @default 1.0
*/
this.near = when.defaultValue(options.near, 1.0);
this._near = this.near;
/**
* The distance of the far plane.
* @type {Number}
* @default 500000000.0
*/
this.far = when.defaultValue(options.far, 500000000.0);
this._far = this.far;
/**
* Offsets the frustum in the x direction.
* @type {Number}
* @default 0.0
*/
this.xOffset = when.defaultValue(options.xOffset, 0.0);
this._xOffset = this.xOffset;
/**
* Offsets the frustum in the y direction.
* @type {Number}
* @default 0.0
*/
this.yOffset = when.defaultValue(options.yOffset, 0.0);
this._yOffset = this.yOffset;
}
/**
* The number of elements used to pack the object into an array.
* @type {Number}
*/
PerspectiveFrustum.packedLength = 6;
/**
* Stores the provided instance into the provided array.
*
* @param {PerspectiveFrustum} value The value to pack.
* @param {Number[]} array The array to pack into.
* @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
*
* @returns {Number[]} The array that was packed into
*/
PerspectiveFrustum.pack = function (value, array, startingIndex) {
//>>includeStart('debug', pragmas.debug);
Check.Check.typeOf.object("value", value);
Check.Check.defined("array", array);
//>>includeEnd('debug');
startingIndex = when.defaultValue(startingIndex, 0);
array[startingIndex++] = value.fov;
array[startingIndex++] = value.aspectRatio;
array[startingIndex++] = value.near;
array[startingIndex++] = value.far;
array[startingIndex++] = value.xOffset;
array[startingIndex] = value.yOffset;
return array;
};
/**
* Retrieves an instance from a packed array.
*
* @param {Number[]} array The packed array.
* @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
* @param {PerspectiveFrustum} [result] The object into which to store the result.
* @returns {PerspectiveFrustum} The modified result parameter or a new PerspectiveFrustum instance if one was not provided.
*/
PerspectiveFrustum.unpack = function (array, startingIndex, result) {
//>>includeStart('debug', pragmas.debug);
Check.Check.defined("array", array);
//>>includeEnd('debug');
startingIndex = when.defaultValue(startingIndex, 0);
if (!when.defined(result)) {
result = new PerspectiveFrustum();
}
result.fov = array[startingIndex++];
result.aspectRatio = array[startingIndex++];
result.near = array[startingIndex++];
result.far = array[startingIndex++];
result.xOffset = array[startingIndex++];
result.yOffset = array[startingIndex];
return result;
};
function update(frustum) {
//>>includeStart('debug', pragmas.debug);
if (
!when.defined(frustum.fov) ||
!when.defined(frustum.aspectRatio) ||
!when.defined(frustum.near) ||
!when.defined(frustum.far)
) {
throw new Check.DeveloperError(
"fov, aspectRatio, near, or far parameters are not set."
);
}
//>>includeEnd('debug');
var f = frustum._offCenterFrustum;
if (
frustum.fov !== frustum._fov ||
frustum.aspectRatio !== frustum._aspectRatio ||
frustum.near !== frustum._near ||
frustum.far !== frustum._far ||
frustum.xOffset !== frustum._xOffset ||
frustum.yOffset !== frustum._yOffset
) {
//>>includeStart('debug', pragmas.debug);
if (frustum.fov < 0 || frustum.fov >= Math.PI) {
throw new Check.DeveloperError("fov must be in the range [0, PI).");
}
if (frustum.aspectRatio < 0) {
throw new Check.DeveloperError("aspectRatio must be positive.");
}
if (frustum.near < 0 || frustum.near > frustum.far) {
throw new Check.DeveloperError(
"near must be greater than zero and less than far."
);
}
//>>includeEnd('debug');
frustum._aspectRatio = frustum.aspectRatio;
frustum._fov = frustum.fov;
frustum._fovy =
frustum.aspectRatio <= 1
? frustum.fov
: Math.atan(Math.tan(frustum.fov * 0.5) / frustum.aspectRatio) * 2.0;
frustum._near = frustum.near;
frustum._far = frustum.far;
frustum._sseDenominator = 2.0 * Math.tan(0.5 * frustum._fovy);
frustum._xOffset = frustum.xOffset;
frustum._yOffset = frustum.yOffset;
f.top = frustum.near * Math.tan(0.5 * frustum._fovy);
f.bottom = -f.top;
f.right = frustum.aspectRatio * f.top;
f.left = -f.right;
f.near = frustum.near;
f.far = frustum.far;
f.right += frustum.xOffset;
f.left += frustum.xOffset;
f.top += frustum.yOffset;
f.bottom += frustum.yOffset;
}
}
Object.defineProperties(PerspectiveFrustum.prototype, {
/**
* Gets the perspective projection matrix computed from the view frustum.
* @memberof PerspectiveFrustum.prototype
* @type {Matrix4}
* @readonly
*
* @see PerspectiveFrustum#infiniteProjectionMatrix
*/
projectionMatrix: {
get: function () {
update(this);
return this._offCenterFrustum.projectionMatrix;
},
},
/**
* The perspective projection matrix computed from the view frustum with an infinite far plane.
* @memberof PerspectiveFrustum.prototype
* @type {Matrix4}
* @readonly
*
* @see PerspectiveFrustum#projectionMatrix
*/
infiniteProjectionMatrix: {
get: function () {
update(this);
return this._offCenterFrustum.infiniteProjectionMatrix;
},
},
/**
* Gets the angle of the vertical field of view, in radians.
* @memberof PerspectiveFrustum.prototype
* @type {Number}
* @readonly
* @default undefined
*/
fovy: {
get: function () {
update(this);
return this._fovy;
},
},
/**
* @readonly
* @private
*/
sseDenominator: {
get: function () {
update(this);
return this._sseDenominator;
},
},
});
/**
* Creates a culling volume for this frustum.
*
* @param {Cartesian3} position The eye position.
* @param {Cartesian3} direction The view direction.
* @param {Cartesian3} up The up direction.
* @returns {CullingVolume} A culling volume at the given position and orientation.
*
* @example
* // Check if a bounding volume intersects the frustum.
* var cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);
* var intersect = cullingVolume.computeVisibility(boundingVolume);
*/
PerspectiveFrustum.prototype.computeCullingVolume = function (
position,
direction,
up
) {
update(this);
return this._offCenterFrustum.computeCullingVolume(position, direction, up);
};
/**
* Returns the pixel's width and height in meters.
*
* @param {Number} drawingBufferWidth The width of the drawing buffer.
* @param {Number} drawingBufferHeight The height of the drawing buffer.
* @param {Number} distance The distance to the near plane in meters.
* @param {Number} pixelRatio The scaling factor from pixel space to coordinate space.
* @param {Cartesian2} result The object onto which to store the result.
* @returns {Cartesian2} The modified result parameter or a new instance of {@link Cartesian2} with the pixel's width and height in the x and y properties, respectively.
*
* @exception {DeveloperError} drawingBufferWidth must be greater than zero.
* @exception {DeveloperError} drawingBufferHeight must be greater than zero.
* @exception {DeveloperError} pixelRatio must be greater than zero.
*
* @example
* // Example 1
* // Get the width and height of a pixel.
* var pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 1.0, scene.pixelRatio, new Cesium.Cartesian2());
*
* @example
* // Example 2
* // Get the width and height of a pixel if the near plane was set to 'distance'.
* // For example, get the size of a pixel of an image on a billboard.
* var position = camera.position;
* var direction = camera.direction;
* var toCenter = Cesium.Cartesian3.subtract(primitive.boundingVolume.center, position, new Cesium.Cartesian3()); // vector from camera to a primitive
* var toCenterProj = Cesium.Cartesian3.multiplyByScalar(direction, Cesium.Cartesian3.dot(direction, toCenter), new Cesium.Cartesian3()); // project vector onto camera direction vector
* var distance = Cesium.Cartesian3.magnitude(toCenterProj);
* var pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, distance, scene.pixelRatio, new Cesium.Cartesian2());
*/
PerspectiveFrustum.prototype.getPixelDimensions = function (
drawingBufferWidth,
drawingBufferHeight,
distance,
pixelRatio,
result
) {
update(this);
return this._offCenterFrustum.getPixelDimensions(
drawingBufferWidth,
drawingBufferHeight,
distance,
pixelRatio,
result
);
};
/**
* Returns a duplicate of a PerspectiveFrustum instance.
*
* @param {PerspectiveFrustum} [result] The object onto which to store the result.
* @returns {PerspectiveFrustum} The modified result parameter or a new PerspectiveFrustum instance if one was not provided.
*/
PerspectiveFrustum.prototype.clone = function (result) {
if (!when.defined(result)) {
result = new PerspectiveFrustum();
}
result.aspectRatio = this.aspectRatio;
result.fov = this.fov;
result.near = this.near;
result.far = this.far;
// force update of clone to compute matrices
result._aspectRatio = undefined;
result._fov = undefined;
result._near = undefined;
result._far = undefined;
this._offCenterFrustum.clone(result._offCenterFrustum);
return result;
};
/**
* Compares the provided PerspectiveFrustum componentwise and returns
* <code>true</code> if they are equal, <code>false</code> otherwise.
*
* @param {PerspectiveFrustum} [other] The right hand side PerspectiveFrustum.
* @returns {Boolean} <code>true</code> if they are equal, <code>false</code> otherwise.
*/
PerspectiveFrustum.prototype.equals = function (other) {
if (!when.defined(other) || !(other instanceof PerspectiveFrustum)) {
return false;
}
update(this);
update(other);
return (
this.fov === other.fov &&
this.aspectRatio === other.aspectRatio &&
this._offCenterFrustum.equals(other._offCenterFrustum)
);
};
/**
* Compares the provided PerspectiveFrustum componentwise and returns
* <code>true</code> if they pass an absolute or relative tolerance test,
* <code>false</code> otherwise.
*
* @param {PerspectiveFrustum} other The right hand side PerspectiveFrustum.
* @param {Number} relativeEpsilon The relative epsilon tolerance to use for equality testing.
* @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.
* @returns {Boolean} <code>true</code> if this and other are within the provided epsilon, <code>false</code> otherwise.
*/
PerspectiveFrustum.prototype.equalsEpsilon = function (
other,
relativeEpsilon,
absoluteEpsilon
) {
if (!when.defined(other) || !(other instanceof PerspectiveFrustum)) {
return false;
}
update(this);
update(other);
return (
_Math.CesiumMath.equalsEpsilon(
this.fov,
other.fov,
relativeEpsilon,
absoluteEpsilon
) &&
_Math.CesiumMath.equalsEpsilon(
this.aspectRatio,
other.aspectRatio,
relativeEpsilon,
absoluteEpsilon
) &&
this._offCenterFrustum.equalsEpsilon(
other._offCenterFrustum,
relativeEpsilon,
absoluteEpsilon
)
);
};
var PERSPECTIVE = 0;
var ORTHOGRAPHIC = 1;
/**
* Describes a frustum at the given the origin and orientation.
*
* @alias FrustumGeometry
* @constructor
*
* @param {Object} options Object with the following properties:
* @param {PerspectiveFrustum|OrthographicFrustum} options.frustum The frustum.
* @param {Cartesian3} options.origin The origin of the frustum.
* @param {Quaternion} options.orientation The orientation of the frustum.
* @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
*/
function FrustumGeometry(options) {
//>>includeStart('debug', pragmas.debug);
Check.Check.typeOf.object("options", options);
Check.Check.typeOf.object("options.frustum", options.frustum);
Check.Check.typeOf.object("options.origin", options.origin);
Check.Check.typeOf.object("options.orientation", options.orientation);
//>>includeEnd('debug');
var frustum = options.frustum;
var orientation = options.orientation;
var origin = options.origin;
var vertexFormat = when.defaultValue(options.vertexFormat, VertexFormat.VertexFormat.DEFAULT);
// This is private because it is used by DebugCameraPrimitive to draw a multi-frustum by
// creating multiple FrustumGeometrys. This way the near plane of one frustum doesn't overlap
// the far plane of another.
var drawNearPlane = when.defaultValue(options._drawNearPlane, true);
var frustumType;
var frustumPackedLength;
if (frustum instanceof PerspectiveFrustum) {
frustumType = PERSPECTIVE;
frustumPackedLength = PerspectiveFrustum.packedLength;
} else if (frustum instanceof OrthographicFrustum) {
frustumType = ORTHOGRAPHIC;
frustumPackedLength = OrthographicFrustum.packedLength;
}
this._frustumType = frustumType;
this._frustum = frustum.clone();
this._origin = Cartesian2.Cartesian3.clone(origin);
this._orientation = Transforms.Quaternion.clone(orientation);
this._drawNearPlane = drawNearPlane;
this._vertexFormat = vertexFormat;
this._workerName = "createFrustumGeometry";
/**
* The number of elements used to pack the object into an array.
* @type {Number}
*/
this.packedLength =
2 +
frustumPackedLength +
Cartesian2.Cartesian3.packedLength +
Transforms.Quaternion.packedLength +
VertexFormat.VertexFormat.packedLength;
}
/**
* Stores the provided instance into the provided array.
*
* @param {FrustumGeometry} value The value to pack.
* @param {Number[]} array The array to pack into.
* @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
*
* @returns {Number[]} The array that was packed into
*/
FrustumGeometry.pack = function (value, array, startingIndex) {
//>>includeStart('debug', pragmas.debug);
Check.Check.typeOf.object("value", value);
Check.Check.defined("array", array);
//>>includeEnd('debug');
startingIndex = when.defaultValue(startingIndex, 0);
var frustumType = value._frustumType;
var frustum = value._frustum;
array[startingIndex++] = frustumType;
if (frustumType === PERSPECTIVE) {
PerspectiveFrustum.pack(frustum, array, startingIndex);
startingIndex += PerspectiveFrustum.packedLength;
} else {
OrthographicFrustum.pack(frustum, array, startingIndex);
startingIndex += OrthographicFrustum.packedLength;
}
Cartesian2.Cartesian3.pack(value._origin, array, startingIndex);
startingIndex += Cartesian2.Cartesian3.packedLength;
Transforms.Quaternion.pack(value._orientation, array, startingIndex);
startingIndex += Transforms.Quaternion.packedLength;
VertexFormat.VertexFormat.pack(value._vertexFormat, array, startingIndex);
startingIndex += VertexFormat.VertexFormat.packedLength;
array[startingIndex] = value._drawNearPlane ? 1.0 : 0.0;
return array;
};
var scratchPackPerspective = new PerspectiveFrustum();
var scratchPackOrthographic = new OrthographicFrustum();
var scratchPackQuaternion = new Transforms.Quaternion();
var scratchPackorigin = new Cartesian2.Cartesian3();
var scratchVertexFormat = new VertexFormat.VertexFormat();
/**
* Retrieves an instance from a packed array.
*
* @param {Number[]} array The packed array.
* @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
* @param {FrustumGeometry} [result] The object into which to store the result.
*/
FrustumGeometry.unpack = function (array, startingIndex, result) {
//>>includeStart('debug', pragmas.debug);
Check.Check.defined("array", array);
//>>includeEnd('debug');
startingIndex = when.defaultValue(startingIndex, 0);
var frustumType = array[startingIndex++];
var frustum;
if (frustumType === PERSPECTIVE) {
frustum = PerspectiveFrustum.unpack(
array,
startingIndex,
scratchPackPerspective
);
startingIndex += PerspectiveFrustum.packedLength;
} else {
frustum = OrthographicFrustum.unpack(
array,
startingIndex,
scratchPackOrthographic
);
startingIndex += OrthographicFrustum.packedLength;
}
var origin = Cartesian2.Cartesian3.unpack(array, startingIndex, scratchPackorigin);
startingIndex += Cartesian2.Cartesian3.packedLength;
var orientation = Transforms.Quaternion.unpack(
array,
startingIndex,
scratchPackQuaternion
);
startingIndex += Transforms.Quaternion.packedLength;
var vertexFormat = VertexFormat.VertexFormat.unpack(
array,
startingIndex,
scratchVertexFormat
);
startingIndex += VertexFormat.VertexFormat.packedLength;
var drawNearPlane = array[startingIndex] === 1.0;
if (!when.defined(result)) {
return new FrustumGeometry({
frustum: frustum,
origin: origin,
orientation: orientation,
vertexFormat: vertexFormat,
_drawNearPlane: drawNearPlane,
});
}
var frustumResult =
frustumType === result._frustumType ? result._frustum : undefined;
result._frustum = frustum.clone(frustumResult);
result._frustumType = frustumType;
result._origin = Cartesian2.Cartesian3.clone(origin, result._origin);
result._orientation = Transforms.Quaternion.clone(orientation, result._orientation);
result._vertexFormat = VertexFormat.VertexFormat.clone(vertexFormat, result._vertexFormat);
result._drawNearPlane = drawNearPlane;
return result;
};
function getAttributes(
offset,
normals,
tangents,
bitangents,
st,
normal,
tangent,
bitangent
) {
var stOffset = (offset / 3) * 2;
for (var i = 0; i < 4; ++i) {
if (when.defined(normals)) {
normals[offset] = normal.x;
normals[offset + 1] = normal.y;
normals[offset + 2] = normal.z;
}
if (when.defined(tangents)) {
tangents[offset] = tangent.x;
tangents[offset + 1] = tangent.y;
tangents[offset + 2] = tangent.z;
}
if (when.defined(bitangents)) {
bitangents[offset] = bitangent.x;
bitangents[offset + 1] = bitangent.y;
bitangents[offset + 2] = bitangent.z;
}
offset += 3;
}
st[stOffset] = 0.0;
st[stOffset + 1] = 0.0;
st[stOffset + 2] = 1.0;
st[stOffset + 3] = 0.0;
st[stOffset + 4] = 1.0;
st[stOffset + 5] = 1.0;
st[stOffset + 6] = 0.0;
st[stOffset + 7] = 1.0;
}
var scratchRotationMatrix = new Transforms.Matrix3();
var scratchViewMatrix = new Transforms.Matrix4();
var scratchInverseMatrix = new Transforms.Matrix4();
var scratchXDirection = new Cartesian2.Cartesian3();
var scratchYDirection = new Cartesian2.Cartesian3();
var scratchZDirection = new Cartesian2.Cartesian3();
var scratchNegativeX = new Cartesian2.Cartesian3();
var scratchNegativeY = new Cartesian2.Cartesian3();
var scratchNegativeZ = new Cartesian2.Cartesian3();
var frustumSplits = new Array(3);
var frustumCornersNDC = new Array(4);
frustumCornersNDC[0] = new Transforms.Cartesian4(-1.0, -1.0, 1.0, 1.0);
frustumCornersNDC[1] = new Transforms.Cartesian4(1.0, -1.0, 1.0, 1.0);
frustumCornersNDC[2] = new Transforms.Cartesian4(1.0, 1.0, 1.0, 1.0);
frustumCornersNDC[3] = new Transforms.Cartesian4(-1.0, 1.0, 1.0, 1.0);
var scratchFrustumCorners = new Array(4);
for (var i = 0; i < 4; ++i) {
scratchFrustumCorners[i] = new Transforms.Cartesian4();
}
FrustumGeometry._computeNearFarPlanes = function (
origin,
orientation,
frustumType,
frustum,
positions,
xDirection,
yDirection,
zDirection
) {
var rotationMatrix = Transforms.Matrix3.fromQuaternion(
orientation,
scratchRotationMatrix
);
var x = when.defaultValue(xDirection, scratchXDirection);
var y = when.defaultValue(yDirection, scratchYDirection);
var z = when.defaultValue(zDirection, scratchZDirection);
x = Transforms.Matrix3.getColumn(rotationMatrix, 0, x);
y = Transforms.Matrix3.getColumn(rotationMatrix, 1, y);
z = Transforms.Matrix3.getColumn(rotationMatrix, 2, z);
Cartesian2.Cartesian3.normalize(x, x);
Cartesian2.Cartesian3.normalize(y, y);
Cartesian2.Cartesian3.normalize(z, z);
Cartesian2.Cartesian3.negate(x, x);
var view = Transforms.Matrix4.computeView(origin, z, y, x, scratchViewMatrix);
var inverseView;
var inverseViewProjection;
if (frustumType === PERSPECTIVE) {
var projection = frustum.projectionMatrix;
var viewProjection = Transforms.Matrix4.multiply(
projection,
view,
scratchInverseMatrix
);
inverseViewProjection = Transforms.Matrix4.inverse(
viewProjection,
scratchInverseMatrix
);
} else {
inverseView = Transforms.Matrix4.inverseTransformation(view, scratchInverseMatrix);
}
if (when.defined(inverseViewProjection)) {
frustumSplits[0] = frustum.near;
frustumSplits[1] = frustum.far;
} else {
frustumSplits[0] = 0.0;
frustumSplits[1] = frustum.near;
frustumSplits[2] = frustum.far;
}
for (var i = 0; i < 2; ++i) {
for (var j = 0; j < 4; ++j) {
var corner = Transforms.Cartesian4.clone(
frustumCornersNDC[j],
scratchFrustumCorners[j]
);
if (!when.defined(inverseViewProjection)) {
if (when.defined(frustum._offCenterFrustum)) {
frustum = frustum._offCenterFrustum;
}
var near = frustumSplits[i];
var far = frustumSplits[i + 1];
corner.x =
(corner.x * (frustum.right - frustum.left) +
frustum.left +
frustum.right) *
0.5;
corner.y =
(corner.y * (frustum.top - frustum.bottom) +
frustum.bottom +
frustum.top) *
0.5;
corner.z = (corner.z * (near - far) - near - far) * 0.5;
corner.w = 1.0;
Transforms.Matrix4.multiplyByVector(inverseView, corner, corner);
} else {
corner = Transforms.Matrix4.multiplyByVector(
inverseViewProjection,
corner,
corner
);
// Reverse perspective divide
var w = 1.0 / corner.w;
Cartesian2.Cartesian3.multiplyByScalar(corner, w, corner);
Cartesian2.Cartesian3.subtract(corner, origin, corner);
Cartesian2.Cartesian3.normalize(corner, corner);
var fac = Cartesian2.Cartesian3.dot(z, corner);
Cartesian2.Cartesian3.multiplyByScalar(corner, frustumSplits[i] / fac, corner);
Cartesian2.Cartesian3.add(corner, origin, corner);
}
positions[12 * i + j * 3] = corner.x;
positions[12 * i + j * 3 + 1] = corner.y;
positions[12 * i + j * 3 + 2] = corner.z;
}
}
};
/**
* Computes the geometric representation of a frustum, including its vertices, indices, and a bounding sphere.
*
* @param {FrustumGeometry} frustumGeometry A description of the frustum.
* @returns {Geometry|undefined} The computed vertices and indices.
*/
FrustumGeometry.createGeometry = function (frustumGeometry) {
var frustumType = frustumGeometry._frustumType;
var frustum = frustumGeometry._frustum;
var origin = frustumGeometry._origin;
var orientation = frustumGeometry._orientation;
var drawNearPlane = frustumGeometry._drawNearPlane;
var vertexFormat = frustumGeometry._vertexFormat;
var numberOfPlanes = drawNearPlane ? 6 : 5;
var positions = new Float64Array(3 * 4 * 6);
FrustumGeometry._computeNearFarPlanes(
origin,
orientation,
frustumType,
frustum,
positions
);
// -x plane
var offset = 3 * 4 * 2;
positions[offset] = positions[3 * 4];
positions[offset + 1] = positions[3 * 4 + 1];
positions[offset + 2] = positions[3 * 4 + 2];
positions[offset + 3] = positions[0];
positions[offset + 4] = positions[1];
positions[offset + 5] = positions[2];
positions[offset + 6] = positions[3 * 3];
positions[offset + 7] = positions[3 * 3 + 1];
positions[offset + 8] = positions[3 * 3 + 2];
positions[offset + 9] = positions[3 * 7];
positions[offset + 10] = positions[3 * 7 + 1];
positions[offset + 11] = positions[3 * 7 + 2];
// -y plane
offset += 3 * 4;
positions[offset] = positions[3 * 5];
positions[offset + 1] = positions[3 * 5 + 1];
positions[offset + 2] = positions[3 * 5 + 2];
positions[offset + 3] = positions[3];
positions[offset + 4] = positions[3 + 1];
positions[offset + 5] = positions[3 + 2];
positions[offset + 6] = positions[0];
positions[offset + 7] = positions[1];
positions[offset + 8] = positions[2];
positions[offset + 9] = positions[3 * 4];
positions[offset + 10] = positions[3 * 4 + 1];
positions[offset + 11] = positions[3 * 4 + 2];
// +x plane
offset += 3 * 4;
positions[offset] = positions[3];
positions[offset + 1] = positions[3 + 1];
positions[offset + 2] = positions[3 + 2];
positions[offset + 3] = positions[3 * 5];
positions[offset + 4] = positions[3 * 5 + 1];
positions[offset + 5] = positions[3 * 5 + 2];
positions[offset + 6] = positions[3 * 6];
positions[offset + 7] = positions[3 * 6 + 1];
positions[offset + 8] = positions[3 * 6 + 2];
positions[offset + 9] = positions[3 * 2];
positions[offset + 10] = positions[3 * 2 + 1];
positions[offset + 11] = positions[3 * 2 + 2];
// +y plane
offset += 3 * 4;
positions[offset] = positions[3 * 2];
positions[offset + 1] = positions[3 * 2 + 1];
positions[offset + 2] = positions[3 * 2 + 2];
positions[offset + 3] = positions[3 * 6];
positions[offset + 4] = positions[3 * 6 + 1];
positions[offset + 5] = positions[3 * 6 + 2];
positions[offset + 6] = positions[3 * 7];
positions[offset + 7] = positions[3 * 7 + 1];
positions[offset + 8] = positions[3 * 7 + 2];
positions[offset + 9] = positions[3 * 3];
positions[offset + 10] = positions[3 * 3 + 1];
positions[offset + 11] = positions[3 * 3 + 2];
if (!drawNearPlane) {
positions = positions.subarray(3 * 4);
}
var attributes = new GeometryAttributes.GeometryAttributes({
position: new GeometryAttribute.GeometryAttribute({
componentDatatype: ComponentDatatype.ComponentDatatype.DOUBLE,
componentsPerAttribute: 3,
values: positions,
}),
});
if (
when.defined(vertexFormat.normal) ||
when.defined(vertexFormat.tangent) ||
when.defined(vertexFormat.bitangent) ||
when.defined(vertexFormat.st)
) {
var normals = when.defined(vertexFormat.normal)
? new Float32Array(3 * 4 * numberOfPlanes)
: undefined;
var tangents = when.defined(vertexFormat.tangent)
? new Float32Array(3 * 4 * numberOfPlanes)
: undefined;
var bitangents = when.defined(vertexFormat.bitangent)
? new Float32Array(3 * 4 * numberOfPlanes)
: undefined;
var st = when.defined(vertexFormat.st)
? new Float32Array(2 * 4 * numberOfPlanes)
: undefined;
var x = scratchXDirection;
var y = scratchYDirection;
var z = scratchZDirection;
var negativeX = Cartesian2.Cartesian3.negate(x, scratchNegativeX);
var negativeY = Cartesian2.Cartesian3.negate(y, scratchNegativeY);
var negativeZ = Cartesian2.Cartesian3.negate(z, scratchNegativeZ);
offset = 0;
if (drawNearPlane) {
getAttributes(offset, normals, tangents, bitangents, st, negativeZ, x, y); // near
offset += 3 * 4;
}
getAttributes(offset, normals, tangents, bitangents, st, z, negativeX, y); // far
offset += 3 * 4;
getAttributes(
offset,
normals,
tangents,
bitangents,
st,
negativeX,
negativeZ,
y
); // -x
offset += 3 * 4;
getAttributes(
offset,
normals,
tangents,
bitangents,
st,
negativeY,
negativeZ,
negativeX
); // -y
offset += 3 * 4;
getAttributes(offset, normals, tangents, bitangents, st, x, z, y); // +x
offset += 3 * 4;
getAttributes(offset, normals, tangents, bitangents, st, y, z, negativeX); // +y
if (when.defined(normals)) {
attributes.normal = new GeometryAttribute.GeometryAttribute({
componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
componentsPerAttribute: 3,
values: normals,
});
}
if (when.defined(tangents)) {
attributes.tangent = new GeometryAttribute.GeometryAttribute({
componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
componentsPerAttribute: 3,
values: tangents,
});
}
if (when.defined(bitangents)) {
attributes.bitangent = new GeometryAttribute.GeometryAttribute({
componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
componentsPerAttribute: 3,
values: bitangents,
});
}
if (when.defined(st)) {
attributes.st = new GeometryAttribute.GeometryAttribute({
componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
componentsPerAttribute: 2,
values: st,
});
}
}
var indices = new Uint16Array(6 * numberOfPlanes);
for (var i = 0; i < numberOfPlanes; ++i) {
var indexOffset = i * 6;
var index = i * 4;
indices[indexOffset] = index;
indices[indexOffset + 1] = index + 1;
indices[indexOffset + 2] = index + 2;
indices[indexOffset + 3] = index;
indices[indexOffset + 4] = index + 2;
indices[indexOffset + 5] = index + 3;
}
return new GeometryAttribute.Geometry({
attributes: attributes,
indices: indices,
primitiveType: GeometryAttribute.PrimitiveType.TRIANGLES,
boundingSphere: Transforms.BoundingSphere.fromVertices(positions),
});
};
exports.FrustumGeometry = FrustumGeometry;
exports.OrthographicFrustum = OrthographicFrustum;
exports.PerspectiveFrustum = PerspectiveFrustum;
});
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.