diff --git a/dist/gss.js b/dist/gss.js index e042effa..f0de380e 100644 --- a/dist/gss.js +++ b/dist/gss.js @@ -1,3 +1,4 @@ +/* gss-engine - version 2.0.0 (2015-01-26) - http://gridstylesheets.org */ /* gss-engine - version 1.0.4-beta (2015-01-27) - http://gridstylesheets.org */ (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o30||this._deleted>this._compactThreshold&&(this._compact(),this._deleted=0)},"delete":function(a){a=a.hashCode,this._store.hasOwnProperty(a)&&(this._deleted++,delete this._store[a],this.size>0&&this.size--)},each:function(a,b){if(this.size){this._perhapsCompact();var c=this._store,d=this._keyStrMap;for(var e in this._store)this._store.hasOwnProperty(e)&&a.call(b||null,d[e],c[e])}},escapingEach:function(a,b){if(this.size){this._perhapsCompact();for(var d=this,e=this._store,f=this._keyStrMap,g=c,h=Object.keys(e),i=0;i "+c+"\n"}),a}})}(this.c||b.parent.exports||{}),function(a){"use strict";a.HashSet=a.inherit({_t:"c.HashSet",initialize:function(){this.storage=[],this.size=0,this.hashCode=a._inc()},add:function(a){var b=this.storage;b.indexOf(a),-1==b.indexOf(a)&&(b[b.length]=a),this.size=this.storage.length},values:function(){return this.storage},has:function(a){var b=this.storage;return-1!=b.indexOf(a)},"delete":function(a){var b=this.storage.indexOf(a);return-1==b?null:(this.storage.splice(b,1)[0],void(this.size=this.storage.length))},clear:function(){this.storage.length=0},each:function(a,b){this.size&&this.storage.forEach(a,b)},escapingEach:function(a,b){this.size&&this.storage.forEach(a,b)},toString:function(){var a=this.size+" {",b=!0;return this.each(function(c){b?b=!1:a+=", ",a+=c}),a+="}\n"},toJSON:function(){var a=[];return this.each(function(b){a[a.length]=b.toJSON()}),{_t:"c.HashSet",data:a}},fromJSON:function(b){var c=new a.HashSet;return b.data&&(c.size=b.data.length,c.storage=b.data),c}})}(this.c||b.parent.exports||{}),function(a){"use strict";a.Error=a.inherit({initialize:function(a){a&&(this._description=a)},_name:"c.Error",_description:"An error has occured in Cassowary",set description(a){this._description=a},get description(){return"("+this._name+") "+this._description},get message(){return this.description},toString:function(){return this.description}});var b=function(b,c){return a.inherit({"extends":a.Error,initialize:function(){a.Error.apply(this,arguments)},_name:b||"",_description:c||""})};a.ConstraintNotFound=b("c.ConstraintNotFound","Tried to remove a constraint never added to the tableu"),a.InternalError=b("c.InternalError"),a.NonExpression=b("c.NonExpression","The resulting expression would be non"),a.NotEnoughStays=b("c.NotEnoughStays","There are not enough stays to give specific values to every variable"),a.RequiredFailure=b("c.RequiredFailure","A required constraint cannot be satisfied"),a.TooDifficult=b("c.TooDifficult","The constraints are too difficult to solve")}(this.c||b.parent.exports||{}),function(a){"use strict";var b=1e3;a.SymbolicWeight=a.inherit({_t:"c.SymbolicWeight",initialize:function(){this.value=0;for(var a=1,c=arguments.length-1;c>=0;--c)this.value+=arguments[c]*a,a*=b},toJSON:function(){return{_t:this._t,value:this.value}}})}(this.c||b.parent.exports||{}),function(a){a.Strength=a.inherit({initialize:function(b,c,d,e){this.name=b,this.symbolicWeight=c instanceof a.SymbolicWeight?c:new a.SymbolicWeight(c,d,e)},get required(){return this===a.Strength.required},toString:function(){return this.name+(this.isRequired?"":":"+this.symbolicWeight)}}),a.Strength.required=new a.Strength("",1e3,1e3,1e3),a.Strength.strong=new a.Strength("strong",1,0,0),a.Strength.medium=new a.Strength("medium",0,1,0),a.Strength.weak=new a.Strength("weak",0,0,1)}(this.c||("undefined"!=typeof b?b.parent.exports.c:{})),function(a){"use strict";a.AbstractVariable=a.inherit({isDummy:!1,isExternal:!1,isPivotable:!1,isRestricted:!1,_init:function(b,c){this.hashCode=a._inc(),this.name=(c||"")+this.hashCode,b&&("undefined"!=typeof b.name&&(this.name=b.name),"undefined"!=typeof b.value&&(this.value=b.value),"undefined"!=typeof b.prefix&&(this._prefix=b.prefix))},_prefix:"",name:"",value:0,valueOf:function(){return this.value},toJSON:function(){var a={};return this._t&&(a._t=this._t),this.name&&(a.name=this.name),"undefined"!=typeof this.value&&(a.value=this.value),this._prefix&&(a._prefix=this._prefix),this._t&&(a._t=this._t),a},fromJSON:function(b,c){var d=new c;return a.extend(d,b),d},toString:function(){return this._prefix+"["+this.name+":"+this.value+"]"}}),a.Variable=a.inherit({_t:"c.Variable","extends":a.AbstractVariable,initialize:function(b){this._init(b,"v");var c=a.Variable._map;c&&(c[this.name]=this)},isExternal:!0}),a.DummyVariable=a.inherit({_t:"c.DummyVariable","extends":a.AbstractVariable,initialize:function(a){this._init(a,"d")},isDummy:!0,isRestricted:!0,value:"dummy"}),a.ObjectiveVariable=a.inherit({_t:"c.ObjectiveVariable","extends":a.AbstractVariable,initialize:function(a){this._init(a,"o")},value:"obj"}),a.SlackVariable=a.inherit({_t:"c.SlackVariable","extends":a.AbstractVariable,initialize:function(a){this._init(a,"s")},isPivotable:!0,isRestricted:!0,value:"slack"})}(this.c||b.parent.exports||{}),function(a){"use strict";a.Point=a.inherit({initialize:function(b,c,d){if(b instanceof a.Variable)this._x=b;else{var e={value:b};d&&(e.name="x"+d),this._x=new a.Variable(e)}if(c instanceof a.Variable)this._y=c;else{var f={value:c};d&&(f.name="y"+d),this._y=new a.Variable(f)}},get x(){return this._x},set x(b){b instanceof a.Variable?this._x=b:this._x.value=b},get y(){return this._y},set y(b){b instanceof a.Variable?this._y=b:this._y.value=b},toString:function(){return"("+this.x+", "+this.y+")"}})}(this.c||b.parent.exports||{}),function(a){"use strict";var b=function(a,b){return"number"==typeof a?a:b};a.Expression=a.inherit({initialize:function(c,d,e){this.constant=b(e,0),this.terms=new a.HashTable,c instanceof a.AbstractVariable?(d=b(d,1),this.setVariable(c,d)):"number"==typeof c&&(isNaN(c)?console.trace():this.constant=c)},initializeFromHash:function(b,c){return a.verbose&&(console.log("*******************************"),console.log("clone c.initializeFromHash"),console.log("*******************************")),a.GC&&console.log("clone c.Expression"),this.constant=b,this.terms=c.clone(),this},multiplyMe:function(a){this.constant*=a;var b=this.terms;return b.each(function(c,d){b.set(c,d*a)}),this},clone:function(){a.verbose&&(console.log("*******************************"),console.log("clone c.Expression"),console.log("*******************************"));var b=a.Expression.empty();return b.initializeFromHash(this.constant,this.terms),b},times:function(b){if("number"==typeof b)return this.clone().multiplyMe(b);if(this.isConstant)return b.times(this.constant);if(b.isConstant)return this.times(b.constant);throw new a.NonExpression},plus:function(b){return b instanceof a.Expression?this.clone().addExpression(b,1):b instanceof a.Variable?this.clone().addVariable(b,1):void 0},minus:function(b){return b instanceof a.Expression?this.clone().addExpression(b,-1):b instanceof a.Variable?this.clone().addVariable(b,-1):void 0},divide:function(b){if("number"==typeof b){if(a.approx(b,0))throw new a.NonExpression;return this.times(1/b)}if(b instanceof a.Expression){if(!b.isConstant)throw new a.NonExpression;return this.times(1/b.constant)}},addExpression:function(c,d,e,f){return c instanceof a.AbstractVariable&&(c=a.Expression.fromVariable(c)),d=b(d,1),this.constant+=d*c.constant,c.terms.each(function(a,b){this.addVariable(a,b*d,e,f)},this),this},addVariable:function(b,c,d,e){null==c&&(c=1);var f=this.terms.get(b);if(f){var g=f+c;0==g||a.approx(g,0)?(e&&e.noteRemovedVariable(b,d),this.terms["delete"](b)):this.setVariable(b,g)}else a.approx(c,0)||(this.setVariable(b,c),e&&e.noteAddedVariable(b,d));return this},setVariable:function(a,b){return this.terms.set(a,b),this},anyPivotableVariable:function(){if(this.isConstant)throw new a.InternalError("anyPivotableVariable called on a constant");var b=this.terms.escapingEach(function(a){return a.isPivotable?{retval:a}:void 0});return b&&void 0!==b.retval?b.retval:null},substituteOut:function(b,c,d,e){this.setVariable.bind(this);var f=this.terms,g=f.get(b);f["delete"](b),this.constant+=g*c.constant,c.terms.each(function(b,c){var h=f.get(b);if(h){var i=h+g*c;a.approx(i,0)?(e.noteRemovedVariable(b,d),f["delete"](b)):f.set(b,i)}else f.set(b,g*c),e&&e.noteAddedVariable(b,d)})},changeSubject:function(a,b){this.setVariable(a,this.newSubject(b))},newSubject:function(a){var b=1/this.terms.get(a);return this.terms["delete"](a),this.multiplyMe(-b),b},coefficientFor:function(a){return this.terms.get(a)||0},get isConstant(){return 0==this.terms.size},toString:function(){var b="",c=!1;if(!a.approx(this.constant,0)||this.isConstant){if(b+=this.constant,this.isConstant)return b;c=!0}return this.terms.each(function(a,d){c&&(b+=" + "),b+=d+"*"+a,c=!0}),b},equals:function(b){return b===this?!0:b instanceof a.Expression&&b.constant===this.constant&&b.terms.equals(this.terms)},Plus:function(a,b){return a.plus(b)},Minus:function(a,b){return a.minus(b)},Times:function(a,b){return a.times(b)},Divide:function(a,b){return a.divide(b)}}),a.Expression.empty=function(){return new a.Expression(void 0,1,0)},a.Expression.fromConstant=function(b){return new a.Expression(b)},a.Expression.fromValue=function(b){return b=+b,new a.Expression(void 0,b,0)},a.Expression.fromVariable=function(b){return new a.Expression(b,1,0)}}(this.c||b.parent.exports||{}),function(a){"use strict";a.AbstractConstraint=a.inherit({initialize:function(b,c){this.hashCode=a._inc(),this.strength=b||a.Strength.required,this.weight=c||1},isEditConstraint:!1,isInequality:!1,isStayConstraint:!1,get required(){return this.strength===a.Strength.required},toString:function(){return this.strength+" {"+this.weight+"} ("+this.expression+")"}});var b=a.AbstractConstraint.prototype.toString,c=function(b,c,d){a.AbstractConstraint.call(this,c||a.Strength.strong,d),this.variable=b,this.expression=new a.Expression(b,-1,b.value)};a.EditConstraint=a.inherit({"extends":a.AbstractConstraint,initialize:function(){c.apply(this,arguments)},isEditConstraint:!0,toString:function(){return"edit:"+b.call(this)}}),a.StayConstraint=a.inherit({"extends":a.AbstractConstraint,initialize:function(){c.apply(this,arguments)},isStayConstraint:!0,toString:function(){return"stay:"+b.call(this)}});var d=a.Constraint=a.inherit({"extends":a.AbstractConstraint,initialize:function(b,c,d){a.AbstractConstraint.call(this,c,d),this.expression=b}});a.Inequality=a.inherit({"extends":a.Constraint,_cloneOrNewCle:function(b){return b.clone?b.clone():new a.Expression(b)},initialize:function(b,c,e,f,g){var h=b instanceof a.Expression,i=e instanceof a.Expression,j=b instanceof a.AbstractVariable,k=e instanceof a.AbstractVariable,l="number"==typeof b,m="number"==typeof e;if((h||l)&&k){var n=b,o=c,p=e,q=f,r=g;if(d.call(this,this._cloneOrNewCle(n),q,r),o==a.LEQ)this.expression.multiplyMe(-1),this.expression.addVariable(p);else{if(o!=a.GEQ)throw new a.InternalError("Invalid operator in c.Inequality constructor");this.expression.addVariable(p,-1)}}else if(j&&(i||m)){var n=e,o=c,p=b,q=f,r=g;if(d.call(this,this._cloneOrNewCle(n),q,r),o==a.GEQ)this.expression.multiplyMe(-1),this.expression.addVariable(p);else{if(o!=a.LEQ)throw new a.InternalError("Invalid operator in c.Inequality constructor");this.expression.addVariable(p,-1)}}else{if(h&&m){var s=b,o=c,t=e,q=f,r=g;if(d.call(this,this._cloneOrNewCle(s),q,r),o==a.LEQ)this.expression.multiplyMe(-1),this.expression.addExpression(this._cloneOrNewCle(t));else{if(o!=a.GEQ)throw new a.InternalError("Invalid operator in c.Inequality constructor");this.expression.addExpression(this._cloneOrNewCle(t),-1)}return this}if(l&&i){var s=e,o=c,t=b,q=f,r=g;if(d.call(this,this._cloneOrNewCle(s),q,r),o==a.GEQ)this.expression.multiplyMe(-1),this.expression.addExpression(this._cloneOrNewCle(t));else{if(o!=a.LEQ)throw new a.InternalError("Invalid operator in c.Inequality constructor");this.expression.addExpression(this._cloneOrNewCle(t),-1)}return this}if(h&&i){var s=b,o=c,t=e,q=f,r=g;if(d.call(this,this._cloneOrNewCle(t),q,r),o==a.GEQ)this.expression.multiplyMe(-1),this.expression.addExpression(this._cloneOrNewCle(s));else{if(o!=a.LEQ)throw new a.InternalError("Invalid operator in c.Inequality constructor");this.expression.addExpression(this._cloneOrNewCle(s),-1)}}else{if(h)return d.call(this,b,c,e);if(c==a.GEQ)d.call(this,new a.Expression(e),f,g),this.expression.multiplyMe(-1),this.expression.addVariable(b);else{if(c!=a.LEQ)throw new a.InternalError("Invalid operator in c.Inequality constructor");d.call(this,new a.Expression(e),f,g),this.expression.addVariable(b,-1)}}}},isInequality:!0,toString:function(){return d.prototype.toString.call(this)+" >= 0) id: "+this.hashCode}}),a.Equation=a.inherit({"extends":a.Constraint,initialize:function(b,c,e,f){if(b instanceof a.Expression&&!c||c instanceof a.Strength)d.call(this,b,c,e);else if(b instanceof a.AbstractVariable&&c instanceof a.Expression){var g=b,h=c,i=e,j=f;d.call(this,h.clone(),i,j),this.expression.addVariable(g,-1)}else if(b instanceof a.AbstractVariable&&"number"==typeof c){var g=b,k=c,i=e,j=f;d.call(this,new a.Expression(k),i,j),this.expression.addVariable(g,-1)}else if(b instanceof a.Expression&&c instanceof a.AbstractVariable){var h=b,g=c,i=e,j=f;d.call(this,h.clone(),i,j),this.expression.addVariable(g,-1)}else{if(!(b instanceof a.Expression||b instanceof a.AbstractVariable||"number"==typeof b)||!(c instanceof a.Expression||c instanceof a.AbstractVariable||"number"==typeof c))throw"Bad initializer to c.Equation";b=b instanceof a.Expression?b.clone():new a.Expression(b),c=c instanceof a.Expression?c.clone():new a.Expression(c),d.call(this,b,e,f),this.expression.addExpression(c,-1)}a.assert(this.strength instanceof a.Strength,"_strength not set")},toString:function(){return d.prototype.toString.call(this)+" = 0)"}})}(this.c||b.parent.exports||{}),function(a){"use strict";a.EditInfo=a.inherit({initialize:function(a,b,c,d,e){this.constraint=a,this.editPlus=b,this.editMinus=c,this.prevEditConstant=d,this.index=e},toString:function(){return""}})}(this.c||b.parent.exports||{}),function(a){"use strict";a.Tableau=a.inherit({initialize:function(){this.columns=new a.HashTable,this.rows=new a.HashTable,this._infeasibleRows=new a.HashSet,this._externalRows=new a.HashSet,this._externalParametricVars=new a.HashSet},noteRemovedVariable:function(b,c){a.trace&&console.log("c.Tableau::noteRemovedVariable: ",b,c);var d=this.columns.get(b);c&&d&&d["delete"](c)},noteAddedVariable:function(a,b){b&&this.insertColVar(a,b)},getInternalInfo:function(){var a="Tableau Information:\n";return a+="Rows: "+this.rows.size,a+=" (= "+(this.rows.size-1)+" constraints)",a+="\nColumns: "+this.columns.size,a+="\nInfeasible Rows: "+this._infeasibleRows.size,a+="\nExternal basic variables: "+this._externalRows.size,a+="\nExternal parametric variables: ",a+=this._externalParametricVars.size,a+="\n"},toString:function(){var a="Tableau:\n";return this.rows.each(function(b,c){a+=b,a+=" <==> ",a+=c,a+="\n"}),a+="\nColumns:\n",a+=this.columns,a+="\nInfeasible rows: ",a+=this._infeasibleRows,a+="External basic variables: ",a+=this._externalRows,a+="External parametric variables: ",a+=this._externalParametricVars},insertColVar:function(b,c){var d=this.columns.get(b);d||(d=new a.HashSet,this.columns.set(b,d)),d.add(c)},addRow:function(b,c){a.trace&&a.fnenterprint("addRow: "+b+", "+c),this.rows.set(b,c),c.terms.each(function(a){this.insertColVar(a,b),a.isExternal&&this._externalParametricVars.add(a)},this),b.isExternal&&this._externalRows.add(b),a.trace&&a.traceprint(this.toString())},removeColumn:function(b){a.trace&&a.fnenterprint("removeColumn:"+b);var c=this.columns.get(b);c?(this.columns["delete"](b),c.each(function(a){var c=this.rows.get(a);c.terms["delete"](b)},this)):a.trace&&console.log("Could not find var",b,"in columns"),b.isExternal&&(this._externalRows["delete"](b),this._externalParametricVars["delete"](b))},removeRow:function(b){a.trace&&a.fnenterprint("removeRow:"+b);var c=this.rows.get(b);return a.assert(null!=c),c.terms.each(function(c){var d=this.columns.get(c);null!=d&&(a.trace&&console.log("removing from varset:",b),d["delete"](b))},this),this._infeasibleRows["delete"](b),b.isExternal&&this._externalRows["delete"](b),this.rows["delete"](b),a.trace&&a.fnexitprint("returning "+c),c},substituteOut:function(b,c){a.trace&&a.fnenterprint("substituteOut:"+b+", "+c),a.trace&&a.traceprint(this.toString());var d=this.columns.get(b);d.each(function(a){var d=this.rows.get(a);d.substituteOut(b,c,a,this),a.isRestricted&&d.constant<0&&this._infeasibleRows.add(a)},this),b.isExternal&&(this._externalRows.add(b),this._externalParametricVars["delete"](b)),this.columns["delete"](b)},columnsHasKey:function(a){return!!this.columns.get(a)}})}(this.c||b.parent.exports||{}),function(a){var b=a.Tableau,c=b.prototype,d=1e-8,e=a.Strength.weak;a.SimplexSolver=a.inherit({"extends":a.Tableau,initialize:function(){a.Tableau.call(this),this._stayMinusErrorVars=[],this._stayPlusErrorVars=[],this._errorVars=new a.HashTable,this._markerVars=new a.HashTable,this._objective=new a.ObjectiveVariable({name:"Z"}),this._editVarMap=new a.HashTable,this._editVarList=[],this._slackCounter=0,this._artificialCounter=0,this._dummyCounter=0,this.autoSolve=!0,this._needsSolving=!1,this._optimizeCount=0,this.rows.set(this._objective,a.Expression.empty()),this._editVariableStack=[0],a.trace&&a.traceprint("objective expr == "+this.rows.get(this._objective))},add:function(){for(var a=0;a0,"_editVarMap.size > 0"),this._infeasibleRows.clear(),this._resetStayConstants(),this._editVariableStack[this._editVariableStack.length]=this._editVarMap.size,this},endEdit:function(){return a.assert(this._editVarMap.size>0,"_editVarMap.size > 0"),this.resolve(),this._editVariableStack.pop(),this.removeEditVarsTo(this._editVariableStack[this._editVariableStack.length-1]),this},removeAllEditVars:function(){return this.removeEditVarsTo(0)},removeEditVarsTo:function(b){try{for(var c=this._editVarList.length,d=b;c>d;d++)this._editVarList[d]&&this.removeConstraint(this._editVarMap.get(this._editVarList[d].v).constraint);return this._editVarList.length=b,a.assert(this._editVarMap.size==b,"_editVarMap.size == n"),this}catch(e){throw new a.InternalError("Constraint not found in removeEditVarsTo")}},addPointStays:function(b){return a.trace&&console.log("addPointStays",b),b.forEach(function(a,b){this.addStay(a.x,e,Math.pow(2,b)),this.addStay(a.y,e,Math.pow(2,b))},this),this},addStay:function(b,c,d){var f=new a.StayConstraint(b,c||e,d||1);return this.addConstraint(f)},removeConstraint:function(b){a.trace&&a.fnenterprint("removeConstraintInternal: "+b),a.trace&&a.traceprint(this.toString()),this._needsSolving=!0,this._resetStayConstants();var c=this.rows.get(this._objective),d=this._errorVars.get(b);a.trace&&a.traceprint("eVars == "+d),null!=d&&d.each(function(e){var f=this.rows.get(e);null==f?c.addVariable(e,-b.weight*b.strength.symbolicWeight.value,this._objective,this):c.addExpression(f,-b.weight*b.strength.symbolicWeight.value,this._objective,this),a.trace&&a.traceprint("now eVars == "+d)},this);var e=this._markerVars.get(b);if(this._markerVars["delete"](b),null==e)throw new a.InternalError("Constraint not found in removeConstraintInternal");if(a.trace&&a.traceprint("Looking to remove var "+e),null==this.rows.get(e)){var f=this.columns.get(e);a.trace&&a.traceprint("Must pivot -- columns are "+f);var g=null,h=0;f.each(function(b){if(b.isRestricted){var c=this.rows.get(b),d=c.coefficientFor(e);if(a.trace&&a.traceprint("Marker "+e+"'s coefficient in "+c+" is "+d),0>d){var f=-c.constant/d;(null==g||h>f||a.approx(f,h)&&b.hashCoded)&&(h=d,g=a)}},this)),null==g&&(0==f.size?this.removeColumn(e):f.escapingEach(function(a){return a!=this._objective?(g=a,{brk:!0}):void 0},this)),null!=g&&this.pivot(e,g)}if(null!=this.rows.get(e)&&this.removeRow(e),null!=d&&d.each(function(a){a!=e&&this.removeColumn(a)},this),b.isStayConstraint){if(null!=d)for(var i=0;ie&&this.suggestValue(a,b[e])},this),this.resolve()},resolvePair:function(a,b){this.suggestValue(this._editVarList[0].v,a),this.suggestValue(this._editVarList[1].v,b),this.resolve()},resolve:function(){a.trace&&a.fnenterprint("resolve()"),this.dualOptimize(),this._setExternalVariables(),this._infeasibleRows.clear(),this._resetStayConstants()},suggestValue:function(b,c){a.trace&&console.log("suggestValue("+b+", "+c+")");var d=this._editVarMap.get(b);if(!d)throw new a.Error("suggestValue for variable "+b+", but var is not an edit variable");var e=c-d.prevEditConstant;return d.prevEditConstant=c,this.deltaEditConstant(e,d.editPlus,d.editMinus),this},solve:function(){return this._needsSolving&&(this.optimize(this._objective),this._setExternalVariables()),this},setEditedValue:function(b,c){if(!this.columnsHasKey(b)&&null==this.rows.get(b))return b.value=c,this;if(!a.approx(c,b.value)){this.addEditVar(b),this.beginEdit();try{this.suggestValue(b,c)}catch(d){throw new a.InternalError("Error in setEditedValue")}this.endEdit()}return this},addVar:function(b){if(!this.columnsHasKey(b)&&null==this.rows.get(b)){try{this.addStay(b)}catch(c){throw new a.InternalError("Error in addVar -- required failure is impossible")}a.trace&&a.traceprint("added initial stay on "+b)}return this},getInternalInfo:function(){var a=c.getInternalInfo.call(this);return a+="\nSolver info:\n",a+="Stay Error Variables: ",a+=this._stayPlusErrorVars.length+this._stayMinusErrorVars.length,a+=" ("+this._stayPlusErrorVars.length+" +, ",a+=this._stayMinusErrorVars.length+" -)\n",a+="Edit Variables: "+this._editVarMap.size,a+="\n"},getDebugInfo:function(){return this.toString()+this.getInternalInfo()+"\n"},toString:function(){var a=c.getInternalInfo.call(this);return a+="\n_stayPlusErrorVars: ",a+="["+this._stayPlusErrorVars+"]",a+="\n_stayMinusErrorVars: ",a+="["+this._stayMinusErrorVars+"]",a+="\n",a+="_editVarMap:\n"+this._editVarMap,a+="\n"},addWithArtificialVariable:function(b){a.trace&&a.fnenterprint("addWithArtificialVariable: "+b);var c=new a.SlackVariable({value:++this._artificialCounter,prefix:"a"}),d=new a.ObjectiveVariable({name:"az"}),e=b.clone();a.trace&&a.traceprint("before addRows:\n"+this),this.addRow(d,e),this.addRow(c,b),a.trace&&a.traceprint("after addRows:\n"+this),this.optimize(d);var f=this.rows.get(d);if(a.trace&&a.traceprint("azTableauRow.constant == "+f.constant),!a.approx(f.constant,0))throw this.removeRow(d),this.removeColumn(c),new a.RequiredFailure;var g=this.rows.get(c);if(null!=g){if(g.isConstant)return this.removeRow(c),void this.removeRow(d);var h=g.anyPivotableVariable();this.pivot(h,c)}a.assert(null==this.rows.get(c),"rowExpression(av) == null"),this.removeColumn(c),this.removeRow(d)},tryAddingDirectly:function(b){a.trace&&a.fnenterprint("tryAddingDirectly: "+b);var c=this.chooseSubject(b);return null==c?(a.trace&&a.fnexitprint("returning false"),!1):(b.newSubject(c),this.columnsHasKey(c)&&this.substituteOut(c,b),this.addRow(c,b),a.trace&&a.fnexitprint("returning true"),!0)},chooseSubject:function(b){a.trace&&a.fnenterprint("chooseSubject: "+b);var c=null,d=!1,e=!1,f=b.terms,g=f.escapingEach(function(a,b){if(d){if(!a.isRestricted&&!this.columnsHasKey(a))return{retval:a}}else if(a.isRestricted){if(!e&&!a.isDummy&&0>b){var f=this.columns.get(a);(null==f||1==f.size&&this.columnsHasKey(this._objective))&&(c=a,e=!0)}}else c=a,d=!0},this);if(g&&void 0!==g.retval)return g.retval;if(null!=c)return c;var h=0,g=f.escapingEach(function(a,b){return a.isDummy?void(this.columnsHasKey(a)||(c=a,h=b)):{retval:null}},this);if(g&&void 0!==g.retval)return g.retval;if(!a.approx(b.constant,0))throw new a.RequiredFailure;return h>0&&b.multiplyMe(-1),c},deltaEditConstant:function(b,c,d){a.trace&&a.fnenterprint("deltaEditConstant :"+b+", "+c+", "+d);var e=this.rows.get(c);if(null!=e)return e.constant+=b,void(e.constant<0&&this._infeasibleRows.add(c));var f=this.rows.get(d);if(null!=f)return f.constant+=-b,void(f.constant<0&&this._infeasibleRows.add(d));var g=this.columns.get(d);g||console.log("columnVars is null -- tableau is:\n"+this),g.each(function(a){var c=this.rows.get(a),e=c.coefficientFor(d);c.constant+=e*b,a.isRestricted&&c.constant<0&&this._infeasibleRows.add(a)},this)},dualOptimize:function(){a.trace&&a.fnenterprint("dualOptimize:");for(var b=this.rows.get(this._objective);this._infeasibleRows.size;){var c=this._infeasibleRows.values()[0];this._infeasibleRows["delete"](c);var d=null,e=this.rows.get(c);if(e&&e.constant<0){var f,g=Number.MAX_VALUE,h=e.terms;if(h.each(function(c,e){if(e>0&&c.isPivotable){var h=b.coefficientFor(c);f=h/e,(g>f||a.approx(f,g)&&c.hashCodeb?(e=b,g=a,{brk:1}):void 0},this),e>=-d)return;a.trace&&console.log("entryVar:",g,"objectiveCoeff:",e);var i=Number.MAX_VALUE,j=this.columns.get(g),k=0;if(j.each(function(b){if(a.trace&&a.traceprint("Checking "+b),b.isPivotable){var c=this.rows.get(b),d=c.coefficientFor(g);a.trace&&a.traceprint("pivotable, coeff = "+d),0>d&&(k=-c.constant/d,(i>k||a.approx(k,i)&&b.hashCoded;d++){var e=this.rows.get(b[d]);null===e&&(e=this.rows.get(this._stayMinusErrorVars[d])),null!=e&&(e.constant=0)}},_setExternalVariables:function(){a.trace&&a.fnenterprint("_setExternalVariables:"),a.trace&&a.traceprint(this.toString());var b={};this._externalParametricVars.each(function(c){null!=this.rows.get(c)?a.trace&&console.log("Error: variable"+c+" in _externalParametricVars is basic"):(c.value=0,b[c.name]=0)},this),this._externalRows.each(function(a){var c=this.rows.get(a);a.value!=c.constant&&(a.value=c.constant,b[a.name]=c.constant)},this),this._changed=b,this._needsSolving=!1,this._informCallbacks(),this.onsolved()},onsolved:function(){},_informCallbacks:function(){if(this._callbacks){var a=this._changed;this._callbacks.forEach(function(b){b(a)})}},_addCallback:function(a){var b=this._callbacks||(this._callbacks=[]);b[b.length]=a},insertErrorVar:function(b,c){a.trace&&a.fnenterprint("insertErrorVar:"+b+", "+c);var d=this._errorVars.get(c);d||(d=new a.HashSet,this._errorVars.set(b,d)),d.add(c)}})}(this.c||b.parent.exports||{}),function(a){"use strict";a.Timer=a.inherit({initialize:function(){this.isRunning=!1,this._elapsedMs=0},start:function(){return this.isRunning=!0,this._startReading=new Date,this},stop:function(){return this.isRunning=!1,this._elapsedMs+=new Date-this._startReading,this},reset:function(){return this.isRunning=!1,this._elapsedMs=0,this},elapsedTime:function(){return this.isRunning?(this._elapsedMs+(new Date-this._startReading))/1e3:this._elapsedMs/1e3}})}(this.c||b.parent.exports||{}),this.c.parser=function(){function a(a){return'"'+a.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E-\x1F\x80-\uFFFF]/g,escape)+'"'}var b={parse:function(b,c){function d(a){O>M||(M>O&&(O=M,P=[]),P.push(a))}function e(){var a,b,c,d,e;if(d=M,e=M,a=s(),null!==a){for(b=[],c=f();null!==c;)b.push(c),c=f();null!==b?(c=s(),null!==c?a=[a,b,c]:(a=null,M=e)):(a=null,M=e)}else a=null,M=e;return null!==a&&(a=function(a,b){return b}(d,a[1])),null===a&&(M=d),a}function f(){var a,b,c,d;return c=M,d=M,a=I(),null!==a?(b=l(),null!==b?a=[a,b]:(a=null,M=d)):(a=null,M=d),null!==a&&(a=function(a,b){return b}(c,a[0])),null===a&&(M=c),a}function g(){var a;return b.length>M?(a=b.charAt(M),M++):(a=null,0===N&&d("any character")),a}function h(){var a;return/^[a-zA-Z]/.test(b.charAt(M))?(a=b.charAt(M),M++):(a=null,0===N&&d("[a-zA-Z]")),null===a&&(36===b.charCodeAt(M)?(a="$",M++):(a=null,0===N&&d('"$"')),null===a&&(95===b.charCodeAt(M)?(a="_",M++):(a=null,0===N&&d('"_"')))),a}function i(){var a;return N++,/^[\t\x0B\f \xA0\uFEFF]/.test(b.charAt(M))?(a=b.charAt(M),M++):(a=null,0===N&&d("[\\t\\x0B\\f \\xA0\\uFEFF]")),N--,0===N&&null===a&&d("whitespace"),a}function j(){var a;return/^[\n\r\u2028\u2029]/.test(b.charAt(M))?(a=b.charAt(M),M++):(a=null,0===N&&d("[\\n\\r\\u2028\\u2029]")),a}function k(){var a;return N++,10===b.charCodeAt(M)?(a="\n",M++):(a=null,0===N&&d('"\\n"')),null===a&&("\r\n"===b.substr(M,2)?(a="\r\n",M+=2):(a=null,0===N&&d('"\\r\\n"')),null===a&&(13===b.charCodeAt(M)?(a="\r",M++):(a=null,0===N&&d('"\\r"')),null===a&&(8232===b.charCodeAt(M)?(a="\u2028",M++):(a=null,0===N&&d('"\\u2028"')),null===a&&(8233===b.charCodeAt(M)?(a="\u2029",M++):(a=null,0===N&&d('"\\u2029"')))))),N--,0===N&&null===a&&d("end of line"),a}function l(){var a,c,e;return e=M,a=s(),null!==a?(59===b.charCodeAt(M)?(c=";",M++):(c=null,0===N&&d('";"')),null!==c?a=[a,c]:(a=null,M=e)):(a=null,M=e),null===a&&(e=M,a=r(),null!==a?(c=k(),null!==c?a=[a,c]:(a=null,M=e)):(a=null,M=e),null===a&&(e=M,a=s(),null!==a?(c=m(),null!==c?a=[a,c]:(a=null,M=e)):(a=null,M=e))),a}function m(){var a,c;return c=M,N++,b.length>M?(a=b.charAt(M),M++):(a=null,0===N&&d("any character")),N--,null===a?a="":(a=null,M=c),a}function n(){var a;return N++,a=o(),null===a&&(a=q()),N--,0===N&&null===a&&d("comment"),a}function o(){var a,c,e,f,h,i,j;if(h=M,"/*"===b.substr(M,2)?(a="/*",M+=2):(a=null,0===N&&d('"/*"')),null!==a){for(c=[],i=M,j=M,N++,"*/"===b.substr(M,2)?(e="*/",M+=2):(e=null,0===N&&d('"*/"')),N--,null===e?e="":(e=null,M=j),null!==e?(f=g(),null!==f?e=[e,f]:(e=null,M=i)):(e=null,M=i);null!==e;)c.push(e),i=M,j=M,N++,"*/"===b.substr(M,2)?(e="*/",M+=2):(e=null,0===N&&d('"*/"')),N--,null===e?e="":(e=null,M=j),null!==e?(f=g(),null!==f?e=[e,f]:(e=null,M=i)):(e=null,M=i);null!==c?("*/"===b.substr(M,2)?(e="*/",M+=2):(e=null,0===N&&d('"*/"')),null!==e?a=[a,c,e]:(a=null,M=h)):(a=null,M=h)}else a=null,M=h;return a}function p(){var a,c,e,f,h,i,k;if(h=M,"/*"===b.substr(M,2)?(a="/*",M+=2):(a=null,0===N&&d('"/*"')),null!==a){for(c=[],i=M,k=M,N++,"*/"===b.substr(M,2)?(e="*/",M+=2):(e=null,0===N&&d('"*/"')),null===e&&(e=j()),N--,null===e?e="":(e=null,M=k),null!==e?(f=g(),null!==f?e=[e,f]:(e=null,M=i)):(e=null,M=i);null!==e;)c.push(e),i=M,k=M,N++,"*/"===b.substr(M,2)?(e="*/",M+=2):(e=null,0===N&&d('"*/"')),null===e&&(e=j()),N--,null===e?e="":(e=null,M=k),null!==e?(f=g(),null!==f?e=[e,f]:(e=null,M=i)):(e=null,M=i);null!==c?("*/"===b.substr(M,2)?(e="*/",M+=2):(e=null,0===N&&d('"*/"')),null!==e?a=[a,c,e]:(a=null,M=h)):(a=null,M=h)}else a=null,M=h;return a}function q(){var a,c,e,f,h,i,k;if(h=M,"//"===b.substr(M,2)?(a="//",M+=2):(a=null,0===N&&d('"//"')),null!==a){for(c=[],i=M,k=M,N++,e=j(),N--,null===e?e="":(e=null,M=k),null!==e?(f=g(),null!==f?e=[e,f]:(e=null,M=i)):(e=null,M=i);null!==e;)c.push(e),i=M,k=M,N++,e=j(),N--,null===e?e="":(e=null,M=k),null!==e?(f=g(),null!==f?e=[e,f]:(e=null,M=i)):(e=null,M=i);null!==c?(e=j(),null===e&&(e=m()),null!==e?a=[a,c,e]:(a=null,M=h)):(a=null,M=h)}else a=null,M=h;return a}function r(){var a,b;for(a=[],b=i(),null===b&&(b=p(),null===b&&(b=q()));null!==b;)a.push(b),b=i(),null===b&&(b=p(),null===b&&(b=q()));return a}function s(){var a,b;for(a=[],b=i(),null===b&&(b=k(),null===b&&(b=n()));null!==b;)a.push(b),b=i(),null===b&&(b=k(),null===b&&(b=n()));return a}function t(){var a,b;return b=M,a=v(),null===a&&(a=u()),null!==a&&(a=function(a,b){return{type:"NumericLiteral",value:b}}(b,a)),null===a&&(M=b),a}function u(){var a,c,e;if(e=M,/^[0-9]/.test(b.charAt(M))?(c=b.charAt(M),M++):(c=null,0===N&&d("[0-9]")),null!==c)for(a=[];null!==c;)a.push(c),/^[0-9]/.test(b.charAt(M))?(c=b.charAt(M),M++):(c=null,0===N&&d("[0-9]"));else a=null;return null!==a&&(a=function(a,b){return parseInt(b.join(""))}(e,a)),null===a&&(M=e),a}function v(){var a,c,e,f,g;return f=M,g=M,a=u(),null!==a?(46===b.charCodeAt(M)?(c=".",M++):(c=null,0===N&&d('"."')),null!==c?(e=u(),null!==e?a=[a,c,e]:(a=null,M=g)):(a=null,M=g)):(a=null,M=g),null!==a&&(a=function(a,b){return parseFloat(b.join(""))}(f,a)),null===a&&(M=f),a}function w(){var a,c,e,f;if(f=M,/^[\-+]/.test(b.charAt(M))?(a=b.charAt(M),M++):(a=null,0===N&&d("[\\-+]")),a=null!==a?a:"",null!==a){if(/^[0-9]/.test(b.charAt(M))?(e=b.charAt(M),M++):(e=null,0===N&&d("[0-9]")),null!==e)for(c=[];null!==e;)c.push(e),/^[0-9]/.test(b.charAt(M))?(e=b.charAt(M),M++):(e=null,0===N&&d("[0-9]"));else c=null;null!==c?a=[a,c]:(a=null,M=f)}else a=null,M=f;return a}function x(){var a,b;return N++,b=M,a=y(),null!==a&&(a=function(a,b){return b}(b,a)),null===a&&(M=b),N--,0===N&&null===a&&d("identifier"),a}function y(){var a,b,c,e,f;if(N++,e=M,f=M,a=h(),null!==a){for(b=[],c=h();null!==c;)b.push(c),c=h();null!==b?a=[a,b]:(a=null,M=f)}else a=null,M=f;return null!==a&&(a=function(a,b,c){return b+c.join("")}(e,a[0],a[1])),null===a&&(M=e),N--,0===N&&null===a&&d("identifier"),a}function z(){var a,c,e,f,g,h,i;return h=M,a=x(),null!==a&&(a=function(a,b){return{type:"Variable",name:b}}(h,a)),null===a&&(M=h),null===a&&(a=t(),null===a&&(h=M,i=M,40===b.charCodeAt(M)?(a="(",M++):(a=null,0===N&&d('"("')),null!==a?(c=s(),null!==c?(e=I(),null!==e?(f=s(),null!==f?(41===b.charCodeAt(M)?(g=")",M++):(g=null,0===N&&d('")"')),null!==g?a=[a,c,e,f,g]:(a=null,M=i)):(a=null,M=i)):(a=null,M=i)):(a=null,M=i)):(a=null,M=i),null!==a&&(a=function(a,b){return b}(h,a[2])),null===a&&(M=h))),a}function A(){var a,b,c,d,e;return a=z(),null===a&&(d=M,e=M,a=B(),null!==a?(b=s(),null!==b?(c=A(),null!==c?a=[a,b,c]:(a=null,M=e)):(a=null,M=e)):(a=null,M=e),null!==a&&(a=function(a,b,c){return{type:"UnaryExpression",operator:b,expression:c}}(d,a[0],a[2])),null===a&&(M=d)),a}function B(){var a;return 43===b.charCodeAt(M)?(a="+",M++):(a=null,0===N&&d('"+"')),null===a&&(45===b.charCodeAt(M)?(a="-",M++):(a=null,0===N&&d('"-"')),null===a&&(33===b.charCodeAt(M)?(a="!",M++):(a=null,0===N&&d('"!"')))),a}function C(){var a,b,c,d,e,f,g,h,i;if(g=M,h=M,a=A(),null!==a){for(b=[],i=M,c=s(),null!==c?(d=D(),null!==d?(e=s(),null!==e?(f=A(),null!==f?c=[c,d,e,f]:(c=null,M=i)):(c=null,M=i)):(c=null,M=i)):(c=null,M=i);null!==c;)b.push(c),i=M,c=s(),null!==c?(d=D(),null!==d?(e=s(),null!==e?(f=A(),null!==f?c=[c,d,e,f]:(c=null,M=i)):(c=null,M=i)):(c=null,M=i)):(c=null,M=i);null!==b?a=[a,b]:(a=null,M=h)}else a=null,M=h;return null!==a&&(a=function(a,b,c){for(var d=b,e=0;e="===b.substr(M,2)?(a=">=",M+=2):(a=null,0===N&&d('">="')),null===a&&(60===b.charCodeAt(M)?(a="<",M++):(a=null,0===N&&d('"<"')),null===a&&(62===b.charCodeAt(M)?(a=">",M++):(a=null,0===N&&d('">"'))))),a}function I(){var a,c,e,f,g,h,i,j,k;if(i=M,j=M,a=G(),null!==a){for(c=[],k=M,e=s(),null!==e?("=="===b.substr(M,2)?(f="==",M+=2):(f=null,0===N&&d('"=="')),null!==f?(g=s(),null!==g?(h=G(),null!==h?e=[e,f,g,h]:(e=null,M=k)):(e=null,M=k)):(e=null,M=k)):(e=null,M=k);null!==e;)c.push(e),k=M,e=s(),null!==e?("=="===b.substr(M,2)?(f="==",M+=2):(f=null,0===N&&d('"=="')),null!==f?(g=s(),null!==g?(h=G(),null!==h?e=[e,f,g,h]:(e=null,M=k)):(e=null,M=k)):(e=null,M=k)):(e=null,M=k);null!==c?a=[a,c]:(a=null,M=j)}else a=null,M=j;return null!==a&&(a=function(a,b,c){for(var d=b,e=0;em;m++)k=q[m],h=h.concat(d(k).commands);if(c.length>0&&i.selectors.length>0){for(j="",r=i.selectors,e=n=0,p=r.length;p>n;e=++n)l=r[e],j+=l,e!==i.selectors.length-1&&(j+=", ");j+=" {}",f=d(j).commands[0],f[2]=c,h.push(f),("undefined"!=typeof window&&null!==window&&null!=(s=window.GSS)?s.console:void 0)&&window.GSS.console.row("@"+a,i.statements.concat([j]),b)}return{commands:h}},j=function(a,b,c){var e,f,g,h,j;for(null==c&&(c=[]),e=[],g=i.parse("@"+a+" "+b),h=0,j=g.length;j>h;h++)f=g[h],e=e.concat(d(f).commands);return{commands:c.concat(e)}},e.hooks={directives:{h:h,v:h,horizontal:h,vertical:h,"grid-template":j,"grid-rows":j,"grid-cols":j}},b.exports={parse:d,scope:f}},{"../lib/parser":5,"../lib/scoper":6,"./parser":5,"./scoper":6,"error-reporter":7,"vfl-compiler":10,"vgl-compiler":8}],4:[function(a,b){var c,d;d=function(a){var b,c,e,f;for(b=[],e=0,f=a.length;f>e;e++)c=a[e],"object"!=typeof c?b.push(c):c instanceof Array&&b.push(d(c));return b},c=function(){function a(a,b,c,d){this.parser=a,this._lineNumber=b,this._columnNumber=c,this._Error=d()}return a._toString=function(a){return"[object String]"===Object.prototype.toString.call(a)?a:"[object Array]"===Object.prototype.toString.call(a)?a.join(""):""},a._unpack2DExpression=function(a){var b,c,d,e,f,g,h;if(d={"bottom-left":["left","bottom"],"bottom-right":["right","bottom"],center:["center-x","center-y"],"intrinsic-size":["intrinsic-width","intrinsic-height"],position:["x","y"],size:["width","height"],"top-left":["left","top"],"top-right":["right","top"]},b=[a],f=a[2],e=d[f],null!=e)for(b=[],g=0,h=e.length;h>g;g++)c=e[g],a=a.slice(),a[2]=c,b.push(a);return b},a.prototype._Error=null,a.prototype._columnNumber=function(){},a.prototype._lineNumber=function(){},a.prototype.reverseFilterNest=function(a){var b,c,e,f,g,h,i,j,k,l;for(f=a.length,b=f-1;b>0;){if(g=a[b],c=a[b-1],","===g[0]){for(i=[","],l=g.slice(1,g.length),j=0,k=l.length;k>j;j++)h=l[j],e=d(c),i.push(this.reverseFilterNest([e,h]));a[b]=i}else"$pseudo"===g[0]&&","===c[0]?"first"===g[1]&&"virtual"===c[1][0]?a[b]=c[1]:"last"===g[1]&&"virtual"===c[c.length-1][0]&&(a[b]=c[c.length-1]):g.splice(1,0,c);b--}return a[f-1]},a.prototype.nestedDualTermCommands=function(a,b){var c,d,e,f,g;for(e=a,c=f=0,g=b.length;g>f;c=++f)d=b[c],e=[b[c][1],e,b[c][3]];return e},a.prototype.createSelectorCommaCommand=function(a,b){var c,d,e,f,g,h;for(e=","===a[0]?a:[",",a],c=g=0,h=b.length;h>g;c=++g)d=b[c],f=b[c][3],","===f[0]?(f.splice(0,1),e=e.concat(f)):e.push(f);return e},a.prototype.mergeCommands=function(a){var b,c,d,e;for(b=[],d=0,e=a.length;e>d;d++)c=a[d],b=b.concat(c.commands);return{commands:b}},a.prototype.splatifyIfNeeded=function(a,b){return b.splats?this.splatExpander(a,b):[a,b]},a.prototype.splatExpander=function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w;for(n=b.splats,k=b.postfix,i=null,p=0,t=n.length;t>p;p++){for(m=n[p],l=m.prefix,f=m.from,o=m.to,e=[],g=f;o>=g;)e.push(l+g),g++;if(i){for(j=[],q=0,u=i.length;u>q;q++)for(h=i[q],r=0,v=e.length;v>r;r++)d=e[r],j.push(h+d);i=j}else i=e}for(c=[","],s=0,w=i.length;w>s;s++)h=i[s],k&&(h+=k),c.push([a,h]);return c},a.prototype.constraint=function(b,c,d){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s;for(f=[],g=b,(null==d||0===d.length)&&(d=[]),j=p=0,r=c.length;r>p;j=++p){for(k=c[j],l=c[j][1],m=c[j][3],i=a._unpack2DExpression(g),o=a._unpack2DExpression(m),i.length>o.length?o.push(o[0]):i.lengthq;j=++q)n=o[j],h=i[j],null!=h&&null!=n&&(e=[l,h,n].concat(d),f.push(e));g=m}return{commands:f}},a.prototype.inlineConstraint=function(a,b,c){var d;return a=a.join("").trim(),c=c.join("").trim(),d=this.parser.parse("&["+a+"] "+b+" "+c)},a.prototype.inlineSet=function(a,b){var c;return a=a.join("").trim(),b=b.join("").trim(),c=[["set",a,b]],{commands:c}},a.prototype.directive=function(a,b,c){var d,e;return(e=this.parser.hooks.directives[a])?e(a,b,c):(d=["directive",a,b],c&&d.push(c),{commands:[d]})},a.prototype.variable=function(b,c,d){var e,f;if(f=a._toString(d),null!=c&&0!==c.length){switch(f){case"left":f="x";break;case"top":f="y";break;case"cx":f="center-x";break;case"cy":f="center-y"}if(-1!==c.toString().indexOf("::window"))switch(f){case"right":f="width";break;case"bottom":f="height"}}return e=null!=c?["get",c,f]:["get",f],b?["-",0,e]:e},a.prototype.integer=function(a){return parseInt(a.join(""),10)},a.prototype.signedInteger=function(a,b){return null==b&&(b=0),parseInt(""+a+b,10)},a.prototype.signedReal=function(a,b){return null==b&&(b=0),parseFloat(""+a+b)},a.prototype.selector=function(){return{id:function(b){var c;return c=a._toString(b),["$id",c]},virtual:function(b){var c;return c=a._toString(b),["virtual",c]},"class":function(b){var c;return c=a._toString(b),["$class",c]},tag:function(b){var c;return c=a._toString(b),["$tag",c]},all:function(b){var c;return c=a._toString(b),["$all",c]}}},a.prototype.querySelectorAllParts=function(){return{withoutParens:function(b){return a._toString(b)},withParens:function(b){var c;return c=a._toString(b),"("+c+")"}}},a.prototype.strengthAndWeight=function(){var a=this;return{valid:function(a,b){return null==b||0===b.length?[a]:[a,b]},invalid:function(){throw new a._Error("Invalid Strength or Weight",null,null,null,a._lineNumber(),a._columnNumber())}}},a.prototype.virtualElement=function(a){return{commands:[["virtual"].concat(a)]}},a.prototype.stay=function(b){var c,d,e,f,g,h,i,j;for(h=["stay"].concat(b),f=a._unpack2DExpression(h[1]),d=[],g=i=0,j=f.length;j>i;g=++i)e=f[g],c=h.slice(),c[1]=f[g],d.push(c);return{commands:d}},a.prototype.stayVariable=function(a){return a},a.prototype.conditional=function(a){var b;return b=[a],{commands:b}},a}(),b.exports=c},{}],5:[function(a,b){b.exports=function(){function b(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}function c(a,b,c,d,e,f){this.message=a,this.expected=b,this.found=c,this.offset=d,this.line=e,this.column=f,this.name="SyntaxError"}function d(b){function d(){return f(vi).line}function e(){return f(vi).column}function f(a){function c(a,c,d){var e,f;for(e=c;d>e;e++)f=b.charAt(e),"\n"===f?(a.seenCR||a.line++,a.column=1,a.seenCR=!1):"\r"===f||"\u2028"===f||"\u2029"===f?(a.line++,a.column=1,a.seenCR=!0):(a.column++,a.seenCR=!1)}return wi!==a&&(wi>a&&(wi=0,xi={line:1,column:1,seenCR:!1}),c(xi,wi,a),wi=a),xi}function g(a){yi>ui||(ui>yi&&(yi=ui,zi=[]),zi.push(a))}function h(a,d,e){function g(a){var b=1;for(a.sort(function(a,b){return a.descriptionb.description?1:0});b1?g.slice(0,-1).join(", ")+" or "+g[a.length-1]:g[0],e=b?'"'+c(b)+'"':"end of input","Expected "+d+" but "+e+" found."}var i=f(e),j=eui?(a=b.charAt(ui),ui++):(a=Qb,0===Ai&&g(vf)),a}function V(){var a,c;return Ai++,xf.test(b.charAt(ui))?(a=b.charAt(ui),ui++):(a=Qb,0===Ai&&g(yf)),Ai--,a===Qb&&(c=Qb,0===Ai&&g(wf)),a}function W(){var a;return zf.test(b.charAt(ui))?(a=b.charAt(ui),ui++):(a=Qb,0===Ai&&g(Af)),a}function X(){var a,c;return Ai++,10===b.charCodeAt(ui)?(a=Cf,ui++):(a=Qb,0===Ai&&g(Df)),a===Qb&&(b.substr(ui,2)===Ef?(a=Ef,ui+=2):(a=Qb,0===Ai&&g(Ff)),a===Qb&&(13===b.charCodeAt(ui)?(a=Gf,ui++):(a=Qb,0===Ai&&g(Hf)),a===Qb&&(8232===b.charCodeAt(ui)?(a=If,ui++):(a=Qb,0===Ai&&g(Jf)),a===Qb&&(8233===b.charCodeAt(ui)?(a=Kf,ui++):(a=Qb,0===Ai&&g(Lf)))))),Ai--,a===Qb&&(c=Qb,0===Ai&&g(Bf)),a}function Y(){var a,c,d;return a=ui,c=db(),c!==Qb?(59===b.charCodeAt(ui)?(d=xc,ui++):(d=Qb,0===Ai&&g(yc)),d!==Qb?(c=[c,d],a=c):(ui=a,a=Tb)):(ui=a,a=Tb),a===Qb&&(a=ui,c=cb(),c!==Qb?(d=X(),d!==Qb?(c=[c,d],a=c):(ui=a,a=Tb)):(ui=a,a=Tb),a===Qb&&(a=ui,c=db(),c!==Qb?(d=Z(),d!==Qb?(c=[c,d],a=c):(ui=a,a=Tb)):(ui=a,a=Tb))),a}function Z(){var a,c;return a=ui,Ai++,b.length>ui?(c=b.charAt(ui),ui++):(c=Qb,0===Ai&&g(vf)),Ai--,c===Qb?a=wc:(ui=a,a=Tb),a}function $(){var a,b;return Ai++,a=_(),a===Qb&&(a=bb()),Ai--,a===Qb&&(b=Qb,0===Ai&&g(Mf)),a}function _(){var a,c,d,e,f,h;if(a=ui,b.substr(ui,2)===Nf?(c=Nf,ui+=2):(c=Qb,0===Ai&&g(Of)),c!==Qb){for(d=[],e=ui,f=ui,Ai++,b.substr(ui,2)===Pf?(h=Pf,ui+=2):(h=Qb,0===Ai&&g(Qf)),Ai--,h===Qb?f=wc:(ui=f,f=Tb),f!==Qb?(h=U(),h!==Qb?(f=[f,h],e=f):(ui=e,e=Tb)):(ui=e,e=Tb);e!==Qb;)d.push(e),e=ui,f=ui,Ai++,b.substr(ui,2)===Pf?(h=Pf,ui+=2):(h=Qb,0===Ai&&g(Qf)),Ai--,h===Qb?f=wc:(ui=f,f=Tb),f!==Qb?(h=U(),h!==Qb?(f=[f,h],e=f):(ui=e,e=Tb)):(ui=e,e=Tb);d!==Qb?(b.substr(ui,2)===Pf?(e=Pf,ui+=2):(e=Qb,0===Ai&&g(Qf)),e!==Qb?(c=[c,d,e],a=c):(ui=a,a=Tb)):(ui=a,a=Tb)}else ui=a,a=Tb;return a}function ab(){var a,c,d,e,f,h;if(a=ui,b.substr(ui,2)===Nf?(c=Nf,ui+=2):(c=Qb,0===Ai&&g(Of)),c!==Qb){for(d=[],e=ui,f=ui,Ai++,b.substr(ui,2)===Pf?(h=Pf,ui+=2):(h=Qb,0===Ai&&g(Qf)),h===Qb&&(h=W()),Ai--,h===Qb?f=wc:(ui=f,f=Tb),f!==Qb?(h=U(),h!==Qb?(f=[f,h],e=f):(ui=e,e=Tb)):(ui=e,e=Tb);e!==Qb;)d.push(e),e=ui,f=ui,Ai++,b.substr(ui,2)===Pf?(h=Pf,ui+=2):(h=Qb,0===Ai&&g(Qf)),h===Qb&&(h=W()),Ai--,h===Qb?f=wc:(ui=f,f=Tb),f!==Qb?(h=U(),h!==Qb?(f=[f,h],e=f):(ui=e,e=Tb)):(ui=e,e=Tb);d!==Qb?(b.substr(ui,2)===Pf?(e=Pf,ui+=2):(e=Qb,0===Ai&&g(Qf)),e!==Qb?(c=[c,d,e],a=c):(ui=a,a=Tb)):(ui=a,a=Tb)}else ui=a,a=Tb;return a}function bb(){var a,c,d,e,f,h;if(a=ui,b.substr(ui,2)===Rf?(c=Rf,ui+=2):(c=Qb,0===Ai&&g(Sf)),c!==Qb){for(d=[],e=ui,f=ui,Ai++,h=W(),Ai--,h===Qb?f=wc:(ui=f,f=Tb),f!==Qb?(h=U(),h!==Qb?(f=[f,h],e=f):(ui=e,e=Tb)):(ui=e,e=Tb);e!==Qb;)d.push(e),e=ui,f=ui,Ai++,h=W(),Ai--,h===Qb?f=wc:(ui=f,f=Tb),f!==Qb?(h=U(),h!==Qb?(f=[f,h],e=f):(ui=e,e=Tb)):(ui=e,e=Tb);d!==Qb?(e=W(),e===Qb&&(e=Z()),e!==Qb?(c=[c,d,e],a=c):(ui=a,a=Tb)):(ui=a,a=Tb)}else ui=a,a=Tb;return a}function cb(){var a,b;for(a=[],b=V(),b===Qb&&(b=ab(),b===Qb&&(b=bb()));b!==Qb;)a.push(b),b=V(),b===Qb&&(b=ab(),b===Qb&&(b=bb()));return a}function db(){var a,b;for(a=[],b=V(),b===Qb&&(b=X(),b===Qb&&(b=$()));b!==Qb;)a.push(b),b=V(),b===Qb&&(b=X(),b===Qb&&(b=$()));return a}function eb(){var a,b,c;return a=ui,b=jb(),b!==Qb?(c=fb(),c!==Qb?(vi=a,b=Tf(b,c),a=b):(ui=a,a=Tb)):(ui=a,a=Tb),a===Qb&&(a=fb(),a===Qb&&(a=ui,b=ib(),b!==Qb?(c=cb(),c!==Qb?(vi=a,b=Uf(b),a=b):(ui=a,a=Tb)):(ui=a,a=Tb))),a}function fb(){var a,c,d,e,f,h;return a=ui,40===b.charCodeAt(ui)?(c=Ud,ui++):(c=Qb,0===Ai&&g(Vd)),c!==Qb?(d=db(),d!==Qb?(e=gb(),e!==Qb?(f=db(),f!==Qb?(41===b.charCodeAt(ui)?(h=Wd,ui++):(h=Qb,0===Ai&&g(Xd)),h!==Qb?(vi=a,c=Vf(e),a=c):(ui=a,a=Tb)):(ui=a,a=Tb)):(ui=a,a=Tb)):(ui=a,a=Tb)):(ui=a,a=Tb),a}function gb(){var a,c,d,e,f,h,i,j;if(a=ui,c=hb(),c!==Qb){if(d=[],e=ui,f=db(),f!==Qb?(44===b.charCodeAt(ui)?(h=Wf,ui++):(h=Qb,0===Ai&&g(Xf)),h!==Qb?(i=db(),i!==Qb?(j=hb(),j!==Qb?(f=[f,h,i,j],e=f):(ui=e,e=Tb)):(ui=e,e=Tb)):(ui=e,e=Tb)):(ui=e,e=Tb),e!==Qb)for(;e!==Qb;)d.push(e),e=ui,f=db(),f!==Qb?(44===b.charCodeAt(ui)?(h=Wf,ui++):(h=Qb,0===Ai&&g(Xf)),h!==Qb?(i=db(),i!==Qb?(j=hb(),j!==Qb?(f=[f,h,i,j],e=f):(ui=e,e=Tb)):(ui=e,e=Tb)):(ui=e,e=Tb)):(ui=e,e=Tb);else d=Tb;d!==Qb?(vi=a,c=Yf(c,d),a=c):(ui=a,a=Tb)}else ui=a,a=Tb;return a===Qb&&(a=hb()),a}function hb(){var a,b,c;if(a=ui,b=[],c=nb(),c!==Qb)for(;c!==Qb;)b.push(c),c=nb();else b=Tb;return b!==Qb&&(vi=a,b=Zf(b)),a=b}function ib(){var a,b,c;if(a=ui,b=[],c=lb(),c!==Qb)for(;c!==Qb;)b.push(c),c=lb();else b=Tb;return b!==Qb&&(vi=a,b=Zf(b)),a=b}function jb(){var a,b,c;if(a=ui,b=[],c=kb(),c!==Qb)for(;c!==Qb;)b.push(c),c=kb();else b=Tb;return b!==Qb&&(vi=a,b=Zf(b)),a=b}function kb(){var a,b;return Ai++,a=zb(),a===Qb&&(a=tb(),a===Qb&&(a=vb(),a===Qb&&(a=wb(),a===Qb&&(a=xb(),a===Qb&&(a=yb(),a===Qb&&(a=Bb())))))),Ai--,a===Qb&&(b=Qb,0===Ai&&g($f)),a}function lb(){var a,b;return Ai++,a=kb(),a===Qb&&(a=fb()),Ai--,a===Qb&&(b=Qb,0===Ai&&g(_f)),a}function mb(){var a;return a=lb(),a===Qb&&(a=Db()),a}function nb(){var a,b;return a=mb(),a===Qb&&(a=ui,b=ob(),b!==Qb&&(vi=a,b=ag(b)),a=b),a}function ob(){var a,c,d,e;if(Ai++,a=ui,c=cb(),c!==Qb){if(d=[],cg.test(b.charAt(ui))?(e=b.charAt(ui),ui++):(e=Qb,0===Ai&&g(dg)),e!==Qb)for(;e!==Qb;)d.push(e),cg.test(b.charAt(ui))?(e=b.charAt(ui),ui++):(e=Qb,0===Ai&&g(dg));else d=Tb;d!==Qb?(e=cb(),e!==Qb?(vi=a,c=eg(d),a=c):(ui=a,a=Tb)):(ui=a,a=Tb)}else ui=a,a=Tb;if(a===Qb){if(a=ui,c=[],32===b.charCodeAt(ui)?(d=Ge,ui++):(d=Qb,0===Ai&&g(He)),d!==Qb)for(;d!==Qb;)c.push(d),32===b.charCodeAt(ui)?(d=Ge,ui++):(d=Qb,0===Ai&&g(He));else c=Tb;c!==Qb?(d=ui,Ai++,fg.test(b.charAt(ui))?(e=b.charAt(ui),ui++):(e=Qb,0===Ai&&g(gg)),Ai--,e!==Qb?(ui=d,d=wc):d=Tb,d!==Qb?(vi=a,c=hg(),a=c):(ui=a,a=Tb)):(ui=a,a=Tb)}return Ai--,a===Qb&&(c=Qb,0===Ai&&g(bg)),a}function pb(){var a,b,c,d;if(a=ui,b=[],c=qb(),c!==Qb)for(;c!==Qb;)b.push(c),c=qb();else b=Tb;if(b!==Qb){for(c=[],d=sb();d!==Qb;)c.push(d),d=sb();c!==Qb?(vi=a,b=ig(b,c),a=b):(ui=a,a=Tb)}else ui=a,a=Tb;return a}function qb(){var a,b,c;if(Ai++,a=ui,b=[],c=sb(),c!==Qb)for(;c!==Qb;)b.push(c),c=sb();else b=Tb;return b!==Qb?(c=rb(),c!==Qb?(vi=a,b=kg(b,c),a=b):(ui=a,a=Tb)):(ui=a,a=Tb),Ai--,a===Qb&&(b=Qb,0===Ai&&g(jg)),a}function rb(){var a,c,d,e,f;if(Ai++,a=ui,c=[],lf.test(b.charAt(ui))?(d=b.charAt(ui),ui++):(d=Qb,0===Ai&&g(mf)),d!==Qb)for(;d!==Qb;)c.push(d),lf.test(b.charAt(ui))?(d=b.charAt(ui),ui++):(d=Qb,0===Ai&&g(mf));else c=Tb;if(c!==Qb)if(b.substr(ui,3)===mg?(d=mg,ui+=3):(d=Qb,0===Ai&&g(ng)),d!==Qb){if(e=[],lf.test(b.charAt(ui))?(f=b.charAt(ui),ui++):(f=Qb,0===Ai&&g(mf)),f!==Qb)for(;f!==Qb;)e.push(f),lf.test(b.charAt(ui))?(f=b.charAt(ui),ui++):(f=Qb,0===Ai&&g(mf));else e=Tb;e!==Qb?(vi=a,c=og(c,e),a=c):(ui=a,a=Tb)}else ui=a,a=Tb;else ui=a,a=Tb;return Ai--,a===Qb&&(c=Qb,0===Ai&&g(lg)),a}function sb(){var a,b,c;return a=ui,b=ui,Ai++,c=rb(),Ai--,c===Qb?b=wc:(ui=b,b=Tb),b!==Qb?(c=Fb(),c!==Qb?(vi=a,b=pg(c),a=b):(ui=a,a=Tb)):(ui=a,a=Tb),a}function tb(){var a,c,d,e;return a=ui,qg.test(b.charAt(ui))?(c=b.charAt(ui),ui++):(c=Qb,0===Ai&&g(rg)),c!==Qb?(d=pb(),d===Qb&&(d=ub()),d!==Qb?(qg.test(b.charAt(ui))?(e=b.charAt(ui),ui++):(e=Qb,0===Ai&&g(rg)),e!==Qb?(vi=a,c=sg(d),a=c):(ui=a,a=Tb)):(ui=a,a=Tb)):(ui=a,a=Tb),a}function ub(){var a,c,d;if(a=ui,c=[],tg.test(b.charAt(ui))?(d=b.charAt(ui),ui++):(d=Qb,0===Ai&&g(ug)),d!==Qb)for(;d!==Qb;)c.push(d),tg.test(b.charAt(ui))?(d=b.charAt(ui),ui++):(d=Qb,0===Ai&&g(ug));else c=Tb;return c!==Qb&&(vi=a,c=vg(c)),a=c}function vb(){var a,c;return a=ui,c=Eb(),c!==Qb&&(vi=a,c=wg(c)),a=c,a===Qb&&(a=ui,42===b.charCodeAt(ui)?(c=Od,ui++):(c=Qb,0===Ai&&g(Pd)),c!==Qb&&(vi=a,c=xg()),a=c),a}function wb(){var a,c,d;return a=ui,35===b.charCodeAt(ui)?(c=yg,ui++):(c=Qb,0===Ai&&g(zg)),c!==Qb?(d=pb(),d===Qb&&(d=Eb()),d!==Qb?(vi=a,c=Ag(d),a=c):(ui=a,a=Tb)):(ui=a,a=Tb),a}function xb(){var a,c,d;return a=ui,46===b.charCodeAt(ui)?(c=rf,ui++):(c=Qb,0===Ai&&g(sf)),c!==Qb?(d=pb(),d===Qb&&(d=Eb()),d!==Qb?(vi=a,c=Bg(d),a=c):(ui=a,a=Tb)):(ui=a,a=Tb),a}function yb(){var a,b;return a=ui,b=Ab(),b!==Qb&&(vi=a,b=Cg(b)),a=b}function zb(){var a,c,d,e;if(a=ui,36===b.charCodeAt(ui)?(c=Dg,ui++):(c=Qb,0===Ai&&g(Eg)),c!==Qb&&(vi=a,c=Fg()),a=c,a===Qb&&(a=ui,38===b.charCodeAt(ui)?(c=Gg,ui++):(c=Qb,0===Ai&&g(Hg)),c!==Qb?(d=ui,Ai++,Ig.test(b.charAt(ui))?(e=b.charAt(ui),ui++):(e=Qb,0===Ai&&g(Jg)),Ai--,e!==Qb?(ui=d,d=wc):d=Tb,d!==Qb?(vi=a,c=Kg(),a=c):(ui=a,a=Tb)):(ui=a,a=Tb),a===Qb)){if(a=ui,c=[],94===b.charCodeAt(ui)?(d=Lg,ui++):(d=Qb,0===Ai&&g(Mg)),d!==Qb)for(;d!==Qb;)c.push(d),94===b.charCodeAt(ui)?(d=Lg,ui++):(d=Qb,0===Ai&&g(Mg));else c=Tb;c!==Qb&&(vi=a,c=Ng(c)),a=c}return a}function Ab(){var a,c;return b.substr(ui,10)===Og?(a=Og,ui+=10):(a=Qb,0===Ai&&g(Pg)),a===Qb&&(b.substr(ui,6)===Qg?(a=Qg,ui+=6):(a=Qb,0===Ai&&g(Rg)),a===Qb&&(b.substr(ui,7)===Sg?(a=Sg,ui+=7):(a=Qb,0===Ai&&g(Tg)),a===Qb&&(b.substr(ui,8)===Ug?(a=Ug,ui+=8):(a=Qb,0===Ai&&g(Vg))))),a===Qb&&(a=ui,b.substr(ui,8)===Wg?(c=Wg,ui+=8):(c=Qb,0===Ai&&g(Xg)),c===Qb&&(b.substr(ui,10)===Yg?(c=Yg,ui+=10):(c=Qb,0===Ai&&g(Zg))),c!==Qb&&(vi=a,c=$g()),a=c,a===Qb&&(a=ui,b.substr(ui,6)===_g?(c=_g,ui+=6):(c=Qb,0===Ai&&g(ah)),c===Qb&&(b.substr(ui,2)===bh?(c=bh,ui+=2):(c=Qb,0===Ai&&g(ch))),c!==Qb&&(vi=a,c=dh()),a=c)),a}function Bb(){var a,c,d,e;return a=ui,b.substr(ui,2)===bh?(c=bh,ui+=2):(c=Qb,0===Ai&&g(ch)),c===Qb&&(58===b.charCodeAt(ui)?(c=sc,ui++):(c=Qb,0===Ai&&g(tc))),c!==Qb?(d=Eb(),d!==Qb?(e=Cb(),e===Qb&&(e=kc),e!==Qb?(vi=a,c=eh(c,d,e),a=c):(ui=a,a=Tb)):(ui=a,a=Tb)):(ui=a,a=Tb),a}function Cb(){var a,c,d,e;if(a=ui,40===b.charCodeAt(ui)?(c=Ud,ui++):(c=Qb,0===Ai&&g(Vd)),c!==Qb){for(d=[],fh.test(b.charAt(ui))?(e=b.charAt(ui),ui++):(e=Qb,0===Ai&&g(gh));e!==Qb;)d.push(e),fh.test(b.charAt(ui))?(e=b.charAt(ui),ui++):(e=Qb,0===Ai&&g(gh));d!==Qb?(41===b.charCodeAt(ui)?(e=Wd,ui++):(e=Qb,0===Ai&&g(Xd)),e!==Qb?(vi=a,c=hh(d),a=c):(ui=a,a=Tb)):(ui=a,a=Tb)}else ui=a,a=Tb;return a}function Db(){var a,c,d,e,f,h;if(a=ui,91===b.charCodeAt(ui)?(c=le,ui++):(c=Qb,0===Ai&&g(me)),c!==Qb){if(d=[],ih.test(b.charAt(ui))?(e=b.charAt(ui),ui++):(e=Qb,0===Ai&&g(jh)),e!==Qb)for(;e!==Qb;)d.push(e),ih.test(b.charAt(ui))?(e=b.charAt(ui),ui++):(e=Qb,0===Ai&&g(jh));else d=Tb;if(d!==Qb){if(e=[],kh.test(b.charAt(ui))?(f=b.charAt(ui),ui++):(f=Qb,0===Ai&&g(lh)),f!==Qb)for(;f!==Qb;)e.push(f),kh.test(b.charAt(ui))?(f=b.charAt(ui),ui++):(f=Qb,0===Ai&&g(lh));else e=Tb;if(e!==Qb){if(f=[],mh.test(b.charAt(ui))?(h=b.charAt(ui),ui++):(h=Qb,0===Ai&&g(nh)),h!==Qb)for(;h!==Qb;)f.push(h),mh.test(b.charAt(ui))?(h=b.charAt(ui),ui++):(h=Qb,0===Ai&&g(nh));else f=Tb;f!==Qb?(93===b.charCodeAt(ui)?(h=ne,ui++):(h=Qb,0===Ai&&g(oe)),h!==Qb?(vi=a,c=oh(d,e,f),a=c):(ui=a,a=Tb)):(ui=a,a=Tb)}else ui=a,a=Tb}else ui=a,a=Tb}else ui=a,a=Tb;if(a===Qb)if(a=ui,91===b.charCodeAt(ui)?(c=le,ui++):(c=Qb,0===Ai&&g(me)),c!==Qb){if(d=[],mh.test(b.charAt(ui))?(e=b.charAt(ui),ui++):(e=Qb,0===Ai&&g(nh)),e!==Qb)for(;e!==Qb;)d.push(e),mh.test(b.charAt(ui))?(e=b.charAt(ui),ui++):(e=Qb,0===Ai&&g(nh));else d=Tb;d!==Qb?(93===b.charCodeAt(ui)?(e=ne,ui++):(e=Qb,0===Ai&&g(oe)),e!==Qb?(vi=a,c=ph(d),a=c):(ui=a,a=Tb)):(ui=a,a=Tb)}else ui=a,a=Tb;return a}function Eb(){var a,b,c;if(a=ui,b=[],c=Fb(),c!==Qb)for(;c!==Qb;)b.push(c),c=Fb();else b=Tb;return b!==Qb&&(vi=a,b=qh(b)),a=b}function Fb(){var a;return Ae.test(b.charAt(ui))?(a=b.charAt(ui),ui++):(a=Qb,0===Ai&&g(Be)),a}function Gb(){var a,c,d,e;return Ai++,a=ui,33===b.charCodeAt(ui)?(c=sh,ui++):(c=Qb,0===Ai&&g(th)),c!==Qb?(d=Ib(),d!==Qb?(e=Hb(),e===Qb&&(e=kc),e!==Qb?(vi=a,c=uh(d,e),a=c):(ui=a,a=Tb)):(ui=a,a=Tb)):(ui=a,a=Tb),a===Qb&&(a=ui,33===b.charCodeAt(ui)?(c=sh,ui++):(c=Qb,0===Ai&&g(th)),c!==Qb?(b.length>ui?(d=b.charAt(ui),ui++):(d=Qb,0===Ai&&g(vf)),d===Qb&&(d=kc),d!==Qb?(vi=a,c=vh(),a=c):(ui=a,a=Tb)):(ui=a,a=Tb)),Ai--,a===Qb&&(c=Qb,0===Ai&&g(rh)),a}function Hb(){var a,c,d;if(a=ui,c=[],lf.test(b.charAt(ui))?(d=b.charAt(ui),ui++):(d=Qb,0===Ai&&g(mf)),d!==Qb)for(;d!==Qb;)c.push(d),lf.test(b.charAt(ui))?(d=b.charAt(ui),ui++):(d=Qb,0===Ai&&g(mf));else c=Tb;return c!==Qb&&(vi=a,c=wh(c)),a=c}function Ib(){var a,c,d;if(a=ui,b.substr(ui,8)===xh?(c=xh,ui+=8):(c=Qb,0===Ai&&g(yh)),c===Qb&&(b.substr(ui,8)===zh?(c=zh,ui+=8):(c=Qb,0===Ai&&g(Ah)),c===Qb&&(b.substr(ui,8)===Bh?(c=Bh,ui+=8):(c=Qb,0===Ai&&g(Ch)))),c!==Qb&&(vi=a,c=Dh()),a=c,a===Qb&&(a=ui,b.substr(ui,7)===Eh?(c=Eh,ui+=7):(c=Qb,0===Ai&&g(Fh)),c===Qb&&(b.substr(ui,7)===Gh?(c=Gh,ui+=7):(c=Qb,0===Ai&&g(Hh)),c===Qb&&(b.substr(ui,7)===Ih?(c=Ih,ui+=7):(c=Qb,0===Ai&&g(Jh)))),c!==Qb&&(vi=a,c=Dh()),a=c,a===Qb&&(a=ui,b.substr(ui,6)===Kh?(c=Kh,ui+=6):(c=Qb,0===Ai&&g(Lh)),c===Qb&&(b.substr(ui,6)===Mh?(c=Mh,ui+=6):(c=Qb,0===Ai&&g(Nh)),c===Qb&&(b.substr(ui,6)===Oh?(c=Oh,ui+=6):(c=Qb,0===Ai&&g(Ph)))),c!==Qb&&(vi=a,c=Qh()),a=c,a===Qb&&(a=ui,b.substr(ui,6)===Rh?(c=Rh,ui+=6):(c=Qb,0===Ai&&g(Sh)),c===Qb&&(b.substr(ui,6)===Th?(c=Th,ui+=6):(c=Qb,0===Ai&&g(Uh)),c===Qb&&(b.substr(ui,6)===Vh?(c=Vh,ui+=6):(c=Qb,0===Ai&&g(Wh)))),c!==Qb&&(vi=a,c=Xh()),a=c,a===Qb&&(a=ui,b.substr(ui,4)===Yh?(c=Yh,ui+=4):(c=Qb,0===Ai&&g(Zh)),c===Qb&&(b.substr(ui,4)===$h?(c=$h,ui+=4):(c=Qb,0===Ai&&g(_h)),c===Qb&&(b.substr(ui,4)===ai?(c=ai,ui+=4):(c=Qb,0===Ai&&g(bi)))),c!==Qb&&(vi=a,c=ci()),a=c,a===Qb))))){if(a=ui,c=[],di.test(b.charAt(ui))?(d=b.charAt(ui),ui++):(d=Qb,0===Ai&&g(ei)),d!==Qb)for(;d!==Qb;)c.push(d),di.test(b.charAt(ui))?(d=b.charAt(ui),ui++):(d=Qb,0===Ai&&g(ei));else c=Tb;c!==Qb&&(vi=a,c=fi(c)),a=c}return a}function Jb(){var a,c,d,e,f,h;if(a=ui,64===b.charCodeAt(ui)?(c=Fc,ui++):(c=Qb,0===Ai&&g(Gc)),c!==Qb)if(b.substr(ui,12)===gi?(d=gi,ui+=12):(d=Qb,0===Ai&&g(hi)),d===Qb&&(b.substr(ui,7)===ii?(d=ii,ui+=7):(d=Qb,0===Ai&&g(ji))),d!==Qb)if(e=db(),e!==Qb){if(f=[],h=Kb(),h!==Qb)for(;h!==Qb;)f.push(h),h=Kb();else f=Tb;f!==Qb?(vi=a,c=ki(f),a=c):(ui=a,a=Tb)}else ui=a,a=Tb;else ui=a,a=Tb;else ui=a,a=Tb;return a}function Kb(){var a,c,d,e,f;if(a=ui,34===b.charCodeAt(ui)?(c=li,ui++):(c=Qb,0===Ai&&g(mi)),c!==Qb){if(d=[],tg.test(b.charAt(ui))?(e=b.charAt(ui),ui++):(e=Qb,0===Ai&&g(ug)),e!==Qb)for(;e!==Qb;)d.push(e),tg.test(b.charAt(ui))?(e=b.charAt(ui),ui++):(e=Qb,0===Ai&&g(ug));else d=Tb;d!==Qb?(34===b.charCodeAt(ui)?(e=li,ui++):(e=Qb,0===Ai&&g(mi)),e!==Qb?(f=db(),f!==Qb?(vi=a,c=ni(d),a=c):(ui=a,a=Tb)):(ui=a,a=Tb)):(ui=a,a=Tb)}else ui=a,a=Tb;return a}function Lb(){var a,b,c,d;if(a=ui,b=Nb(),b!==Qb){if(c=[],d=Mb(),d!==Qb)for(;d!==Qb;)c.push(d),d=Mb();else c=Tb;c!==Qb?(vi=a,b=oi(c),a=b):(ui=a,a=Tb)}else ui=a,a=Tb;return a}function Mb(){var a,c,d,e,f;return a=ui,c=db(),c!==Qb?(d=J(),d!==Qb?(e=db(),e!==Qb?(44===b.charCodeAt(ui)?(f=Wf,ui++):(f=Qb,0===Ai&&g(Xf)),f===Qb&&(f=kc),f!==Qb?(vi=a,c=pi(d),a=c):(ui=a,a=Tb)):(ui=a,a=Tb)):(ui=a,a=Tb)):(ui=a,a=Tb),a}function Nb(){var a;return b.substr(ui,10)===qi?(a=qi,ui+=10):(a=Qb,0===Ai&&g(ri)),a===Qb&&(b.substr(ui,5)===si?(a=si,ui+=5):(a=Qb,0===Ai&&g(ti))),a}var Ob,Pb=arguments.length>1?arguments[1]:{},Qb={},Rb={start:i},Sb=i,Tb=Qb,Ub=function(a){return a},Vb=function(a){return Ci.mergeCommands(a)},Wb={type:"other",description:"IfElseStatement"},Xb=function(a,b){return{commands:[a.concat(b)]}},Yb=function(a){return{commands:[a]}},Zb=function(a){return a},$b="@if",_b={type:"literal",value:"@if",description:'"@if"'},ac="{",bc={type:"literal",value:"{",description:'"{"'},cc="}",dc={type:"literal",value:"}",description:'"}"'},ec=function(a,b){return["if",a,b.commands]},fc=/^[^{]/,gc={type:"class",value:"[^{]",description:"[^{]"},hc=function(){throw new Ci._Error("Invalid If Clause",null,null,null,Ci._lineNumber(),Ci._columnNumber())},ic="@else",jc={type:"literal",value:"@else",description:'"@else"'},kc=null,lc=function(a,b){return[a||!0,b.commands]},mc=function(){throw new Ci._Error("Invalid Else Clause",null,null,null,Ci._lineNumber(),Ci._columnNumber())},nc={type:"other",description:"ConstraintStatement"},oc=function(a,b,c){return Ci.constraint(a,b,c)},pc={type:"other",description:"InlineConstraintStatement"},qc=/^[^:&$\^)(\][@ ]/,rc={type:"class",value:"[^:&$\\^)(\\][@ ]",description:"[^:&$\\^)(\\][@ ]"},sc=":",tc={type:"literal",value:":",description:'":"'},uc=/^[^;]/,vc={type:"class",value:"[^;]",description:"[^;]"},wc=void 0,xc=";",yc={type:"literal",value:";",description:'";"'},zc=function(a,b,c){return Ci.inlineConstraint(a,b,c)},Ac={type:"other",description:"Inline Set"},Bc=function(a,b){return Ci.inlineSet(a,b)},Cc=function(a,b){return{commands:[["rule",a,b.commands]]}},Dc=function(a){return a},Ec={type:"other",description:"Directive"},Fc="@",Gc={type:"literal",value:"@",description:'"@"'},Hc=/^[^ {}]/,Ic={type:"class",value:"[^ {}]",description:"[^ {}]"},Jc=/^[^{};]/,Kc={type:"class",value:"[^{};]",description:"[^{};]"},Lc=function(a,b,c){return Ci.directive(a.join(""),b.join("").trim(),c.commands)},Mc=function(a,b){return Ci.directive(a.join(""),b.join("").trim())},Nc=function(a,b){return Ci.nestedDualTermCommands(a,b)},Oc="AND",Pc={type:"literal",value:"AND",description:'"AND"'},Qc="and",Rc={type:"literal",value:"and",description:'"and"'},Sc="And",Tc={type:"literal",value:"And",description:'"And"'},Uc="&&",Vc={type:"literal",value:"&&",description:'"&&"'},Wc=function(){return"&&"},Xc="OR",Yc={type:"literal",value:"OR",description:'"OR"'},Zc="or",$c={type:"literal",value:"or",description:'"or"'},_c="Or",ad={type:"literal",value:"Or",description:'"Or"'},bd="||",cd={type:"literal",value:"||",description:'"||"'},dd=function(){return"||"},ed=function(a,b){return Ci.nestedDualTermCommands(a,b)},fd="!=",gd={type:"literal",value:"!=",description:'"!="'},hd=function(){return"!="},id="=",jd={type:"literal",value:"=",description:'"="'},kd=function(){return"="},ld="~=",md={type:"literal",value:"~=",description:'"~="'},nd=function(){return"~="},od={type:"other",description:"Constraint Operator"},pd="==",qd={type:"literal",value:"==",description:'"=="'},rd=function(){return"=="},sd="<=",td={type:"literal",value:"<=",description:'"<="'},ud="=<",vd={type:"literal",value:"=<",description:'"=<"'},wd=function(){return"<="},xd=">=",yd={type:"literal",value:">=",description:'">="'},zd="=>",Ad={type:"literal",value:"=>",description:'"=>"'},Bd=function(){return">="},Cd="<",Dd={type:"literal",value:"<",description:'"<"'},Ed=function(){return"<"},Fd=">",Gd={type:"literal",value:">",description:'">"'},Hd=function(){return">"},Id="+",Jd={type:"literal",value:"+",description:'"+"'},Kd=function(){return"+"},Ld="-",Md={type:"literal",value:"-",description:'"-"'},Nd=function(){return"-"},Od="*",Pd={type:"literal",value:"*",description:'"*"'},Qd=function(){return"*"},Rd="/",Sd={type:"literal",value:"/",description:'"/"'},Td=function(){return"/"},Ud="(",Vd={type:"literal",value:"(",description:'"("'},Wd=")",Xd={type:"literal",value:")",description:'")"'},Yd=function(a){return a},Zd="true",$d={type:"literal",value:"true",description:'"true"'},_d=function(){return!0},ae="false",be={type:"literal",value:"false",description:'"false"'},ce=function(){return!1},de="null",ee={type:"literal",value:"null",description:'"null"'},fe=function(){return null},ge="undefined",he={type:"literal",value:"undefined",description:'"undefined"'},ie=function(){return void 0},je=function(a){return a},ke={type:"other",description:"variable"},le="[",me={type:"literal",value:"[",description:'"["'},ne="]",oe={type:"literal",value:"]",description:'"]"'},pe=function(a,b,c){return Ci.variable(a,b,c)},qe=function(a,b){return Ci.variable(!1,a,b)},re=/^["']/,se={type:"class",value:"[\"']",description:"[\"']"},te=/^[^"']/,ue={type:"class",value:"[^\"']",description:"[^\"']"},ve=function(a){return a.join("")},we=/^[a-zA-Z0-9#.\-_$]/,xe={type:"class",value:"[a-zA-Z0-9#.\\-_$]",description:"[a-zA-Z0-9#.\\-_$]"},ye=/^[a-zA-Z]/,ze={type:"class",value:"[a-zA-Z]",description:"[a-zA-Z]"},Ae=/^[a-zA-Z0-9\-_]/,Be={type:"class",value:"[a-zA-Z0-9\\-_]",description:"[a-zA-Z0-9\\-_]"},Ce=function(a,b){return a+b.join("")},De=/^[\-]/,Ee={type:"class",value:"[\\-]",description:"[\\-]"},Fe=function(a,b,c){return a.join("")+b+c.join("")},Ge=" ",He={type:"literal",value:" ",description:'" "'},Ie=function(a,b){return[b,a]},Je=function(a){return a},Ke="px",Le={type:"literal",value:"px",description:'"px"'},Me="em",Ne={type:"literal",value:"em",description:'"em"'},Oe="vh",Pe={type:"literal",value:"vh",description:'"vh"'},Qe="%",Re={type:"literal",value:"%",description:'"%"'},Se="rem",Te={type:"literal",value:"rem",description:'"rem"'},Ue="ex",Ve={type:"literal",value:"ex",description:'"ex"'},We="ch",Xe={type:"literal",value:"ch",description:'"ch"'},Ye="vmin",Ze={type:"literal",value:"vmin",description:'"vmin"'},$e="vmax",_e={type:"literal",value:"vmax",description:'"vmax"'},af="cm",bf={type:"literal",value:"cm",description:'"cm"'},cf="mm",df={type:"literal",value:"mm",description:'"mm"'},ef="in",ff={type:"literal",value:"in",description:'"in"'},gf="pt",hf={type:"literal",value:"pt",description:'"pt"'},jf="pc",kf={type:"literal",value:"pc",description:'"pc"'},lf=/^[0-9]/,mf={type:"class",value:"[0-9]",description:"[0-9]"},nf=function(a){return Ci.integer(a)},of=/^[\-+]/,pf={type:"class",value:"[\\-+]",description:"[\\-+]"},qf=function(a,b){return Ci.signedInteger(a,b)},rf=".",sf={type:"literal",value:".",description:'"."'},tf=function(a,b){return parseFloat(a.join("")+"."+b.join(""))},uf=function(a,b){return Ci.signedReal(a,b)},vf={type:"any",description:"any character"},wf={type:"other",description:"whitespace"},xf=/^[\t\x0B\f \xA0\uFEFF]/,yf={type:"class",value:"[\\t\\x0B\\f \\xA0\\uFEFF]",description:"[\\t\\x0B\\f \\xA0\\uFEFF]"},zf=/^[\n\r\u2028\u2029]/,Af={type:"class",value:"[\\n\\r\\u2028\\u2029]",description:"[\\n\\r\\u2028\\u2029]"},Bf={type:"other",description:"end of line"},Cf="\n",Df={type:"literal",value:"\n",description:'"\\n"'},Ef="\r\n",Ff={type:"literal",value:"\r\n",description:'"\\r\\n"'},Gf="\r",Hf={type:"literal",value:"\r",description:'"\\r"'},If="\u2028",Jf={type:"literal",value:"\u2028",description:'"\\u2028"'},Kf="\u2029",Lf={type:"literal",value:"\u2029",description:'"\\u2029"'},Mf={type:"other",description:"comment"},Nf="/*",Of={type:"literal",value:"/*",description:'"/*"'},Pf="*/",Qf={type:"literal",value:"*/",description:'"*/"'},Rf="//",Sf={type:"literal",value:"//",description:'"//"'},Tf=function(a,b){return[a,b]},Uf=function(a){return a},Vf=function(a){return a},Wf=",",Xf={type:"literal",value:",",description:'","'},Yf=function(a,b){return Ci.createSelectorCommaCommand(a,b)},Zf=function(a){return Ci.reverseFilterNest(a)},$f={type:"other",description:"NoParanSelector"},_f={type:"other",description:"SimpleSelector"},ag=function(a){return[a]