| Current Path : /proc/thread-self/root/proc/thread-self/root/proc/1908984/root/proc/1147586/cwd/ |
| Current File : //proc/thread-self/root/proc/thread-self/root/proc/1908984/root/proc/1147586/cwd/javascript.tar |
hide.js 0000644 00000021000 15234425705 0006013 0 ustar 00 // Angie Radtke 2009 - 2012 thanks to daniel //
/*global window, localStorage, Cookie, altopen, altclose, big, small, rightopen, rightclose, bildauf, bildzu */
function saveIt(name) {
var x = document.getElementById(name).style.display;
if (!x) {
alert('No cookie available');
} else if (localStorage) {
localStorage[name] = x;
}
}
function readIt(name) {
if (localStorage) {
return localStorage[name];
}
}
function wrapperwidth(width) {
jQuery('#wrapper').css('width', width);
}
// add Wai-Aria landmark-roles
jQuery(function($) {
$('#nav').attr('role', 'navigation');
$('input[id^="mod-search-searchword"]').closest('form').attr('role', 'search');
$('#main').attr('role', 'main');
$('#right').attr('role', 'contentinfo');
});
jQuery(function($) {
// get ankers
var $myankers = $('a.opencloselink');
$myankers.each(function() {
var $element = $(this);
$element.attr('role', 'tab');
var myid = $element.attr('id');
myid = myid.split('_');
myid = 'module_' + myid[1];
$element.attr('aria-controls', myid);
});
var $list = $('div.moduletable_js');
$list.each(function() {
var $element = $(this);
if ($element.find('div.module_content').length) {
var $el = $element.find('div.module_content');
$el.attr('role', 'tabpanel');
var myid = $el.attr('id');
myid = myid.split('_');
myid = 'link_' + myid[1];
$el.attr('aria-labelledby', myid);
var myclass = $el.attr('class');
var one = myclass.split(' ');
// search for active menu-item
var $listelement = $el.find('a.active').first();
var unique = $el.attr('id');
var nocookieset = readIt(unique);
if (($listelement.length) || ((one[1] == 'open') && (nocookieset == null))) {
$el.show();
var $eltern = $el.parent();
var $elternh = $eltern.find('h3').first();
var $elternbild = $eltern.find('img').first();
$elternbild.attr('alt', altopen).attr('src', bildzu);
$elternbild.focus();
} else {
$el.hide();
$el.attr('aria-expanded', 'false');
}
unique = $el.attr('id');
var cookieset = readIt(unique);
if (cookieset === 'block') {
$el.show();
$el.attr('aria-expanded', 'true');
}
}
});
});
jQuery(function($) {
var $what = $('#right');
// if rightcolumn
if ($what.length) {
var whatid = $what.attr('id');
var rightcookie = readIt(whatid);
if (rightcookie === 'none') {
$what.hide();
$('#nav').addClass('leftbigger');
wrapperwidth(big);
var $grafik = $('#bild');
$grafik.html(rightopen);
$grafik.focus();
}
}
});
function auf(key) {
var $ = jQuery.noConflict();
var $el = $('#' + key);
if (!$el.is(':visible')) {
$el.show();
$el.attr('aria-expanded', 'true');
if (key !== 'right') {
$el.hide().toggle('slide');
$el.parent().attr('class', 'slide');
$eltern = $el.parent().parent();
$elternh = $eltern.find('h3').first();
$elternh.addClass('high');
$elternbild = $eltern.find('img').first();
$el.focus();
$elternbild.attr('alt', altopen).attr('src', bildzu);
}
if (key === 'right') {
$('#right').show();
wrapperwidth(small);
$('#nav').removeClass('leftbigger');
$grafik = $('#bild');
$('#bild').html(rightclose);
$grafik.focus();
}
} else {
$el.hide();
$el.attr('aria-expanded', 'false');
$el.removeClass('open');
if (key !== 'right') {
$eltern = $el.parent().parent();
$elternh = $eltern.find('h3').first();
$elternh.removeClass('high');
$elternbild = $eltern.find('img').first();
$elternbild.attr('alt', altclose).attr('src', bildauf);
$elternbild.focus();
}
if (key === 'right') {
$('#right').hide();
wrapperwidth(big);
$('#nav').addClass('leftbigger');
$grafik = $('#bild');
$grafik.html(rightopen);
$grafik.focus();
}
}
// write cookie
saveIt(key);
}
// ########### Tabfunctions ####################
jQuery(function($) {
var $alldivs = $('div.tabcontent');
var $outerdivs = $('div.tabouter');
//outerdivs = outerdivs.getProperty('id');
$outerdivs.each(function() {
var $alldivs = $(this).find('div.tabcontent');
var count = 0;
var countankers = 0;
$alldivs.each(function() {
var $el = $(this);
count++;
$el.attr('role', 'tabpanel');
$el.attr('aria-hidden', 'false');
$el.attr('aria-expanded', 'true');
elid = $el.attr('id');
elid = elid.split('_');
elid = 'link_' + elid[1];
$el.attr('aria-labelledby', elid);
if (count !== 1) {
$el.addClass('tabclosed').removeClass('tabopen');
$el.attr('aria-hidden', 'true');
$el.attr('aria-expanded', 'false');
}
});
$allankers = $(this).find('ul.tabs').first().find('a');
$allankers.each(function() {
countankers++;
var $el = $(this);
$el.attr('aria-selected', 'true');
$el.attr('role', 'tab');
linkid = $el.attr('id');
moduleid = linkid.split('_');
moduleid = 'module_' + moduleid[1];
$el.attr('aria-controls', moduleid);
if (countankers != 1) {
$el.addClass('linkclosed').removeClass('linkopen');
$el.attr('aria-selected', 'false');
}
});
});
});
function tabshow(elid) {
var $ = jQuery.noConflict();
var $el = $('#' + elid);
var $outerdiv = $el.parent();
var $alldivs = $outerdiv.find('div.tabcontent');
var $liste = $outerdiv.find('ul.tabs').first();
$liste.find('a').attr('aria-selected', 'false');
$alldivs.each(function() {
var $element = $(this);
$element.addClass('tabclosed').removeClass('tabopen');
$element.attr('aria-hidden', 'true');
$element.attr('aria-expanded', 'false');
});
$el.addClass('tabopen').removeClass('tabclosed');
$el.attr('aria-hidden', 'false');
$el.attr('aria-expanded', 'true');
$el.focus();
var getid = elid.split('_');
var activelink = '#link_' + getid[1];
$(activelink).attr('aria-selected', 'true');
$liste.find('a').addClass('linkclosed').removeClass('linkopen');
$(activelink).addClass('linkopen').removeClass('linkclosed');
}
function nexttab(el) {
var $ = jQuery.noConflict();
var $outerdiv = $('#' + el).parent();
var $liste = $outerdiv.find('ul.tabs').first();
var getid = el.split('_');
var activelink = '#link_' + getid[1];
var aktiverlink = $(activelink).attr('aria-selected');
var $tablinks = $liste.find('a');
for (var i = 0; i < $tablinks.length; i++) {
if ($($tablinks[i]).attr('id') === activelink) {
if ($($tablinks[i + 1]).length) {
$($tablinks[i + 1]).click();
break;
}
}
}
}
// mobilemenuheader
var mobileMenu = function(){
var $ = jQuery.noConflict(), displayed = false, $mobile, $menu, $menuWrapper;
var getX = function() {
return $(document).width();
};
var createElements = function () {
var Openmenu=Joomla.JText._('TPL_BEEZ3_OPENMENU');
var Closemenu=Joomla.JText._('TPL_BEEZ3_CLOSEMENU');
$menu = $("#header").find('ul.menu').first();
$menuWrapper = $('<div>', {id : 'menuwrapper', role: 'menubar'});
// create the menu opener and assign events
$mobile = $('<div>', {id: 'mobile_select'}).html('<h2><a href="#" id="menuopener" onclick="return false;"><span>'+Openmenu+'</span></a></h2>').show();
$mobile.on('click', function(){
var state = $menuWrapper.css('display');
$menuWrapper.slideToggle();
if (state === 'none') {
$('#menuopener').html(Closemenu);
$('#menuwrapper').attr('aria-expanded', 'true').attr('aria-hidden','false');
} else {
$('#menuopener').html(Openmenu);
$('#menuwrapper').attr('aria-expanded', 'false').attr('aria-hidden', 'true');
}
});
// add the menu to the dom
$menu.wrap($menuWrapper);
// add the menuopener to the dom and hide it
$('#header').find('#menuwrapper').first().before($mobile.hide());
$menuWrapper = $('#menuwrapper');
$mobile = $('#mobile_select');
};
var display = function () {
$menuWrapper.hide();
$mobile.show();
displayed = true;
};
var initialize = function () {
// create the elements once
createElements();
// show the elements if the browser size is smaller
if (getX() <= 461 && !displayed) {
display();
}
// react on resize events
$(window).on('resize', function () {
if (getX() >= 461) {
if (displayed) {
$mobile.hide();
$('#menuwrapper').show();
displayed = false;
}
}
if (getX() < 461) {
if (!displayed) {
display();
}
}
});
};
initialize();
};
jQuery(function () {
new mobileMenu();
});
//For discussion and comments, see: http://remysharp.com/2009/01/07/html5-enabling-script/
(function(){if(!/*@cc_on!@*/0)return;var e = "abbr,article,aside,audio,canvas,datalist,details,eventsource,figure,footer,header,hgroup,mark,menu,meter,nav,output,progress,section,time,video".split(','),i=e.length;while(i--){document.createElement(e[i])}})()
index.html 0000644 00000000037 15234425705 0006550 0 ustar 00 <!DOCTYPE html><title></title>
md_stylechanger.js 0000644 00000004621 15234425705 0010264 0 ustar 00 /*global window, localStorage, fontSizeTitle, bigger, reset, smaller, biggerTitle, resetTitle, smallerTitle, Cookie */
var prefsLoaded = false;
var defaultFontSize = 100;
var currentFontSize = defaultFontSize;
Object.append(Browser.Features, {
localstorage: (function() {
return ('localStorage' in window) && window.localStorage !== null;
})()
});
function setFontSize(fontSize) {
document.body.style.fontSize = fontSize + '%';
}
function changeFontSize(sizeDifference) {
currentFontSize = parseInt(currentFontSize, 10) + parseInt(sizeDifference * 5, 10);
if (currentFontSize > 180) {
currentFontSize = 180;
} else if (currentFontSize < 60) {
currentFontSize = 60;
}
setFontSize(currentFontSize);
}
function revertStyles() {
currentFontSize = defaultFontSize;
changeFontSize(0);
}
function writeFontSize(value) {
if (Browser.Features.localstorage) {
localStorage.fontSize = value;
} else {
Cookie.write("fontSize", value, {duration: 180});
}
}
function readFontSize() {
if (Browser.Features.localstorage) {
return localStorage.fontSize;
} else {
return Cookie.read("fontSize");
}
}
function setUserOptions() {
if (!prefsLoaded) {
var size = readFontSize();
currentFontSize = size ? size : defaultFontSize;
setFontSize(currentFontSize);
prefsLoaded = true;
}
}
function addControls() {
var container = document.id('fontsize');
var content = '<h3>'+ fontSizeTitle +'</h3><p><a title="'+ biggerTitle +'" href="#" onclick="changeFontSize(2); return false">'+ bigger +'</a><span class="unseen">.</span><a href="#" title="'+resetTitle+'" onclick="revertStyles(); return false">'+ reset +'</a><span class="unseen">.</span><a href="#" title="'+ smallerTitle +'" onclick="changeFontSize(-2); return false">'+ smaller +'</a></p>';
container.set('html', content);
}
function saveSettings() {
writeFontSize(currentFontSize);
}
window.addEvent('domready', function () {
smaller = Joomla.JText._('TPL_BEEZ3_SMALLER');
fontSizeTitle = Joomla.JText._('TPL_BEEZ3_FONTSIZE');
bigger = Joomla.JText._('TPL_BEEZ3_BIGGER');
reset = Joomla.JText._('TPL_BEEZ3_RESET');
biggerTitle = Joomla.JText._('TPL_BEEZ3_INCREASE_SIZE');
smallerTitle = Joomla.JText._('TPL_BEEZ3_DECREASE_SIZE');
resetTitle = Joomla.JText._('TPL_BEEZ3_REVERT_STYLES_TO_DEFAULT');
});
window.addEvent('domready', setUserOptions);
window.addEvent('domready', addControls);
window.addEvent('unload', saveSettings);
respond.js 0000644 00000022434 15234425705 0006570 0 ustar 00 /*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */
/*! NOTE: If you're already including a window.matchMedia polyfill via Modernizr or otherwise, you don't need this part */
window.matchMedia = window.matchMedia || (function(doc, undefined){
var bool,
docElem = doc.documentElement,
refNode = docElem.firstElementChild || docElem.firstChild,
// fakeBody required for <FF4 when executed in <head>
fakeBody = doc.createElement('body'),
div = doc.createElement('div');
div.id = 'mq-test-1';
div.style.cssText = "position:absolute;top:-100em";
fakeBody.style.background = "none";
fakeBody.appendChild(div);
return function(q){
div.innerHTML = '­<style media="'+q+'"> #mq-test-1 { width: 42px; }</style>';
docElem.insertBefore(fakeBody, refNode);
bool = div.offsetWidth == 42;
docElem.removeChild(fakeBody);
return { matches: bool, media: q };
};
})(document);
/*! Respond.js v1.1.0: min/max-width media query polyfill. (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs */
(function( win ){
//exposed namespace
win.respond = {};
//define update even in native-mq-supporting browsers, to avoid errors
respond.update = function(){};
//expose media query support flag for external use
respond.mediaQueriesSupported = win.matchMedia && win.matchMedia( "only all" ).matches;
//if media queries are supported, exit here
if ( respond.mediaQueriesSupported ){ return; }
//define vars
var doc = win.document,
docElem = doc.documentElement,
mediastyles = [],
rules = [],
appendedEls = [],
parsedSheets = {},
resizeThrottle = 30,
head = doc.getElementsByTagName( "head" )[0] || docElem,
base = doc.getElementsByTagName( "base" )[0],
links = head.getElementsByTagName( "link" ),
requestQueue = [],
// Loop stylesheets, send text content to translate
ripCSS = function(){
var sheets = links,
sl = sheets.length,
i = 0,
// Vars for loop:
sheet, href, media, isCSS;
for( ; i < sl; i++ ){
sheet = sheets[ i ],
href = sheet.href,
media = sheet.media,
isCSS = sheet.rel && sheet.rel.toLowerCase() === "stylesheet";
// Only links plz and prevent re-parsing
if ( !!href && isCSS && !parsedSheets[ href ] ){
// Selectivizr exposes css through the rawCssText expando
if (sheet.styleSheet && sheet.styleSheet.rawCssText) {
translate( sheet.styleSheet.rawCssText, href, media );
parsedSheets[ href ] = true;
} else {
if ( (!/^([a-zA-Z:]*\/\/)/.test( href ) && !base)
|| href.replace( RegExp.$1, "" ).split( "/" )[0] === win.location.host ){
requestQueue.push( {
href: href,
media: media
} );
}
}
}
}
makeRequests();
},
// Recurse through request queue, get css text
makeRequests = function(){
if ( requestQueue.length ){
var thisRequest = requestQueue.shift();
ajax( thisRequest.href, function( styles ){
translate( styles, thisRequest.href, thisRequest.media );
parsedSheets[ thisRequest.href ] = true;
makeRequests();
} );
}
},
// Find media blocks in css text, convert to style blocks
translate = function( styles, href, media ){
var qs = styles.match( /@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi ),
ql = qs && qs.length || 0,
// Try to get CSS path
href = href.substring( 0, href.lastIndexOf( "/" )),
repUrls = function( css ){
return css.replace( /(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g, "$1" + href + "$2$3" );
},
useMedia = !ql && media,
// Vars used in loop
i = 0,
j, fullq, thisq, eachq, eql;
// If path exists, tack on trailing slash
if ( href.length ){ href += "/"; }
/* If no internal queries exist, but media attr does, use that
* note: this currently lacks support for situations where a media attr is specified on a link AND
* its associated stylesheet has internal CSS media queries.
* In those cases, the media attribute will currently be ignored.
*/
if ( useMedia ){
ql = 1;
}
for( ; i < ql; i++ ){
j = 0;
// Media attr
if ( useMedia ){
fullq = media;
rules.push( repUrls( styles ) );
}
// Parse for styles
else{
fullq = qs[ i ].match( /@media *([^\{]+)\{([\S\s]+?)$/ ) && RegExp.$1;
rules.push( RegExp.$2 && repUrls( RegExp.$2 ) );
}
eachq = fullq.split( "," );
eql = eachq.length;
for( ; j < eql; j++ ){
thisq = eachq[ j ];
mediastyles.push( {
media : thisq.split( "(" )[ 0 ].match( /(only\s+)?([a-zA-Z]+)\s?/ ) && RegExp.$2 || "all",
rules : rules.length - 1,
hasquery : thisq.indexOf("(") > -1,
minw : thisq.match( /\(min\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/ ) && parseFloat( RegExp.$1 ) + ( RegExp.$2 || "" ),
maxw : thisq.match( /\(max\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/ ) && parseFloat( RegExp.$1 ) + ( RegExp.$2 || "" )
} );
}
}
applyMedia();
},
lastCall,
resizeDefer,
// Returns the value of 1em in pixels
getEmValue = function() {
var ret,
div = doc.createElement('div'),
body = doc.body,
fakeUsed = false;
div.style.cssText = "position:absolute;font-size:1em;width:1em";
if ( !body ){
body = fakeUsed = doc.createElement( "body" );
body.style.background = "none";
}
body.appendChild( div );
docElem.insertBefore( body, docElem.firstChild );
ret = div.offsetWidth;
if ( fakeUsed ){
docElem.removeChild( body );
}
else {
body.removeChild( div );
}
// Also update eminpx before returning
ret = eminpx = parseFloat(ret);
return ret;
},
// Cached container for 1em value, populated the first time it's needed
eminpx,
// Enable/disable styles
applyMedia = function( fromResize ){
var name = "clientWidth",
docElemProp = docElem[ name ],
currWidth = doc.compatMode === "CSS1Compat" && docElemProp || doc.body[ name ] || docElemProp,
styleBlocks = {},
lastLink = links[ links.length-1 ],
now = (new Date()).getTime();
// Throttle resize calls
if ( fromResize && lastCall && now - lastCall < resizeThrottle ){
clearTimeout( resizeDefer );
resizeDefer = setTimeout( applyMedia, resizeThrottle );
return;
}
else {
lastCall = now;
}
for( var i in mediastyles ){
var thisstyle = mediastyles[ i ],
min = thisstyle.minw,
max = thisstyle.maxw,
minnull = min === null,
maxnull = max === null,
em = "em";
if ( !!min ){
min = parseFloat( min ) * ( min.indexOf( em ) > -1 ? ( eminpx || getEmValue() ) : 1 );
}
if ( !!max ){
max = parseFloat( max ) * ( max.indexOf( em ) > -1 ? ( eminpx || getEmValue() ) : 1 );
}
// If there's no media query at all (the () part), or min or max is not null, and if either is present, they're true
if ( !thisstyle.hasquery || ( !minnull || !maxnull ) && ( minnull || currWidth >= min ) && ( maxnull || currWidth <= max ) ){
if ( !styleBlocks[ thisstyle.media ] ){
styleBlocks[ thisstyle.media ] = [];
}
styleBlocks[ thisstyle.media ].push( rules[ thisstyle.rules ] );
}
}
// Remove any existing respond style element(s)
for( var i in appendedEls ){
if ( appendedEls[ i ] && appendedEls[ i ].parentNode === head ){
head.removeChild( appendedEls[ i ] );
}
}
// Inject active styles, grouped by media type
for( var i in styleBlocks ){
var ss = doc.createElement( "style" ),
css = styleBlocks[ i ].join( "\n" );
ss.type = "text/css";
ss.media = i;
// Originally, ss was appended to a documentFragment and sheets were appended in bulk.
// This caused crashes in IE in a number of circumstances, such as when the HTML element had a bg image set, so appending beforehand seems best. Thanks to @dvelyk for the initial research on this one!
head.insertBefore( ss, lastLink.nextSibling );
if ( ss.styleSheet ){
ss.styleSheet.cssText = css;
}
else {
ss.appendChild( doc.createTextNode( css ) );
}
// Push to appendedEls to track for later removal
appendedEls.push( ss );
}
},
// Tweaked Ajax functions from Quirksmode
ajax = function( url, callback ) {
var req = xmlHttp();
if (!req){
return;
}
req.open( "GET", url, true );
req.onreadystatechange = function () {
if ( req.readyState != 4 || req.status != 200 && req.status != 304 ){
return;
}
callback( req.responseText );
}
if ( req.readyState == 4 ){
return;
}
req.send( null );
},
// Define ajax obj
xmlHttp = (function() {
var xmlhttpmethod = false;
try {
xmlhttpmethod = new XMLHttpRequest();
}
catch( e ){
xmlhttpmethod = new ActiveXObject( "Microsoft.XMLHTTP" );
}
return function(){
return xmlhttpmethod;
};
})();
// Translate CSS
ripCSS();
// Expose update for re-running respond later on
respond.update = ripCSS;
// Adjust on resize
function callMedia(){
applyMedia( true );
}
if ( win.addEventListener ){
win.addEventListener( "resize", callMedia, false );
}
else if( win.attachEvent ){
win.attachEvent( "onresize", callMedia );
}
})(this);
respond.src.js 0000644 00000022411 15234425705 0007351 0 ustar 00 /*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */
/*! NOTE: If you're already including a window.matchMedia polyfill via Modernizr or otherwise, you don't need this part */
window.matchMedia = window.matchMedia || (function(doc, undefined){
var bool,
docElem = doc.documentElement,
refNode = docElem.firstElementChild || docElem.firstChild,
// fakeBody required for <FF4 when executed in <head>
fakeBody = doc.createElement('body'),
div = doc.createElement('div');
div.id = 'mq-test-1';
div.style.cssText = "position:absolute;top:-100em";
fakeBody.style.background = "none";
fakeBody.appendChild(div);
return function(q){
div.innerHTML = '­<style media="'+q+'"> #mq-test-1 { width: 42px; }</style>';
docElem.insertBefore(fakeBody, refNode);
bool = div.offsetWidth == 42;
docElem.removeChild(fakeBody);
return { matches: bool, media: q };
};
})(document);
/*! Respond.js v1.1.0: min/max-width media query polyfill. (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs */
(function( win ){
// Exposed namespace
win.respond = {};
// Define update even in native-mq-supporting browsers, to avoid errors
respond.update = function(){};
// Expose media query support flag for external use
respond.mediaQueriesSupported = win.matchMedia && win.matchMedia( "only all" ).matches;
// If media queries are supported, exit here
if ( respond.mediaQueriesSupported ){ return; }
// Define vars
var doc = win.document,
docElem = doc.documentElement,
mediastyles = [],
rules = [],
appendedEls = [],
parsedSheets = {},
resizeThrottle = 30,
head = doc.getElementsByTagName( "head" )[0] || docElem,
base = doc.getElementsByTagName( "base" )[0],
links = head.getElementsByTagName( "link" ),
requestQueue = [],
// Loop stylesheets, send text content to translate
ripCSS = function(){
var sheets = links,
sl = sheets.length,
i = 0,
// Vars for loop:
sheet, href, media, isCSS;
for( ; i < sl; i++ ){
sheet = sheets[ i ],
href = sheet.href,
media = sheet.media,
isCSS = sheet.rel && sheet.rel.toLowerCase() === "stylesheet";
//only links plz and prevent re-parsing
if ( !!href && isCSS && !parsedSheets[ href ] ){
// selectivizr exposes css through the rawCssText expando
if (sheet.styleSheet && sheet.styleSheet.rawCssText) {
translate( sheet.styleSheet.rawCssText, href, media );
parsedSheets[ href ] = true;
} else {
if ( (!/^([a-zA-Z:]*\/\/)/.test( href ) && !base)
|| href.replace( RegExp.$1, "" ).split( "/" )[0] === win.location.host ){
requestQueue.push( {
href: href,
media: media
} );
}
}
}
}
makeRequests();
},
// Recurse through request queue, get css text
makeRequests = function(){
if ( requestQueue.length ){
var thisRequest = requestQueue.shift();
ajax( thisRequest.href, function( styles ){
translate( styles, thisRequest.href, thisRequest.media );
parsedSheets[ thisRequest.href ] = true;
makeRequests();
} );
}
},
// Find media blocks in css text, convert to style blocks
translate = function( styles, href, media ){
var qs = styles.match( /@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi ),
ql = qs && qs.length || 0,
// Try to get CSS path
href = href.substring( 0, href.lastIndexOf( "/" )),
repUrls = function( css ){
return css.replace( /(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g, "$1" + href + "$2$3" );
},
useMedia = !ql && media,
// Vars used in loop
i = 0,
j, fullq, thisq, eachq, eql;
// If path exists, tack on trailing slash
if ( href.length ){ href += "/"; }
//if no internal queries exist, but media attr does, use that
//note: this currently lacks support for situations where a media attr is specified on a link AND
//its associated stylesheet has internal CSS media queries.
//In those cases, the media attribute will currently be ignored.
if ( useMedia ){
ql = 1;
}
for( ; i < ql; i++ ){
j = 0;
// Media attr
if ( useMedia ){
fullq = media;
rules.push( repUrls( styles ) );
}
// Parse for styles
else{
fullq = qs[ i ].match( /@media *([^\{]+)\{([\S\s]+?)$/ ) && RegExp.$1;
rules.push( RegExp.$2 && repUrls( RegExp.$2 ) );
}
eachq = fullq.split( "," );
eql = eachq.length;
for( ; j < eql; j++ ){
thisq = eachq[ j ];
mediastyles.push( {
media : thisq.split( "(" )[ 0 ].match( /(only\s+)?([a-zA-Z]+)\s?/ ) && RegExp.$2 || "all",
rules : rules.length - 1,
hasquery : thisq.indexOf("(") > -1,
minw : thisq.match( /\(min\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/ ) && parseFloat( RegExp.$1 ) + ( RegExp.$2 || "" ),
maxw : thisq.match( /\(max\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/ ) && parseFloat( RegExp.$1 ) + ( RegExp.$2 || "" )
} );
}
}
applyMedia();
},
lastCall,
resizeDefer,
// returns the value of 1em in pixels
getEmValue = function() {
var ret,
div = doc.createElement('div'),
body = doc.body,
fakeUsed = false;
div.style.cssText = "position:absolute;font-size:1em;width:1em";
if ( !body ){
body = fakeUsed = doc.createElement( "body" );
body.style.background = "none";
}
body.appendChild( div );
docElem.insertBefore( body, docElem.firstChild );
ret = div.offsetWidth;
if ( fakeUsed ){
docElem.removeChild( body );
}
else {
body.removeChild( div );
}
// Also update eminpx before returning
ret = eminpx = parseFloat(ret);
return ret;
},
// Cached container for 1em value, populated the first time it's needed
eminpx,
// Enable/disable styles
applyMedia = function( fromResize ){
var name = "clientWidth",
docElemProp = docElem[ name ],
currWidth = doc.compatMode === "CSS1Compat" && docElemProp || doc.body[ name ] || docElemProp,
styleBlocks = {},
lastLink = links[ links.length-1 ],
now = (new Date()).getTime();
// Throttle resize calls
if ( fromResize && lastCall && now - lastCall < resizeThrottle ){
clearTimeout( resizeDefer );
resizeDefer = setTimeout( applyMedia, resizeThrottle );
return;
}
else {
lastCall = now;
}
for( var i in mediastyles ){
var thisstyle = mediastyles[ i ],
min = thisstyle.minw,
max = thisstyle.maxw,
minnull = min === null,
maxnull = max === null,
em = "em";
if ( !!min ){
min = parseFloat( min ) * ( min.indexOf( em ) > -1 ? ( eminpx || getEmValue() ) : 1 );
}
if ( !!max ){
max = parseFloat( max ) * ( max.indexOf( em ) > -1 ? ( eminpx || getEmValue() ) : 1 );
}
// If there's no media query at all (the () part), or min or max is not null, and if either is present, they're true
if ( !thisstyle.hasquery || ( !minnull || !maxnull ) && ( minnull || currWidth >= min ) && ( maxnull || currWidth <= max ) ){
if ( !styleBlocks[ thisstyle.media ] ){
styleBlocks[ thisstyle.media ] = [];
}
styleBlocks[ thisstyle.media ].push( rules[ thisstyle.rules ] );
}
}
// Remove any existing respond style element(s)
for( var i in appendedEls ){
if ( appendedEls[ i ] && appendedEls[ i ].parentNode === head ){
head.removeChild( appendedEls[ i ] );
}
}
// Inject active styles, grouped by media type
for( var i in styleBlocks ){
var ss = doc.createElement( "style" ),
css = styleBlocks[ i ].join( "\n" );
ss.type = "text/css";
ss.media = i;
// Originally, ss was appended to a documentFragment and sheets were appended in bulk.
// This caused crashes in IE in a number of circumstances, such as when the HTML element had a bg image set, so appending beforehand seems best. Thanks to @dvelyk for the initial research on this one!
head.insertBefore( ss, lastLink.nextSibling );
if ( ss.styleSheet ){
ss.styleSheet.cssText = css;
}
else{
ss.appendChild( doc.createTextNode( css ) );
}
// Push to appendedEls to track for later removal
appendedEls.push( ss );
}
},
// Tweaked Ajax functions from Quirksmode
ajax = function( url, callback ) {
var req = xmlHttp();
if (!req){
return;
}
req.open( "GET", url, true );
req.onreadystatechange = function () {
if ( req.readyState != 4 || req.status != 200 && req.status != 304 ){
return;
}
callback( req.responseText );
}
if ( req.readyState == 4 ){
return;
}
req.send( null );
},
// Define ajax obj
xmlHttp = (function() {
var xmlhttpmethod = false;
try {
xmlhttpmethod = new XMLHttpRequest();
}
catch( e ){
xmlhttpmethod = new ActiveXObject( "Microsoft.XMLHTTP" );
}
return function(){
return xmlhttpmethod;
};
})();
// Translate CSS
ripCSS();
// Expose update for re-running respond later on
respond.update = ripCSS;
// Adjust on resize
function callMedia(){
applyMedia( true );
}
if ( win.addEventListener ){
win.addEventListener( "resize", callMedia, false );
}
else if( win.attachEvent ){
win.attachEvent( "onresize", callMedia );
}
})(this);
template.js 0000644 00000003657 15234425705 0006737 0 ustar 00 /**
* @package Joomla.Site
* @subpackage Templates.beez3
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @since 3.2
*/
jQuery(function($) {
'use strict';
$(document).on('click', ".btn-group label:not(.active)", function() {
var $label = $(this);
var $input = $(document.getElementById($label.attr('for')));
if ($input.prop('checked'))
{
return;
}
$label.closest('.btn-group').find("label").removeClass('active btn-success btn-danger btn-primary');
var btnClass = 'primary';
if ($input.val() != '')
{
var reversed = $label.closest('.btn-group').hasClass('btn-group-reversed');
btnClass = ($input.val() == 0 ? !reversed : reversed) ? 'danger' : 'success';
}
$label.addClass('active btn-' + btnClass);
$input.prop('checked', true).trigger('change');
})
.on('subform-row-add', initButtonGroup)
.on('subform-row-add', initTooltip);
initButtonGroup();
initTooltip();
// Called once on domready, again when a subform row is added
function initTooltip(event, container)
{
$(container || document).find('*[rel=tooltip]').tooltip();
}
// Called once on domready, again when a subform row is added
function initButtonGroup(event, container)
{
var $container = $(container || document);
// Turn radios into btn-group
$container.find('.radio.btn-group label').addClass('btn');
// Setup coloring for buttons
$container.find('.btn-group input:checked').each(function() {
var $input = $(this);
var $label = $(document.querySelector('label[for=' + $input.attr('id') + ']'));
var btnClass = 'primary';
if ($input.val() != '')
{
var reversed = $input.parent().hasClass('btn-group-reversed');
btnClass = ($input.val() == 0 ? !reversed : reversed) ? 'danger' : 'success';
}
$label.addClass('active btn-' + btnClass);
});
}
});
javascript.js 0000644 00000112525 15235203126 0007255 0 ustar 00 // CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: https://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
"use strict";
CodeMirror.defineMode("javascript", function(config, parserConfig) {
var indentUnit = config.indentUnit;
var statementIndent = parserConfig.statementIndent;
var jsonldMode = parserConfig.jsonld;
var jsonMode = parserConfig.json || jsonldMode;
var isTS = parserConfig.typescript;
var wordRE = parserConfig.wordCharacters || /[\w$\xa1-\uffff]/;
// Tokenizer
var keywords = function(){
function kw(type) {return {type: type, style: "keyword"};}
var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c"), D = kw("keyword d");
var operator = kw("operator"), atom = {type: "atom", style: "atom"};
return {
"if": kw("if"), "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B,
"return": D, "break": D, "continue": D, "new": kw("new"), "delete": C, "void": C, "throw": C,
"debugger": kw("debugger"), "var": kw("var"), "const": kw("var"), "let": kw("var"),
"function": kw("function"), "catch": kw("catch"),
"for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"),
"in": operator, "typeof": operator, "instanceof": operator,
"true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom,
"this": kw("this"), "class": kw("class"), "super": kw("atom"),
"yield": C, "export": kw("export"), "import": kw("import"), "extends": C,
"await": C
};
}();
var isOperatorChar = /[+\-*&%=<>!?|~^@]/;
var isJsonldKeyword = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;
function readRegexp(stream) {
var escaped = false, next, inSet = false;
while ((next = stream.next()) != null) {
if (!escaped) {
if (next == "/" && !inSet) return;
if (next == "[") inSet = true;
else if (inSet && next == "]") inSet = false;
}
escaped = !escaped && next == "\\";
}
}
// Used as scratch variables to communicate multiple values without
// consing up tons of objects.
var type, content;
function ret(tp, style, cont) {
type = tp; content = cont;
return style;
}
function tokenBase(stream, state) {
var ch = stream.next();
if (ch == '"' || ch == "'") {
state.tokenize = tokenString(ch);
return state.tokenize(stream, state);
} else if (ch == "." && stream.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/)) {
return ret("number", "number");
} else if (ch == "." && stream.match("..")) {
return ret("spread", "meta");
} else if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
return ret(ch);
} else if (ch == "=" && stream.eat(">")) {
return ret("=>", "operator");
} else if (ch == "0" && stream.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/)) {
return ret("number", "number");
} else if (/\d/.test(ch)) {
stream.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/);
return ret("number", "number");
} else if (ch == "/") {
if (stream.eat("*")) {
state.tokenize = tokenComment;
return tokenComment(stream, state);
} else if (stream.eat("/")) {
stream.skipToEnd();
return ret("comment", "comment");
} else if (expressionAllowed(stream, state, 1)) {
readRegexp(stream);
stream.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/);
return ret("regexp", "string-2");
} else {
stream.eat("=");
return ret("operator", "operator", stream.current());
}
} else if (ch == "`") {
state.tokenize = tokenQuasi;
return tokenQuasi(stream, state);
} else if (ch == "#" && stream.peek() == "!") {
stream.skipToEnd();
return ret("meta", "meta");
} else if (ch == "#" && stream.eatWhile(wordRE)) {
return ret("variable", "property")
} else if (ch == "<" && stream.match("!--") ||
(ch == "-" && stream.match("->") && !/\S/.test(stream.string.slice(0, stream.start)))) {
stream.skipToEnd()
return ret("comment", "comment")
} else if (isOperatorChar.test(ch)) {
if (ch != ">" || !state.lexical || state.lexical.type != ">") {
if (stream.eat("=")) {
if (ch == "!" || ch == "=") stream.eat("=")
} else if (/[<>*+\-|&?]/.test(ch)) {
stream.eat(ch)
if (ch == ">") stream.eat(ch)
}
}
if (ch == "?" && stream.eat(".")) return ret(".")
return ret("operator", "operator", stream.current());
} else if (wordRE.test(ch)) {
stream.eatWhile(wordRE);
var word = stream.current()
if (state.lastType != ".") {
if (keywords.propertyIsEnumerable(word)) {
var kw = keywords[word]
return ret(kw.type, kw.style, word)
}
if (word == "async" && stream.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/, false))
return ret("async", "keyword", word)
}
return ret("variable", "variable", word)
}
}
function tokenString(quote) {
return function(stream, state) {
var escaped = false, next;
if (jsonldMode && stream.peek() == "@" && stream.match(isJsonldKeyword)){
state.tokenize = tokenBase;
return ret("jsonld-keyword", "meta");
}
while ((next = stream.next()) != null) {
if (next == quote && !escaped) break;
escaped = !escaped && next == "\\";
}
if (!escaped) state.tokenize = tokenBase;
return ret("string", "string");
};
}
function tokenComment(stream, state) {
var maybeEnd = false, ch;
while (ch = stream.next()) {
if (ch == "/" && maybeEnd) {
state.tokenize = tokenBase;
break;
}
maybeEnd = (ch == "*");
}
return ret("comment", "comment");
}
function tokenQuasi(stream, state) {
var escaped = false, next;
while ((next = stream.next()) != null) {
if (!escaped && (next == "`" || next == "$" && stream.eat("{"))) {
state.tokenize = tokenBase;
break;
}
escaped = !escaped && next == "\\";
}
return ret("quasi", "string-2", stream.current());
}
var brackets = "([{}])";
// This is a crude lookahead trick to try and notice that we're
// parsing the argument patterns for a fat-arrow function before we
// actually hit the arrow token. It only works if the arrow is on
// the same line as the arguments and there's no strange noise
// (comments) in between. Fallback is to only notice when we hit the
// arrow, and not declare the arguments as locals for the arrow
// body.
function findFatArrow(stream, state) {
if (state.fatArrowAt) state.fatArrowAt = null;
var arrow = stream.string.indexOf("=>", stream.start);
if (arrow < 0) return;
if (isTS) { // Try to skip TypeScript return type declarations after the arguments
var m = /:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(stream.string.slice(stream.start, arrow))
if (m) arrow = m.index
}
var depth = 0, sawSomething = false;
for (var pos = arrow - 1; pos >= 0; --pos) {
var ch = stream.string.charAt(pos);
var bracket = brackets.indexOf(ch);
if (bracket >= 0 && bracket < 3) {
if (!depth) { ++pos; break; }
if (--depth == 0) { if (ch == "(") sawSomething = true; break; }
} else if (bracket >= 3 && bracket < 6) {
++depth;
} else if (wordRE.test(ch)) {
sawSomething = true;
} else if (/["'\/`]/.test(ch)) {
for (;; --pos) {
if (pos == 0) return
var next = stream.string.charAt(pos - 1)
if (next == ch && stream.string.charAt(pos - 2) != "\\") { pos--; break }
}
} else if (sawSomething && !depth) {
++pos;
break;
}
}
if (sawSomething && !depth) state.fatArrowAt = pos;
}
// Parser
var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true,
"regexp": true, "this": true, "import": true, "jsonld-keyword": true};
function JSLexical(indented, column, type, align, prev, info) {
this.indented = indented;
this.column = column;
this.type = type;
this.prev = prev;
this.info = info;
if (align != null) this.align = align;
}
function inScope(state, varname) {
for (var v = state.localVars; v; v = v.next)
if (v.name == varname) return true;
for (var cx = state.context; cx; cx = cx.prev) {
for (var v = cx.vars; v; v = v.next)
if (v.name == varname) return true;
}
}
function parseJS(state, style, type, content, stream) {
var cc = state.cc;
// Communicate our context to the combinators.
// (Less wasteful than consing up a hundred closures on every call.)
cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; cx.style = style;
if (!state.lexical.hasOwnProperty("align"))
state.lexical.align = true;
while(true) {
var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement;
if (combinator(type, content)) {
while(cc.length && cc[cc.length - 1].lex)
cc.pop()();
if (cx.marked) return cx.marked;
if (type == "variable" && inScope(state, content)) return "variable-2";
return style;
}
}
}
// Combinator utils
var cx = {state: null, column: null, marked: null, cc: null};
function pass() {
for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]);
}
function cont() {
pass.apply(null, arguments);
return true;
}
function inList(name, list) {
for (var v = list; v; v = v.next) if (v.name == name) return true
return false;
}
function register(varname) {
var state = cx.state;
cx.marked = "def";
if (state.context) {
if (state.lexical.info == "var" && state.context && state.context.block) {
// FIXME function decls are also not block scoped
var newContext = registerVarScoped(varname, state.context)
if (newContext != null) {
state.context = newContext
return
}
} else if (!inList(varname, state.localVars)) {
state.localVars = new Var(varname, state.localVars)
return
}
}
// Fall through means this is global
if (parserConfig.globalVars && !inList(varname, state.globalVars))
state.globalVars = new Var(varname, state.globalVars)
}
function registerVarScoped(varname, context) {
if (!context) {
return null
} else if (context.block) {
var inner = registerVarScoped(varname, context.prev)
if (!inner) return null
if (inner == context.prev) return context
return new Context(inner, context.vars, true)
} else if (inList(varname, context.vars)) {
return context
} else {
return new Context(context.prev, new Var(varname, context.vars), false)
}
}
function isModifier(name) {
return name == "public" || name == "private" || name == "protected" || name == "abstract" || name == "readonly"
}
// Combinators
function Context(prev, vars, block) { this.prev = prev; this.vars = vars; this.block = block }
function Var(name, next) { this.name = name; this.next = next }
var defaultVars = new Var("this", new Var("arguments", null))
function pushcontext() {
cx.state.context = new Context(cx.state.context, cx.state.localVars, false)
cx.state.localVars = defaultVars
}
function pushblockcontext() {
cx.state.context = new Context(cx.state.context, cx.state.localVars, true)
cx.state.localVars = null
}
function popcontext() {
cx.state.localVars = cx.state.context.vars
cx.state.context = cx.state.context.prev
}
popcontext.lex = true
function pushlex(type, info) {
var result = function() {
var state = cx.state, indent = state.indented;
if (state.lexical.type == "stat") indent = state.lexical.indented;
else for (var outer = state.lexical; outer && outer.type == ")" && outer.align; outer = outer.prev)
indent = outer.indented;
state.lexical = new JSLexical(indent, cx.stream.column(), type, null, state.lexical, info);
};
result.lex = true;
return result;
}
function poplex() {
var state = cx.state;
if (state.lexical.prev) {
if (state.lexical.type == ")")
state.indented = state.lexical.indented;
state.lexical = state.lexical.prev;
}
}
poplex.lex = true;
function expect(wanted) {
function exp(type) {
if (type == wanted) return cont();
else if (wanted == ";" || type == "}" || type == ")" || type == "]") return pass();
else return cont(exp);
};
return exp;
}
function statement(type, value) {
if (type == "var") return cont(pushlex("vardef", value), vardef, expect(";"), poplex);
if (type == "keyword a") return cont(pushlex("form"), parenExpr, statement, poplex);
if (type == "keyword b") return cont(pushlex("form"), statement, poplex);
if (type == "keyword d") return cx.stream.match(/^\s*$/, false) ? cont() : cont(pushlex("stat"), maybeexpression, expect(";"), poplex);
if (type == "debugger") return cont(expect(";"));
if (type == "{") return cont(pushlex("}"), pushblockcontext, block, poplex, popcontext);
if (type == ";") return cont();
if (type == "if") {
if (cx.state.lexical.info == "else" && cx.state.cc[cx.state.cc.length - 1] == poplex)
cx.state.cc.pop()();
return cont(pushlex("form"), parenExpr, statement, poplex, maybeelse);
}
if (type == "function") return cont(functiondef);
if (type == "for") return cont(pushlex("form"), forspec, statement, poplex);
if (type == "class" || (isTS && value == "interface")) {
cx.marked = "keyword"
return cont(pushlex("form", type == "class" ? type : value), className, poplex)
}
if (type == "variable") {
if (isTS && value == "declare") {
cx.marked = "keyword"
return cont(statement)
} else if (isTS && (value == "module" || value == "enum" || value == "type") && cx.stream.match(/^\s*\w/, false)) {
cx.marked = "keyword"
if (value == "enum") return cont(enumdef);
else if (value == "type") return cont(typename, expect("operator"), typeexpr, expect(";"));
else return cont(pushlex("form"), pattern, expect("{"), pushlex("}"), block, poplex, poplex)
} else if (isTS && value == "namespace") {
cx.marked = "keyword"
return cont(pushlex("form"), expression, statement, poplex)
} else if (isTS && value == "abstract") {
cx.marked = "keyword"
return cont(statement)
} else {
return cont(pushlex("stat"), maybelabel);
}
}
if (type == "switch") return cont(pushlex("form"), parenExpr, expect("{"), pushlex("}", "switch"), pushblockcontext,
block, poplex, poplex, popcontext);
if (type == "case") return cont(expression, expect(":"));
if (type == "default") return cont(expect(":"));
if (type == "catch") return cont(pushlex("form"), pushcontext, maybeCatchBinding, statement, poplex, popcontext);
if (type == "export") return cont(pushlex("stat"), afterExport, poplex);
if (type == "import") return cont(pushlex("stat"), afterImport, poplex);
if (type == "async") return cont(statement)
if (value == "@") return cont(expression, statement)
return pass(pushlex("stat"), expression, expect(";"), poplex);
}
function maybeCatchBinding(type) {
if (type == "(") return cont(funarg, expect(")"))
}
function expression(type, value) {
return expressionInner(type, value, false);
}
function expressionNoComma(type, value) {
return expressionInner(type, value, true);
}
function parenExpr(type) {
if (type != "(") return pass()
return cont(pushlex(")"), maybeexpression, expect(")"), poplex)
}
function expressionInner(type, value, noComma) {
if (cx.state.fatArrowAt == cx.stream.start) {
var body = noComma ? arrowBodyNoComma : arrowBody;
if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, expect("=>"), body, popcontext);
else if (type == "variable") return pass(pushcontext, pattern, expect("=>"), body, popcontext);
}
var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma;
if (atomicTypes.hasOwnProperty(type)) return cont(maybeop);
if (type == "function") return cont(functiondef, maybeop);
if (type == "class" || (isTS && value == "interface")) { cx.marked = "keyword"; return cont(pushlex("form"), classExpression, poplex); }
if (type == "keyword c" || type == "async") return cont(noComma ? expressionNoComma : expression);
if (type == "(") return cont(pushlex(")"), maybeexpression, expect(")"), poplex, maybeop);
if (type == "operator" || type == "spread") return cont(noComma ? expressionNoComma : expression);
if (type == "[") return cont(pushlex("]"), arrayLiteral, poplex, maybeop);
if (type == "{") return contCommasep(objprop, "}", null, maybeop);
if (type == "quasi") return pass(quasi, maybeop);
if (type == "new") return cont(maybeTarget(noComma));
return cont();
}
function maybeexpression(type) {
if (type.match(/[;\}\)\],]/)) return pass();
return pass(expression);
}
function maybeoperatorComma(type, value) {
if (type == ",") return cont(maybeexpression);
return maybeoperatorNoComma(type, value, false);
}
function maybeoperatorNoComma(type, value, noComma) {
var me = noComma == false ? maybeoperatorComma : maybeoperatorNoComma;
var expr = noComma == false ? expression : expressionNoComma;
if (type == "=>") return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext);
if (type == "operator") {
if (/\+\+|--/.test(value) || isTS && value == "!") return cont(me);
if (isTS && value == "<" && cx.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/, false))
return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, me);
if (value == "?") return cont(expression, expect(":"), expr);
return cont(expr);
}
if (type == "quasi") { return pass(quasi, me); }
if (type == ";") return;
if (type == "(") return contCommasep(expressionNoComma, ")", "call", me);
if (type == ".") return cont(property, me);
if (type == "[") return cont(pushlex("]"), maybeexpression, expect("]"), poplex, me);
if (isTS && value == "as") { cx.marked = "keyword"; return cont(typeexpr, me) }
if (type == "regexp") {
cx.state.lastType = cx.marked = "operator"
cx.stream.backUp(cx.stream.pos - cx.stream.start - 1)
return cont(expr)
}
}
function quasi(type, value) {
if (type != "quasi") return pass();
if (value.slice(value.length - 2) != "${") return cont(quasi);
return cont(expression, continueQuasi);
}
function continueQuasi(type) {
if (type == "}") {
cx.marked = "string-2";
cx.state.tokenize = tokenQuasi;
return cont(quasi);
}
}
function arrowBody(type) {
findFatArrow(cx.stream, cx.state);
return pass(type == "{" ? statement : expression);
}
function arrowBodyNoComma(type) {
findFatArrow(cx.stream, cx.state);
return pass(type == "{" ? statement : expressionNoComma);
}
function maybeTarget(noComma) {
return function(type) {
if (type == ".") return cont(noComma ? targetNoComma : target);
else if (type == "variable" && isTS) return cont(maybeTypeArgs, noComma ? maybeoperatorNoComma : maybeoperatorComma)
else return pass(noComma ? expressionNoComma : expression);
};
}
function target(_, value) {
if (value == "target") { cx.marked = "keyword"; return cont(maybeoperatorComma); }
}
function targetNoComma(_, value) {
if (value == "target") { cx.marked = "keyword"; return cont(maybeoperatorNoComma); }
}
function maybelabel(type) {
if (type == ":") return cont(poplex, statement);
return pass(maybeoperatorComma, expect(";"), poplex);
}
function property(type) {
if (type == "variable") {cx.marked = "property"; return cont();}
}
function objprop(type, value) {
if (type == "async") {
cx.marked = "property";
return cont(objprop);
} else if (type == "variable" || cx.style == "keyword") {
cx.marked = "property";
if (value == "get" || value == "set") return cont(getterSetter);
var m // Work around fat-arrow-detection complication for detecting typescript typed arrow params
if (isTS && cx.state.fatArrowAt == cx.stream.start && (m = cx.stream.match(/^\s*:\s*/, false)))
cx.state.fatArrowAt = cx.stream.pos + m[0].length
return cont(afterprop);
} else if (type == "number" || type == "string") {
cx.marked = jsonldMode ? "property" : (cx.style + " property");
return cont(afterprop);
} else if (type == "jsonld-keyword") {
return cont(afterprop);
} else if (isTS && isModifier(value)) {
cx.marked = "keyword"
return cont(objprop)
} else if (type == "[") {
return cont(expression, maybetype, expect("]"), afterprop);
} else if (type == "spread") {
return cont(expressionNoComma, afterprop);
} else if (value == "*") {
cx.marked = "keyword";
return cont(objprop);
} else if (type == ":") {
return pass(afterprop)
}
}
function getterSetter(type) {
if (type != "variable") return pass(afterprop);
cx.marked = "property";
return cont(functiondef);
}
function afterprop(type) {
if (type == ":") return cont(expressionNoComma);
if (type == "(") return pass(functiondef);
}
function commasep(what, end, sep) {
function proceed(type, value) {
if (sep ? sep.indexOf(type) > -1 : type == ",") {
var lex = cx.state.lexical;
if (lex.info == "call") lex.pos = (lex.pos || 0) + 1;
return cont(function(type, value) {
if (type == end || value == end) return pass()
return pass(what)
}, proceed);
}
if (type == end || value == end) return cont();
if (sep && sep.indexOf(";") > -1) return pass(what)
return cont(expect(end));
}
return function(type, value) {
if (type == end || value == end) return cont();
return pass(what, proceed);
};
}
function contCommasep(what, end, info) {
for (var i = 3; i < arguments.length; i++)
cx.cc.push(arguments[i]);
return cont(pushlex(end, info), commasep(what, end), poplex);
}
function block(type) {
if (type == "}") return cont();
return pass(statement, block);
}
function maybetype(type, value) {
if (isTS) {
if (type == ":") return cont(typeexpr);
if (value == "?") return cont(maybetype);
}
}
function maybetypeOrIn(type, value) {
if (isTS && (type == ":" || value == "in")) return cont(typeexpr)
}
function mayberettype(type) {
if (isTS && type == ":") {
if (cx.stream.match(/^\s*\w+\s+is\b/, false)) return cont(expression, isKW, typeexpr)
else return cont(typeexpr)
}
}
function isKW(_, value) {
if (value == "is") {
cx.marked = "keyword"
return cont()
}
}
function typeexpr(type, value) {
if (value == "keyof" || value == "typeof" || value == "infer" || value == "readonly") {
cx.marked = "keyword"
return cont(value == "typeof" ? expressionNoComma : typeexpr)
}
if (type == "variable" || value == "void") {
cx.marked = "type"
return cont(afterType)
}
if (value == "|" || value == "&") return cont(typeexpr)
if (type == "string" || type == "number" || type == "atom") return cont(afterType);
if (type == "[") return cont(pushlex("]"), commasep(typeexpr, "]", ","), poplex, afterType)
if (type == "{") return cont(pushlex("}"), typeprops, poplex, afterType)
if (type == "(") return cont(commasep(typearg, ")"), maybeReturnType, afterType)
if (type == "<") return cont(commasep(typeexpr, ">"), typeexpr)
}
function maybeReturnType(type) {
if (type == "=>") return cont(typeexpr)
}
function typeprops(type) {
if (type.match(/[\}\)\]]/)) return cont()
if (type == "," || type == ";") return cont(typeprops)
return pass(typeprop, typeprops)
}
function typeprop(type, value) {
if (type == "variable" || cx.style == "keyword") {
cx.marked = "property"
return cont(typeprop)
} else if (value == "?" || type == "number" || type == "string") {
return cont(typeprop)
} else if (type == ":") {
return cont(typeexpr)
} else if (type == "[") {
return cont(expect("variable"), maybetypeOrIn, expect("]"), typeprop)
} else if (type == "(") {
return pass(functiondecl, typeprop)
} else if (!type.match(/[;\}\)\],]/)) {
return cont()
}
}
function typearg(type, value) {
if (type == "variable" && cx.stream.match(/^\s*[?:]/, false) || value == "?") return cont(typearg)
if (type == ":") return cont(typeexpr)
if (type == "spread") return cont(typearg)
return pass(typeexpr)
}
function afterType(type, value) {
if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType)
if (value == "|" || type == "." || value == "&") return cont(typeexpr)
if (type == "[") return cont(typeexpr, expect("]"), afterType)
if (value == "extends" || value == "implements") { cx.marked = "keyword"; return cont(typeexpr) }
if (value == "?") return cont(typeexpr, expect(":"), typeexpr)
}
function maybeTypeArgs(_, value) {
if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType)
}
function typeparam() {
return pass(typeexpr, maybeTypeDefault)
}
function maybeTypeDefault(_, value) {
if (value == "=") return cont(typeexpr)
}
function vardef(_, value) {
if (value == "enum") {cx.marked = "keyword"; return cont(enumdef)}
return pass(pattern, maybetype, maybeAssign, vardefCont);
}
function pattern(type, value) {
if (isTS && isModifier(value)) { cx.marked = "keyword"; return cont(pattern) }
if (type == "variable") { register(value); return cont(); }
if (type == "spread") return cont(pattern);
if (type == "[") return contCommasep(eltpattern, "]");
if (type == "{") return contCommasep(proppattern, "}");
}
function proppattern(type, value) {
if (type == "variable" && !cx.stream.match(/^\s*:/, false)) {
register(value);
return cont(maybeAssign);
}
if (type == "variable") cx.marked = "property";
if (type == "spread") return cont(pattern);
if (type == "}") return pass();
if (type == "[") return cont(expression, expect(']'), expect(':'), proppattern);
return cont(expect(":"), pattern, maybeAssign);
}
function eltpattern() {
return pass(pattern, maybeAssign)
}
function maybeAssign(_type, value) {
if (value == "=") return cont(expressionNoComma);
}
function vardefCont(type) {
if (type == ",") return cont(vardef);
}
function maybeelse(type, value) {
if (type == "keyword b" && value == "else") return cont(pushlex("form", "else"), statement, poplex);
}
function forspec(type, value) {
if (value == "await") return cont(forspec);
if (type == "(") return cont(pushlex(")"), forspec1, poplex);
}
function forspec1(type) {
if (type == "var") return cont(vardef, forspec2);
if (type == "variable") return cont(forspec2);
return pass(forspec2)
}
function forspec2(type, value) {
if (type == ")") return cont()
if (type == ";") return cont(forspec2)
if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression, forspec2) }
return pass(expression, forspec2)
}
function functiondef(type, value) {
if (value == "*") {cx.marked = "keyword"; return cont(functiondef);}
if (type == "variable") {register(value); return cont(functiondef);}
if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, mayberettype, statement, popcontext);
if (isTS && value == "<") return cont(pushlex(">"), commasep(typeparam, ">"), poplex, functiondef)
}
function functiondecl(type, value) {
if (value == "*") {cx.marked = "keyword"; return cont(functiondecl);}
if (type == "variable") {register(value); return cont(functiondecl);}
if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, mayberettype, popcontext);
if (isTS && value == "<") return cont(pushlex(">"), commasep(typeparam, ">"), poplex, functiondecl)
}
function typename(type, value) {
if (type == "keyword" || type == "variable") {
cx.marked = "type"
return cont(typename)
} else if (value == "<") {
return cont(pushlex(">"), commasep(typeparam, ">"), poplex)
}
}
function funarg(type, value) {
if (value == "@") cont(expression, funarg)
if (type == "spread") return cont(funarg);
if (isTS && isModifier(value)) { cx.marked = "keyword"; return cont(funarg); }
if (isTS && type == "this") return cont(maybetype, maybeAssign)
return pass(pattern, maybetype, maybeAssign);
}
function classExpression(type, value) {
// Class expressions may have an optional name.
if (type == "variable") return className(type, value);
return classNameAfter(type, value);
}
function className(type, value) {
if (type == "variable") {register(value); return cont(classNameAfter);}
}
function classNameAfter(type, value) {
if (value == "<") return cont(pushlex(">"), commasep(typeparam, ">"), poplex, classNameAfter)
if (value == "extends" || value == "implements" || (isTS && type == ",")) {
if (value == "implements") cx.marked = "keyword";
return cont(isTS ? typeexpr : expression, classNameAfter);
}
if (type == "{") return cont(pushlex("}"), classBody, poplex);
}
function classBody(type, value) {
if (type == "async" ||
(type == "variable" &&
(value == "static" || value == "get" || value == "set" || (isTS && isModifier(value))) &&
cx.stream.match(/^\s+[\w$\xa1-\uffff]/, false))) {
cx.marked = "keyword";
return cont(classBody);
}
if (type == "variable" || cx.style == "keyword") {
cx.marked = "property";
return cont(classfield, classBody);
}
if (type == "number" || type == "string") return cont(classfield, classBody);
if (type == "[")
return cont(expression, maybetype, expect("]"), classfield, classBody)
if (value == "*") {
cx.marked = "keyword";
return cont(classBody);
}
if (isTS && type == "(") return pass(functiondecl, classBody)
if (type == ";" || type == ",") return cont(classBody);
if (type == "}") return cont();
if (value == "@") return cont(expression, classBody)
}
function classfield(type, value) {
if (value == "?") return cont(classfield)
if (type == ":") return cont(typeexpr, maybeAssign)
if (value == "=") return cont(expressionNoComma)
var context = cx.state.lexical.prev, isInterface = context && context.info == "interface"
return pass(isInterface ? functiondecl : functiondef)
}
function afterExport(type, value) {
if (value == "*") { cx.marked = "keyword"; return cont(maybeFrom, expect(";")); }
if (value == "default") { cx.marked = "keyword"; return cont(expression, expect(";")); }
if (type == "{") return cont(commasep(exportField, "}"), maybeFrom, expect(";"));
return pass(statement);
}
function exportField(type, value) {
if (value == "as") { cx.marked = "keyword"; return cont(expect("variable")); }
if (type == "variable") return pass(expressionNoComma, exportField);
}
function afterImport(type) {
if (type == "string") return cont();
if (type == "(") return pass(expression);
if (type == ".") return pass(maybeoperatorComma);
return pass(importSpec, maybeMoreImports, maybeFrom);
}
function importSpec(type, value) {
if (type == "{") return contCommasep(importSpec, "}");
if (type == "variable") register(value);
if (value == "*") cx.marked = "keyword";
return cont(maybeAs);
}
function maybeMoreImports(type) {
if (type == ",") return cont(importSpec, maybeMoreImports)
}
function maybeAs(_type, value) {
if (value == "as") { cx.marked = "keyword"; return cont(importSpec); }
}
function maybeFrom(_type, value) {
if (value == "from") { cx.marked = "keyword"; return cont(expression); }
}
function arrayLiteral(type) {
if (type == "]") return cont();
return pass(commasep(expressionNoComma, "]"));
}
function enumdef() {
return pass(pushlex("form"), pattern, expect("{"), pushlex("}"), commasep(enummember, "}"), poplex, poplex)
}
function enummember() {
return pass(pattern, maybeAssign);
}
function isContinuedStatement(state, textAfter) {
return state.lastType == "operator" || state.lastType == "," ||
isOperatorChar.test(textAfter.charAt(0)) ||
/[,.]/.test(textAfter.charAt(0));
}
function expressionAllowed(stream, state, backUp) {
return state.tokenize == tokenBase &&
/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(state.lastType) ||
(state.lastType == "quasi" && /\{\s*$/.test(stream.string.slice(0, stream.pos - (backUp || 0))))
}
// Interface
return {
startState: function(basecolumn) {
var state = {
tokenize: tokenBase,
lastType: "sof",
cc: [],
lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false),
localVars: parserConfig.localVars,
context: parserConfig.localVars && new Context(null, null, false),
indented: basecolumn || 0
};
if (parserConfig.globalVars && typeof parserConfig.globalVars == "object")
state.globalVars = parserConfig.globalVars;
return state;
},
token: function(stream, state) {
if (stream.sol()) {
if (!state.lexical.hasOwnProperty("align"))
state.lexical.align = false;
state.indented = stream.indentation();
findFatArrow(stream, state);
}
if (state.tokenize != tokenComment && stream.eatSpace()) return null;
var style = state.tokenize(stream, state);
if (type == "comment") return style;
state.lastType = type == "operator" && (content == "++" || content == "--") ? "incdec" : type;
return parseJS(state, style, type, content, stream);
},
indent: function(state, textAfter) {
if (state.tokenize == tokenComment || state.tokenize == tokenQuasi) return CodeMirror.Pass;
if (state.tokenize != tokenBase) return 0;
var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical, top
// Kludge to prevent 'maybelse' from blocking lexical scope pops
if (!/^\s*else\b/.test(textAfter)) for (var i = state.cc.length - 1; i >= 0; --i) {
var c = state.cc[i];
if (c == poplex) lexical = lexical.prev;
else if (c != maybeelse) break;
}
while ((lexical.type == "stat" || lexical.type == "form") &&
(firstChar == "}" || ((top = state.cc[state.cc.length - 1]) &&
(top == maybeoperatorComma || top == maybeoperatorNoComma) &&
!/^[,\.=+\-*:?[\(]/.test(textAfter))))
lexical = lexical.prev;
if (statementIndent && lexical.type == ")" && lexical.prev.type == "stat")
lexical = lexical.prev;
var type = lexical.type, closing = firstChar == type;
if (type == "vardef") return lexical.indented + (state.lastType == "operator" || state.lastType == "," ? lexical.info.length + 1 : 0);
else if (type == "form" && firstChar == "{") return lexical.indented;
else if (type == "form") return lexical.indented + indentUnit;
else if (type == "stat")
return lexical.indented + (isContinuedStatement(state, textAfter) ? statementIndent || indentUnit : 0);
else if (lexical.info == "switch" && !closing && parserConfig.doubleIndentSwitch != false)
return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit);
else if (lexical.align) return lexical.column + (closing ? 0 : 1);
else return lexical.indented + (closing ? 0 : indentUnit);
},
electricInput: /^\s*(?:case .*?:|default:|\{|\})$/,
blockCommentStart: jsonMode ? null : "/*",
blockCommentEnd: jsonMode ? null : "*/",
blockCommentContinue: jsonMode ? null : " * ",
lineComment: jsonMode ? null : "//",
fold: "brace",
closeBrackets: "()[]{}''\"\"``",
helperType: jsonMode ? "json" : "javascript",
jsonldMode: jsonldMode,
jsonMode: jsonMode,
expressionAllowed: expressionAllowed,
skipExpression: function(state) {
var top = state.cc[state.cc.length - 1]
if (top == expression || top == expressionNoComma) state.cc.pop()
}
};
});
CodeMirror.registerHelper("wordChars", "javascript", /[\w$]/);
CodeMirror.defineMIME("text/javascript", "javascript");
CodeMirror.defineMIME("text/ecmascript", "javascript");
CodeMirror.defineMIME("application/javascript", "javascript");
CodeMirror.defineMIME("application/x-javascript", "javascript");
CodeMirror.defineMIME("application/ecmascript", "javascript");
CodeMirror.defineMIME("application/json", { name: "javascript", json: true });
CodeMirror.defineMIME("application/x-json", { name: "javascript", json: true });
CodeMirror.defineMIME("application/manifest+json", { name: "javascript", json: true })
CodeMirror.defineMIME("application/ld+json", { name: "javascript", jsonld: true });
CodeMirror.defineMIME("text/typescript", { name: "javascript", typescript: true });
CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript: true });
});
javascript.min.js 0000644 00000042030 15235203126 0010030 0 ustar 00 !(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})((function(a){"use strict";a.defineMode("javascript",(function(b,c){function d(a){for(var b,c=!1,d=!1;null!=(b=a.next());){if(!c){if("/"==b&&!d)return;"["==b?d=!0:d&&"]"==b&&(d=!1)}c=!c&&"\\"==b}}function e(a,b,c){return Pa=a,Qa=c,b}function f(a,b){var c=a.next();if('"'==c||"'"==c)return b.tokenize=g(c),b.tokenize(a,b);if("."==c&&a.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return e("number","number");if("."==c&&a.match(".."))return e("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(c))return e(c);if("="==c&&a.eat(">"))return e("=>","operator");if("0"==c&&a.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return e("number","number");if(/\d/.test(c))return a.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),e("number","number");if("/"==c)return a.eat("*")?(b.tokenize=h,h(a,b)):a.eat("/")?(a.skipToEnd(),e("comment","comment")):Oa(a,b,1)?(d(a),a.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),e("regexp","string-2")):(a.eat("="),e("operator","operator",a.current()));if("`"==c)return b.tokenize=i,i(a,b);if("#"==c&&"!"==a.peek())return a.skipToEnd(),e("meta","meta");if("#"==c&&a.eatWhile(Wa))return e("variable","property");if("<"==c&&a.match("!--")||"-"==c&&a.match("->")&&!/\S/.test(a.string.slice(0,a.start)))return a.skipToEnd(),e("comment","comment");if(Ya.test(c))return">"==c&&b.lexical&&">"==b.lexical.type||(a.eat("=")?"!"!=c&&"="!=c||a.eat("="):/[<>*+\-|&?]/.test(c)&&(a.eat(c),">"==c&&a.eat(c))),"?"==c&&a.eat(".")?e("."):e("operator","operator",a.current());if(Wa.test(c)){a.eatWhile(Wa);var f=a.current();if("."!=b.lastType){if(Xa.propertyIsEnumerable(f)){var j=Xa[f];return e(j.type,j.style,f)}if("async"==f&&a.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return e("async","keyword",f)}return e("variable","variable",f)}}function g(a){return function(b,c){var d,g=!1;if(Ta&&"@"==b.peek()&&b.match(Za))return c.tokenize=f,e("jsonld-keyword","meta");for(;null!=(d=b.next())&&(d!=a||g);)g=!g&&"\\"==d;return g||(c.tokenize=f),e("string","string")}}function h(a,b){for(var c,d=!1;c=a.next();){if("/"==c&&d){b.tokenize=f;break}d="*"==c}return e("comment","comment")}function i(a,b){for(var c,d=!1;null!=(c=a.next());){if(!d&&("`"==c||"$"==c&&a.eat("{"))){b.tokenize=f;break}d=!d&&"\\"==c}return e("quasi","string-2",a.current())}function j(a,b){b.fatArrowAt&&(b.fatArrowAt=null);var c=a.string.indexOf("=>",a.start);if(!(c<0)){if(Va){var d=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(a.string.slice(a.start,c));d&&(c=d.index)}for(var e=0,f=!1,g=c-1;g>=0;--g){var h=a.string.charAt(g),i=$a.indexOf(h);if(i>=0&&i<3){if(!e){++g;break}if(0==--e){"("==h&&(f=!0);break}}else if(i>=3&&i<6)++e;else if(Wa.test(h))f=!0;else if(/["'\/`]/.test(h))for(;;--g){if(0==g)return;var j=a.string.charAt(g-1);if(j==h&&"\\"!=a.string.charAt(g-2)){g--;break}}else if(f&&!e){++g;break}}f&&!e&&(b.fatArrowAt=g)}}function k(a,b,c,d,e,f){this.indented=a,this.column=b,this.type=c,this.prev=e,this.info=f,null!=d&&(this.align=d)}function l(a,b){for(var c=a.localVars;c;c=c.next)if(c.name==b)return!0;for(var d=a.context;d;d=d.prev)for(var c=d.vars;c;c=c.next)if(c.name==b)return!0}function m(a,b,c,d,e){var f=a.cc;for(ab.state=a,ab.stream=e,ab.marked=null,ab.cc=f,ab.style=b,a.lexical.hasOwnProperty("align")||(a.lexical.align=!0);;){if((f.length?f.pop():Ua?D:B)(c,d)){for(;f.length&&f[f.length-1].lex;)f.pop()();return ab.marked?ab.marked:"variable"==c&&l(a,d)?"variable-2":b}}}function n(){for(var a=arguments.length-1;a>=0;a--)ab.cc.push(arguments[a])}function o(){return n.apply(null,arguments),!0}function p(a,b){for(var c=b;c;c=c.next)if(c.name==a)return!0;return!1}function q(a){var b=ab.state;if(ab.marked="def",b.context)if("var"==b.lexical.info&&b.context&&b.context.block){var d=r(a,b.context);if(null!=d)return void(b.context=d)}else if(!p(a,b.localVars))return void(b.localVars=new u(a,b.localVars));c.globalVars&&!p(a,b.globalVars)&&(b.globalVars=new u(a,b.globalVars))}function r(a,b){if(b){if(b.block){var c=r(a,b.prev);return c?c==b.prev?b:new t(c,b.vars,!0):null}return p(a,b.vars)?b:new t(b.prev,new u(a,b.vars),!1)}return null}function s(a){return"public"==a||"private"==a||"protected"==a||"abstract"==a||"readonly"==a}function t(a,b,c){this.prev=a,this.vars=b,this.block=c}function u(a,b){this.name=a,this.next=b}function v(){ab.state.context=new t(ab.state.context,ab.state.localVars,!1),ab.state.localVars=bb}function w(){ab.state.context=new t(ab.state.context,ab.state.localVars,!0),ab.state.localVars=null}function x(){ab.state.localVars=ab.state.context.vars,ab.state.context=ab.state.context.prev}function y(a,b){var c=function(){var c=ab.state,d=c.indented;if("stat"==c.lexical.type)d=c.lexical.indented;else for(var e=c.lexical;e&&")"==e.type&&e.align;e=e.prev)d=e.indented;c.lexical=new k(d,ab.stream.column(),a,null,c.lexical,b)};return c.lex=!0,c}function z(){var a=ab.state;a.lexical.prev&&(")"==a.lexical.type&&(a.indented=a.lexical.indented),a.lexical=a.lexical.prev)}function A(a){function b(c){return c==a?o():";"==a||"}"==c||")"==c||"]"==c?n():o(b)}return b}function B(a,b){return"var"==a?o(y("vardef",b),ka,A(";"),z):"keyword a"==a?o(y("form"),F,B,z):"keyword b"==a?o(y("form"),B,z):"keyword d"==a?ab.stream.match(/^\s*$/,!1)?o():o(y("stat"),H,A(";"),z):"debugger"==a?o(A(";")):"{"==a?o(y("}"),w,Y,z,x):";"==a?o():"if"==a?("else"==ab.state.lexical.info&&ab.state.cc[ab.state.cc.length-1]==z&&ab.state.cc.pop()(),o(y("form"),F,B,z,qa)):"function"==a?o(ua):"for"==a?o(y("form"),ra,B,z):"class"==a||Va&&"interface"==b?(ab.marked="keyword",o(y("form","class"==a?a:b),za,z)):"variable"==a?Va&&"declare"==b?(ab.marked="keyword",o(B)):Va&&("module"==b||"enum"==b||"type"==b)&&ab.stream.match(/^\s*\w/,!1)?(ab.marked="keyword","enum"==b?o(La):"type"==b?o(wa,A("operator"),ba,A(";")):o(y("form"),la,A("{"),y("}"),Y,z,z)):Va&&"namespace"==b?(ab.marked="keyword",o(y("form"),D,B,z)):Va&&"abstract"==b?(ab.marked="keyword",o(B)):o(y("stat"),R):"switch"==a?o(y("form"),F,A("{"),y("}","switch"),w,Y,z,z,x):"case"==a?o(D,A(":")):"default"==a?o(A(":")):"catch"==a?o(y("form"),v,C,B,z,x):"export"==a?o(y("stat"),Da,z):"import"==a?o(y("stat"),Fa,z):"async"==a?o(B):"@"==b?o(D,B):n(y("stat"),D,A(";"),z)}function C(a){if("("==a)return o(xa,A(")"))}function D(a,b){return G(a,b,!1)}function E(a,b){return G(a,b,!0)}function F(a){return"("!=a?n():o(y(")"),H,A(")"),z)}function G(a,b,c){if(ab.state.fatArrowAt==ab.stream.start){var d=c?N:M;if("("==a)return o(v,y(")"),W(xa,")"),z,A("=>"),d,x);if("variable"==a)return n(v,la,A("=>"),d,x)}var e=c?J:I;return _a.hasOwnProperty(a)?o(e):"function"==a?o(ua,e):"class"==a||Va&&"interface"==b?(ab.marked="keyword",o(y("form"),ya,z)):"keyword c"==a||"async"==a?o(c?E:D):"("==a?o(y(")"),H,A(")"),z,e):"operator"==a||"spread"==a?o(c?E:D):"["==a?o(y("]"),Ka,z,e):"{"==a?X(T,"}",null,e):"quasi"==a?n(K,e):"new"==a?o(O(c)):o()}function H(a){return a.match(/[;\}\)\],]/)?n():n(D)}function I(a,b){return","==a?o(H):J(a,b,!1)}function J(a,b,c){var d=0==c?I:J,e=0==c?D:E;return"=>"==a?o(v,c?N:M,x):"operator"==a?/\+\+|--/.test(b)||Va&&"!"==b?o(d):Va&&"<"==b&&ab.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?o(y(">"),W(ba,">"),z,d):"?"==b?o(D,A(":"),e):o(e):"quasi"==a?n(K,d):";"!=a?"("==a?X(E,")","call",d):"."==a?o(S,d):"["==a?o(y("]"),H,A("]"),z,d):Va&&"as"==b?(ab.marked="keyword",o(ba,d)):"regexp"==a?(ab.state.lastType=ab.marked="operator",ab.stream.backUp(ab.stream.pos-ab.stream.start-1),o(e)):void 0:void 0}function K(a,b){return"quasi"!=a?n():"${"!=b.slice(b.length-2)?o(K):o(D,L)}function L(a){if("}"==a)return ab.marked="string-2",ab.state.tokenize=i,o(K)}function M(a){return j(ab.stream,ab.state),n("{"==a?B:D)}function N(a){return j(ab.stream,ab.state),n("{"==a?B:E)}function O(a){return function(b){return"."==b?o(a?Q:P):"variable"==b&&Va?o(ha,a?J:I):n(a?E:D)}}function P(a,b){if("target"==b)return ab.marked="keyword",o(I)}function Q(a,b){if("target"==b)return ab.marked="keyword",o(J)}function R(a){return":"==a?o(z,B):n(I,A(";"),z)}function S(a){if("variable"==a)return ab.marked="property",o()}function T(a,b){if("async"==a)return ab.marked="property",o(T);if("variable"==a||"keyword"==ab.style){if(ab.marked="property","get"==b||"set"==b)return o(U);var c;return Va&&ab.state.fatArrowAt==ab.stream.start&&(c=ab.stream.match(/^\s*:\s*/,!1))&&(ab.state.fatArrowAt=ab.stream.pos+c[0].length),o(V)}return"number"==a||"string"==a?(ab.marked=Ta?"property":ab.style+" property",o(V)):"jsonld-keyword"==a?o(V):Va&&s(b)?(ab.marked="keyword",o(T)):"["==a?o(D,Z,A("]"),V):"spread"==a?o(E,V):"*"==b?(ab.marked="keyword",o(T)):":"==a?n(V):void 0}function U(a){return"variable"!=a?n(V):(ab.marked="property",o(ua))}function V(a){return":"==a?o(E):"("==a?n(ua):void 0}function W(a,b,c){function d(e,f){if(c?c.indexOf(e)>-1:","==e){var g=ab.state.lexical;return"call"==g.info&&(g.pos=(g.pos||0)+1),o((function(c,d){return c==b||d==b?n():n(a)}),d)}return e==b||f==b?o():c&&c.indexOf(";")>-1?n(a):o(A(b))}return function(c,e){return c==b||e==b?o():n(a,d)}}function X(a,b,c){for(var d=3;d<arguments.length;d++)ab.cc.push(arguments[d]);return o(y(b,c),W(a,b),z)}function Y(a){return"}"==a?o():n(B,Y)}function Z(a,b){if(Va){if(":"==a)return o(ba);if("?"==b)return o(Z)}}function $(a,b){if(Va&&(":"==a||"in"==b))return o(ba)}function _(a){if(Va&&":"==a)return ab.stream.match(/^\s*\w+\s+is\b/,!1)?o(D,aa,ba):o(ba)}function aa(a,b){if("is"==b)return ab.marked="keyword",o()}function ba(a,b){return"keyof"==b||"typeof"==b||"infer"==b||"readonly"==b?(ab.marked="keyword",o("typeof"==b?E:ba)):"variable"==a||"void"==b?(ab.marked="type",o(ga)):"|"==b||"&"==b?o(ba):"string"==a||"number"==a||"atom"==a?o(ga):"["==a?o(y("]"),W(ba,"]",","),z,ga):"{"==a?o(y("}"),da,z,ga):"("==a?o(W(fa,")"),ca,ga):"<"==a?o(W(ba,">"),ba):void 0}function ca(a){if("=>"==a)return o(ba)}function da(a){return a.match(/[\}\)\]]/)?o():","==a||";"==a?o(da):n(ea,da)}function ea(a,b){return"variable"==a||"keyword"==ab.style?(ab.marked="property",o(ea)):"?"==b||"number"==a||"string"==a?o(ea):":"==a?o(ba):"["==a?o(A("variable"),$,A("]"),ea):"("==a?n(va,ea):a.match(/[;\}\)\],]/)?void 0:o()}function fa(a,b){return"variable"==a&&ab.stream.match(/^\s*[?:]/,!1)||"?"==b?o(fa):":"==a?o(ba):"spread"==a?o(fa):n(ba)}function ga(a,b){return"<"==b?o(y(">"),W(ba,">"),z,ga):"|"==b||"."==a||"&"==b?o(ba):"["==a?o(ba,A("]"),ga):"extends"==b||"implements"==b?(ab.marked="keyword",o(ba)):"?"==b?o(ba,A(":"),ba):void 0}function ha(a,b){if("<"==b)return o(y(">"),W(ba,">"),z,ga)}function ia(){return n(ba,ja)}function ja(a,b){if("="==b)return o(ba)}function ka(a,b){return"enum"==b?(ab.marked="keyword",o(La)):n(la,Z,oa,pa)}function la(a,b){return Va&&s(b)?(ab.marked="keyword",o(la)):"variable"==a?(q(b),o()):"spread"==a?o(la):"["==a?X(na,"]"):"{"==a?X(ma,"}"):void 0}function ma(a,b){return"variable"!=a||ab.stream.match(/^\s*:/,!1)?("variable"==a&&(ab.marked="property"),"spread"==a?o(la):"}"==a?n():"["==a?o(D,A("]"),A(":"),ma):o(A(":"),la,oa)):(q(b),o(oa))}function na(){return n(la,oa)}function oa(a,b){if("="==b)return o(E)}function pa(a){if(","==a)return o(ka)}function qa(a,b){if("keyword b"==a&&"else"==b)return o(y("form","else"),B,z)}function ra(a,b){return"await"==b?o(ra):"("==a?o(y(")"),sa,z):void 0}function sa(a){return"var"==a?o(ka,ta):"variable"==a?o(ta):n(ta)}function ta(a,b){return")"==a?o():";"==a?o(ta):"in"==b||"of"==b?(ab.marked="keyword",o(D,ta)):n(D,ta)}function ua(a,b){return"*"==b?(ab.marked="keyword",o(ua)):"variable"==a?(q(b),o(ua)):"("==a?o(v,y(")"),W(xa,")"),z,_,B,x):Va&&"<"==b?o(y(">"),W(ia,">"),z,ua):void 0}function va(a,b){return"*"==b?(ab.marked="keyword",o(va)):"variable"==a?(q(b),o(va)):"("==a?o(v,y(")"),W(xa,")"),z,_,x):Va&&"<"==b?o(y(">"),W(ia,">"),z,va):void 0}function wa(a,b){return"keyword"==a||"variable"==a?(ab.marked="type",o(wa)):"<"==b?o(y(">"),W(ia,">"),z):void 0}function xa(a,b){return"@"==b&&o(D,xa),"spread"==a?o(xa):Va&&s(b)?(ab.marked="keyword",o(xa)):Va&&"this"==a?o(Z,oa):n(la,Z,oa)}function ya(a,b){return"variable"==a?za(a,b):Aa(a,b)}function za(a,b){if("variable"==a)return q(b),o(Aa)}function Aa(a,b){return"<"==b?o(y(">"),W(ia,">"),z,Aa):"extends"==b||"implements"==b||Va&&","==a?("implements"==b&&(ab.marked="keyword"),o(Va?ba:D,Aa)):"{"==a?o(y("}"),Ba,z):void 0}function Ba(a,b){return"async"==a||"variable"==a&&("static"==b||"get"==b||"set"==b||Va&&s(b))&&ab.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(ab.marked="keyword",o(Ba)):"variable"==a||"keyword"==ab.style?(ab.marked="property",o(Ca,Ba)):"number"==a||"string"==a?o(Ca,Ba):"["==a?o(D,Z,A("]"),Ca,Ba):"*"==b?(ab.marked="keyword",o(Ba)):Va&&"("==a?n(va,Ba):";"==a||","==a?o(Ba):"}"==a?o():"@"==b?o(D,Ba):void 0}function Ca(a,b){if("?"==b)return o(Ca);if(":"==a)return o(ba,oa);if("="==b)return o(E);var c=ab.state.lexical.prev;return n(c&&"interface"==c.info?va:ua)}function Da(a,b){return"*"==b?(ab.marked="keyword",o(Ja,A(";"))):"default"==b?(ab.marked="keyword",o(D,A(";"))):"{"==a?o(W(Ea,"}"),Ja,A(";")):n(B)}function Ea(a,b){return"as"==b?(ab.marked="keyword",o(A("variable"))):"variable"==a?n(E,Ea):void 0}function Fa(a){return"string"==a?o():"("==a?n(D):"."==a?n(I):n(Ga,Ha,Ja)}function Ga(a,b){return"{"==a?X(Ga,"}"):("variable"==a&&q(b),"*"==b&&(ab.marked="keyword"),o(Ia))}function Ha(a){if(","==a)return o(Ga,Ha)}function Ia(a,b){if("as"==b)return ab.marked="keyword",o(Ga)}function Ja(a,b){if("from"==b)return ab.marked="keyword",o(D)}function Ka(a){return"]"==a?o():n(W(E,"]"))}function La(){return n(y("form"),la,A("{"),y("}"),W(Ma,"}"),z,z)}function Ma(){return n(la,oa)}function Na(a,b){return"operator"==a.lastType||","==a.lastType||Ya.test(b.charAt(0))||/[,.]/.test(b.charAt(0))}function Oa(a,b,c){return b.tokenize==f&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(b.lastType)||"quasi"==b.lastType&&/\{\s*$/.test(a.string.slice(0,a.pos-(c||0)))}var Pa,Qa,Ra=b.indentUnit,Sa=c.statementIndent,Ta=c.jsonld,Ua=c.json||Ta,Va=c.typescript,Wa=c.wordCharacters||/[\w$\xa1-\uffff]/,Xa=(function(){function a(a){return{type:a,style:"keyword"}}var b=a("keyword a"),c=a("keyword b"),d=a("keyword c"),e=a("keyword d"),f=a("operator"),g={type:"atom",style:"atom"};return{if:a("if"),while:b,with:b,else:c,do:c,try:c,finally:c,return:e,break:e,continue:e,new:a("new"),delete:d,void:d,throw:d,debugger:a("debugger"),var:a("var"),const:a("var"),let:a("var"),function:a("function"),catch:a("catch"),for:a("for"),switch:a("switch"),case:a("case"),default:a("default"),in:f,typeof:f,instanceof:f,true:g,false:g,null:g,undefined:g,NaN:g,Infinity:g,this:a("this"),class:a("class"),super:a("atom"),yield:d,export:a("export"),import:a("import"),extends:d,await:d}})(),Ya=/[+\-*&%=<>!?|~^@]/,Za=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,$a="([{}])",_a={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0},ab={state:null,column:null,marked:null,cc:null},bb=new u("this",new u("arguments",null));return x.lex=!0,z.lex=!0,{startState:function(a){var b={tokenize:f,lastType:"sof",cc:[],lexical:new k((a||0)-Ra,0,"block",!1),localVars:c.localVars,context:c.localVars&&new t(null,null,!1),indented:a||0};return c.globalVars&&"object"==typeof c.globalVars&&(b.globalVars=c.globalVars),b},token:function(a,b){if(a.sol()&&(b.lexical.hasOwnProperty("align")||(b.lexical.align=!1),b.indented=a.indentation(),j(a,b)),b.tokenize!=h&&a.eatSpace())return null;var c=b.tokenize(a,b);return"comment"==Pa?c:(b.lastType="operator"!=Pa||"++"!=Qa&&"--"!=Qa?Pa:"incdec",m(b,c,Pa,Qa,a))},indent:function(b,d){if(b.tokenize==h||b.tokenize==i)return a.Pass;if(b.tokenize!=f)return 0;var e,g=d&&d.charAt(0),j=b.lexical;if(!/^\s*else\b/.test(d))for(var k=b.cc.length-1;k>=0;--k){var l=b.cc[k];if(l==z)j=j.prev;else if(l!=qa)break}for(;("stat"==j.type||"form"==j.type)&&("}"==g||(e=b.cc[b.cc.length-1])&&(e==I||e==J)&&!/^[,\.=+\-*:?[\(]/.test(d));)j=j.prev;Sa&&")"==j.type&&"stat"==j.prev.type&&(j=j.prev);var m=j.type,n=g==m;return"vardef"==m?j.indented+("operator"==b.lastType||","==b.lastType?j.info.length+1:0):"form"==m&&"{"==g?j.indented:"form"==m?j.indented+Ra:"stat"==m?j.indented+(Na(b,d)?Sa||Ra:0):"switch"!=j.info||n||0==c.doubleIndentSwitch?j.align?j.column+(n?0:1):j.indented+(n?0:Ra):j.indented+(/^(?:case|default)\b/.test(d)?Ra:2*Ra)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:Ua?null:"/*",blockCommentEnd:Ua?null:"*/",blockCommentContinue:Ua?null:" * ",lineComment:Ua?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:Ua?"json":"javascript",jsonldMode:Ta,jsonMode:Ua,expressionAllowed:Oa,skipExpression:function(a){var b=a.cc[a.cc.length-1];b!=D&&b!=E||a.cc.pop()}}})),a.registerHelper("wordChars","javascript",/[\w$]/),a.defineMIME("text/javascript","javascript"),a.defineMIME("text/ecmascript","javascript"),a.defineMIME("application/javascript","javascript"),a.defineMIME("application/x-javascript","javascript"),a.defineMIME("application/ecmascript","javascript"),a.defineMIME("application/json",{name:"javascript",json:!0}),a.defineMIME("application/x-json",{name:"javascript",json:!0}),a.defineMIME("application/manifest+json",{name:"javascript",json:!0}),a.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),a.defineMIME("text/typescript",{name:"javascript",typescript:!0}),a.defineMIME("application/typescript",{name:"javascript",typescript:!0})}));