/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2011, 2016 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/

/*
Copyright (c) 2002 Douglas Crockford  (www.JSLint.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

/*******************************************************************************
 * @license
 * Copyright (c) 2013 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/

/**
 * @license RequireJS i18n 2.0.4 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
 * Available via the MIT or new BSD license.
 * see: http://github.com/requirejs/i18n for details
 */

/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made
 * available under the terms of the Eclipse Public License v1.0
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html).
 *
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2012, 2015 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors: IBM Corporation - initial API and implementation
 *******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2010, 2016 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/

!function(e,t){"function"==typeof define&&define.amd?define("orion/Deferred",t):"object"==typeof exports?module.exports=t():(e.orion=e.orion||{},e.orion.Deferred=t())}(this,function(){function e(){for(var e;e=i.shift();)e();o=!1}function t(e){i.push(e),o||(o=!0,s())}function n(e){return function(t){e(t)}}function a(e,t,a){try{var r=e(t),i=r&&("object"==typeof r||"function"==typeof r)&&r.then;if("function"==typeof i)if(r===a.promise)a.reject(new TypeError);else{var o=r.cancel;"function"==typeof o?a._parentCancel=o.bind(r):delete a._parentCancel,i.call(r,n(a.resolve),n(a.reject),n(a.progress))}else a.resolve(r)}catch(s){a.reject(s)}}function r(){function e(){for(var e;e=l.shift();){var t=e.deferred,n="fulfilled"===c?"resolve":"reject",r=e[n];"function"==typeof r?a(r,s,t):t[n](s)}}function n(n){delete d._parentCancel,c="rejected",s=n,l.length&&t(e)}function i(a){function o(e){return function(t){c&&"assumed"!==c||e(t)}}delete d._parentCancel;try{var u=a&&("object"==typeof a||"function"==typeof a)&&a.then;if("function"==typeof u)if(a===d)n(new TypeError);else{c="assumed";var f=a&&a.cancel;if("function"!=typeof f){var p=new r;a=p.promise;try{u(p.resolve,p.reject,p.progress)}catch(h){p.reject(h)}f=a.cancel,u=a.then}s=a,u.call(a,o(i),o(n)),d._parentCancel=f.bind(a)}else c="fulfilled",s=a,l.length&&t(e)}catch(g){o(n)(g)}}function o(){var e=d._parentCancel;if(e)delete d._parentCancel,e();else if(!c){var t=new Error("Cancel");t.name="Cancel",n(t)}}var s,c,l=[],d=this;this.resolve=function(e){return c||i(e),d},this.reject=function(e){return c||n(e),d},this.progress=function(e){return c||l.forEach(function(t){if(t.progress)try{t.progress(e)}catch(n){}}),d.promise},this.cancel=function(){return d._parentCancel?setTimeout(o,0):o(),d},this.then=function(n,a,i){var o=new r;return o._parentCancel=d.promise.cancel,l.push({resolve:n,reject:a,progress:i,deferred:o}),("fulfilled"===c||"rejected"===c)&&t(e),o.promise},this.promise={then:d.then,cancel:d.cancel}}var i=[],o=!1,s=function(){if("undefined"!=typeof process&&"function"==typeof process.nextTick){var t=process.nextTick;return function(){t(e)}}if("function"==typeof MutationObserver){var n=document.createElement("div"),a=new MutationObserver(e);return a.observe(n,{attributes:!0}),function(){n.setAttribute("class","_tick")}}return function(){setTimeout(e,0)}}();return r.all=function(e,t){function n(e,t){s||(o[e]=t,0===--i&&c.resolve(o))}function a(e,a){if(!s){if(t)try{return void n(e,t(a))}catch(r){a=r}c.reject(a)}}var i=e.length,o=[],s=!1,c=new r;return c.then(void 0,function(){s=!0,e.forEach(function(e){e.cancel&&e.cancel()})}),0===i?c.resolve(o):e.forEach(function(e,t){e.then(n.bind(void 0,t),a.bind(void 0,t))}),c.promise},r.when=function(e,t,n,a){var i,o;return e&&"function"==typeof e.then?i=e:(o=new r,o.resolve(e),i=o.promise),i.then(t,n,a)},r}),define("orion/EventTarget",[],function(){function e(){this._namedListeners={}}return e.prototype={dispatchEvent:function(e){if(!e.type)throw new Error("unspecified type");var t=this._namedListeners[e.type];return t&&t.forEach(function(t){try{"function"==typeof t?t(e):t.handleEvent(e)}catch(n){"undefined"!=typeof console&&console.log(n)}}),!e.defaultPrevented},addEventListener:function(e,t){("function"==typeof t||t.handleEvent)&&(this._namedListeners[e]=this._namedListeners[e]||[],this._namedListeners[e].push(t))},removeEventListener:function(e,t){var n=this._namedListeners[e];if(n)for(var a=0;a<n.length;a++)if(n[a]===t){1===n.length?delete this._namedListeners[e]:n.splice(a,1);break}}},e.prototype.constructor=e,e.attach=function(t){var n=new e;t.dispatchEvent=n.dispatchEvent.bind(n),t.addEventListener=n.addEventListener.bind(n),t.removeEventListener=n.removeEventListener.bind(n)},e}),function(e,t){"function"==typeof define&&define.amd?define("orion/plugin",["orion/Deferred","orion/EventTarget"],t):"object"==typeof exports?module.exports=t(require("orion/Deferred"),require("orion/EventTarget")):(e.orion=e.orion||{},e.orion.PluginProvider=t(e.orion.Deferred,e.orion.EventTarget))}(this,function(e,t){function n(e,t){var n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;n.sort(),a.sort();for(var r=0,i=n.length;i>r;r++){var o=n[r];if(o!==a[r])return!1;var s=e[o],c=t[o];if(s!==c&&JSON.stringify(s)!==JSON.stringify(c))return!1}return!0}function a(e,t){this.__objectId=e,this.__methods=t}function r(r,i){function o(e,t){t=t||I,t&&("undefined"==typeof ArrayBuffer&&(e=JSON.stringify(e)),t===self||N?t.postMessage(e):t.postMessage(e,"*"))}function s(e){"undefined"!=typeof localStorage&&localStorage.pluginLogging&&console.log(e+"("+(Date.now()-B)+"ms)="+self.location)}function c(){var e=Date.now();F&&4e3>e-F||(F=e,o({method:"loading"}),s("heartbeat"))}function l(){var e=[];return Object.keys(L).forEach(function(t){var n=L[t];e.push({serviceId:t,names:n.names,methods:n.methods,properties:n.properties})}),{updateRegistry:!!T,headers:k||{},services:e}}function d(e,t){if(t&&t instanceof XMLHttpRequest){var n,a;try{n=t.status,a=t.statusText}catch(r){n=0,a=""}return{status:n||0,statusText:a}}return t}function u(e){var t=e?JSON.parse(JSON.stringify(e,d)):e;return e instanceof Error&&(t.__isError=!0,t.message=t.message||e.message,t.name=t.name||e.name),t}function f(t,n){if(n=n||I,!n)return(new e).reject(new Error("plugin not connected"));t.id=String(E++);var r=new e;D[t.id]=r,r.then(null,function(e){A&&e instanceof Error&&"Cancel"===e.name&&C({requestId:t.id,method:"cancel",params:e.message?[e.message]:[]},n)});var i=Object.prototype.toString;return t.params.forEach(function(e,n){if("[object Object]"===i.call(e)&&!(e instanceof a)){var o,s;for(o in e)"[object Function]"===i.call(e[o])&&(s=s||[],s.push(o));if(s){var c=U++;O[c]=e;var l=function(){delete O[c]};r.then(l,l),t.params[n]=new a(c,s)}}}),C(t,n),r.promise}function p(e,t,n){e||0===e?C({id:e,result:null,error:t},n):console.log(t)}function h(e,t,n,a,r){a.forEach(function(e,t){if(e&&"undefined"!=typeof e.__objectId){var n={};e.__methods.forEach(function(t){n[t]=function(){return f({objectId:e.__objectId,method:t,params:Array.prototype.slice.call(arguments)},r)}}),a[t]=n}});var i="undefined"==typeof e?null:{id:e,result:null,error:null};try{var o=n.apply(t,a);if(!i)return;o&&"function"==typeof o.then?(j[e]=o,o.then(function(t){delete j[e],i.result=t,C(i,r)},function(t){j[e]&&(delete j[e],i.error=u(t),C(i,r))},function(){C({responseId:e,method:"progress",params:Array.prototype.slice.call(arguments)},r)})):(i.result=o,C(i,r))}catch(s){i&&(i.error=u(s),C(i,r))}}function g(e,t){if(N||e.source===I||"undefined"==typeof window){var n=e.data,a="string"!=typeof n?n:JSON.parse(n);try{if(a.method){var r=a.method,i=a.params||[];if("serviceId"in a){var o=L[a.serviceId];o?(o=o.implementation,r in o?h(a.id,o,o[r],i,t):p(a.id,"method not found",t)):p(a.id,"service not found",t)}else if("objectId"in a){var s=O[a.objectId];s?r in s?h(a.id,s,s[r],i,t):p(a.id,"method not found",t):p(a.id,"object not found",t)}else if("requestId"in a){var c=j[a.requestId];c&&"cancel"===r&&c.cancel&&c.cancel.apply(c,i)}else if("responseId"in a){var l=D[a.responseId];l&&"progress"===r&&l.progress&&l.progress.apply(l,i)}else{if("plugin"!==a.method)throw new Error("Bad method: "+a.method);var d=a.params[0];y({services:d.services})}}else if(a.id){var u=D[String(a.id)];u&&(delete D[String(a.id)],a.error?u.reject(a.error):u.resolve(a.result))}}catch(f){console.log("Plugin._messageHandler "+f)}}}function m(e){var n={};if(e.methods&&(e.methods.forEach(function(t){n[t]=function(){var n={serviceId:e.serviceId,method:t,params:Array.prototype.slice.call(arguments)};return f(n)}}),n.addEventListener&&n.removeEventListener&&t)){var r=new t,i=U++;O[i]={handleEvent:r.dispatchEvent.bind(r)};var o=new a(i,["handleEvent"]),s=n.addEventListener;n.addEventListener=function(e,t){r._namedListeners[e]||s(e,o),r.addEventListener(e,t)};var c=n.removeEventListener;n.removeEventListener=function(e,t){r.removeEventListener(e,t),r._namedListeners[e]||c(e,o)}}return n}function v(e){var t=JSON.parse(JSON.stringify(e.properties)),n=e.names||e.type||[];return Array.isArray(n)||(n=[n]),t.objectClass=n,t}function b(e){if(T){var t=m(e),n=v(e),a=T.registerService(e.names||e.type,t,n);M[e.serviceId]={registration:a,proxy:t}}}function y(e){var t=w||[];if(w=e.services||[],!n(w,t)){var a=[];w.forEach(function(e){var t=e.serviceId;a.push(t);var r=M[t];if(r){if(n(e.methods,Object.keys(r.proxy))){var i=v(e),o=r.registration.getReference(),s={};return o.getPropertyKeys().forEach(function(e){s[e]=o.getProperty(e)}),void(n(i,s)||r.registration.setProperties(i))}r.registration.unregister(),delete M[t]}b(e)}),Object.keys(M).forEach(function(e){-1===a.indexOf(e)&&(M[e].registration.unregister(),delete M[e])})}x&&(x(),x=null)}var w,x,k=r,A=!1,E=0,U=0,S=0,j={},D={},O={},L={},M={},T=i,_=[],N=!1,I=null;"undefined"==typeof window?self.postMessage?I=self:N=!0:window!==window.parent?I=window.parent:null!==window.opener&&(I=window.opener);var C=o,q=function(e){o({method:"error",error:u(e.error)})};addEventListener("error",q);var F,B=Date.now();c(),N&&self.addEventListener("connect",function(e){var t=e.ports[0];if(_.push(t),A){var n={method:"plugin",params:[l()]};o(n,t)}else c();t.addEventListener("message",function(e){g(e,t)}),t.start()}),this.updateHeaders=function(e){if(A)throw new Error("Cannot update headers. Plugin Provider is connected");k=e},this.registerService=function(e,t,n){if(A)throw new Error("Cannot register service. Plugin Provider is connected");"string"==typeof e?e=[e]:Array.isArray(e)||(e=[]);var a=null,r=[];for(a in t)"function"==typeof t[a]&&r.push(a);L[S++]={names:e,methods:r,implementation:t,properties:n||{},listeners:{}},c()},this.registerServiceProvider=this.registerService,this.connect=function(e,t){if(A)return void(e&&e());removeEventListener("error",q);var n={method:"plugin",params:[l()]};if(!N){if(!I)return void(t&&t("No valid plugin target"));addEventListener("message",g,!1),o(n)}if("undefined"!=typeof window){var a=document.getElementsByTagName("head")[0]||document.documentElement,r=a.getElementsByTagName("title")[0];r||(r=document.createElement("title"),r.textContent=k?k.name:"",a.appendChild(r))}_.forEach(function(e){o(n,e)}),A=!0,T?x=e:e&&e()},this.disconnect=function(){A&&(removeEventListener("message",g),_.forEach(function(e){e.close()}),_=null,I=null,A=!1)}}return r}),this.JSON||(this.JSON={}),function(){function f(e){return 10>e?"0"+e:e}function quote(e){return escapable.lastIndex=0,escapable.test(e)?'"'+e.replace(escapable,function(e){var t=meta[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var n,a,r,i,o,s=gap,c=t[e];switch(c&&"object"==typeof c&&"function"==typeof c.toJSON&&(c=c.toJSON(e)),"function"==typeof rep&&(c=rep.call(t,e,c)),typeof c){case"string":return quote(c);case"number":return isFinite(c)?String(c):"null";case"boolean":case"null":return String(c);case"object":if(!c)return"null";if(gap+=indent,o=[],"[object Array]"===Object.prototype.toString.apply(c)){for(i=c.length,n=0;i>n;n+=1)o[n]=str(n,c)||"null";return r=0===o.length?"[]":gap?"[\n"+gap+o.join(",\n"+gap)+"\n"+s+"]":"["+o.join(",")+"]",gap=s,r}if(rep&&"object"==typeof rep)for(i=rep.length,n=0;i>n;n+=1)a=rep[n],"string"==typeof a&&(r=str(a,c),r&&o.push(quote(a)+(gap?": ":":")+r));else for(a in c)Object.hasOwnProperty.call(c,a)&&(r=str(a,c),r&&o.push(quote(a)+(gap?": ":":")+r));return r=0===o.length?"{}":gap?"{\n"+gap+o.join(",\n"+gap)+"\n"+s+"}":"{"+o.join(",")+"}",gap=s,r}}"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","	":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;"function"!=typeof JSON.stringify&&(JSON.stringify=function(e,t,n){var a;if(gap="",indent="","number"==typeof n)for(a=0;n>a;a+=1)indent+=" ";else"string"==typeof n&&(indent=n);if(rep=t,t&&"function"!=typeof t&&("object"!=typeof t||"number"!=typeof t.length))throw new Error("JSON.stringify");return str("",{"":e})}),"function"!=typeof JSON.parse&&(JSON.parse=function(text,reviver){function walk(e,t){var n,a,r=e[t];if(r&&"object"==typeof r)for(n in r)Object.hasOwnProperty.call(r,n)&&(a=walk(r,n),void 0!==a?r[n]=a:delete r[n]);return reviver.call(e,t,r)}var j;if(text=String(text),cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}();var JSLINT=function(){function e(){}function t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function n(e,n){var a;for(a in n)t(n,a)&&(e[a]=n[a])}function a(){Xt.safe||(Xt.rhino&&n(Gt,kn),Xt.devel&&n(Gt,vn),Xt.browser&&n(Gt,hn),Xt.node&&n(Gt,xn),Xt.windows&&n(Gt,An),Xt.widget&&n(Gt,jn))}function r(e,t,n){throw{name:"JSLintError",line:t,character:n,message:e+" ("+Math.floor(t/Pt.length*100)+"% scanned)."}}function i(e,t,n,a,i,o){var s,c,l;return t=t||Wt,"(end)"===t.id&&(t=rn),c=t.line||0,s=t.from||0,l={id:"(error)",raw:e,evidence:Pt[c-1]||"",line:c,character:s,a:n,b:a,c:i,d:o},l.reason=e.supplant(l),JSLINT.errors.push(l),Xt.passfail&&r("Stopping. ",c,s),sn+=1,sn>=Xt.maxerr&&r("Too many errors.",c,s),l}function o(e,t,n,a,r,o,s){return i(e,{line:t,from:n},a,r,o,s)}function s(e,t,n,a,o,s){var c=i(e,t,n,a,o,s);r("Stopping, unable to continue.",c.line,c.character)}function c(e,t,n,a,r,i,o){return s(e,{line:t,from:n},a,r,i,o)}function l(e,n){Xt.safe&&It["(global)"]&&"boolean"!=typeof Gt[e]?i("ADsafe global: "+e+".",rn):"hasOwnProperty"===e&&i("'hasOwnProperty' is a really bad name."),t(It,e)&&!It["(global)"]&&i(It[e]===!0?"'{a}' was used before it was defined.":"'{a}' is already defined.",Wt,e),It[e]=n,It["(global)"]?(qt[e]=It,t(Bt,e)&&(i("'{a}' was used before it was defined.",Wt,e),delete Bt[e])):Qt[e]=It}function d(){var e,t,n,r,o,c=Wt.value;switch(c){case"*/":s("Unbegun comment.");break;case"/*members":case"/*member":c="/*members",Ht||(Ht={}),t=Ht;break;case"/*jslint":Xt.safe&&i("ADsafe restriction."),t=Xt,n=pn;break;case"/*global":Xt.safe&&i("ADsafe restriction."),t=Gt}r=Rn.token();e:for(;;){for(;;){if("special"===r.type&&"*/"===r.value)break e;if("(endline)"!==r.id&&","!==r.id)break;r=Rn.token()}"(string)"!==r.type&&"(identifier)"!==r.type&&"/*members"!==c&&s("Bad option.",r),o=Rn.token(),":"===o.id?(o=Rn.token(),t===Ht&&s("Expected '{a}' and instead saw '{b}'.",r,"*/",":"),"indent"===r.value&&"/*jslint"===c?(e=+o.value,("number"!=typeof e||!isFinite(e)||0>=e||Math.floor(e)!==e)&&s("Expected a small integer and instead saw '{a}'.",o,o.value),t.white=!0,t.indent=e):"maxerr"===r.value&&"/*jslint"===c?(e=+o.value,("number"!=typeof e||!isFinite(e)||0>=e||Math.floor(e)!==e)&&s("Expected a small integer and instead saw '{a}'.",o,o.value),t.maxerr=e):"maxlen"===r.value&&"/*jslint"===c?(e=+o.value,("number"!=typeof e||!isFinite(e)||0>=e||Math.floor(e)!==e)&&s("Expected a small integer and instead saw '{a}'.",o,o.value),t.maxlen=e):"true"===o.value?t[r.value]=!0:"false"===o.value?t[r.value]=!1:s("Bad option value.",o),r=Rn.token()):("/*jslint"===c&&s("Missing option value.",r),t[r.value]=!1,r=o)}n&&a()}function u(e){for(var t,n=e||0,a=0;n>=a;)t=Rt[a],t||(t=Rt[a]=Rn.token()),a+=1;return t}function f(e,t){switch(rn.id){case"(number)":"."===Wt.id&&i("A dot following a number can be confused with a decimal point.",rn);break;case"-":("-"===Wt.id||"--"===Wt.id)&&i("Confusing minusses.");break;case"+":("+"===Wt.id||"++"===Wt.id)&&i("Confusing plusses.")}for(("(string)"===rn.type||rn.identifier)&&(Dt=rn.value),e&&Wt.id!==e&&(t?"(end)"===Wt.id?i("Unmatched '{a}'.",t,t.id):i("Expected '{a}' to match '{b}' from line {c} and instead saw '{d}'.",Wt,e,t.id,t.line,Wt.value):("(identifier)"!==Wt.type||Wt.value!==e)&&i("Expected '{a}' and instead saw '{b}'.",Wt,e,Wt.value)),Kt=rn,rn=Wt;;){if(Wt=Rt.shift()||Rn.token(),"(end)"===Wt.id||"(error)"===Wt.id)return;if("special"===Wt.type)d();else if("(endline)"!==Wt.id)break}}function p(e,t){var n;if("(end)"===Wt.id&&s("Unexpected early end of program.",rn),f(),Xt.safe&&"boolean"==typeof Gt[rn.value]&&"("!==Wt.id&&"."!==Wt.id&&i("ADsafe violation.",rn),t&&(Dt="anonymous",It["(verb)"]=rn.value),t===!0&&rn.fud)n=rn.fud();else{if(rn.nud)n=rn.nud();else{if("(number)"===Wt.type&&"."===rn.id)return i("A leading decimal point can be confused with a dot: '.{a}'.",rn,Wt.value),f(),rn;s("Expected an identifier and instead saw '{a}'.",rn,rn.id)}for(;e<Wt.lbp;)f(),rn.led?n=rn.led(n):s("Expected an operator and instead saw '{a}'.",rn,rn.id)}return n}function h(e,t){e=e||rn,t=t||Wt,(Xt.white||"styleproperty"===cn||"style"===cn)&&e.character!==t.from&&e.line===t.line&&i("Unexpected space after '{a}'.",t,e.value)}function g(e,t){e=e||rn,t=t||Wt,Xt.white&&!e.comment&&e.line===t.line&&h(e,t)}function m(e,t){Xt.white&&(e=e||rn,t=t||Wt,e.line===t.line&&e.character===t.from&&i("Missing space after '{a}'.",Wt,e.value))}function v(e,t){e=e||rn,t=t||Wt,Xt.laxbreak||e.line===t.line?Xt.white&&(e=e||rn,t=t||Wt,e.character===t.from&&i("Missing space after '{a}'.",Wt,e.value)):i("Bad line breaking before '{a}'.",t,t.id)}function b(e){var t;Xt.white&&"(end)"!==Wt.id&&(t=zt+(e||0),Wt.from!==t&&i("Expected '{a}' to have an indentation at {b} instead at {c}.",Wt,Wt.value,t,Wt.from))}function y(e){e=e||rn,e.line!==Wt.line&&i("Line breaking error '{a}'.",e,e.value)}function w(){rn.line!==Wt.line?Xt.laxbreak||i("Bad line breaking before '{a}'.",rn,Wt.id):rn.character!==Wt.from&&Xt.white&&i("Unexpected space after '{a}'.",Wt,rn.value),f(","),m(rn,Wt)}function x(e,t){var n=Sn[e];return n&&"object"==typeof n||(Sn[e]=n={id:e,lbp:t,value:e}),n}function k(e){return x(e,0)}function A(e,t){var n=k(e);return n.identifier=n.reserved=!0,n.fud=t,n}function E(e,t){var n=A(e,t);return n.block=!0,n}function U(e){var t=e.id.charAt(0);return(t>="a"&&"z">=t||t>="A"&&"Z">=t)&&(e.identifier=e.reserved=!0),e}function S(e,t){var n=x(e,150);return U(n),n.nud="function"==typeof t?t:function(){return this.right=p(150),this.arity="unary",("++"===this.id||"--"===this.id)&&(Xt.plusplus?i("Unexpected use of '{a}'.",this,this.id):this.right.identifier&&!this.right.reserved||"."===this.right.id||"["===this.right.id||i("Bad operand.",this)),this},n}function j(e,t){var n=k(e);return n.type=e,n.nud=t,n}function D(e,t){var n=j(e,t);return n.identifier=n.reserved=!0,n}function O(e){return D(e,function(){return("this"===this.id||"arguments"===this.id||"eval"===this.id)&&(nn&&It["(global)"]?i("Strict violation.",this):Xt.safe&&i("ADsafe violation.",this)),this})}function L(e,t,n,a){var r=x(e,n);return U(r),r.led=function(e){return a||(v(Kt,rn),m(rn,Wt)),"function"==typeof t?t(e,this):(this.left=e,this.right=p(n),this)},r}function M(e,t){var n=x(e,100);return n.led=function(e){v(Kt,rn),m(rn,Wt);var n=p(100);return e&&"NaN"===e.id||n&&"NaN"===n.id?i("Use the isNaN function to compare with NaN.",this):t&&t.apply(this,[e,n]),"!"===e.id&&i("Confusing use of '{a}'.",e,"!"),"!"===n.id&&i("Confusing use of '{a}'.",e,"!"),this.left=e,this.right=n,this},n}function T(e){return e&&("(number)"===e.type&&0===+e.value||"(string)"===e.type&&" "===e.value||"true"===e.type||"false"===e.type||"undefined"===e.type||"null"===e.type)}function _(e){return x(e,20).exps=!0,L(e,function(e,t){var n;if(t.left=e,Gt[e.value]===!1&&Qt[e.value]["(global)"]===!0&&i("Read only.",e),Xt.safe){n=e;do"boolean"==typeof Gt[n.value]&&i("ADsafe violation.",n),n=n.left;while(n)}if(e){if("."===e.id||"["===e.id)return e.left&&"arguments"!==e.left.value||i("Bad assignment.",t),t.right=p(19),t;if(e.identifier&&!e.reserved)return"exception"===It[e.value]&&i("Do not assign to the exception parameter.",e),t.right=p(19),t;e===Sn["function"]&&i("Expected an identifier in an assignment and instead saw a function invocation.",rn)}s("Bad assignment.",t)},20)}function N(e,t,n){var a=x(e,n);return U(a),a.led="function"==typeof t?t:function(e){return Xt.bitwise&&i("Unexpected use of '{a}'.",this,this.id),this.left=e,this.right=p(n),this},a}function I(e){return x(e,20).exps=!0,L(e,function(e,t){return Xt.bitwise&&i("Unexpected use of '{a}'.",t,t.id),m(Kt,rn),m(rn,Wt),e?"."===e.id||"["===e.id||e.identifier&&!e.reserved?(p(19),t):(e===Sn["function"]&&i("Expected an identifier in an assignment, and instead saw a function invocation.",rn),t):void s("Bad assignment.",t)},20)}function C(e){var t=x(e,150);return t.led=function(e){return Xt.plusplus?i("Unexpected use of '{a}'.",this,this.id):e.identifier&&!e.reserved||"."===e.id||"["===e.id||i("Bad operand.",this),this.left=e,this},t}function q(){return Wt.identifier?(f(),Xt.safe&&fn[rn.value]?i("ADsafe violation: '{a}'.",rn,rn.value):rn.reserved&&!Xt.es5&&i("Expected an identifier and instead saw '{a}' (a reserved word).",rn,rn.id),rn.value):void 0}function F(){var e=q();return e?e:void("function"===rn.id&&"("===Wt.id?i("Missing name in function statement."):s("Expected an identifier and instead saw '{a}'.",Wt,Wt.value))}function B(e){var t,n=0;if(";"===Wt.id&&!Vt)for(;;){if(t=u(n),t.reach)return;if("(endline)"!==t.id){if("function"===t.id){i("Inner functions should be listed at the top of the outer function.",t);break}i("Unreachable '{a}' after '{b}'.",t,t.value,e);break}n+=1}}function $(e){var t,n=zt,a=Qt,r=Wt;return";"===r.id?(i("Unnecessary semicolon.",r),void f(";")):(r.identifier&&!r.reserved&&":"===u().id&&(f(),f(":"),Qt=Object.create(a),l(r.value,"label"),Wt.labelled||i("Label '{a}' on {b} statement.",Wt,r.value,Wt.value),qn.test(r.value+":")&&i("Label '{a}' looks like a javascript url.",r,r.value),Wt.label=r.value,r=Wt),e||b(),t=p(0,!0),r.block||(t&&t.exps?"("===t.id&&"new"===t.left.id&&i("Do not use 'new' for side effects."):i("Expected an assignment or function call and instead saw an expression.",rn),";"!==Wt.id?o("Missing semicolon.",rn.line,rn.from+rn.value.length):(h(rn,Wt),f(";"),m(rn,Wt))),zt=n,Qt=a,t)}function z(){return"use strict"===Wt.value?(f(),f(";"),nn=!0,!0):!1}function J(e){var t,n,a=[];if(e&&!z()&&Xt.strict&&i('Missing "use strict" statement.',Wt),Xt.adsafe)switch(e){case"script":St||("ADSAFE"!==Wt.value||"."!==u(0).id||"id"!==u(1).value&&"go"!==u(1).value)&&s("ADsafe violation: Missing ADSAFE.id or ADSAFE.go.",Wt),"ADSAFE"===Wt.value&&"."===u(0).id&&"id"===u(1).value&&(St&&s("ADsafe violation.",Wt),f("ADSAFE"),f("."),f("id"),f("("),Wt.value!==Ut&&s("ADsafe violation: id does not match.",Wt),f("(string)"),f(")"),f(";"),St=!0);break;case"lib":if("ADSAFE"===Wt.value)return f("ADSAFE"),f("."),f("lib"),f("("),f("(string)"),w(),t=p(0),"function"!==t.id&&s("The second argument to lib must be a function.",t),n=t.funct["(params)"],n=n&&n.join(", "),n&&"lib"!==n&&s("Expected '{a}' and instead saw '{b}'.",t,"(lib)","("+n+")"),f(")"),f(";"),a;s("ADsafe lib violation.")}for(;!Wt.reach&&"(end)"!==Wt.id;)";"===Wt.id?(i("Unnecessary semicolon."),f(";")):a.push($());return a}function P(e){var t,n,a=$t,r=zt,o=Qt;if($t=e,Qt=Object.create(Qt),m(rn,Wt),n=Wt,"{"===Wt.id){if(f("{"),"}"!==Wt.id||rn.line!==Wt.line){for(zt+=Xt.indent;!e&&Wt.from>zt;)zt+=Xt.indent;e||z(),t=J(),zt-=Xt.indent,b()}f("}",n),zt=r}else i("Expected '{a}' and instead saw '{b}'.",Wt,"{",Wt.value),Vt=!0,t=[$()],Vt=!1;return It["(verb)"]=null,Qt=o,$t=a,t}function R(){return this}function Z(e){Ht&&"boolean"!=typeof Ht[e]&&i("Unexpected /*member '{a}'.",rn,e),"number"==typeof Zt[e]?Zt[e]+=1:Zt[e]=1}function H(e){var t=e.value,n=e.line,a=Bt[t];"function"==typeof a&&(a=!1),a?a[a.length-1]!==n&&a.push(n):(a=[n],Bt[t]=a)}function W(){return Wt.identifier?(f(),!0):void 0}function V(){return"-"===Wt.id&&(f("-"),h(),y()),"(number)"===Wt.type?(f("(number)"),!0):void 0}function X(){return"(string)"===Wt.type?(f(),!0):void 0}function G(){var e,t,n;if(Wt.identifier){if(n=Wt.value,"rgb"===n||"rgba"===n){for(f(),f("("),e=0;3>e;e+=1)e&&f(","),t=Wt.value,"(number)"!==Wt.type||0>t?(i("Expected a positive number and instead saw '{a}'",Wt,t),f()):(f(),"%"===Wt.id?(f("%"),t>100&&i("Expected a percentage and instead saw '{a}'",rn,t)):t>255&&i("Expected a small number and instead saw '{a}'",rn,t));return"rgba"===n&&(f(","),t=+Wt.value,("(number)"!==Wt.type||0>t||t>1)&&i("Expected a number between 0 and 1 and instead saw '{a}'",Wt,t),f(),"%"===Wt.id&&(i("Unexpected '%'."),f("%"))),f(")"),!0}if(gn[Wt.value]===!0)return f(),!0}else if("(color)"===Wt.type)return f(),!0;return!1}function Y(){return"-"===Wt.id&&(f("-"),h(),y()),"(number)"===Wt.type?(f(),"(string)"!==Wt.type&&mn[Wt.value]===!0?(h(),f()):0!==+rn.value&&i("Expected a linear unit and instead saw '{a}'.",Wt,Wt.value),!0):!1}function K(){return"-"===Wt.id&&(f("-"),h()),"(number)"===Wt.type?(f(),"(string)"!==Wt.type&&mn[Wt.value]===!0&&(h(),f()),!0):!1}function Q(){if(!Wt.identifier)return Y();switch(Wt.value){case"thin":case"medium":case"thick":return f(),!0}}function et(){return Wt.identifier?"auto"===Wt.value?(f(),!0):void 0:Y()}function tt(){return Wt.identifier&&"attr"===Wt.value?(f(),f("("),Wt.identifier||i("Expected a name and instead saw '{a}'.",Wt,Wt.value),f(),f(")"),!0):!1}function nt(){for(;";"!==Wt.id;){if(W()||X()||i("Expected a name and instead saw '{a}'.",Wt,Wt.value),","!==Wt.id)return!0;w()}}function at(){return Wt.identifier&&"counter"===Wt.value?(f(),f("("),!Wt.identifier,f(),","===Wt.id&&(w(),"(string)"!==Wt.type&&i("Expected a string and instead saw '{a}'.",Wt,Wt.value),f()),f(")"),!0):Wt.identifier&&"counters"===Wt.value?(f(),f("("),Wt.identifier||i("Expected a name and instead saw '{a}'.",Wt,Wt.value),f(),","===Wt.id&&(w(),"(string)"!==Wt.type&&i("Expected a string and instead saw '{a}'.",Wt,Wt.value),f()),","===Wt.id&&(w(),"(string)"!==Wt.type&&i("Expected a string and instead saw '{a}'.",Wt,Wt.value),f()),f(")"),!0):!1}function rt(){var e;if(Wt.identifier&&"rect"===Wt.value){for(f(),f("("),e=0;4>e;e+=1)if(!Y()){i("Expected a number and instead saw '{a}'.",Wt,Wt.value);break}return f(")"),!0}return!1}function it(){var e,t;return Wt.identifier&&"url"===Wt.value?(Wt=Rn.range("(",")"),t=Wt.value,e=t.charAt(0),('"'===e||"'"===e)&&(t.slice(-1)!==e?i("Bad url string."):(t=t.slice(1,-1),t.indexOf(e)>=0&&i("Bad url string."))),t||i("Missing url."),f(),Xt.safe&&Fn.test(t)&&s("ADsafe URL violation."),on.push(t),!0):!1}function ot(){for(var e;"*"===Wt.id||"#"===Wt.id||"_"===Wt.value;)Xt.css||i("Unexpected '{a}'.",Wt,Wt.value),f();return"-"===Wt.id?(Xt.css||i("Unexpected '{a}'.",Wt,Wt.value),f("-"),Wt.identifier||i("Expected a non-standard style attribute and instead saw '{a}'.",Wt,Wt.value),f(),Mt):(Wt.identifier?t(Lt,Wt.value)?e=Lt[Wt.value]:(e=Mt,Xt.css||i("Unrecognized style attribute '{a}'.",Wt,Wt.value)):i("Excepted a style attribute, and instead saw '{a}'.",Wt,Wt.value),f(),e)}function st(e){var t,n,a,r,i,o=0,s=0;switch(typeof e){case"function":return e();case"string":return Wt.identifier&&Wt.value===e?(f(),!0):!1}for(;;){if(o>=e.length)return!1;if(i=e[o],o+=1,i===!0)break;for("number"==typeof i?(t=i,i=e[o],o+=1):t=1,a=!1;t>0&&st(i);)a=!0,t-=1;if(a)return!0}for(s=o,n=[];;){for(r=!1,o=s;o<e.length;o+=1)if(!n[o]&&st(Lt[e[o]])){a=!0,r=!0,n[o]=!0;break}if(!r)return a}}function ct(){if("(number)"===Wt.id)return f(),void("n"===Wt.value&&Wt.identifier&&(h(),f(),"+"===Wt.id&&(h(),f("+"),h(),f("(number)"))));switch(Wt.value){case"odd":case"even":if(Wt.identifier)return void f()}i("Unexpected token '{a}'.",Wt,Wt.value)}function lt(){for(var e;;){if("}"===Wt.id||"(end)"===Wt.id||ln&&Wt.id===ln)return;for(;";"===Wt.id;)i("Misplaced ';'."),f(";");e=ot(),f(":"),Wt.identifier&&"inherit"===Wt.value?f():st(e)||(i("Unexpected token '{a}'.",Wt,Wt.value),f()),"!"===Wt.id&&(f("!"),h(),Wt.identifier&&"important"===Wt.value?f():i("Expected '{a}' and instead saw '{b}'.",Wt,"important",Wt.value)),"}"===Wt.id||Wt.id===ln?i("Missing '{a}'.",Wt,";"):f(";")}}function dt(){if(Wt.identifier)t(wn,Wt.value)||i("Expected a tagName, and instead saw {a}.",Wt,Wt.value),f();else switch(Wt.id){case">":case"+":f(),dt();break;case":":switch(f(":"),Wt.value){case"active":case"after":case"before":case"checked":case"disabled":case"empty":case"enabled":case"first-child":case"first-letter":case"first-line":case"first-of-type":case"focus":case"hover":case"last-of-type":case"link":case"only-of-type":case"root":case"target":case"visited":f();break;case"lang":f(),f("("),Wt.identifier||i("Expected a lang code, and instead saw :{a}.",Wt,Wt.value),f(")");break;case"nth-child":case"nth-last-child":case"nth-last-of-type":case"nth-of-type":f(),f("("),ct(),f(")");break;case"not":f(),f("("),":"===Wt.id&&"not"===u(0).value&&i("Nested not."),dt(),f(")");break;default:i("Expected a pseudo, and instead saw :{a}.",Wt,Wt.value)}break;case"#":f("#"),Wt.identifier||i("Expected an id, and instead saw #{a}.",Wt,Wt.value),f();break;case"*":f("*");break;case".":f("."),Wt.identifier||i("Expected a class, and instead saw #.{a}.",Wt,Wt.value),f();break;case"[":f("["),Wt.identifier||i("Expected an attribute, and instead saw [{a}].",Wt,Wt.value),f(),("="===Wt.id||"~="===Wt.value||"$="===Wt.value||"|="===Wt.value||"*="===Wt.id||"^="===Wt.id)&&(f(),"(string)"!==Wt.type&&i("Expected a string, and instead saw {a}.",Wt,Wt.value),f()),f("]");break;default:s("Expected a CSS selector, and instead saw {a}.",Wt,Wt.value)}}function ut(){var e;if("{"===Wt.id)i("Expected a style pattern, and instead saw '{a}'.",Wt,Wt.id);else if("@"===Wt.id){if(f("@"),e=Wt.value,Wt.identifier&&dn[e]===!0)return f(),e;i("Expected an at-rule, and instead saw @{a}.",Wt,e)}for(;;){if(dt(),"</"===Wt.id||"{"===Wt.id||"(end)"===Wt.id)return"";","===Wt.id&&w()}}function ft(){for(var e;"@"===Wt.id&&(e=u(),e.identifier&&"import"===e.value);)f("@"),f(),it()||(i("Expected '{a}' and instead saw '{b}'.",Wt,"url",Wt.value),f()),f(";");for(;"</"!==Wt.id&&"(end)"!==Wt.id;)ut(),cn="styleproperty",";"===Wt.id?f(";"):(f("{"),lt(),cn="style",f("}"))}function pt(e){"html"===e||Xt.fragment||("div"===e&&Xt.adsafe?s("ADSAFE: Use the fragment option."):s("Expected '{a}' and instead saw '{b}'.",rn,"html",e)),Xt.adsafe&&("html"===e&&s("Currently, ADsafe does not operate on whole HTML documents. It operates on <div> fragments and .js files.",rn),Xt.fragment?"div"!==e&&s("ADsafe violation: Wrap the widget in a div.",rn):s("Use the fragment option.",rn)),Xt.browser=!0,a()}function ht(e,t,n){var a,r;"id"===t?(a="string"==typeof n?n.toUpperCase():"",Ft[a]===!0&&i("Duplicate id='{a}'.",Wt,n),/^[A-Za-z][A-Za-z0-9._:\-]*$/.test(n)?Xt.adsafe&&(Ut?n.slice(0,Ut.length)!==Ut?i("ADsafe violation: An id must have a '{a}' prefix",Wt,Ut):/^[A-Z]+_[A-Z]+$/.test(n)||i("ADSAFE violation: bad id."):(Ut=n,/^[A-Z]+_$/.test(n)||i("ADSAFE violation: bad id."))):i("Bad id: '{a}'.",Wt,n),r=n.search(Jn),r>=0&&i("Unexpected character '{a}' in {b}.",rn,n.charAt(r),t),Ft[a]=!0):"class"===t||"type"===t||"name"===t?(r=n.search(zn),r>=0&&i("Unexpected character '{a}' in {b}.",rn,n.charAt(r),t),Ft[a]=!0):"href"===t||"background"===t||"content"===t||"data"===t||t.indexOf("src")>=0||t.indexOf("url")>=0?(Xt.safe&&Fn.test(n)&&s("ADsafe URL violation."),on.push(n)):"for"===t?Xt.adsafe&&(Ut?n.slice(0,Ut.length)!==Ut?i("ADsafe violation: An id must have a '{a}' prefix",Wt,Ut):/^[A-Z]+_[A-Z]+$/.test(n)||i("ADSAFE violation: bad id."):i("ADSAFE violation: bad id.")):"name"===t&&Xt.adsafe&&n.indexOf("_")>=0&&i("ADsafe name violation.")}function gt(e,t){var n,a,r=wn[e];if(en=!1,r||s("Unrecognized tag '<{a}>'.",Wt,e===e.toLowerCase()?e:e+" (capitalization error)"),tn.length>0)if("html"===e&&s("Too many <html> tags.",rn),a=r.parent)a.indexOf(" "+tn[tn.length-1].name+" ")<0&&s("A '<{a}>' must be within '<{b}>'.",rn,e,a);
else if(!Xt.adsafe&&!Xt.fragment){n=tn.length;do 0>=n&&s("A '<{a}>' must be within '<{b}>'.",rn,e,"body"),n-=1;while("body"!==tn[n].name)}switch(e){case"div":Xt.adsafe&&1===tn.length&&!Ut&&i("ADSAFE violation: missing ID_.");break;case"script":cn="script",f(">"),zt=Wt.from,t.lang&&i("lang is deprecated.",rn),Xt.adsafe&&1!==tn.length&&i("ADsafe script placement violation.",rn),t.src?(!Xt.adsafe||St&&Ot[t.src]||i("ADsafe unapproved script source.",rn),t.type&&i("type is unnecessary.",rn)):(jt&&s("ADsafe script violation.",rn),J("script")),cn="html",f("</"),Wt.identifier||"script"===Wt.value||i("Expected '{a}' and instead saw '{b}'.",Wt,"script",Wt.value),f(),cn="outer";break;case"style":cn="style",f(">"),ft(),cn="html",f("</"),Wt.identifier||"style"===Wt.value||i("Expected '{a}' and instead saw '{b}'.",Wt,"style",Wt.value),f(),cn="outer";break;case"input":switch(t.type){case"radio":case"checkbox":case"button":case"reset":case"submit":break;case"text":case"password":case"file":case"hidden":case"image":Xt.adsafe&&"off"!==t.autocomplete&&i("ADsafe autocomplete violation.");break;default:i("Bad input type.")}break;case"applet":case"body":case"embed":case"frame":case"frameset":case"head":case"iframe":case"noembed":case"noframes":case"object":case"param":Xt.adsafe&&i("ADsafe violation: Disallowed tag: "+e)}}function mt(e){return"</"+e+">"}function vt(){var e,n,a,r,o,c,l,d,u=Xt.white;for(cn="html",ln="",tn=null;;){switch(Wt.value){case"<":for(cn="html",f("<"),n={},c=Wt,c.identifier||i("Bad identifier {a}.",c,c.value),r=c.value,Xt.cap&&(r=r.toLowerCase()),c.name=r,f(),tn||(tn=[],pt(r)),l=wn[r],"object"!=typeof l&&s("Unrecognized tag '<{a}>'.",c,r),a=l.empty,c.type=r;;){if("/"===Wt.id){f("/"),">"!==Wt.id&&i("Expected '{a}' and instead saw '{b}'.",Wt,">",Wt.value);break}if(Wt.id&&">"===Wt.id.substr(0,1))break;Wt.identifier||(("(end)"===Wt.id||"(error)"===Wt.id)&&s("Missing '>'.",Wt),i("Bad identifier.")),Xt.white=!0,m(rn,Wt),e=Wt.value,Xt.white=u,f(),Xt.cap||e===e.toLowerCase()||i("Attribute '{a}' not all lower case.",Wt,e),e=e.toLowerCase(),ln="",t(n,e)&&i("Attribute '{a}' repeated.",Wt,e),"on"===e.slice(0,2)?(Xt.on||i("Avoid HTML event handlers."),cn="scriptstring",f("="),o=Wt.id,'"'!==o&&"'"!==o&&s("Missing quote."),ln=o,d=Xt.white,Xt.white=!1,f(o),J("on"),Xt.white=d,Wt.id!==o&&s("Missing close quote on script attribute."),cn="html",ln="",f(o),l=!1):"style"===e?(cn="scriptstring",f("="),o=Wt.id,'"'!==o&&"'"!==o&&s("Missing quote."),cn="styleproperty",ln=o,f(o),lt(),cn="html",ln="",f(o),l=!1):"="===Wt.id?(f("="),l=Wt.value,Wt.identifier||'"'===Wt.id||"'"===Wt.id||"(string)"===Wt.type||"(number)"===Wt.type||"(color)"===Wt.type||i("Expected an attribute value and instead saw '{a}'.",rn,e),f()):l=!0,n[e]=l,ht(r,e,l)}gt(r,n),a||tn.push(c),cn="outer",f(">");break;case"</":cn="html",f("</"),Wt.identifier||i("Bad identifier."),r=Wt.value,Xt.cap&&(r=r.toLowerCase()),f(),tn||s("Unexpected '{a}'.",Wt,mt(r)),c=tn.pop(),c||s("Unexpected '{a}'.",Wt,mt(r)),c.name!==r&&s("Expected '{a}' and instead saw '{b}'.",Wt,mt(c.name),mt(r)),">"!==Wt.id&&s("Missing '{a}'.",Wt,">"),cn="outer",f(">");break;case"<!":for(Xt.safe&&i("ADsafe HTML violation."),cn="html";f(),">"!==Wt.id&&"(end)"!==Wt.id;)Wt.value.indexOf("--")>=0&&i("Unexpected --."),Wt.value.indexOf("<")>=0&&i("Unexpected <."),Wt.value.indexOf(">")>=0&&i("Unexpected >.");cn="outer",f(">");break;case"(end)":return;default:"(end)"===Wt.id?s("Missing '{a}'.",Wt,"</"+tn[tn.length-1].value+">"):f()}if(tn&&0===tn.length&&(Xt.adsafe||!Xt.fragment||"(end)"===Wt.id))break}"(end)"!==Wt.id&&s("Unexpected material after the end.")}function bt(){var e=q(!0);return e||("(string)"===Wt.id?(e=Wt.value,f()):"(number)"===Wt.id&&(e=Wt.value.toString(),f())),e}function yt(){var e,t=Wt,n=[];if(f("("),g(),")"===Wt.id)return f(")"),void g(Kt,rn);for(;;){if(e=F(),n.push(e),l(e,"parameter"),","!==Wt.id)return f(")",t),g(Kt,rn),n;w()}}function wt(e){var t,n=Qt;return Qt=Object.create(n),It={"(name)":e||'"'+Dt+'"',"(line)":Wt.line,"(context)":It,"(breakage)":0,"(loopage)":0,"(scope)":Qt},t=It,rn.funct=It,Ct.push(It),e&&l(e,"function"),It["(params)"]=yt(),P(!1),Qt=n,It["(last)"]=rn.line,It=It["(context)"],t}function xt(e){var t,n,a;for(It["(onevar)"]&&Xt.onevar?i("Too many var statements."):It["(global)"]||(It["(onevar)"]=!0),this.first=[];(m(rn,Wt),t=F(),It["(global)"]&&Gt[t]===!1&&i("Redefinition of '{a}'.",rn,t),l(t,"unused"),!e)&&(n=rn,this.first.push(rn),"="===Wt.id&&(m(rn,Wt),f("="),m(rn,Wt),"undefined"===Wt.id&&i("It is not necessary to initialize '{a}' to 'undefined'.",rn,t),"="===u(0).id&&Wt.identifier&&s("Variable {a} was not declared correctly.",Wt,Wt.value),a=p(0),n.first=a),","===Wt.id);)w();return this}function kt(){function e(){var e={},t=Wt;if(f("{"),"}"!==Wt.id)for(;;){if("(end)"===Wt.id)s("Missing '}' to match '{' from line {a}.",Wt,t.line);else{if("}"===Wt.id){i("Unexpected comma.",rn);break}","===Wt.id?s("Unexpected comma.",Wt):"(string)"!==Wt.id&&i("Expected a string and instead saw {a}.",Wt,Wt.value)}if(e[Wt.value]===!0?i("Duplicate key '{a}'.",Wt,Wt.value):"__proto__"===Wt.value?i("Stupid key '{a}'.",Wt,Wt.value):e[Wt.value]=!0,f(),f(":"),kt(),","!==Wt.id)break;f(",")}f("}")}function t(){var e=Wt;if(f("["),"]"!==Wt.id)for(;;){if("(end)"===Wt.id)s("Missing ']' to match '[' from line {a}.",Wt,e.line);else{if("]"===Wt.id){i("Unexpected comma.",rn);break}","===Wt.id&&s("Unexpected comma.",Wt)}if(kt(),","!==Wt.id)break;f(",")}f("]")}switch(Wt.id){case"{":e();break;case"[":t();break;case"true":case"false":case"null":case"(number)":case"(string)":f();break;case"-":f("-"),rn.character!==Wt.from&&i("Unexpected space after '-'.",rn),h(rn,Wt),f("(number)");break;default:s("Expected a JSON value.",Wt)}}function At(e){return"[object Array]"===Object.prototype.toString.apply(e)}function Et(e){var n,a=[];for(n in e)t(e,n)&&a.push(n);return a}var Ut,St,jt,Dt,Ot,Lt,Mt,Tt,_t,Nt,It,Ct,qt,Ft,Bt,$t,zt,Jt,Pt,Rt,Zt,Ht,Wt,Vt,Xt,Gt,Yt,Kt,Qt,en,tn,nn,an,rn,on,sn,cn,ln,dn={media:!0,"font-face":!0,page:!0},un={"<":!0,"<=":!0,"==":!0,"===":!0,"!==":!0,"!=":!0,">":!0,">=":!0,"+":!0,"-":!0,"*":!0,"/":!0,"%":!0},fn={arguments:!0,callee:!0,caller:!0,constructor:!0,eval:!0,prototype:!0,stack:!0,unwatch:!0,valueOf:!0,watch:!0},pn={adsafe:!0,bitwise:!0,browser:!0,cap:!0,css:!0,debug:!0,devel:!0,eqeqeq:!0,es5:!0,evil:!0,forin:!0,fragment:!0,immed:!0,laxbreak:!0,newcap:!0,node:!0,nomen:!0,on:!0,onevar:!0,passfail:!0,plusplus:!0,regexp:!0,rhino:!0,undef:!0,safe:!0,windows:!0,strict:!0,sub:!0,white:!0,widget:!0},hn={addEventListener:!1,blur:!1,clearInterval:!1,clearTimeout:!1,close:!1,closed:!1,defaultStatus:!1,document:!1,event:!1,focus:!1,frames:!1,getComputedStyle:!1,history:!1,Image:!1,length:!1,location:!1,moveBy:!1,moveTo:!1,name:!1,navigator:!1,onbeforeunload:!0,onblur:!0,onerror:!0,onfocus:!0,onload:!0,onresize:!0,onunload:!0,open:!1,opener:!1,Option:!1,parent:!1,print:!1,removeEventListener:!1,resizeBy:!1,resizeTo:!1,screen:!1,scroll:!1,scrollBy:!1,scrollTo:!1,setInterval:!1,setTimeout:!1,status:!1,top:!1,window:!1,XMLHttpRequest:!1},gn={aliceblue:!0,antiquewhite:!0,aqua:!0,aquamarine:!0,azure:!0,beige:!0,bisque:!0,black:!0,blanchedalmond:!0,blue:!0,blueviolet:!0,brown:!0,burlywood:!0,cadetblue:!0,chartreuse:!0,chocolate:!0,coral:!0,cornflowerblue:!0,cornsilk:!0,crimson:!0,cyan:!0,darkblue:!0,darkcyan:!0,darkgoldenrod:!0,darkgray:!0,darkgreen:!0,darkkhaki:!0,darkmagenta:!0,darkolivegreen:!0,darkorange:!0,darkorchid:!0,darkred:!0,darksalmon:!0,darkseagreen:!0,darkslateblue:!0,darkslategray:!0,darkturquoise:!0,darkviolet:!0,deeppink:!0,deepskyblue:!0,dimgray:!0,dodgerblue:!0,firebrick:!0,floralwhite:!0,forestgreen:!0,fuchsia:!0,gainsboro:!0,ghostwhite:!0,gold:!0,goldenrod:!0,gray:!0,green:!0,greenyellow:!0,honeydew:!0,hotpink:!0,indianred:!0,indigo:!0,ivory:!0,khaki:!0,lavender:!0,lavenderblush:!0,lawngreen:!0,lemonchiffon:!0,lightblue:!0,lightcoral:!0,lightcyan:!0,lightgoldenrodyellow:!0,lightgreen:!0,lightpink:!0,lightsalmon:!0,lightseagreen:!0,lightskyblue:!0,lightslategray:!0,lightsteelblue:!0,lightyellow:!0,lime:!0,limegreen:!0,linen:!0,magenta:!0,maroon:!0,mediumaquamarine:!0,mediumblue:!0,mediumorchid:!0,mediumpurple:!0,mediumseagreen:!0,mediumslateblue:!0,mediumspringgreen:!0,mediumturquoise:!0,mediumvioletred:!0,midnightblue:!0,mintcream:!0,mistyrose:!0,moccasin:!0,navajowhite:!0,navy:!0,oldlace:!0,olive:!0,olivedrab:!0,orange:!0,orangered:!0,orchid:!0,palegoldenrod:!0,palegreen:!0,paleturquoise:!0,palevioletred:!0,papayawhip:!0,peachpuff:!0,peru:!0,pink:!0,plum:!0,powderblue:!0,purple:!0,red:!0,rosybrown:!0,royalblue:!0,saddlebrown:!0,salmon:!0,sandybrown:!0,seagreen:!0,seashell:!0,sienna:!0,silver:!0,skyblue:!0,slateblue:!0,slategray:!0,snow:!0,springgreen:!0,steelblue:!0,tan:!0,teal:!0,thistle:!0,tomato:!0,turquoise:!0,violet:!0,wheat:!0,white:!0,whitesmoke:!0,yellow:!0,yellowgreen:!0},mn={"%":!0,cm:!0,em:!0,ex:!0,"in":!0,mm:!0,pc:!0,pt:!0,px:!0},vn={alert:!1,confirm:!1,console:!1,Debug:!1,opera:!1,prompt:!1},bn={"\b":"\\b","	":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"/":"\\/","\\":"\\\\"},yn=["closure","exception","global","label","outer","unused","var"],wn={a:{},abbr:{},acronym:{},address:{},applet:{},area:{empty:!0,parent:" map "},article:{},aside:{},audio:{},b:{},base:{empty:!0,parent:" head "},bdo:{},big:{},blockquote:{},body:{parent:" html noframes "},br:{empty:!0},button:{},canvas:{parent:" body p div th td "},caption:{parent:" table "},center:{},cite:{},code:{},col:{empty:!0,parent:" table colgroup "},colgroup:{parent:" table "},command:{parent:" menu "},datalist:{},dd:{parent:" dl "},del:{},details:{},dialog:{},dfn:{},dir:{},div:{},dl:{},dt:{parent:" dl "},em:{},embed:{},fieldset:{},figure:{},font:{},footer:{},form:{},frame:{empty:!0,parent:" frameset "},frameset:{parent:" html frameset "},h1:{},h2:{},h3:{},h4:{},h5:{},h6:{},head:{parent:" html "},header:{},hgroup:{},html:{parent:"*"},hr:{empty:!0},i:{},iframe:{},img:{empty:!0},input:{empty:!0},ins:{},kbd:{},keygen:{},label:{},legend:{parent:" details fieldset figure "},li:{parent:" dir menu ol ul "},link:{empty:!0,parent:" head "},map:{},mark:{},menu:{},meta:{empty:!0,parent:" head noframes noscript "},meter:{},nav:{},noframes:{parent:" html body "},noscript:{parent:" body head noframes "},object:{},ol:{},optgroup:{parent:" select "},option:{parent:" optgroup select "},output:{},p:{},param:{empty:!0,parent:" applet object "},pre:{},progress:{},q:{},rp:{},rt:{},ruby:{},samp:{},script:{empty:!0,parent:" body div frame head iframe p pre span "},section:{},select:{},small:{},span:{},source:{},strong:{},style:{parent:" head ",empty:!0},sub:{},sup:{},table:{},tbody:{parent:" table "},td:{parent:" tr "},textarea:{},tfoot:{parent:" table "},th:{parent:" tr "},thead:{parent:" table "},time:{},title:{parent:" head "},tr:{parent:" table tbody thead tfoot "},tt:{},u:{},ul:{},"var":{},video:{}},xn={Buffer:!1,clearInterval:!1,clearTimeout:!1,console:!1,exports:!1,global:!1,module:!1,process:!1,require:!1,setInterval:!1,setTimeout:!1,__filename:!1,__dirname:!1},kn={defineClass:!1,deserialize:!1,gc:!1,help:!1,load:!1,loadClass:!1,print:!1,quit:!1,readFile:!1,readUrl:!1,runCommand:!1,seal:!1,serialize:!1,spawn:!1,sync:!1,toint32:!1,version:!1},An={ActiveXObject:!1,CScript:!1,Debug:!1,Enumerator:!1,System:!1,VBArray:!1,WScript:!1},En={Array:!1,Boolean:!1,Date:!1,decodeURI:!1,decodeURIComponent:!1,encodeURI:!1,encodeURIComponent:!1,Error:!1,eval:!1,EvalError:!1,Function:!1,hasOwnProperty:!1,isFinite:!1,isNaN:!1,JSON:!1,Math:!1,Number:!1,Object:!1,parseInt:!1,parseFloat:!1,RangeError:!1,ReferenceError:!1,RegExp:!1,String:!1,SyntaxError:!1,TypeError:!1,URIError:!1},Un={E:!0,LN2:!0,LN10:!0,LOG2E:!0,LOG10E:!0,PI:!0,SQRT1_2:!0,SQRT2:!0,MAX_VALUE:!0,MIN_VALUE:!0,NEGATIVE_INFINITY:!0,POSITIVE_INFINITY:!0},Sn={},jn={alert:!0,animator:!0,appleScript:!0,beep:!0,bytesToUIString:!0,Canvas:!0,chooseColor:!0,chooseFile:!0,chooseFolder:!0,closeWidget:!0,COM:!0,convertPathToHFS:!0,convertPathToPlatform:!0,CustomAnimation:!0,escape:!0,FadeAnimation:!0,filesystem:!0,Flash:!0,focusWidget:!0,form:!0,FormField:!0,Frame:!0,HotKey:!0,Image:!0,include:!0,isApplicationRunning:!0,iTunes:!0,konfabulatorVersion:!0,log:!0,md5:!0,MenuItem:!0,MoveAnimation:!0,openURL:!0,play:!0,Point:!0,popupMenu:!0,preferenceGroups:!0,preferences:!0,print:!0,prompt:!0,random:!0,Rectangle:!0,reloadWidget:!0,ResizeAnimation:!0,resolvePath:!0,resumeUpdates:!0,RotateAnimation:!0,runCommand:!0,runCommandInBg:!0,saveAs:!0,savePreferences:!0,screen:!0,ScrollBar:!0,showWidgetPreferences:!0,sleep:!0,speak:!0,Style:!0,suppressUpdates:!0,system:!0,tellWidget:!0,Text:!0,TextArea:!0,Timer:!0,unescape:!0,updateNow:!0,URL:!0,Web:!0,widget:!0,Window:!0,XMLDOM:!0,XMLHttpRequest:!0,yahooCheckLogin:!0,yahooLogin:!0,yahooLogout:!0},Dn=/@cc|<\/?|script|\]*s\]|<\s*!|&lt/i,On=/[\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/,Ln=/^\s*([(){}\[.,:;'"~\?\]#@]|==?=?|\/(\*(jslint|members?|global)?|=|\/)?|\*[\/=]?|\+[+=]?|-[\-=]?|%=?|&[&=]?|\|[|=]?|>>?>?=?|<([\/=!]|\!(\[|--)?|<=?)?|\^=?|\!=?=?|[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+([xX][0-9a-fA-F]+|\.[0-9]*)?([eE][+\-]?[0-9]+)?)/,Mn=/^\s*(['"=>\/&#]|<(?:\/|\!(?:--)?)?|[a-zA-Z][a-zA-Z0-9_\-]*|[0-9]+|--)/,Tn=/[\u0000-\u001f&<"\/\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/,_n=/[\u0000-\u001f&<"\/\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,Nn=/[>&]|<[\/!]?|--/,In=/\*\/|\/\*/,Cn=/^([a-zA-Z_$][a-zA-Z0-9_$]*)$/,qn=/^(?:javascript|jscript|ecmascript|vbscript|mocha|livescript)\s*:/i,Fn=/&|\+|\u00AD|\.\.|\/\*|%[^;]|base64|url|expression|data|mailto/i,Bn=/^\s*([{:#%.=,>+\[\]@()"';]|\*=?|\$=|\|=|\^=|~=|[a-zA-Z_][a-zA-Z0-9_\-]*|[0-9]+|<\/|\/\*)/,$n=/^\s*([@#!"'};:\-%.=,+\[\]()*_]|[a-zA-Z][a-zA-Z0-9._\-]*|\/\*?|\d+(?:\.\d+)?|<\/)/,zn=/[^a-zA-Z0-9+\-_\/ ]/,Jn=/[\[\]\/\\"'*<>.&:(){}+=#]/,Pn={outer:Mn,html:Mn,style:Bn,styleproperty:$n};"function"!=typeof Object.create&&(Object.create=function(t){return e.prototype=t,new e}),String.prototype.entityify=function(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},String.prototype.isAlpha=function(){return this>="a"&&"z">=this||this>="A"&&"Z">=this},String.prototype.isDigit=function(){return this>="0"&&"9">=this},String.prototype.supplant=function(e){return this.replace(/\{([^{}]*)\}/g,function(t,n){var a=e[n];return"string"==typeof a||"number"==typeof a?a:t})},String.prototype.name=function(){return Cn.test(this)?this:Tn.test(this)?'"'+this.replace(_n,function(e){var t=bn[e];return t?t:"\\u"+("0000"+e.charCodeAt().toString(16)).slice(-4)})+'"':'"'+this+'"'};var Rn=function(){function e(){var e;return i>=Pt.length?!1:(a=1,s=Pt[i],i+=1,e=s.search(/ \t/),e>=0&&o("Mixed spaces and tabs.",i,e+1),s=s.replace(/\t/g,an),e=s.search(On),e>=0&&o("Unsafe character.",i,e),Xt.maxlen&&Xt.maxlen<s.length&&o("Line too long.",i,s.length),!0)}function n(e,n){var s,l;return l="(color)"===e?{type:e}:"(punctuator)"===e||"(identifier)"===e&&t(Sn,n)?Sn[n]||Sn["(error)"]:Sn[e],l=Object.create(l),("(string)"===e||"(range)"===e)&&qn.test(n)&&o("Script URL.",i,r),"(identifier)"===e&&(l.identifier=!0,"__iterator__"===n||"__proto__"===n?c("Reserved name '{a}'.",i,r,n):!Xt.nomen||"_"!==n.charAt(0)&&"_"!==n.charAt(n.length-1)||o("Unexpected {a} in '{b}'.",i,r,"dangling '_'",n)),l.value=n,l.line=i,l.character=a,l.from=r,s=l.id,"(endline)"!==s&&(Yt=s&&("(,=:[!&|?{};".indexOf(s.charAt(s.length-1))>=0||"return"===s)),l}var a,r,i,s;return{init:function(t){Pt="string"==typeof t?t.replace(/\r\n/g,"\n").replace(/\r/g,"\n").split("\n"):t,i=0,e(),r=1},range:function(e,t){var l,d="";for(r=a,s.charAt(0)!==e&&c("Expected '{a}' and instead saw '{b}'.",i,a,e,s.charAt(0));;){switch(s=s.slice(1),a+=1,l=s.charAt(0)){case"":c("Missing '{a}'.",i,a,l);break;case t:return s=s.slice(1),a+=1,n("(range)",d);case ln:case"\\":o("Unexpected '{a}'.",i,a,l)}d+=l}},token:function(){function t(e){var t,n=e.exec(s);return n?(b=n[0].length,t=n[1],u=t.charAt(0),s=s.substr(b),r=a+b-t.length,a+=b,t):void 0}function l(t){function l(e){var t=parseInt(s.substr(u+1,e),16);u+=e,t>=32&&126>=t&&34!==t&&92!==t&&39!==t&&o("Unnecessary escapement.",i,a),a+=e,d=String.fromCharCode(t)}var d,u,f="";if(Jt&&'"'!==t&&o("Strings must use doublequote.",i,a),ln===t||"scriptstring"===cn&&!ln)return n("(punctuator)",t);for(u=0;;){for(;u>=s.length;)u=0,"html"===cn&&e()||c("Unclosed string.",i,r);if(d=s.charAt(u),d===t)return a+=1,s=s.substr(u+1),n("(string)",f,t);if(" ">d){if("\n"===d||"\r"===d)break;o("Control character in string: {a}.",i,a+u,s.slice(0,u))}else if(d===ln)o("Bad HTML string",i,a+u);else if("<"===d)Xt.safe&&"html"===cn?o("ADsafe string violation.",i,a+u):"/"===s.charAt(u+1)&&(cn||Xt.safe)?o("Expected '<\\/' and instead saw '</'.",i,a):"!"===s.charAt(u+1)&&(cn||Xt.safe)&&o("Unexpected '<!' in a string.",i,a);else if("\\"===d)if("html"===cn)Xt.safe&&o("ADsafe string violation.",i,a+u);else if("styleproperty"===cn)u+=1,a+=1,d=s.charAt(u),d!==t&&o("Escapement in style string.",i,a+u);else switch(u+=1,a+=1,d=s.charAt(u)){case ln:o("Bad HTML string",i,a+u);break;case"\\":case"'":case'"':case"/":break;case"b":d="\b";break;case"f":d="\f";break;case"n":d="\n";break;case"r":d="\r";break;case"t":d="	";break;case"u":l(4);break;case"v":d="";break;case"x":Jt&&o("Avoid \\x-.",i,a),l(2);break;default:o("Bad escapement.",i,a)}f+=d,a+=1,u+=1}}for(var d,u,f,p,h,g,m,v,b,y,w,x;;){if(!s)return n(e()?"(endline)":"(end)","");for(;"outer"===cn&&(v=s.search(Nn),0!==v);){if(v>0){a+=1,s=s.slice(v);break}if(!e())return n("(end)","")}if(x=t(Pn[cn]||Ln)){if(u.isAlpha()||"_"===u||"$"===u)return n("(identifier)",x);if(u.isDigit())return"style"===cn||isFinite(Number(x))||o("Bad number '{a}'.",i,a,x),"style"!==cn&&"styleproperty"!==cn&&s.substr(0,1).isAlpha()&&o("Missing space after '{a}'.",i,a,x),"0"===u&&(h=x.substr(1,1),h.isDigit()?"."!==rn.id&&"styleproperty"!==cn&&o("Don't use extra leading zeros '{a}'.",i,a,x):!Jt||"x"!==h&&"X"!==h||o("Avoid 0x-. '{a}'.",i,a,x)),"."===x.substr(x.length-1)&&o("A trailing decimal point can be confused with a dot '{a}'.",i,a,x),n("(number)",x);switch(x){case'"':case"'":return l(x);case"//":en||cn&&"script"!==cn?o("Unexpected comment.",i,a):"script"===cn&&/<\s*\//i.test(s)?o("Unexpected </ in comment.",i,a):(Xt.safe||"script"===cn)&&Dn.test(s)&&o("Dangerous comment.",i,a),s="",rn.comment=!0;break;case"/*":for((en||cn&&"script"!==cn&&"style"!==cn&&"styleproperty"!==cn)&&o("Unexpected comment.",i,a),Xt.safe&&Dn.test(s)&&o("ADsafe comment violation.",i,a);v=s.search(In),!(v>=0);)e()?Xt.safe&&Dn.test(s)&&o("ADsafe comment violation.",i,a):c("Unclosed comment.",i,a);a+=v+2,"/"===s.substr(v,1)&&c("Nested comment.",i,a),s=s.substr(v+2),rn.comment=!0;break;case"/*members":case"/*member":case"/*jslint":case"/*global":case"*/":return{value:x,type:"special",line:i,character:a,from:r};case"":break;case"/":if("/="===rn.id&&c("A regular expression literal can be confused with '/='.",i,r),Yt){for(g=0,p=0,b=0;;){switch(d=!0,u=s.charAt(b),b+=1,u){case"":return void c("Unclosed regular expression.",i,r);case"/":for(g>0&&o("Unescaped '{a}'.",i,r+b,"/"),u=s.substr(0,b-1),w={g:!0,i:!0,m:!0};w[s.charAt(b)]===!0;)w[s.charAt(b)]=!1,b+=1;return a+=b,s=s.substr(b),w=s.charAt(0),("/"===w||"*"===w)&&c("Confusing regular expression.",i,r),n("(regexp)",u);case"\\":u=s.charAt(b)," ">u?o("Unexpected control character in regular expression.",i,r+b):"<"===u&&o("Unexpected escaped character '{a}' in regular expression.",i,r+b,u),b+=1;break;case"(":if(g+=1,d=!1,"?"===s.charAt(b))switch(b+=1,s.charAt(b)){case":":case"=":case"!":b+=1;break;default:o("Expected '{a}' and instead saw '{b}'.",i,r+b,":",s.charAt(b))}else p+=1;break;case"|":d=!1;break;case")":0===g?o("Unescaped '{a}'.",i,r+b,")"):g-=1;break;case" ":for(w=1;" "===s.charAt(b);)b+=1,w+=1;w>1&&o("Spaces are hard to count. Use {{a}}.",i,r+b,w);break;case"[":u=s.charAt(b),"^"===u&&(b+=1,Xt.regexp&&o("Insecure '{a}'.",i,r+b,u)),w=!1,"]"===u&&(o("Empty class.",i,r+b-1),w=!0);e:do switch(u=s.charAt(b),b+=1,u){case"[":case"^":o("Unescaped '{a}'.",i,r+b,u),w=!0;break;case"-":w?w=!1:(o("Unescaped '{a}'.",i,r+b,"-"),w=!0);break;case"]":w||o("Unescaped '{a}'.",i,r+b-1,"-");break e;case"\\":u=s.charAt(b)," ">u?o("Unexpected control character in regular expression.",i,r+b):"<"===u&&o("Unexpected escaped character '{a}' in regular expression.",i,r+b,u),b+=1,w=!0;break;case"/":o("Unescaped '{a}'.",i,r+b-1,"/"),w=!0;break;case"<":"script"===cn&&(u=s.charAt(b),("!"===u||"/"===u)&&o("HTML confusion in regular expression '<{a}'.",i,r+b,u)),w=!0;break;default:w=!0}while(u);break;case".":Xt.regexp&&o("Insecure '{a}'.",i,r+b,u);break;case"]":case"?":case"{":case"}":case"+":case"*":o("Unescaped '{a}'.",i,r+b,u);break;case"<":"script"===cn&&(u=s.charAt(b),("!"===u||"/"===u)&&o("HTML confusion in regular expression '<{a}'.",i,r+b,u))}if(d)switch(s.charAt(b)){case"?":case"+":case"*":b+=1,"?"===s.charAt(b)&&(b+=1);break;case"{":for(b+=1,u=s.charAt(b),("0">u||u>"9")&&o("Expected a number and instead saw '{a}'.",i,r+b,u),b+=1,y=+u;u=s.charAt(b),!("0">u||u>"9");)b+=1,y=+u+10*y;if(m=y,","===u&&(b+=1,m=1/0,u=s.charAt(b),u>="0"&&"9">=u))for(b+=1,m=+u;u=s.charAt(b),!("0">u||u>"9");)b+=1,m=+u+10*m;"}"!==s.charAt(b)?o("Expected '{a}' and instead saw '{b}'.",i,r+b,"}",u):b+=1,"?"===s.charAt(b)&&(b+=1),y>m&&o("'{a}' should not be greater than '{b}'.",i,r+b,y,m)}}return u=s.substr(0,b-1),a+=b,s=s.substr(b),n("(regexp)",u)}return n("(punctuator)",x);case"<!--":for(b=i,u=a;v=s.indexOf("--"),!(v>=0);)v=s.indexOf("<!"),v>=0&&c("Nested HTML comment.",i,a+v),e()||c("Unclosed HTML comment.",b,u);b=s.indexOf("<!"),b>=0&&v>b&&c("Nested HTML comment.",i,a+b),a+=v,">"!==s[v+2]&&c("Expected -->.",i,a),a+=3,s=s.slice(v+3);break;case"#":if("html"===cn||"styleproperty"===cn){for(;u=s.charAt(0),!(("0">u||u>"9")&&("a">u||u>"f")&&("A">u||u>"F"));)a+=1,s=s.substr(1),x+=u;return 4!==x.length&&7!==x.length&&o("Bad hex color '{a}'.",i,r+b,x),n("(color)",x)}return n("(punctuator)",x);default:if("outer"===cn&&"&"===u){for(a+=1,s=s.substr(1);u=s.charAt(0),a+=1,s=s.substr(1),";"!==u;)u>="0"&&"9">=u||u>="a"&&"z">=u||"#"===u||c("Bad entity",i,r+b,a);break}return n("(punctuator)",x)}}else{for(x="",u="";s&&"!">s;)s=s.substr(1);if(s){if("html"===cn)return f=s.charAt(0),s=s.substr(1),n("(error)",f);c("Unexpected '{a}'.",i,a,s.substr(0,1))}}}}}}();Mt=[it,function(){for(;;)if(Wt.identifier)switch(Wt.value.toLowerCase()){case"url":it();break;case"expression":i("Unexpected expression '{a}'.",Wt,Wt.value),f();break;default:f()}else{if(";"===Wt.id||"!"===Wt.id||"(end)"===Wt.id||"}"===Wt.id)return!0;f()}}],Tt=["none","hidden","dotted","dashed","solid","double","ridge","inset","outset"],_t=["auto","always","avoid","left","right"],Nt=["auto","hidden","scroll","visible"],Lt={background:[!0,"background-attachment","background-color","background-image","background-position","background-repeat"],"background-attachment":["scroll","fixed"],"background-color":["transparent",G],"background-image":["none",it],"background-position":[2,[Y,"top","bottom","left","right","center"]],"background-repeat":["repeat","repeat-x","repeat-y","no-repeat"],border:[!0,"border-color","border-style","border-width"],"border-bottom":[!0,"border-bottom-color","border-bottom-style","border-bottom-width"],"border-bottom-color":G,"border-bottom-style":Tt,"border-bottom-width":Q,"border-collapse":["collapse","separate"],"border-color":["transparent",4,G],"border-left":[!0,"border-left-color","border-left-style","border-left-width"],"border-left-color":G,"border-left-style":Tt,"border-left-width":Q,"border-right":[!0,"border-right-color","border-right-style","border-right-width"],"border-right-color":G,"border-right-style":Tt,"border-right-width":Q,"border-spacing":[2,Y],"border-style":[4,Tt],"border-top":[!0,"border-top-color","border-top-style","border-top-width"],"border-top-color":G,"border-top-style":Tt,"border-top-width":Q,"border-width":[4,Q],bottom:[Y,"auto"],"caption-side":["bottom","left","right","top"],clear:["both","left","none","right"],clip:[rt,"auto"],color:G,content:["open-quote","close-quote","no-open-quote","no-close-quote",X,it,at,tt],"counter-increment":[W,"none"],"counter-reset":[W,"none"],cursor:[it,"auto","crosshair","default","e-resize","help","move","n-resize","ne-resize","nw-resize","pointer","s-resize","se-resize","sw-resize","w-resize","text","wait"],direction:["ltr","rtl"],display:["block","compact","inline","inline-block","inline-table","list-item","marker","none","run-in","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group"],"empty-cells":["show","hide"],"float":["left","none","right"],font:["caption","icon","menu","message-box","small-caption","status-bar",!0,"font-size","font-style","font-weight","font-family"],"font-family":nt,"font-size":["xx-small","x-small","small","medium","large","x-large","xx-large","larger","smaller",Y],"font-size-adjust":["none",V],"font-stretch":["normal","wider","narrower","ultra-condensed","extra-condensed","condensed","semi-condensed","semi-expanded","expanded","extra-expanded"],"font-style":["normal","italic","oblique"],"font-variant":["normal","small-caps"],"font-weight":["normal","bold","bolder","lighter",V],height:[Y,"auto"],left:[Y,"auto"],"letter-spacing":["normal",Y],"line-height":["normal",K],"list-style":[!0,"list-style-image","list-style-position","list-style-type"],"list-style-image":["none",it],"list-style-position":["inside","outside"],"list-style-type":["circle","disc","square","decimal","decimal-leading-zero","lower-roman","upper-roman","lower-greek","lower-alpha","lower-latin","upper-alpha","upper-latin","hebrew","katakana","hiragana-iroha","katakana-oroha","none"],margin:[4,et],"margin-bottom":et,"margin-left":et,"margin-right":et,"margin-top":et,"marker-offset":[Y,"auto"],"max-height":[Y,"none"],"max-width":[Y,"none"],"min-height":Y,"min-width":Y,opacity:V,outline:[!0,"outline-color","outline-style","outline-width"],"outline-color":["invert",G],"outline-style":["dashed","dotted","double","groove","inset","none","outset","ridge","solid"],"outline-width":Q,overflow:Nt,"overflow-x":Nt,"overflow-y":Nt,padding:[4,Y],"padding-bottom":Y,"padding-left":Y,"padding-right":Y,"padding-top":Y,"page-break-after":_t,"page-break-before":_t,position:["absolute","fixed","relative","static"],quotes:[8,X],right:[Y,"auto"],"table-layout":["auto","fixed"],"text-align":["center","justify","left","right"],"text-decoration":["none","underline","overline","line-through","blink"],"text-indent":Y,"text-shadow":["none",4,[G,Y]],"text-transform":["capitalize","uppercase","lowercase","none"],top:[Y,"auto"],"unicode-bidi":["normal","embed","bidi-override"],"vertical-align":["baseline","bottom","sub","super","top","text-top","middle","text-bottom",Y],visibility:["visible","hidden","collapse"],"white-space":["normal","nowrap","pre","pre-line","pre-wrap","inherit"],width:[Y,"auto"],"word-spacing":["normal",Y],"word-wrap":["break-word","normal"],"z-index":["auto",V]},j("(number)",R),j("(string)",R),Sn["(identifier)"]={type:"(identifier)",lbp:0,identifier:!0,nud:function(){var e,t=this.value,n=Qt[t];if("function"==typeof n?n=void 0:"boolean"==typeof n&&(e=It,It=Ct[0],l(t,"var"),n=It,It=e),It===n)switch(It[t]){case"unused":It[t]="var";break;case"label":i("'{a}' is a statement label.",rn,t)}else if(It["(global)"])Xt.undef&&"boolean"!==Gt[t]&&i("'{a}' is not defined.",rn,t),H(rn);else switch(It[t]){case"closure":case"function":case"var":case"unused":i("'{a}' used out of scope.",rn,t);break;case"label":i("'{a}' is a statement label.",rn,t);break;case"outer":case"global":break;default:if(n===!0)It[t]=!0;else if(null===n)i("'{a}' is not allowed.",rn,t),H(rn);else if("object"!=typeof n)Xt.undef?i("'{a}' is not defined.",rn,t):It[t]=!0,H(rn);else switch(n[t]){case"function":case"var":case"unused":n[t]="closure",It[t]=n["(global)"]?"global":"outer";break;case"closure":case"parameter":It[t]=n["(global)"]?"global":"outer";break;case"label":i("'{a}' is a statement label.",rn,t)}}return this},led:function(){s("Expected an operator and instead saw '{a}'.",Wt,Wt.value)}},j("(regexp)",function(){return this}),k("(endline)"),k("(begin)"),k("(end)").reach=!0,k("</").reach=!0,k("<!"),k("<!--"),k("-->"),k("(error)").reach=!0,k("}").reach=!0,k(")"),k("]"),k('"').reach=!0,k("'").reach=!0,k(";"),k(":").reach=!0,k(","),k("#"),k("@"),D("else"),D("case").reach=!0,D("catch"),D("default").reach=!0,D("finally"),O("arguments"),O("eval"),O("false"),O("Infinity"),O("NaN"),O("null"),O("this"),O("true"),O("undefined"),_("=","assign",20),_("+=","assignadd",20),_("-=","assignsub",20),_("*=","assignmult",20),_("/=","assigndiv",20).nud=function(){s("A regular expression literal can be confused with '/='.")},_("%=","assignmod",20),I("&=","assignbitand",20),I("|=","assignbitor",20),I("^=","assignbitxor",20),I("<<=","assignshiftleft",20),I(">>=","assignshiftright",20),I(">>>=","assignshiftrightunsigned",20),L("?",function(e,t){return t.left=e,t.right=p(10),f(":"),t["else"]=p(10),t},30),L("||","or",40),L("&&","and",50),N("|","bitor",70),N("^","bitxor",80),N("&","bitand",90),M("==",function(e,t){return Xt.eqeqeq?i("Expected '{a}' and instead saw '{b}'.",this,"===","=="):T(e)?i("Use '{a}' to compare with '{b}'.",this,"===",e.value):T(t)&&i("Use '{a}' to compare with '{b}'.",this,"===",t.value),this}),M("==="),M("!=",function(e,t){return Xt.eqeqeq?i("Expected '{a}' and instead saw '{b}'.",this,"!==","!="):T(e)?i("Use '{a}' to compare with '{b}'.",this,"!==",e.value):T(t)&&i("Use '{a}' to compare with '{b}'.",this,"!==",t.value),this}),M("!=="),M("<"),M(">"),M("<="),M(">="),N("<<","shiftleft",120),N(">>","shiftright",120),N(">>>","shiftrightunsigned",120),L("in","in",120),L("instanceof","instanceof",120),L("+",function(e,t){var n=p(130);return e&&n&&"(string)"===e.id&&"(string)"===n.id?(e.value+=n.value,e.character=n.character,qn.test(e.value)&&i("JavaScript URL.",e),e):(t.left=e,t.right=n,t)},130),S("+","num"),L("-","sub",130),S("-","neg"),L("*","mult",140),L("/","div",140),L("%","mod",140),C("++","postinc"),S("++","preinc"),Sn["++"].exps=!0,C("--","postdec"),S("--","predec"),Sn["--"].exps=!0,S("delete",function(){var e=p(0);return(!e||"."!==e.id&&"["!==e.id)&&i("Expected '{a}' and instead saw '{b}'.",Wt,".",Wt.value),this.first=e,this}).exps=!0,S("~",function(){return Xt.bitwise&&i("Unexpected '{a}'.",this,"~"),p(150),this}),S("!",function(){return this.right=p(150),this.arity="unary",un[this.right.id]===!0&&i("Confusing use of '{a}'.",this,"!"),this}),S("typeof","typeof"),S("new",function(){var e,t=p(155);if(t&&"function"!==t.id)if(t.identifier)switch(t["new"]=!0,t.value){case"Object":i("Use the object literal notation {}.",rn);break;case"Array":return"("!==Wt.id?i("Use the array literal notation [].",rn):(f("("),")"===Wt.id?i("Use the array literal notation [].",rn):(e=p(0),t.dimension=e,("(number)"===e.id&&/[.+\-Ee]/.test(e.value)||"-"===e.id&&!e.right||"(string)"===e.id||"["===e.id||"{"===e.id||"true"===e.id||"false"===e.id||"null"===e.id||"undefined"===e.id||"Infinity"===e.id)&&i("Use the array literal notation [].",rn),")"!==Wt.id&&s("Use the array literal notation [].",rn)),f(")")),this.first=t,this;case"Number":case"String":case"Boolean":case"Math":case"JSON":i("Do not use {a} as a constructor.",rn,t.value);break;case"Function":Xt.evil||i("The Function constructor is eval.");break;case"Date":case"RegExp":break;default:"function"!==t.id&&(e=t.value.substr(0,1),Xt.newcap&&("A">e||e>"Z")&&i("A constructor name should start with an uppercase letter.",rn))}else"."!==t.id&&"["!==t.id&&"("!==t.id&&i("Bad constructor.",rn);else i("Weird construction. Delete 'new'.",this);return h(rn,Wt),"("!==Wt.id&&i("Missing '()' invoking a constructor."),this.first=t,this}),Sn["new"].exps=!0,L(".",function(e,t){h(Kt,rn);var n=F();if("string"==typeof n&&Z(n),t.left=e,t.right=n,Xt.evil||!e||"document"!==e.value||"write"!==n&&"writeln"!==n?Xt.adsafe&&e&&"ADSAFE"===e.value&&("id"===n||"lib"===n?i("ADsafe violation.",t):"go"===n&&("script"!==cn?i("ADsafe violation.",t):(jt||"("!==Wt.id||"(string)"!==u(0).id||u(0).value!==Ut||","!==u(1).id)&&s("ADsafe violation: go.",t),jt=!0,St=!1)):i("document.write can be a form of eval.",e),Xt.evil||"eval"!==n&&"execScript"!==n){if(Xt.safe)for(;fn[n]===!0&&i("ADsafe restricted word '{a}'.",rn,n),"boolean"==typeof Gt[e.value]&&"("!==Wt.id;){if(Un[n]===!0){"."===Wt.id&&i("ADsafe violation.",t);
break}if("."!==Wt.id){i("ADsafe violation.",t);break}f("."),rn.left=t,rn.right=n,t=rn,n=F(),"string"==typeof n&&Z(n)}}else i("eval is evil.");return t},160,!0),L("(",function(e,t){h(Kt,rn),g();var n=0,a=[];if(e&&("(identifier)"===e.type?e.value.match(/^[A-Z]([A-Z0-9_$]*[a-z][A-Za-z0-9_$]*)?$/)&&"Number"!==e.value&&"String"!==e.value&&"Boolean"!==e.value&&"Date"!==e.value&&("Math"===e.value?i("Math is not a function.",e):Xt.newcap&&i("Missing 'new' prefix when invoking a constructor.",e)):"."===e.id&&Xt.safe&&"Math"===e.left.value&&"random"===e.right&&i("ADsafe violation.",e)),")"!==Wt.id)for(;a[a.length]=p(10),n+=1,","===Wt.id;)w();return f(")"),Xt.immed&&"function"===e.id&&")"!==Wt.id&&i("Wrap the entire immediate function invocation in parens.",t),g(Kt,rn),"object"==typeof e&&("parseInt"===e.value&&1===n&&i("Missing radix parameter.",e),Xt.evil||("eval"===e.value||"Function"===e.value||"execScript"===e.value?i("eval is evil.",e):!a[0]||"(string)"!==a[0].id||"setTimeout"!==e.value&&"setInterval"!==e.value||i("Implied eval is evil. Pass a function instead of a string.",e)),e.identifier||"."===e.id||"["===e.id||"("===e.id||"&&"===e.id||"||"===e.id||"?"===e.id||i("Bad invocation.",e)),t.left=e,t},155,!0).exps=!0,S("(",function(){g();var e=p(0);return f(")",this),g(Kt,rn),Xt.immed&&"function"===e.id&&("("===Wt.id?i("Move the invocation into the parens that contain the function.",Wt):i("Do not wrap function literals in parens unless they are to be immediately invoked.",this)),e}),L("[",function(e,t){g();var n,a=p(0);return a&&"(string)"===a.type?(Xt.safe&&fn[a.value]===!0?i("ADsafe restricted word '{a}'.",t,a.value):Xt.evil||"eval"!==a.value&&"execScript"!==a.value?!Xt.safe||"_"!==a.value.charAt(0)&&"-"!==a.value.charAt(0)||i("ADsafe restricted subscript '{a}'.",t,a.value):i("eval is evil.",t),Z(a.value),!Xt.sub&&Cn.test(a.value)&&(n=Sn[a.value],n&&n.reserved||i("['{a}'] is better written in dot notation.",a,a.value))):(!a||"(number)"!==a.type||a.value<0)&&Xt.safe&&i("ADsafe subscripting."),f("]",t),g(Kt,rn),t.left=e,t.right=a,t},160,!0),S("[",function(){var e=rn.line!==Wt.line;for(this.first=[],e&&(zt+=Xt.indent,Wt.from===zt+Xt.indent&&(zt+=Xt.indent));"(end)"!==Wt.id;){for(;","===Wt.id;)i("Extra comma."),f(",");if("]"===Wt.id)break;if(e&&rn.line!==Wt.line&&b(),this.first.push(p(10)),","!==Wt.id)break;if(w(),"]"===Wt.id){i("Extra comma.",rn);break}}return e&&(zt-=Xt.indent,b()),f("]",this),this},160),function(e){e.nud=function(){var e,t,n,a,r,o,c={};for(e=rn.line!==Wt.line,e&&(zt+=Xt.indent,Wt.from===zt+Xt.indent&&(zt+=Xt.indent));"}"!==Wt.id;){if(e&&b(),"get"===Wt.value&&":"!==u().id)f("get"),Xt.es5||s("get/set are ES5 features."),n=bt(),n||s("Missing property name."),o=Wt,h(rn,Wt),t=wt(n),It["(loopage)"]&&i("Don't make functions within a loop.",o),r=t["(params)"],r&&i("Unexpected parameter '{a}' in get {b} function.",o,r[0],n),h(rn,Wt),f(","),b(),f("set"),a=bt(),n!==a&&s("Expected {a} and instead saw {b}.",rn,n,a),o=Wt,h(rn,Wt),t=wt(n),r=t["(params)"],r&&1===r.length&&"value"===r[0]||i("Expected (value) in set {a} function.",o,n);else{if(n=bt(),"string"!=typeof n)break;f(":"),m(rn,Wt),p(10)}if(c[n]===!0&&i("Duplicate member '{a}'.",Wt,n),c[n]=!0,Z(n),","!==Wt.id)break;w(),","===Wt.id?i("Extra comma.",rn):"}"===Wt.id&&i("Extra comma.",rn)}return e&&(zt-=Xt.indent,b()),f("}",this),this},e.fud=function(){s("Expected to see a statement and instead saw a block.",rn)}}(k("{")),A("var",xt).exps=!0,E("function",function(){$t&&i("Function statements cannot be placed in blocks. Use a function expression or move the statement to the top of the outer function.",rn);var e=F();return h(rn,Wt),l(e,"unused"),wt(e),"("===Wt.id&&Wt.line===rn.line&&s("Function statements are not invocable. Wrap the whole function invocation in parens."),this}),S("function",function(){var e=q();return e?h(rn,Wt):m(rn,Wt),wt(e),It["(loopage)"]&&i("Don't make functions within a loop."),this}),E("if",function(){var e=Wt;return f("("),m(this,e),g(),p(20),"="===Wt.id&&(i("Expected a conditional expression and instead saw an assignment."),f("="),p(20)),f(")",e),g(Kt,rn),P(!0),"else"===Wt.id&&(m(rn,Wt),f("else"),"if"===Wt.id||"switch"===Wt.id?$(!0):P(!0)),this}),E("try",function(){var e,t,n;return Xt.adsafe&&i("ADsafe try violation.",this),P(!1),"catch"===Wt.id&&(f("catch"),m(rn,Wt),f("("),n=Qt,Qt=Object.create(n),t=Wt.value,"(identifier)"!==Wt.type?i("Expected an identifier and instead saw '{a}'.",Wt,t):l(t,"exception"),f(),f(")"),P(!1),e=!0,Qt=n),"finally"===Wt.id?(f("finally"),void P(!1)):(e||s("Expected '{a}' and instead saw '{b}'.",Wt,"catch",Wt.value),this)}),E("while",function(){var e=Wt;return It["(breakage)"]+=1,It["(loopage)"]+=1,f("("),m(this,e),g(),p(20),"="===Wt.id&&(i("Expected a conditional expression and instead saw an assignment."),f("="),p(20)),f(")",e),g(Kt,rn),P(!0),It["(breakage)"]-=1,It["(loopage)"]-=1,this}).labelled=!0,D("with"),E("switch",function(){var e=Wt,t=!1;for(It["(breakage)"]+=1,f("("),m(this,e),g(),this.condition=p(20),f(")",e),g(Kt,rn),m(rn,Wt),e=Wt,f("{"),m(rn,Wt),zt+=Xt.indent,this.cases=[];;)switch(Wt.id){case"case":switch(It["(verb)"]){case"break":case"case":case"continue":case"return":case"switch":case"throw":break;default:i("Expected a 'break' statement before 'case'.",rn)}b(-Xt.indent),f("case"),this.cases.push(p(20)),t=!0,f(":"),It["(verb)"]="case";break;case"default":switch(It["(verb)"]){case"break":case"continue":case"return":case"throw":break;default:i("Expected a 'break' statement before 'default'.",rn)}b(-Xt.indent),f("default"),t=!0,f(":");break;case"}":return zt-=Xt.indent,b(),f("}",e),(1===this.cases.length||"true"===this.condition.id||"false"===this.condition.id)&&i("This 'switch' should be an 'if'.",this),It["(breakage)"]-=1,void(It["(verb)"]=void 0);case"(end)":return void s("Missing '{a}'.",Wt,"}");default:if(t)switch(rn.id){case",":return void s("Each value should have its own case label.");case":":J();break;default:s("Missing ':' on a case clause.",rn)}else s("Expected '{a}' and instead saw '{b}'.",Wt,"case",Wt.value)}}).labelled=!0,A("debugger",function(){return Xt.debug||i("All 'debugger' statements should be removed."),this}).exps=!0,function(){var e=A("do",function(){It["(breakage)"]+=1,It["(loopage)"]+=1,this.first=P(!0),f("while");var e=Wt;return m(rn,e),f("("),g(),p(20),"="===Wt.id&&(i("Expected a conditional expression and instead saw an assignment."),f("="),p(20)),f(")",e),g(Kt,rn),It["(breakage)"]-=1,It["(loopage)"]-=1,this});e.labelled=!0,e.exps=!0}(),E("for",function(){var e,t=Xt.forin,n=Wt;if(It["(breakage)"]+=1,It["(loopage)"]+=1,f("("),m(this,n),g(),"in"===u("var"===Wt.id?1:0).id){if("var"===Wt.id)f("var"),xt(!0);else{switch(It[Wt.value]){case"unused":It[Wt.value]="var";break;case"var":break;default:i("Bad for in variable '{a}'.",Wt,Wt.value)}f()}return f("in"),p(20),f(")",n),e=P(!0),!t&&(e.length>1||"object"!=typeof e[0]||"if"!==e[0].value)&&i("The body of a for in should be wrapped in an if statement to filter unwanted properties from the prototype.",this),It["(breakage)"]-=1,It["(loopage)"]-=1,this}if(";"!==Wt.id)if("var"===Wt.id)f("var"),xt();else for(;p(0,"for"),","===Wt.id;)w();if(y(rn),f(";"),";"!==Wt.id&&(p(20),"="===Wt.id&&(i("Expected a conditional expression and instead saw an assignment."),f("="),p(20))),y(rn),f(";"),";"===Wt.id&&s("Expected '{a}' and instead saw '{b}'.",Wt,")",";"),")"!==Wt.id)for(;p(0,"for"),","===Wt.id;)w();return f(")",n),g(Kt,rn),P(!0),It["(breakage)"]-=1,It["(loopage)"]-=1,this}).labelled=!0,A("break",function(){var e=Wt.value;return 0===It["(breakage)"]&&i("Unexpected '{a}'.",Wt,this.value),y(this),";"!==Wt.id&&rn.line===Wt.line&&("label"!==It[e]?i("'{a}' is not a statement label.",Wt,e):Qt[e]!==It&&i("'{a}' is out of scope.",Wt,e),this.first=Wt,f()),B("break"),this}).exps=!0,A("continue",function(){var e=Wt.value;return 0===It["(breakage)"]&&i("Unexpected '{a}'.",Wt,this.value),y(this),";"!==Wt.id?rn.line===Wt.line&&("label"!==It[e]?i("'{a}' is not a statement label.",Wt,e):Qt[e]!==It&&i("'{a}' is out of scope.",Wt,e),this.first=Wt,f()):It["(loopage)"]||i("Unexpected '{a}'.",Wt,this.value),B("continue"),this}).exps=!0,A("return",function(){return y(this),"(regexp)"===Wt.id&&i("Wrap the /regexp/ literal in parens to disambiguate the slash operator."),";"===Wt.id||Wt.reach||(m(rn,Wt),this.first=p(20)),B("return"),this}).exps=!0,A("throw",function(){return y(this),m(rn,Wt),this.first=p(20),B("throw"),this}).exps=!0,D("void"),D("class"),D("const"),D("enum"),D("export"),D("extends"),D("import"),D("super"),D("let"),D("yield"),D("implements"),D("interface"),D("package"),D("private"),D("protected"),D("public"),D("static");var Zn=function(e,t){var n,r;if(JSLINT.errors=[],Gt=Object.create(En),t){if(n=t.predef,n instanceof Array)for(r=0;r<n.length;r+=1)Gt[n[r]]=!0;t.adsafe&&(t.safe=!0),t.safe&&(t.browser=!1,t.css=!1,t.debug=!1,t.devel=!1,t.eqeqeq=!0,t.evil=!1,t.forin=!1,t.nomen=!0,t.on=!1,t.rhino=!1,t.safe=!0,t.windows=!1,t.strict=!0,t.sub=!1,t.undef=!0,t.widget=!1,Gt.Date=null,Gt.eval=null,Gt.Function=null,Gt.Object=null,Gt.ADSAFE=!1,Gt.lib=!1),Xt=t}else Xt={};if(Xt.indent=Xt.indent||4,Xt.maxerr=Xt.maxerr||50,Ut="",St=!1,jt=!1,Ot={},Xt.approved)for(r=0;r<Xt.approved.length;r+=1)Ot[Xt.approved[r]]=Xt.approved[r];else Ot.test="test";for(an="",r=0;r<Xt.indent;r+=1)an+=" ";zt=1,qt=Object.create(Gt),Qt=qt,It={"(global)":!0,"(name)":"(global)","(scope)":Qt,"(breakage)":0,"(loopage)":0},Ct=[It],Ft={},on=[],en=!1,cn=!1,tn=null,Zt={},Ht=null,Bt={},$t=!1,Rt=[],Jt=!1,sn=0,Rn.init(e),Yt=!0,nn=!1,Kt=rn=Wt=Sn["(begin)"],a();try{if(f(),"<"===Wt.value.charAt(0))vt(),Xt.adsafe&&!jt&&i("ADsafe violation: Missing ADSAFE.go.",this);else switch(Wt.id){case"{":case"[":Xt.laxbreak=!0,Jt=!0,kt();break;case"@":case"*":case"#":case".":case":":cn="style",f(),"@"===rn.id&&Wt.identifier&&"charset"===Wt.value&&1===rn.line&&1===rn.from||s('A css file should begin with @charset "UTF-8";'),f(),"(string)"!==Wt.type&&"UTF-8"!==Wt.value&&s('A css file should begin with @charset "UTF-8";'),f(),f(";"),ft();break;default:Xt.adsafe&&Xt.fragment&&s("Expected '{a}' and instead saw '{b}'.",Wt,"<div>",Wt.value),J("lib")}f("(end)")}catch(o){o&&JSLINT.errors.push({reason:o.message,line:o.line||Wt.line,character:o.character||Wt.from},null)}return 0===JSLINT.errors.length};return Zn.data=function(){var e,n,a,r,i,o,s,c={functions:[]},l=[],d=[],u=[];Zn.errors.length&&(c.errors=Zn.errors),Jt&&(c.json=!0);for(o in Bt)t(Bt,o)&&l.push({name:o,line:Bt[o]});for(l.length>0&&(c.implieds=l),on.length>0&&(c.urls=on),n=Et(Qt),n.length>0&&(c.globals=n),r=1;r<Ct.length;r+=1){for(a=Ct[r],e={},i=0;i<yn.length;i+=1)e[yn[i]]=[];for(o in a)t(a,o)&&"("!==o.charAt(0)&&(s=a[o],At(e[s])&&(e[s].push(o),"unused"===s&&u.push({name:o,line:a["(line)"],"function":a["(name)"]})));for(i=0;i<yn.length;i+=1)0===e[yn[i]].length&&delete e[yn[i]];e.name=a["(name)"],e.param=a["(params)"],e.line=a["(line)"],e.last=a["(last)"],c.functions.push(e)}u.length>0&&(c.unused=u),d=[];for(o in Zt)if("number"==typeof Zt[o]){c.member=Zt;break}return c},Zn.report=function(e){function t(e,t){var n,a,r;if(t){for(h.push("<div><i>"+e+"</i> "),t=t.sort(),a=0;a<t.length;a+=1)t[a]!==r&&(r=t[a],h.push((n?", ":"")+r),n=!0);h.push("</div>")}}var n,a,r,i,o,s,c,l,d,u=Zn.data(),f=[],p="",h=[];if(u.errors||u.implieds||u.unused){if(r=!0,h.push("<div id=errors><i>Error:</i>"),u.errors)for(o=0;o<u.errors.length;o+=1)n=u.errors[o],n&&(a=n.evidence||"",h.push("<p>Problem"+(isFinite(n.line)?" at line "+n.line+" character "+n.character:"")+": "+n.reason.entityify()+"</p><p class=evidence>"+(a&&(a.length>80?a.slice(0,77)+"...":a).entityify())+"</p>"));if(u.implieds){for(d=[],o=0;o<u.implieds.length;o+=1)d[o]="<code>"+u.implieds[o].name+"</code>&nbsp;<i>"+u.implieds[o].line+"</i>";h.push("<p><i>Implied global:</i> "+d.join(", ")+"</p>")}if(u.unused){for(d=[],o=0;o<u.unused.length;o+=1)d[o]="<code><u>"+u.unused[o].name+"</u></code>&nbsp;<i>"+u.unused[o].line+"</i> <code>"+u.unused[o]["function"]+"</code>";h.push("<p><i>Unused variable:</i> "+d.join(", ")+"</p>")}u.json&&h.push("<p>JSON: bad.</p>"),h.push("</div>")}if(!e){for(h.push("<br><div id=functions>"),u.urls&&t("URLs<br>",u.urls,"<br>"),h.push("style"===cn?"<p>CSS.</p>":u.json&&!r?"<p>JSON: good.</p>":u.globals?"<div><i>Global</i> "+u.globals.sort().join(", ")+"</div>":"<div><i>No new global variables introduced.</i></div>"),o=0;o<u.functions.length;o+=1)i=u.functions[o],h.push("<br><div class=function><i>"+i.line+"-"+i.last+"</i> "+(i.name||"")+"("+(i.param?i.param.join(", "):"")+")</div>"),t("<big><b>Unused</b></big>",i.unused),t("Closure",i.closure),t("Variable",i["var"]),t("Exception",i.exception),t("Outer",i.outer),t("Global",i.global),t("Label",i.label);if(u.member){if(f=Et(u.member),f.length){for(f=f.sort(),p="<br><pre id=members>/*members ",c=10,o=0;o<f.length;o+=1)s=f[o],l=s.name(),c+l.length>72&&(h.push(p+"<br>"),p="    ",c=1),c+=l.length+2,1===u.member[s]&&(l="<i>"+l+"</i>"),o<f.length-1&&(l+=", "),p+=l;h.push(p+"<br>*/</pre>")}h.push("</div>")}}return h.join("")},Zn.jslint=Zn,Zn.edition="2010-04-06",Zn}();define("orion/jslintworker",function(){}),define("orion/objects",[],function(){function e(e){for(var t=Object.prototype.hasOwnProperty,n=1,a=arguments.length;a>n;n++){var r=arguments[n];for(var i in r)t.call(r,i)&&(e[i]=r[i])}return e}return{clone:function(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var n=Object.create(Object.getPrototypeOf(t));return e(n,t),n},mixin:e,toArray:function(e){return Array.isArray(e)?e:[e]}}}),function(){"use strict";function e(e,t,n,a,r,i){t[e]&&(n.push(e),(t[e]===!0||1===t[e])&&a.push(r+e+"/"+i))}function t(e,t,n,a,r){var i=a+t+"/"+r;require._fileExists(e.toUrl(i+".js"))&&n.push(i)}function n(e,t,a){var r;for(r in t)!t.hasOwnProperty(r)||e.hasOwnProperty(r)&&!a?"object"==typeof t[r]&&(!e[r]&&t[r]&&(e[r]={}),n(e[r],t[r],a)):e[r]=t[r]}var a=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",["module"],function(r){var i=r.config?r.config():{};return i=i||{},{version:"2.0.4",load:function(r,o,s,c){c=c||{},c.locale&&(i.locale=c.locale);var l,d,u,f=a.exec(r),p=f[1],h=f[4],g=f[5],m=h.split("-"),v=[],b={},y="";if(f[5]?(p=f[1],l=p+g):(l=r,g=f[4],h=i.locale,h||(h=i.locale="undefined"==typeof navigator?"root":(navigator.language||navigator.userLanguage||"root").toLowerCase()),m=h.split("-")),c.isBuild){for(v.push(l),t(o,"root",v,p,g),d=0;d<m.length;d++)u=m[d],y+=(y?"-":"")+u,t(o,y,v,p,g);if(c.locales){var w,x;for(w=0;w<c.locales.length;w++)for(h=c.locales[w],m=h.split("-"),y="",x=0;x<m.length;x++)u=m[x],y+=(y?"-":"")+u,t(o,y,v,p,g)}o(v,function(){s()})}else o([l],function(t){var a,r=[];for(e("root",t,r,v,p,g),d=0;d<m.length;d++)a=m[d],y+=(y?"-":"")+a,e(y,t,r,v,p,g);o(v,function(){var e,a,i;for(e=r.length-1;e>-1&&r[e];e--)i=r[e],a=t[i],(a===!0||1===a)&&(a=o(p+i+"/"+g)),n(b,a);s(b)})})}}})}(),define("orion/jslint/nls/messages",["module"],function(e){var t=e.config();return t&&t.root?t:{root:!0}}),define("orion/jslint/nls/root/messages",{"Stopping.":"Stopping. (${0}% scanned)","Too many errors.":"Too many errors. (${0}% scanned)","Stopping, unable to continue.":"Stopping, unable to continue. (${0}% scanned)","'{a}' is a reserved key.":"'${0}' is a reserved key.","'{a}' should not be greater than '{b}'.":"'${0}' should not be greater than '${1}'.","A regular expression literal can be confused with '/='.":"A regular expression literal can be confused with '/='.","A trailing decimal point can be confused with a dot '{a}'.":"A trailing decimal point can be confused with a dot '${0}'.","ADsafe comment violation.":"ADsafe comment violation.","ADsafe string violation.":"ADsafe string violation.","Avoid \\x-.":"Avoid \\x-.","Avoid 0x-. '{a}'.":"Avoid 0x-. '${0}'.","Bad escapement.":"Bad escapement.","Bad hex color '{a}'.":"Bad hex color '${0}'.","Bad HTML string":"Bad HTML string","Bad identifier {a}.":"Bad identifier ${0}.","Bad number '{a}'.":"Bad number '${0}'.","Confusing regular expression.":"Confusing regular expression.","Control character in string: {a}.":"Control character in string: ${0}.","Dangerous comment.":"Dangerous comment.","Don't use extra leading zeros '{a}'.":"Don't use extra leading zeros '${0}'.","Duplicate key '{a}'.":"Duplicate key '${0}'.","Empty class.":"Empty class.","Escapement in style string.":"Escapement in style string.","Expected '<\\/' and instead saw '</'.":"Expected '<\\/' and instead saw '</'.","Expected {a} and instead saw {b}.":"Expected ${0} and instead saw ${1}.","Expected '{a}' and instead saw '{b}'.":"Expected '${0}' and instead saw '${1}'.","Expected a number and instead saw '{a}'.":"Expected a number and instead saw '${0}'.","Expected a string and instead saw {a}.":"Expected a string and instead saw ${0}.","Expected a JSON value.":"Expected a JSON value.","HTML confusion in regular expression '<{a}'.":"HTML confusion in regular expression '<${0}'.","Insecure '{a}'.":"Insecure '${0}'.","Missing ']' to match '[' from line {a}.":"Missing '}' to match '{' from line ${0}.","Missing '}' to match '{' from line {a}.":"Missing '}' to match '{' from line ${0}.","Missing semicolon.":"Missing semicolon.","Missing space after '{a}'.":"Missing space after '${0}'.","Nested comment.":"Nested comment.","Spaces are hard to count. Use {{a}}.":"Spaces are hard to count. Use {${0}}.","Strings must use doublequote.":"Strings must use doublequote.","Unclosed comment.":"Unclosed comment.","Unclosed regular expression.":"Unclosed regular expression.","Unclosed string.":"Unclosed string.","Unescaped '{a}'.":"Unescaped '${0}'.","Unexpected </ in comment.":"Unexpected </ in comment.","Unexpected {a} in '{b}'.":"Unexpected ${0} in '${1}'.","Unexpected '{a}'.":"Unexpected '${0}'.","Unexpected '<!' in a string.":"Unexpected '<!' in a string.","Unexpected comma.":"Unexpected comma.","Unexpected comment.":"Unexpected comment.","Unexpected control character in regular expression.":"Unexpected control character in regular expression.","Unexpected escaped character '{a}' in regular expression.":"Unexpected escaped character '${0}' in regular expression.","Unexpected space after '-'.":"Unexpected space after '-'.","Unexpected space after '{a}'.":"Unexpected space after '${0}'.","Unnecessary escapement.":"Unnecessary escapement."}),define("orion/i18nUtil",[],function(){function e(e){var t=/\$\{([^\}]+)\}/g,n=arguments;return 2===n.length&&n[1]&&"object"==typeof n[1]?e.replace(t,function(e,t){return n[1][t]}):e.replace(t,function(e,t){return n[(t<<0)+1]})}return{formatMessage:e}}),define("plugins/jslintPlugin",["orion/plugin","orion/jslintworker","orion/objects","i18n!orion/jslint/nls/messages","orion/i18nUtil"],function(e,t,n,a,r){function i(e){return JSLINT(e,f),JSLINT.data()}function o(e){var t=[["Expected '{'","Statement body should be inside '{ }' braces."],"Missing semicolon","Extra comma","Missing property name","Unmatched "," and instead saw"," is not defined","Unclosed string","Stopping, unable to continue"],n=e.description;if(-1===n.indexOf("Dangerous comment")){for(var a=0;a<t.length;a++){var r=t[a],i="string"==typeof r?r:r[0],o="string"==typeof r?null:r[1];-1!==n.indexOf(i)&&o&&(e.description=o)}return"Unexpected comma."===e.raw&&(e.id="no-comma-dangle"),e}return null}function s(e){var t=e.raw;if(t){if("string"==typeof a[t])return t.match(/\{a\}|\{b\}|\{c\}|\{d\}/)?r.formatMessage(a[t],e.a,e.b,e.c,e.d):a[t]}else{var n=/(.*)\(([0-9]*)\%/.exec(e.reason);if(n)return r.formatMessage(a[n[1].trim()],n[2]);if(a[e.reason.trim()])return r.formatMessage(a[e.reason.trim()],"100")}return e.reason}function c(e,t){var n,a=i(t),r=[];if(a.errors){var c=a.errors;for(n=0;n<c.length;n++){var l=c[n];if(l){var d=l.character-1,u=d+1;if(l.evidence){var f=l.evidence.substring(d).search(/.\b/);f>-1&&(u+=f)}l.description=s(l),l.start=l.character,l.end=u,l=o(l),l&&r.push(l)}}}if(a.functions){var p,h=a.functions;for(n=0;n<h.length;n++){var g=h[n],m=g.unused;if(m&&0!==m.length){p||(p=t.split(/\r?\n/));for(var v='"'===g.name[0],b=v?g.name.substring(1,g.name.length-1):g.name,y=p[g.line-1],w=0;w<m.length;w++){var x=y.indexOf(b),k=v?y.indexOf("function",x):y.lastIndexOf("function",x);-1!==k&&r.push({reason:"Function declares unused variable '"+m[w]+"'.",line:g.line,character:k+1,end:k+"function".length,severity:"warning"})}}}}return{problems:r}}function l(){var t={name:"Orion JSLint Service",version:"1.0",description:"This plugin provides JSLint functionality for validating JSON."},n=new e(t);d(n),n.connect()}function d(e){e.registerService(["orion.edit.validator"],p,{contentType:["application/json"]})}var u={bitwise:!1,eqeqeq:!0,es5:!0,immed:!0,indent:1,maxerr:300,newcap:!0,nomen:!1,onevar:!1,plusplus:!1,regexp:!0,strict:!1,undef:!0,white:!1},f=u,p={updated:function(e){if(e&&"string"==typeof e.options){var t=e.options;if(!/^\s*$/.test(t)){var a={},r=!1;t.split(/,/).forEach(function(e){var t=/\s*(\w+)\s*:\s*(\w+)\s*/.exec(e);if(null===t)console.log("JSLint ignoring bad option: "+e);else{var n=t[1],i=t[2];a[n]=i,r=!0}}),f={},n.mixin(f,u,a),r&&console.log("JSLint using user-provided options: {"+Object.keys(a).map(function(e){return e+":"+a[e]}).join(",")+"}")}}},computeProblems:function(e,t){return e.getText().then(c.bind(null,t))}};return{connect:l,registerServiceProviders:d}});