From eb70e5a2aaf3eb0485c8c705f7b8f19a71e438f7 Mon Sep 17 00:00:00 2001 From: tophf Date: Tue, 10 Nov 2020 20:29:23 +0300 Subject: [PATCH] update stylus-lang dependency to 0.54.7 --- background/background-worker.js | 12 +- package-lock.json | 137 +++++++++++++----- package.json | 2 +- tools/build-vendor.js | 2 +- vendor/stylus-lang-bundle/README.md | 4 +- .../stylus-lang-bundle/stylus-renderer.min.js | 105 ++++++++++++++ vendor/stylus-lang-bundle/stylus.min.js | 6 - 7 files changed, 212 insertions(+), 56 deletions(-) create mode 100644 vendor/stylus-lang-bundle/stylus-renderer.min.js delete mode 100644 vendor/stylus-lang-bundle/stylus.min.js diff --git a/background/background-worker.js b/background/background-worker.js index b4d7294b..d1908b1c 100644 --- a/background/background-worker.js +++ b/background/background-worker.js @@ -90,17 +90,11 @@ function getUsercssCompiler(preprocessor) { }, stylus: { preprocess(source, vars) { - loadScript('/vendor/stylus-lang-bundle/stylus.min.js'); + loadScript('/vendor/stylus-lang-bundle/stylus-renderer.min.js'); return new Promise((resolve, reject) => { const varDef = Object.keys(vars).map(key => `${key} = ${vars[key].value};\n`).join(''); - if (!Error.captureStackTrace) Error.captureStackTrace = () => {}; - self.stylus(varDef + source).render((err, output) => { - if (err) { - reject(err); - } else { - resolve(output); - } - }); + new self.StylusRenderer(varDef + source) + .render((err, output) => err ? reject(err) : resolve(output)); }); } }, diff --git a/package-lock.json b/package-lock.json index d871fa70..d6797a9f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1182,8 +1182,7 @@ "atob": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", - "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", - "dev": true + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==" }, "atomic-sleep": { "version": "1.0.0", @@ -1265,8 +1264,7 @@ "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" }, "base": { "version": "0.11.2", @@ -1447,7 +1445,6 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -2038,8 +2035,7 @@ "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, "concat-stream": { "version": "1.6.2", @@ -2144,6 +2140,25 @@ "integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==", "dev": true }, + "css": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/css/-/css-2.2.4.tgz", + "integrity": "sha512-oUnjmWpy0niI3x/mPL8dVEI1l7MnG3+HHyRPHf+YFSbK+svOhXpmSOcDURUh2aOCgl2grzrOPt1nHLuCVFULLw==", + "requires": { + "inherits": "^2.0.3", + "source-map": "^0.6.1", + "source-map-resolve": "^0.5.2", + "urix": "^0.1.0" + } + }, + "css-parse": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/css-parse/-/css-parse-2.0.0.tgz", + "integrity": "sha1-pGjuZnwW2BzPBcWMONKpfHgNv9Q=", + "requires": { + "css": "^2.0.0" + } + }, "css-select": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz", @@ -2217,8 +2232,7 @@ "decode-uri-component": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", - "dev": true + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=" }, "decompress-response": { "version": "3.3.0", @@ -3260,6 +3274,11 @@ "es5-ext": "~0.10.14" } }, + "event-lite": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/event-lite/-/event-lite-0.1.2.tgz", + "integrity": "sha512-HnSYx1BsJ87/p6swwzv+2v6B4X+uxUteoDfRxsAb1S1BePzQqOLevVmkdA15GHJVd9A9Ok6wygUR18Hu0YeV9g==" + }, "event-to-promise": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/event-to-promise/-/event-to-promise-0.8.0.tgz", @@ -3850,8 +3869,7 @@ "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, "fsevents": { "version": "2.1.2", @@ -3995,7 +4013,6 @@ "version": "7.1.6", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -4315,7 +4332,6 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" @@ -4324,8 +4340,7 @@ "inherits": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" }, "ini": { "version": "1.3.5", @@ -5318,7 +5333,6 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, "requires": { "brace-expansion": "^1.1.7" } @@ -5805,7 +5819,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, "requires": { "wrappy": "1" } @@ -5999,6 +6012,11 @@ "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", "dev": true }, + "path-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==" + }, "path-dirname": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", @@ -6014,8 +6032,7 @@ "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "path-is-inside": { "version": "1.0.2", @@ -6481,8 +6498,7 @@ "resolve-url": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", - "dev": true + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=" }, "responselike": { "version": "1.0.2", @@ -6570,14 +6586,12 @@ "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "sax": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", - "dev": true + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" }, "semver": { "version": "5.6.0", @@ -6996,14 +7010,12 @@ "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" }, "source-map-resolve": { "version": "0.5.3", "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", - "dev": true, "requires": { "atob": "^2.1.2", "decode-uri-component": "^0.2.0", @@ -7025,8 +7037,7 @@ "source-map-url": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", - "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", - "dev": true + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=" }, "spawn-sync": { "version": "1.0.15", @@ -7288,10 +7299,59 @@ "resolved": "https://registry.npmjs.org/stylelint-bundle/-/stylelint-bundle-8.0.0.tgz", "integrity": "sha512-kASuh8U4SbfDh12plCbwmIvttR8P/+Y33OwJ2t5GZuradF2Hk9dP27U5cPyqK8HAPw7wbr/LHYwkjQiSL7gh3A==" }, + "stylus": { + "version": "github:stylus/stylus#59bc665db295981d4e3f702e7275c5589a3c6d15", + "from": "github:stylus/stylus#dev", + "requires": { + "css-parse": "~2.0.0", + "debug": "~3.1.0", + "glob": "^7.1.6", + "mkdirp": "~1.0.4", + "safer-buffer": "^2.1.2", + "sax": "~1.2.4", + "semver": "^6.3.0", + "source-map": "^0.7.3" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "requires": { + "ms": "2.0.0" + } + }, + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==" + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" + }, + "source-map": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", + "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==" + } + } + }, "stylus-lang-bundle": { - "version": "0.54.5", - "resolved": "https://registry.npmjs.org/stylus-lang-bundle/-/stylus-lang-bundle-0.54.5.tgz", - "integrity": "sha512-UGd0rNe1aiXAMzOUNiIoH7Y4qVN6poYHZTt/tM6vJ4UWS8negVxds4H25Rm+TDJH8clkd+R8n+3VIaa3C7LbVw==" + "version": "github:openstyles/stylus-lang-bundle#bf8d6972c7583538bd126540b1388f7daba1a570", + "from": "github:openstyles/stylus-lang-bundle#v0.54.7", + "requires": { + "event-lite": "^0.1.2", + "path-browserify": "^1.0.1", + "stylus": "github:stylus/stylus#dev", + "tiny-sha1": "^0.2.1" + } }, "supports-color": { "version": "5.5.0", @@ -7444,6 +7504,11 @@ "globrex": "^0.1.1" } }, + "tiny-sha1": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/tiny-sha1/-/tiny-sha1-0.2.1.tgz", + "integrity": "sha1-onRkudPxv4LpMaRrGqPfmcqSbF4=" + }, "tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", @@ -7786,8 +7851,7 @@ "urix": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", - "dev": true + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=" }, "url-parse-lax": { "version": "3.0.0", @@ -8045,8 +8109,7 @@ "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "write": { "version": "1.0.3", diff --git a/package.json b/package.json index d45040db..5987b01c 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "lz-string-unsafe": "^1.4.4-fork-1", "semver-bundle": "^0.1.1", "stylelint-bundle": "^8.0.0", - "stylus-lang-bundle": "^0.54.5", + "stylus-lang-bundle": "github:openstyles/stylus-lang-bundle#v0.54.7", "usercss-meta": "^0.9.0", "webext-launch-web-auth-flow": "^0.1.0" }, diff --git a/tools/build-vendor.js b/tools/build-vendor.js index 41279fb2..8ebf6512 100644 --- a/tools/build-vendor.js +++ b/tools/build-vendor.js @@ -52,7 +52,7 @@ const files = { 'https://github.com/stylelint/stylelint/raw/{VERSION}/LICENSE → LICENSE' ], 'stylus-lang-bundle': [ - 'stylus.min.js' + 'dist/stylus-renderer.min.js → stylus-renderer.min.js' ], 'usercss-meta': [ 'dist/usercss-meta.min.js → usercss-meta.min.js' diff --git a/vendor/stylus-lang-bundle/README.md b/vendor/stylus-lang-bundle/README.md index ede4337e..14ea2e9c 100644 --- a/vendor/stylus-lang-bundle/README.md +++ b/vendor/stylus-lang-bundle/README.md @@ -1,5 +1,5 @@ -## stylus-lang-bundle v0.54.5 +## stylus-lang-bundle v0.54.7 Following files are copied from npm (node_modules): -* stylus.min.js +* stylus-renderer.min.js: dist\stylus-renderer.min.js diff --git a/vendor/stylus-lang-bundle/stylus-renderer.min.js b/vendor/stylus-lang-bundle/stylus-renderer.min.js new file mode 100644 index 00000000..fed970d0 --- /dev/null +++ b/vendor/stylus-lang-bundle/stylus-renderer.min.js @@ -0,0 +1,105 @@ +var StylusRenderer=function(){"use strict";function assertPath(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function normalizeStringPosix(t,e){for(var n,i="",r=0,o=-1,a=0,h=0;h<=t.length;++h){if(h2){var l=i.lastIndexOf("/");if(l!==i.length-1){-1===l?(i="",r=0):r=(i=i.slice(0,l)).length-1-i.lastIndexOf("/"),o=h,a=0;continue}}else if(2===i.length||1===i.length){i="",r=0,o=h,a=0;continue}e&&(i.length>0?i+="/..":i="..",r=2)}else i.length>0?i+="/"+t.slice(o+1,h):i=t.slice(o+1,h),r=h-o-1;o=h,a=0}else 46===n&&-1!==a?++a:a=-1}return i}var t={resolve:function resolve(){for(var t,e="",n=!1,i=arguments.length-1;i>=-1&&!n;i--){var r;i>=0?r=arguments[i]:(void 0===t&&(t=process.cwd()),r=t),assertPath(r),0!==r.length&&(e=r+"/"+e,n=47===r.charCodeAt(0))}return e=normalizeStringPosix(e,!n),n?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function normalize(t){if(assertPath(t),0===t.length)return".";var e=47===t.charCodeAt(0),n=47===t.charCodeAt(t.length-1);return 0!==(t=normalizeStringPosix(t,!e)).length||e||(t="."),t.length>0&&n&&(t+="/"),e?"/"+t:t},isAbsolute:function isAbsolute(t){return assertPath(t),t.length>0&&47===t.charCodeAt(0)},join:function join(){if(0===arguments.length)return".";for(var e,n=0;n0&&(void 0===e?e=i:e+="/"+i)}return void 0===e?".":t.normalize(e)},relative:function relative(e,n){if(assertPath(e),assertPath(n),e===n)return"";if((e=t.resolve(e))===(n=t.resolve(n)))return"";for(var i=1;il){if(47===n.charCodeAt(a+u))return n.slice(a+u+1);if(0===u)return n.slice(a+u)}else o>l&&(47===e.charCodeAt(i+u)?c=u:0===u&&(c=0));break}var f=e.charCodeAt(i+u);if(f!==n.charCodeAt(a+u))break;47===f&&(c=u)}var d="";for(u=i+c+1;u<=r;++u)u!==r&&47!==e.charCodeAt(u)||(0===d.length?d+="..":d+="/..");return d.length>0?d+n.slice(a+c):(a+=c,47===n.charCodeAt(a)&&++a,n.slice(a))},_makeLong:function _makeLong(t){return t},dirname:function dirname(t){if(assertPath(t),0===t.length)return".";for(var e=t.charCodeAt(0),n=47===e,i=-1,r=!0,o=t.length-1;o>=1;--o)if(47===(e=t.charCodeAt(o))){if(!r){i=o;break}}else r=!1;return-1===i?n?"/":".":n&&1===i?"//":t.slice(0,i)},basename:function basename(t,e){if(void 0!==e&&"string"!=typeof e)throw new TypeError('"ext" argument must be a string');assertPath(t);var n,i=0,r=-1,o=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var a=e.length-1,h=-1;for(n=t.length-1;n>=0;--n){var l=t.charCodeAt(n);if(47===l){if(!o){i=n+1;break}}else-1===h&&(o=!1,h=n+1),a>=0&&(l===e.charCodeAt(a)?-1==--a&&(r=n):(a=-1,r=h))}return i===r?r=h:-1===r&&(r=t.length),t.slice(i,r)}for(n=t.length-1;n>=0;--n)if(47===t.charCodeAt(n)){if(!o){i=n+1;break}}else-1===r&&(o=!1,r=n+1);return-1===r?"":t.slice(i,r)},extname:function extname(t){assertPath(t);for(var e=-1,n=0,i=-1,r=!0,o=0,a=t.length-1;a>=0;--a){var h=t.charCodeAt(a);if(47!==h)-1===i&&(r=!1,i=a+1),46===h?-1===e?e=a:1!==o&&(o=1):-1!==e&&(o=-1);else if(!r){n=a+1;break}}return-1===e||-1===i||0===o||1===o&&e===i-1&&e===n+1?"":t.slice(e,i)},format:function format(t){if(null===t||"object"!=typeof t)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return function _format(t,e){var n=e.dir||e.root,i=e.base||(e.name||"")+(e.ext||"");return n?n===e.root?n+i:n+t+i:i}("/",t)},parse:function parse(t){assertPath(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;var n,i=t.charCodeAt(0),r=47===i;r?(e.root="/",n=1):n=0;for(var o=-1,a=0,h=-1,l=!0,c=t.length-1,u=0;c>=n;--c)if(47!==(i=t.charCodeAt(c)))-1===h&&(l=!1,h=c+1),46===i?-1===o?o=c:1!==u&&(u=1):-1!==o&&(u=-1);else if(!l){a=c+1;break}return-1===o||-1===h||0===u||1===u&&o===h-1&&o===a+1?-1!==h&&(e.base=e.name=0===a&&r?t.slice(1,h):t.slice(a,h)):(0===a&&r?(e.name=t.slice(1,o),e.base=t.slice(1,h)):(e.name=t.slice(a,o),e.base=t.slice(a,h)),e.ext=t.slice(o,h)),a>0?e.dir=t.slice(0,a-1):r&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null}; +/*! + * Stylus - Token + * Copyright (c) Automattic + * MIT Licensed + */ +let e;t.posix=t;var n=e=e=function Token(t,e){this.type=t,this.val=e};n.prototype.inspect=function(){var t=" "+nodeUtil.inspect(this.val);return"[Token:"+this.lineno+":"+this.column+" "+this.type+""+(this.val?t:"")+"]"},n.prototype.toString=function(){return(void 0===this.val?this.type:this.val).toString()};var i=1e3,r=60*i,o=60*r,a=24*o;function plural(t,e,n){if(!(t0)return function parse(t){if(!((t=String(t)).length>100)){var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*n;case"days":case"day":case"d":return n*a;case"hours":case"hour":case"hrs":case"hr":case"h":return n*o;case"minutes":case"minute":case"mins":case"min":case"m":return n*r;case"seconds":case"second":case"secs":case"sec":case"s":return n*i;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}(t);if("number"===n&&!1===isNaN(t))return e.long?function fmtLong(t){return plural(t,a,"day")||plural(t,o,"hour")||plural(t,r,"minute")||plural(t,i,"second")||t+" ms"}(t):function fmtShort(t){return t>=a?Math.round(t/a)+"d":t>=o?Math.round(t/o)+"h":t>=r?Math.round(t/r)+"m":t>=i?Math.round(t/i)+"s":t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))},h.instances=[],h.names=[],h.skips=[],h.formatters={};const l=h;function load(){var t;try{t=l.storage.debug}catch(t){}return!t&&"undefined"!=typeof process&&"env"in process&&(t=process.env.DEBUG),t}l.log=function log(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},l.formatArgs=function formatArgs(t){var e=this.useColors;if(t[0]=(e?"%c":"")+this.namespace+(e?" %c":" ")+t[0]+(e?"%c ":" ")+"+"+l.humanize(this.diff),e){var n="color: "+this.color;t.splice(1,0,n,"color: inherit");var i=0,r=0;t[0].replace(/%[a-zA-Z%]/g,(function(t){"%%"!==t&&(i++,"%c"===t&&(r=i))})),t.splice(r,0,n)}},l.save=function save(t){try{null==t?l.storage.removeItem("debug"):l.storage.debug=t}catch(t){}},l.load=load,l.useColors=function useColors(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},l.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function localstorage(){try{return window.localStorage}catch(t){}} +/*! + * Stylus - Visitor + * Copyright (c) Automattic + * MIT Licensed + */(),l.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],l.formatters.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},l.enable(load());var c=function Visitor(t){this.root=t};c.prototype.visit=function(t,e){var n="visit"+t.constructor.name;return this[n]?this[n](t):t}; +/*! + * Stylus - units + * Copyright (c) Automattic + * MIT Licensed + */ +var u=["em","ex","ch","rem","vw","vh","vmin","vmax","cm","mm","in","pt","pc","px","deg","grad","rad","turn","s","ms","Hz","kHz","dpi","dpcm","dppx","x","%","fr"],f=function Stack(){Array.apply(this,arguments)}; +/*! + * Stylus - Stack + * Copyright (c) Automattic + * MIT Licensed + */f.prototype.__proto__=Array.prototype,f.prototype.push=function(t){return t.stack=this,t.parent=this.currentFrame,[].push.apply(this,arguments)},f.prototype.__defineGetter__("currentFrame",(function(){return this[this.length-1]})),f.prototype.getBlockFrame=function(t){for(var e=0;e + * MIT Licensed + */ +var d=function Scope(){this.locals={}};d.prototype.add=function(t){this.locals[t.name]=t.val},d.prototype.lookup=function(t){return function hasOwnProperty(t,e){return Object.prototype.hasOwnProperty.call(t,e)}(this.locals,t)?this.locals[t]:void 0},d.prototype.inspect=function(){var t=Object.keys(this.locals).map((function(t){return"@"+t}));return"[Scope"+(t.length?" "+t.join(", "):"")+"]"};var m=function Frame(t){this._scope=!1===t.scope?null:new d,this.block=t};m.prototype.__defineGetter__("scope",(function(){return this._scope||this.parent.scope})),m.prototype.lookup=function(t){return this.scope.lookup(t)},m.prototype.inspect=function(){return"[Frame "+(!1===this.block.scope?"scope-less":this.scope.inspect())+"]"};const _export_sync_=t=>"functions/index.styl"===t?[t]:[];function notImplemented(){throw new Error("Not implemented")}const _export_statSync_=t=>"functions/index.styl"===t?{mtime:0}:notImplemented(),_export_readFileSync_=t=>"functions/index.styl"===t?"called-from = ()\n\nvendors = moz webkit o ms official\n\n// stringify the given arg\n\n-string(arg)\n type(arg) + ' ' + arg\n\n// require a color\n\nrequire-color(color)\n unless color is a 'color'\n error('RGB or HSL value expected, got a ' + -string(color))\n\n// require a unit\n\nrequire-unit(n)\n unless n is a 'unit'\n error('unit expected, got a ' + -string(n))\n\n// require a string\n\nrequire-string(str)\n unless str is a 'string' or str is a 'ident'\n error('string expected, got a ' + -string(str))\n\n// Math functions\n\nabs(n) { math(n, 'abs') }\nmin(a, b) { a < b ? a : b }\nmax(a, b) { a > b ? a : b }\n\n// Trigonometrics\nPI = -math-prop('PI')\n\nradians-to-degrees(angle)\n angle * (180 / PI)\n\ndegrees-to-radians(angle)\n angle * (PI / 180)\n\nsin(n)\n n = unit(n) == 'deg' ? degrees-to-radians(unit(n, '')) : unit(n, '')\n round(math(n, 'sin'), 9)\n\ncos(n)\n n = unit(n) == 'deg' ? degrees-to-radians(unit(n, '')) : unit(n, '')\n round(math(n, 'cos'), 9)\n\n// Rounding Math functions\n\nceil(n, precision = 0)\n multiplier = 10 ** precision\n math(n * multiplier, 'ceil') / multiplier\n\nfloor(n, precision = 0)\n multiplier = 10 ** precision\n math(n * multiplier, 'floor') / multiplier\n\nround(n, precision = 0)\n multiplier = 10 ** precision\n math(n * multiplier, 'round') / multiplier\n\n// return the sum of the given numbers\n\nsum(nums)\n sum = 0\n sum += n for n in nums\n\n// return the average of the given numbers\n\navg(nums)\n sum(nums) / length(nums)\n\n// return a unitless number, or pass through\n\nremove-unit(n)\n if typeof(n) is \"unit\"\n unit(n, \"\")\n else\n n\n\n// convert a percent to a decimal, or pass through\n\npercent-to-decimal(n)\n if unit(n) is \"%\"\n remove-unit(n) / 100\n else\n n\n\n// check if n is an odd number\n\nodd(n)\n 1 == n % 2\n\n// check if n is an even number\n\neven(n)\n 0 == n % 2\n\n// check if color is light\n\nlight(color)\n lightness(color) >= 50%\n\n// check if color is dark\n\ndark(color)\n lightness(color) < 50%\n\n// desaturate color by amount\n\ndesaturate(color, amount)\n adjust(color, 'saturation', - amount)\n\n// saturate color by amount\n\nsaturate(color = '', amount = 100%)\n if color is a 'color'\n adjust(color, 'saturation', amount)\n else\n unquote( \"saturate(\" + color + \")\" )\n\n// darken by the given amount\n\ndarken(color, amount)\n adjust(color, 'lightness', - amount)\n\n// lighten by the given amount\n\nlighten(color, amount)\n adjust(color, 'lightness', amount)\n\n// decrease opacity by amount\n\nfade-out(color, amount)\n color - rgba(black, percent-to-decimal(amount))\n\n// increase opacity by amount\n\nfade-in(color, amount)\n color + rgba(black, percent-to-decimal(amount))\n\n// spin hue by a given amount\n\nspin(color, amount)\n color + unit(amount, deg)\n\n// mix two colors by a given amount\n\nmix(color1, color2, weight = 50%)\n unless weight in 0..100\n error(\"Weight must be between 0% and 100%\")\n\n if length(color1) == 2\n weight = color1[0]\n color1 = color1[1]\n\n else if length(color2) == 2\n weight = 100 - color2[0]\n color2 = color2[1]\n\n require-color(color1)\n require-color(color2)\n\n p = unit(weight / 100, '')\n w = p * 2 - 1\n\n a = alpha(color1) - alpha(color2)\n\n w1 = (((w * a == -1) ? w : (w + a) / (1 + w * a)) + 1) / 2\n w2 = 1 - w1\n\n channels = (red(color1) red(color2)) (green(color1) green(color2)) (blue(color1) blue(color2))\n rgb = ()\n\n for pair in channels\n push(rgb, floor(pair[0] * w1 + pair[1] * w2))\n\n a1 = alpha(color1) * p\n a2 = alpha(color2) * (1 - p)\n alpha = a1 + a2\n\n rgba(rgb[0], rgb[1], rgb[2], alpha)\n\n// invert colors, leave alpha intact\n\ninvert(color = '')\n if color is a 'color'\n rgba(#fff - color, alpha(color))\n else\n unquote( \"invert(\" + color + \")\" )\n\n// give complement of the given color\n\ncomplement( color )\n spin( color, 180 )\n\n// give grayscale of the given color\n\ngrayscale( color = '' )\n if color is a 'color'\n desaturate( color, 100% )\n else\n unquote( \"grayscale(\" + color + \")\" )\n\n// mix the given color with white\n\ntint( color, percent )\n mix( white, color, percent )\n\n// mix the given color with black\n\nshade( color, percent )\n mix( black, color, percent )\n\n// return the last value in the given expr\n\nlast(expr)\n expr[length(expr) - 1]\n\n// return keys in the given pairs or object\n\nkeys(pairs)\n ret = ()\n if type(pairs) == 'object'\n for key in pairs\n push(ret, key)\n else\n for pair in pairs\n push(ret, pair[0]);\n ret\n\n// return values in the given pairs or object\n\nvalues(pairs)\n ret = ()\n if type(pairs) == 'object'\n for key, val in pairs\n push(ret, val)\n else\n for pair in pairs\n push(ret, pair[1]);\n ret\n\n// join values with the given delimiter\n\njoin(delim, vals...)\n buf = ''\n vals = vals[0] if length(vals) == 1\n for val, i in vals\n buf += i ? delim + val : val\n\n// add a CSS rule to the containing block\n\n// - This definition allows add-property to be used as a mixin\n// - It has the same effect as interpolation but allows users\n// to opt for a functional style\n\nadd-property-function = add-property\nadd-property(name, expr)\n if mixin\n {name} expr\n else\n add-property-function(name, expr)\n\nprefix-classes(prefix)\n -prefix-classes(prefix, block)\n\n// Caching mixin, use inside your functions to enable caching by extending.\n\n$stylus_mixin_cache = {}\ncache()\n $key = (current-media() or 'no-media') + '__' + called-from[0] + '__' + arguments\n if $key in $stylus_mixin_cache\n @extend {\"$cache_placeholder_for_\" + $stylus_mixin_cache[$key]}\n else if 'cache' in called-from\n {block}\n else\n $id = length($stylus_mixin_cache)\n\n &,\n /$cache_placeholder_for_{$id}\n $stylus_mixin_cache[$key] = $id\n {block}\n\n// Percentage function to convert a number, e.g. \".45\", into a percentage, e.g. \"45%\"\n\npercentage(num)\n return unit(num * 100, '%')\n\n// Returns the position of a `value` within a `list`\n\nindex(list, value)\n for val, i in list\n return i if val == value\n":notImplemented(); +/*! + * Stylus - Selector Parser + * Copyright (c) Automattic + * MIT Licensed + */ +var v=[">","+","~"],y=function SelectorParser(t,e,n){this.str=t,this.stack=e||[],this.parts=n||[],this.pos=0,this.level=2,this.nested=!0,this.ignore=!1};y.prototype.skip=function(t){this.str=this.str.substr(t),this.pos+=t},y.prototype.skipSpaces=function(){for(;" "==this.str[0];)this.skip(1)},y.prototype.advance=function(){return this.root()||this.relative()||this.initial()||this.escaped()||this.parent()||this.partial()||this.char()},y.prototype.root=function(){this.pos||"/"!=this.str[0]||"deep"==this.str.slice(1,5)||(this.nested=!1,this.skip(1))},y.prototype.relative=function(t){if((!this.pos||t)&&"../"==this.str.slice(0,3)){for(this.nested=!1,this.skip(3);this.relative(!0);)this.level++;if(!this.raw){var e=this.stack[this.stack.length-this.level];if(e)return e;this.ignore=!0}}},y.prototype.initial=function(){if(!this.pos&&"~"==this.str[0]&&"/"==this.str[1])return this.nested=!1,this.skip(2),this.stack[0]},y.prototype.escaped=function(){if("\\"==this.str[0]){var t=this.str[1];if("&"==t||"^"==t)return this.skip(2),t}},y.prototype.parent=function(){if("&"==this.str[0]){if(this.nested=!1,!this.pos&&(!this.stack.length||this.raw)){for(var t=0;" "==this.str[++t];);if(~v.indexOf(this.str[t]))return void this.skip(t+1)}if(this.skip(1),!this.raw)return this.stack[this.stack.length-1]}},y.prototype.partial=function(){if("^"==this.str[0]&&"["==this.str[1]){this.skip(2),this.skipSpaces();var t=this.range();if(this.skipSpaces(),"]"!=this.str[0])return"^[";if(this.nested=!1,this.skip(1),t)return t;this.ignore=!0}},y.prototype.number=function(){var t=0,e="";for("-"==this.str[t]&&(e+=this.str[t++]);this.str.charCodeAt(t)>=48&&this.str.charCodeAt(t)<=57;)e+=this.str[t++];if(e)return this.skip(t),Number(e)},y.prototype.range=function(){var t,e=this.number();if(".."==this.str.slice(0,2)){this.skip(2);var n=this.number(),i=this.parts.length;if(e<0&&(e=i+e-1),n<0&&(n=i+n-1),e>n){var r=e;e=n,n=r}n0?(100-i[e])*r/100:i[e]*(r/100)),i[e]+=r,i.rgba}function rgba(t,e,n,i){switch(arguments.length){case 1:return _export_assertColor_(t),t.rgba;case 2:_export_assertColor_(t);var r=t.rgba;return _export_assertType_(e,"unit","alpha"),"%"==(i=e.clone()).type&&(i.val/=100),new Dt.RGBA(r.r,r.g,r.b,i.val);default:_export_assertType_(t,"unit","red"),_export_assertType_(e,"unit","green"),_export_assertType_(n,"unit","blue"),_export_assertType_(i,"unit","alpha");var o="%"==t.type?Math.round(2.55*t.val):t.val,a="%"==e.type?Math.round(2.55*e.val):e.val,h="%"==n.type?Math.round(2.55*n.val):n.val;return(i=i.clone())&&"%"==i.type&&(i.val/=100),new Dt.RGBA(o,a,h,i.val)}}function alpha(t,e){return t=t.rgba,e?rgba(new Dt.Unit(t.r),new Dt.Unit(t.g),new Dt.Unit(t.b),e):new Dt.Unit(t.a,"")}function basename$1(e,n){return _export_assertString_(e,"path"),t.basename(e.val,n&&n.val)}function blend(t,e){return _export_assertColor_(t),t=t.rgba,e=e||new Dt.RGBA(255,255,255,1),_export_assertColor_(e),e=e.rgba,new Dt.RGBA(t.r*t.a+e.r*(1-t.a),t.g*t.a+e.g*(1-t.a),t.b*t.a+e.b*(1-t.a),t.a+e.a-t.a*e.a)}function blue(t,e){return t=t.rgba,e?rgba(new Dt.Unit(t.r),new Dt.Unit(t.g),e,new Dt.Unit(t.a)):new Dt.Unit(t.b,"")}(x=function addProperty(t,e){_export_assertType_(t,"expression","name"),t=_export_unwrap_(t).first,_export_assertString_(t,"name"),_export_assertType_(e,"expression","expr");var n=new Dt.Property([t],e),i=this.closestBlock,r=i.nodes.length,o=i.nodes.slice(0,i.index),a=i.nodes.slice(i.index++,r);return o.push(n),i.nodes=o.concat(a),n}).raw=!0,adjust.params=["color","prop","amount"],rgba.params=["red","green","blue","alpha"],alpha.params=["color","value"],(_=function(t,e,n){_export_assertPresent_(t,"number"),_export_assertPresent_(e,"base"),t=_export_unwrap_(t).nodes[0].val,e=_export_unwrap_(e).nodes[0].val,n=n&&_export_unwrap_(n).nodes[0].val||2;for(var i=Number(t).toString(e);i.length(t/=255)?t/12.92:Math.pow((t+.055)/1.055,2.4)}return _export_assertColor_(t),t=t.rgba,new Dt.Unit(.2126*processChannel(t.r)+.7152*processChannel(t.g)+.0722*processChannel(t.b))}function contrast(t,e){if("rgba"!=t.nodeName&&"hsla"!=t.nodeName)return new Dt.Literal("contrast("+(t.isNull?"":t.toString())+")");var n=new Dt.Object;function contrast(t,e){1>t.a&&(t=blend(t,e));var n=luminosity(e).val+.05,i=luminosity(t).val+.05,r=n/i;return i>n&&(r=1/r),Math.round(10*r)/10}if(t=t.rgba,e=e||new Dt.RGBA(255,255,255,1),_export_assertColor_(e),1<=(e=e.rgba).a){var i=new Dt.Unit(contrast(t,e));n.set("ratio",i),n.set("error",new Dt.Unit(0)),n.set("min",i),n.set("max",i)}else{var r=contrast(t,blend(e,new Dt.RGBA(0,0,0,1))),o=contrast(t,blend(e,new Dt.RGBA(255,255,255,1))),a=Math.max(r,o);function processChannel(t,n){return Math.min(Math.max(0,(t-n*e.a)/(1-e.a)),255)}var h=new Dt.RGBA(processChannel(t.r,e.r),processChannel(t.g,e.g),processChannel(t.b,e.b),1),l=contrast(t,blend(e,h));n.set("ratio",new Dt.Unit(Math.round(50*(l+a))/100)),n.set("error",new Dt.Unit(Math.round(50*(a-l))/100)),n.set("min",new Dt.Unit(l)),n.set("max",new Dt.Unit(a))}return n}function convert(t){return _export_assertString_(t,"str"),_export_parseString_(t.string)}function define(t,e,n){_export_assertType_(t,"string","name"),e=_export_unwrap_(e);var i=this.currentScope;n&&n.toBoolean().isTrue&&(i=this.global.scope);var r=new Dt.Ident(t.val,e);return i.add(r),Dt.null}function dirname(e){return _export_assertString_(e,"path"),t.dirname(e.val).replace(/\\/g,"/")}function error(t){_export_assertType_(t,"string","msg");var e=new Error(t.val);throw e.fromStylus=!0,e}function extname(e){return _export_assertString_(e,"path"),t.extname(e.val)}function green(t,e){return t=t.rgba,e?rgba(new Dt.Unit(t.r),e,new Dt.Unit(t.b),new Dt.Unit(t.a)):new Dt.Unit(t.g,"")}function hsla(t,e,n,i){switch(arguments.length){case 1:return _export_assertColor_(t),t.hsla;case 2:_export_assertColor_(t);var r=t.hsla;return _export_assertType_(e,"unit","alpha"),"%"==(i=e.clone()).type&&(i.val/=100),new Dt.HSLA(r.h,r.s,r.l,i.val);default:return _export_assertType_(t,"unit","hue"),_export_assertType_(e,"unit","saturation"),_export_assertType_(n,"unit","lightness"),_export_assertType_(i,"unit","alpha"),(i=i.clone())&&"%"==i.type&&(i.val/=100),new Dt.HSLA(t.val,e.val,n.val,i.val)}}function hsl(t,e,n){return 1==arguments.length?(_export_assertColor_(t,"color"),t.hsla):hsla(t,e,n,new Dt.Unit(1))}function hue(t,e){if(e){var n=t.hsla;return hsla(e,new Dt.Unit(n.s),new Dt.Unit(n.l),new Dt.Unit(n.a))}return component(t,new Dt.String("hue"))}component.params=["color","name"],luminosity.params=["color"],contrast.params=["top","bottom"],convert.params=["str"],define.params=["name","expr","global"],dirname.params=["p"],error.params=["msg"],extname.params=["p"],green.params=["color","value"],hsla.params=["hue","saturation","lightness","alpha"],hsl.params=["hue","saturation","lightness"],hue.params=["color","value"];const noop=()=>noop;function json(t,e,n){_export_assertString_(t,"path"),t=t.string;var i=_export_lookup_(t,this.options.paths,this.options.filename),r=e&&"object"==e.nodeName&&e;if(!i){if(r&&r.get("optional").toBoolean().isTrue)return Dt.null;throw new Error("failed to locate .json file "+t)}var o=JSON.parse(_export_readFileSync_(i));if(r)return function convert(t,e){var n=new Dt.Object,i=e.get("leave-strings").toBoolean();for(var r in t){var o=t[r];"object"==typeof o?n.set(r,convert(o,e)):("string"==(o=_export_coerce_(o)).nodeName&&i.isFalse&&(o=_export_parseString_(o.string)),n.set(r,o))}return n}(o,r);oldJson.call(this,o,e,n)}function oldJson(t,e,n){n?(_export_assertString_(n,"namePrefix"),n=n.val):n="";var i=(e=e?e.toBoolean():new Dt.Boolean(e)).isTrue?this.currentScope:this.global.scope;!function convert(t,e){for(var r in e=e?e+"-":"",t){var o=t[r],a=e+r;"object"==typeof o?convert(o,a):("string"==(o=_export_coerce_(o)).nodeName&&(o=_export_parseString_(o.string)),i.add({name:n+a,val:o}))}}(t)}let A,F,O,L,B,j,P,I;function lightness(t,e){if(e){var n=t.hsla;return hsla(new Dt.Unit(n.h),new Dt.Unit(n.s),e,new Dt.Unit(n.a))}return component(t,new Dt.String("lightness"))}function lookup(t){_export_assertType_(t,"string","name");var e=this.lookup(t.val);return e?this.visit(e):Dt.null}function match(t,e,n){_export_assertType_(t,"string","pattern"),_export_assertString_(e,"val");var i=new RegExp(t.val,function validateFlags(t){return!!(t=t&&t.string)&&t.split("").every((function(t){return~"igm".indexOf(t)}))}(n)?n.string:"");return e.string.match(i)}function math(t,e){return _export_assertType_(t,"unit","n"),_export_assertString_(e,"fn"),new Dt.Unit(Math[e.string](t.val),t.type)}function operate(t,e,n){return _export_assertType_(t,"string","op"),_export_assertPresent_(e,"left"),_export_assertPresent_(n,"right"),e.operate(t.val,n)}function range(t,e,n){if(_export_assertType_(t,"unit","start"),_export_assertType_(e,"unit","stop"),n){if(_export_assertType_(n,"unit","step"),0==n.val)throw new Error('ArgumentError: "step" argument must not be zero')}else n=new Dt.Unit(1);for(var i=new Dt.Expression,r=t.val;r<=e.val;r+=n.val)i.push(new Dt.Unit(r,t.type));return i}function red(t,e){return t=t.rgba,e?rgba(e,new Dt.Unit(t.g),new Dt.Unit(t.b),new Dt.Unit(t.a)):new Dt.Unit(t.r,"")}function remove(t,e){return _export_assertType_(t,"object","object"),_export_assertString_(e,"key"),delete t.vals[e.string],t}function replace(t,e,n){_export_assertString_(t,"pattern"),_export_assertString_(e,"replacement"),_export_assertString_(n,"val"),t=new RegExp(t.string,"g");var i=n.string.replace(t,e.string);return n instanceof Dt.Ident?new Dt.Ident(i):new Dt.String(i)}function rgb(t,e,n){switch(arguments.length){case 1:_export_assertColor_(t);var i=t.rgba;return new Dt.RGBA(i.r,i.g,i.b,1);default:return rgba(t,e,n,new Dt.Unit(1))}}json.params=["path","local","namePrefix"],(A=function length(t){if(t){if(t.nodes){var e=_export_unwrap_(t).nodes;return 1==e.length&&"object"==e[0].nodeName?e[0].length:1==e.length&&"string"==e[0].nodeName?e[0].val.length:e.length}return 1}return 0}).raw=!0,lightness.params=["color","value"],(F=function listSeparator(t){return t=_export_unwrap_(t),new Dt.String(t.isList?",":" ")}).raw=!0,lookup.params=["name"],match.params=["pattern","val","flags"],math.params=["n","fn"],(O=function merge(t){_export_assertPresent_(t,"dest"),t=_export_unwrap_(t).first,_export_assertType_(t,"object","dest");for(var e=_export_unwrap_(arguments[arguments.length-1]).first,n=!0===e.val,i=1,r=arguments.length-n;i=0;--o)if("property"===t.nodes[o].nodeName){i=o;break}n&&(this.buf+=this.out(this.compress?"{":" {\n"),++this.indents),o=0;for(var a=t.nodes.length;o-1)return n.toString().replace("0.",".")+e}return(i?parseFloat(n.toFixed(15)):n).toString()+e},G.prototype.visitGroup=function(t){var e=this.keyframe?[]:this.stack,n=this.compress?",":",\n";if(e.push(t.nodes),t.block.hasProperties){var i=_export_compileSelectors_.call(this,e),r=i.length;if(r){this.keyframe&&(n=this.compress?",":", ");for(var o=0;o0&&!~r.indexOf("&")&&(r="/"+r),(o=new Dt.Selector([new Dt.Literal(r)])).val=r,o.block=t.block,t.nodes[i++]=o}})),n.push(t.nodes);var r=_export_compileSelectors_(n,!0);return r.forEach((function(e){i[e]=i[e]||[],i[e].push(t)})),this.extend(t,r),n.pop(),t},q.prototype.visitFunction=function(){return Dt.null},q.prototype.visitMedia=function(t){var e,n=[],i=this.closestGroup(t.block);return function mergeQueries(e){e.nodes.forEach((function(i,r){switch(i.nodeName){case"media":i.val=t.val.merge(i.val),n.push(i),e.nodes[r]=Dt.null;break;case"block":mergeQueries(i);break;default:i.block&&i.block.nodes&&mergeQueries(i.block)}}))}(t.block),this.bubble(t),n.length&&n.forEach((function(t){i?i.block.push(t):this.root.nodes.splice(++this.rootIndex,0,t),t=this.visit(t),e=t.block.parent,!t.bubbled||i&&"group"!=e.node.nodeName||(t.group.block=t.block.nodes[0].block,t.block.nodes[0]=t.group)}),this),t},q.prototype.visitSupports=function(t){return this.bubble(t),t},q.prototype.visitAtrule=function(t){return t.block&&(t.block=this.visit(t.block)),t},q.prototype.visitKeyframes=function(t){var e=t.block.nodes.filter((function(t){return t.block&&t.block.hasProperties}));return t.frames=e.length,t},q.prototype.visitImport=function(t){return this.imports.push(t),this.hoist?Dt.null:t},q.prototype.visitCharset=function(t){return this.charset=t,this.hoist?Dt.null:t},q.prototype.extend=function(t,e){var n=this.map,i=this,r=this.closestGroup(t.block);t.extends.forEach((function(t){var o=n[t.selector];if(!o){if(t.optional)return;if(!(o=i._checkForPrefixedGroups(t.selector))){var a=new Error('Failed to @extend "'+t.selector+'"');throw a.lineno=t.lineno,a.column=t.column,a}}e.forEach((function(t){var n=new Dt.Selector;n.val=t,n.inherits=!1,o.forEach((function(t){r&&r==t||i.extend(t,e),t.push(n)}))}))})),t.block=this.visit(t.block)},q.prototype._checkForPrefixedGroups=function(t){for(var e=[],n=this.map,i=null,r=0;r1&&(n.isList?pushToStack(n.nodes,t):t.push(parse$1(n.nodes.map((function(t){return _export_assertString_(t,"selector"),t.string})).join(" "))))}else e.length>1&&pushToStack(e,t);return t.length?_export_compileSelectors_(t).join(","):"&"}).raw=!0,(J=function(t){return(t=_export_unwrap_(t)).nodes.shift()}).raw=!0,split.params=["delim","val"],substr.params=["val","start","length"],($=function slice(t,e,n){if(e=e&&e.nodes[0].val,n=n&&n.nodes[0].val,(t=_export_unwrap_(t).nodes).length>1)return _export_coerce_(t.slice(e,n),!0);var i=t[0].string.slice(e,n);return t[0]instanceof Dt.Ident?new Dt.Ident(i):new Dt.String(i)}).raw=!0,tan.params=["angle"],transparentify.params=["top","bottom","alpha"],type.params=["node"],unit.params=["unit","type"],unquote.params=["string"],(z=function(t){t=_export_unwrap_(t);for(var e=1,n=arguments.length;e1)e.push(new Dt.String(r.map((function(t){return((i=new y(t.val).parse().nested)&&n?"& ":"")+t.val})).join(",")));else{var o=r[0].val;i=new y(o).parse().nested,e.push(new Dt.String((i&&n?"& ":"")+o))}}else e.push(new Dt.String("&"));return e},H.shift=J,H.split=split,H.substr=substr,H.slice=$,H.tan=tan,H.trace=function trace(){return console.log(this.stack),Dt.null},H.transparentify=transparentify,H.type=H.typeof=H["type-of"]=type,H.unit=unit,H.unquote=unquote,H.unshift=H.prepend=z,H.use=use,H.warn=warn,H["-math-prop"]=math$1,H["-prefix-classes"]=prefixClasses; +/*! + * Stylus - colors + * Copyright (c) Automattic + * MIT Licensed + */ +var D={aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],transparent:[0,0,0,0],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1],rebeccapurple:[102,51,153,1]},Q=t.extname,W={".gif":"image/gif",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".svg":"image/svg+xml",".webp":"image/webp",".ttf":"application/x-font-ttf",".eot":"application/vnd.ms-fontobject",".woff":"application/font-woff",".woff2":"application/font-woff2"};const _module_exports_$k=function(t){var e=(t=t||{}).paths||[],n=null!=t.limit?t.limit:3e4,i=t.mimes||W;function fn(t,r){var o=new G(t),a="base64";o.isURL=!0,t=function parse$2(t){return new URL(t)}(t=t.nodes.map((function(t){return o.visit(t)})).join(""));var h,l,c=Q(t.pathname),u=i[c],f=t.hash||"",d=new Dt.Literal('url("'+t.href+'")'),m=e.concat(this.paths);if(!u)return d;if(t.protocol)return d;var v=_export_lookup_(t.pathname,m);return v?(h=_export_readFileSync_(v),!1!==n&&h.length>n?d:(r&&"utf8"==r.first.val.toLowerCase()?(a="charset=utf-8",l=h.toString().replace(/\s+/g," ").replace(/[{}\|\\\^~\[\]`"<>#%]/g,(function(t){return"%"+t[0].charCodeAt(0).toString(16).toUpperCase()})).trim()):l=h.toString(a)+f,new Dt.Literal('url("data:'+u+";"+a+","+l+'")'))):(he.emit("file not found","File "+d+" could not be found, literal url retained!"),d)}return fn.raw=!0,fn};_module_exports_$k.mimes=W;var K=t.dirname,Z=l("stylus:evaluator");function importFile(t,e,n){var i,r=this.importStack,o=te;if(t.once){if(this.requireHistory[e])return Dt.null;if(this.requireHistory[e]=!0,n&&!this.includeCSS)return t}if(~r.indexOf(e))throw new Error("import loop has been found");var a=_export_readFileSync_(e);if(!a.trim())return Dt.null;if(t.path=e,t.dirname=K(e),i=_export_statSync_(e),t.mtime=i.mtime,this.paths.push(t.dirname),this.options._imports&&this.options._imports.push(t.clone()),r.push(e),Dt.filename=e,n&&((n=new Dt.Literal(a.replace(/\r\n?/g,"\n"))).lineno=n.column=1,!this.resolveURL))return n;var h=new Dt.Block,l=new o(a,_export_merge_({root:h},this.options));try{h=l.parse()}catch(t){var c=l.lexer.lineno,u=l.lexer.column;if(n&&this.includeCSS&&this.resolveURL)return this.warn("ParseError: "+e+":"+c+":"+u+". This file included as-is"),n;throw t.filename=e,t.lineno=c,t.column=u,t.input=a,t}(h=h.clone(this.currentBlock)).parent=this.currentBlock,h.scope=!1;var f=this.visit(h);return r.pop(),this.resolveURL&&!this.resolveURL.nocheck||this.paths.pop(),f}var V=function Evaluator(t,e){e=e||{},c.call(this,t);var n=this.functions=e.functions||{};this.stack=new f,this.imports=e.imports||[],this.globals=e.globals||{},this.paths=e.paths||[],this.prefix=e.prefix||"",this.filename=e.filename,this.includeCSS=e["include css"],this.resolveURL=n.url&&"resolver"==n.url.name&&n.url.options,this.paths.push(K(e.filename||".")),this.stack.push(this.global=new m(t)),this.warnings=e.warn,this.options=e,this.calling=[],this.importStack=[],this.requireHistory={},this.return=0};V.prototype.__proto__=c.prototype;var Y=c.prototype.visit;function CoercionError(t){this.name="CoercionError",this.message=t,Error.captureStackTrace&&Error.captureStackTrace(this,CoercionError)}V.prototype.visit=function(t){try{return Y.call(this,t)}catch(e){if(e.filename)throw e;e.lineno=t.lineno,e.column=t.column,e.filename=t.filename,e.stylusStack=this.stack.toString();try{e.input=_export_readFileSync_(e.filename)}catch(t){}throw e}},V.prototype.setup=function(){var t=this.root,e=[];this.populateGlobalScope(),this.imports.forEach((function(t){var n=new Dt.Expression;n.push(new Dt.String(t)),e.push(new Dt.Import(n))}),this),t.nodes=e.concat(t.nodes)},V.prototype.populateGlobalScope=function(){var t=this.global.scope;Object.keys(D).forEach((function(e){var n=D[e],i=new Dt.RGBA(n[0],n[1],n[2],n[3]),r=new Dt.Ident(e,i);i.name=e,t.add(r)})),t.add(new Dt.Ident("embedurl",new Dt.Function("embedurl",_module_exports_$k({limit:!1}))));var e=this.globals;Object.keys(e).forEach((function(n){var i=e[n];i.nodeName||(i=new Dt.Literal(i)),t.add(new Dt.Ident(n,i))}))},V.prototype.evaluate=function(){return Z("eval %s",this.filename),this.setup(),this.visit(this.root)},V.prototype.visitGroup=function(t){return t.nodes=t.nodes.map((function(t){return t.val=this.interpolate(t),Z("ruleset %s",t.val),t}),this),t.block=this.visit(t.block),t},V.prototype.visitReturn=function(t){throw t.expr=this.visit(t.expr),t},V.prototype.visitMedia=function(t){return t.block=this.visit(t.block),t.val=this.visit(t.val),t},V.prototype.visitQueryList=function(t){var e,n;if(t.nodes.forEach(this.visit,this),1==t.nodes.length&&(n=t.nodes[0],e=this.lookup(n.type))){if(!(e=e.first.string))return t;var i=new te(e,this.options);t=this.visit(i.queries())}return t},V.prototype.visitQuery=function(t){return t.predicate=this.visit(t.predicate),t.type=this.visit(t.type),t.nodes.forEach(this.visit,this),t},V.prototype.visitFeature=function(t){return t.name=this.interpolate(t),t.expr&&(this.return++,t.expr=this.visit(t.expr),this.return--),t},V.prototype.visitObject=function(t){for(var e in t.vals)t.vals[e]=this.visit(t.vals[e]);return t},V.prototype.visitMember=function(t){var e=t.left,n=t.right,i=this.visit(e).first;if("object"!=i.nodeName)throw new Error(e.toString()+" has no property ."+n);return t.val&&(this.return++,i.set(n.name,this.visit(t.val)),this.return--),i.get(n.name)},V.prototype.visitKeyframes=function(t){var e;return t.fabricated?t:(t.val=this.interpolate(t).trim(),(e=this.lookup(t.val))&&(t.val=e.first.string||e.first.name),t.block=this.visit(t.block),"official"!=t.prefix?t:(this.vendors.forEach((function(e){if("ms"!=e){var n=t.clone();n.val=t.val,n.prefix=e,n.block=t.block,n.fabricated=!0,this.currentBlock.push(n)}}),this),Dt.null))},V.prototype.visitFunction=function(t){var e=this.stack.currentFrame.scope.lookup(t.name);return e&&this.warn("local "+e.nodeName+' "'+t.name+'" previously defined in this scope'),this.functions[t.name]&&this.warn('user-defined function "'+t.name+'" is already defined'),H[t.name]&&this.warn('built-in function "'+t.name+'" is already defined'),t},V.prototype.visitEach=function(t){this.return++;var e,n,i=_export_unwrap_(this.visit(t.expr)),r=i.nodes.length,o=new Dt.Ident(t.val),a=new Dt.Ident(t.key||"__index__"),h=this.currentScope,l=this.currentBlock,c=[],u=this;function visitBody(n,i){h.add(i),h.add(n),e=u.visit(t.block.clone()),c=c.concat(e.nodes)}if(this.return--,t.block.scope=!1,1==r&&"object"==i.nodes[0].nodeName)for(var f in(n=i.nodes[0]).vals)o.val=new Dt.String(f),a.val=n.get(f),visitBody(a,o);else for(var d=0;d200)throw new RangeError("Maximum stylus call stack size exceeded");"expression"==i.nodeName&&(i=i.first),this.return++;var r=this.visit(t.args);for(var o in r.map)r.map[o]=this.visit(r.map[o].clone());return this.return--,i.fn?(Z("%s is built-in",t),n=this.invokeBuiltin(i.fn,r)):"function"==i.nodeName&&(Z("%s is user-defined",t),t.block&&(t.block=this.visit(t.block)),n=this.invokeFunction(i,r,t.block)),this.calling.pop(),this.ignoreColors=!1,n},V.prototype.visitIdent=function(t){var e;if(t.property)return(e=this.lookupProperty(t.name))?this.visit(e.expr.clone()):Dt.null;if(t.val.isNull){var n=this.lookup(t.name);return n&&t.mixin&&this.mixinNode(n),n?this.visit(n):t}return this.return++,t.val=this.visit(t.val),this.return--,this.currentScope.add(t),t.val},V.prototype.visitBinOp=function(t){if("is defined"==t.op)return this.isDefined(t.left);this.return++;var e=t.op,n=this.visit(t.left),i="||"==e||"&&"==e?t.right:this.visit(t.right),r=t.val?this.visit(t.val):null;this.return--;try{return this.visit(n.operate(e,i,r))}catch(t){if("CoercionError"==t.name)switch(e){case"==":return Dt.false;case"!=":return Dt.true}throw t}},V.prototype.visitUnaryOp=function(t){var e=t.op,n=this.visit(t.expr);switch("!"!=e&&(n=n.first.clone(),_export_assertType_(n,"unit")),e){case"-":n.val=-n.val;break;case"+":n.val=+n.val;break;case"~":n.val=~n.val;break;case"!":return n.toBoolean().negate()}return n},V.prototype.visitTernary=function(t){return this.visit(t.cond).toBoolean().isTrue?this.visit(t.trueExpr):this.visit(t.falseExpr)},V.prototype.visitExpression=function(t){for(var e=0,n=t.nodes.length;e1)for(var o=0;o=":return Dt.Boolean(this.hash>=e.hash);case"<=":return Dt.Boolean(this.hash<=e.hash);case">":return Dt.Boolean(this.hash>e.hash);case"<":return Dt.Boolean(this.hash=r:--i>r);return o}return X.prototype.operate.call(this,t,e)},ct.prototype.coerce=function(t){if("unit"==t.nodeName){var e=this,n=t,i=lt[e.type],r=lt[n.type];if(i&&r&&i.label==r.label){var o=n.val*(r.val/i.val);return new Dt.Unit(o,e.type)}return new Dt.Unit(n.val,e.type)}if("string"==t.nodeName){if("%"==t.val)return new Dt.Unit(0,"%");var a=parseFloat(t.val);return isNaN(a)&&X.prototype.coerce.call(this,t),new Dt.Unit(a)}return X.prototype.coerce.call(this,t)}; +/*! + * Stylus - String + * Copyright (c) Automattic + * MIT Licensed + */ +var pt=H.s,ut=function String(t,e){X.call(this),this.val=t,this.string=t,this.prefixed=!1,this.quote="string"!=typeof e?"'":e};let ft;ut.prototype.__proto__=X.prototype,ut.prototype.toString=function(){return this.quote+this.val+this.quote},ut.prototype.clone=function(){var t=new ut(this.val,this.quote);return t.lineno=this.lineno,t.column=this.column,t.filename=this.filename,t},ut.prototype.toJSON=function(){return{__type:"String",val:this.val,quote:this.quote,lineno:this.lineno,column:this.column,filename:this.filename}},ut.prototype.toBoolean=function(){return Dt.Boolean(this.val.length)},ut.prototype.coerce=function(t){switch(t.nodeName){case"string":return t;case"expression":return new ut(t.nodes.map((function(t){return this.coerce(t).val}),this).join(" "));default:return new ut(t.toString())}},ut.prototype.operate=function(t,e){switch(t){case"%":(i=new Dt.Expression).push(this);var n="expression"==e.nodeName?_export_unwrap_(e).nodes:[e];return pt.apply(null,[i].concat(n));case"+":var i;return(i=new Dt.Expression).push(new ut(this.val+this.coerce(e).val)),i;default:return X.prototype.operate.call(this,t,e)}};var dt=ft=ft=function HSLA(t,e,n,i){X.call(this),this.h=clampDegrees(t),this.s=clampPercentage(e),this.l=clampPercentage(n),this.a=function clampAlpha(t){return Math.max(0,Math.min(t,1))}(i),this.hsla=this};function clampDegrees(t){return(t%=360)>=0?t:360+t}function clampPercentage(t){return Math.max(0,Math.min(t,100))}dt.prototype.__proto__=X.prototype,dt.prototype.toString=function(){return"hsla("+this.h+","+this.s.toFixed(0)+"%,"+this.l.toFixed(0)+"%,"+this.a+")"},dt.prototype.clone=function(t){var e=new dt(this.h,this.s,this.l,this.a);return e.lineno=this.lineno,e.column=this.column,e.filename=this.filename,e},dt.prototype.toJSON=function(){return{__type:"HSLA",h:this.h,s:this.s,l:this.l,a:this.a,lineno:this.lineno,column:this.column,filename:this.filename}},dt.prototype.__defineGetter__("rgba",(function(){return Dt.RGBA.fromHSLA(this)})),dt.prototype.__defineGetter__("hash",(function(){return this.rgba.toString()})),dt.prototype.add=function(t,e,n){return new dt(this.h+t,this.s+e,this.l+n,this.a)},dt.prototype.sub=function(t,e,n){return this.add(-t,-e,-n)},dt.prototype.operate=function(t,e){switch(t){case"==":case"!=":case"<=":case">=":case"<":case">":case"is a":case"||":case"&&":return this.rgba.operate(t,e);default:return this.rgba.operate(t,e).hsla}},ft.fromRGBA=function(t){var e,n,i=t.r/255,r=t.g/255,o=t.b/255,a=t.a,h=Math.min(i,r,o),l=Math.max(i,r,o),c=(l+h)/2,u=l-h;switch(l){case h:e=0;break;case i:e=60*(r-o)/u;break;case r:e=60*(o-i)/u+120;break;case o:e=60*(i-r)/u+240}return n=l==h?0:c<.5?u/(2*c):u/(2-2*c),new dt(e%=360,n*=100,c*=100,a)},dt.prototype.adjustLightness=function(t){return this.l=clampPercentage(this.l+this.l*(t/100)),this},dt.prototype.adjustHue=function(t){return this.h=clampDegrees(this.h+t),this};var mt=H.adjust;let vt;var yt=vt=vt=function RGBA(t,e,n,i){X.call(this),this.r=clamp(t),this.g=clamp(e),this.b=clamp(n),this.a=function clampAlpha$1(t){return Math.max(0,Math.min(t,1))}(i),this.name="",this.rgba=this};function clamp(t){return Math.max(0,Math.min(t.toFixed(0),255))}yt.prototype.__proto__=X.prototype,yt.withoutClamping=function(t,e,n,i){var r=new yt(0,0,0,0);return r.r=t,r.g=e,r.b=n,r.a=i,r},yt.prototype.clone=function(){var t=new yt(this.r,this.g,this.b,this.a);return t.raw=this.raw,t.name=this.name,t.lineno=this.lineno,t.column=this.column,t.filename=this.filename,t},yt.prototype.toJSON=function(){return{__type:"RGBA",r:this.r,g:this.g,b:this.b,a:this.a,raw:this.raw,name:this.name,lineno:this.lineno,column:this.column,filename:this.filename}},yt.prototype.toBoolean=function(){return Dt.true},yt.prototype.__defineGetter__("hsla",(function(){return ft.fromRGBA(this)})),yt.prototype.__defineGetter__("hash",(function(){return this.toString()})),yt.prototype.add=function(t,e,n,i){return new yt(this.r+t,this.g+e,this.b+n,this.a+i)},yt.prototype.sub=function(t,e,n,i){return new yt(this.r-t,this.g-e,this.b-n,1==i?this.a:this.a-i)},yt.prototype.multiply=function(t){return new yt(this.r*t,this.g*t,this.b*t,this.a)},yt.prototype.divide=function(t){return new yt(this.r/t,this.g/t,this.b/t,this.a)},yt.prototype.operate=function(t,e){switch("in"!=t&&(e=e.first),t){case"is a":if("string"==e.nodeName&&"color"==e.string)return Dt.true;break;case"+":switch(e.nodeName){case"unit":var n=e.val;switch(e.type){case"%":return mt(this,new Dt.String("lightness"),e);case"deg":return this.hsla.adjustHue(n).rgba;default:return this.add(n,n,n,0)}case"rgba":return this.add(e.r,e.g,e.b,e.a);case"hsla":return this.hsla.add(e.h,e.s,e.l)}break;case"-":switch(e.nodeName){case"unit":switch(n=e.val,e.type){case"%":return mt(this,new Dt.String("lightness"),new Dt.Unit(-n,"%"));case"deg":return this.hsla.adjustHue(-n).rgba;default:return this.sub(n,n,n,0)}case"rgba":return this.sub(e.r,e.g,e.b,e.a);case"hsla":return this.hsla.sub(e.h,e.s,e.l)}break;case"*":switch(e.nodeName){case"unit":return this.multiply(e.val)}break;case"/":switch(e.nodeName){case"unit":return this.divide(e.val)}}return X.prototype.operate.call(this,t,e)},yt.prototype.toString=function(){function pad(t){return t<16?"0"+t.toString(16):t.toString(16)}if("transparent"==this.name)return this.name;if(1==this.a){var t=pad(this.r),e=pad(this.g),n=pad(this.b);return t[0]==t[1]&&e[0]==e[1]&&n[0]==n[1]?"#"+t[0]+e[0]+n[0]:"#"+t+e+n}return"rgba("+this.r+","+this.g+","+this.b+","+ +this.a.toFixed(3)+")"},vt.fromHSLA=function(t){var e=t.h/360,n=t.s/100,i=t.l/100,r=t.a,o=i<=.5?i*(n+1):i+n-i*n,a=2*i-o,h=255*hue(e+1/3),l=255*hue(e),c=255*hue(e-1/3);function hue(t){return t<0&&++t,t>1&&--t,6*t<1?a+(o-a)*t*6:2*t<1?o:3*t<2?a+(o-a)*(2/3-t)*6:a}return new yt(h,l,c,r)};var gt=function Ident(t,e,n){X.call(this),this.name=t,this.string=t,this.val=e||Dt.null,this.mixin=!!n};gt.prototype.__defineGetter__("isEmpty",(function(){return null==this.val})),gt.prototype.__defineGetter__("hash",(function(){return this.name})),gt.prototype.__proto__=X.prototype,gt.prototype.clone=function(t){var e=new gt(this.name);return e.val=this.val.clone(t,e),e.mixin=this.mixin,e.lineno=this.lineno,e.column=this.column,e.filename=this.filename,e.property=this.property,e.rest=this.rest,e},gt.prototype.toJSON=function(){return{__type:"Ident",name:this.name,val:this.val,mixin:this.mixin,property:this.property,rest:this.rest,lineno:this.lineno,column:this.column,filename:this.filename}},gt.prototype.toString=function(){return this.name},gt.prototype.coerce=function(t){switch(t.nodeName){case"ident":case"string":case"literal":return new gt(t.string);case"unit":return new gt(t.toString());default:return X.prototype.coerce.call(this,t)}},gt.prototype.operate=function(t,e){var n=e.first;switch(t){case"-":if("unit"==n.nodeName){var i=new Dt.Expression;return(n=n.clone()).val=-n.val,i.push(this),i.push(n),i}case"+":return new Dt.Ident(this.string+this.coerce(n).string)}return X.prototype.operate.call(this,t,e)};var kt=function Group(){X.call(this),this.nodes=[],this.extends=[]};kt.prototype.__proto__=X.prototype,kt.prototype.push=function(t){this.nodes.push(t)},kt.prototype.__defineGetter__("block",(function(){return this.nodes[0].block})),kt.prototype.__defineSetter__("block",(function(t){for(var e=0,n=this.nodes.length;e + * MIT Licensed + */ +var _t=function Atrule(t){X.call(this),this.type=t};function hasOutput(t){var e=t.nodes;return!e.every((function(t){return"group"==t.nodeName&&t.hasOnlyPlaceholders}))&&e.some((function(t){switch(t.nodeName){case"property":case"literal":case"import":return!0;case"block":return hasOutput(t);default:if(t.block)return hasOutput(t.block)}}))}_t.prototype.__proto__=X.prototype,_t.prototype.__defineGetter__("hasOnlyProperties",(function(){if(!this.block)return!1;for(var t=this.block.nodes,e=0,n=t.length;e + * MIT Licensed + */ +var jt=function Namespace(t,e){X.call(this),this.val=t,this.prefix=e};jt.prototype.__proto__=X.prototype,jt.prototype.toString=function(){return"@namespace "+(this.prefix?this.prefix+" ":"")+this.val},jt.prototype.toJSON=function(){return{__type:"Namespace",val:this.val,prefix:this.prefix,lineno:this.lineno,column:this.column,filename:this.filename}};var Pt=function Import(t,e){X.call(this),this.path=t,this.once=e||!1};Pt.prototype.__proto__=X.prototype,Pt.prototype.clone=function(t){var e=new Pt;return e.path=this.path.nodeName?this.path.clone(t,e):this.path,e.once=this.once,e.mtime=this.mtime,e.lineno=this.lineno,e.column=this.column,e.filename=this.filename,e},Pt.prototype.toJSON=function(){return{__type:"Import",path:this.path,once:this.once,mtime:this.mtime,lineno:this.lineno,column:this.column,filename:this.filename}};var It=function Extend(t){X.call(this),this.selectors=t};It.prototype.__proto__=X.prototype,It.prototype.clone=function(){return new It(this.selectors)},It.prototype.toString=function(){return"@extend "+this.selectors.join(", ")},It.prototype.toJSON=function(){return{__type:"Extend",selectors:this.selectors,lineno:this.lineno,column:this.column,filename:this.filename}};var Ut={}.constructor,Rt=function Object(){X.call(this),this.vals={},this.keys={}};Rt.prototype.__proto__=X.prototype,Rt.prototype.setValue=function(t,e){return this.vals[t]=e,this},Rt.prototype.set=Rt.prototype.setValue,Rt.prototype.setKey=function(t,e){return this.keys[t]=e,this},Rt.prototype.__defineGetter__("length",(function(){return Ut.keys(this.vals).length})),Rt.prototype.get=function(t){return this.vals[t]||Dt.null},Rt.prototype.has=function(t){return t in this.vals},Rt.prototype.operate=function(t,e){switch(t){case".":case"[]":return this.get(e.hash);case"==":var n,i,r=this.vals;if("object"!=e.nodeName||this.length!=e.length)return Dt.false;for(var o in r)if(n=r[o],i=e.vals[o],n.operate(t,i).isFalse)return Dt.false;return Dt.true;case"!=":return this.operate("==",e).negate();default:return X.prototype.operate.call(this,t,e)}},Rt.prototype.toBoolean=function(){return Dt.Boolean(this.length)},Rt.prototype.toBlock=function(){var t,e,n="{";for(t in this.vals)if("object"==(e=this.get(t)).first.nodeName)n+=t+" "+e.first.toBlock();else switch(t){case"@charset":n+=t+" "+e.first.toString()+";";break;default:n+=t+":"+toString(e)+";"}return n+"}";function toString(t){return t.nodes?t.nodes.map(toString).join(t.isList?",":" "):"literal"==t.nodeName&&","==t.val?"\\,":t.toString()}},Rt.prototype.clone=function(t){var e,n=new Rt;for(e in n.lineno=this.lineno,n.column=this.column,n.filename=this.filename,this.vals)n.vals[e]=this.vals[e].clone(t,n);for(e in this.keys)n.keys[e]=this.keys[e].clone(t,n);return n},Rt.prototype.toJSON=function(){return{__type:"Object",vals:this.vals,keys:this.keys,lineno:this.lineno,column:this.column,filename:this.filename}},Rt.prototype.toString=function(){var t={};for(var e in this.vals)t[e]=this.vals[e].toString();return JSON.stringify(t)};var Gt=function Function(t,e,n){X.call(this),this.name=t,this.params=e,this.block=n,"function"==typeof e&&(this.fn=e)};Gt.prototype.__defineGetter__("arity",(function(){return this.params.length})),Gt.prototype.__proto__=X.prototype,Gt.prototype.__defineGetter__("hash",(function(){return"function "+this.name})),Gt.prototype.clone=function(t){if(this.fn)var e=new Gt(this.name,this.fn);else(e=new Gt(this.name)).params=this.params.clone(t,e),e.block=this.block.clone(t,e);return e.lineno=this.lineno,e.column=this.column,e.filename=this.filename,e},Gt.prototype.toString=function(){return this.fn?this.name+"("+this.fn.toString().match(/^function *\w*\((.*?)\)/).slice(1).join(", ")+")":this.name+"("+this.params.nodes.join(", ")+")"},Gt.prototype.toJSON=function(){var t={__type:"Function",name:this.name,lineno:this.lineno,column:this.column,filename:this.filename};return this.fn?t.fn=this.fn:(t.params=this.params,t.block=this.block),t};var Mt=function Property(t,e){X.call(this),this.segments=t,this.expr=e};Mt.prototype.__proto__=X.prototype,Mt.prototype.clone=function(t){var e=new Mt(this.segments);return e.name=this.name,this.literal&&(e.literal=this.literal),e.lineno=this.lineno,e.column=this.column,e.filename=this.filename,e.segments=this.segments.map((function(n){return n.clone(t,e)})),this.expr&&(e.expr=this.expr.clone(t,e)),e},Mt.prototype.toJSON=function(){var t={__type:"Property",segments:this.segments,name:this.name,lineno:this.lineno,column:this.column,filename:this.filename};return this.expr&&(t.expr=this.expr),this.literal&&(t.literal=this.literal),t},Mt.prototype.toString=function(){return"property("+this.segments.join("")+", "+this.expr+")"},Mt.prototype.operate=function(t,e,n){return this.expr.operate(t,e,n)};var qt=function Selector(t){X.call(this),this.inherits=!0,this.segments=t,this.optional=!1};qt.prototype.__proto__=X.prototype,qt.prototype.toString=function(){return this.segments.join("")+(this.optional?" !optional":"")},qt.prototype.__defineGetter__("isPlaceholder",(function(){return this.val&&~this.val.substr(0,2).indexOf("$")})),qt.prototype.clone=function(t){var e=new qt;return e.lineno=this.lineno,e.column=this.column,e.filename=this.filename,e.inherits=this.inherits,e.val=this.val,e.segments=this.segments.map((function(n){return n.clone(t,e)})),e.optional=this.optional,e},qt.prototype.toJSON=function(){return{__type:"Selector",inherits:this.inherits,segments:this.segments,optional:this.optional,val:this.val,lineno:this.lineno,column:this.column,filename:this.filename}};var Tt=function Expression(t){X.call(this),this.nodes=[],this.isList=t};Tt.prototype.__defineGetter__("isEmpty",(function(){return!this.nodes.length})),Tt.prototype.__defineGetter__("first",(function(){return this.nodes[0]?this.nodes[0].first:Dt.null})),Tt.prototype.__defineGetter__("hash",(function(){return this.nodes.map((function(t){return t.hash})).join("::")})),Tt.prototype.__proto__=X.prototype,Tt.prototype.clone=function(t){var e=new this.constructor(this.isList);return e.preserve=this.preserve,e.lineno=this.lineno,e.column=this.column,e.filename=this.filename,e.nodes=this.nodes.map((function(n){return n.clone(t,e)})),e},Tt.prototype.push=function(t){this.nodes.push(t)},Tt.prototype.operate=function(t,e,n){switch(t){case"[]=":var i=this,r=_export_unwrap_(e).nodes;return n=_export_unwrap_(n),r.forEach((function(t){if(u=i.nodes.length,"unit"==t.nodeName){for(var e=t.val<0?u+t.val:t.val,r=e;e-- >u;)i.nodes[e]=Dt.null;i.nodes[r]=n}else t.string&&(o=i.nodes[0])&&"object"==o.nodeName&&o.set(t.string,n.clone())})),n;case"[]":var o,a=new Dt.Expression,h=_export_unwrap_(this).nodes;return(r=_export_unwrap_(e).nodes).forEach((function(t){"unit"==t.nodeName?o=h[t.val<0?h.length+t.val:t.val]:"object"==h[0].nodeName&&(o=h[0].get(t.string)),o&&a.push(o)})),a.isEmpty?Dt.null:_export_unwrap_(a);case"||":return this.toBoolean().isTrue?this:e;case"in":return X.prototype.operate.call(this,t,e);case"!=":return this.operate("==",e,n).negate();case"==":var l,c,u=this.nodes.length;if(e=e.toExpression(),u!=e.nodes.length)return Dt.false;for(var f=0;f1?Dt.true:this.first.toBoolean()},Tt.prototype.toString=function(){return"("+this.nodes.map((function(t){return t.toString()})).join(this.isList?", ":" ")+")"},Tt.prototype.toJSON=function(){return{__type:"Expression",isList:this.isList,preserve:this.preserve,lineno:this.lineno,column:this.column,filename:this.filename,nodes:this.nodes}};var Jt={Expression:Tt},$t=function Arguments(){Jt.Expression.call(this),this.map={}};$t.prototype.__proto__=Jt.Expression.prototype,$t.fromExpression=function(t){var e=new $t,n=t.nodes.length;e.lineno=t.lineno,e.column=t.column,e.isList=t.isList;for(var i=0;i + * MIT Licensed + */ +var zt=function Atblock(){X.call(this)};zt.prototype.__defineGetter__("nodes",(function(){return this.block.nodes})),zt.prototype.__proto__=X.prototype,zt.prototype.clone=function(t){var e=new zt;return e.block=this.block.clone(t,e),e.lineno=this.lineno,e.column=this.column,e.filename=this.filename,e},zt.prototype.toString=function(){return"@block"},zt.prototype.toJSON=function(){return{__type:"Atblock",block:this.block,lineno:this.lineno,column:this.column,fileno:this.fileno}}; +/*! + * Stylus - supports + * Copyright (c) Automattic + * MIT Licensed + */ +var Ht=function Supports(t){_t.call(this,"supports"),this.condition=t};Ht.prototype.__proto__=_t.prototype,Ht.prototype.clone=function(t){var e=new Ht;return e.condition=this.condition.clone(t,e),e.block=this.block.clone(t,e),e.lineno=this.lineno,e.column=this.column,e.filename=this.filename,e},Ht.prototype.toJSON=function(){return{__type:"Supports",condition:this.condition,block:this.block,lineno:this.lineno,column:this.column,filename:this.filename}},Ht.prototype.toString=function(){return"@supports "+this.condition}; +/*! + * Stylus - nodes + * Copyright (c) Automattic + * MIT Licensed + */ +const Dt={};function ParseError(t){this.name="ParseError",this.message=t,Error.captureStackTrace&&Error.captureStackTrace(this,ParseError)}function SyntaxError(t){this.name="SyntaxError",this.message=t,Error.captureStackTrace&&Error.captureStackTrace(this,ParseError)}Dt.lineno=null,Dt.column=null,Dt.filename=null,Dt.Node=X,Dt.Root=tt,Dt.Null=et,Dt.Each=nt,Dt.If=it,Dt.Call=rt,Dt.UnaryOp=st,Dt.BinOp=ot,Dt.Ternary=at,Dt.Block=ht,Dt.Unit=ct,Dt.String=ut,Dt.HSLA=ft,Dt.RGBA=vt,Dt.Ident=gt,Dt.Group=kt,Dt.Literal=wt,Dt.Boolean=bt,Dt.Return=xt,Dt.Media=St,Dt.QueryList=Ct,Dt.Query=Et,Dt.Feature=Nt,Dt.Params=At,Dt.Comment=Ft,Dt.Keyframes=Ot,Dt.Member=Lt,Dt.Charset=Bt,Dt.Namespace=jt,Dt.Import=Pt,Dt.Extend=It,Dt.Object=Rt,Dt.Function=Gt,Dt.Property=Mt,Dt.Selector=qt,Dt.Expression=Tt,Dt.Arguments=$t,Dt.Atblock=zt,Dt.Atrule=_t,Dt.Supports=Ht,Dt.true=new Dt.Boolean(!0),Dt.false=new Dt.Boolean(!1),Dt.null=new Dt.Null,ParseError.prototype.__proto__=Error.prototype,SyntaxError.prototype.__proto__=Error.prototype;const Qt=Lexer;var Wt={and:"&&",or:"||",is:"==",isnt:"!=","is not":"!=",":=":"?="};function Lexer(t,e){function comment(t,e,n,i){var r=i.lastIndexOf("/*",n)>i.lastIndexOf("*/",n),o=i.lastIndexOf("//",n),a=i.lastIndexOf("\n",n),h=0,l=0;if(~o&&o>a)for(;a!=n;){if("'"==i[a]&&(l?l--:l++),'"'==i[a]&&(h?h--:h++),"/"==i[a]&&"/"==i[a+1]){r=!l&&!h;break}++a}return r?t:","===e&&/^[,\t\n]+$/.test(t)?t.replace(/\n/,"\r"):e+"\r"}this.stash=[],this.indentStack=[],this.indentRe=null,this.lineno=1,this.column=1,"\ufeff"==t.charAt(0)&&(t=t.slice(1)),this.str=t.replace(/\s+$/,"\n").replace(/\r\n?/g,"\n").replace(/\\ *\n/g,"\r").replace(/([,(:](?!\/\/[^ ])) *(?:\/\/[^\n]*|\/\*.*?\*\/)?\n\s*/g,comment).replace(/\s*\n[ \t]*([,)])/g,comment)}Lexer.prototype={inspect:function(){for(var t,e=this.str,n=[];"eos"!=(t=this.next()).type;)n.push(t.inspect());return this.str=e,n.concat(t.inspect()).join("\n")},lookahead:function(t){for(var e=t-this.stash.length;e-- >0;)this.stash.push(this.advance());return this.stash[--t]},skip:function(t){var e=t[0];t=e?e.length:t,this.str=this.str.substr(t),e?this.move(e):this.column+=t},move:function(t){var e=t.match(/\n/g),n=t.lastIndexOf("\n");e&&(this.lineno+=e.length),this.column=~n?t.length-n:this.column+t.length},next:function(){var t=this.stashed()||this.advance();return this.prev=t,t},isPartOfSelector:function(){var t=this.stash[this.stash.length-1]||this.prev;switch(t&&t.type){case"color":return 2==t.val.raw.length;case".":case"[":return!0}return!1},advance:function(){var t=this.column,e=this.lineno,n=this.eos()||this.null()||this.sep()||this.keyword()||this.urlchars()||this.comment()||this.newline()||this.escaped()||this.important()||this.literal()||this.anonFunc()||this.atrule()||this.function()||this.brace()||this.paren()||this.color()||this.string()||this.unit()||this.namedop()||this.boolean()||this.unicode()||this.ident()||this.op()||function(){var n=this.eol();return n&&(t=n.column,e=n.lineno),n}.call(this)||this.space()||this.selector();return n.lineno=e,n.column=t,n},peek:function(){return this.lookahead(1)},stashed:function(){return this.stash.shift()},eos:function(){if(!this.str.length)return this.indentStack.length?(this.indentStack.shift(),new e("outdent")):new e("eos")},urlchars:function(){var t;if(this.isURL)return(t=/^[\/:@.;?&=*!,<>#%0-9]+/.exec(this.str))?(this.skip(t),new e("literal",new Dt.Literal(t[0]))):void 0},sep:function(){var t;if(t=/^;[ \t]*/.exec(this.str))return this.skip(t),new e(";")},eol:function(){if("\r"==this.str[0]){for(++this.lineno,this.skip(1),this.column=1;this.space(););return this.advance()}},space:function(){var t;if(t=/^([ \t]+)/.exec(this.str))return this.skip(t),new e("space")},escaped:function(){var t;if(t=/^\\(.)[ \t]*/.exec(this.str)){var n=t[1];return this.skip(t),new e("ident",new Dt.Literal(n))}},literal:function(){var t;if(t=/^@css[ \t]*\{/.exec(this.str)){this.skip(t);for(var n,i,r=1,o="";n=this.str[0];){switch(this.str=this.str.substr(1),n){case"{":++r;break;case"}":--r;break;case"\n":case"\r":++this.lineno}if(o+=n,!r)break}return o=o.replace(/\s*}$/,""),(i=new Dt.Literal(o)).css=!0,new e("literal",i)}},important:function(){var t;if(t=/^!important[ \t]*/.exec(this.str))return this.skip(t),new e("ident",new Dt.Literal("!important"))},brace:function(){var t;if(t=/^([{}])/.exec(this.str)){this.skip(1);var n=t[1];return new e(n,n)}},paren:function(){var t;if(t=/^([()])([ \t]*)/.exec(this.str)){var n=t[1];this.skip(t),")"==n&&(this.isURL=!1);var i=new e(n,n);return i.space=t[2],i}},null:function(){var t;if(t=/^(null)\b[ \t]*/.exec(this.str))return this.skip(t),this.isPartOfSelector()?new e("ident",new Dt.Ident(t[0])):new e("null",Dt.null)},keyword:function(){var t;if(t=/^(return|if|else|unless|for|in)\b[ \t]*/.exec(this.str)){var n=t[1];return this.skip(t),this.isPartOfSelector()?new e("ident",new Dt.Ident(t[0])):new e(n,n)}},namedop:function(){var t,n;if(t=/^(not|and|or|is a|is defined|isnt|is not|is)(?!-)\b([ \t]*)/.exec(this.str)){var i=t[1];return this.skip(t),(n=this.isPartOfSelector()?new e("ident",new Dt.Ident(t[0])):new e(i=Wt[i]||i,i)).space=t[2],n}},op:function(){var t;if(t=/^([.]{1,3}|&&|\|\||[!<>=?:]=|\*\*|[-+*\/%]=?|[,=?:!~<>&\[\]])([ \t]*)/.exec(this.str)){var n=t[1];this.skip(t);var i=new e(n=Wt[n]||n,n);return i.space=t[2],this.isURL=!1,i}},anonFunc:function(){var t;if("@"==this.str[0]&&"("==this.str[1])return this.skip(2),(t=new e("function",new Dt.Ident("anonymous"))).anonymous=!0,t},atrule:function(){var t;if(t=/^@(?!apply)(?:-(\w+)-)?([a-zA-Z0-9-_]+)[ \t]*/.exec(this.str)){this.skip(t);var n=t[1],i=t[2];switch(i){case"require":case"import":case"charset":case"namespace":case"media":case"scope":case"supports":return new e(i);case"document":return new e("-moz-document");case"block":return new e("atblock");case"extend":case"extends":return new e("extend");case"keyframes":return new e(i,n);default:return new e("atrule",n?"-"+n+"-"+i:i)}}},comment:function(){if("/"==this.str[0]&&"/"==this.str[1])return-1==(t=this.str.indexOf("\n"))&&(t=this.str.length),this.skip(t),this.advance();if("/"==this.str[0]&&"*"==this.str[1]){var t;-1==(t=this.str.indexOf("*/"))&&(t=this.str.length);var n=this.str.substr(0,t+2),i=n.split(/\n|\r/).length-1,r=!0,o=!1;return this.lineno+=i,this.skip(t+2),"!"==n[2]&&(n=n.replace("*!","*"),r=!1),this.prev&&";"==this.prev.type&&(o=!0),new e("comment",new Dt.Comment(n,r,o))}},boolean:function(){var t;if(t=/^(true|false)\b([ \t]*)/.exec(this.str)){var n=Dt.Boolean("true"==t[1]);this.skip(t);var i=new e("boolean",n);return i.space=t[2],i}},unicode:function(){var t;if(t=/^u\+[0-9a-f?]{1,6}(?:-[0-9a-f]{1,6})?/i.exec(this.str))return this.skip(t),new e("literal",new Dt.Literal(t[0]))},function:function(){var t;if(t=/^(-*[_a-zA-Z$][-\w\d$]*)\(([ \t]*)/.exec(this.str)){var n=t[1];this.skip(t),this.isURL="url"==n;var i=new e("function",new Dt.Ident(n));return i.space=t[2],i}},ident:function(){var t;if(t=/^-*([_a-zA-Z$]|@apply)[-\w\d$]*/.exec(this.str))return this.skip(t),new e("ident",new Dt.Ident(t[0]))},newline:function(){var t,n;if(this.indentRe?t=this.indentRe.exec(this.str):((t=(n=/^\n([\t]*)[ \t]*/).exec(this.str))&&!t[1].length&&(t=(n=/^\n([ \t]*)/).exec(this.str)),t&&t[1].length&&(this.indentRe=n)),t){var i,r=t[1].length;if(this.skip(t)," "===this.str[0]||"\t"===this.str[0])throw new SyntaxError("Invalid indentation. You can use tabs or spaces to indent, but not both.");if("\n"==this.str[0])return this.advance();if(this.indentStack.length&&rr;)this.stash.push(new e("outdent")),this.indentStack.shift();i=this.stash.pop()}else r&&r!=this.indentStack[0]?(this.indentStack.unshift(r),i=new e("indent")):i=new e("newline");return i}},unit:function(){var t;if(t=/^(-)?(\d+\.\d+|\d+|\.\d+)(%|[a-zA-Z]+)?[ \t]*/.exec(this.str)){this.skip(t);var n=parseFloat(t[2]);"-"==t[1]&&(n=-n);var i=new Dt.Unit(n,t[3]);return i.raw=t[0],new e("unit",i)}},string:function(){var t;if(t=/^("[^"]*"|'[^']*')[ \t]*/.exec(this.str)){var n=t[1],i=t[0][0];return this.skip(t),n=n.slice(1,-1).replace(/\\n/g,"\n"),new e("string",new Dt.String(n,i))}},color:function(){return this.rrggbbaa()||this.rrggbb()||this.rgba()||this.rgb()||this.nn()||this.n()},n:function(){var t;if(t=/^#([a-fA-F0-9]{1})[ \t]*/.exec(this.str)){this.skip(t);var n=parseInt(t[1]+t[1],16),i=new Dt.RGBA(n,n,n,1);return i.raw=t[0],new e("color",i)}},nn:function(){var t;if(t=/^#([a-fA-F0-9]{2})[ \t]*/.exec(this.str)){this.skip(t);var n=parseInt(t[1],16),i=new Dt.RGBA(n,n,n,1);return i.raw=t[0],new e("color",i)}},rgb:function(){var t;if(t=/^#([a-fA-F0-9]{3})[ \t]*/.exec(this.str)){this.skip(t);var n=t[1],i=parseInt(n[0]+n[0],16),r=parseInt(n[1]+n[1],16),o=parseInt(n[2]+n[2],16),a=new Dt.RGBA(i,r,o,1);return a.raw=t[0],new e("color",a)}},rgba:function(){var t;if(t=/^#([a-fA-F0-9]{4})[ \t]*/.exec(this.str)){this.skip(t);var n=t[1],i=parseInt(n[0]+n[0],16),r=parseInt(n[1]+n[1],16),o=parseInt(n[2]+n[2],16),a=parseInt(n[3]+n[3],16),h=new Dt.RGBA(i,r,o,a/255);return h.raw=t[0],new e("color",h)}},rrggbb:function(){var t;if(t=/^#([a-fA-F0-9]{6})[ \t]*/.exec(this.str)){this.skip(t);var n=t[1],i=parseInt(n.substr(0,2),16),r=parseInt(n.substr(2,2),16),o=parseInt(n.substr(4,2),16),a=new Dt.RGBA(i,r,o,1);return a.raw=t[0],new e("color",a)}},rrggbbaa:function(){var t;if(t=/^#([a-fA-F0-9]{8})[ \t]*/.exec(this.str)){this.skip(t);var n=t[1],i=parseInt(n.substr(0,2),16),r=parseInt(n.substr(2,2),16),o=parseInt(n.substr(4,2),16),a=parseInt(n.substr(6,2),16),h=new Dt.RGBA(i,r,o,a/255);return h.raw=t[0],new e("color",h)}},selector:function(){var t;if(t=/^\^|.*?(?=\/\/(?![^\[]*\])|[,\n{])/.exec(this.str)){var n=t[0];return this.skip(t),new e("selector",n)}}};var NullCache=function(){};NullCache.prototype.set=function(t,e){},NullCache.prototype.get=function(t){},NullCache.prototype.has=function(t){return!1},NullCache.prototype.key=function(t,e){return""};var Kt=65407===new Uint16Array(new Uint8Array([127,255]).buffer)[0];function hexify(t){for(var e="",n=8;n--;)e+=(t>>>(n<<2)&15).toString(16);return e}function parity(t,e,n){return t^e^n}function majority(t,e,n){return t&e^t&n^e&n}function rotateLeft(t,e){return t<>>32-e}var Zt=new Uint32Array(80),MemoryCache=function(t){t=t||{},this.limit=t["cache limit"]||256,this._cache={},this.length=0,this.head=this.tail=null};MemoryCache.prototype.set=function(t,e){var n,i=e.clone();i.filename=Dt.filename,i.lineno=Dt.lineno,i.column=Dt.column,n={key:t,value:i},this._cache[t]=n,this.tail?(this.tail.next=n,n.prev=this.tail):this.head=n,this.tail=n,this.length++==this.limit&&this.purge()},MemoryCache.prototype.get=function(t){var e=this._cache[t],n=e.value.clone();return e==this.tail||(e.next&&(e==this.head&&(this.head=e.next),e.next.prev=e.prev),e.prev&&(e.prev.next=e.next),e.next=null,e.prev=this.tail,this.tail&&(this.tail.next=e),this.tail=e),n},MemoryCache.prototype.has=function(t){return!!this._cache[t]},MemoryCache.prototype.key=function(t,e){var n=function createHash(){let t="";return{update:function update(e){t+=e},digest:function digest(){return function sha1(t){if(!(t instanceof Uint8Array))throw new TypeError("Input data must be a Uint8Array.");var e,n=new ArrayBuffer(function align(t,e){var n=e-1;return t+n&~n}(t.byteLength+9,64)),i=new Uint32Array(n),r=new Uint8Array(n);if(r.set(t),r[t.byteLength]=128,Kt)for(var o=0,a=i.length;o>24&255|e>>8&65280|e<<8&16711680|e<<24&4278190080;var h,l=8*t.byteLength;i[i.length-2]=l/Math.pow(2,32),i[i.length-1]=l;for(var c=1732584193,u=4023233417,f=2562383102,d=271733878,m=3285377520,v=void 0,y=void 0,g=void 0,k=void 0,w=void 0,b=void 0,x=void 0,_=0,S=i.length;_","=",":","&","&&","~","{","}",".","..","/"],Xt=["matches","not","dir","lang","any-link","link","visited","local-link","target","scope","hover","active","focus","drop","current","past","future","enabled","disabled","read-only","read-write","placeholder-shown","checked","indeterminate","valid","invalid","in-range","out-of-range","required","optional","user-error","root","empty","blank","nth-child","nth-last-child","first-child","last-child","only-child","nth-of-type","nth-last-of-type","first-of-type","last-of-type","only-of-type","nth-match","nth-last-match","nth-column","nth-last-column","first-line","first-letter","before","after","selection"],te=function Parser(t,e){var n=this;e=e||{},Parser.cache=Parser.cache||Parser.getCache(e),this.hash=Parser.cache.key(t,e),this.lexer={},Parser.cache.has(this.hash)||(this.lexer=new Qt(t,e)),this.prefix=e.prefix||"",this.root=e.root||new Dt.Root,this.state=["root"],this.stash=[],this.parens=0,this.css=0,this.state.pop=function(){n.prevState=[].pop.call(this)}}; +/*! + * Stylus - Parser + * Copyright (c) Automattic + * MIT Licensed + */te.getCache=function(t){return!1===t.cache?getCache(!1):getCache(t.cache||"memory",t)},te.prototype={constructor:te,currentState:function(){return this.state[this.state.length-1]},previousState:function(){return this.state[this.state.length-2]},parse:function(){var t=this.parent=this.root;if(te.cache.has(this.hash))"block"==(t=te.cache.get(this.hash)).nodeName&&(t.constructor=Dt.Root);else{for(;"eos"!=this.peek().type&&(this.skipWhitespace(),"eos"!=this.peek().type);){var e=this.statement();this.accept(";"),e||this.error("unexpected token {peek}, not allowed at the root level"),t.push(e)}te.cache.set(this.hash,t)}return t},error:function(t){var e=this.peek().type,n=null==this.peek().val?"":" "+this.peek().toString();throw n.trim()==e.trim()&&(n=""),new ParseError(t.replace("{peek}",'"'+e+n+'"'))},accept:function(t){if(t==this.peek().type)return this.next()},expect:function(t){return t!=this.peek().type&&this.error('expected "'+t+'", got {peek}'),this.next()},next:function(){var t=this.stash.length?this.stash.pop():this.lexer.next(),e=t.lineno,n=t.column||1;return t.val&&t.val.nodeName&&(t.val.lineno=e,t.val.column=n),Dt.lineno=e,Dt.column=n,Vt.lexer("%s %s",t.type,t.val||""),t},peek:function(){return this.lexer.peek()},lookahead:function(t){return this.lexer.lookahead(t)},isSelectorToken:function(t){var e=this.lookahead(t).type;switch(e){case"for":return this.bracketed;case"[":return this.bracketed=!0,!0;case"]":return this.bracketed=!1,!0;default:return~Yt.indexOf(e)}},isPseudoSelector:function(t){var e=this.lookahead(t).val;return e&&~Xt.indexOf(e.name)},lineContains:function(t){for(var e,n=1;e=this.lookahead(n++);){if(~["indent","outdent","newline","eos"].indexOf(e.type))return;if(t==e.type)return!0}},selectorToken:function(){if(this.isSelectorToken(1)){if("{"==this.peek().type){if(!this.lineContains("}"))return;for(var t,e=0;t=this.lookahead(++e);){if("}"==t.type){if(2==e||3==e&&"space"==this.lookahead(e-1).type)return;break}if(":"==t.type)return}}return this.next()}},skip:function(t){for(;~t.indexOf(this.peek().type);)this.next()},skipWhitespace:function(){this.skip(["space","indent","outdent","newline"])},skipNewlines:function(){for(;"newline"==this.peek().type;)this.next()},skipSpaces:function(){for(;"space"==this.peek().type;)this.next()},skipSpacesAndComments:function(){for(;"space"==this.peek().type||"comment"==this.peek().type;)this.next()},looksLikeFunctionDefinition:function(t){return"indent"==this.lookahead(t).type||"{"==this.lookahead(t).type},looksLikeSelector:function(t){var e,n,i=1;if(t&&":"==this.lookahead(i+1).type&&(this.lookahead(i+1).space||"indent"==this.lookahead(i+2).type))return!1;for(;"ident"==this.lookahead(i).type&&("newline"==this.lookahead(i+1).type||","==this.lookahead(i+1).type);)i+=2;for(;this.isSelectorToken(i)||","==this.lookahead(i).type;){if("selector"==this.lookahead(i).type)return!0;if("&"==this.lookahead(i+1).type)return!0;if(i>1&&"ident"===this.lookahead(i-1).type&&"."===this.lookahead(i).type&&"ident"===this.lookahead(i+1).type){for(;e=this.lookahead(i+2);){if(-1!==["indent","outdent","{",";","eos","selector","media","if","atrule",")","}","unit","[","for","function"].indexOf(e.type)){if("["!==e.type){if(this.isPseudoSelector(i+2))return!0;if(")"===e.type&&this.lookahead(i+3)&&"}"===this.lookahead(i+3).type)break;return-1===["outdent",";","eos","media","if","atrule",")","}","unit","for","function"].indexOf(e.type)}for(;(e=this.lookahead(i+3))&&"]"!==e.type;){if(~[".","unit"].indexOf(e.type))return!1;i+=1}}i+=1}return!0}if("."==this.lookahead(i).type&&"ident"==this.lookahead(i+1).type)return!0;if("*"==this.lookahead(i).type&&"newline"==this.lookahead(i+1).type)return!0;if(":"==this.lookahead(i).type&&":"==this.lookahead(i+1).type)return!0;if("color"==this.lookahead(i).type&&"newline"==this.lookahead(i-1).type)return!0;if(this.looksLikeAttributeSelector(i))return!0;if(("="==this.lookahead(i).type||"function"==this.lookahead(i).type)&&"{"==this.lookahead(i+1).type)return!1;if(":"==this.lookahead(i).type&&!this.isPseudoSelector(i+1)&&this.lineContains("."))return!1;if("{"==this.lookahead(i).type?n=!0:"}"==this.lookahead(i).type&&(n=!1),n&&":"==this.lookahead(i).type)return!0;if("space"==this.lookahead(i).type&&"{"==this.lookahead(i+1).type)return!0;if(":"==this.lookahead(i++).type&&!this.lookahead(i-1).space&&this.isPseudoSelector(i))return!0;if("space"==this.lookahead(i).type&&"newline"==this.lookahead(i+1).type&&"{"==this.lookahead(i+2).type)return!0;if(","==this.lookahead(i).type&&"newline"==this.lookahead(i+1).type)return!0}if(","==this.lookahead(i).type&&"newline"==this.lookahead(i+1).type)return!0;if("{"==this.lookahead(i).type&&"newline"==this.lookahead(i+1).type)return!0;if(this.css&&(";"==this.lookahead(i).type||"}"==this.lookahead(i-1).type))return!1;for(;!~["indent","outdent","newline","for","if",";","}","eos"].indexOf(this.lookahead(i).type);)++i;return"indent"==this.lookahead(i).type||void 0},looksLikeAttributeSelector:function(t){var e=this.lookahead(t).type;return!("="!=e||!this.bracketed)||("ident"==e||"string"==e)&&"]"==this.lookahead(t+1).type&&("newline"==this.lookahead(t+2).type||this.isSelectorToken(t+2))&&!this.lineContains(":")&&!this.lineContains("=")},looksLikeKeyframe:function(){var t,e=2;switch(this.lookahead(e).type){case"{":case"indent":case",":return!0;case"newline":for(;"unit"==this.lookahead(++e).type||"newline"==this.lookahead(e).type;);return"indent"==(t=this.lookahead(e).type)||"{"==t}},stateAllowsSelector:function(){switch(this.currentState()){case"root":case"atblock":case"selector":case"conditional":case"function":case"atrule":case"for":return!0}},assignAtblock:function(t){try{t.push(this.atblock(t))}catch(t){this.error("invalid right-hand side operand in assignment, got {peek}")}},statement:function(){var t,e,n=this.stmt(),i=this.prevState;switch(this.allowPostfix&&(this.allowPostfix=!1,i="expression"),i){case"assignment":case"expression":case"function arguments":for(;e=this.accept("if")||this.accept("unless")||this.accept("for");)switch(e.type){case"if":case"unless":(n=new Dt.If(this.expression(),n)).postfix=!0,n.negate="unless"==e.type,this.accept(";");break;case"for":var r,o=this.id().name;this.accept(",")&&(r=this.id().name),this.expect("in");var a=new Dt.Each(o,r,this.expression());(t=new Dt.Block(this.parent,a)).push(n),a.block=t,n=a}}return n},stmt:function(){var t,e=this.peek();switch(e.type){case"keyframes":return this.keyframes();case"-moz-document":return this.mozdocument();case"comment":case"selector":case"literal":case"charset":case"namespace":case"import":case"require":case"extend":case"media":case"atrule":case"ident":case"scope":case"supports":case"unless":case"function":case"for":case"if":return this[e.type]();case"return":return this.return();case"{":return this.property();default:if(this.stateAllowsSelector())switch(e.type){case"color":case"~":case">":case"<":case":":case"&":case"&&":case"[":case".":case"/":return(t=this.selector()).column=e.column,t.lineno=e.lineno,t;case"..":if("/"==this.lookahead(2).type)return this.selector();case"+":return"function"==this.lookahead(2).type?this.functionCall():this.selector();case"*":return this.property();case"unit":if(this.looksLikeKeyframe())return(t=this.selector()).column=e.column,t.lineno=e.lineno,t;case"-":if("{"==this.lookahead(2).type)return this.property()}var n=this.expression();return n.isEmpty&&this.error("unexpected {peek}"),n}},block:function(t,e){var n,i,r,o=this.parent=new Dt.Block(this.parent,t);for(!1===e&&(o.scope=!1),this.accept("newline"),this.accept("{")?(this.css++,n="}",this.skipWhitespace()):(n="outdent",this.expect("indent"));n!=this.peek().type;){if(this.css){if(this.accept("newline")||this.accept("indent"))continue;i=this.statement(),this.accept(";"),this.skipWhitespace()}else{if(this.accept("newline"))continue;if(r=this.lookahead(2).type,"indent"==this.peek().type&&~["outdent","newline","comment"].indexOf(r)){this.skip(["indent","outdent"]);continue}if("eos"==this.peek().type)return o;i=this.statement(),this.accept(";")}i||this.error("unexpected token {peek} in block"),o.push(i)}return this.css?(this.skipWhitespace(),this.expect("}"),this.skipSpaces(),this.css--):this.expect("outdent"),this.parent=o.parent,o},comment:function(){var t=this.next().val;return this.skipSpaces(),t},for:function(){this.expect("for");var t,e=this.id().name;this.accept(",")&&(t=this.id().name),this.expect("in"),this.state.push("for"),this.cond=!0;var n=new Dt.Each(e,t,this.expression());return this.cond=!1,n.block=this.block(n,!1),this.state.pop(),n},return:function(){this.expect("return");var t=this.expression();return t.isEmpty?new Dt.Return:new Dt.Return(t)},unless:function(){this.expect("unless"),this.state.push("conditional"),this.cond=!0;var t=new Dt.If(this.expression(),!0);return this.cond=!1,t.block=this.block(t,!1),this.state.pop(),t},if:function(){var t=this.expect("if");this.state.push("conditional"),this.cond=!0;var e,n,i,r=new Dt.If(this.expression());for(r.column=t.column,this.cond=!1,r.block=this.block(r,!1),this.skip(["newline","comment"]);this.accept("else");){if(!(t=this.accept("if"))){r.elses.push(this.block(r,!1));break}this.cond=!0,e=this.expression(),this.cond=!1,n=this.block(r,!1),(i=new Dt.If(e,n)).column=t.column,r.elses.push(i),this.skip(["newline","comment"])}return this.state.pop(),r},atblock:function(t){return t||this.expect("atblock"),t=new Dt.Atblock,this.state.push("atblock"),t.block=this.block(t,!1),this.state.pop(),t},atrule:function(){var t,e=this.expect("atrule").val,n=new Dt.Atrule(e);return this.skipSpacesAndComments(),n.segments=this.selectorParts(),this.skipSpacesAndComments(),("indent"==(t=this.peek().type)||"{"==t||"newline"==t&&"{"==this.lookahead(2).type)&&(this.state.push("atrule"),n.block=this.block(n),this.state.pop()),n},scope:function(){this.expect("scope");var t=this.selectorParts().map((function(t){return t.val})).join("");return this.selectorScope=t.trim(),Dt.null},supports:function(){this.expect("supports");var t=new Dt.Supports(this.supportsCondition());return this.state.push("atrule"),t.block=this.block(t),this.state.pop(),t},supportsCondition:function(){var t=this.supportsNegation()||this.supportsOp();return t||(this.cond=!0,t=this.expression(),this.cond=!1),t},supportsNegation:function(){if(this.accept("not")){var t=new Dt.Expression;return t.push(new Dt.Literal("not")),t.push(this.supportsFeature()),t}},supportsOp:function(){var t,e,n=this.supportsFeature();if(n){for((e=new Dt.Expression).push(n);t=this.accept("&&")||this.accept("||");)e.push(new Dt.Literal("&&"==t.val?"and":"or")),e.push(this.supportsFeature());return e}},supportsFeature:function(){if(this.skipSpacesAndComments(),"("==this.peek().type){var t=this.lookahead(2).type;if("ident"==t||"{"==t)return this.feature();this.expect("(");var e=new Dt.Expression;return e.push(new Dt.Literal("(")),e.push(this.supportsCondition()),this.expect(")"),e.push(new Dt.Literal(")")),this.skipSpacesAndComments(),e}},extend:function(){var t,e,n,i=this.expect("extend"),r=[];do{(n=this.selectorParts()).length&&(t=new Dt.Selector(n),r.push(t),"!"===this.peek().type&&"ident"===(i=this.lookahead(2)).type&&"optional"===i.val.name&&(this.skip(["!","ident"]),t.optional=!0))}while(this.accept(","));return(e=new Dt.Extend(r)).lineno=i.lineno,e.column=i.column,e},media:function(){this.expect("media"),this.state.push("atrule");var t=new Dt.Media(this.queries());return t.block=this.block(t),this.state.pop(),t},queries:function(){var t=new Dt.QueryList,e=["comment","newline","space"];do{this.skip(e),t.push(this.query()),this.skip(e)}while(this.accept(","));return t},query:function(){var t,e,n,i=new Dt.Query;if("ident"==this.peek().type&&("."==this.lookahead(2).type||"["==this.lookahead(2).type))return this.cond=!0,t=this.expression(),this.cond=!1,i.push(new Dt.Feature(t.nodes)),i;if((e=this.accept("ident")||this.accept("not"))&&(e=new Dt.Literal(e.val.string||e.val),this.skipSpacesAndComments(),(n=this.accept("ident"))?(i.type=n.val,i.predicate=e):i.type=e,this.skipSpacesAndComments(),!this.accept("&&")))return i;do{i.push(this.feature())}while(this.accept("&&"));return i},feature:function(){this.skipSpacesAndComments(),this.expect("("),this.skipSpacesAndComments();var t=new Dt.Feature(this.interpolate());return this.skipSpacesAndComments(),this.accept(":"),this.skipSpacesAndComments(),this.inProperty=!0,t.expr=this.list(),this.inProperty=!1,this.skipSpacesAndComments(),this.expect(")"),this.skipSpacesAndComments(),t},mozdocument:function(){this.expect("-moz-document");var t=new Dt.Atrule("-moz-document"),e=[];do{this.skipSpacesAndComments(),e.push(this.functionCall()),this.skipSpacesAndComments()}while(this.accept(","));return t.segments=[new Dt.Literal(e.join(", "))],this.state.push("atrule"),t.block=this.block(t,!1),this.state.pop(),t},import:function(){return this.expect("import"),this.allowPostfix=!0,new Dt.Import(this.expression(),!1)},require:function(){return this.expect("require"),this.allowPostfix=!0,new Dt.Import(this.expression(),!0)},charset:function(){this.expect("charset");var t=this.expect("string").val;return this.allowPostfix=!0,new Dt.Charset(t)},namespace:function(){var t,e;return this.expect("namespace"),this.skipSpacesAndComments(),(e=this.accept("ident"))&&(e=e.val),this.skipSpacesAndComments(),t=this.accept("string")||this.url(),this.allowPostfix=!0,new Dt.Namespace(t,e)},keyframes:function(){var t,e=this.expect("keyframes");return this.skipSpacesAndComments(),(t=new Dt.Keyframes(this.selectorParts(),e.val)).column=e.column,this.skipSpacesAndComments(),this.state.push("atrule"),t.block=this.block(t),this.state.pop(),t},literal:function(){return this.expect("literal").val},id:function(){var t=this.expect("ident");return this.accept("space"),t.val},ident:function(){for(var t=2,e=this.lookahead(t).type;"space"==e;)e=this.lookahead(++t).type;switch(e){case"=":case"?=":case"-=":case"+=":case"*=":case"/=":case"%=":return this.assignment();case".":if("space"==this.lookahead(t-1).type)return this.selector();if(this._ident==this.peek())return this.id();for(;"="!=this.lookahead(++t).type&&!~["[",",","newline","indent","eos"].indexOf(this.lookahead(t).type););if("="==this.lookahead(t).type)return this._ident=this.peek(),this.expression();if(this.looksLikeSelector()&&this.stateAllowsSelector())return this.selector();case"[":if(this._ident==this.peek())return this.id();for(;"]"!=this.lookahead(t++).type&&"selector"!=this.lookahead(t).type&&"eos"!=this.lookahead(t).type;);if("="==this.lookahead(t).type)return this._ident=this.peek(),this.expression();if(this.looksLikeSelector()&&this.stateAllowsSelector())return this.selector();case"-":case"+":case"/":case"*":case"%":case"**":case"&&":case"||":case">":case"<":case">=":case"<=":case"!=":case"==":case"?":case"in":case"is a":case"is defined":if(this._ident==this.peek())return this.id();switch(this._ident=this.peek(),this.currentState()){case"for":case"selector":return this.property();case"root":case"atblock":case"atrule":return"["==e?this.subscript():this.selector();case"function":case"conditional":return this.looksLikeSelector()?this.selector():this.expression();default:return this.operand?this.id():this.expression()}default:switch(this.currentState()){case"root":return this.selector();case"for":case"selector":case"function":case"conditional":case"atblock":case"atrule":return this.property();default:var n=this.id();return"interpolation"==this.previousState()&&(n.mixin=!0),n}}},interpolate:function(){var t,e=[];for(this.accept("*")&&e.push(new Dt.Literal("*"));;)if(this.accept("{"))this.state.push("interpolation"),e.push(this.expression()),this.expect("}"),this.state.pop();else if(t=this.accept("-"))e.push(new Dt.Literal("-"));else{if(!(t=this.accept("ident")))break;e.push(t.val)}return e.length||this.expect("ident"),e},property:function(){if(this.looksLikeSelector(!0))return this.selector();var t=this.interpolate(),e=new Dt.Property(t),n=e;return this.accept("space"),this.accept(":")&&this.accept("space"),this.state.push("property"),this.inProperty=!0,e.expr=this.list(),e.expr.isEmpty&&(n=t[0]),this.inProperty=!1,this.allowPostfix=!0,this.state.pop(),this.accept(";"),n},selector:function(){var t,e,n=new Dt.Group,i=this.selectorScope,r="root"==this.currentState();do{this.accept("newline"),t=this.selectorParts(),r&&i&&t.unshift(new Dt.Literal(i+" ")),t.length&&((e=new Dt.Selector(t)).lineno=t[0].lineno,e.column=t[0].column,n.push(e))}while(this.accept(",")||this.accept("newline"));return"selector-parts"==this.currentState()?n.nodes:(this.state.push("selector"),n.block=this.block(n),this.state.pop(),n)},selectorParts:function(){for(var t,e=[];t=this.selectorToken();)switch(Vt.selector("%s",t),t.type){case"{":this.skipSpaces();var n=this.expression();this.skipSpaces(),this.expect("}"),e.push(n);break;case this.prefix&&".":var i=new Dt.Literal(t.val+this.prefix);i.prefixed=!0,e.push(i);break;case"comment":break;case"color":case"unit":e.push(new Dt.Literal(t.val.raw));break;case"space":e.push(new Dt.Literal(" "));break;case"function":e.push(new Dt.Literal(t.val.name+"("));break;case"ident":e.push(new Dt.Literal(t.val.name||t.val.string));break;default:e.push(new Dt.Literal(t.val)),t.space&&e.push(new Dt.Literal(" "))}return e},assignment:function(){var t,e,n=this.id(),i=n.name;if(t=this.accept("=")||this.accept("?=")||this.accept("+=")||this.accept("-=")||this.accept("*=")||this.accept("/=")||this.accept("%=")){this.state.push("assignment");var r=this.list();switch(r.isEmpty&&this.assignAtblock(r),(e=new Dt.Ident(i,r)).lineno=n.lineno,e.column=n.column,this.state.pop(),t.type){case"?=":var o=new Dt.BinOp("is defined",e),a=new Dt.Expression;a.push(new Dt.Ident(i)),e=new Dt.Ternary(o,a,e);break;case"+=":case"-=":case"*=":case"/=":case"%=":e.val=new Dt.BinOp(t.type[0],new Dt.Ident(i),r)}}return e},function:function(){var t,e=1,n=2;t:for(;t=this.lookahead(n++);)switch(t.type){case"function":case"(":++e;break;case")":if(!--e)break t;break;case"eos":this.error('failed to find closing paren ")"')}switch(this.currentState()){case"expression":return this.functionCall();default:return this.looksLikeFunctionDefinition(n)?this.functionDefinition():this.expression()}},url:function(){this.expect("function"),this.state.push("function arguments");var t=this.args();return this.expect(")"),this.state.pop(),new Dt.Call("url",t)},functionCall:function(){var t=this.accept("+");if("url"==this.peek().val.name)return this.url();var e=this.expect("function").val,n=e.name;this.state.push("function arguments"),this.parens++;var i=this.args();this.expect(")"),this.parens--,this.state.pop();var r=new Dt.Call(n,i);return r.column=e.column,r.lineno=e.lineno,t&&(this.state.push("function"),r.block=this.block(r),this.state.pop()),r},functionDefinition:function(){var t=this.expect("function"),e=t.val.name;this.state.push("function params"),this.skipWhitespace();var n=this.params();this.skipWhitespace(),this.expect(")"),this.state.pop(),this.state.push("function");var i=new Dt.Function(e,n);return i.column=t.column,i.lineno=t.lineno,i.block=this.block(i),this.state.pop(),new Dt.Ident(e,i)},params:function(){for(var t,e,n=new Dt.Params;t=this.accept("ident");)this.accept("space"),n.push(e=t.val),this.accept("...")?e.rest=!0:this.accept("=")&&(e.val=this.expression()),this.skipWhitespace(),this.accept(","),this.skipWhitespace();return n},args:function(){var t,e=new Dt.Arguments;do{"ident"==this.peek().type&&":"==this.lookahead(2).type?(t=this.next().val.string,this.expect(":"),e.map[t]=this.expression()):e.push(this.expression())}while(this.accept(","));return e},list:function(){for(var t=this.expression();this.accept(",");)if(t.isList)e.push(this.expression());else{var e=new Dt.Expression(!0);e.push(t),e.push(this.expression()),t=e}return t},expression:function(){var t,e=new Dt.Expression;for(this.state.push("expression");t=this.negation();)t||this.error("unexpected token {peek} in expression"),e.push(t);return this.state.pop(),e.nodes.length&&(e.lineno=e.nodes[0].lineno,e.column=e.nodes[0].column),e},negation:function(){return this.accept("not")?new Dt.UnaryOp("!",this.negation()):this.ternary()},ternary:function(){var t=this.logical();if(this.accept("?")){var e=this.expression();this.expect(":");var n=this.expression();t=new Dt.Ternary(t,e,n)}return t},logical:function(){for(var t,e=this.typecheck();t=this.accept("&&")||this.accept("||");)e=new Dt.BinOp(t.type,e,this.typecheck());return e},typecheck:function(){for(var t,e=this.equality();t=this.accept("is a");)this.operand=!0,e||this.error('illegal unary "'+t+'", missing left-hand operand'),e=new Dt.BinOp(t.type,e,this.equality()),this.operand=!1;return e},equality:function(){for(var t,e=this.in();t=this.accept("==")||this.accept("!=");)this.operand=!0,e||this.error('illegal unary "'+t+'", missing left-hand operand'),e=new Dt.BinOp(t.type,e,this.in()),this.operand=!1;return e},in:function(){for(var t=this.relational();this.accept("in");)this.operand=!0,t||this.error('illegal unary "in", missing left-hand operand'),t=new Dt.BinOp("in",t,this.relational()),this.operand=!1;return t},relational:function(){for(var t,e=this.range();t=this.accept(">=")||this.accept("<=")||this.accept("<")||this.accept(">");)this.operand=!0,e||this.error('illegal unary "'+t+'", missing left-hand operand'),e=new Dt.BinOp(t.type,e,this.range()),this.operand=!1;return e},range:function(){var t,e=this.additive();return(t=this.accept("...")||this.accept(".."))&&(this.operand=!0,e||this.error('illegal unary "'+t+'", missing left-hand operand'),e=new Dt.BinOp(t.val,e,this.additive()),this.operand=!1),e},additive:function(){for(var t,e=this.multiplicative();t=this.accept("+")||this.accept("-");)this.operand=!0,e=new Dt.BinOp(t.type,e,this.multiplicative()),this.operand=!1;return e},multiplicative:function(){for(var t,n=this.defined();t=this.accept("**")||this.accept("*")||this.accept("/")||this.accept("%");){if(this.operand=!0,"/"==t&&this.inProperty&&!this.parens)return this.stash.push(new e("literal",new Dt.Literal("/"))),this.operand=!1,n;n||this.error('illegal unary "'+t+'", missing left-hand operand'),n=new Dt.BinOp(t.type,n,this.defined()),this.operand=!1}return n},defined:function(){var t=this.unary();return this.accept("is defined")&&(t||this.error('illegal unary "is defined", missing left-hand operand'),t=new Dt.BinOp("is defined",t)),t},unary:function(){var t,e;return(t=this.accept("!")||this.accept("~")||this.accept("+")||this.accept("-"))?(this.operand=!0,(e=this.unary())||this.error('illegal unary "'+t+'"'),e=new Dt.UnaryOp(t.type,e),this.operand=!1,e):this.subscript()},subscript:function(){for(var t=this.member();this.accept("[");)t=new Dt.BinOp("[]",t,this.expression()),this.expect("]");return this.accept("=")&&(t.op+="=",t.val=this.list(),t.val.isEmpty&&this.assignAtblock(t.val)),t},member:function(){var t=this.primary();if(t){for(;this.accept(".");){var e=new Dt.Ident(this.expect("ident").val.string);t=new Dt.Member(t,e)}this.skipSpaces(),this.accept("=")&&(t.val=this.list(),t.val.isEmpty&&this.assignAtblock(t.val))}return t},object:function(){var t,e,n,i,r=new Dt.Object;for(this.expect("{"),this.skipWhitespace();!this.accept("}");)this.accept("comment")||this.accept("newline")||(n||this.accept(","),(t=this.accept("ident")||this.accept("string"))||this.error('expected "ident" or "string", got {peek}'),i=t.val.hash,this.skipSpacesAndComments(),this.expect(":"),e=this.expression(),r.setValue(i,e),r.setKey(i,t.val),n=this.accept(","),this.skipWhitespace());return r},primary:function(){var t;if(this.skipSpaces(),this.accept("(")){++this.parens;var e=this.expression(),n=this.expect(")");return--this.parens,this.accept("%")&&e.push(new Dt.Ident("%")),t=this.peek(),!n.space&&"ident"==t.type&&~u.indexOf(t.val.string)&&(e.push(new Dt.Ident(t.val.string)),this.next()),e}switch((t=this.peek()).type){case"null":case"unit":case"color":case"string":case"literal":case"boolean":case"comment":return this.next().val;case!this.cond&&"{":return this.object();case"atblock":return this.atblock();case"atrule":var i=new Dt.Ident(this.next().val);return i.property=!0,i;case"ident":return this.ident();case"function":return t.anonymous?this.functionDefinition():this.functionCall()}}};const ee={exports:{}};!function(t){void 0!==ee&&(ee.exports=t);var e={on:function on(t,e){return getListeners(this,t).push(e),this},once:function once(t,e){var n=this;return wrap.originalListener=e,getListeners(n,t).push(wrap),n;function wrap(){off.call(n,t,wrap),e.apply(this,arguments)}},off:off,emit:function emit(t,e){var n=this,i=getListeners(n,t,!0);if(!i)return!1;var r=arguments.length;if(1===r)i.forEach(zeroarg);else if(2===r)i.forEach(onearg);else{var o=Array.prototype.slice.call(arguments,1);i.forEach(moreargs)}return!!i.length;function zeroarg(t){t.call(n)}function onearg(t){t.call(n,e)}function moreargs(t){t.apply(n,o)}}};function mixin(t){for(var n in e)t[n]=e[n];return t}function off(t,e){var n,i=this;if(arguments.length){if(e){if(n=getListeners(i,t,!0)){if(!(n=n.filter(ne)).length)return off.call(i,t);i.listeners[t]=n}}else if((n=i.listeners)&&(delete n[t],!Object.keys(n).length))return off.call(i)}else delete i.listeners;return i;function ne(t){return t!==e&&t.originalListener!==e}}function getListeners(t,e,n){if(!n||t.listeners){var i=t.listeners||(t.listeners={});return i[e]||(i[e]=[])}}mixin(t.prototype),t.mixin=mixin}(( +/** + * event-lite.js - Light-weight EventEmitter (less than 1KB when gzipped) + * + * @copyright Yusuke Kawasaki + * @license MIT + * @constructor + * @see https://github.com/kawanet/event-lite + * @see http://kawanet.github.io/event-lite/EventLite.html + * @example + * var EventLite = require("event-lite"); + * + * function MyClass() {...} // your class + * + * EventLite.mixin(MyClass.prototype); // import event methods + * + * var obj = new MyClass(); + * obj.on("foo", function() {...}); // add event listener + * obj.once("bar", function() {...}); // add one-time event listener + * obj.emit("foo"); // dispatch event + * obj.emit("bar"); // dispatch another event + * obj.off("foo"); // remove event listener + */ +function EventLite(){if(!(this instanceof EventLite))return new EventLite}));var ie=ee.exports;const re=class{constructor(){this.events=new ie}on(...t){return this.events.on(...t)}off(...t){return this.events.off(...t)}once(...t){return this.events.once(...t)}emit(...t){return this.events.emit(...t)}listeners(t){return this.events.listeners&&this.events.listeners[t]||[]}},noop$1=()=>noop$1;var se=t.dirname,oe=function DepsResolver(t,e){this.root=t,this.filename=e.filename,this.paths=e.paths||[],this.paths.push(se(e.filename||".")),this.options=e,this.functions={},this.deps=[]};oe.prototype.__proto__=c.prototype;var ae=oe.prototype.visit;oe.prototype.visit=function(t){switch(t.nodeName){case"root":case"block":case"expression":this.visitRoot(t);break;case"group":case"media":case"atblock":case"atrule":case"keyframes":case"each":case"supports":this.visit(t.block);break;default:ae.call(this,t)}},oe.prototype.visitRoot=function(t){for(var e=0,n=t.nodes.length;e1?match[1].trim():""}})}if(String.prototype.trimRight===undefined){String.prototype.trimRight=function(){return String(this).replace(/\s+$/,"")}}var stylus=function(){function require(p){var path=require.resolve(p),mod=require.modules[path];if(!mod)throw new Error('failed to require "'+p+'"');if(!mod.exports){mod.exports={};mod.call(mod.exports,mod,mod.exports,require.relative(path))}return mod.exports}var bifs="called-from = ()\n\nvendors = moz webkit o ms official\n\n// stringify the given arg\n\n-string(arg)\n type(arg) + ' ' + arg\n\n// require a color\n\nrequire-color(color)\n unless color is a 'color'\n error('RGB or HSL value expected, got a ' + -string(color))\n\n// require a unit\n\nrequire-unit(n)\n unless n is a 'unit'\n error('unit expected, got a ' + -string(n))\n\n// require a string\n\nrequire-string(str)\n unless str is a 'string' or str is a 'ident'\n error('string expected, got a ' + -string(str))\n\n// Math functions\n\nabs(n) { math(n, 'abs') }\nmin(a, b) { a < b ? a : b }\nmax(a, b) { a > b ? a : b }\n\n// Trigonometrics\nPI = -math-prop('PI')\n\nradians-to-degrees(angle)\n angle * (180 / PI)\n\ndegrees-to-radians(angle)\n unit(angle * (PI / 180),'')\n\nsin(n)\n n = degrees-to-radians(n) if unit(n) == 'deg'\n round(math(n, 'sin'), 9)\n\ncos(n)\n n = degrees-to-radians(n) if unit(n) == 'deg'\n round(math(n, 'cos'), 9)\n\n// Rounding Math functions\n\nceil(n, precision = 0)\n multiplier = 10 ** precision\n math(n * multiplier, 'ceil') / multiplier\n\nfloor(n, precision = 0)\n multiplier = 10 ** precision\n math(n * multiplier, 'floor') / multiplier\n\nround(n, precision = 0)\n multiplier = 10 ** precision\n math(n * multiplier, 'round') / multiplier\n\n// return the sum of the given numbers\n\nsum(nums)\n sum = 0\n sum += n for n in nums\n\n// return the average of the given numbers\n\navg(nums)\n sum(nums) / length(nums)\n\n// return a unitless number, or pass through\n\nremove-unit(n)\n if typeof(n) is 'unit'\n unit(n, '')\n else\n n\n\n// convert a percent to a decimal, or pass through\n\npercent-to-decimal(n)\n if unit(n) is '%'\n remove-unit(n) / 100\n else\n n\n\n// check if n is an odd number\n\nodd(n)\n 1 == n % 2\n\n// check if n is an even number\n\neven(n)\n 0 == n % 2\n\n// check if color is light\n\nlight(color)\n lightness(color) >= 50%\n\n// check if color is dark\n\ndark(color)\n lightness(color) < 50%\n\n// desaturate color by amount\n\ndesaturate(color, amount)\n adjust(color, 'saturation', - amount)\n\n// saturate color by amount\n\nsaturate(color = '', amount = 100%)\n if color is a 'color'\n adjust(color, 'saturation', amount)\n else\n unquote( 'saturate(' + color + ')' )\n\n// darken by the given amount\n\ndarken(color, amount)\n adjust(color, 'lightness', - amount)\n\n// lighten by the given amount\n\nlighten(color, amount)\n adjust(color, 'lightness', amount)\n\n// decrease opacity by amount\n\nfade-out(color, amount)\n color - rgba(black, percent-to-decimal(amount))\n\n// increase opacity by amount\n\nfade-in(color, amount)\n color + rgba(black, percent-to-decimal(amount))\n\n// spin hue by a given amount\n\nspin(color, amount)\n color + unit(amount, deg)\n\n// mix two colors by a given amount\n\nmix(color1, color2, weight = 50%)\n unless weight in 0..100\n error('Weight must be between 0% and 100%')\n\n if length(color1) == 2\n weight = color1[0]\n color1 = color1[1]\n\n else if length(color2) == 2\n weight = 100 - color2[0]\n color2 = color2[1]\n\n require-color(color1)\n require-color(color2)\n\n p = unit(weight / 100, '')\n w = p * 2 - 1\n\n a = alpha(color1) - alpha(color2)\n\n w1 = (((w * a == -1) ? w : (w + a) / (1 + w * a)) + 1) / 2\n w2 = 1 - w1\n\n channels = (red(color1) red(color2)) (green(color1) green(color2)) (blue(color1) blue(color2))\n rgb = ()\n\n for pair in channels\n push(rgb, floor(pair[0] * w1 + pair[1] * w2))\n\n a1 = alpha(color1) * p\n a2 = alpha(color2) * (1 - p)\n alpha = a1 + a2\n\n rgba(rgb[0], rgb[1], rgb[2], alpha)\n\n// invert colors, leave alpha intact\n\ninvert(color = '')\n if color is a 'color'\n rgba(#fff - color, alpha(color))\n else\n unquote( 'invert(' + color + ')' )\n\n// give complement of the given color\n\ncomplement( color )\n spin( color, 180 )\n\n// give grayscale of the given color\n\ngrayscale( color = '' )\n if color is a 'color'\n desaturate( color, 100% )\n else\n unquote( 'grayscale(' + color + ')' )\n\n// mix the given color with white\n\ntint( color, percent )\n mix( white, color, percent )\n\n// mix the given color with black\n\nshade( color, percent )\n mix( black, color, percent )\n\n// return the last value in the given expr\n\nlast(expr)\n expr[length(expr) - 1]\n\n// return keys in the given pairs or object\n\nkeys(pairs)\n ret = ()\n if type(pairs) == 'object'\n for key in pairs\n push(ret, key)\n else\n for pair in pairs\n push(ret, pair[0]);\n ret\n\n// return values in the given pairs or object\n\nvalues(pairs)\n ret = ()\n if type(pairs) == 'object'\n for key, val in pairs\n push(ret, val)\n else\n for pair in pairs\n push(ret, pair[1]);\n ret\n\n// join values with the given delimiter\n\njoin(delim, vals...)\n buf = ''\n vals = vals[0] if length(vals) == 1\n for val, i in vals\n buf += i ? delim + val : val\n\n// add a CSS rule to the containing block\n\n// - This definition allows add-property to be used as a mixin\n// - It has the same effect as interpolation but allows users\n// to opt for a functional style\n\nadd-property-function = add-property\nadd-property(name, expr)\n if mixin\n {name} expr\n else\n add-property-function(name, expr)\n\nprefix-classes(prefix)\n -prefix-classes(prefix, block)\n\n// Caching mixin, use inside your functions to enable caching by extending.\n\n$stylus_mixin_cache = {}\ncache()\n $key = (current-media() or 'no-media') + '__' + called-from[0] + '__' + arguments\n if $key in $stylus_mixin_cache\n @extend {'$cache_placeholder_for_' + $stylus_mixin_cache[$key]}\n else if 'cache' in called-from\n {block}\n else\n $id = length($stylus_mixin_cache)\n\n &,\n /$cache_placeholder_for_{$id}\n $stylus_mixin_cache[$key] = $id\n {block}\n\n// Percentage function to convert a number, e.g. '.45', into a percentage, e.g. '45%'\n\npercentage(num)\n return unit(num * 100, '%')\n\n// Returns the position of a `value` within a `list`\n\nindex(list, value)\n for val, i in list\n return i if val == value\n";require.modules={};require.resolve=function(path){var orig=path,reg=path+".js",index=path+"/index.js";return require.modules[reg]&®||require.modules[index]&&index||orig};require.register=function(path,fn){require.modules[path]=fn};require.relative=function(parent){return function(p){if("."!=p[0])return require(p);var path=parent.split("/"),segs=p.split("/");path.pop();for(var i=0;i=0;i--){var last=parts[i];if(last=="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up--;up){parts.unshift("..")}}return parts}var splitPathRe=/^([\s\S]+\/(?!$)|\/)?((?:[\s\S]+?)?(\.[^.]*)?)$/;exports.normalize=function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.slice(-1)==="/";path=normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path};exports.join=function(){var paths=Array.prototype.slice.call(arguments,0);return exports.normalize(paths.filter(function(p,index){return p&&typeof p==="string"}).join("/"))};exports.relative=function(from,to){from=exports.resolve(from).substr(1);to=exports.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;isizeLimit)return literal;if(enc&&"utf8"==enc.first.val.toLowerCase()){encoding=encodingTypes.UTF8;result=buf.toString("utf8").replace(/\s+/g," ").replace(/[{}\|\\\^~\[\]`"<>#%]/g,function(match){return"%"+match[0].charCodeAt(0).toString(16).toUpperCase()}).trim()}else{result=buf.toString(encoding)+hash}return new nodes.Literal('url("data:'+mime+";"+encoding+","+result+'")')}fn.raw=true;return fn};module.exports.mimes=defaultMimes});require.register("functions/add-property.js",function(module,exports,require){var utils=require("../utils"),nodes=require("../nodes");(module.exports=function addProperty(name,expr){utils.assertType(name,"expression","name");name=utils.unwrap(name).first;utils.assertString(name,"name");utils.assertType(expr,"expression","expr");var prop=new nodes.Property([name],expr);var block=this.closestBlock;var len=block.nodes.length,head=block.nodes.slice(0,block.index),tail=block.nodes.slice(block.index++,len);head.push(prop);block.nodes=head.concat(tail);return prop}).raw=true});require.register("functions/adjust.js",function(module,exports,require){var utils=require("../utils");module.exports=function adjust(color,prop,amount){utils.assertColor(color,"color");utils.assertString(prop,"prop");utils.assertType(amount,"unit","amount");var hsl=color.hsla.clone();prop={hue:"h",saturation:"s",lightness:"l"}[prop.string];if(!prop)throw new Error("invalid adjustment property");var val=amount.val;if("%"==amount.type){val="l"==prop&&val>0?(100-hsl[prop])*val/100:hsl[prop]*(val/100)}hsl[prop]+=val;return hsl.rgba}});require.register("functions/alpha.js",function(module,exports,require){var nodes=require("../nodes"),rgba=require("./rgba");module.exports=function alpha(color,value){color=color.rgba;if(value){return rgba(new nodes.Unit(color.r),new nodes.Unit(color.g),new nodes.Unit(color.b),value)}return new nodes.Unit(color.a,"")}});require.register("functions/base-convert.js",function(module,exports,require){var utils=require("../utils"),nodes=require("../nodes");(module.exports=function(num,base,width){utils.assertPresent(num,"number");utils.assertPresent(base,"base");num=utils.unwrap(num).nodes[0].val;base=utils.unwrap(base).nodes[0].val;width=width&&utils.unwrap(width).nodes[0].val||2;var result=Number(num).toString(base);while(result.lengthtop.a){top=blend(top,bottom)}var l1=luminosity(bottom).val+.05,l2=luminosity(top).val+.05,ratio=l1/l2;if(l2>l1){ratio=1/ratio}return Math.round(ratio*10)/10}if(1<=bottom.a){var resultRatio=new nodes.Unit(contrast(top,bottom));result.set("ratio",resultRatio);result.set("error",new nodes.Unit(0));result.set("min",resultRatio);result.set("max",resultRatio)}else{var onBlack=contrast(top,blend(bottom,new nodes.RGBA(0,0,0,1))),onWhite=contrast(top,blend(bottom,new nodes.RGBA(255,255,255,1))),max=Math.max(onBlack,onWhite);function processChannel(topChannel,bottomChannel){return Math.min(Math.max(0,(topChannel-bottomChannel*bottom.a)/(1-bottom.a)),255)}var closest=new nodes.RGBA(processChannel(top.r,bottom.r),processChannel(top.g,bottom.g),processChannel(top.b,bottom.b),1);var min=contrast(top,blend(bottom,closest));result.set("ratio",new nodes.Unit(Math.round((min+max)*50)/100));result.set("error",new nodes.Unit(Math.round((max-min)*50)/100));result.set("min",new nodes.Unit(min));result.set("max",new nodes.Unit(max))}return result}});require.register("functions/convert.js",function(module,exports,require){var utils=require("../utils");module.exports=function convert(str){utils.assertString(str,"str");return utils.parseString(str.string)}});require.register("functions/current-media.js",function(module,exports,require){var nodes=require("../nodes");module.exports=function currentMedia(){var self=this;return new nodes.String(lookForMedia(this.closestBlock.node)||"");function lookForMedia(node){if("media"==node.nodeName){node.val=self.visit(node.val);return node.toString()}else if(node.block.parent.node){return lookForMedia(node.block.parent.node)}}}});require.register("functions/define.js",function(module,exports,require){var utils=require("../utils"),nodes=require("../nodes");module.exports=function define(name,expr,global){utils.assertType(name,"string","name");expr=utils.unwrap(expr);var scope=this.currentScope;if(global&&global.toBoolean().isTrue){scope=this.global.scope}var node=new nodes.Ident(name.val,expr);scope.add(node);return nodes.nil}});require.register("functions/dirname.js",function(module,exports,require){var utils=require("../utils"),path=require("../path");module.exports=function dirname(p){utils.assertString(p,"path");return path.dirname(p.val).replace(/\\/g,"/")}});require.register("functions/error.js",function(module,exports,require){var utils=require("../utils");module.exports=function error(msg){utils.assertType(msg,"string","msg");var err=new Error(msg.val);err.fromStylus=true;throw err}});require.register("functions/extname.js",function(module,exports,require){var utils=require("../utils"),path=require("../path");module.exports=function extname(p){utils.assertString(p,"path");return path.extname(p.val)}});require.register("functions/green.js",function(module,exports,require){var nodes=require("../nodes"),rgba=require("./rgba");module.exports=function green(color,value){color=color.rgba;if(value){return rgba(new nodes.Unit(color.r),value,new nodes.Unit(color.b),new nodes.Unit(color.a))}return new nodes.Unit(color.g,"")}});require.register("functions/hsl.js",function(module,exports,require){var utils=require("../utils"),nodes=require("../nodes"),hsla=require("./hsla");module.exports=function hsl(hue,saturation,lightness){if(1==arguments.length){utils.assertColor(hue,"color");return hue.hsla}else{return hsla(hue,saturation,lightness,new nodes.Unit(1))}}});require.register("functions/hsla.js",function(module,exports,require){var utils=require("../utils"),nodes=require("../nodes");module.exports=function hsla(hue,saturation,lightness,alpha){switch(arguments.length){case 1:utils.assertColor(hue);return hue.hsla;case 2:utils.assertColor(hue);var color=hue.hsla;utils.assertType(saturation,"unit","alpha");var alpha=saturation.clone();if("%"==alpha.type)alpha.val/=100;return new nodes.HSLA(color.h,color.s,color.l,alpha.val);default:utils.assertType(hue,"unit","hue");utils.assertType(saturation,"unit","saturation");utils.assertType(lightness,"unit","lightness");utils.assertType(alpha,"unit","alpha");var alpha=alpha.clone();if(alpha&&"%"==alpha.type)alpha.val/=100;return new nodes.HSLA(hue.val,saturation.val,lightness.val,alpha.val)}}});require.register("functions/hue.js",function(module,exports,require){var nodes=require("../nodes"),hsla=require("./hsla"),component=require("./component");module.exports=function hue(color,value){if(value){var hslaColor=color.hsla;return hsla(value,new nodes.Unit(hslaColor.s),new nodes.Unit(hslaColor.l),new nodes.Unit(hslaColor.a))}return component(color,new nodes.String("hue"))}});require.register("functions/length.js",function(module,exports,require){var utils=require("../utils");(module.exports=function length(expr){if(expr){if(expr.nodes){var nodes=utils.unwrap(expr).nodes;if(1==nodes.length&&"object"==nodes[0].nodeName){return nodes[0].length}else{return nodes.length}}else{return 1}}return 0}).raw=true});require.register("functions/lightness.js",function(module,exports,require){var nodes=require("../nodes"),hsla=require("./hsla"),component=require("./component");module.exports=function lightness(color,value){if(value){var hslaColor=color.hsla;return hsla(new nodes.Unit(hslaColor.h),new nodes.Unit(hslaColor.s),value,new nodes.Unit(hslaColor.a))}return component(color,new nodes.String("lightness"))}});require.register("functions/list-separator.js",function(module,exports,require){var utils=require("../utils"),nodes=require("../nodes");(module.exports=function listSeparator(list){list=utils.unwrap(list);return new nodes.String(list.isList?",":" ")}).raw=true});require.register("functions/lookup.js",function(module,exports,require){var utils=require("../utils"),nodes=require("../nodes");module.exports=function lookup(name){utils.assertType(name,"string","name");var node=this.lookup(name.val);if(!node)return nodes.nil;return this.visit(node)}});require.register("functions/luminosity.js",function(module,exports,require){var utils=require("../utils"),nodes=require("../nodes");module.exports=function luminosity(color){utils.assertColor(color);color=color.rgba;function processChannel(channel){channel=channel/255;return.03928>channel?channel/12.92:Math.pow((channel+.055)/1.055,2.4)}return new nodes.Unit(.2126*processChannel(color.r)+.7152*processChannel(color.g)+.0722*processChannel(color.b))}});require.register("functions/match.js",function(module,exports,require){var utils=require("../utils"),nodes=require("../nodes");var VALID_FLAGS="igm";module.exports=function match(pattern,val,flags){utils.assertType(pattern,"string","pattern");utils.assertString(val,"val");var re=new RegExp(pattern.val,validateFlags(flags)?flags.string:"");return val.string.match(re)};function validateFlags(flags){flags=flags&&flags.string;if(flags){return flags.split("").every(function(flag){return~VALID_FLAGS.indexOf(flag)})}return false}});require.register("functions/math-prop.js",function(module,exports,require){var nodes=require("../nodes");module.exports=function math(prop){return new nodes.Unit(Math[prop.string])}});require.register("functions/math.js",function(module,exports,require){var utils=require("../utils"),nodes=require("../nodes");module.exports=function math(n,fn){utils.assertType(n,"unit","n");utils.assertString(fn,"fn");return new nodes.Unit(Math[fn.string](n.val),n.type)}});require.register("functions/merge.js",function(module,exports,require){var utils=require("../utils");(module.exports=function merge(dest){utils.assertPresent(dest,"dest");dest=utils.unwrap(dest).first;utils.assertType(dest,"object","dest");var last=utils.unwrap(arguments[arguments.length-1]).first,deep=true===last.val;for(var i=1,len=arguments.length-deep;i1){if(expr.isList){pushToStack(expr.nodes,stack)}else{stack.push(parse(expr.nodes.map(function(node){utils.assertString(node,"selector");return node.string}).join(" ")))}}}else if(args.length>1){pushToStack(args,stack)}return stack.length?utils.compileSelectors(stack).join(","):"&"}).raw=true;function pushToStack(selectors,stack){selectors.forEach(function(sel){sel=sel.first;utils.assertString(sel,"selector");stack.push(parse(sel.string))})}function parse(selector){var Parser=new require("../parser"),parser=new Parser(selector),nodes;parser.state.push("selector-parts");nodes=parser.selector();nodes.forEach(function(node){node.val=node.segments.map(function(seg){return seg.toString()}).join("")});return nodes}});require.register("functions/selectors.js",function(module,exports,require){var nodes=require("../nodes"),Parser=require("../selector-parser");module.exports=function selectors(){var stack=this.selectorStack,expr=new nodes.Expression(true);if(stack.length){for(var i=0;i1){expr.push(new nodes.String(group.map(function(selector){nested=new Parser(selector.val).parse().nested;return(nested&&i?"& ":"")+selector.val}).join(",")))}else{var selector=group[0].val;nested=new Parser(selector).parse().nested;expr.push(new nodes.String((nested&&i?"& ":"")+selector))}}}else{expr.push(new nodes.String("&"))}return expr}});require.register("functions/shift.js",function(module,exports,require){var utils=require("../utils");(module.exports=function(expr){expr=utils.unwrap(expr);return expr.nodes.shift()}).raw=true});require.register("functions/split.js",function(module,exports,require){var utils=require("../utils"),nodes=require("../nodes");module.exports=function split(delim,val){utils.assertString(delim,"delimiter");utils.assertString(val,"val");var splitted=val.string.split(delim.string);var expr=new nodes.Expression;var ItemNode=val instanceof nodes.Ident?nodes.Ident:nodes.String;for(var i=0,len=splitted.length;i1){return utils.coerce(val.slice(start,end),true)}var result=val[0].string.slice(start,end);return val[0]instanceof nodes.Ident?new nodes.Ident(result):new nodes.String(result)}).raw=true});require.register("functions/substr.js",function(module,exports,require){var utils=require("../utils"),nodes=require("../nodes");module.exports=function substr(val,start,length){utils.assertString(val,"val");utils.assertType(start,"unit","start");length=length&&length.val;var res=val.string.substr(start.val,length);return val instanceof nodes.Ident?new nodes.Ident(res):new nodes.String(res)}});require.register("functions/tan.js",function(module,exports,require){var utils=require("../utils"),nodes=require("../nodes");module.exports=function tan(angle){utils.assertType(angle,"unit","angle");var radians=angle.val;if(angle.type==="deg"){radians*=Math.PI/180}var m=Math.pow(10,9);var sin=Math.round(Math.sin(radians)*m)/m,cos=Math.round(Math.cos(radians)*m)/m,tan=Math.round(m*sin/cos)/m;return new nodes.Unit(tan,"")}});require.register("functions/trace.js",function(module,exports,require){var nodes=require("../nodes");module.exports=function trace(){console.log(this.stack);return nodes.nil}});require.register("functions/transparentify.js",function(module,exports,require){var utils=require("../utils"),nodes=require("../nodes");module.exports=function transparentify(top,bottom,alpha){utils.assertColor(top);top=top.rgba;bottom=bottom||new nodes.RGBA(255,255,255,1);if(!alpha&&bottom&&!bottom.rgba){alpha=bottom;bottom=new nodes.RGBA(255,255,255,1)}utils.assertColor(bottom);bottom=bottom.rgba;var bestAlpha=["r","g","b"].map(function(channel){return(top[channel]-bottom[channel])/((0s.lastIndexOf("*/",offset),commentIdx=s.lastIndexOf("//",offset),i=s.lastIndexOf("\n",offset),double=0,single=0;if(~commentIdx&&commentIdx>i){while(i!=offset){if("'"==s[i])single?single--:single++;if('"'==s[i])double?double--:double++;if("/"==s[i]&&"/"==s[i+1]){inComment=!single&&!double;break}++i}}return inComment?str:val+"\r"}if("\ufeff"==str.charAt(0))str=str.slice(1);this.str=str.replace(/\s+$/,"\n").replace(/\r\n?/g,"\n").replace(/\\ *\n/g,"\r").replace(/([,(:](?!\/\/[^ ])) *(?:\/\/[^\n]*|\/\*.*?\*\/)?\n\s*/g,comment).replace(/\s*\n[ \t]*([,)])/g,comment)}Lexer.prototype={inspect:function(){var tok,tmp=this.str,buf=[];while("eos"!=(tok=this.next()).type){buf.push(tok.inspect())}this.str=tmp;return buf.concat(tok.inspect()).join("\n")},lookahead:function(n){var fetch=n-this.stash.length;while(fetch-- >0)this.stash.push(this.advance());return this.stash[--n]},skip:function(len){var chunk=len[0];len=chunk?chunk.length:len;this.str=this.str.substr(len);if(chunk){this.move(chunk)}else{this.column+=len}},move:function(str){var lines=str.match(/\n/g),idx=str.lastIndexOf("\n");if(lines)this.lineno+=lines.length;this.column=~idx?str.length-idx:this.column+str.length},next:function(){var tok=this.stashed()||this.advance();this.prev=tok;return tok},isPartOfSelector:function(){var tok=this.stash[this.stash.length-1]||this.prev;switch(tok&&tok.type){case"color":return 2==tok.val.raw.length;case".":case"[":return true}return false},advance:function(){var column=this.column,line=this.lineno,tok=this.eos()||this.nil()||this.sep()||this.keyword()||this.urlchars()||this.comment()||this.newline()||this.escaped()||this.important()||this.literal()||this.fun()||this.anonFunc()||this.atrule()||this.brace()||this.paren()||this.color()||this.string()||this.unit()||this.namedop()||this.boolean()||this.unicode()||this.ident()||this.op()||this.eol()||this.space()||this.selector();tok.lineno=line;tok.column=column;return tok},peek:function(){return this.lookahead(1)},stashed:function(){return this.stash.shift()},eos:function(){if(this.str.length)return;if(this.indentStack.length){this.indentStack.shift();return new Token("outdent")}else{return new Token("eos")}},urlchars:function(){var captures;if(!this.isURL)return;if(captures=/^[\/:@.;?&=*!,<>#%0-9]+/.exec(this.str)){this.skip(captures);return new Token("literal",new nodes.Literal(captures[0]))}},sep:function(){var captures;if(captures=/^;[ \t]*/.exec(this.str)){this.skip(captures);return new Token(";")}},eol:function(){if("\r"==this.str[0]){++this.lineno;this.skip(1);return this.advance()}},space:function(){var captures;if(captures=/^([ \t]+)/.exec(this.str)){this.skip(captures);return new Token("space")}},escaped:function(){var captures;if(captures=/^\\(.)[ \t]*/.exec(this.str)){var c=captures[1];this.skip(captures);return new Token("ident",new nodes.Literal(c))}},literal:function(){var captures;if(captures=/^@css[ \t]*\{/.exec(this.str)){this.skip(captures);var c,braces=1,css="",node;while(c=this.str[0]){this.str=this.str.substr(1);switch(c){case"{":++braces;break;case"}":--braces;break;case"\n":case"\r":++this.lineno;break}css+=c;if(!braces)break}css=css.replace(/\s*}$/,"");node=new nodes.Literal(css);node.css=true;return new Token("literal",node)}},important:function(){var captures;if(captures=/^!important[ \t]*/.exec(this.str)){this.skip(captures);return new Token("ident",new nodes.Literal("!important"))}},brace:function(){var captures;if(captures=/^([{}])/.exec(this.str)){this.skip(1);var brace=captures[1];return new Token(brace,brace)}},paren:function(){var captures;if(captures=/^([()])([ \t]*)/.exec(this.str)){var paren=captures[1];this.skip(captures);if(")"==paren)this.isURL=false;var tok=new Token(paren,paren);tok.space=captures[2];return tok}},nil:function(){var captures,tok;if(captures=/^(null)\b[ \t]*/.exec(this.str)){this.skip(captures);if(this.isPartOfSelector()){tok=new Token("ident",new nodes.Ident(captures[0]))}else{tok=new Token("null",nodes.nil)}return tok}},keyword:function(){var captures,tok;if(captures=/^(return|if|else|unless|for|in)\b[ \t]*/.exec(this.str)){var keyword=captures[1];this.skip(captures);if(this.isPartOfSelector()){tok=new Token("ident",new nodes.Ident(captures[0]))}else{tok=new Token(keyword,keyword)}return tok}},namedop:function(){var captures,tok;if(captures=/^(not|and|or|is a|is defined|isnt|is not|is)(?!-)\b([ \t]*)/.exec(this.str)){var op=captures[1];this.skip(captures);if(this.isPartOfSelector()){tok=new Token("ident",new nodes.Ident(captures[0]))}else{op=alias[op]||op;tok=new Token(op,op)}tok.space=captures[2];return tok}},op:function(){var captures;if(captures=/^([.]{1,3}|&&|\|\||[!<>=?:]=|\*\*|[-+*\/%]=?|[,=?:!~<>&\[\]])([ \t]*)/.exec(this.str)){var op=captures[1];this.skip(captures);op=alias[op]||op;var tok=new Token(op,op);tok.space=captures[2];this.isURL=false;return tok}},anonFunc:function(){var tok;if("@"==this.str[0]&&"("==this.str[1]){this.skip(2);tok=new Token("function",new nodes.Ident("anonymous"));tok.anonymous=true;return tok}},atrule:function(){var captures;if(captures=/^@(?:-(\w+)-)?([a-zA-Z0-9-_]+)[ \t]*/.exec(this.str)){this.skip(captures);var vendor=captures[1],type=captures[2],tok;switch(type){case"require":case"import":case"charset":case"namespace":case"media":case"scope":case"supports":return new Token(type);case"document":return new Token("-moz-document");case"block":return new Token("atblock");case"extend":case"extends":return new Token("extend");case"keyframes":return new Token(type,vendor);default:return new Token("atrule",vendor?"-"+vendor+"-"+type:type)}}},comment:function(){if("/"==this.str[0]&&"/"==this.str[1]){var end=this.str.indexOf("\n");if(-1==end)end=this.str.length;this.skip(end);return this.advance()}if("/"==this.str[0]&&"*"==this.str[1]){var end=this.str.indexOf("*/");if(-1==end)end=this.str.length;var str=this.str.substr(0,end+2),lines=str.split(/\n|\r/).length-1,suppress=true,inline=false;this.lineno+=lines;this.skip(end+2);if("!"==str[2]){str=str.replace("*!","*");suppress=false}if(this.prev&&";"==this.prev.type)inline=true;return new Token("comment",new nodes.Comment(str,suppress,inline))}},"boolean":function(){var captures;if(captures=/^(true|false)\b([ \t]*)/.exec(this.str)){var val=nodes.Boolean("true"==captures[1]);this.skip(captures);var tok=new Token("boolean",val);tok.space=captures[2];return tok}},unicode:function(){var captures;if(captures=/^u\+[0-9a-f?]{1,6}(?:-[0-9a-f]{1,6})?/i.exec(this.str)){this.skip(captures);return new Token("literal",new nodes.Literal(captures[0]))}},fun:function(){var captures;if(captures=/^(-*[_a-zA-Z$][-\w\d$]*)\(([ \t]*)/.exec(this.str)){var name=captures[1];this.skip(captures);this.isURL="url"==name;var tok=new Token("function",new nodes.Ident(name));tok.space=captures[2];return tok}},ident:function(){var captures;if(captures=/^-*[_a-zA-Z$][-\w\d$]*/.exec(this.str)){this.skip(captures);return new Token("ident",new nodes.Ident(captures[0]))}},newline:function(){var captures,re;if(this.indentRe){captures=this.indentRe.exec(this.str)}else{re=/^\n([\t]*)[ \t]*/;captures=re.exec(this.str);if(captures&&!captures[1].length){re=/^\n([ \t]*)/;captures=re.exec(this.str)}if(captures&&captures[1].length)this.indentRe=re}if(captures){var tok,indents=captures[1].length;this.skip(captures);if(this.str[0]===" "||this.str[0]===" "){throw new errors.SyntaxError("Invalid indentation. You can use tabs or spaces to indent, but not both.")}if("\n"==this.str[0])return this.advance();if(this.indentStack.length&&indentsindents){this.stash.push(new Token("outdent"));this.indentStack.shift()}tok=this.stash.pop()}else if(indents&&indents!=this.indentStack[0]){this.indentStack.unshift(indents);tok=new Token("indent")}else{tok=new Token("newline")}return tok}},unit:function(){var captures;if(captures=/^(-)?(\d+\.\d+|\d+|\.\d+)(%|[a-zA-Z]+)?[ \t]*/.exec(this.str)){this.skip(captures);var n=parseFloat(captures[2]);if("-"==captures[1])n=-n;var node=new nodes.Unit(n,captures[3]);node.raw=captures[0];return new Token("unit",node)}},string:function(){var captures;if(captures=/^("[^"]*"|'[^']*')[ \t]*/.exec(this.str)){var str=captures[1],quote=captures[0][0];this.skip(captures);str=str.slice(1,-1).replace(/\\n/g,"\n");return new Token("string",new nodes.String(str,quote))}},color:function(){return this.rrggbbaa()||this.rrggbb()||this.rgba()||this.rgb()||this.nn()||this.n()},n:function(){var captures;if(captures=/^#([a-fA-F0-9]{1})[ \t]*/.exec(this.str)){this.skip(captures);var n=parseInt(captures[1]+captures[1],16),color=new nodes.RGBA(n,n,n,1);color.raw=captures[0];return new Token("color",color)}},nn:function(){var captures;if(captures=/^#([a-fA-F0-9]{2})[ \t]*/.exec(this.str)){this.skip(captures);var n=parseInt(captures[1],16),color=new nodes.RGBA(n,n,n,1);color.raw=captures[0];return new Token("color",color)}},rgb:function(){var captures;if(captures=/^#([a-fA-F0-9]{3})[ \t]*/.exec(this.str)){this.skip(captures);var rgb=captures[1],r=parseInt(rgb[0]+rgb[0],16),g=parseInt(rgb[1]+rgb[1],16),b=parseInt(rgb[2]+rgb[2],16),color=new nodes.RGBA(r,g,b,1);color.raw=captures[0];return new Token("color",color)}},rgba:function(){var captures;if(captures=/^#([a-fA-F0-9]{4})[ \t]*/.exec(this.str)){this.skip(captures);var rgb=captures[1],r=parseInt(rgb[0]+rgb[0],16),g=parseInt(rgb[1]+rgb[1],16),b=parseInt(rgb[2]+rgb[2],16),a=parseInt(rgb[3]+rgb[3],16),color=new nodes.RGBA(r,g,b,a/255);color.raw=captures[0];return new Token("color",color)}},rrggbb:function(){var captures;if(captures=/^#([a-fA-F0-9]{6})[ \t]*/.exec(this.str)){this.skip(captures);var rgb=captures[1],r=parseInt(rgb.substr(0,2),16),g=parseInt(rgb.substr(2,2),16),b=parseInt(rgb.substr(4,2),16),color=new nodes.RGBA(r,g,b,1);color.raw=captures[0];return new Token("color",color)}},rrggbbaa:function(){var captures;if(captures=/^#([a-fA-F0-9]{8})[ \t]*/.exec(this.str)){this.skip(captures);var rgb=captures[1],r=parseInt(rgb.substr(0,2),16),g=parseInt(rgb.substr(2,2),16),b=parseInt(rgb.substr(4,2),16),a=parseInt(rgb.substr(6,2),16),color=new nodes.RGBA(r,g,b,a/255);color.raw=captures[0];return new Token("color",color)}},selector:function(){var captures;if(captures=/^\^|.*?(?=\/\/(?![^\[]*\])|[,\n{])/.exec(this.str)){var selector=captures[0];this.skip(captures);return new Token("selector",selector)}}}});require.register("nodes/arguments.js",function(module,exports,require){var Node=require("./node"),nodes=require("../nodes"),utils=require("../utils");var Arguments=module.exports=function Arguments(){nodes.Expression.call(this);this.map={}};Arguments.prototype.__proto__=nodes.Expression.prototype;Arguments.fromExpression=function(expr){var args=new Arguments,len=expr.nodes.length;args.lineno=expr.lineno;args.column=expr.column;args.isList=expr.isList;for(var i=0;ilen)self.nodes[i]=nodes.nil;self.nodes[n]=val}else if(unit.string){node=self.nodes[0];if(node&&"object"==node.nodeName)node.set(unit.string,val.clone())}});return val;case"[]":var expr=new nodes.Expression,vals=utils.unwrap(this).nodes,range=utils.unwrap(right).nodes,node;range.forEach(function(unit){if("unit"==unit.nodeName){node=vals[unit.val<0?vals.length+unit.val:unit.val]}else if("object"==vals[0].nodeName){node=vals[0].get(unit.string)}if(node)expr.push(node)});return expr.isEmpty?nodes.nil:utils.unwrap(expr);case"||":return this.toBoolean().isTrue?this:right;case"in":return Node.prototype.operate.call(this,op,right);case"!=":return this.operate("==",right,val).negate();case"==":var len=this.nodes.length,right=right.toExpression(),a,b;if(len!=right.nodes.length)return nodes.no;for(var i=0;i1)return nodes.yes;return this.first.toBoolean()};Expression.prototype.toString=function(){return"("+this.nodes.map(function(node){return node.toString()}).join(this.isList?", ":" ")+")"};Expression.prototype.toJSON=function(){return{__type:"Expression",isList:this.isList,preserve:this.preserve,lineno:this.lineno,column:this.column,filename:this.filename,nodes:this.nodes}}});require.register("nodes/function.js",function(module,exports,require){var Node=require("./node");var Function=module.exports=function Function(name,params,body){Node.call(this);this.name=name;this.params=params;this.block=body;if("function"==typeof params)this.fn=params};Function.prototype.__defineGetter__("arity",function(){return this.params.length});Function.prototype.__proto__=Node.prototype;Function.prototype.__defineGetter__("hash",function(){return"function "+this.name});Function.prototype.clone=function(parent){ -if(this.fn){var clone=new Function(this.name,this.fn)}else{var clone=new Function(this.name);clone.params=this.params.clone(parent,clone);clone.block=this.block.clone(parent,clone)}clone.lineno=this.lineno;clone.column=this.column;clone.filename=this.filename;return clone};Function.prototype.toString=function(){if(this.fn){return this.name+"("+this.fn.toString().match(/^function *\w*\((.*?)\)/).slice(1).join(", ")+")"}else{return this.name+"("+this.params.nodes.join(", ")+")"}};Function.prototype.toJSON=function(){var json={__type:"Function",name:this.name,lineno:this.lineno,column:this.column,filename:this.filename};if(this.fn){json.fn=this.fn}else{json.params=this.params;json.block=this.block}return json}});require.register("nodes/group.js",function(module,exports,require){var Node=require("./node");var Group=module.exports=function Group(){Node.call(this);this.nodes=[];this.extends=[]};Group.prototype.__proto__=Node.prototype;Group.prototype.push=function(selector){this.nodes.push(selector)};Group.prototype.__defineGetter__("block",function(){return this.nodes[0].block});Group.prototype.__defineSetter__("block",function(block){for(var i=0,len=this.nodes.length;i=":case"<":case">":case"is a":case"||":case"&&":return this.rgba.operate(op,right);default:return this.rgba.operate(op,right).hsla}};exports.fromRGBA=function(rgba){var r=rgba.r/255,g=rgba.g/255,b=rgba.b/255,a=rgba.a;var min=Math.min(r,g,b),max=Math.max(r,g,b),l=(max+min)/2,d=max-min,h,s;switch(max){case min:h=0;break;case r:h=60*(g-b)/d;break;case g:h=60*(b-r)/d+120;break;case b:h=60*(r-g)/d+240;break}if(max==min){s=0}else if(l<.5){s=d/(2*l)}else{s=d/(2-2*l)}h%=360;s*=100;l*=100;return new HSLA(h,s,l,a)};HSLA.prototype.adjustLightness=function(percent){this.l=clampPercentage(this.l+this.l*(percent/100));return this};HSLA.prototype.adjustHue=function(deg){this.h=clampDegrees(this.h+deg);return this};function clampDegrees(n){n=n%360;return n>=0?n:360+n}function clampPercentage(n){return Math.max(0,Math.min(n,100))}function clampAlpha(n){return Math.max(0,Math.min(n,1))}});require.register("nodes/ident.js",function(module,exports,require){var Node=require("./node"),nodes=require("./index");var Ident=module.exports=function Ident(name,val,mixin){Node.call(this);this.name=name;this.string=name;this.val=val||nodes.nil;this.mixin=!!mixin};Ident.prototype.__defineGetter__("isEmpty",function(){return undefined==this.val});Ident.prototype.__defineGetter__("hash",function(){return this.name});Ident.prototype.__proto__=Node.prototype;Ident.prototype.clone=function(parent){var clone=new Ident(this.name);clone.val=this.val.clone(parent,clone);clone.mixin=this.mixin;clone.lineno=this.lineno;clone.column=this.column;clone.filename=this.filename;clone.property=this.property;clone.rest=this.rest;return clone};Ident.prototype.toJSON=function(){return{__type:"Ident",name:this.name,val:this.val,mixin:this.mixin,property:this.property,rest:this.rest,lineno:this.lineno,column:this.column,filename:this.filename}};Ident.prototype.toString=function(){return this.name};Ident.prototype.coerce=function(other){switch(other.nodeName){case"ident":case"string":case"literal":return new Ident(other.string);case"unit":return new Ident(other.toString());default:return Node.prototype.coerce.call(this,other)}};Ident.prototype.operate=function(op,right){var val=right.first;switch(op){case"-":if("unit"==val.nodeName){var expr=new nodes.Expression;val=val.clone();val.val=-val.val;expr.push(this);expr.push(val);return expr}case"+":return new nodes.Ident(this.string+this.coerce(val).string)}return Node.prototype.operate.call(this,op,right)}});require.register("nodes/if.js",function(module,exports,require){var Node=require("./node");var If=module.exports=function If(cond,negate){Node.call(this);this.cond=cond;this.elses=[];if(negate&&negate.nodeName){this.block=negate}else{this.negate=negate}};If.prototype.__proto__=Node.prototype;If.prototype.clone=function(parent){var clone=new If;clone.cond=this.cond.clone(parent,clone);clone.block=this.block.clone(parent,clone);clone.elses=this.elses.map(function(node){return node.clone(parent,clone)});clone.negate=this.negate;clone.postfix=this.postfix;clone.lineno=this.lineno;clone.column=this.column;clone.filename=this.filename;return clone};If.prototype.toJSON=function(){return{__type:"If",cond:this.cond,block:this.block,elses:this.elses,negate:this.negate,postfix:this.postfix,lineno:this.lineno,column:this.column,filename:this.filename}}});require.register("nodes/import.js",function(module,exports,require){var Node=require("./node");var Import=module.exports=function Import(expr,once){Node.call(this);this.path=expr;this.once=once||false};Import.prototype.__proto__=Node.prototype;Import.prototype.clone=function(parent){var clone=new Import;clone.path=this.path.nodeName?this.path.clone(parent,clone):this.path;clone.once=this.once;clone.mtime=this.mtime;clone.lineno=this.lineno;clone.column=this.column;clone.filename=this.filename;return clone};Import.prototype.toJSON=function(){return{__type:"Import",path:this.path,once:this.once,mtime:this.mtime,lineno:this.lineno,column:this.column,filename:this.filename}}});require.register("nodes/extend.js",function(module,exports,require){var Node=require("./node");var Extend=module.exports=function Extend(selectors){Node.call(this);this.selectors=selectors};Extend.prototype.__proto__=Node.prototype;Extend.prototype.clone=function(){return new Extend(this.selectors)};Extend.prototype.toString=function(){return"@extend "+this.selectors.join(", ")};Extend.prototype.toJSON=function(){return{__type:"Extend",selectors:this.selectors,lineno:this.lineno,column:this.column,filename:this.filename}}});require.register("nodes/index.js",function(module,exports,require){exports.Node=require("./node");exports.Root=require("./root");exports.Null=require("./null");exports.Each=require("./each");exports.If=require("./if");exports.Call=require("./call");exports.UnaryOp=require("./unaryop");exports.BinOp=require("./binop");exports.Ternary=require("./ternary");exports.Block=require("./block");exports.Unit=require("./unit");exports.String=require("./string");exports.HSLA=require("./hsla");exports.RGBA=require("./rgba");exports.Ident=require("./ident");exports.Group=require("./group");exports.Literal=require("./literal");exports.Boolean=require("./boolean");exports.Return=require("./return");exports.Media=require("./media");exports.QueryList=require("./query-list");exports.Query=require("./query");exports.Feature=require("./feature");exports.Params=require("./params");exports.Comment=require("./comment");exports.Keyframes=require("./keyframes");exports.Member=require("./member");exports.Charset=require("./charset");exports.Namespace=require("./namespace");exports.Import=require("./import");exports.Extend=require("./extend");exports.Object=require("./object");exports.Function=require("./function");exports.Property=require("./property");exports.Selector=require("./selector");exports.Expression=require("./expression");exports.Arguments=require("./arguments");exports.Atblock=require("./atblock");exports.Atrule=require("./atrule");exports.Supports=require("./supports");exports.yes=new exports.Boolean(true);exports.no=new exports.Boolean(false);exports.nil=new exports.Null});require.register("nodes/keyframes.js",function(module,exports,require){var Atrule=require("./atrule");var Keyframes=module.exports=function Keyframes(segs,prefix){Atrule.call(this,"keyframes");this.segments=segs;this.prefix=prefix||"official"};Keyframes.prototype.__proto__=Atrule.prototype;Keyframes.prototype.clone=function(parent){var clone=new Keyframes;clone.lineno=this.lineno;clone.column=this.column;clone.filename=this.filename;clone.segments=this.segments.map(function(node){return node.clone(parent,clone)});clone.prefix=this.prefix;clone.block=this.block.clone(parent,clone);return clone};Keyframes.prototype.toJSON=function(){return{__type:"Keyframes",segments:this.segments,prefix:this.prefix,block:this.block,lineno:this.lineno,column:this.column,filename:this.filename}};Keyframes.prototype.toString=function(){return"@keyframes "+this.segments.join("")}});require.register("nodes/literal.js",function(module,exports,require){var Node=require("./node"),nodes=require("./index");var Literal=module.exports=function Literal(str){Node.call(this);this.val=str;this.string=str;this.prefixed=false};Literal.prototype.__proto__=Node.prototype;Literal.prototype.__defineGetter__("hash",function(){return this.val});Literal.prototype.toString=function(){return this.val};Literal.prototype.coerce=function(other){switch(other.nodeName){case"ident":case"string":case"literal":return new Literal(other.string);default:return Node.prototype.coerce.call(this,other)}};Literal.prototype.operate=function(op,right){var val=right.first;switch(op){case"+":return new nodes.Literal(this.string+this.coerce(val).string);default:return Node.prototype.operate.call(this,op,right)}};Literal.prototype.toJSON=function(){return{__type:"Literal",val:this.val,string:this.string,prefixed:this.prefixed,lineno:this.lineno,column:this.column,filename:this.filename}}});require.register("nodes/media.js",function(module,exports,require){var Atrule=require("./atrule");var Media=module.exports=function Media(val){Atrule.call(this,"media");this.val=val};Media.prototype.__proto__=Atrule.prototype;Media.prototype.clone=function(parent){var clone=new Media;clone.val=this.val.clone(parent,clone);clone.block=this.block.clone(parent,clone);clone.lineno=this.lineno;clone.column=this.column;clone.filename=this.filename;return clone};Media.prototype.toJSON=function(){return{__type:"Media",val:this.val,block:this.block,lineno:this.lineno,column:this.column,filename:this.filename}};Media.prototype.toString=function(){return"@media "+this.val}});require.register("nodes/query-list.js",function(module,exports,require){var Node=require("./node");var QueryList=module.exports=function QueryList(){Node.call(this);this.nodes=[]};QueryList.prototype.__proto__=Node.prototype;QueryList.prototype.clone=function(parent){var clone=new QueryList;clone.lineno=this.lineno;clone.column=this.column;clone.filename=this.filename;for(var i=0;i=":return nodes.Boolean(this.hash>=right.hash);case"<=":return nodes.Boolean(this.hash<=right.hash);case">":return nodes.Boolean(this.hash>right.hash);case"<":return nodes.Boolean(this.hash1)--h;if(h*6<1)return m1+(m2-m1)*h*6;if(h*2<1)return m2;if(h*3<2)return m1+(m2-m1)*(2/3-h)*6;return m1}return new RGBA(r,g,b,a)};function clamp(n){return Math.max(0,Math.min(n.toFixed(0),255))}function clampAlpha(n){return Math.max(0,Math.min(n,1))}});require.register("nodes/root.js",function(module,exports,require){var Node=require("./node");var Root=module.exports=function Root(){this.nodes=[]};Root.prototype.__proto__=Node.prototype;Root.prototype.push=function(node){this.nodes.push(node)};Root.prototype.unshift=function(node){this.nodes.unshift(node)};Root.prototype.clone=function(){var clone=new Root;clone.lineno=this.lineno;clone.column=this.column;clone.filename=this.filename;this.nodes.forEach(function(node){clone.push(node.clone(clone,clone))});return clone};Root.prototype.toString=function(){return"[Root]"};Root.prototype.toJSON=function(){return{__type:"Root",nodes:this.nodes,lineno:this.lineno,column:this.column,filename:this.filename}}});require.register("nodes/selector.js",function(module,exports,require){var Block=require("./block"),Node=require("./node");var Selector=module.exports=function Selector(segs){Node.call(this);this.inherits=true;this.segments=segs;this.optional=false};Selector.prototype.__proto__=Node.prototype;Selector.prototype.toString=function(){return this.segments.join("")+(this.optional?" !optional":"")};Selector.prototype.__defineGetter__("isPlaceholder",function(){return this.val&&~this.val.substr(0,2).indexOf("$")});Selector.prototype.clone=function(parent){var clone=new Selector;clone.lineno=this.lineno;clone.column=this.column;clone.filename=this.filename;clone.inherits=this.inherits;clone.val=this.val;clone.segments=this.segments.map(function(node){return node.clone(parent,clone)});clone.optional=this.optional;return clone};Selector.prototype.toJSON=function(){return{__type:"Selector",inherits:this.inherits,segments:this.segments,optional:this.optional,val:this.val,lineno:this.lineno,column:this.column,filename:this.filename}}});require.register("nodes/string.js",function(module,exports,require){var Node=require("./node"),sprintf=require("../functions").s,utils=require("../utils"),nodes=require("./index");var String=module.exports=function String(val,quote){Node.call(this);this.val=val;this.string=val;this.prefixed=false;if(typeof quote!=="string"){this.quote="'"}else{this.quote=quote}};String.prototype.__proto__=Node.prototype;String.prototype.toString=function(){return this.quote+this.val+this.quote};String.prototype.clone=function(){var clone=new String(this.val,this.quote);clone.lineno=this.lineno;clone.column=this.column;clone.filename=this.filename;return clone};String.prototype.toJSON=function(){return{__type:"String",val:this.val,quote:this.quote,lineno:this.lineno,column:this.column,filename:this.filename}};String.prototype.toBoolean=function(){return nodes.Boolean(this.val.length)};String.prototype.coerce=function(other){switch(other.nodeName){case"string":return other;case"expression":return new String(other.nodes.map(function(node){return this.coerce(node).val},this).join(" "));default:return new String(other.toString())}};String.prototype.operate=function(op,right){switch(op){case"%":var expr=new nodes.Expression;expr.push(this);var args="expression"==right.nodeName?utils.unwrap(right).nodes:[right];return sprintf.apply(null,[expr].concat(args));case"+":var expr=new nodes.Expression;expr.push(new String(this.val+this.coerce(right).val));return expr;default:return Node.prototype.operate.call(this,op,right)}}});require.register("nodes/ternary.js",function(module,exports,require){var Node=require("./node");var Ternary=module.exports=function Ternary(cond,trueExpr,falseExpr){Node.call(this);this.cond=cond;this.trueExpr=trueExpr;this.falseExpr=falseExpr};Ternary.prototype.__proto__=Node.prototype;Ternary.prototype.clone=function(parent){var clone=new Ternary;clone.cond=this.cond.clone(parent,clone);clone.trueExpr=this.trueExpr.clone(parent,clone);clone.falseExpr=this.falseExpr.clone(parent,clone);clone.lineno=this.lineno;clone.column=this.column;clone.filename=this.filename;return clone};Ternary.prototype.toJSON=function(){return{__type:"Ternary",cond:this.cond,trueExpr:this.trueExpr,falseExpr:this.falseExpr,lineno:this.lineno,column:this.column,filename:this.filename}}});require.register("nodes/unaryop.js",function(module,exports,require){var Node=require("./node");var UnaryOp=module.exports=function UnaryOp(op,expr){Node.call(this);this.op=op;this.expr=expr};UnaryOp.prototype.__proto__=Node.prototype;UnaryOp.prototype.clone=function(parent){var clone=new UnaryOp(this.op);clone.expr=this.expr.clone(parent,clone);clone.lineno=this.lineno;clone.column=this.column;clone.filename=this.filename;return clone};UnaryOp.prototype.toJSON=function(){return{__type:"UnaryOp",op:this.op,expr:this.expr,lineno:this.lineno,column:this.column,filename:this.filename}}});require.register("nodes/unit.js",function(module,exports,require){var Node=require("./node"),nodes=require("./index");var FACTOR_TABLE={mm:{val:1,label:"mm"},cm:{val:10,label:"mm"},"in":{val:25.4,label:"mm"},pt:{val:25.4/72,label:"mm"},ms:{val:1,label:"ms"},s:{val:1e3,label:"ms"},Hz:{val:1,label:"Hz"},kHz:{val:1e3,label:"Hz"}};var Unit=module.exports=function Unit(val,type){Node.call(this);this.val=val;this.type=type};Unit.prototype.__proto__=Node.prototype;Unit.prototype.toBoolean=function(){return nodes.Boolean(this.type?true:this.val)};Unit.prototype.toString=function(){return this.val+(this.type||"")};Unit.prototype.clone=function(){var clone=new Unit(this.val,this.type);clone.lineno=this.lineno;clone.column=this.column;clone.filename=this.filename;return clone};Unit.prototype.toJSON=function(){return{__type:"Unit",val:this.val,type:this.type,lineno:this.lineno,column:this.column,filename:this.filename}};Unit.prototype.operate=function(op,right){var type=this.type||right.first.type;if("rgba"==right.nodeName||"hsla"==right.nodeName){return right.operate(op,this)}if(this.shouldCoerce(op)){right=right.first;if("%"!=this.type&&("-"==op||"+"==op)&&"%"==right.type){right=new Unit(this.val*(right.val/100),"%")}else{right=this.coerce(right)}switch(op){case"-":return new Unit(this.val-right.val,type);case"+":type=type||right.type=="%"&&right.type;return new Unit(this.val+right.val,type);case"/":return new Unit(this.val/right.val,type);case"*":return new Unit(this.val*right.val,type);case"%":return new Unit(this.val%right.val,type);case"**":return new Unit(Math.pow(this.val,right.val),type);case"..":case"...":var start=this.val,end=right.val,expr=new nodes.Expression,inclusive=".."==op;if(start=end:--start>end)}return expr}}return Node.prototype.operate.call(this,op,right)};Unit.prototype.coerce=function(other){if("unit"==other.nodeName){var a=this,b=other,factorA=FACTOR_TABLE[a.type],factorB=FACTOR_TABLE[b.type];if(factorA&&factorB&&factorA.label==factorB.label){var bVal=b.val*(factorB.val/factorA.val);return new nodes.Unit(bVal,a.type)}else{return new nodes.Unit(b.val,a.type)}}else if("string"==other.nodeName){if("%"==other.val)return new nodes.Unit(0,"%");var val=parseFloat(other.val);if(isNaN(val))Node.prototype.coerce.call(this,other);return new nodes.Unit(val)}else{return Node.prototype.coerce.call(this,other)}}});require.register("nodes/object.js",function(module,exports,require){var Node=require("./node"),nodes=require("./index"),nativeObj={}.constructor;var Object=module.exports=function Object(){Node.call(this);this.vals={}};Object.prototype.__proto__=Node.prototype;Object.prototype.set=function(key,val){this.vals[key]=val;return this};Object.prototype.__defineGetter__("length",function(){return nativeObj.keys(this.vals).length});Object.prototype.get=function(key){return this.vals[key]||nodes.nil};Object.prototype.has=function(key){return key in this.vals};Object.prototype.operate=function(op,right){switch(op){case".":case"[]":return this.get(right.hash);case"==":var vals=this.vals,a,b;if("object"!=right.nodeName||this.length!=right.length)return nodes.no;for(var key in vals){a=vals[key];b=right.vals[key];if(a.operate(op,b).isFalse)return nodes.no; -}return nodes.yes;case"!=":return this.operate("==",right).negate();default:return Node.prototype.operate.call(this,op,right)}};Object.prototype.toBoolean=function(){return nodes.Boolean(this.length)};Object.prototype.toBlock=function(){var str="{",key,val;for(key in this.vals){val=this.get(key);if("object"==val.first.nodeName){str+=key+" "+val.first.toBlock()}else{switch(key){case"@charset":str+=key+" "+val.first.toString()+";";break;default:str+=key+":"+toString(val)+";"}}}str+="}";return str;function toString(node){if(node.nodes){return node.nodes.map(toString).join(node.isList?",":" ")}else if("literal"==node.nodeName&&","==node.val){return"\\,"}return node.toString()}};Object.prototype.clone=function(parent){var clone=new Object;clone.lineno=this.lineno;clone.column=this.column;clone.filename=this.filename;for(var key in this.vals){clone.vals[key]=this.vals[key].clone(parent,clone)}return clone};Object.prototype.toJSON=function(){return{__type:"Object",vals:this.vals,lineno:this.lineno,column:this.column,filename:this.filename}};Object.prototype.toString=function(){var obj={};for(var prop in this.vals){obj[prop]=this.vals[prop].toString()}return JSON.stringify(obj)}});require.register("nodes/supports.js",function(module,exports,require){var Atrule=require("./atrule");var Supports=module.exports=function Supports(condition){Atrule.call(this,"supports");this.condition=condition};Supports.prototype.__proto__=Atrule.prototype;Supports.prototype.clone=function(parent){var clone=new Supports;clone.condition=this.condition.clone(parent,clone);clone.block=this.block.clone(parent,clone);clone.lineno=this.lineno;clone.column=this.column;clone.filename=this.filename;return clone};Supports.prototype.toJSON=function(){return{__type:"Supports",condition:this.condition,block:this.block,lineno:this.lineno,column:this.column,filename:this.filename}};Supports.prototype.toString=function(){return"@supports "+this.condition}});require.register("nodes/member.js",function(module,exports,require){var Node=require("./node");var Member=module.exports=function Member(left,right){Node.call(this);this.left=left;this.right=right};Member.prototype.__proto__=Node.prototype;Member.prototype.clone=function(parent){var clone=new Member;clone.left=this.left.clone(parent,clone);clone.right=this.right.clone(parent,clone);if(this.val)clone.val=this.val.clone(parent,clone);clone.lineno=this.lineno;clone.column=this.column;clone.filename=this.filename;return clone};Member.prototype.toJSON=function(){var json={__type:"Member",left:this.left,right:this.right,lineno:this.lineno,column:this.column,filename:this.filename};if(this.val)json.val=this.val;return json};Member.prototype.toString=function(){return this.left.toString()+"."+this.right.toString()}});require.register("nodes/atblock.js",function(module,exports,require){var Node=require("./node");var Atblock=module.exports=function Atblock(){Node.call(this)};Atblock.prototype.__defineGetter__("nodes",function(){return this.block.nodes});Atblock.prototype.__proto__=Node.prototype;Atblock.prototype.clone=function(parent){var clone=new Atblock;clone.block=this.block.clone(parent,clone);clone.lineno=this.lineno;clone.column=this.column;clone.filename=this.filename;return clone};Atblock.prototype.toString=function(){return"@block"};Atblock.prototype.toJSON=function(){return{__type:"Atblock",block:this.block,lineno:this.lineno,column:this.column,fileno:this.fileno}}});require.register("nodes/atrule.js",function(module,exports,require){var Node=require("./node");var Atrule=module.exports=function Atrule(type){Node.call(this);this.type=type};Atrule.prototype.__proto__=Node.prototype;Atrule.prototype.__defineGetter__("hasOnlyProperties",function(){if(!this.block)return false;var nodes=this.block.nodes;for(var i=0,len=nodes.length;i","=",":","&","&&","~","{","}",".","..","/"];var pseudoSelectors=["matches","not","dir","lang","any-link","link","visited","local-link","target","scope","hover","active","focus","drop","current","past","future","enabled","disabled","read-only","read-write","placeholder-shown","checked","indeterminate","valid","invalid","in-range","out-of-range","required","optional","user-error","root","empty","blank","nth-child","nth-last-child","first-child","last-child","only-child","nth-of-type","nth-last-of-type","first-of-type","last-of-type","only-of-type","nth-match","nth-last-match","nth-column","nth-last-column","first-line","first-letter","before","after","selection"];var Parser=module.exports=function Parser(str,options){var self=this;options=options||{};this.lexer=new Lexer(str,options);this.prefix=options.prefix||"";this.root=options.root||new nodes.Root;this.state=["root"];this.stash=[];this.parens=0;this.css=0;this.state.pop=function(){self.prevState=[].pop.call(this)}};Parser.prototype={constructor:Parser,currentState:function(){return this.state[this.state.length-1]},previousState:function(){return this.state[this.state.length-2]},parse:function(){var block=this.parent=this.root;while("eos"!=this.peek().type){this.skipWhitespace();if("eos"==this.peek().type)break;var stmt=this.statement();this.accept(";");if(!stmt)this.error("unexpected token {peek}, not allowed at the root level");block.push(stmt)}return block},error:function(msg){var type=this.peek().type,val=undefined==this.peek().val?"":" "+this.peek().toString();if(val.trim()==type.trim())val="";throw new errors.ParseError(msg.replace("{peek}",'"'+type+val+'"'))},accept:function(type){if(type==this.peek().type){return this.next()}},expect:function(type){if(type!=this.peek().type){this.error('expected "'+type+'", got {peek}')}return this.next()},next:function(){var tok=this.stash.length?this.stash.pop():this.lexer.next(),line=tok.lineno,column=tok.column||1;if(tok.val&&tok.val.nodeName){tok.val.lineno=line;tok.val.column=column}nodes.lineno=line;nodes.column=column;return tok},peek:function(){return this.lexer.peek()},lookahead:function(n){return this.lexer.lookahead(n)},isSelectorToken:function(n){var la=this.lookahead(n).type;switch(la){case"for":return this.bracketed;case"[":this.bracketed=true;return true;case"]":this.bracketed=false;return true;default:return~selectorTokens.indexOf(la)}},isPseudoSelector:function(n){var val=this.lookahead(n).val;return val&&~pseudoSelectors.indexOf(val.name)},lineContains:function(type){var i=1,la;while(la=this.lookahead(i++)){if(~["indent","outdent","newline","eos"].indexOf(la.type))return;if(type==la.type)return true}},selectorToken:function(){if(this.isSelectorToken(1)){if("{"==this.peek().type){if(!this.lineContains("}"))return;var i=0,la;while(la=this.lookahead(++i)){if("}"==la.type){if(i==2||i==3&&this.lookahead(i-1).type=="space")return;break}if(":"==la.type)return}}return this.next()}},skip:function(tokens){while(~tokens.indexOf(this.peek().type))this.next()},skipWhitespace:function(){this.skip(["space","indent","outdent","newline"])},skipNewlines:function(){while("newline"==this.peek().type)this.next()},skipSpaces:function(){while("space"==this.peek().type)this.next()},skipSpacesAndComments:function(){while("space"==this.peek().type||"comment"==this.peek().type)this.next()},looksLikeFunctionDefinition:function(i){return"indent"==this.lookahead(i).type||"{"==this.lookahead(i).type},looksLikeSelector:function(fromProperty){var i=1,brace;if(fromProperty&&":"==this.lookahead(i+1).type&&(this.lookahead(i+1).space||"indent"==this.lookahead(i+2).type))return false;while("ident"==this.lookahead(i).type&&("newline"==this.lookahead(i+1).type||","==this.lookahead(i+1).type))i+=2;while(this.isSelectorToken(i)||","==this.lookahead(i).type){if("selector"==this.lookahead(i).type)return true;if("&"==this.lookahead(i+1).type)return true;if("."==this.lookahead(i).type&&"ident"==this.lookahead(i+1).type)return true;if("*"==this.lookahead(i).type&&"newline"==this.lookahead(i+1).type)return true;if(":"==this.lookahead(i).type&&":"==this.lookahead(i+1).type)return true;if("color"==this.lookahead(i).type&&"newline"==this.lookahead(i-1).type)return true;if(this.looksLikeAttributeSelector(i))return true;if(("="==this.lookahead(i).type||"function"==this.lookahead(i).type)&&"{"==this.lookahead(i+1).type)return false;if(":"==this.lookahead(i).type&&!this.isPseudoSelector(i+1)&&this.lineContains("."))return false;if("{"==this.lookahead(i).type)brace=true;else if("}"==this.lookahead(i).type)brace=false;if(brace&&":"==this.lookahead(i).type)return true;if("space"==this.lookahead(i).type&&"{"==this.lookahead(i+1).type)return true;if(":"==this.lookahead(i++).type&&!this.lookahead(i-1).space&&this.isPseudoSelector(i))return true;if("space"==this.lookahead(i).type&&"newline"==this.lookahead(i+1).type&&"{"==this.lookahead(i+2).type)return true;if(","==this.lookahead(i).type&&"newline"==this.lookahead(i+1).type)return true}if(","==this.lookahead(i).type&&"newline"==this.lookahead(i+1).type)return true;if("{"==this.lookahead(i).type&&"newline"==this.lookahead(i+1).type)return true;if(this.css){if(";"==this.lookahead(i).type||"}"==this.lookahead(i-1).type)return false}while(!~["indent","outdent","newline","for","if",";","}","eos"].indexOf(this.lookahead(i).type))++i;if("indent"==this.lookahead(i).type)return true},looksLikeAttributeSelector:function(n){var type=this.lookahead(n).type;if("="==type&&this.bracketed)return true;return("ident"==type||"string"==type)&&"]"==this.lookahead(n+1).type&&("newline"==this.lookahead(n+2).type||this.isSelectorToken(n+2))&&!this.lineContains(":")&&!this.lineContains("=")},looksLikeKeyframe:function(){var i=2,type;switch(this.lookahead(i).type){case"{":case"indent":case",":return true;case"newline":while("unit"==this.lookahead(++i).type||"newline"==this.lookahead(i).type);type=this.lookahead(i).type;return"indent"==type||"{"==type}},stateAllowsSelector:function(){switch(this.currentState()){case"root":case"atblock":case"selector":case"conditional":case"function":case"atrule":case"for":return true}},assignAtblock:function(expr){try{expr.push(this.atblock(expr))}catch(err){this.error("invalid right-hand side operand in assignment, got {peek}")}},statement:function(){var stmt=this.stmt(),state=this.prevState,block,op;if(this.allowPostfix){this.allowPostfix=false;state="expression"}switch(state){case"assignment":case"expression":case"function arguments":while(op=this.accept("if")||this.accept("unless")||this.accept("for")){switch(op.type){case"if":case"unless":stmt=new nodes.If(this.expression(),stmt);stmt.postfix=true;stmt.negate="unless"==op.type;this.accept(";");break;case"for":var key,val=this.id().name;if(this.accept(","))key=this.id().name;this.expect("in");var each=new nodes.Each(val,key,this.expression());block=new nodes.Block(this.parent,each);block.push(stmt);each.block=block;stmt=each}}}return stmt},stmt:function(){var type=this.peek().type;switch(type){case"keyframes":return this.keyframes();case"-moz-document":return this.mozdocument();case"comment":case"selector":case"extend":case"literal":case"charset":case"namespace":case"require":case"extend":case"media":case"atrule":case"ident":case"scope":case"supports":case"unless":return this[type]();case"function":return this.fun();case"import":return this.atimport();case"if":return this.ifstmt();case"for":return this.forin();case"return":return this.ret();case"{":return this.property();default:if(this.stateAllowsSelector()){switch(type){case"color":case"~":case">":case"<":case":":case"&":case"&&":case"[":case".":case"/":return this.selector();case"..":if("/"==this.lookahead(2).type)return this.selector();case"+":return"function"==this.lookahead(2).type?this.functionCall():this.selector();case"*":return this.property();case"unit":if(this.looksLikeKeyframe())return this.selector();case"-":if("{"==this.lookahead(2).type)return this.property()}}var expr=this.expression();if(expr.isEmpty)this.error("unexpected {peek}");return expr}},block:function(node,scope){var delim,stmt,next,block=this.parent=new nodes.Block(this.parent,node);if(false===scope)block.scope=false;this.accept("newline");if(this.accept("{")){this.css++;delim="}";this.skipWhitespace()}else{delim="outdent";this.expect("indent")}while(delim!=this.peek().type){if(this.css){if(this.accept("newline")||this.accept("indent"))continue;stmt=this.statement();this.accept(";");this.skipWhitespace()}else{if(this.accept("newline"))continue;next=this.lookahead(2).type;if("indent"==this.peek().type&&~["outdent","newline","comment"].indexOf(next)){this.skip(["indent","outdent"]);continue}if("eos"==this.peek().type)return block;stmt=this.statement();this.accept(";")}if(!stmt)this.error("unexpected token {peek} in block");block.push(stmt)}if(this.css){this.skipWhitespace();this.expect("}");this.skipSpaces();this.css--}else{this.expect("outdent")}this.parent=block.parent;return block},comment:function(){var node=this.next().val;this.skipSpaces();return node},forin:function(){this.expect("for");var key,val=this.id().name;if(this.accept(","))key=this.id().name;this.expect("in");this.state.push("for");this.cond=true;var each=new nodes.Each(val,key,this.expression());this.cond=false;each.block=this.block(each,false);this.state.pop();return each},ret:function(){this.expect("return");var expr=this.expression();return expr.isEmpty?new nodes.Return:new nodes.Return(expr)},unless:function(){this.expect("unless");this.state.push("conditional");this.cond=true;var node=new nodes.If(this.expression(),true);this.cond=false;node.block=this.block(node,false);this.state.pop();return node},ifstmt:function(){this.expect("if");this.state.push("conditional");this.cond=true;var node=new nodes.If(this.expression()),cond,block;this.cond=false;node.block=this.block(node,false);this.skip(["newline","comment"]);while(this.accept("else")){if(this.accept("if")){this.cond=true;cond=this.expression();this.cond=false;block=this.block(node,false);node.elses.push(new nodes.If(cond,block))}else{node.elses.push(this.block(node,false));break}this.skip(["newline","comment"])}this.state.pop();return node},atblock:function(node){if(!node)this.expect("atblock");node=new nodes.Atblock;this.state.push("atblock");node.block=this.block(node,false);this.state.pop();return node},atrule:function(){var type=this.expect("atrule").val,node=new nodes.Atrule(type),tok;this.skipSpacesAndComments();node.segments=this.selectorParts();this.skipSpacesAndComments();tok=this.peek().type;if("indent"==tok||"{"==tok||"newline"==tok&&"{"==this.lookahead(2).type){this.state.push("atrule");node.block=this.block(node);this.state.pop()}return node},scope:function(){this.expect("scope");var selector=this.selectorParts().map(function(selector){return selector.val}).join("");this.selectorScope=selector.trim();return nodes.nil},supports:function(){this.expect("supports");var node=new nodes.Supports(this.supportsCondition());this.state.push("atrule");node.block=this.block(node);this.state.pop();return node},supportsCondition:function(){var node=this.supportsNegation()||this.supportsOp();if(!node){this.cond=true;node=this.expression();this.cond=false}return node},supportsNegation:function(){if(this.accept("not")){var node=new nodes.Expression;node.push(new nodes.Literal("not"));node.push(this.supportsFeature());return node}},supportsOp:function(){var feature=this.supportsFeature(),op,expr;if(feature){expr=new nodes.Expression;expr.push(feature);while(op=this.accept("&&")||this.accept("||")){expr.push(new nodes.Literal("&&"==op.val?"and":"or"));expr.push(this.supportsFeature())}return expr}},supportsFeature:function(){this.skipSpacesAndComments();if("("==this.peek().type){var la=this.lookahead(2).type;if("ident"==la||"{"==la){return this.feature()}else{this.expect("(");var node=new nodes.Expression;node.push(new nodes.Literal("("));node.push(this.supportsCondition());this.expect(")");node.push(new nodes.Literal(")"));this.skipSpacesAndComments();return node}}},extend:function(){var tok=this.expect("extend"),selectors=[],sel,node,arr;do{arr=this.selectorParts();if(!arr.length)continue;sel=new nodes.Selector(arr);selectors.push(sel);if("!"!==this.peek().type)continue;tok=this.lookahead(2);if("ident"!==tok.type||"optional"!==tok.val.name)continue;this.skip(["!","ident"]);sel.optional=true}while(this.accept(","));node=new nodes.Extend(selectors);node.lineno=tok.lineno;node.column=tok.column;return node},media:function(){this.expect("media");this.state.push("atrule");var media=new nodes.Media(this.queries());media.block=this.block(media);this.state.pop();return media},queries:function(){var queries=new nodes.QueryList,skip=["comment","newline","space"];do{this.skip(skip);queries.push(this.query());this.skip(skip)}while(this.accept(","));return queries},query:function(){var query=new nodes.Query,expr,pred,id;if("ident"==this.peek().type&&("."==this.lookahead(2).type||"["==this.lookahead(2).type)){this.cond=true;expr=this.expression();this.cond=false;query.push(new nodes.Feature(expr.nodes));return query}if(pred=this.accept("ident")||this.accept("not")){pred=new nodes.Literal(pred.val.string||pred.val);this.skipSpacesAndComments();if(id=this.accept("ident")){query.type=id.val;query.predicate=pred}else{query.type=pred}this.skipSpacesAndComments();if(!this.accept("&&"))return query}do{query.push(this.feature())}while(this.accept("&&"));return query},feature:function(){this.skipSpacesAndComments();this.expect("(");this.skipSpacesAndComments();var node=new nodes.Feature(this.interpolate());this.skipSpacesAndComments();this.accept(":");this.skipSpacesAndComments();this.inProperty=true;node.expr=this.list();this.inProperty=false;this.skipSpacesAndComments();this.expect(")");this.skipSpacesAndComments();return node},mozdocument:function(){this.expect("-moz-document");var mozdocument=new nodes.Atrule("-moz-document"),calls=[];do{this.skipSpacesAndComments();calls.push(this.functionCall());this.skipSpacesAndComments()}while(this.accept(","));mozdocument.segments=[new nodes.Literal(calls.join(", "))];this.state.push("atrule");mozdocument.block=this.block(mozdocument,false);this.state.pop();return mozdocument},atimport:function(){this.expect("import");this.allowPostfix=true;return new nodes.Import(this.expression(),false)},require:function(){this.expect("require");this.allowPostfix=true;return new nodes.Import(this.expression(),true)},charset:function(){this.expect("charset");var str=this.expect("string").val;this.allowPostfix=true;return new nodes.Charset(str)},namespace:function(){var str,prefix;this.expect("namespace");this.skipSpacesAndComments();if(prefix=this.accept("ident")){prefix=prefix.val}this.skipSpacesAndComments();str=this.accept("string")||this.url();this.allowPostfix=true;return new nodes.Namespace(str,prefix)},keyframes:function(){var tok=this.expect("keyframes"),keyframes;this.skipSpacesAndComments();keyframes=new nodes.Keyframes(this.selectorParts(),tok.val);this.skipSpacesAndComments();this.state.push("atrule");keyframes.block=this.block(keyframes);this.state.pop();return keyframes},literal:function(){return this.expect("literal").val},id:function(){var tok=this.expect("ident");this.accept("space");return tok.val},ident:function(){var i=2,la=this.lookahead(i).type;while("space"==la)la=this.lookahead(++i).type;switch(la){case"=":case"?=":case"-=":case"+=":case"*=":case"/=":case"%=":return this.assignment();case".":if("space"==this.lookahead(i-1).type)return this.selector();if(this._ident==this.peek())return this.id();while("="!=this.lookahead(++i).type&&!~["[",",","newline","indent","eos"].indexOf(this.lookahead(i).type));if("="==this.lookahead(i).type){this._ident=this.peek();return this.expression()}else if(this.looksLikeSelector()&&this.stateAllowsSelector()){return this.selector()}case"[":if(this._ident==this.peek())return this.id();while("]"!=this.lookahead(i++).type&&"selector"!=this.lookahead(i).type&&"eos"!=this.lookahead(i).type);if("="==this.lookahead(i).type){this._ident=this.peek();return this.expression()}else if(this.looksLikeSelector()&&this.stateAllowsSelector()){return this.selector()}case"-":case"+":case"/":case"*":case"%":case"**":case"&&":case"||":case">":case"<":case">=":case"<=":case"!=":case"==":case"?":case"in":case"is a":case"is defined":if(this._ident==this.peek()){return this.id()}else{this._ident=this.peek();switch(this.currentState()){case"for":case"selector":return this.property();case"root":case"atblock":case"atrule":return"["==la?this.subscript():this.selector();case"function":case"conditional":return this.looksLikeSelector()?this.selector():this.expression();default:return this.operand?this.id():this.expression()}}default:switch(this.currentState()){case"root":return this.selector();case"for":case"selector":case"function":case"conditional":case"atblock":case"atrule":return this.property();default:var id=this.id();if("interpolation"==this.previousState())id.mixin=true;return id}}},interpolate:function(){var node,segs=[],star;star=this.accept("*");if(star)segs.push(new nodes.Literal("*"));while(true){if(this.accept("{")){this.state.push("interpolation");segs.push(this.expression());this.expect("}");this.state.pop()}else if(node=this.accept("-")){segs.push(new nodes.Literal("-"))}else if(node=this.accept("ident")){segs.push(node.val)}else{break}}if(!segs.length)this.expect("ident");return segs},property:function(){if(this.looksLikeSelector(true))return this.selector();var ident=this.interpolate(),prop=new nodes.Property(ident),ret=prop;this.accept("space");if(this.accept(":"))this.accept("space");this.state.push("property");this.inProperty=true;prop.expr=this.list();if(prop.expr.isEmpty)ret=ident[0];this.inProperty=false;this.allowPostfix=true;this.state.pop();this.accept(";");return ret},selector:function(){var arr,group=new nodes.Group,scope=this.selectorScope,isRoot="root"==this.currentState(),selector;do{this.accept("newline");arr=this.selectorParts();if(isRoot&&scope)arr.unshift(new nodes.Literal(scope+" "));if(arr.length){selector=new nodes.Selector(arr);selector.lineno=arr[0].lineno;selector.column=arr[0].column;group.push(selector)}}while(this.accept(",")||this.accept("newline"));if("selector-parts"==this.currentState())return group.nodes;this.state.push("selector");group.block=this.block(group);this.state.pop();return group},selectorParts:function(){var tok,arr=[];while(tok=this.selectorToken()){switch(tok.type){case"{":this.skipSpaces();var expr=this.expression();this.skipSpaces();this.expect("}");arr.push(expr);break;case this.prefix&&".":var literal=new nodes.Literal(tok.val+this.prefix);literal.prefixed=true;arr.push(literal);break;case"comment":break;case"color":case"unit":arr.push(new nodes.Literal(tok.val.raw));break;case"space":arr.push(new nodes.Literal(" "));break;case"function":arr.push(new nodes.Literal(tok.val.name+"("));break;case"ident":arr.push(new nodes.Literal(tok.val.name||tok.val.string));break;default:arr.push(new nodes.Literal(tok.val));if(tok.space)arr.push(new nodes.Literal(" "))}}return arr},assignment:function(){var op,node,name=this.id().name;if(op=this.accept("=")||this.accept("?=")||this.accept("+=")||this.accept("-=")||this.accept("*=")||this.accept("/=")||this.accept("%=")){this.state.push("assignment");var expr=this.list();if(expr.isEmpty)this.assignAtblock(expr);node=new nodes.Ident(name,expr);this.state.pop();switch(op.type){case"?=":var defined=new nodes.BinOp("is defined",node),lookup=new nodes.Expression;lookup.push(new nodes.Ident(name));node=new nodes.Ternary(defined,lookup,node);break;case"+=":case"-=":case"*=":case"/=":case"%=":node.val=new nodes.BinOp(op.type[0],new nodes.Ident(name),expr);break}}return node},fun:function(){var parens=1,i=2,tok;out:while(tok=this.lookahead(i++)){switch(tok.type){case"function":case"(":++parens;break;case")":if(!--parens)break out;break;case"eos":this.error('failed to find closing paren ")"')}}switch(this.currentState()){case"expression":return this.functionCall();default:return this.looksLikeFunctionDefinition(i)?this.functionDefinition():this.expression()}},url:function(){this.expect("function");this.state.push("function arguments");var args=this.args();this.expect(")");this.state.pop();return new nodes.Call("url",args)},functionCall:function(){var withBlock=this.accept("+");if("url"==this.peek().val.name)return this.url();var name=this.expect("function").val.name;this.state.push("function arguments");this.parens++;var args=this.args();this.expect(")");this.parens--;this.state.pop();var call=new nodes.Call(name,args);if(withBlock){this.state.push("function");call.block=this.block(call);this.state.pop()}return call},functionDefinition:function(){var name=this.expect("function").val.name;this.state.push("function params");this.skipWhitespace();var params=this.params();this.skipWhitespace();this.expect(")");this.state.pop();this.state.push("function");var fn=new nodes.Function(name,params);fn.block=this.block(fn);this.state.pop();return new nodes.Ident(name,fn)},params:function(){var tok,node,params=new nodes.Params;while(tok=this.accept("ident")){this.accept("space");params.push(node=tok.val);if(this.accept("...")){node.rest=true}else if(this.accept("=")){node.val=this.expression()}this.skipWhitespace();this.accept(",");this.skipWhitespace()}return params},args:function(){var args=new nodes.Arguments,keyword;do{if("ident"==this.peek().type&&":"==this.lookahead(2).type){keyword=this.next().val.string;this.expect(":");args.map[keyword]=this.expression()}else{args.push(this.expression())}}while(this.accept(","));return args},list:function(){var node=this.expression();while(this.accept(",")){if(node.isList){list.push(this.expression())}else{var list=new nodes.Expression(true);list.push(node);list.push(this.expression());node=list}}return node},expression:function(){var node,expr=new nodes.Expression;this.state.push("expression");while(node=this.negation()){if(!node)this.error("unexpected token {peek} in expression");expr.push(node)}this.state.pop();if(expr.nodes.length){expr.lineno=expr.nodes[0].lineno;expr.column=expr.nodes[0].column}return expr},negation:function(){if(this.accept("not")){return new nodes.UnaryOp("!",this.negation())}return this.ternary()},ternary:function(){var node=this.logical();if(this.accept("?")){var trueExpr=this.expression();this.expect(":");var falseExpr=this.expression();node=new nodes.Ternary(node,trueExpr,falseExpr)}return node},logical:function(){var op,node=this.typecheck();while(op=this.accept("&&")||this.accept("||")){node=new nodes.BinOp(op.type,node,this.typecheck())}return node},typecheck:function(){var op,node=this.equality();while(op=this.accept("is a")){this.operand=true;if(!node)this.error('illegal unary "'+op+'", missing left-hand operand');node=new nodes.BinOp(op.type,node,this.equality());this.operand=false}return node},equality:function(){var op,node=this.inop();while(op=this.accept("==")||this.accept("!=")){this.operand=true;if(!node)this.error('illegal unary "'+op+'", missing left-hand operand');node=new nodes.BinOp(op.type,node,this.inop());this.operand=false}return node},inop:function(){var node=this.relational();while(this.accept("in")){this.operand=true;if(!node)this.error('illegal unary "in", missing left-hand operand');node=new nodes.BinOp("in",node,this.relational());this.operand=false}return node},relational:function(){var op,node=this.range();while(op=this.accept(">=")||this.accept("<=")||this.accept("<")||this.accept(">")){this.operand=true;if(!node)this.error('illegal unary "'+op+'", missing left-hand operand');node=new nodes.BinOp(op.type,node,this.range());this.operand=false}return node},range:function(){var op,node=this.additive();if(op=this.accept("...")||this.accept("..")){this.operand=true;if(!node)this.error('illegal unary "'+op+'", missing left-hand operand');node=new nodes.BinOp(op.val,node,this.additive());this.operand=false}return node},additive:function(){var op,node=this.multiplicative();while(op=this.accept("+")||this.accept("-")){this.operand=true;node=new nodes.BinOp(op.type,node,this.multiplicative());this.operand=false}return node},multiplicative:function(){var op,node=this.defined();while(op=this.accept("**")||this.accept("*")||this.accept("/")||this.accept("%")){this.operand=true;if("/"==op&&this.inProperty&&!this.parens){this.stash.push(new Token("literal",new nodes.Literal("/")));this.operand=false;return node}else{if(!node)this.error('illegal unary "'+op+'", missing left-hand operand');node=new nodes.BinOp(op.type,node,this.defined());this.operand=false}}return node},defined:function(){var node=this.unary();if(this.accept("is defined")){if(!node)this.error('illegal unary "is defined", missing left-hand operand');node=new nodes.BinOp("is defined",node)}return node},unary:function(){var op,node;if(op=this.accept("!")||this.accept("~")||this.accept("+")||this.accept("-")){this.operand=true;node=this.unary();if(!node)this.error('illegal unary "'+op+'"');node=new nodes.UnaryOp(op.type,node);this.operand=false;return node}return this.subscript()},subscript:function(){var node=this.member(),id;while(this.accept("[")){node=new nodes.BinOp("[]",node,this.expression());this.expect("]")}if(this.accept("=")){node.op+="=";node.val=this.list();if(node.val.isEmpty)this.assignAtblock(node.val)}return node},member:function(){var node=this.primary();if(node){while(this.accept(".")){var id=new nodes.Ident(this.expect("ident").val.string);node=new nodes.Member(node,id)}this.skipSpaces();if(this.accept("=")){node.val=this.list();if(node.val.isEmpty)this.assignAtblock(node.val)}}return node},object:function(){var obj=new nodes.Object,id,val,comma;this.expect("{");this.skipWhitespace();while(!this.accept("}")){if(this.accept("comment")||this.accept("newline"))continue;if(!comma)this.accept(",");id=this.accept("ident")||this.accept("string");if(!id)this.error('expected "ident" or "string", got {peek}');id=id.val.hash;this.skipSpacesAndComments();this.expect(":");val=this.expression();obj.set(id,val);comma=this.accept(",");this.skipWhitespace()}return obj},primary:function(){var tok;this.skipSpaces();if(this.accept("(")){++this.parens;var expr=this.expression(),paren=this.expect(")");--this.parens;if(this.accept("%"))expr.push(new nodes.Ident("%"));tok=this.peek();if(!paren.space&&"ident"==tok.type&&~units.indexOf(tok.val.string)){expr.push(new nodes.Ident(tok.val.string));this.next()}return expr}tok=this.peek();switch(tok.type){case"null":case"unit":case"color":case"string":case"literal":case"boolean":case"comment":return this.next().val;case!this.cond&&"{":return this.object();case"atblock":return this.atblock();case"atrule":var id=new nodes.Ident(this.next().val);id.property=true; -return id;case"ident":return this.ident();case"function":return tok.anonymous?this.functionDefinition():this.functionCall()}}}});require.register("renderer.js",function(module,exports,require){var Parser=require("./parser"),Evaluator=require("./visitor/evaluator"),Normalizer=require("./visitor/normalizer"),utils=require("./utils"),nodes=require("./nodes"),join=require("./path").join;module.exports=Renderer;function Renderer(str,options){options=options||{};options.globals=options.globals||{};options.functions=options.functions||{};options.use=options.use||[];options.use=Array.isArray(options.use)?options.use:[options.use];options.imports=[];options.paths=options.paths||[];options.filename=options.filename||"stylus";options.Evaluator=options.Evaluator||Evaluator;this.options=options;this.str=str}Renderer.prototype.render=function(fn){var parser=this.parser=new Parser(this.str,this.options);for(var i=0,len=this.options.use.length;i","+","~"];var SelectorParser=module.exports=function SelectorParser(str,stack,parts){this.str=str;this.stack=stack||[];this.parts=parts||[];this.pos=0;this.level=2;this.nested=true;this.ignore=false};SelectorParser.prototype.skip=function(len){this.str=this.str.substr(len);this.pos+=len};SelectorParser.prototype.skipSpaces=function(){while(" "==this.str[0])this.skip(1)};SelectorParser.prototype.advance=function(){return this.root()||this.relative()||this.initial()||this.escaped()||this.parent()||this.partial()||this.char()};SelectorParser.prototype.root=function(){if(!this.pos&&"/"==this.str[0]&&"deep"!=this.str.slice(1,5)){this.nested=false;this.skip(1)}};SelectorParser.prototype.relative=function(multi){if((!this.pos||multi)&&"../"==this.str.slice(0,3)){this.nested=false;this.skip(3);while(this.relative(true))this.level++;if(!this.raw){var ret=this.stack[this.stack.length-this.level];if(ret){return ret}else{this.ignore=true}}}};SelectorParser.prototype.initial=function(){if(!this.pos&&"~"==this.str[0]&&"/"==this.str[1]){this.nested=false;this.skip(2);return this.stack[0]}};SelectorParser.prototype.escaped=function(){if("\\"==this.str[0]){var char=this.str[1];if("&"==char||"^"==char){this.skip(2);return char}}};SelectorParser.prototype.parent=function(){if("&"==this.str[0]){this.nested=false;if(!this.pos&&(!this.stack.length||this.raw)){var i=0;while(" "==this.str[++i]);if(~COMBINATORS.indexOf(this.str[i])){this.skip(i+1);return}}this.skip(1);if(!this.raw)return this.stack[this.stack.length-1]}};SelectorParser.prototype.partial=function(){if("^"==this.str[0]&&"["==this.str[1]){this.skip(2);this.skipSpaces();var ret=this.range();this.skipSpaces();if("]"!=this.str[0])return"^[";this.nested=false;this.skip(1);if(ret){return ret}else{this.ignore=true}}};SelectorParser.prototype.number=function(){var i=0,ret="";if("-"==this.str[i])ret+=this.str[i++];while(this.str.charCodeAt(i)>=48&&this.str.charCodeAt(i)<=57)ret+=this.str[i++];if(ret){this.skip(i);return Number(ret)}};SelectorParser.prototype.range=function(){var start=this.number(),ret;if(".."==this.str.slice(0,2)){this.skip(2);var end=this.number(),len=this.parts.length;if(start<0)start=len+start-1;if(end<0)end=len+end-1;if(start>end){var tmp=start;start=end;end=tmp}if(end-1){return n.toString().replace("0.",".")+type}}return(float?parseFloat(n.toFixed(15)):n).toString()+type};Compiler.prototype.visitGroup=function(group){var stack=this.keyframe?[]:this.stack,comma=this.compress?",":",\n";stack.push(group.nodes);if(group.block.hasProperties){var selectors=utils.compileSelectors.call(this,stack),len=selectors.length;if(len){if(this.keyframe)comma=this.compress?",":", ";for(var i=0;i200){throw new RangeError("Maximum stylus call stack size exceeded")}if("expression"==fn.nodeName)fn=fn.first;this.ret++;var args=this.visit(call.args);for(var key in args.map){args.map[key]=this.visit(args.map[key].clone())}this.ret--;if(fn.fn){ret=this.invokeBuiltin(fn.fn,args)}else if("function"==fn.nodeName){if(call.block)call.block=this.visit(call.block);ret=this.invokeFunction(fn,args,call.block)}this.calling.pop();this.ignoreColors=false;return ret};Evaluator.prototype.visitIdent=function(ident){var prop;if(ident.property){if(prop=this.lookupProperty(ident.name)){return this.visit(prop.expr.clone())}return nodes.nil}else if(ident.val.isNull){var val=this.lookup(ident.name);if(val&&ident.mixin)this.mixinNode(val);return val?this.visit(val):ident}else{this.ret++;ident.val=this.visit(ident.val);this.ret--;this.currentScope.add(ident);return ident.val}};Evaluator.prototype.visitBinOp=function(binop){if("is defined"==binop.op)return this.isDefined(binop.left); -this.ret++;var op=binop.op,left=this.visit(binop.left),right="||"==op||"&&"==op?binop.right:this.visit(binop.right);var val=binop.val?this.visit(binop.val):null;this.ret--;try{return this.visit(left.operate(op,right,val))}catch(err){if("CoercionError"==err.name){switch(op){case"==":return nodes.no;case"!=":return nodes.yes}}throw err}};Evaluator.prototype.visitUnaryOp=function(unary){var op=unary.op,node=this.visit(unary.expr);if("!"!=op){node=node.first.clone();utils.assertType(node,"unit")}switch(op){case"-":node.val=-node.val;break;case"+":node.val=+node.val;break;case"~":node.val=~node.val;break;case"!":return node.toBoolean().negate()}return node};Evaluator.prototype.visitTernary=function(ternary){var ok=this.visit(ternary.cond).toBoolean();return ok.isTrue?this.visit(ternary.trueExpr):this.visit(ternary.falseExpr)};Evaluator.prototype.visitExpression=function(expr){for(var i=0,len=expr.nodes.length;i1){for(var i=0;i0&&!~part.indexOf("&")){part="/"+part}s=new nodes.Selector([new nodes.Literal(part)]);s.val=part;s.block=group.block;group.nodes[i++]=s}});stack.push(group.nodes);var selectors=utils.compileSelectors(stack,true);selectors.forEach(function(selector){map[selector]=map[selector]||[];map[selector].push(group)});this.extend(group,selectors);stack.pop();return group};Normalizer.prototype.visitFunction=function(){return nodes.nil};Normalizer.prototype.visitMedia=function(media){var medias=[],group=this.closestGroup(media.block),parent;function mergeQueries(block){block.nodes.forEach(function(node,i){switch(node.nodeName){case"media":node.val=media.val.merge(node.val);medias.push(node);block.nodes[i]=nodes.nil;break;case"block":mergeQueries(node);break;default:if(node.block&&node.block.nodes)mergeQueries(node.block)}})}mergeQueries(media.block);this.bubble(media);if(medias.length){medias.forEach(function(node){if(group){group.block.push(node)}else{this.root.nodes.splice(++this.rootIndex,0,node)}node=this.visit(node);parent=node.block.parent;if(node.bubbled&&(!group||"group"==parent.node.nodeName)){node.group.block=node.block.nodes[0].block;node.block.nodes[0]=node.group}},this)}return media};Normalizer.prototype.visitSupports=function(node){this.bubble(node);return node};Normalizer.prototype.visitAtrule=function(node){if(node.block)node.block=this.visit(node.block);return node};Normalizer.prototype.visitKeyframes=function(node){var frames=node.block.nodes.filter(function(frame){return frame.block&&frame.block.hasProperties});node.frames=frames.length;return node};Normalizer.prototype.visitImport=function(node){this.imports.push(node);return this.hoist?nodes.nil:node};Normalizer.prototype.visitCharset=function(node){this.charset=node;return this.hoist?nodes.nil:node};Normalizer.prototype.extend=function(group,selectors){var map=this.map,self=this,parent=this.closestGroup(group.block);group.extends.forEach(function(extend){var groups=map[extend.selector];if(!groups){if(extend.optional)return;var err=new Error('Failed to @extend "'+extend.selector+'"');err.lineno=extend.lineno;err.column=extend.column;throw err}selectors.forEach(function(selector){var node=new nodes.Selector;node.val=selector;node.inherits=false;groups.forEach(function(group){if(!parent||parent!=group)self.extend(group,selectors);group.push(node)})})});group.block=this.visit(group.block)}});return require("stylus")}();