Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add uncompressed built file

  • Loading branch information...
commit c9ef73798ce952ce2528fa1c8d9c03799297992f 1 parent bb5ea1e
@kriszyp authored
View
2  README.md
@@ -26,7 +26,7 @@ and you can start using xstyle's CSS extensions:
<style>
/* my rules */
</style>
-<script src="xstyle/xstyle.min.js"></script>
+&lt;script src="xstyle/xstyle.js">&lt;/script> <!-- or use the minified xstyle.min.js -->
</pre>
Or xstyle can be used with an AMD module loader, like RequireJS or Dojo, and load the
View
4 build/build-xstyle.cmd
@@ -1 +1,3 @@
-uglifyjs ../core/amdLoader.js ../../put-selector/put.js ../core/elemental.js ../core/ruleModel.js ../core/parser.js ../main.js -o ..\xstyle.min.js --source-map ..\xstyle.min.js.map -p 2 -c -m
+cd ..
+cat core/amdLoader.js ../put-selector/put.js core/elemental.js core/ruleModel.js core/parser.js main.js > xstyle.js
+uglifyjs xstyle.js -o xstyle.min.js --source-map xstyle.min.js.map -p 2 -c -m
View
1,533 xstyle.js
@@ -0,0 +1,1533 @@
+/*
+ * This is a very simple AMD module loader so that xstyle can be used standalone
+ */
+
+(function(){
+ var doc = document;
+ // find a script to go off of
+ var scripts = doc.scripts;
+ var baseScript = scripts[scripts.length-1];
+ var baseUrl = baseScript.src.replace(/[^\/]+\/xstyle[^\/]*js/,'');
+ // a very simple AMD loader
+ define = function(id, deps, factory){
+ if(!factory){
+ factory = deps;
+ deps = id;
+ id = 'put-selector/put';
+ }
+ var waiting = 1;
+ for(var i = 0;i < deps.length; i++){
+ var dep = deps[i];
+ var module = modules[dep];
+ if(!module){
+ // inject script tag
+ module = modules[dep] = {callbacks: []};
+ var node = doc.createElement('script');
+ node.src = baseUrl + dep + '.js';
+ baseScript.parentNode.insertBefore(node, baseScript);
+ }
+ if(module.callbacks){
+ // add a callback for this waiting module
+ waiting++;
+ module.callbacks.push((function(i){
+ return function(value){
+ deps[i] = value;
+ loaded();
+ };
+ })(i));
+ }else{
+ deps[i] = module.result;
+ }
+ }
+ module = modules[id] || (modules[id] = {callbacks: []});
+ loaded();
+ function loaded(){
+ if(--waiting < 1){
+ // done loading, run the factory
+ var result = module.result = factory && factory.apply(this, deps);
+ var callbacks = module.callbacks;
+ for(var i = 0 ; i < callbacks.length; i++){
+ callbacks[i](result);
+ }
+ module.callbacks = 0;
+ }
+ }
+ };
+
+ require = function(deps, factory){
+ define("", deps, factory);
+ };
+
+ var modules = {require: {result: require}};
+})();
+(function(define){
+var forDocument, fragmentFasterHeuristic = /[-+,> ]/; // if it has any of these combinators, it is probably going to be faster with a document fragment
+define([], forDocument = function(doc, newFragmentFasterHeuristic){
+"use strict";
+ // module:
+ // put-selector/put
+ // summary:
+ // This module defines a fast lightweight function for updating and creating new elements
+ // terse, CSS selector-based syntax. The single function from this module creates
+ // new DOM elements and updates existing elements. See README.md for more information.
+ // examples:
+ // To create a simple div with a class name of "foo":
+ // | put("div.foo");
+ fragmentFasterHeuristic = newFragmentFasterHeuristic || fragmentFasterHeuristic;
+ var selectorParse = /(?:\s*([-+ ,<>]))?\s*(\.|!\.?|#)?([-\w%$|]+)?(?:\[([^\]=]+)=?['"]?([^\]'"]*)['"]?\])?/g,
+ undefined, namespaceIndex, namespaces = false,
+ doc = doc || document,
+ ieCreateElement = typeof doc.createElement == "object"; // telltale sign of the old IE behavior with createElement that does not support later addition of name
+ function insertTextNode(element, text){
+ element.appendChild(doc.createTextNode(text));
+ }
+ function put(topReferenceElement){
+ var fragment, lastSelectorArg, nextSibling, referenceElement, current,
+ args = arguments,
+ returnValue = args[0]; // use the first argument as the default return value in case only an element is passed in
+ function insertLastElement(){
+ // we perform insertBefore actions after the element is fully created to work properly with
+ // <input> tags in older versions of IE that require type attributes
+ // to be set before it is attached to a parent.
+ // We also handle top level as a document fragment actions in a complex creation
+ // are done on a detached DOM which is much faster
+ // Also if there is a parse error, we generally error out before doing any DOM operations (more atomic)
+ if(current && referenceElement && current != referenceElement){
+ (referenceElement == topReferenceElement &&
+ // top level, may use fragment for faster access
+ (fragment ||
+ // fragment doesn't exist yet, check to see if we really want to create it
+ (fragment = fragmentFasterHeuristic.test(argument) && doc.createDocumentFragment()))
+ // any of the above fails just use the referenceElement
+ || referenceElement).
+ insertBefore(current, nextSibling || null); // do the actual insertion
+ }
+ }
+ for(var i = 0; i < args.length; i++){
+ var argument = args[i];
+ if(typeof argument == "object"){
+ lastSelectorArg = false;
+ if(argument instanceof Array){
+ // an array
+ current = doc.createDocumentFragment();
+ for(var key = 0; key < argument.length; key++){
+ current.appendChild(put(argument[key]));
+ }
+ argument = current;
+ }
+ if(argument.nodeType){
+ current = argument;
+ insertLastElement();
+ referenceElement = argument;
+ nextSibling = 0;
+ }else{
+ // an object hash
+ for(var key in argument){
+ current[key] = argument[key];
+ }
+ }
+ }else if(lastSelectorArg){
+ // a text node should be created
+ // take a scalar value, use createTextNode so it is properly escaped
+ // createTextNode is generally several times faster than doing an escaped innerHTML insertion: http://jsperf.com/createtextnode-vs-innerhtml/2
+ lastSelectorArg = false;
+ insertTextNode(current, argument);
+ }else{
+ if(i < 1){
+ // if we are starting with a selector, there is no top element
+ topReferenceElement = null;
+ }
+ lastSelectorArg = true;
+ var leftoverCharacters = argument.replace(selectorParse, function(t, combinator, prefix, value, attrName, attrValue){
+ if(combinator){
+ // insert the last current object
+ insertLastElement();
+ if(combinator == '-' || combinator == '+'){
+ // + or - combinator,
+ // TODO: add support for >- as a means of indicating before the first child?
+ referenceElement = (nextSibling = (current || referenceElement)).parentNode;
+ current = null;
+ if(combinator == "+"){
+ nextSibling = nextSibling.nextSibling;
+ }// else a - operator, again not in CSS, but obvious in it's meaning (create next element before the current/referenceElement)
+ }else{
+ if(combinator == "<"){
+ // parent combinator (not really in CSS, but theorized, and obvious in it's meaning)
+ referenceElement = current = (current || referenceElement).parentNode;
+ }else{
+ if(combinator == ","){
+ // comma combinator, start a new selector
+ referenceElement = topReferenceElement;
+ }else if(current){
+ // else descendent or child selector (doesn't matter, treated the same),
+ referenceElement = current;
+ }
+ current = null;
+ }
+ nextSibling = 0;
+ }
+ if(current){
+ referenceElement = current;
+ }
+ }
+ var tag = !prefix && value;
+ if(tag || (!current && (prefix || attrName))){
+ if(tag == "$"){
+ // this is a variable to be replaced with a text node
+ insertTextNode(referenceElement, args[++i]);
+ }else{
+ // Need to create an element
+ tag = tag || put.defaultTag;
+ var ieInputName = ieCreateElement && args[i +1] && args[i +1].name;
+ if(ieInputName){
+ // in IE, we have to use the crazy non-standard createElement to create input's that have a name
+ tag = '<' + tag + ' name="' + ieInputName + '">';
+ }
+ // we swtich between creation methods based on namespace usage
+ current = namespaces && ~(namespaceIndex = tag.indexOf('|')) ?
+ doc.createElementNS(namespaces[tag.slice(0, namespaceIndex)], tag.slice(namespaceIndex + 1)) :
+ doc.createElement(tag);
+ }
+ }
+ if(prefix){
+ if(value == "$"){
+ value = args[++i];
+ }
+ if(prefix == "#"){
+ // #id was specified
+ current.id = value;
+ }else{
+ // we are in the className addition and removal branch
+ var currentClassName = current.className;
+ // remove the className (needed for addition or removal)
+ // see http://jsperf.com/remove-class-name-algorithm/2 for some tests on this
+ var removed = currentClassName && (" " + currentClassName + " ").replace(" " + value + " ", " ");
+ if(prefix == "."){
+ // addition, add the className
+ current.className = currentClassName ? (removed + value).substring(1) : value;
+ }else{
+ // else a '!' class removal
+ if(argument == "!"){
+ var parentNode;
+ // special signal to delete this element
+ if(ieCreateElement){
+ // use the ol' innerHTML trick to get IE to do some cleanup
+ put("div", current, '<').innerHTML = "";
+ }else if(parentNode = current.parentNode){ // intentional assigment
+ // use a faster, and more correct (for namespaced elements) removal (http://jsperf.com/removechild-innerhtml)
+ parentNode.removeChild(current);
+ }
+ }else{
+ // we already have removed the class, just need to trim
+ removed = removed.substring(1, removed.length - 1);
+ // only assign if it changed, this can save a lot of time
+ if(removed != currentClassName){
+ current.className = removed;
+ }
+ }
+ }
+ // CSS class removal
+ }
+ }
+ if(attrName){
+ if(attrValue == "$"){
+ attrValue = args[++i];
+ }
+ // [name=value]
+ if(attrName == "style"){
+ // handle the special case of setAttribute not working in old IE
+ current.style.cssText = attrValue;
+ }else{
+ var method = attrName.charAt(0) == "!" ? (attrName = attrName.substring(1)) && 'removeAttribute' : 'setAttribute';
+ attrValue = attrValue === '' ? attrName : attrValue;
+ // determine if we need to use a namespace
+ namespaces && ~(namespaceIndex = attrName.indexOf('|')) ?
+ current[method + "NS"](namespaces[attrName.slice(0, namespaceIndex)], attrName.slice(namespaceIndex + 1), attrValue) :
+ current[method](attrName, attrValue);
+ }
+ }
+ return '';
+ });
+ if(leftoverCharacters){
+ throw new SyntaxError("Unexpected char " + leftoverCharacters + " in " + argument);
+ }
+ insertLastElement();
+ referenceElement = returnValue = current || referenceElement;
+ }
+ }
+ if(topReferenceElement && fragment){
+ // we now insert the top level elements for the fragment if it exists
+ topReferenceElement.appendChild(fragment);
+ }
+ return returnValue;
+ }
+ put.addNamespace = function(name, uri){
+ if(doc.createElementNS){
+ (namespaces || (namespaces = {}))[name] = uri;
+ }else{
+ // for old IE
+ doc.namespaces.add(name, uri);
+ }
+ };
+ put.defaultTag = "div";
+ put.forDocument = forDocument;
+ return put;
+});
+})(function(id, deps, factory){
+ factory = factory || deps;
+ if(typeof define === "function"){
+ // AMD loader
+ define([], function(){
+ return factory();
+ });
+ }else if(typeof window == "undefined"){
+ // server side JavaScript, probably (hopefully) NodeJS
+ require("./node-html")(module, factory);
+ }else{
+ // plain script in a browser
+ put = factory();
+ }
+});
+define("xstyle/core/elemental", ["put-selector/put"], function(put){
+ // using delegation, listen for any input changes in the document and "put" the value
+ // TODO: add a hook so one could add support for IE8, or maybe this event delegation isn't really that useful
+ var doc = document;
+ doc.addEventListener('change', function(event){
+ var element = event.target;
+ // get the variable computation so we can put the value
+ var variable = element['-x-variable'];
+ if(variable.put){ // if it can be put, we do so
+ variable.put(element.value);
+ }
+ });
+
+
+ // elemental section, this code is for property handlers that need to mutate the DOM for elements
+ // that match it's rule
+ var testDiv = doc.createElement("div");
+ var features = {
+ "dom-qsa2.1": !!testDiv.querySelectorAll
+ };
+ function has(feature){
+ return features[feature];
+ }
+ // get the matches function, whatever it is called in this browser
+ var matchesSelector = testDiv.matches || testDiv.matchesSelector || testDiv.webkitMatchesSelector || testDiv.mozMatchesSelector || testDiv.msMatchesSelector || testDiv.oMatchesSelector;
+ var selectorRenderers = [];
+ var classHash = {}, propertyHash = {};
+ var renderQueue = [];
+ var documentQueried;
+ // probably want to inline our own DOM readiness code
+ function domReady(callback){
+ // TODO: support IE7-8
+ if(/e/.test(doc.readyState||'')){
+ // TODO: fix the issues with sync so this can be run immediately
+ setTimeout(callback, 200);
+ }else{
+ doc.addEventListener("DOMContentLoaded", callback);
+ }
+ }
+ domReady(function(){
+ if(!documentQueried){
+ documentQueried = true;
+ if(has("dom-qsa2.1")){
+ // if we have a query engine, it is fastest to use that
+ for(var i = 0, l = selectorRenderers.length; i < l; i++){
+ // find the matches and register the renderers
+ findMatches(selectorRenderers[i]);
+ }
+ // render all the elements that are queued up
+ renderWaiting();
+ }else{
+ //else rely on css expressions (or maybe we should use document.all and just scan everything)
+ var all = doc.all;
+ for(var i = 0, l = all.length; i < l; i++){
+ update(all[i]);
+ }
+ }
+ }
+ });
+ function findMatches(renderer){
+ // find the elements for a given selector and apply the renderers to it
+ var toRender = [];
+ var results = doc.querySelectorAll(renderer.selector);
+ var name = renderer.name;
+ for(var i = 0, l = results.length; i < l; i++){
+ var element = results[i];
+ var currentStyle = element.elementalStyle;
+ var currentSpecificities = element.elementalSpecificities;
+ if(!currentStyle){
+ currentStyle = element.elementalStyle = {};
+ currentSpecificities = element.elementalSpecificities = {};
+ }
+ // TODO: only override if the selector is equal or higher specificity
+ // var specificity = renderer.selector.match(/ /).length;
+ if(true || currentSpecificities[name] <= renderer.specificity){ // only process changes
+ var elementRenderings = element.renderings;
+ if(!elementRenderings){
+ // put it in the queue
+ elementRenderings = element.renderings = [];
+ renderQueue.push(element);
+ }
+
+ elementRenderings.push({
+ name: name,
+ rendered: currentStyle[name] == renderer.propertyValue,
+ renderer: renderer
+ });
+ currentStyle[name] = renderer.propertyValue;
+ }
+ }
+
+ }
+ var isCurrent;
+ function renderWaiting(){
+ // render all the elements in the queue to be rendered
+ for(var i = 0; i < renderQueue.length; i++){
+ var element = renderQueue[i];
+ var renderings = element.renderings, currentStyle = element.elementalStyle;
+ delete element.renderings;
+ for(var j = 0; j < renderings.length; j++){
+ var rendering = renderings[j];
+ var renderer = rendering.renderer;
+ var rendered = renderer.rendered;
+ isCurrent = currentStyle[rendering.name] == renderer.propertyValue; // determine if this renderer matches the current computed style
+ if(!rendered && isCurrent){
+ try{
+ renderer.render(element);
+ }catch(e){
+ console.error(e, e.stack);
+ put(element, "div.error", e.toString());
+ }
+ }
+ if(rendered && !isCurrent && renderer.unrender){
+ renderer.unrender(element);
+ renderings.splice(j--, 1); // TODO: need to remove duplicate rendered items as well
+ }
+ }
+ }
+ renderQueue = [];
+ }
+ function apply(element, renderers){
+ // an element was found that matches a selector, so we apply the renderers
+ for(var i = 0, l = renderers.length; i < l; i++){
+ renderers[i](element);
+ }
+ }
+ function update(element, selector){
+ /* At some point, might want to use getMatchedCSSRules for faster access to matching rules
+ if(typeof getMatchedCSSRules != "undefined"){
+ // webkit gives us fast access to which rules apply
+ getMatchedCSSRules(element);
+ }else{*/
+ for(var i = 0, l = selectorRenderers.length; i < l; i++){
+ var renderer = selectorRenderers[i];
+ if((!selector || (selector == renderer.selector)) &&
+ (matchesSelector ?
+ // use matchesSelector if available
+ matchesSelector.call(element, renderer.selector) : // TODO: determine if it is higher specificity that other same name properties
+ // else use IE's custom css property inheritance mechanism
+ element.currentStyle[renderer.name] == renderer.propertyValue)){
+ renderer.render(element);
+ }
+ }
+ }
+ return {
+ ready: domReady,
+ addRenderer: function(propertyName, propertyValue, rule, handler){
+ var renderer = {
+ selector: rule.selector,
+ propertyValue: propertyValue,
+ name: propertyName,
+ render: handler
+ };
+ // the main entry point for adding elemental handlers for a selector. The handler
+ // will be called for each element that is created that matches a given selector
+ selectorRenderers.push(renderer);
+ if(documentQueried){
+ findMatches(renderer);
+ }
+ renderWaiting();
+ /*if(!matchesSelector){
+ // create a custom property to identify this rule in created elements
+ return (renderers.triggerProperty = 'selector_' + encodeURIComponent(selector).replace(/%/g, '/')) + ': 1;' +
+ (document.querySelectorAll ? '' :
+ // we use css expressions for IE6-7 to find new elements that match the selector, since qSA is not available, wonder if it is better to just use document.all...
+ 'zoom: expression(cssxRegister(this,"' + selector +'"));');
+ }*/
+ },
+ update: update, // this should be called for newly created dynamic elements to ensure the proper rules are applied
+ clearRenderers: function(){
+ // clears all the renderers in use
+ selectorRenderers = [];
+ }
+ };
+});define("xstyle/core/ruleModel", ["xstyle/core/elemental", "put-selector/put"], function(elemental, put){
+
+ var nextId = 0;
+ // selection of default children for given elements
+ var childTagForParent = {
+ "TABLE": "tr",
+ "TBODY": "tr",
+ "TR": "td",
+ "UL": "li",
+ "OL": "li",
+ "SELECT": "option"
+ };
+ var operatorMatch = {
+ '{': '}',
+ '[': ']',
+ '(': ')'
+ }
+ var doc = document, styleSheet;
+ var undef, testDiv = doc.createElement("div");
+ // some utility functions
+ function when(value, callback){
+ return value && value.then ?
+ value.then(callback) : callback(value);
+ }
+ function get(target, path, callback){
+ return when(target, function(target){
+ var name = path[0];
+ if(!target){
+ return callback(name || target);
+ }
+ if(name && target.get){
+ return get(target.get(name), path.slice(1), callback);
+ }
+ if(target.receive){
+ return target.receive(name ? function(value){
+ get(value, path, callback);
+ } : callback);
+ }
+ if(name){
+ return get(target[name], path.slice(1), callback);
+ }
+ callback(target);
+ });
+ }
+ function set(target, path, value){
+ get(target, path.slice(0, path.length - 1), function(target){
+ var property = path[path.length - 1];
+ target.set ?
+ target.set(property, value) :
+ target[property] = value;
+ });
+ }
+
+ var ua = navigator.userAgent;
+ var vendorPrefix = ua.indexOf("WebKit") > -1 ? "-webkit-" :
+ ua.indexOf("Firefox") > -1 ? "-moz-" :
+ ua.indexOf("MSIE") > -1 ? "-ms-" :
+ ua.indexOf("Opera") > -1 ? "-o-" : "";
+ // define the Rule class
+ function Rule(){}
+ Rule.prototype = {
+ eachProperty: function(onProperty){
+ // iterate through each property on the rule
+ var values = this.values || 0;
+ for(var i = 0; i < values.length; i++){
+ var name = values[i];
+ onProperty.call(this, name || 'unnamed', values[name]);
+ }
+ },
+ fullSelector: function(){
+ // calculate the full selector, in case this is a nested rule we determine the full selector using parent rules
+ return (this.parent ? this.parent.fullSelector() : "") + (this.selector || "") + " ";
+ },
+ newRule: function(name){
+ // called by the parser when a new child rule is encountered
+ return (this.rules || (this.rules = {}))[name] = new Rule();
+ },
+ newCall: function(name, sequence, rule){
+ // called by the parser when a function call is encountered
+ var call = new Call(name);
+ return call;
+ },
+ addSheetRule: function(selector, cssText){
+//console.log('addSheetRule',selector, cssText);
+ // Used to add a new rule
+ if(cssText &&
+ selector.charAt(0) != '@'){ // for now just ignore and don't add at-rules
+ try{
+ var ruleNumber = this.styleSheet.addRule(selector, cssText, this.ruleIndex);
+ if(ruleNumber == -1){
+ ruleNumber = this.styleSheet.cssRules.length - 1;
+ }
+ return styleSheet.cssRules[ruleNumber];
+ }catch(e){
+ console.warn("Unable to add rule", e);
+ }
+ }
+ },
+ onRule: function(){
+ // called by parser once a rule is finished parsing
+ this.getCssRule();
+ },
+ getCssRule: function(){
+ if(!this.cssRule){
+ this.cssRule =this.addSheetRule(this.selector, this.cssText);
+ }
+ return this.cssRule;
+ },
+ get: function(key){
+ // TODO: need to add inheritance? or can this be removed
+ return this.values[key];
+ },
+ declareProperty: function(name, value, conditional){
+ // called by the parser when a variable assignment is encountered
+ if(value[0].toString().charAt(0) == '>'){
+ // this is used to indicate that generation should be triggered
+ if(!name){
+ this.generator = value;
+ value = generate(value, this);
+ elemental.addRenderer("", value, this, value);
+ return;
+ }
+ }else{
+ // add it to the properties for this rule
+ var propertyExists = name in testDiv.style || resolveProperty(this, name);
+ if(!conditional || !propertyExists){
+ var properties = (this.properties || (this.properties = {}));
+ properties[name] = evaluateExpression(this, name, value);
+ if(propertyExists){
+ console.warn('Overriding existing property "' + name + '"');
+ }
+ }
+ }
+ },
+ setValue: function(name, value){
+ // called by the parser when a property is encountered
+ var values = (this.values || (this.values = []));
+ values.push(name);
+ values[name] = value;
+ var calls = value.calls;
+ if(calls){
+ for(var i = 0; i < calls.length; i++){
+ var call = calls[i];
+ var handler = call.ref;
+ if(handler && typeof handler.call == 'function'){
+ handler.call(call, this, name, value);
+ }
+ }
+ }
+ // called when each property is parsed, and this determines if there is a handler for it
+ //TODO: delete the property if it one that the browser actually uses
+ // this is called for each CSS property
+ if(name){
+ var propertyName = name;
+ do{
+ // check for the handler
+ var target = resolveProperty(this, name);
+ if(target){
+ var rule = this;
+ // call the handler to handle this rule
+ when(target, function(target){
+ target = target.splice ? target : [target];
+ for(var i = 0; i < target.length; i++){
+ var segment = target[i];
+ var returned = segment.put && segment.put(value, rule, propertyName);
+ if(returned){
+ if(returned.then){
+ returned.then(function(){
+ // TODO: anything we want to do after loading?
+ });
+ }
+ break;
+ }
+ }
+ });
+ break;
+ }
+ // we progressively go through parent property names. For example if the
+ // property name is foo-bar-baz, it first checks for foo-bar-baz, then
+ // foo-bar, then foo
+ name = name.substring(0, name.lastIndexOf("-"));
+ // try shorter name
+ }while(name);
+ }
+ },
+ cssText: ""
+ };
+ // a class representing function calls
+ function Call(value){
+ // we store the caller and the arguments
+ this.caller = value;
+ this.args = [];
+ }
+ var CallPrototype = Call.prototype = new Rule;
+ CallPrototype.declareProperty = CallPrototype.setValue = function(name, value){
+ // handle these both as addition of arguments
+ this.args.push(value);
+ };
+ CallPrototype.toString = function(){
+ var operator = this.operator;
+ return operator + this.args + operatorMatch[operator];
+ };
+
+
+ function generate(generatingSelector, rule){
+ // this is responsible for generation of DOM elements for elements matching generative rules
+ var id = nextId++;
+ // normalize to array
+ generatingSelector = generatingSelector.sort ? generatingSelector : [generatingSelector];
+ // return a function that can do the generation for each element that matches
+ return function(element, item){
+ var lastElement = element;
+ var subId = 0;
+ for(var i = 0, l = generatingSelector.length;i < l; i++){
+ // go through each part in the selector/generation sequence
+ var part = generatingSelector[i];
+ try{
+ if(part.eachProperty){
+ // it's a rule or call
+ if(part.args){
+ if(part.operator == '('){ // a call (or at least parans), for now we are assuming it is a binding
+ var nextPart = generatingSelector[i+1];
+ if(nextPart && nextPart.eachProperty){
+ // apply the class for the next part so we can reference it properly
+ put(lastElement, nextPart.selector);
+ }
+ // TODO: make sure we only do this only once
+ var expression = part.args.toString();
+ var apply = evaluateExpression(part, 0, expression);
+ (function(element, lastElement){
+ when(apply, function(apply){
+ // TODO: assess how we could propagate changes categorically
+ if(apply.forElement){
+ apply = apply.forElement(lastElement);
+ // now apply.element should indicate the element that it is actually keying or varying on
+ }
+ var textNode = element.appendChild(doc.createTextNode("Loading"));
+ apply.receive(function(value){
+ if(value && value.sort){
+ // if it is an array, we do iterative rendering
+ if(textNode){
+ // remove the loading node
+ textNode.parentNode.removeChild(textNode);
+ textNode = null;
+ }
+ var eachHandler = nextPart && nextPart.eachProperty && nextPart.get('each');
+ // if "each" is defined, we will use it render each item
+ if(eachHandler){
+ eachHandler = generate(eachHandler, nextPart);
+ }
+ value.forEach(eachHandler ?
+ function(value){
+ // TODO: do this inside generate
+ eachHandler(element, value);
+ } :
+ function(value){
+ // if there no each handler, we use the default tag name for the parent
+ put(element, childTagForParent[element.tagName] || 'div', value);
+ });
+ }else{
+ if("value" in element){
+ // add the text
+ element.value= value;
+ // we are going to store the variable computation on the element
+ // so that on a change we can quickly do a put on it
+ // we might want to consider changing that in the future, to
+ // reduce memory, but for now this probably has minimal cost
+ element['-x-variable'] = apply;
+ }else{
+ // put text in for Loading until we are ready
+ // TODO: we should do this after setting up the receive in case we synchronously get the data
+ // if not an array, render as plain text
+ textNode.nodeValue = value;
+ }
+ }
+ }, rule, expression);
+ });
+ })(lastElement, element);
+ }else{// brackets
+ put(lastElement, part.toString());
+ }
+ }else{
+ // it is plain rule (not a call), we need to apply the auto-generated selector, so CSS is properly applied
+ put(lastElement, part.selector);
+ // do any elemental updates
+ elemental.update(lastElement, part.selector);
+ }
+ }else if(typeof part == 'string'){
+ // actual CSS selector syntax, we generate the elements specified
+ if(part.charAt(0) == '='){
+ part = part.slice(1); // remove the '=' at the beginning
+ }
+
+ var children = part.split(',');
+ for(var j = 0, cl = children.length;j < cl; j++){
+ var child = children[j].trim();
+ var reference = null;
+ if(child){
+ // TODO: inline our own put-selector code, and handle bindings
+ child = child.replace(/\([^)]*\)/, function(expression){
+ reference = expression;
+ });
+ var nextElement = put(j == 0 ? lastElement : element, child);
+ if(item){
+ // set the item property, so the item reference will work
+ nextElement.item = item;
+ }
+ var nextPart = generatingSelector[i + 1];
+ if(nextElement != lastElement && // avoid infinite loop if it is a nop selector
+ (!nextPart || !nextPart.eachProperty) // if the next part is a rule, than it should be extending it already, so we don't want to double apply
+ ){
+ elemental.update(nextElement);
+ }
+ lastElement = nextElement;
+ }
+ }
+ }else{
+ // a string literal
+ lastElement.appendChild(doc.createTextNode(part.value));
+ }
+ }catch(e){
+ console.error(e, e.stack);
+ lastElement.appendChild(doc.createTextNode(e));
+ }
+ }
+ return lastElement;
+ }
+ }
+ function evaluateExpression(rule, name, value){
+ // evaluate a binding
+ var binding = rule["var-expr-" + name];
+ if(variables){
+ return binding;
+ }
+ var variables = [], isElementDependent;
+ variables.id = nextId++;
+ var target, parameters = [], id = 0, callbacks = [],
+ attributeParts, expression = value.join ? value.join("") : value.toString(),
+ simpleExpression = expression.match(/^[\w_$\/\.-]*$/);
+ // Do the parsing and function creation just once, and adapt the dependencies for the element at creation time
+ // deal with an array, converting strings to JS-eval'able strings
+ // find all the variables in the expression
+ expression = expression.replace(/("[^\"]*")|([\w_$\.\/-]+)/g, function(t, string, variable){
+ if(variable){
+ // for each reference, we break apart into variable reference and property references after each dot
+ attributeParts = variable.split('/');
+ var parameterName = attributeParts.join('_');
+ parameters.push(parameterName);
+ variables.push(attributeParts);
+ // first find the rule that is being referenced
+ var firstReference = attributeParts[0];
+ var target = resolveProperty(rule, firstReference);
+ if(typeof target == 'string' || target instanceof Array){
+ target = evaluateExpression(rule, firstReference, target);
+ }else if(!target){
+ throw new Error('Could not find reference "' + firstReference + '"');
+ }
+ if(target.forElement){
+ isElementDependent = true;
+ }
+ attributeParts[0] = target;
+ // we will reference the variable a function argument in the function we will create
+ return parameterName;
+ }
+ return t;
+ })
+
+ if(simpleExpression){
+ // a direct reversible reference
+ // no forward reactive needed
+ if(name){
+ // create the reverse function
+ var reversal = function(element, name, value){
+ when(findAttributeInAncestors(element, attributeParts[0], attributeParts[1]), function(target){
+ for(var i = 2; i < attributeParts.length -1; i++){
+ var name = attributeParts[i];
+ target = target.get ?
+ target.get(name) :
+ target[name];
+ }
+ var name = attributeParts[i];
+ if(target.set){
+ target.set(name, value);
+ }else{
+ target[name] = value;
+ }
+ });
+ };
+ reversal.rule = rule;
+// (reversalOfAttributes[name] || (reversalOfAttributes[name] = [])).push(reversal);
+ }
+ }else{
+ // it's a full expression, so we create a time-varying bound function with the expression
+ var reactiveFunction = Function.apply(this, parameters.concat(['return xstyleReturn(' + expression + ')']));
+ }
+ variables.func = reactiveFunction;
+ rule["var-expr-" + name] = variables;
+ function getComputation(){
+ var waiting = variables.length + 1;
+ var values = [], callbacks = [];
+ var result, isResolved;
+ var done = function(i){
+ return function(value){
+ values[i] = value;
+ waiting--;
+ if(waiting <= 0){
+ isResolved = true;
+ result = reactiveFunction ? reactiveFunction.apply(this, values) : values[0];
+ for(var j = 0; j < callbacks.length;j++){
+ callbacks[j](result);
+ }
+ }
+ };
+ };
+ if(reactiveFunction){
+ for(var i = 0; i < variables.length; i++){
+ var variable = variables[i];
+ get(variable[0], variable.slice(1), done(i));
+ }
+ }else{
+ var variable = variables[0];
+ var value = {
+ then: function(callback){
+ callbacks.push(callback);
+ }
+ }
+ when(variable[0], function(resolved){
+ value = resolved;
+ for(var j = 1; j < variable.length; j++){
+ if(value && value.get){
+ value = value.get(variable[j]);
+ }else{
+ value = {
+ receive: function(callback){
+ get(resolved, variable.slice(1), callback);
+ },
+ put: function(value){
+ set(resolved, variable.slice(1), value);
+ }
+ };
+ break;
+ }
+ }
+ for(var j = 0; j < callbacks.length; j++){
+ callbacks[j](value);
+ }
+ });
+ return value;
+ if(first && first.then){
+ return {
+ then: function(callback){
+ get(variable[0], variable.slice(1), callback);
+ }
+ };
+ }else{
+ return variable;
+ }
+ }
+ done(-1)();
+ if(result && result.then){
+ return result;
+ }
+ return {
+ receive: function(callback){
+ if(callbacks){
+ callbacks.push(callback);
+ }
+ if(isResolved){
+ callback(result);
+ }
+ }
+ }
+ }
+ return rule["var-expr-" + name] = isElementDependent ? {
+ forElement: function(element){
+ // TODO: at some point may make this async
+ var callbacks = [];
+ var mostSpecificElement;
+ var elementVariables = [];
+ // now find the element that matches that rule, in case we are dealing with a child
+ var parentElement = element;
+ while(!matchesSelector.call(element, rule.selector)){
+ element = element.parentNode;
+ }
+ for(var i = 0; i < variables.length; i++){
+ var variable = variables[i];
+ var target = variable[0];
+ // now find the element that is keyed on
+ if(target.forElement){
+ target = variable[0] = target.forElement(parentElement);
+ }
+ // we need to find the most parent element that we need to vary on for this computation
+ var varyOnElement = target.element;
+ if(parentElement != mostSpecificElement){
+ while(parentElement != varyOnElement){
+ if(parentElement == mostSpecificElement){
+ return;
+ }
+ parentElement = parentElement.parentNode;
+ }
+ mostSpecificElement = parentElement;
+ }
+ }
+ // make sure we indicate the store we are keying off of
+ var computation = mostSpecificElement["expr-result-" + variables.id];
+ if(!computation){
+ mostSpecificElement["expr-result-" + variables.id] = computation = getComputation();
+ computation.element = mostSpecificElement;
+ }
+ return computation;
+ }
+ } : getComputation();
+ }
+ function resolveProperty(rule, name, includeRules){
+ var parentRule = rule;
+ do{
+ var target = parentRule.properties && parentRule.properties[name]
+ || (includeRules && parentRule.rules && parentRule.rules[name]);
+ parentRule = parentRule.parent;
+ }while(!target && parentRule);
+ return target;
+ }
+ var hasAddEventListener = !!doc.addEventListener;
+ var matchesSelector = testDiv.matches || testDiv.webkitMatchesSelector || testDiv.msMatchesSelector || testDiv.mozMatchesSelector;
+
+ // we treat the stylesheet as a "root" rule; all normal rules are children of it
+ var target, root = new Rule;
+ root.root = true;
+ // the root has it's own intrinsic variables that provide important base and bootstrapping functionality
+ root.properties = {
+ Math: Math, // just useful
+ module: function(mid){
+ // require calls can be used to load in data in
+ return {
+ then: function(callback){
+ require([mid], callback);
+ }
+ };
+ },
+ // TODO: add url()
+ item: {
+ // adds support for referencing each item in a list of items when rendering arrays
+ forElement: function(element){
+ // we find the parent element with an item property, and key off of that
+ while(!element.item){
+ element = element.parentNode;
+ }
+ return {
+ element: element, // indicates the key element
+ receive: function(callback){// handle requests for the data
+ callback(element.item);
+ }
+ }
+ }
+ },
+ prefix: {
+ put: function(value, rule, name){
+ // add a vendor prefix
+ // check to see if the browser supports this feature through vendor prefixing
+ if(typeof testDiv.style[vendorPrefix + name] == "string"){
+ // if so, handle the prefixing right here
+ // TODO: switch to using getCssRule, but make sure we have it fixed first
+ return rule.addSheetRule(rule.selector, vendorPrefix + name +':' + value);
+ }
+ }
+ },
+ // provides CSS variable support
+ 'var': {
+ // setting the variables
+ put: function(value, rule, name){
+ (rule.variables || (rule.variables = {}))[name] = value;
+ // TODO: can we reuse something for this?
+ var variableListeners = rule.variableListeners;
+ variableListeners = variableListeners && variableListeners[name] || 0;
+ for(var i = 0;i < variableListeners.length;i++){
+ variableListeners[i](value);
+ }
+ },
+ // referencing variables
+ call: function(call, rule, name, value){
+ this.receive(function(resolvedValue){
+ rule.addSheetRule(rule.selector, name + ': ' + value.toString().replace(/var\([^)]+\)/g, resolvedValue));
+ }, rule, call.args[0]);
+ },
+ // variable properties can also be referenced in property expressions
+ receive: function(callback, rule, name){
+ var parentRule = rule;
+ do{
+ var target = parentRule.variables && parentRule.variables[name];
+ if(target){
+ var variableListeners = parentRule.variableListeners || (parentRule.variableListeners = {});
+ (variableListeners[name] || (variableListeners[name] = [])).push(callback);
+ return callback(target);
+ }
+ parentRule = parentRule.parent;
+ }while(parentRule);
+ callback();
+ }
+ },
+ on: {
+ put: function(value, rule, name){
+ // apply event listening
+ var on = this.on;
+ // first evaluate value as expression
+ get(evaluateExpression(rule, name, value), 0, function(value){
+ // add listener
+ on(document, name.slice(3), rule.selector, value);
+ });
+ },
+ on: function(target, event, selector, listener){
+ // this function can be overriden to provide better event handling
+ hasAddEventListener ?
+ target.addEventListener(event, select, false) :
+ target.attachEvent(event, select);
+ function select(event){
+ // do event delegation
+ selector = selector || rule.fullSelector();
+ if(matchesSelector.call(event.target, selector)){
+ listener(event);
+ }
+ }
+ }
+
+ }
+ };
+ xstyleReturn = function(first){
+ // global function used by the reactive functions to separate out comma-separated expressions into an array
+ if(arguments.length == 1){
+ // one arg, just return that
+ return first;
+ }
+ // if it is a comma separated list of values, return them as an array
+ return [].slice.call(arguments);
+ };
+ root.setStyleSheet = function(nextStyleSheet){
+ styleSheet = nextStyleSheet;
+ };
+ root.resolveProperty = resolveProperty;
+ return root;
+});define("xstyle/core/parser", [], function(){
+ // regular expressions used to parse CSS
+ var cssScan = /\s*((?:[^{\}\[\]\(\)\\'":=;]|\[(?:[^\]'"]|'(?:\\.|[^'])*'|"(?:\\.|[^"])*")\])*)([=:]\??\s*([^{\}\[\]\(\)\\'":;]*))?([{\}\[\]\(\)\\'":;]|$)/g;
+ // name: value operator
+ var singleQuoteScan = /((?:\\.|[^'])*)'/g;
+ var doubleQuoteScan = /((?:\\.|[^"])*)"/g;
+ var commentScan = /\/\*[\w\W]*?\*\//g; // preserve carriage returns to retain line numbering once we do line based error reporting
+ var operatorMatch = {
+ '{': '}',
+ '[': ']',
+ '(': ')'
+ };
+ var nextId = 0;
+ var trim = ''.trim ? function (str){
+ return str.trim();
+ } : function(str){
+ return str.replace(/^\s+|\s+$/g, '');
+ };
+ function toStringWithoutCommas(){
+ return this.join('');
+ }
+ function arrayWithoutCommas(array){
+ array.toString = toStringWithoutCommas;
+ return array;
+ }
+ function LiteralString(string){
+ this.value = string;
+ }
+ LiteralString.prototype.toString = function(){
+ return '"' + this.value.replace(/["\\\n\r]/g, '\\$&') + '"';
+ }
+
+ function convertCssNameToJs(name){
+ return name.replace(/-(\w)/g, function(t, firstLetter){
+ return firstLetter.toUpperCase();
+ });
+ }
+ function extend(base, derivative){
+ var newText = base.cssText;
+ derivative.cssText += newText;
+ 'values,properties,variables,calls'.replace(/\w+/g, function(property){
+ if(base[property]){
+ derivative[property] = Object.create(base[property]);
+ }
+ });
+// var ruleStyle = derivative.getCssRule().style;
+ base.eachProperty(function(name, value){
+ derivative.setValue(name, value);
+ /* if(name){
+ name = convertCssNameToJs(name);
+ if(!ruleStyle[name]){
+ ruleStyle[name] = value;
+ }
+ }*/
+ });
+ if(base.generator){
+ derivative.declareProperty(null, base.generator);
+ }
+
+ }
+
+ function parse(model, textToParse, styleSheet){
+ // tracks the stack of rules as they get nested
+ var stack = [model];
+ model.parse = parseSheet;
+ parseSheet(textToParse, styleSheet);
+ function parseSheet(textToParse, styleSheet){
+ // parse the CSS, finding each rule
+ function addInSequence(operand, dontAddToSelector){
+ if(!dontAddToSelector){
+ selector += operand;
+ }
+ if(sequence){
+ // we had a string so we are accumulated sequences now
+ sequence.push ?
+ typeof sequence[sequence.length - 1] == 'string' && typeof operand == 'string' ?
+ sequence[sequence.length - 1] += operand : // just append the string to last segment
+ operand && sequence.push(operand) : // add to the sequence
+ typeof sequence == 'string' && typeof operand == 'string' ?
+ sequence += operand : // keep appending to the string
+ sequence = arrayWithoutCommas([sequence, operand]); // start a new sequence array
+ }else{
+ sequence = operand;
+ }
+ }
+ textToParse = textToParse.replace(commentScan, '');
+ target = model; // start at root
+ cssScan.lastIndex = 0; // start at zero
+ var ruleIndex = 0, browserUnderstoodRule = true, selector = '', assignNextName = true;
+ while(true){
+ // parse the next block in the CSS
+ // we could perhaps use a simplified regex when we are in a property value
+ var match = cssScan.exec(textToParse);
+ // the next block is parsed into several parts that comprise some operands and an operator
+ var operator = match[4],
+ first = match[1],
+ assignment = match[2],
+ value = match[3],
+ assignmentOperator, name, sequence,
+ conditionalAssignment;
+ value = value && trim(value);
+
+ first = trim(first);
+ if(assignNextName){
+ // we are at the beginning of a new property
+ if(assignment){
+ // remember the name, so can assign to it
+ selector = name = first;
+ // selector = match[1] + assignment;
+ // remember the operator (could be ':' for a property assignment or '=' for a property declaration)
+ assignmentOperator = assignment.charAt(0);
+ conditionalAssignment = assignment.charAt(1) == '?';
+ }else{
+ selector = value = first;
+ }
+ // store in the sequence, the sequence can contain values from multiple rounds of parsing
+ sequence = value;
+ // we have the assigned property name now, and don't need to assign again
+ assignNextName = false;
+ }else{
+ // subsequent part of a property
+ value = value ? first + assignment : first;
+ // add to the current sequence
+ addInSequence(value);
+ }
+ switch(operator){
+ case "'": case '"':
+ // encountered a quoted string, parse through to the end of the string and add to the current sequence
+ var quoteScan = operator == "'" ? singleQuoteScan : doubleQuoteScan;
+ quoteScan.lastIndex = cssScan.lastIndex; // find our current location in the parsing
+ var parsed = quoteScan.exec(textToParse);
+ if(!parsed){ // no match for the end of the string
+ error("unterminated string");
+ }
+ var str = parsed[1]; // the contents of the string
+ // move the css parser up to the end of the string position
+ cssScan.lastIndex = quoteScan.lastIndex;
+ // push the string on the current value and keep parsing
+ addInSequence(new LiteralString(str));
+ continue;
+ case '\\':
+ // escaping
+ var lastIndex = quoteScan.lastIndex++;
+ // add the escaped character to the sequence
+ addInSequence(textToParse.charAt(lastIndex));
+ continue;
+ case '(': case '{': case '[':
+ // encountered a new contents of a rule or a function call
+ var newTarget;
+ var doExtend = false;
+ if(operator == '{'){
+ // it's a rule
+ assignNextName = true; // enter into the beginning of property mode
+ // normalize the selector
+ selector = trim(selector.replace(/\s+/g, ' ').replace(/([\.#:])\S+|\w+/g,function(t, operator){
+ // make tag names be lower case
+ return operator ? t : t.toLowerCase();
+ }));
+ // add this new rule to the current parent rule
+ addInSequence(newTarget = target.newRule(selector), true);
+
+ // todo: check the type
+ if(assignmentOperator == '='){
+ browserUnderstoodRule = false;
+ if(!assignment || assignment.charAt(1) == '>'){
+ sequence.creating = true;
+ }
+ if(value){
+ // extend the referenced target value
+ // TODO: create auto-generate class?
+ doExtend = true;
+ }
+ }
+ if(target.root && browserUnderstoodRule){
+ // we track the native CSSOM rule that we are attached to so we can add properties to the correct rule
+ var lastRuleIndex = ruleIndex;
+ var nextRule;
+ while((nextRule = styleSheet.cssRules[ruleIndex++])){
+ if(nextRule.selectorText == selector){
+ // found it
+ newTarget.cssRule = nextRule;
+ break;
+ }
+ }
+ if(!nextRule){
+ // didn't find it
+ newTarget.ruleIndex = ruleIndex = lastRuleIndex;
+ newTarget.styleSheet = styleSheet;
+ //console.warn("Unable to find rule ", selector, "existing rule did not match", nextRule.selectorText);
+ }
+ }
+ }else{
+ // it's a call, add it in the current sequence
+ var callParts = value.match(/(.*?)([\w-]*)$/);
+ addInSequence(newTarget = target.newCall(callParts[2], sequence, target));
+ newTarget.ref = model.resolveProperty(target, callParts[2]);
+ (sequence.calls || (sequence.calls = [])).push(newTarget);
+ }
+ // make the parent reference
+ newTarget.parent = target;
+ if(sequence.creating){
+ // in generation, we auto-generate selectors so we can reference them
+ newTarget.selector = '.x-generated-' + nextId++;
+ }else{
+ newTarget.selector = target.root ? selector : target.selector + ' ' + selector;
+ }
+ if(doExtend){
+ var ref = model.resolveProperty(target, value.match(/[^\s]+$/)[0], true);
+ if(ref){
+ extend(ref, newTarget);
+ }
+ }
+
+ // store the current state information so we can restore it when exiting this rule or call
+ target.currentName = name;
+ target.currentSequence = sequence;
+ target.assignmentOperator = assignmentOperator;
+ // if it has a pseudo, call the pseudo handler
+ if(assignmentOperator == ':'){
+ // TODO: use when()
+ var pseudoHandler = model.resolveProperty(target, value);
+ if(pseudoHandler && pseudoHandler.pseudo){
+ pseudoHandler.pseudo(target, value);
+ }
+ }
+
+ // add to the stack
+ stack.push(target = newTarget);
+ target.operator = operator;
+ target.start = cssScan.lastIndex;
+ selector = '';
+ name = null;
+ sequence = null;
+ continue;
+ }
+ if(sequence){
+ // now see if we need to process an assignment or directive
+ var first = sequence[0];
+ if(first.charAt && first.charAt(0) == "@"){
+ // it's a directive
+ if(sequence[0].slice(1,7) == "import"){
+ // get the stylesheet
+ var importedSheet = parse.getStyleSheet(styleSheet.cssRules[ruleIndex++], sequence, styleSheet);
+ //waiting++;
+ // preserve the current index, as we are using a single regex to be shared by all parsing executions
+ var currentIndex = cssScan.lastIndex;
+ // parse the imported stylesheet
+ parseSheet(importedSheet.localSource, importedSheet);
+ // now restore our state
+ cssScan.lastIndex = currentIndex;
+ }
+ }else if(assignmentOperator){
+ // need to do an assignment
+ try{
+ target[assignmentOperator == ':' ? 'setValue' : 'declareProperty'](name, sequence, conditionalAssignment);
+ }catch(e){
+ console.error("Error on line ", textToParse.slice(0, cssScan.lastIndex).split('\n').length, "in", styleSheet.href, e.stack || e);
+ }
+ }
+ }
+ switch(operator){
+ case ':':
+ // assignment can happen after a property declaration
+ if(assignmentOperator == '='){
+ assignNextName = true;
+ assignmentOperator = ':';
+ }else{
+ // a double pseudo
+ addInSequence(':');
+ }
+ break;
+ case '}': case ')': case ']':
+ // end of a rule or function call
+ // clear the name now
+ if(operatorMatch[target.operator] != operator){
+ console.error('Incorrect opening operator ' + target.operator + ' with closing operator ' + operator);
+ }
+ name = null;
+ // record the cssText
+ var ruleCssText = textToParse.slice(target.start, cssScan.lastIndex - 1);
+ target.cssText = target.cssText ?
+ target.cssText + ';' + ruleCssText : ruleCssText;
+
+ if(operator == '}'){
+ // if it is rule, call the rule handler
+ target.onRule(target.selector, target);
+ // TODO: remove this conditional, now that we use assignment
+ /*if(target.selector.slice(0,2) != "x-"){// don't trigger the property for the property registration
+ target.eachProperty(onProperty);
+ }*/
+ browserUnderstoodRule = true;
+ selector = '';
+ }/*else if(operator == ')'){
+ // call handler
+ onCall(target.caller, target);
+ }*/
+ // now pop the call or rule off the stack and restore the state
+ stack.pop();
+ target = stack[stack.length - 1];
+ sequence = target.currentSequence;
+ name = target.currentName;
+ assignmentOperator = target.assignmentOperator;
+ if(target.root && operator == '}'){
+ // CSS ASI
+ assignNextName = true;
+ assignmentOperator = false;
+ }
+ break;
+ case "":
+ // no operator means we have reached the end of the text to parse
+ return;
+ case ';':
+ // end of a property, end the sequence return to the beginning of propery mode
+ sequence = null;
+ assignNextName = true;
+ browserUnderstoodRule = false;
+ assignmentOperator = false;
+ selector = '';
+ }
+ }
+ }
+ }
+ return parse;
+});define("xstyle/main", ["require", "xstyle/core/parser", "xstyle/core/ruleModel", "xstyle/core/elemental"], function (require, parser, ruleModel, elemental) {
+ "use strict";
+ function search(tag){
+ // used to search for link and style tags
+ var elements = document.getElementsByTagName(tag);
+ for(var i = 0; i < elements.length; i++){
+ checkImports(elements[i]);
+ }
+ }
+ elemental.ready(function(){
+ // search the document for <link> and <style> elements to potentially parse.
+ search('link');
+ search('style');
+ });
+ // traverse the @imports to load the sources
+ function checkImports(element, callback, fixedImports){
+ var sheet = element.sheet || element.styleSheet || element;
+ var needsParsing = sheet.needsParsing, // load-imports can check for the need to parse when it does it's recursive look at imports
+ cssRules = sheet.rules || sheet.cssRules;
+ function fixImports(){
+ // need to fix imports, applying load-once semantics for all browsers, and flattening for IE to fix nested @import bugs
+ require(["xstyle/core/load-imports"], function(load){
+ load(element, function(){
+ checkImports(element, callback, true);
+ });
+ });
+ }
+ if(sheet.imports && !fixedImports && sheet.imports.length){
+ // this is how we check for imports in IE
+ return fixImports();
+ }
+ if(!needsParsing){
+ for(var i = 0; i < cssRules.length; i++){
+ var rule = cssRules[i];
+ if(rule.href && !fixedImports){
+ // it's an import (for non-IE browsers)
+ return fixImports();
+ }
+ if(rule.selectorText && rule.selectorText.substring(0,2) == "x-"){
+ // an extension is used, needs to be parsed
+ needsParsing = true;
+ if(/^'/.test(rule.style.content)){
+ // this means we are in a built sheet, and can directly parse it
+ // TODO: parse here
+ }
+ }
+ }
+ }
+ // ok, determined that CSS extensions are in the CSS, need to get the source and really parse it
+ parse(sheet.localSource || (sheet.ownerNode || sheet.ownerElement).innerHTML, sheet, callback);
+ }
+ parser.getStyleSheet = function(importRule, sequence){
+ return importRule.styleSheet;
+ };
+ function parse(textToParse, styleSheet, callback) {
+ // this function is responsible for parsing a stylesheet with all of xstyle's syntax rules
+
+ // normalize the stylesheet.
+ if(!styleSheet.addRule){
+ // only FF doesn't have this
+ styleSheet.addRule = function(selector, style, index){
+ return this.insertRule(selector + "{" + style + "}", index >= 0 ? index : this.cssRules.length);
+ }
+ }
+ if(!styleSheet.deleteRule){
+ styleSheet.deleteRule = styleSheet.removeRule;
+ }
+
+
+ var waiting = 1;
+ // determine base url
+ var baseUrl = (styleSheet.href || location.href).replace(/[^\/]+$/,'');
+
+ // keep references
+ ruleModel.css = textToParse;
+
+ // call the parser
+ parser(ruleModel, textToParse, styleSheet);
+
+ function finishedLoad(){
+ // this is called after each asynchronous action is completed, allowing us to determine
+ // when everything is complete
+ if(--waiting == 0){
+ if(callback){
+ callback(styleSheet);
+ }
+ }
+ }
+ // synchronous completion
+ finishedLoad(ruleModel);
+ return ruleModel;
+ }
+
+ var xstyle = {
+ process: checkImports,
+ parse: parse,
+
+ load: function(resourceDef, require, callback, config){
+ // support use an AMD plugin loader
+ require(['xstyle/css'], function(plugin){
+ plugin.load(resourceDef, require, callback, config);
+ });
+ }
+ };
+ return xstyle;
+
+});
View
4 xstyle.min.js
@@ -1,4 +1,4 @@
-(function(){var e=document,r=e.scripts,t=r[r.length-1],n=t.src.replace(/[^\/]+\/xstyle[^\/]*js/,"");define=function(r,i,o){function l(){if(1>--s){for(var e=f.result=o&&o.apply(this,i),r=f.callbacks,t=0;r.length>t;t++)r[t](e);f.callbacks=0}}o||(o=i,i=r,r="put-selector/put");for(var s=1,c=0;i.length>c;c++){var u=i[c],f=a[u];if(!f){f=a[u]={callbacks:[]};var v=e.createElement("script");v.src=n+u+".js",t.parentNode.insertBefore(v,t)}f.callbacks?(s++,f.callbacks.push(function(e){return function(r){i[e]=r,l()}}(c))):i[c]=f.result}f=a[r]||(a[r]={callbacks:[]}),l()},require=function(e,r){define("",e,r)};var a={require:{result:require}}})(),function(e){var r,t=/[-+,> ]/;e([],r=function(e,n){"use strict";function a(r,t){r.appendChild(e.createTextNode(t))}function i(r){function n(){d&&p&&d!=p&&(p==r&&(u||(u=t.test(y)&&e.createDocumentFragment()))||p).insertBefore(d,v||null)}for(var u,f,v,p,d,h=arguments,g=h[0],m=0;h.length>m;m++){var y=h[m];if("object"==typeof y){if(f=!1,y instanceof Array){d=e.createDocumentFragment();for(var x=0;y.length>x;x++)d.appendChild(i(y[x]));y=d}if(y.nodeType)d=y,n(),p=y,v=0;else for(var x in y)d[x]=y[x]}else if(f)f=!1,a(d,y);else{1>m&&(r=null),f=!0;var S=y.replace(l,function(t,l,u,f,g,x){l&&(n(),"-"==l||"+"==l?(p=(v=d||p).parentNode,d=null,"+"==l&&(v=v.nextSibling)):("<"==l?p=d=(d||p).parentNode:(","==l?p=r:d&&(p=d),d=null),v=0),d&&(p=d));var S=!u&&f;if(S||!d&&(u||g))if("$"==S)a(p,h[++m]);else{S=S||i.defaultTag;var R=c&&h[m+1]&&h[m+1].name;R&&(S="<"+S+' name="'+R+'">'),d=s&&~(o=S.indexOf("|"))?e.createElementNS(s[S.slice(0,o)],S.slice(o+1)):e.createElement(S)}if(u)if("$"==f&&(f=h[++m]),"#"==u)d.id=f;else{var b=d.className,w=b&&(" "+b+" ").replace(" "+f+" "," ");if("."==u)d.className=b?(w+f).substring(1):f;else if("!"==y){var E;c?i("div",d,"<").innerHTML="":(E=d.parentNode)&&E.removeChild(d)}else w=w.substring(1,w.length-1),w!=b&&(d.className=w)}if(g)if("$"==x&&(x=h[++m]),"style"==g)d.style.cssText=x;else{var N="!"==g.charAt(0)?(g=g.substring(1))&&"removeAttribute":"setAttribute";x=""===x?g:x,s&&~(o=g.indexOf("|"))?d[N+"NS"](s[g.slice(0,o)],g.slice(o+1),x):d[N](g,x)}return""});if(S)throw new SyntaxError("Unexpected char "+S+" in "+y);n(),p=g=d||p}}return r&&u&&r.appendChild(u),g}t=n||t;var o,l=/(?:\s*([-+ ,<>]))?\s*(\.|!\.?|#)?([-\w%$|]+)?(?:\[([^\]=]+)=?['"]?([^\]'"]*)['"]?\])?/g,s=!1,e=e||document,c="object"==typeof e.createElement;return i.addNamespace=function(r,t){e.createElementNS?(s||(s={}))[r]=t:e.namespaces.add(r,t)},i.defaultTag="div",i.forDocument=r,i})}(function(e,r,t){t=t||r,"function"==typeof define?define([],function(){return t()}):"undefined"==typeof window?require("./node-html")(module,t):put=t()}),define("xstyle/main",["require","put-selector/put"],function(e,r){"use strict";function t(e,r){return e&&e.then?e.then(r):r(e)}function n(e,r,a){return t(e,function(e){var t=r[0];return e?t&&e.get?n(e.get(t),r.slice(1),a):e.receive?e.receive(t?function(e){n(e,r,a)}:a):t?n(e[t],r.slice(1),a):(a(e),void 0):a(t||e)})}function a(e,r,t){n(e,r.slice(0,r.length-1),function(e){var n=r[r.length-1];e.set?e.set(n,t):e[n]=t})}function i(e){for(var r=A.getElementsByTagName(e),t=0;r.length>t;t++)c(r[t])}function o(){return this.join("")}function l(e){return e.toString=o,e}function s(e){this.value=e}function c(r,t,n){function a(){e(["xstyle/load-imports"],function(e){e(r,function(){c(r,t,!0)})})}var i=r.sheet||r.styleSheet||r,o=i.needsParsing,l=i.rules||i.cssRules;if(i.imports&&!n&&i.imports.length)return a();if(!o)for(var s=0;l.length>s;s++){var f=l[s];if(f.href&&!n)return a();f.selectorText&&"x-"==f.selectorText.substring(0,2)&&(o=!0,/^'/.test(f.style.content))}u(i.localSource||(i.ownerNode||i.ownerElement).innerHTML,i,t)}function u(r,n,a){function i(e,r,t){var n=k[e]||(k[e]={});n[r]=t}function o(e){k[e]||(k[e]={}),i("selector","x-"+e,{onRule:function(r){r.eachProperty(function(r,t){var n=""+t;do{var a=n.match(/([^, \(]+)(?:[, ]+(.+))?/);if(!a)return;var o=a[1];if("module"==o)return i(e,r,t[1].args[0]);if("default"==o){if("pseudo"==e)try{return A.querySelectorAll("x:"+r),void 0}catch(l){}}else if("prefix"!=o)return i(e,r,function(){return t})}while(n=a[2])})}})}function c(){}function f(e){this.caller=e,this.args=[]}function v(e,r){r.onRule();var t=k.selector[e];t&&d(t,"onRule",r)}function p(e,r){var t=k.pseudo[e];t&&d(t,"onPseudo",e,r)}function d(r,t,a,i){if(r){var o=q,l=function(e){"string"==typeof e&&n.addRule(o.fullSelector(),e),N()};P++;var s=function(e){function r(e){console.error("Error occurred processing "+t.slice(2).toLowerCase()+" "+a+("{"==o.operator?' in rule "'+o.selector+'" {'+o.cssText:"")+". "+e.message),e&&console.error(e)}try{var s=e[t](a,i,o,n);o instanceof f&&(o.result=s),s&&s.then?s.then(l,r):l(s)}catch(c){r(c)}};"string"==typeof r?e([r],s):s(r)}}function h(e,r){function t(e,r){r||(o+=e),g?g.push?"string"==typeof g[g.length-1]&&"string"==typeof e?g[g.length-1]+=e:e&&g.push(e):"string"==typeof g&&"string"==typeof e?g+=e:g=l([g,e]):g=e}q=$,S.lastIndex=0;for(var n=0,i=!0,o="",c=!0;;){var f,d,g,m,N=S.exec(e),A=N[4],I=N[1],k=N[2],O=N[3];switch(O=O&&C(O),I=C(I),c?(k?(o=d=I,f=k.charAt(0),m="?"==k.charAt(1)):o=O=I,g=O,(d||"/"!=A)&&(c=!1)):(O=O?I+k:I,t(O)),A){case"'":case'"':var L="'"==A?R:b;L.lastIndex=S.lastIndex;var V=L.exec(e);V||error("unterminated string");var j=V[1];S.lastIndex=L.lastIndex,t(new s(j));continue;case"/":"*"==e[S.lastIndex]?(w.lastIndex=S.lastIndex+1,w.exec(e),S.lastIndex=w.lastIndex):t("/");continue;case"\\":var B=L.lastIndex++;t(e.charAt(B));continue;case"(":case"{":case"[":var D,F=!1;if("{"==A)c=!0,t(D=q.newRule(o),!0),f&&(i=!1,k&&">"!=k.charAt(1)||(g.creating=!0),"="==f&&O&&(F=!0)),q.root&&i&&(D.cssRule=r.cssRules[n++]);else{var z=O.match(/(.*?)([\w-]*)$/);t(D=q.newCall(z[2],g,q)),D.ref=y(q,z[2]),(g.calls||(g.calls=[])).push(D)}if(D.parent=q,D.selector=g.creating?".x-generated-"+E++:q.root?o:q.selector+" "+o,F){var _=y(q,O.match(/[^\s]+$/)[0],!0);_&&x(_,D)}q.currentName=d,q.currentSequence=g,q.assignmentOperator=f,M.push(q=D),q.operator=A,q.start=S.lastIndex,o="",q.selector&&q.selector.replace(/:([-\w]+)/,function(e,r){p(r,q)}),d=null,g=null;continue}if(g){var I=g[0];if(I.charAt&&"@"==I.charAt(0)){if("import"==g[0].slice(1,7)){var H=u.getStyleSheet(r.cssRules[n++],g,r);P++;var U=S.lastIndex;h(H.localSource,H),S.lastIndex=U}}else try{q[":"==f?"setValue":"declareProperty"](d,g,m)}catch(K){console.error(K.stack||K)}}switch(A){case":":c=!0,f=":";break;case"}":case")":case"]":T[q.operator]!=A&&console.error("Incorrect opening operator "+q.operator+" with closing operator "+A),d=null,q.cssText=e.slice(q.start,S.lastIndex-1),"}"==A&&(v(q.selector,q),i=!0,o=""),M.pop(),q=M[M.length-1],g=q.currentSequence,d=q.currentName,f=q.assignmentOperator,q.root&&"}"==A&&(c=!0,f=!1);break;case"":return a&&a(),void 0;case";":g=null,c=!0,i=!1,f=!1,o=""}}}function N(){0==--P&&a&&a(n)}n.addRule||(n.addRule=function(e,r,t){return this.insertRule(e+"{"+r+"}",t>=0?t:this.cssRules.length)}),n.deleteRule||(n.deleteRule=n.removeRule);var k={property:{}};o("property"),o("function"),o("pseudo"),k["function"]["var"]=j,k["function"]["extends"]=j;var P=1;(n.href||location.href).replace(/[^\/]+$/,""),c.prototype={eachProperty:function(e){for(var r=this.values||0,t=0;r.length>t;t++){var n=r[t];e.call(this,n||"unnamed",r[n])}},fullSelector:function(){return(this.parent?this.parent.fullSelector():"")+(this.selector||"")+" "},newRule:function(e){return(this.rules||(this.rules={}))[e]=new c},newCall:function(e){var r=new f(e);return r},addSheetRule:function(e,r){if(r&&"@"!=e.charAt(0)){var t=n.addRule(e,r);return-1==t&&(t=n.cssRules.length-1),n.cssRules[t]}},onRule:function(){this.getCssRule()},getCssRule:function(){return this.cssRule||(this.cssRule=this.addSheetRule(this.selector,this.cssText)),this.cssRule},get:function(e){return this.values[e]},declareProperty:function(e,r,t){if(">"==(""+r[0]).charAt(0)){if(!e)return this.generator=r,r=g(r,this),j.addRenderer("",r,this,r),void 0}else{var n=e in I.style||y(this,e);if(!t||!n){var a=this.properties||(this.properties={});a[e]=r,n&&console.warn('Overriding existing property "'+e+'"')}}},setValue:function(e,r){var n=this.values||(this.values=[]);n.push(e),n[e]=r;var a=r.calls;if(a)for(var i=0;a.length>i;i++){var o=a[i],l=o.ref;l&&"function"==typeof l.call&&l.call(o,this,e,r)}if(e)do{var s=y(this,e);if(s){var c=this;t(m(c,e,s),function(t){t=t.splice?t:[t];for(var n=0;t.length>n;n++){var a=t[n];if(a.put(r,c,e))break}});break}e=e.substring(0,e.lastIndexOf("-"))}while(e)},cssText:""};var L=f.prototype=new c;L.declareProperty=L.setValue=function(e,r){this.args.push(r)},L.toString=function(){var e=this.operator;return e+this.args+T[e]};var q,$=new c;$.root=!0,$.properties={Math:Math,module:function(r){return{then:function(t){e([r],t)}}},item:{forElement:function(e){for(;!e.item;)e=e.parentNode;return{element:e,receive:function(r){r(e.item)}}}},prefix:{put:function(e,r,t){return"string"==typeof I.style[O+t]?r.addSheetRule(r.selector,O+t+":"+e):void 0}},"var":{put:function(e,r,t){(r.variables||(r.variables={}))[t]=e;var n=r.variableListeners;n=n&&n[t]||0;for(var a=0;n.length>a;a++)n[a](e)},call:function(e,r,t,n){this.receive(function(e){r.addSheetRule(r.selector,t+": "+(""+n).replace(/var\([^)]+\)/g,e))},r,e.args[0])},receive:function(e,r,t){var n=r;do{var a=n.variables&&n.variables[t];if(a){var i=n.variableListeners||(n.variableListeners={});return(i[t]||(i[t]=[])).push(e),e(a)}n=n.parent}while(n);e()}},on:{put:function(e,r,t){console.log("add event listener"),m(r,t,e)}}},$.css=r,$.parse=h;var M=[$];return h(r,n),N(q),$}function f(e){return L[e]}function v(){if(i("link"),i("style"),!P)if(P=!0,f("dom-qsa2.1")){for(var e=0,r=$.length;r>e;e++)p($[e]);d()}else for(var t=A.all,e=0,r=t.length;r>e;e++)h(t[e])}function p(e){for(var r=A.querySelectorAll(e.selector),t=e.name,n=0,a=r.length;a>n;n++){var i=r[n],o=i.elementalStyle,l=i.elementalSpecificities;o||(o=i.elementalStyle={},l=i.elementalSpecificities={});var s=i.renderings;s||(s=i.renderings=[],M.push(i)),s.push({name:t,rendered:o[t]==e.propertyValue,renderer:e}),o[t]=e.propertyValue}}function d(){for(var e=0;M.length>e;e++){var t=M[e],n=t.renderings,a=t.elementalStyle;delete t.renderings;for(var i=0;n.length>i;i++){var o=n[i],l=o.renderer,s=l.rendered;if(V=a[o.name]==l.propertyValue,!s&&V)try{l.render(t)}catch(c){console.error(c,c.stack),r(t,"div.error",""+c)}s&&!V&&l.unrender&&(l.unrender(t),n.splice(i--,1))}}M=[]}function h(e,r){for(var t=0,n=$.length;n>t;t++){var a=$[t];r&&r!=a.selector||(q?!q.call(e,a.selector):e.currentStyle[a.name]!=a.propertyValue)||a.render(e)}}function g(e,n){return E++,e=e.sort?e:[e],function(a,i){for(var o=a,l=0,s=e.length;s>l;l++){var c=e[l];try{if(c.eachProperty)if(c.args)if("("==c.operator){var u=e[l+1];u&&u.eachProperty&&r(o,u.selector);var f=""+c.args,v=m(c,0,f);(function(e,a){t(v,function(t){t.forElement&&(t=t.forElement(a));var i=e.appendChild(A.createTextNode("Loading"));t.receive(function(n){if(n&&n.sort){i&&(i.parentNode.removeChild(i),i=null);var a=u&&u.eachProperty&&u.get("each");a&&(a=g(a,u)),n.forEach(a?function(r){a(e,r)}:function(t){r(e,N[e.tagName]||"div",t)})}else"value"in e?(e.value=n,e["-x-variable"]=t):i.nodeValue=n},n,f)})})(o,a)}else r(o,""+c);else r(o,c.selector),j.update(o,c.selector);else if("string"==typeof c){"="==c.charAt(0)&&(c=c.slice(1));for(var p=c.split(","),d=0,h=p.length;h>d;d++){var y=p[d].trim(),x=null;if(y){y=y.replace(/\([^)]*\)/,function(e){x=e});var S=r(0==d?o:a,y);i&&(S.item=i);var u=e[l+1];S==o||u&&u.eachProperty||j.update(S),o=S}}}else o.appendChild(A.createTextNode(c.value))}catch(R){console.error(R,R.stack),o.appendChild(A.createTextNode(R))}}return o}}function m(e,r,i){function o(){var e,r,i=c.length+1,o=[],l=[],s=function(t){return function(n){if(o[t]=n,i--,0>=i){r=!0,e=h?h.apply(this,o):o[0];for(var a=0;l.length>a;a++)l[a](e)}}};if(!h){var u=c[0],f={then:function(e){l.push(e)}};return t(u[0],function(e){f=e;for(var r=1;u.length>r;r++){if(!f||!f.get){f={receive:function(r){n(e,u.slice(1),r)},put:function(e){a(resolve,u.slice(1),e)}};break}f=f.get(u[r])}for(var r=0;l.length>r;r++)l[r](f)}),f}for(var v=0;c.length>v;v++){var u=c[v];n(u[0],u.slice(1),s(v))}return s(-1)(),e&&e.then?e:{receive:function(t){l&&l.push(t),r&&t(e)}}}var l=e["var-expr-"+r];if(c)return l;var s,c=[];c.id=E++;var u,f=[],v=i.join?i.join(""):""+i,p=v.match(/^[\w_$\/\.-]*$/);if(v=v.replace(/("[^\"]*")|([\w_$\.\/-]+)/g,function(r,t,n){if(n){u=n.split("/");var a=u.join("_");f.push(a),c.push(u);var i=u[0],o=y(e,i);if("string"==typeof o||o instanceof Array)o=m(e,i,o);else if(!o)throw Error('Could not find reference "'+i+'"');return o.forElement&&(s=!0),u[0]=o,a}return r}),p){if(r){var d=function(e,r,n){t(findAttributeInAncestors(e,u[0],u[1]),function(e){for(var r=2;u.length-1>r;r++){var t=u[r];e=e.get?e.get(t):e[t]}var t=u[r];e.set?e.set(t,n):e[t]=n})};d.rule=e}}else var h=Function.apply(this,f.concat(["return xstyleReturn("+v+")"]));return c.func=h,e["var-expr-"+r]=c,e["var-expr-"+r]=s?{forElement:function(r){for(var t,n=r;!q.call(r,e.selector);)r=r.parentNode;for(var a=0;c.length>a;a++){var i=c[a],l=i[0];l.forElement&&(l=i[0]=l.forElement(n));var s=l.element;if(n!=t){for(;n!=s;){if(n==t)return;n=n.parentNode}t=n}}var u=t["expr-result-"+c.id];return u||(t["expr-result-"+c.id]=u=o(),u.element=t),u}}:o()}function y(e,r,t){var n=e;do{var a=n.properties&&n.properties[r]||t&&n.rules&&n.rules[r];n=n.parent}while(!a&&n);return a}function x(e,r){var t=e.cssText;r.cssText+=t,"values,properties,variables,calls".replace(/\w+/g,function(t){e[t]&&(r[t]=Object.create(e[t]))});var n=r.getCssRule();e.eachProperty(function(e,t){if(r.setValue(e,t),e){var a=n.style;a[e]||(a[e]=t)}}),e.generator&&r.declareProperty(null,e.generator)}var S=/\s*([^{\}\[\]\(\)\/\\'":=;]*)([=:]\??\s*([^{\}\[\]\(\)\/\\'":;]*))?([{\}\[\]\(\)\/\\'":;]|$)/g,R=/((?:\\.|[^'])*)'/g,b=/((?:\\.|[^"])*)"/g,w=/\*\//g,E=0,N={TABLE:"tr",TBODY:"tr",TR:"td",UL:"li",OL:"li",SELECT:"option"},T={"{":"}","[":"]","(":")"},A=document,C="".trim?function(e){return e.trim()}:function(e){return e.replace(/^\s+|\s+$/g,"")},I=A.createElement("div");s.prototype.toString=function(){return'"'+this.value.replace(/["\\\n\r]/g,"\\$&")+'"'};var k=navigator.userAgent,O=k.indexOf("WebKit")>-1?"-webkit-":k.indexOf("Firefox")>-1?"-moz-":k.indexOf("MSIE")>-1?"-ms-":k.indexOf("Opera")>-1?"-o-":"";u.getStyleSheet=function(e){return e.styleSheet},A.addEventListener("change",function(e){var r=e.target,t=r["-x-variable"];t.put&&t.put(r.value)});var P,I=A.createElement("div"),L={"dom-qsa2.1":!!I.querySelectorAll},q=I.matches||I.matchesSelector||I.webkitMatchesSelector||I.mozMatchesSelector||I.msMatchesSelector||I.oMatchesSelector,$=[],M=[];/e/.test(A.readyState||"")?setTimeout(v,200):A.addEventListener("DOMContentLoaded",v);var V,j={process:c,vendorPrefix:O,applyProperty:function(e,r){return"opacity"==e&&"-ms-"==O?"filter: alpha(opacity="+100*r+"); zoom: 1;":O+e+":"+r+";"},onFunction:function(){},onCall:function(e,r){function t(){var r=a,t="extends"==e?"rules":"variables";do{if(!r)throw Error('Could not find "'+n[0]+'" in the defined '+t);var i=r[t]&&r[t][n[0]];r=r.parent}while(!i);return i}var n=r.args,a=r.parent;if("extends"==e){var i=t();x(i,a)}else if("var"==e)return function(e){e.addSheetRule(e.selector,e.currentName+": "+(""+e.currentSequence).replace(/var\([^)]+\)/g,t()))}},parse:u,addRenderer:function(e,r,t,n){var a={selector:t.selector,propertyValue:r,name:e,render:n};$.push(a),P&&p(a),d()},update:h,clearRenderers:function(){$=[]},load:function(e,r,t,n){r(["xstyle/css"],function(a){a.load(e,r,t,n)})}};return j}),xstyleReturn=function(e){return 1==arguments.length?e:[].slice.call(arguments)};
+(function(){var e=document,t=e.scripts,r=t[t.length-1],n=r.src.replace(/[^\/]+\/xstyle[^\/]*js/,"");define=function(t,i,l){function s(){if(1>--o){for(var e=f.result=l&&l.apply(this,i),t=f.callbacks,r=0;t.length>r;r++)t[r](e);f.callbacks=0}}l||(l=i,i=t,t="put-selector/put");for(var o=1,c=0;i.length>c;c++){var u=i[c],f=a[u];if(!f){f=a[u]={callbacks:[]};var h=e.createElement("script");h.src=n+u+".js",r.parentNode.insertBefore(h,r)}f.callbacks?(o++,f.callbacks.push(function(e){return function(t){i[e]=t,s()}}(c))):i[c]=f.result}f=a[t]||(a[t]={callbacks:[]}),s()},require=function(e,t){define("",e,t)};var a={require:{result:require}}})(),function(e){var t,r=/[-+,> ]/;e([],t=function(e,n){"use strict";function a(t,r){t.appendChild(e.createTextNode(r))}function i(t){function n(){v&&p&&v!=p&&(p==t&&(u||(u=r.test(y)&&e.createDocumentFragment()))||p).insertBefore(v,h||null)}for(var u,f,h,p,v,d=arguments,g=d[0],m=0;d.length>m;m++){var y=d[m];if("object"==typeof y){if(f=!1,y instanceof Array){v=e.createDocumentFragment();for(var x=0;y.length>x;x++)v.appendChild(i(y[x]));y=v}if(y.nodeType)v=y,n(),p=y,h=0;else for(var x in y)v[x]=y[x]}else if(f)f=!1,a(v,y);else{1>m&&(t=null),f=!0;var S=y.replace(s,function(r,s,u,f,g,x){s&&(n(),"-"==s||"+"==s?(p=(h=v||p).parentNode,v=null,"+"==s&&(h=h.nextSibling)):("<"==s?p=v=(v||p).parentNode:(","==s?p=t:v&&(p=v),v=null),h=0),v&&(p=v));var S=!u&&f;if(S||!v&&(u||g))if("$"==S)a(p,d[++m]);else{S=S||i.defaultTag;var b=c&&d[m+1]&&d[m+1].name;b&&(S="<"+S+' name="'+b+'">'),v=o&&~(l=S.indexOf("|"))?e.createElementNS(o[S.slice(0,l)],S.slice(l+1)):e.createElement(S)}if(u)if("$"==f&&(f=d[++m]),"#"==u)v.id=f;else{var w=v.className,R=w&&(" "+w+" ").replace(" "+f+" "," ");if("."==u)v.className=w?(R+f).substring(1):f;else if("!"==y){var E;c?i("div",v,"<").innerHTML="":(E=v.parentNode)&&E.removeChild(v)}else R=R.substring(1,R.length-1),R!=w&&(v.className=R)}if(g)if("$"==x&&(x=d[++m]),"style"==g)v.style.cssText=x;else{var T="!"==g.charAt(0)?(g=g.substring(1))&&"removeAttribute":"setAttribute";x=""===x?g:x,o&&~(l=g.indexOf("|"))?v[T+"NS"](o[g.slice(0,l)],g.slice(l+1),x):v[T](g,x)}return""});if(S)throw new SyntaxError("Unexpected char "+S+" in "+y);n(),p=g=v||p}}return t&&u&&t.appendChild(u),g}r=n||r;var l,s=/(?:\s*([-+ ,<>]))?\s*(\.|!\.?|#)?([-\w%$|]+)?(?:\[([^\]=]+)=?['"]?([^\]'"]*)['"]?\])?/g,o=!1,e=e||document,c="object"==typeof e.createElement;return i.addNamespace=function(t,r){e.createElementNS?(o||(o={}))[t]=r:e.namespaces.add(t,r)},i.defaultTag="div",i.forDocument=t,i})}(function(e,t,r){r=r||t,"function"==typeof define?define([],function(){return r()}):"undefined"==typeof window?require("./node-html")(module,r):put=r()}),define("xstyle/core/elemental",["put-selector/put"],function(e){function t(e){return c[e]}function r(e){/e/.test(l.readyState||"")?setTimeout(e,200):l.addEventListener("DOMContentLoaded",e)}function n(e){for(var t=l.querySelectorAll(e.selector),r=e.name,n=0,a=t.length;a>n;n++){var i=t[n],s=i.elementalStyle,o=i.elementalSpecificities;s||(s=i.elementalStyle={},o=i.elementalSpecificities={});var c=i.renderings;c||(c=i.renderings=[],h.push(i)),c.push({name:r,rendered:s[r]==e.propertyValue,renderer:e}),s[r]=e.propertyValue}}function a(){for(var t=0;h.length>t;t++){var r=h[t],n=r.renderings,a=r.elementalStyle;delete r.renderings;for(var i=0;n.length>i;i++){var l=n[i],s=l.renderer,o=s.rendered;if(p=a[l.name]==s.propertyValue,!o&&p)try{s.render(r)}catch(c){console.error(c,c.stack),e(r,"div.error",""+c)}o&&!p&&s.unrender&&(s.unrender(r),n.splice(i--,1))}}h=[]}function i(e,t){for(var r=0,n=f.length;n>r;r++){var a=f[r];t&&t!=a.selector||(u?!u.call(e,a.selector):e.currentStyle[a.name]!=a.propertyValue)||a.render(e)}}var l=document;l.addEventListener("change",function(e){var t=e.target,r=t["-x-variable"];r.put&&r.put(t.value)});var s,o=l.createElement("div"),c={"dom-qsa2.1":!!o.querySelectorAll},u=o.matches||o.matchesSelector||o.webkitMatchesSelector||o.mozMatchesSelector||o.msMatchesSelector||o.oMatchesSelector,f=[],h=[];r(function(){if(!s)if(s=!0,t("dom-qsa2.1")){for(var e=0,r=f.length;r>e;e++)n(f[e]);a()}else for(var o=l.all,e=0,r=o.length;r>e;e++)i(o[e])});var p;return{ready:r,addRenderer:function(e,t,r,i){var l={selector:r.selector,propertyValue:t,name:e,render:i};f.push(l),s&&n(l),a()},update:i,clearRenderers:function(){f=[]}}}),define("xstyle/core/ruleModel",["xstyle/core/elemental","put-selector/put"],function(e,t){function r(e,t){return e&&e.then?e.then(t):t(e)}function n(e,t,a){return r(e,function(e){var r=t[0];return e?r&&e.get?n(e.get(r),t.slice(1),a):e.receive?e.receive(r?function(e){n(e,t,a)}:a):r?n(e[r],t.slice(1),a):(a(e),void 0):a(r||e)})}function a(e,t,r){n(e,t.slice(0,t.length-1),function(e){var n=t[t.length-1];e.set?e.set(n,r):e[n]=r})}function i(){}function l(e){this.caller=e,this.args=[]}function s(n,a){return f++,n=n.sort?n:[n],function(i,l){for(var c=i,u=0,f=n.length;f>u;u++){var p=n[u];try{if(p.eachProperty)if(p.args)if("("==p.operator){var d=n[u+1];d&&d.eachProperty&&t(c,d.selector);var g=""+p.args,m=o(p,0,g);(function(e,n){r(m,function(r){r.forElement&&(r=r.forElement(n));var i=e.appendChild(v.createTextNode("Loading"));r.receive(function(n){if(n&&n.sort){i&&(i.parentNode.removeChild(i),i=null);var a=d&&d.eachProperty&&d.get("each");a&&(a=s(a,d)),n.forEach(a?function(t){a(e,t)}:function(r){t(e,h[e.tagName]||"div",r)})}else"value"in e?(e.value=n,e["-x-variable"]=r):i.nodeValue=n},a,g)})})(c,i)}else t(c,""+p);else t(c,p.selector),e.update(c,p.selector);else if("string"==typeof p){"="==p.charAt(0)&&(p=p.slice(1));for(var y=p.split(","),x=0,S=y.length;S>x;x++){var b=y[x].trim(),w=null;if(b){b=b.replace(/\([^)]*\)/,function(e){w=e});var R=t(0==x?c:i,b);l&&(R.item=l);var d=n[u+1];R==c||d&&d.eachProperty||e.update(R),c=R}}}else c.appendChild(v.createTextNode(p.value))}catch(E){console.error(E,E.stack),c.appendChild(v.createTextNode(E))}}return c}}function o(e,t,i){function l(){var e,t,i=h.length+1,l=[],s=[],o=function(r){return function(n){if(l[r]=n,i--,0>=i){t=!0,e=y?y.apply(this,l):l[0];for(var a=0;s.length>a;a++)s[a](e)}}};if(!y){var c=h[0],u={then:function(e){s.push(e)}};return r(c[0],function(e){u=e;for(var t=1;c.length>t;t++){if(!u||!u.get){u={receive:function(t){n(e,c.slice(1),t)},put:function(t){a(e,c.slice(1),t)}};break}u=u.get(c[t])}for(var t=0;s.length>t;t++)s[t](u)}),u}for(var f=0;h.length>f;f++){var c=h[f];n(c[0],c.slice(1),o(f))}return o(-1)(),e&&e.then?e:{receive:function(r){s&&s.push(r),t&&r(e)}}}var s=e["var-expr-"+t];if(h)return s;var u,h=[];h.id=f++;var p,v=[],d=i.join?i.join(""):""+i,g=d.match(/^[\w_$\/\.-]*$/);if(d=d.replace(/("[^\"]*")|([\w_$\.\/-]+)/g,function(t,r,n){if(n){p=n.split("/");var a=p.join("_");v.push(a),h.push(p);var i=p[0],l=c(e,i);if("string"==typeof l||l instanceof Array)l=o(e,i,l);else if(!l)throw Error('Could not find reference "'+i+'"');return l.forElement&&(u=!0),p[0]=l,a}return t}),g){if(t){var m=function(e,t,n){r(findAttributeInAncestors(e,p[0],p[1]),function(e){for(var t=2;p.length-1>t;t++){var r=p[t];e=e.get?e.get(r):e[r]}var r=p[t];e.set?e.set(r,n):e[r]=n})};m.rule=e}}else var y=Function.apply(this,v.concat(["return xstyleReturn("+d+")"]));return h.func=y,e["var-expr-"+t]=h,e["var-expr-"+t]=u?{forElement:function(t){for(var r,n=t;!S.call(t,e.selector);)t=t.parentNode;for(var a=0;h.length>a;a++){var i=h[a],s=i[0];s.forElement&&(s=i[0]=s.forElement(n));var o=s.element;if(n!=r){for(;n!=o;){if(n==r)return;n=n.parentNode}r=n}}var c=r["expr-result-"+h.id];return c||(r["expr-result-"+h.id]=c=l(),c.element=r),c}}:l()}function c(e,t,r){var n=e;do{var a=n.properties&&n.properties[t]||r&&n.rules&&n.rules[t];n=n.parent}while(!a&&n);return a}var u,f=0,h={TABLE:"tr",TBODY:"tr",TR:"td",UL:"li",OL:"li",SELECT:"option"},p={"{":"}","[":"]","(":")"},v=document,d=v.createElement("div"),g=navigator.userAgent,m=g.indexOf("WebKit")>-1?"-webkit-":g.indexOf("Firefox")>-1?"-moz-":g.indexOf("MSIE")>-1?"-ms-":g.indexOf("Opera")>-1?"-o-":"";i.prototype={eachProperty:function(e){for(var t=this.values||0,r=0;t.length>r;r++){var n=t[r];e.call(this,n||"unnamed",t[n])}},fullSelector:function(){return(this.parent?this.parent.fullSelector():"")+(this.selector||"")+" "},newRule:function(e){return(this.rules||(this.rules={}))[e]=new i},newCall:function(e){var t=new l(e);return t},addSheetRule:function(e,t){if(t&&"@"!=e.charAt(0))try{var r=this.styleSheet.addRule(e,t,this.ruleIndex);return-1==r&&(r=this.styleSheet.cssRules.length-1),u.cssRules[r]}catch(n){console.warn("Unable to add rule",n)}},onRule:function(){this.getCssRule()},getCssRule:function(){return this.cssRule||(this.cssRule=this.addSheetRule(this.selector,this.cssText)),this.cssRule},get:function(e){return this.values[e]},declareProperty:function(t,r,n){if(">"==(""+r[0]).charAt(0)){if(!t)return this.generator=r,r=s(r,this),e.addRenderer("",r,this,r),void 0}else{var a=t in d.style||c(this,t);if(!n||!a){var i=this.properties||(this.properties={});i[t]=o(this,t,r),a&&console.warn('Overriding existing property "'+t+'"')}}},setValue:function(e,t){var n=this.values||(this.values=[]);n.push(e),n[e]=t;var a=t.calls;if(a)for(var i=0;a.length>i;i++){var l=a[i],s=l.ref;s&&"function"==typeof s.call&&s.call(l,this,e,t)}if(e){var o=e;do{var u=c(this,e);if(u){var f=this;r(u,function(e){e=e.splice?e:[e];for(var r=0;e.length>r;r++){var n=e[r],a=n.put&&n.put(t,f,o);if(a){a.then&&a.then(function(){});break}}});break}e=e.substring(0,e.lastIndexOf("-"))}while(e)}},cssText:""};var y=l.prototype=new i;y.declareProperty=y.setValue=function(e,t){this.args.push(t)},y.toString=function(){var e=this.operator;return e+this.args+p[e]};var x=!!v.addEventListener,S=d.matches||d.webkitMatchesSelector||d.msMatchesSelector||d.mozMatchesSelector,b=new i;return b.root=!0,b.properties={Math:Math,module:function(e){return{then:function(t){require([e],t)}}},item:{forElement:function(e){for(;!e.item;)e=e.parentNode;return{element:e,receive:function(t){t(e.item)}}}},prefix:{put:function(e,t,r){return"string"==typeof d.style[m+r]?t.addSheetRule(t.selector,m+r+":"+e):void 0}},"var":{put:function(e,t,r){(t.variables||(t.variables={}))[r]=e;var n=t.variableListeners;n=n&&n[r]||0;for(var a=0;n.length>a;a++)n[a](e)},call:function(e,t,r,n){this.receive(function(e){t.addSheetRule(t.selector,r+": "+(""+n).replace(/var\([^)]+\)/g,e))},t,e.args[0])},receive:function(e,t,r){var n=t;do{var a=n.variables&&n.variables[r];if(a){var i=n.variableListeners||(n.variableListeners={});return(i[r]||(i[r]=[])).push(e),e(a)}n=n.parent}while(n);e()}},on:{put:function(e,t,r){var a=this.on;n(o(t,r,e),0,function(e){a(document,r.slice(3),t.selector,e)})},on:function(e,t,r,n){function a(e){r=r||rule.fullSelector(),S.call(e.target,r)&&n(e)}x?e.addEventListener(t,a,!1):e.attachEvent(t,a)}}},xstyleReturn=function(e){return 1==arguments.length?e:[].slice.call(arguments)},b.setStyleSheet=function(e){u=e},b.resolveProperty=c,b}),define("xstyle/core/parser",[],function(){function e(){return this.join("")}function t(t){return t.toString=e,t}function r(e){this.value=e}function n(e,t){var r=e.cssText;t.cssText+=r,"values,properties,variables,calls".replace(/\w+/g,function(r){e[r]&&(t[r]=Object.create(e[r]))}),e.eachProperty(function(e,r){t.setValue(e,r)}),e.generator&&t.declareProperty(null,e.generator)}function a(e,h,p){function v(h,p){function g(e,r){r||(x+=e),R?R.push?"string"==typeof R[R.length-1]&&"string"==typeof e?R[R.length-1]+=e:e&&R.push(e):"string"==typeof R&&"string"==typeof e?R+=e:R=t([R,e]):R=e}h=h.replace(o,""),target=e,i.lastIndex=0;for(var m=0,y=!0,x="",S=!0;;){var b,w,R,E,T=i.exec(h),N=T[4],A=T[1],k=T[2],I=T[3];switch(I=I&&f(I),A=f(A),S?(k?(x=w=A,b=k.charAt(0),E="?"==k.charAt(1)):x=I=A,R=I,S=!1):(I=I?A+k:A,g(I)),N){case"'":case'"':var C="'"==N?l:s;C.lastIndex=i.lastIndex;var L=C.exec(h);L||error("unterminated string");var M=L[1];i.lastIndex=C.lastIndex,g(new r(M));continue;case"\\":var O=C.lastIndex++;g(h.charAt(O));continue;case"(":case"{":case"[":var P,$=!1;if("{"==N){if(S=!0,x=f(x.replace(/\s+/g," ").replace(/([\.#:])\S+|\w+/g,function(e,t){return t?e:e.toLowerCase()})),g(P=target.newRule(x),!0),"="==b&&(y=!1,k&&">"!=k.charAt(1)||(R.creating=!0),I&&($=!0)),target.root&&y){for(var q,V=m;q=p.cssRules[m++];)if(q.selectorText==x){P.cssRule=q;break}q||(P.ruleIndex=m=V,P.styleSheet=p)}}else{var j=I.match(/(.*?)([\w-]*)$/);g(P=target.newCall(j[2],R,target)),P.ref=e.resolveProperty(target,j[2]),(R.calls||(R.calls=[])).push(P)}if(P.parent=target,P.selector=R.creating?".x-generated-"+u++:target.root?x:target.selector+" "+x,$){var B=e.resolveProperty(target,I.match(/[^\s]+$/)[0],!0);B&&n(B,P)}if(target.currentName=w,target.currentSequence=R,target.assignmentOperator=b,":"==b){var D=e.resolveProperty(target,I);D&&D.pseudo&&D.pseudo(target,I)}d.push(target=P),target.operator=N,target.start=i.lastIndex,x="",w=null,R=null;continue}if(R){var A=R[0];if(A.charAt&&"@"==A.charAt(0)){if("import"==R[0].slice(1,7)){var F=a.getStyleSheet(p.cssRules[m++],R,p),z=i.lastIndex;v(F.localSource,F),i.lastIndex=z}}else if(b)try{target[":"==b?"setValue":"declareProperty"](w,R,E)}catch(U){console.error("Error on line ",h.slice(0,i.lastIndex).split("\n").length,"in",p.href,U.stack||U)}}switch(N){case":":"="==b?(S=!0,b=":"):g(":");break;case"}":case")":case"]":c[target.operator]!=N&&console.error("Incorrect opening operator "+target.operator+" with closing operator "+N),w=null;var _=h.slice(target.start,i.lastIndex-1);target.cssText=target.cssText?target.cssText+";"+_:_,"}"==N&&(target.onRule(target.selector,target),y=!0,x=""),d.pop(),target=d[d.length-1],R=target.currentSequence,w=target.currentName,b=target.assignmentOperator,target.root&&"}"==N&&(S=!0,b=!1);break;case"":return;case";":R=null,S=!0,y=!1,b=!1,x=""}}}var d=[e];e.parse=v,v(h,p)}var i=/\s*((?:[^{\}\[\]\(\)\\'":=;]|\[(?:[^\]'"]|'(?:\\.|[^'])*'|"(?:\\.|[^"])*")\])*)([=:]\??\s*([^{\}\[\]\(\)\\'":;]*))?([{\}\[\]\(\)\\'":;]|$)/g,l=/((?:\\.|[^'])*)'/g,s=/((?:\\.|[^"])*)"/g,o=/\/\*[\w\W]*?\*\//g,c={"{":"}","[":"]","(":")"},u=0,f="".trim?function(e){return e.trim()}:function(e){return e.replace(/^\s+|\s+$/g,"")};return r.prototype.toString=function(){return'"'+this.value.replace(/["\\\n\r]/g,"\\$&")+'"'},a}),define("xstyle/main",["require","xstyle/core/parser","xstyle/core/ruleModel","xstyle/core/elemental"],function(e,t,r,n){"use strict";function a(e){for(var t=document.getElementsByTagName(e),r=0;t.length>r;r++)i(t[r])}function i(t,r,n){function a(){e(["xstyle/core/load-imports"],function(e){e(t,function(){i(t,r,!0)})})}var s=t.sheet||t.styleSheet||t,o=s.needsParsing,c=s.rules||s.cssRules;if(s.imports&&!n&&s.imports.length)return a();if(!o)for(var u=0;c.length>u;u++){var f=c[u];if(f.href&&!n)return a();f.selectorText&&"x-"==f.selectorText.substring(0,2)&&(o=!0,/^'/.test(f.style.content))}l(s.localSource||(s.ownerNode||s.ownerElement).innerHTML,s,r)}function l(e,n,a){function i(){0==--l&&a&&a(n)}n.addRule||(n.addRule=function(e,t,r){return this.insertRule(e+"{"+t+"}",r>=0?r:this.cssRules.length)}),n.deleteRule||(n.deleteRule=n.removeRule);var l=1;return(n.href||location.href).replace(/[^\/]+$/,""),r.css=e,t(r,e,n),i(r),r}n.ready(function(){a("link"),a("style")}),t.getStyleSheet=function(e){return e.styleSheet};var s={process:i,parse:l,load:function(e,t,r,n){t(["xstyle/css"],function(a){a.load(e,t,r,n)})}};return s});
/*
-//@ sourceMappingURL=..\xstyle.min.js.map
+//@ sourceMappingURL=xstyle.min.js.map
*/
View
2  xstyle.min.js.map
@@ -1 +1 @@
-{"version":3,"file":"..\\xstyle.min.js","sources":["amdLoader.js","put-selector/put.js","?"],"names":["doc","document","scripts","baseScript","length","baseUrl","src","replace","define","id","deps","factory","loaded","waiting","result","module","apply","this","callbacks","i","dep","modules","node","createElement","parentNode","insertBefore","push","value","require","forDocument","fragmentFasterHeuristic","newFragmentFasterHeuristic","insertTextNode","element","text","appendChild","createTextNode","put","topReferenceElement","insertLastElement","current","referenceElement","fragment","test","argument","createDocumentFragment","nextSibling","lastSelectorArg","args","arguments","returnValue","Array","key","nodeType","leftoverCharacters","selectorParse","t","combinator","prefix","attrName","attrValue","tag","defaultTag","ieInputName","ieCreateElement","name","namespaces","namespaceIndex","indexOf","createElementNS","slice","currentClassName","className","removed","substring","innerHTML","removeChild","style","cssText","method","charAt","SyntaxError","addNamespace","uri","add","window","when","callback","then","get","target","path","receive","set","property","search","elements","getElementsByTagName","checkImports","toStringWithoutCommas","join","arrayWithoutCommas","array","toString","LiteralString","string","fixedImports","fixImports","load","sheet","styleSheet","needsParsing","cssRules","rules","imports","rule","href","selectorText","content","parse","localSource","ownerNode","ownerElement","textToParse","addHandler","type","handlersForType","handlers","addExtensionHandler","onRule","eachProperty","asString","parts","match","first","querySelectorAll","e","Rule","Call","caller","selector","handlerForName","handler","onPseudo","pseudo","ruleHandled","addRule","fullSelector","finishedLoad","onLoad","handleError","error","console","toLowerCase","operator","message","parseSheet","addInSequence","operand","dontAddToSelector","sequence","root","cssScan","lastIndex","ruleIndex","browserUnderstoodRule","assignNextName","assignmentOperator","conditionalAssignment","exec","assignment","trim","quoteScan","singleQuoteScan","doubleQuoteScan","parsed","str","commentScan","newTarget","doExtend","newRule","creating","cssRule","callParts","newCall","ref","resolveProperty","calls","parent","nextId","extend","currentName","currentSequence","stack","start","importedSheet","getStyleSheet","currentIndex","operatorMatch","pop","index","insertRule","deleteRule","removeRule","xstyle","location","prototype","onProperty","values","call","addSheetRule","ruleNumber","getCssRule","declareProperty","conditional","generator","generate","addRenderer","propertyExists","testDiv","properties","warn","setValue","evaluateExpression","splice","segment","lastIndexOf","CallPrototype","Math","mid","item","forElement","vendorPrefix","var","variables","variableListeners","resolvedValue","parentRule","on","log","css","has","feature","features","domReady","documentQueried","l","selectorRenderers","findMatches","renderWaiting","all","update","renderer","results","currentStyle","elementalStyle","currentSpecificities","elementalSpecificities","elementRenderings","renderings","renderQueue","rendered","propertyValue","j","rendering","isCurrent","render","unrender","matchesSelector","generatingSelector","sort","lastElement","part","nextPart","expression","textNode","eachHandler","forEach","childTagForParent","tagName","nodeValue","children","split","cl","child","reference","nextElement","getComputation","isResolved","done","reactiveFunction","variable","resolved","resolve","binding","isElementDependent","attributeParts","parameters","simpleExpression","parameterName","firstReference","Error","reversal","findAttributeInAncestors","Function","concat","func","mostSpecificElement","parentElement","varyOnElement","computation","includeRules","base","derivative","newText","Object","create","ruleStyle","TABLE","TBODY","TR","UL","OL","SELECT","{","[","(","ua","navigator","userAgent","importRule","addEventListener","event","dom-qsa2.1","matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector","readyState","setTimeout","process","applyProperty","onFunction","onCall","extendingRule","namespace","propertyName","clearRenderers","resourceDef","config","plugin","xstyleReturn"],"mappings":"CAIA,WACC,GAAIA,GAAMC,SAENC,EAAUF,EAAIE,QACdC,EAAaD,EAAQA,EAAQE,OAAO,GACpCC,EAAUF,EAAWG,IAAIC,QAAQ,yBAAyB,GAE9DC,QAAS,SAASC,EAAIC,EAAMC,GAgC3B,QAASC,KACR,GAAe,IAAVC,EAAY,CAIhB,IAAI,GAFAC,GAASC,EAAOD,OAASH,GAAWA,EAAQK,MAAMC,KAAMP,GACxDQ,EAAYH,EAAOG,UACfC,EAAI,EAAQD,EAAUd,OAAde,EAAsBA,IACrCD,EAAUC,GAAGL,EAEdC,GAAOG,UAAY,GAvCjBP,IACHA,EAAUD,EACVA,EAAOD,EACPA,EAAK,mBAGN,KAAI,GADAI,GAAU,EACNM,EAAI,EAAMT,EAAKN,OAATe,EAAiBA,IAAI,CAClC,GAAIC,GAAMV,EAA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G,IACHhH,SAAUzB,EAAKyB,SACf0H,cAAeA,EACfrM,KAAM0R,EACNjF,OAAQ5H,EAITyG,GAAkB7N,KAAKkO,GACpBP,GACFG,EAAYI,GAEbH,KASDE,OAAQA,EACRiG,eAAgB,WAEfrG,MAED3I,KAAO,SAASiP,EAAajU,EAAS2D,EAAUuQ,GAE/ClU,GAAS,cAAe,SAASmU,GAChCA,EAAOnP,KAAKiP,EAAajU,EAAS2D,EAAUuQ,MAI/C,OAAOlJ,KAGRoJ,aAAe,SAAS1N,GAEvB,MAAuB,IAApBrF,UAAU7C,OAELkI,KAGEhE,MAAM2I,KAAKhK"}
+{"version":3,"file":"xstyle.min.js","sources":["?"],"names":["doc","document","scripts","baseScript","length","baseUrl","src","replace","define","id","deps","factory","loaded","waiting","result","module","apply","this","callbacks","i","dep","modules","node","createElement","parentNode","insertBefore","push","value","require","forDocument","fragmentFasterHeuristic","newFragmentFasterHeuristic","insertTextNode","element","text","appendChild","createTextNode","put","topReferenceElement","insertLastElement","current","referenceElement","fragment","test","argument","createDocumentFragment","nextSibling","lastSelectorArg","args","arguments","returnValue","Array","key","nodeType","leftoverCharacters","selectorParse","t","combinator","prefix","attrName","attrValue","tag","defaultTag","ieInputName","ieCreateElement","name","namespaces","namespaceIndex","indexOf","createElementNS","slice","currentClassName","className","removed","substring","innerHTML","removeChild","style","cssText","method","charAt","SyntaxError","addNamespace","uri","add","window","has","feature","features","domReady","callback","readyState","setTimeout","addEventListener","findMatches","renderer","results","querySelectorAll","selector","l","currentStyle","elementalStyle","currentSpecificities","elementalSpecificities","elementRenderings","renderings","renderQueue","rendered","propertyValue","renderWaiting","j","rendering","isCurrent","render","e","console","error","stack","unrender","splice","update","selectorRenderers","matchesSelector","call","event","target","variable","documentQueried","testDiv","dom-qsa2.1","matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector","all","ready","addRenderer","propertyName","rule","handler","clearRenderers","elemental","when","then","get","path","receive","set","property","Rule","Call","caller","generate","generatingSelector","nextId","sort","item","lastElement","part","eachProperty","operator","nextPart","expression","evaluateExpression","forElement","textNode","eachHandler","forEach","childTagForParent","tagName","nodeValue","children","split","cl","child","trim","reference","nextElement","getComputation","isResolved","variables","values","done","reactiveFunction","resolved","binding","isElementDependent","attributeParts","parameters","join","simpleExpression","match","string","parameterName","firstReference","resolveProperty","Error","reversal","findAttributeInAncestors","Function","concat","func","mostSpecificElement","parentElement","varyOnElement","computation","includeRules","parentRule","properties","rules","parent","styleSheet","TABLE","TBODY","TR","UL","OL","SELECT","operatorMatch","{","[","(","ua","navigator","userAgent","vendorPrefix","prototype","onProperty","fullSelector","newRule","newCall","addSheetRule","ruleNumber","addRule","ruleIndex","cssRules","warn","onRule","getCssRule","cssRule","declareProperty","conditional","generator","propertyExists","setValue","calls","ref","segment","returned","lastIndexOf","CallPrototype","toString","hasAddEventListener","root","Math","mid","var","variableListeners","resolvedValue","on","listener","select","attachEvent","xstyleReturn","first","setStyleSheet","nextStyleSheet","toStringWithoutCommas","arrayWithoutCommas","array","LiteralString","extend","base","derivative","newText","Object","create","parse","model","textToParse","parseSheet","addInSequence","operand","dontAddToSelector","sequence","commentScan","cssScan","lastIndex","browserUnderstoodRule","assignNextName","assignmentOperator","conditionalAssignment","exec","assignment","quoteScan","singleQuoteScan","doubleQuoteScan","parsed","str","newTarget","doExtend","toLowerCase","creating","nextRule","lastRuleIndex","selectorText","callParts","currentName","currentSequence","pseudoHandler","pseudo","start","importedSheet","getStyleSheet","currentIndex","localSource","href","ruleCssText","pop","parser","ruleModel","search","elements","getElementsByTagName","checkImports","fixedImports","fixImports","load","sheet","needsParsing","imports","content","ownerNode","ownerElement","finishedLoad","index","insertRule","deleteRule","removeRule","location","css","importRule","xstyle","process","resourceDef","config","plugin"],"mappings":"CAIA,WACC,GAAIA,GAAMC,SAENC,EAAUF,EAAIE,QACdC,EAAaD,EAAQA,EAAQE,OAAO,GACpCC,EAAUF,EAAWG,IAAIC,QAAQ,yBAAyB,GAE9DC,QA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