diff options
Diffstat (limited to 'deprecated/jinwei.me/mobile/js/less.js')
-rw-r--r-- | deprecated/jinwei.me/mobile/js/less.js | 3635 |
1 files changed, 3635 insertions, 0 deletions
diff --git a/deprecated/jinwei.me/mobile/js/less.js b/deprecated/jinwei.me/mobile/js/less.js new file mode 100644 index 0000000..01ba958 --- /dev/null +++ b/deprecated/jinwei.me/mobile/js/less.js | |||
@@ -0,0 +1,3635 @@ | |||
1 | /*! | ||
2 | * LESS - Leaner CSS v1.7.0 | ||
3 | * http://lesscss.org | ||
4 | * | ||
5 | * Copyright (c) 2009-2014, Alexis Sellier <[email protected]> | ||
6 | * Licensed under the Apache v2 License. | ||
7 | * | ||
8 | */ | ||
9 | |||
10 | /** * @license Apache v2 | ||
11 | */ | ||
12 | |||
13 | ! function(a, b) { | ||
14 | function c(b) { | ||
15 | return a.less[b.split("/")[1]] | ||
16 | } | ||
17 | |||
18 | function d(a, b) { | ||
19 | "undefined" != typeof console && w.logLevel >= b && console.log("less: " + a) | ||
20 | } | ||
21 | |||
22 | function e(a) { | ||
23 | return a.replace(/^[a-z-]+:\/+?[^\/]+/, "").replace(/^\//, "").replace(/\.[a-zA-Z]+$/, "").replace(/[^\.\w-]+/g, "-").replace(/\./g, ":") | ||
24 | } | ||
25 | |||
26 | function f(a, c) { | ||
27 | var e = "{line} {content}", | ||
28 | f = a.filename || c, | ||
29 | g = [], | ||
30 | h = (a.type || "Syntax") + "Error: " + (a.message || "There is an error in your .less file") + " in " + f + " ", | ||
31 | i = function(a, c, d) { | ||
32 | a.extract[c] !== b && g.push(e.replace(/\{line\}/, (parseInt(a.line, 10) || 0) + (c - 1)).replace(/\{class\}/, d).replace(/\{content\}/, a.extract[c])) | ||
33 | }; | ||
34 | a.extract ? (i(a, 0, ""), i(a, 1, "line"), i(a, 2, ""), h += "on line " + a.line + ", column " + (a.column + 1) + ":\n" + g.join("\n")) : a.stack && (h += a.stack), d(h, z.errors) | ||
35 | } | ||
36 | |||
37 | function g(a, b, c) { | ||
38 | var f = b.href || "", | ||
39 | g = "less:" + (b.title || e(f)), | ||
40 | h = document.getElementById(g), | ||
41 | i = !1, | ||
42 | j = document.createElement("style"); | ||
43 | if (j.setAttribute("type", "text/css"), b.media && j.setAttribute("media", b.media), j.id = g, j.styleSheet) try { | ||
44 | j.styleSheet.cssText = a | ||
45 | } catch (k) { | ||
46 | throw new Error("Couldn't reassign styleSheet.cssText.") | ||
47 | } else j.appendChild(document.createTextNode(a)), i = null !== h && h.childNodes.length > 0 && j.childNodes.length > 0 && h.firstChild.nodeValue === j.firstChild.nodeValue; | ||
48 | var l = document.getElementsByTagName("head")[0]; | ||
49 | if (null === h || i === !1) { | ||
50 | var m = b && b.nextSibling || null; | ||
51 | m ? m.parentNode.insertBefore(j, m) : l.appendChild(j) | ||
52 | } | ||
53 | if (h && i === !1 && h.parentNode.removeChild(h), c && D) { | ||
54 | d("saving " + f + " to cache.", z.info); | ||
55 | try { | ||
56 | D.setItem(f, a), D.setItem(f + ":timestamp", c) | ||
57 | } catch (k) { | ||
58 | d("failed to save", z.errors) | ||
59 | } | ||
60 | } | ||
61 | } | ||
62 | |||
63 | function h(a) { | ||
64 | return w.postProcessor && "function" == typeof w.postProcessor && (a = w.postProcessor.call(a, a) || a), a | ||
65 | } | ||
66 | |||
67 | function i(a, c) { | ||
68 | var d, f, h = "less-error-message:" + e(c || ""), | ||
69 | i = '<li><label>{line}</label><pre class="{class}">{content}</pre></li>', | ||
70 | j = document.createElement("div"), | ||
71 | k = [], | ||
72 | l = a.filename || c, | ||
73 | m = l.match(/([^\/]+(\?.*)?)$/)[1]; | ||
74 | j.id = h, j.className = "less-error-message", f = "<h3>" + (a.type || "Syntax") + "Error: " + (a.message || "There is an error in your .less file") + '</h3><p>in <a href="' + l + '">' + m + "</a> "; | ||
75 | var n = function(a, c, d) { | ||
76 | a.extract[c] !== b && k.push(i.replace(/\{line\}/, (parseInt(a.line, 10) || 0) + (c - 1)).replace(/\{class\}/, d).replace(/\{content\}/, a.extract[c])) | ||
77 | }; | ||
78 | a.extract ? (n(a, 0, ""), n(a, 1, "line"), n(a, 2, ""), f += "on line " + a.line + ", column " + (a.column + 1) + ":</p><ul>" + k.join("") + "</ul>") : a.stack && (f += "<br/>" + a.stack.split("\n").slice(1).join("<br/>")), j.innerHTML = f, g([".less-error-message ul, .less-error-message li {", "list-style-type: none;", "margin-right: 15px;", "padding: 4px 0;", "margin: 0;", "}", ".less-error-message label {", "font-size: 12px;", "margin-right: 15px;", "padding: 4px 0;", "color: #cc7777;", "}", ".less-error-message pre {", "color: #dd6666;", "padding: 4px 0;", "margin: 0;", "display: inline-block;", "}", ".less-error-message pre.line {", "color: #ff0000;", "}", ".less-error-message h3 {", "font-size: 20px;", "font-weight: bold;", "padding: 15px 0 5px 0;", "margin: 0;", "}", ".less-error-message a {", "color: #10a", "}", ".less-error-message .error {", "color: red;", "font-weight: bold;", "padding-bottom: 2px;", "border-bottom: 1px dashed red;", "}"].join("\n"), { | ||
79 | title: "error-message" | ||
80 | }), j.style.cssText = ["font-family: Arial, sans-serif", "border: 1px solid #e00", "background-color: #eee", "border-radius: 5px", "-webkit-border-radius: 5px", "-moz-border-radius: 5px", "color: #e00", "padding: 15px", "margin-bottom: 15px"].join(";"), "development" == w.env && (d = setInterval(function() { | ||
81 | document.body && (document.getElementById(h) ? document.body.replaceChild(j, document.getElementById(h)) : document.body.insertBefore(j, document.body.firstChild), clearInterval(d)) | ||
82 | }, 10)) | ||
83 | } | ||
84 | |||
85 | function j(a, b) { | ||
86 | w.errorReporting && "html" !== w.errorReporting ? "console" === w.errorReporting ? f(a, b) : "function" == typeof w.errorReporting && w.errorReporting("add", a, b) : i(a, b) | ||
87 | } | ||
88 | |||
89 | function k(a) { | ||
90 | var b = document.getElementById("less-error-message:" + e(a)); | ||
91 | b && b.parentNode.removeChild(b) | ||
92 | } | ||
93 | |||
94 | function l() {} | ||
95 | |||
96 | function m(a) { | ||
97 | w.errorReporting && "html" !== w.errorReporting ? "console" === w.errorReporting ? l(a) : "function" == typeof w.errorReporting && w.errorReporting("remove", a) : k(a) | ||
98 | } | ||
99 | |||
100 | function n(a) { | ||
101 | for (var b, c = document.getElementsByTagName("style"), d = 0; d < c.length; d++) | ||
102 | if (b = c[d], b.type.match(C)) { | ||
103 | var e = new w.tree.parseEnv(w), | ||
104 | f = b.innerHTML || ""; | ||
105 | e.filename = document.location.href.replace(/#.*$/, ""), (a || w.globalVars) && (e.useFileCache = !0); | ||
106 | var g = function(a) { | ||
107 | return function(b, c) { | ||
108 | if (b) return j(b, "inline"); | ||
109 | var d = c.toCSS(w); | ||
110 | a.type = "text/css", a.styleSheet ? a.styleSheet.cssText = d : a.innerHTML = d | ||
111 | } | ||
112 | }(b); | ||
113 | new w.Parser(e).parse(f, g, { | ||
114 | globalVars: w.globalVars, | ||
115 | modifyVars: a | ||
116 | }) | ||
117 | } | ||
118 | } | ||
119 | |||
120 | function o(a, b) { | ||
121 | var c, d, e = /^((?:[a-z-]+:)?\/+?(?:[^\/\?#]*\/)|([\/\\]))?((?:[^\/\\\?#]*[\/\\])*)([^\/\\\?#]*)([#\?].*)?$/i, | ||
122 | f = a.match(e), | ||
123 | g = {}, | ||
124 | h = []; | ||
125 | if (!f) throw new Error("Could not parse sheet href - '" + a + "'"); | ||
126 | if (!f[1] || f[2]) { | ||
127 | if (d = b.match(e), !d) throw new Error("Could not parse page url - '" + b + "'"); | ||
128 | f[1] = f[1] || d[1] || "", f[2] || (f[3] = d[3] + f[3]) | ||
129 | } | ||
130 | if (f[3]) { | ||
131 | for (h = f[3].replace(/\\/g, "/").split("/"), c = 0; c < h.length; c++) "." === h[c] && (h.splice(c, 1), c -= 1); | ||
132 | for (c = 0; c < h.length; c++) ".." === h[c] && c > 0 && (h.splice(c - 1, 2), c -= 2) | ||
133 | } | ||
134 | return g.hostPart = f[1], g.directories = h, g.path = f[1] + h.join("/"), g.fileUrl = g.path + (f[4] || ""), g.url = g.fileUrl + (f[5] || ""), g | ||
135 | } | ||
136 | |||
137 | function p(a, b) { | ||
138 | var c, d, e, f, g = o(a), | ||
139 | h = o(b), | ||
140 | i = ""; | ||
141 | if (g.hostPart !== h.hostPart) return ""; | ||
142 | for (d = Math.max(h.directories.length, g.directories.length), c = 0; d > c && h.directories[c] === g.directories[c]; c++); | ||
143 | for (f = h.directories.slice(c), e = g.directories.slice(c), c = 0; c < f.length - 1; c++) i += "../"; | ||
144 | for (c = 0; c < e.length - 1; c++) i += e[c] + "/"; | ||
145 | return i | ||
146 | } | ||
147 | |||
148 | function q() { | ||
149 | if (a.XMLHttpRequest && ("file:" !== a.location.protocol || !a.ActiveXObject)) return new XMLHttpRequest; | ||
150 | try { | ||
151 | return new ActiveXObject("Microsoft.XMLHTTP") | ||
152 | } catch (b) { | ||
153 | return d("browser doesn't support AJAX.", z.errors), null | ||
154 | } | ||
155 | } | ||
156 | |||
157 | function r(a, b, c, e) { | ||
158 | function f(b, c, d) { | ||
159 | b.status >= 200 && b.status < 300 ? c(b.responseText, b.getResponseHeader("Last-Modified")) : "function" == typeof d && d(b.status, a) | ||
160 | } | ||
161 | var g = q(), | ||
162 | h = y ? w.fileAsync : w.async; | ||
163 | "function" == typeof g.overrideMimeType && g.overrideMimeType("text/css"), d("XHR: Getting '" + a + "'", z.debug), g.open("GET", a, h), g.setRequestHeader("Accept", b || "text/x-less, text/css; q=0.9, */*; q=0.5"), g.send(null), y && !w.fileAsync ? 0 === g.status || g.status >= 200 && g.status < 300 ? c(g.responseText) : e(g.status, a) : h ? g.onreadystatechange = function() { | ||
164 | 4 == g.readyState && f(g, c, e) | ||
165 | } : f(g, c, e) | ||
166 | } | ||
167 | |||
168 | function s(b, c, d, e) { | ||
169 | c && c.currentDirectory && !/^([a-z-]+:)?\//.test(b) && (b = c.currentDirectory + b); | ||
170 | var f = o(b, a.location.href), | ||
171 | g = f.url, | ||
172 | h = { | ||
173 | currentDirectory: f.path, | ||
174 | filename: g | ||
175 | }; | ||
176 | if (c ? (h.entryPath = c.entryPath, h.rootpath = c.rootpath, h.rootFilename = c.rootFilename, h.relativeUrls = c.relativeUrls) : (h.entryPath = f.path, h.rootpath = w.rootpath || f.path, h.rootFilename = g, h.relativeUrls = e.relativeUrls), h.relativeUrls && (h.rootpath = e.rootpath ? o(e.rootpath + p(f.path, h.entryPath)).path : f.path), e.useFileCache && E[g]) try { | ||
177 | var i = E[g]; | ||
178 | d(null, i, g, h, { | ||
179 | lastModified: new Date | ||
180 | }) | ||
181 | } catch (j) { | ||
182 | d(j, null, g) | ||
183 | } else r(g, e.mime, function(a, b) { | ||
184 | E[g] = a; | ||
185 | try { | ||
186 | d(null, a, g, h, { | ||
187 | lastModified: b | ||
188 | }) | ||
189 | } catch (c) { | ||
190 | d(c, null, g) | ||
191 | } | ||
192 | }, function(a, b) { | ||
193 | d({ | ||
194 | type: "File", | ||
195 | message: "'" + b + "' wasn't found (" + a + ")" | ||
196 | }, null, g) | ||
197 | }) | ||
198 | } | ||
199 | |||
200 | function t(a, b, c, d, e) { | ||
201 | var f = new w.tree.parseEnv(w); | ||
202 | f.mime = a.type, (e || w.globalVars) && (f.useFileCache = !0), s(a.href, null, function(h, i, j, k, l) { | ||
203 | if (l) { | ||
204 | l.remaining = d; | ||
205 | var n = D && D.getItem(j), | ||
206 | o = D && D.getItem(j + ":timestamp"); | ||
207 | if (!c && o && l.lastModified && new Date(l.lastModified).valueOf() === new Date(o).valueOf()) return g(n, a), l.local = !0, void b(null, null, i, a, l, j) | ||
208 | } | ||
209 | m(j), i ? (f.currentFileInfo = k, new w.Parser(f).parse(i, function(c, d) { | ||
210 | if (c) return b(c, null, null, a); | ||
211 | try { | ||
212 | b(c, d, i, a, l, j) | ||
213 | } catch (c) { | ||
214 | b(c, null, null, a) | ||
215 | } | ||
216 | }, { | ||
217 | modifyVars: e, | ||
218 | globalVars: w.globalVars | ||
219 | })) : b(h, null, null, a, l, j) | ||
220 | }, f, e) | ||
221 | } | ||
222 | |||
223 | function u(a, b, c) { | ||
224 | for (var d = 0; d < w.sheets.length; d++) t(w.sheets[d], a, b, w.sheets.length - (d + 1), c) | ||
225 | } | ||
226 | |||
227 | function v() { | ||
228 | "development" === w.env ? (w.optimization = 0, w.watchTimer = setInterval(function() { | ||
229 | w.watchMode && u(function(a, b, c, d, e) { | ||
230 | if (a) j(a, d.href); | ||
231 | else if (b) { | ||
232 | var f = b.toCSS(w); | ||
233 | f = h(f), g(f, d, e.lastModified) | ||
234 | } | ||
235 | }) | ||
236 | }, w.poll)) : w.optimization = 3 | ||
237 | }("undefined" == typeof a.less || "undefined" != typeof a.less.nodeType) && (a.less = {}), w = a.less, x = a.less.tree = {}, w.mode = "browser"; | ||
238 | var w, x; | ||
239 | w === b && (w = exports, x = c("./tree"), w.mode = "node"), w.Parser = function(a) { | ||
240 | function d() { | ||
241 | D = y, G.push({ | ||
242 | current: C, | ||
243 | i: y, | ||
244 | j: z | ||
245 | }) | ||
246 | } | ||
247 | |||
248 | function e() { | ||
249 | var a = G.pop(); | ||
250 | C = a.current, D = y = a.i, z = a.j | ||
251 | } | ||
252 | |||
253 | function f() { | ||
254 | G.pop() | ||
255 | } | ||
256 | |||
257 | function g() { | ||
258 | y > D && (C = C.slice(y - D), D = y) | ||
259 | } | ||
260 | |||
261 | function h(a, b) { | ||
262 | var c = a.charCodeAt(0 | b); | ||
263 | return 32 >= c && (32 === c || 10 === c || 9 === c) | ||
264 | } | ||
265 | |||
266 | function i(a) { | ||
267 | var b, c, d = typeof a; | ||
268 | return "string" === d ? v.charAt(y) !== a ? null : (l(1), a) : (g(), (b = a.exec(C)) ? (c = b[0].length, l(c), "string" == typeof b ? b : 1 === b.length ? b[0] : b) : null) | ||
269 | } | ||
270 | |||
271 | function j(a) { | ||
272 | y > D && (C = C.slice(y - D), D = y); | ||
273 | var b = a.exec(C); | ||
274 | return b ? (l(b[0].length), "string" == typeof b ? b : 1 === b.length ? b[0] : b) : null | ||
275 | } | ||
276 | |||
277 | function k(a) { | ||
278 | return v.charAt(y) !== a ? null : (l(1), a) | ||
279 | } | ||
280 | |||
281 | function l(a) { | ||
282 | for (var b, c = y, d = z, e = y - D, f = y + C.length - e, g = y += a, h = v; f > y && (b = h.charCodeAt(y), !(b > 32)) && (32 === b || 10 === b || 9 === b || 13 === b); y++); | ||
283 | return C = C.slice(a + y - g + e), D = y, !C.length && z < B.length - 1 ? (C = B[++z], l(0), !0) : c !== y || d !== z | ||
284 | } | ||
285 | |||
286 | function m(a, b) { | ||
287 | var c = "[object Function]" === Object.prototype.toString.call(a) ? a.call(F) : i(a); | ||
288 | return c ? c : void o(b || ("string" == typeof a ? "expected '" + a + "' got '" + v.charAt(y) + "'" : "unexpected token")) | ||
289 | } | ||
290 | |||
291 | function n(a, b) { | ||
292 | return v.charAt(y) === a ? (l(1), a) : void o(b || "expected '" + a + "' got '" + v.charAt(y) + "'") | ||
293 | } | ||
294 | |||
295 | function o(a, b) { | ||
296 | var c = new Error(a); | ||
297 | throw c.index = y, c.type = b || "Syntax", c | ||
298 | } | ||
299 | |||
300 | function p(a) { | ||
301 | return "string" == typeof a ? v.charAt(y) === a : a.test(C) | ||
302 | } | ||
303 | |||
304 | function q(a) { | ||
305 | return v.charAt(y) === a | ||
306 | } | ||
307 | |||
308 | function r(a, b) { | ||
309 | return a.filename && b.currentFileInfo.filename && a.filename !== b.currentFileInfo.filename ? E.imports.contents[a.filename] : v | ||
310 | } | ||
311 | |||
312 | function s(a, b) { | ||
313 | for (var c = a + 1, d = null, e = -1; --c >= 0 && "\n" !== b.charAt(c);) e++; | ||
314 | return "number" == typeof a && (d = (b.slice(0, a).match(/\n/g) || "").length), { | ||
315 | line: d, | ||
316 | column: e | ||
317 | } | ||
318 | } | ||
319 | |||
320 | function t(a, b, d) { | ||
321 | var e = d.currentFileInfo.filename; | ||
322 | return "browser" !== w.mode && "rhino" !== w.mode && (e = c("path").resolve(e)), { | ||
323 | lineNumber: s(a, b).line + 1, | ||
324 | fileName: e | ||
325 | } | ||
326 | } | ||
327 | |||
328 | function u(a, b) { | ||
329 | var c = r(a, b), | ||
330 | d = s(a.index, c), | ||
331 | e = d.line, | ||
332 | f = d.column, | ||
333 | g = a.call && s(a.call, c).line, | ||
334 | h = c.split("\n"); | ||
335 | this.type = a.type || "Syntax", this.message = a.message, this.filename = a.filename || b.currentFileInfo.filename, this.index = a.index, this.line = "number" == typeof e ? e + 1 : null, this.callLine = g + 1, this.callExtract = h[g], this.stack = a.stack, this.column = f, this.extract = [h[e - 1], h[e], h[e + 1]] | ||
336 | } | ||
337 | var v, y, z, A, B, C, D, E, F, G = [], | ||
338 | H = a && a.filename; | ||
339 | a instanceof x.parseEnv || (a = new x.parseEnv(a)); | ||
340 | var I = this.imports = { | ||
341 | paths: a.paths || [], | ||
342 | queue: [], | ||
343 | files: a.files, | ||
344 | contents: a.contents, | ||
345 | contentsIgnoredChars: a.contentsIgnoredChars, | ||
346 | mime: a.mime, | ||
347 | error: null, | ||
348 | push: function(b, c, d, e) { | ||
349 | var f = this; | ||
350 | this.queue.push(b); | ||
351 | var g = function(a, c, d) { | ||
352 | f.queue.splice(f.queue.indexOf(b), 1); | ||
353 | var g = d === H; | ||
354 | f.files[d] = c, a && !f.error && (f.error = a), e(a, c, g, d) | ||
355 | }; | ||
356 | w.Parser.importer ? w.Parser.importer(b, c, g, a) : w.Parser.fileLoader(b, c, function(b, e, f, h) { | ||
357 | if (b) return void g(b); | ||
358 | var i = new x.parseEnv(a); | ||
359 | i.currentFileInfo = h, i.processImports = !1, i.contents[f] = e, (c.reference || d.reference) && (h.reference = !0), d.inline ? g(null, e, f) : new w.Parser(i).parse(e, function(a, b) { | ||
360 | g(a, b, f) | ||
361 | }) | ||
362 | }, a) | ||
363 | } | ||
364 | }, | ||
365 | J = j; | ||
366 | return u.prototype = new Error, u.prototype.constructor = u, this.env = a = a || {}, this.optimization = "optimization" in this.env ? this.env.optimization : 1, E = { | ||
367 | imports: I, | ||
368 | parse: function(d, e, f) { | ||
369 | var g, h, i, j, k, l = null, | ||
370 | m = ""; | ||
371 | if (y = z = D = A = 0, j = f && f.globalVars ? w.Parser.serializeVars(f.globalVars) + "\n" : "", k = f && f.modifyVars ? "\n" + w.Parser.serializeVars(f.modifyVars) : "", (j || f && f.banner) && (m = (f && f.banner ? f.banner : "") + j, E.imports.contentsIgnoredChars[a.currentFileInfo.filename] = m.length), d = d.replace(/\r\n/g, "\n"), v = d = m + d.replace(/^\uFEFF/, "") + k, E.imports.contents[a.currentFileInfo.filename] = d, B = function(b) { | ||
372 | function c(b, c) { | ||
373 | l = new u({ | ||
374 | index: c || i, | ||
375 | type: "Parse", | ||
376 | message: b, | ||
377 | filename: a.currentFileInfo.filename | ||
378 | }, a) | ||
379 | } | ||
380 | |||
381 | function d(a) { | ||
382 | var c = i - s; | ||
383 | 512 > c && !a || !c || (r.push(b.slice(s, i + 1)), s = i + 1) | ||
384 | } | ||
385 | var e, f, g, h, i, j, k, m, n, o = b.length, | ||
386 | p = 0, | ||
387 | q = 0, | ||
388 | r = [], | ||
389 | s = 0; | ||
390 | for (i = 0; o > i; i++) | ||
391 | if (k = b.charCodeAt(i), !(k >= 97 && 122 >= k || 34 > k)) switch (k) { | ||
392 | case 40: | ||
393 | q++, f = i; | ||
394 | continue; | ||
395 | case 41: | ||
396 | if (--q < 0) return c("missing opening `(`"); | ||
397 | continue; | ||
398 | case 59: | ||
399 | q || d(); | ||
400 | continue; | ||
401 | case 123: | ||
402 | p++, e = i; | ||
403 | continue; | ||
404 | case 125: | ||
405 | if (--p < 0) return c("missing opening `{`"); | ||
406 | p || q || d(); | ||
407 | continue; | ||
408 | case 92: | ||
409 | if (o - 1 > i) { | ||
410 | i++; | ||
411 | continue | ||
412 | } | ||
413 | return c("unescaped `\\`"); | ||
414 | case 34: | ||
415 | case 39: | ||
416 | case 96: | ||
417 | for (n = 0, j = i, i += 1; o > i; i++) | ||
418 | if (m = b.charCodeAt(i), !(m > 96)) { | ||
419 | if (m == k) { | ||
420 | n = 1; | ||
421 | break | ||
422 | } | ||
423 | if (92 == m) { | ||
424 | if (i == o - 1) return c("unescaped `\\`"); | ||
425 | i++ | ||
426 | } | ||
427 | } | ||
428 | if (n) continue; | ||
429 | return c("unmatched `" + String.fromCharCode(k) + "`", j); | ||
430 | case 47: | ||
431 | if (q || i == o - 1) continue; | ||
432 | if (m = b.charCodeAt(i + 1), 47 == m) | ||
433 | for (i += 2; o > i && (m = b.charCodeAt(i), !(13 >= m) || 10 != m && 13 != m); i++); | ||
434 | else if (42 == m) { | ||
435 | for (g = j = i, i += 2; o - 1 > i && (m = b.charCodeAt(i), 125 == m && (h = i), 42 != m || 47 != b.charCodeAt(i + 1)); i++); | ||
436 | if (i == o - 1) return c("missing closing `*/`", j); | ||
437 | i++ | ||
438 | } | ||
439 | continue; | ||
440 | case 42: | ||
441 | if (o - 1 > i && 47 == b.charCodeAt(i + 1)) return c("unmatched `/*`"); | ||
442 | continue | ||
443 | } | ||
444 | return 0 !== p ? g > e && h > g ? c("missing closing `}` or `*/`", e) : c("missing closing `}`", e) : 0 !== q ? c("missing closing `)`", f) : (d(!0), r) | ||
445 | }(d), l) return e(new u(l, a)); | ||
446 | C = B[0]; | ||
447 | try { | ||
448 | g = new x.Ruleset(null, this.parsers.primary()), g.root = !0, g.firstRoot = !0 | ||
449 | } catch (n) { | ||
450 | return e(new u(n, a)) | ||
451 | } | ||
452 | if (g.toCSS = function(d) { | ||
453 | return function(e, f) { | ||
454 | e = e || {}; | ||
455 | var g, h, i = new x.evalEnv(e); | ||
456 | "object" != typeof f || Array.isArray(f) || (f = Object.keys(f).map(function(a) { | ||
457 | var b = f[a]; | ||
458 | return b instanceof x.Value || (b instanceof x.Expression || (b = new x.Expression([b])), b = new x.Value([b])), new x.Rule("@" + a, b, !1, null, 0) | ||
459 | }), i.frames = [new x.Ruleset(null, f)]); | ||
460 | try { | ||
461 | var j, k = [], | ||
462 | l = [new x.joinSelectorVisitor, new x.processExtendsVisitor, new x.toCSSVisitor({ | ||
463 | compress: Boolean(e.compress) | ||
464 | })], | ||
465 | m = this; | ||
466 | if (e.plugins) | ||
467 | for (j = 0; j < e.plugins.length; j++) e.plugins[j].isPreEvalVisitor ? k.push(e.plugins[j]) : e.plugins[j].isPreVisitor ? l.splice(0, 0, e.plugins[j]) : l.push(e.plugins[j]); | ||
468 | for (j = 0; j < k.length; j++) k[j].run(m); | ||
469 | for (g = d.call(m, i), j = 0; j < l.length; j++) l[j].run(g); | ||
470 | e.sourceMap && (g = new x.sourceMapOutput({ | ||
471 | contentsIgnoredCharsMap: E.imports.contentsIgnoredChars, | ||
472 | writeSourceMap: e.writeSourceMap, | ||
473 | rootNode: g, | ||
474 | contentsMap: E.imports.contents, | ||
475 | sourceMapFilename: e.sourceMapFilename, | ||
476 | sourceMapURL: e.sourceMapURL, | ||
477 | outputFilename: e.sourceMapOutputFilename, | ||
478 | sourceMapBasepath: e.sourceMapBasepath, | ||
479 | sourceMapRootpath: e.sourceMapRootpath, | ||
480 | outputSourceFiles: e.outputSourceFiles, | ||
481 | sourceMapGenerator: e.sourceMapGenerator | ||
482 | })), h = g.toCSS({ | ||
483 | compress: Boolean(e.compress), | ||
484 | dumpLineNumbers: a.dumpLineNumbers, | ||
485 | strictUnits: Boolean(e.strictUnits), | ||
486 | numPrecision: 8 | ||
487 | }) | ||
488 | } catch (n) { | ||
489 | throw new u(n, a) | ||
490 | } | ||
491 | if (e.cleancss && "node" === w.mode) { | ||
492 | var o = c("clean-css"), | ||
493 | p = e.cleancssOptions || {}; | ||
494 | return p.keepSpecialComments === b && (p.keepSpecialComments = "*"), p.processImport = !1, p.noRebase = !0, p.noAdvanced === b && (p.noAdvanced = !0), new o(p).minify(h) | ||
495 | } | ||
496 | return e.compress ? h.replace(/(^(\s)+)|((\s)+$)/g, "") : h | ||
497 | } | ||
498 | }(g.eval), y < v.length - 1) { | ||
499 | y = A; | ||
500 | var o = s(y, v); | ||
501 | i = v.split("\n"), h = o.line + 1, l = { | ||
502 | type: "Parse", | ||
503 | message: "Unrecognised input", | ||
504 | index: y, | ||
505 | filename: a.currentFileInfo.filename, | ||
506 | line: h, | ||
507 | column: o.column, | ||
508 | extract: [i[h - 2], i[h - 1], i[h]] | ||
509 | } | ||
510 | } | ||
511 | var p = function(b) { | ||
512 | return b = l || b || E.imports.error, b ? (b instanceof u || (b = new u(b, a)), e(b)) : e(null, g) | ||
513 | }; | ||
514 | return a.processImports === !1 ? p() : void new x.importVisitor(this.imports, p).run(g) | ||
515 | }, | ||
516 | parsers: F = { | ||
517 | primary: function() { | ||
518 | for (var a, b = this.mixin, c = J, d = []; C;) { | ||
519 | if (a = this.extendRule() || b.definition() || this.rule() || this.ruleset() || b.call() || this.comment() || this.rulesetCall() || this.directive()) d.push(a); | ||
520 | else if (!c(/^[\s\n]+/) && !c(/^;+/)) break; | ||
521 | if (q("}")) break | ||
522 | } | ||
523 | return d | ||
524 | }, | ||
525 | comment: function() { | ||
526 | var b; | ||
527 | if ("/" === v.charAt(y)) return "/" === v.charAt(y + 1) ? new x.Comment(j(/^\/\/.*/), !0, y, a.currentFileInfo) : (b = j(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/), b ? new x.Comment(b, !1, y, a.currentFileInfo) : void 0) | ||
528 | }, | ||
529 | comments: function() { | ||
530 | for (var a, b = [];;) { | ||
531 | if (a = this.comment(), !a) break; | ||
532 | b.push(a) | ||
533 | } | ||
534 | return b | ||
535 | }, | ||
536 | entities: { | ||
537 | quoted: function() { | ||
538 | var b, c, d = y, | ||
539 | e = y; | ||
540 | return "~" === v.charAt(d) && (d++, c = !0), '"' === v.charAt(d) || "'" === v.charAt(d) ? (c && k("~"), b = j(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/), b ? new x.Quoted(b[0], b[1] || b[2], c, e, a.currentFileInfo) : void 0) : void 0 | ||
541 | }, | ||
542 | keyword: function() { | ||
543 | var a; | ||
544 | if (a = j(/^%|^[_A-Za-z-][_A-Za-z0-9-]*/)) { | ||
545 | var b = x.Color.fromKeyword(a); | ||
546 | return b ? b : new x.Keyword(a) | ||
547 | } | ||
548 | }, | ||
549 | call: function() { | ||
550 | var b, c, d, e, f = y; | ||
551 | if (b = /^([\w-]+|%|progid:[\w\.]+)\(/.exec(C)) { | ||
552 | if (b = b[1], c = b.toLowerCase(), "url" === c) return null; | ||
553 | if (y += b.length, "alpha" === c && (e = F.alpha(), "undefined" != typeof e)) return e; | ||
554 | if (k("("), d = this.arguments(), k(")")) return b ? new x.Call(b, d, f, a.currentFileInfo) : void 0 | ||
555 | } | ||
556 | }, | ||
557 | arguments: function() { | ||
558 | for (var a, b = [];;) { | ||
559 | if (a = this.assignment() || F.expression(), !a) break; | ||
560 | if (b.push(a), !k(",")) break | ||
561 | } | ||
562 | return b | ||
563 | }, | ||
564 | literal: function() { | ||
565 | return this.dimension() || this.color() || this.quoted() || this.unicodeDescriptor() | ||
566 | }, | ||
567 | assignment: function() { | ||
568 | var a, b; | ||
569 | return a = j(/^\w+(?=\s?=)/i), a && k("=") ? (b = F.entity(), b ? new x.Assignment(a, b) : void 0) : void 0 | ||
570 | }, | ||
571 | url: function() { | ||
572 | var b; | ||
573 | if ("u" === v.charAt(y) && j(/^url\(/)) return b = this.quoted() || this.variable() || j(/^(?:(?:\\[\(\)'"])|[^\(\)'"])+/) || "", n(")"), new x.URL(null != b.value || b instanceof x.Variable ? b : new x.Anonymous(b), a.currentFileInfo) | ||
574 | }, | ||
575 | variable: function() { | ||
576 | var b, c = y; | ||
577 | return "@" === v.charAt(y) && (b = j(/^@@?[\w-]+/)) ? new x.Variable(b, c, a.currentFileInfo) : void 0 | ||
578 | }, | ||
579 | variableCurly: function() { | ||
580 | var b, c = y; | ||
581 | return "@" === v.charAt(y) && (b = j(/^@\{([\w-]+)\}/)) ? new x.Variable("@" + b[1], c, a.currentFileInfo) : void 0 | ||
582 | }, | ||
583 | color: function() { | ||
584 | var a; | ||
585 | return "#" === v.charAt(y) && (a = j(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})/)) ? new x.Color(a[1]) : void 0 | ||
586 | }, | ||
587 | dimension: function() { | ||
588 | var a, b = v.charCodeAt(y); | ||
589 | if (!(b > 57 || 43 > b || 47 === b || 44 == b)) return a = j(/^([+-]?\d*\.?\d+)(%|[a-z]+)?/), a ? new x.Dimension(a[1], a[2]) : void 0 | ||
590 | }, | ||
591 | unicodeDescriptor: function() { | ||
592 | var a; | ||
593 | return a = j(/^U\+[0-9a-fA-F?]+(\-[0-9a-fA-F?]+)?/), a ? new x.UnicodeDescriptor(a[0]) : void 0 | ||
594 | }, | ||
595 | javascript: function() { | ||
596 | var c, d, e = y; | ||
597 | return "~" === v.charAt(e) && (e++, d = !0), "`" === v.charAt(e) ? (a.javascriptEnabled === b || a.javascriptEnabled || o("You are using JavaScript, which has been disabled."), d && k("~"), c = j(/^`([^`]*)`/), c ? new x.JavaScript(c[1], y, d) : void 0) : void 0 | ||
598 | } | ||
599 | }, | ||
600 | variable: function() { | ||
601 | var a; | ||
602 | return "@" === v.charAt(y) && (a = j(/^(@[\w-]+)\s*:/)) ? a[1] : void 0 | ||
603 | }, | ||
604 | rulesetCall: function() { | ||
605 | var a; | ||
606 | return "@" === v.charAt(y) && (a = j(/^(@[\w-]+)\s*\(\s*\)\s*;/)) ? new x.RulesetCall(a[1]) : void 0 | ||
607 | }, | ||
608 | extend: function(a) { | ||
609 | var b, c, d, e, f, g = y; | ||
610 | if (j(a ? /^&:extend\(/ : /^:extend\(/)) { | ||
611 | do { | ||
612 | for (d = null, b = null; !(d = j(/^(all)(?=\s*(\)|,))/)) && (c = this.element());) b ? b.push(c) : b = [c]; | ||
613 | d = d && d[1], f = new x.Extend(new x.Selector(b), d, g), e ? e.push(f) : e = [f] | ||
614 | } while (k(",")); | ||
615 | return m(/^\)/), a && m(/^;/), e | ||
616 | } | ||
617 | }, | ||
618 | extendRule: function() { | ||
619 | return this.extend(!0) | ||
620 | }, | ||
621 | mixin: { | ||
622 | call: function() { | ||
623 | var b, c, g, h, i, l, m = v.charAt(y), | ||
624 | o = !1, | ||
625 | p = y; | ||
626 | if ("." === m || "#" === m) { | ||
627 | for (d();;) { | ||
628 | if (b = y, h = j(/^[#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/), !h) break; | ||
629 | g = new x.Element(i, h, b, a.currentFileInfo), c ? c.push(g) : c = [g], i = k(">") | ||
630 | } | ||
631 | return c && (k("(") && (l = this.args(!0).args, n(")")), F.important() && (o = !0), F.end()) ? (f(), new x.mixin.Call(c, l, p, a.currentFileInfo, o)) : void e() | ||
632 | } | ||
633 | }, | ||
634 | args: function(a) { | ||
635 | var b, c, g, h, i, l, m = E.parsers, | ||
636 | n = m.entities, | ||
637 | p = { | ||
638 | args: null, | ||
639 | variadic: !1 | ||
640 | }, | ||
641 | q = [], | ||
642 | r = [], | ||
643 | s = []; | ||
644 | for (d();;) { | ||
645 | if (a) l = m.detachedRuleset() || m.expression(); | ||
646 | else { | ||
647 | if (m.comments(), "." === v.charAt(y) && j(/^\.{3}/)) { | ||
648 | p.variadic = !0, k(";") && !b && (b = !0), (b ? r : s).push({ | ||
649 | variadic: !0 | ||
650 | }); | ||
651 | break | ||
652 | } | ||
653 | l = n.variable() || n.literal() || n.keyword() | ||
654 | } if (!l) break; | ||
655 | h = null, l.throwAwayComments && l.throwAwayComments(), i = l; | ||
656 | var t = null; | ||
657 | if (a ? l.value && 1 == l.value.length && (t = l.value[0]) : t = l, t && t instanceof x.Variable) | ||
658 | if (k(":")) { | ||
659 | if (q.length > 0 && (b && o("Cannot mix ; and , as delimiter types"), c = !0), i = a && m.detachedRuleset() || m.expression(), !i) { | ||
660 | if (!a) return e(), p.args = [], p; | ||
661 | o("could not understand value for named argument") | ||
662 | } | ||
663 | h = g = t.name | ||
664 | } else { | ||
665 | if (!a && j(/^\.{3}/)) { | ||
666 | p.variadic = !0, k(";") && !b && (b = !0), (b ? r : s).push({ | ||
667 | name: l.name, | ||
668 | variadic: !0 | ||
669 | }); | ||
670 | break | ||
671 | } | ||
672 | a || (g = h = t.name, i = null) | ||
673 | } | ||
674 | i && q.push(i), s.push({ | ||
675 | name: h, | ||
676 | value: i | ||
677 | }), k(",") || (k(";") || b) && (c && o("Cannot mix ; and , as delimiter types"), b = !0, q.length > 1 && (i = new x.Value(q)), r.push({ | ||
678 | name: g, | ||
679 | value: i | ||
680 | }), g = null, q = [], c = !1) | ||
681 | } | ||
682 | return f(), p.args = b ? r : s, p | ||
683 | }, | ||
684 | definition: function() { | ||
685 | var a, b, c, g, h = [], | ||
686 | i = !1; | ||
687 | if (!("." !== v.charAt(y) && "#" !== v.charAt(y) || p(/^[^{]*\}/))) | ||
688 | if (d(), b = j(/^([#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\s*\(/)) { | ||
689 | a = b[1]; | ||
690 | var l = this.args(!1); | ||
691 | if (h = l.args, i = l.variadic, !k(")")) return A = y, void e(); | ||
692 | if (F.comments(), j(/^when/) && (g = m(F.conditions, "expected condition")), c = F.block()) return f(), new x.mixin.Definition(a, h, c, g, i); | ||
693 | e() | ||
694 | } else f() | ||
695 | } | ||
696 | }, | ||
697 | entity: function() { | ||
698 | var a = this.entities; | ||
699 | return a.literal() || a.variable() || a.url() || a.call() || a.keyword() || a.javascript() || this.comment() | ||
700 | }, | ||
701 | end: function() { | ||
702 | return k(";") || q("}") | ||
703 | }, | ||
704 | alpha: function() { | ||
705 | var a; | ||
706 | if (j(/^\(opacity=/i)) return a = j(/^\d+/) || this.entities.variable(), a ? (n(")"), new x.Alpha(a)) : void 0 | ||
707 | }, | ||
708 | element: function() { | ||
709 | var b, c, g, h = y; | ||
710 | return c = this.combinator(), b = j(/^(?:\d+\.\d+|\d+)%/) || j(/^(?:[.#]?|:*)(?:[\w-]|[^\x00-\x9f]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/) || k("*") || k("&") || this.attribute() || j(/^\([^()@]+\)/) || j(/^[\.#](?=@)/) || this.entities.variableCurly(), b || (d(), k("(") ? (g = this.selector()) && k(")") ? (b = new x.Paren(g), f()) : e() : f()), b ? new x.Element(c, b, h, a.currentFileInfo) : void 0 | ||
711 | }, | ||
712 | combinator: function() { | ||
713 | var a = v.charAt(y); | ||
714 | if (">" === a || "+" === a || "~" === a || "|" === a || "^" === a) { | ||
715 | for (y++, "^" === v.charAt(y) && (a = "^^", y++); h(v, y);) y++; | ||
716 | return new x.Combinator(a) | ||
717 | } | ||
718 | return new x.Combinator(h(v, y - 1) ? " " : null) | ||
719 | }, | ||
720 | lessSelector: function() { | ||
721 | return this.selector(!0) | ||
722 | }, | ||
723 | selector: function(b) { | ||
724 | for (var c, d, e, f, g, h, i, j = y, k = J; | ||
725 | (b && (g = this.extend()) || b && (h = k(/^when/)) || (f = this.element())) && (h ? i = m(this.conditions, "expected condition") : i ? o("CSS guard can only be used at the end of selector") : g ? d ? d.push(g) : d = [g] : (d && o("Extend can only be used at the end of selector"), e = v.charAt(y), c ? c.push(f) : c = [f], f = null), "{" !== e && "}" !== e && ";" !== e && "," !== e && ")" !== e);); | ||
726 | return c ? new x.Selector(c, d, i, j, a.currentFileInfo) : void(d && o("Extend must be used to extend a selector, it cannot be used on its own")) | ||
727 | }, | ||
728 | attribute: function() { | ||
729 | if (k("[")) { | ||
730 | var a, b, c, d = this.entities; | ||
731 | return (a = d.variableCurly()) || (a = m(/^(?:[_A-Za-z0-9-\*]*\|)?(?:[_A-Za-z0-9-]|\\.)+/)), c = j(/^[|~*$^]?=/), c && (b = d.quoted() || j(/^[0-9]+%/) || j(/^[\w-]+/) || d.variableCurly()), n("]"), new x.Attribute(a, c, b) | ||
732 | } | ||
733 | }, | ||
734 | block: function() { | ||
735 | var a; | ||
736 | return k("{") && (a = this.primary()) && k("}") ? a : void 0 | ||
737 | }, | ||
738 | blockRuleset: function() { | ||
739 | var a = this.block(); | ||
740 | return a && (a = new x.Ruleset(null, a)), a | ||
741 | }, | ||
742 | detachedRuleset: function() { | ||
743 | var a = this.blockRuleset(); | ||
744 | return a ? new x.DetachedRuleset(a) : void 0 | ||
745 | }, | ||
746 | ruleset: function() { | ||
747 | var b, c, g, h; | ||
748 | for (d(), a.dumpLineNumbers && (h = t(y, v, a));;) { | ||
749 | if (c = this.lessSelector(), !c) break; | ||
750 | if (b ? b.push(c) : b = [c], this.comments(), c.condition && b.length > 1 && o("Guards are only currently allowed on a single selector."), !k(",")) break; | ||
751 | c.condition && o("Guards are only currently allowed on a single selector."), this.comments() | ||
752 | } | ||
753 | if (b && (g = this.block())) { | ||
754 | f(); | ||
755 | var i = new x.Ruleset(b, g, a.strictImports); | ||
756 | return a.dumpLineNumbers && (i.debugInfo = h), i | ||
757 | } | ||
758 | A = y, e() | ||
759 | }, | ||
760 | rule: function(b) { | ||
761 | var c, g, h, i, j, k = y, | ||
762 | l = v.charAt(k); | ||
763 | if ("." !== l && "#" !== l && "&" !== l) | ||
764 | if (d(), c = this.variable() || this.ruleProperty()) { | ||
765 | if (j = "string" == typeof c, j && (g = this.detachedRuleset()), g || (g = b || !a.compress && !j ? this.anonymousValue() || this.value() : this.value() || this.anonymousValue(), h = this.important(), i = !j && c.pop().value), g && this.end()) return f(), new x.Rule(c, g, h, i, k, a.currentFileInfo); | ||
766 | if (A = y, e(), g && !b) return this.rule(!0) | ||
767 | } else f() | ||
768 | }, | ||
769 | anonymousValue: function() { | ||
770 | var a; | ||
771 | return a = /^([^@+\/'"*`(;{}-]*);/.exec(C), a ? (y += a[0].length - 1, new x.Anonymous(a[1])) : void 0 | ||
772 | }, | ||
773 | "import": function() { | ||
774 | var b, c, g = y; | ||
775 | d(); | ||
776 | var h = j(/^@import?\s+/), | ||
777 | i = (h ? this.importOptions() : null) || {}; | ||
778 | return h && (b = this.entities.quoted() || this.entities.url()) && (c = this.mediaFeatures(), k(";")) ? (f(), c = c && new x.Value(c), new x.Import(b, c, i, g, a.currentFileInfo)) : void e() | ||
779 | }, | ||
780 | importOptions: function() { | ||
781 | var a, b, c, d = {}; | ||
782 | if (!k("(")) return null; | ||
783 | do | ||
784 | if (a = this.importOption()) { | ||
785 | switch (b = a, c = !0, b) { | ||
786 | case "css": | ||
787 | b = "less", c = !1; | ||
788 | break; | ||
789 | case "once": | ||
790 | b = "multiple", c = !1 | ||
791 | } | ||
792 | if (d[b] = c, !k(",")) break | ||
793 | } | ||
794 | while (a); | ||
795 | return n(")"), d | ||
796 | }, | ||
797 | importOption: function() { | ||
798 | var a = j(/^(less|css|multiple|once|inline|reference)/); | ||
799 | return a ? a[1] : void 0 | ||
800 | }, | ||
801 | mediaFeature: function() { | ||
802 | var b, c, d = this.entities, | ||
803 | e = []; | ||
804 | do | ||
805 | if (b = d.keyword() || d.variable()) e.push(b); | ||
806 | else if (k("(")) { | ||
807 | if (c = this.property(), b = this.value(), !k(")")) return null; | ||
808 | if (c && b) e.push(new x.Paren(new x.Rule(c, b, null, null, y, a.currentFileInfo, !0))); | ||
809 | else { | ||
810 | if (!b) return null; | ||
811 | e.push(new x.Paren(b)) | ||
812 | } | ||
813 | } while (b); | ||
814 | return e.length > 0 ? new x.Expression(e) : void 0 | ||
815 | }, | ||
816 | mediaFeatures: function() { | ||
817 | var a, b = this.entities, | ||
818 | c = []; | ||
819 | do | ||
820 | if (a = this.mediaFeature()) { | ||
821 | if (c.push(a), !k(",")) break | ||
822 | } else if (a = b.variable(), a && (c.push(a), !k(","))) break; while (a); | ||
823 | return c.length > 0 ? c : null | ||
824 | }, | ||
825 | media: function() { | ||
826 | var b, c, d, e; | ||
827 | return a.dumpLineNumbers && (e = t(y, v, a)), j(/^@media/) && (b = this.mediaFeatures(), c = this.block()) ? (d = new x.Media(c, b, y, a.currentFileInfo), a.dumpLineNumbers && (d.debugInfo = e), d) : void 0 | ||
828 | }, | ||
829 | directive: function() { | ||
830 | var b, c, g, h, i, l, m, n = y, | ||
831 | p = !0; | ||
832 | if ("@" === v.charAt(y)) { | ||
833 | if (c = this["import"]() || this.media()) return c; | ||
834 | if (d(), b = j(/^@[a-z-]+/)) { | ||
835 | switch (h = b, "-" == b.charAt(1) && b.indexOf("-", 2) > 0 && (h = "@" + b.slice(b.indexOf("-", 2) + 1)), h) { | ||
836 | case "@charset": | ||
837 | i = !0, p = !1; | ||
838 | break; | ||
839 | case "@namespace": | ||
840 | l = !0, p = !1; | ||
841 | break; | ||
842 | case "@keyframes": | ||
843 | i = !0; | ||
844 | break; | ||
845 | case "@host": | ||
846 | case "@page": | ||
847 | case "@document": | ||
848 | case "@supports": | ||
849 | m = !0 | ||
850 | } | ||
851 | return i ? (c = this.entity(), c || o("expected " + b + " identifier")) : l ? (c = this.expression(), c || o("expected " + b + " expression")) : m && (c = (j(/^[^{;]+/) || "").trim(), c && (c = new x.Anonymous(c))), p && (g = this.blockRuleset()), g || !p && c && k(";") ? (f(), new x.Directive(b, c, g, n, a.currentFileInfo, a.dumpLineNumbers ? t(n, v, a) : null)) : void e() | ||
852 | } | ||
853 | } | ||
854 | }, | ||
855 | value: function() { | ||
856 | var a, b = []; | ||
857 | do | ||
858 | if (a = this.expression(), a && (b.push(a), !k(","))) break; | ||
859 | while (a); | ||
860 | return b.length > 0 ? new x.Value(b) : void 0 | ||
861 | }, | ||
862 | important: function() { | ||
863 | return "!" === v.charAt(y) ? j(/^! *important/) : void 0 | ||
864 | }, | ||
865 | sub: function() { | ||
866 | var a, b; | ||
867 | return k("(") && (a = this.addition()) ? (b = new x.Expression([a]), n(")"), b.parens = !0, b) : void 0 | ||
868 | }, | ||
869 | multiplication: function() { | ||
870 | var a, b, c, d, e; | ||
871 | if (a = this.operand()) { | ||
872 | for (e = h(v, y - 1);;) { | ||
873 | if (p(/^\/[*\/]/)) break; | ||
874 | if (c = k("/") || k("*"), !c) break; | ||
875 | if (b = this.operand(), !b) break; | ||
876 | a.parensInOp = !0, b.parensInOp = !0, d = new x.Operation(c, [d || a, b], e), e = h(v, y - 1) | ||
877 | } | ||
878 | return d || a | ||
879 | } | ||
880 | }, | ||
881 | addition: function() { | ||
882 | var a, b, c, d, e; | ||
883 | if (a = this.multiplication()) { | ||
884 | for (e = h(v, y - 1);;) { | ||
885 | if (c = j(/^[-+]\s+/) || !e && (k("+") || k("-")), !c) break; | ||
886 | if (b = this.multiplication(), !b) break; | ||
887 | a.parensInOp = !0, b.parensInOp = !0, d = new x.Operation(c, [d || a, b], e), e = h(v, y - 1) | ||
888 | } | ||
889 | return d || a | ||
890 | } | ||
891 | }, | ||
892 | conditions: function() { | ||
893 | var a, b, c, d = y; | ||
894 | if (a = this.condition()) { | ||
895 | for (;;) { | ||
896 | if (!p(/^,\s*(not\s*)?\(/) || !k(",")) break; | ||
897 | if (b = this.condition(), !b) break; | ||
898 | c = new x.Condition("or", c || a, b, d) | ||
899 | } | ||
900 | return c || a | ||
901 | } | ||
902 | }, | ||
903 | condition: function() { | ||
904 | var a, b, c, d, e = this.entities, | ||
905 | f = y, | ||
906 | g = !1; | ||
907 | return j(/^not/) && (g = !0), n("("), a = this.addition() || e.keyword() || e.quoted(), a ? (d = j(/^(?:>=|<=|=<|[<=>])/), d ? (b = this.addition() || e.keyword() || e.quoted(), b ? c = new x.Condition(d, a, b, f, g) : o("expected expression")) : c = new x.Condition("=", a, new x.Keyword("true"), f, g), n(")"), j(/^and/) ? new x.Condition("and", c, this.condition()) : c) : void 0 | ||
908 | }, | ||
909 | operand: function() { | ||
910 | var a, b = this.entities, | ||
911 | c = v.charAt(y + 1); | ||
912 | "-" !== v.charAt(y) || "@" !== c && "(" !== c || (a = k("-")); | ||
913 | var d = this.sub() || b.dimension() || b.color() || b.variable() || b.call(); | ||
914 | return a && (d.parensInOp = !0, d = new x.Negative(d)), d | ||
915 | }, | ||
916 | expression: function() { | ||
917 | var a, b, c = []; | ||
918 | do a = this.addition() || this.entity(), a && (c.push(a), p(/^\/[\/*]/) || (b = k("/"), b && c.push(new x.Anonymous(b)))); while (a); | ||
919 | return c.length > 0 ? new x.Expression(c) : void 0 | ||
920 | }, | ||
921 | property: function() { | ||
922 | var a = j(/^(\*?-?[_a-zA-Z0-9-]+)\s*:/); | ||
923 | return a ? a[1] : void 0 | ||
924 | }, | ||
925 | ruleProperty: function() { | ||
926 | function b(a) { | ||
927 | var b = a.exec(e); | ||
928 | return b ? (g.push(y + h), h += b[0].length, e = e.slice(b[1].length), f.push(b[1])) : void 0 | ||
929 | } | ||
930 | var c, d, e = C, | ||
931 | f = [], | ||
932 | g = [], | ||
933 | h = 0; | ||
934 | for (b(/^(\*?)/); b(/^((?:[\w-]+)|(?:@\{[\w-]+\}))/);); | ||
935 | if (f.length > 1 && b(/^\s*((?:\+_|\+)?)\s*:/)) { | ||
936 | for (l(h), "" === f[0] && (f.shift(), g.shift()), d = 0; d < f.length; d++) c = f[d], f[d] = "@" !== c.charAt(0) ? new x.Keyword(c) : new x.Variable("@" + c.slice(2, -1), g[d], a.currentFileInfo); | ||
937 | return f | ||
938 | } | ||
939 | } | ||
940 | } | ||
941 | } | ||
942 | }, w.Parser.serializeVars = function(a) { | ||
943 | var b = ""; | ||
944 | for (var c in a) | ||
945 | if (Object.hasOwnProperty.call(a, c)) { | ||
946 | var d = a[c]; | ||
947 | b += ("@" === c[0] ? "" : "@") + c + ": " + d + (";" === ("" + d).slice(-1) ? "" : ";") | ||
948 | } | ||
949 | return b | ||
950 | }, | ||
951 | function(d) { | ||
952 | function e(a, b, c) { | ||
953 | if (!(c instanceof d.Dimension)) throw { | ||
954 | type: "Argument", | ||
955 | message: "argument must be a number" | ||
956 | }; | ||
957 | return null == b ? b = c.unit : c = c.unify(), new d.Dimension(a(parseFloat(c.value)), b) | ||
958 | } | ||
959 | |||
960 | function f(a, b, c) { | ||
961 | var e, f, g, h, i = b.alpha, | ||
962 | j = c.alpha, | ||
963 | k = []; | ||
964 | g = j + i * (1 - j); | ||
965 | for (var l = 0; 3 > l; l++) e = b.rgb[l] / 255, f = c.rgb[l] / 255, h = a(e, f), g && (h = (j * f + i * (e - j * (e + f - h))) / g), k[l] = 255 * h; | ||
966 | return new d.Color(k, g) | ||
967 | } | ||
968 | |||
969 | function g() { | ||
970 | var a, b = d.functions; | ||
971 | for (a in l) l.hasOwnProperty(a) && (b[a] = e.bind(null, Math[a], l[a])); | ||
972 | for (a in m) m.hasOwnProperty(a) && (b[a] = f.bind(null, m[a])); | ||
973 | a = d.defaultFunc, b["default"] = a.eval.bind(a) | ||
974 | } | ||
975 | |||
976 | function h(a) { | ||
977 | return d.functions.hsla(a.h, a.s, a.l, a.a) | ||
978 | } | ||
979 | |||
980 | function i(a, b) { | ||
981 | return a instanceof d.Dimension && a.unit.is("%") ? parseFloat(a.value * b / 100) : j(a) | ||
982 | } | ||
983 | |||
984 | function j(a) { | ||
985 | if (a instanceof d.Dimension) return parseFloat(a.unit.is("%") ? a.value / 100 : a.value); | ||
986 | if ("number" == typeof a) return a; | ||
987 | throw { | ||
988 | error: "RuntimeError", | ||
989 | message: "color functions take numbers as parameters" | ||
990 | } | ||
991 | } | ||
992 | |||
993 | function k(a) { | ||
994 | return Math.min(1, Math.max(0, a)) | ||
995 | } | ||
996 | d.functions = { | ||
997 | rgb: function(a, b, c) { | ||
998 | return this.rgba(a, b, c, 1) | ||
999 | }, | ||
1000 | rgba: function(a, b, c, e) { | ||
1001 | var f = [a, b, c].map(function(a) { | ||
1002 | return i(a, 255) | ||
1003 | }); | ||
1004 | return e = j(e), new d.Color(f, e) | ||
1005 | }, | ||
1006 | hsl: function(a, b, c) { | ||
1007 | return this.hsla(a, b, c, 1) | ||
1008 | }, | ||
1009 | hsla: function(a, b, c, d) { | ||
1010 | function e(a) { | ||
1011 | return a = 0 > a ? a + 1 : a > 1 ? a - 1 : a, 1 > 6 * a ? g + (f - g) * a * 6 : 1 > 2 * a ? f : 2 > 3 * a ? g + (f - g) * (2 / 3 - a) * 6 : g | ||
1012 | } | ||
1013 | a = j(a) % 360 / 360, b = k(j(b)), c = k(j(c)), d = k(j(d)); | ||
1014 | var f = .5 >= c ? c * (b + 1) : c + b - c * b, | ||
1015 | g = 2 * c - f; | ||
1016 | return this.rgba(255 * e(a + 1 / 3), 255 * e(a), 255 * e(a - 1 / 3), d) | ||
1017 | }, | ||
1018 | hsv: function(a, b, c) { | ||
1019 | return this.hsva(a, b, c, 1) | ||
1020 | }, | ||
1021 | hsva: function(a, b, c, d) { | ||
1022 | a = j(a) % 360 / 360 * 360, b = j(b), c = j(c), d = j(d); | ||
1023 | var e, f; | ||
1024 | e = Math.floor(a / 60 % 6), f = a / 60 - e; | ||
1025 | var g = [c, c * (1 - b), c * (1 - f * b), c * (1 - (1 - f) * b)], | ||
1026 | h = [ | ||
1027 | [0, 3, 1], | ||
1028 | [2, 0, 1], | ||
1029 | [1, 0, 3], | ||
1030 | [1, 2, 0], | ||
1031 | [3, 1, 0], | ||
1032 | [0, 1, 2] | ||
1033 | ]; | ||
1034 | return this.rgba(255 * g[h[e][0]], 255 * g[h[e][1]], 255 * g[h[e][2]], d) | ||
1035 | }, | ||
1036 | hue: function(a) { | ||
1037 | return new d.Dimension(Math.round(a.toHSL().h)) | ||
1038 | }, | ||
1039 | saturation: function(a) { | ||
1040 | return new d.Dimension(Math.round(100 * a.toHSL().s), "%") | ||
1041 | }, | ||
1042 | lightness: function(a) { | ||
1043 | return new d.Dimension(Math.round(100 * a.toHSL().l), "%") | ||
1044 | }, | ||
1045 | hsvhue: function(a) { | ||
1046 | return new d.Dimension(Math.round(a.toHSV().h)) | ||
1047 | }, | ||
1048 | hsvsaturation: function(a) { | ||
1049 | return new d.Dimension(Math.round(100 * a.toHSV().s), "%") | ||
1050 | }, | ||
1051 | hsvvalue: function(a) { | ||
1052 | return new d.Dimension(Math.round(100 * a.toHSV().v), "%") | ||
1053 | }, | ||
1054 | red: function(a) { | ||
1055 | return new d.Dimension(a.rgb[0]) | ||
1056 | }, | ||
1057 | green: function(a) { | ||
1058 | return new d.Dimension(a.rgb[1]) | ||
1059 | }, | ||
1060 | blue: function(a) { | ||
1061 | return new d.Dimension(a.rgb[2]) | ||
1062 | }, | ||
1063 | alpha: function(a) { | ||
1064 | return new d.Dimension(a.toHSL().a) | ||
1065 | }, | ||
1066 | luma: function(a) { | ||
1067 | return new d.Dimension(Math.round(a.luma() * a.alpha * 100), "%") | ||
1068 | }, | ||
1069 | luminance: function(a) { | ||
1070 | var b = .2126 * a.rgb[0] / 255 + .7152 * a.rgb[1] / 255 + .0722 * a.rgb[2] / 255; | ||
1071 | return new d.Dimension(Math.round(b * a.alpha * 100), "%") | ||
1072 | }, | ||
1073 | saturate: function(a, b) { | ||
1074 | if (!a.rgb) return null; | ||
1075 | var c = a.toHSL(); | ||
1076 | return c.s += b.value / 100, c.s = k(c.s), h(c) | ||
1077 | }, | ||
1078 | desaturate: function(a, b) { | ||
1079 | var c = a.toHSL(); | ||
1080 | return c.s -= b.value / 100, c.s = k(c.s), h(c) | ||
1081 | }, | ||
1082 | lighten: function(a, b) { | ||
1083 | var c = a.toHSL(); | ||
1084 | return c.l += b.value / 100, c.l = k(c.l), h(c) | ||
1085 | }, | ||
1086 | darken: function(a, b) { | ||
1087 | var c = a.toHSL(); | ||
1088 | return c.l -= b.value / 100, c.l = k(c.l), h(c) | ||
1089 | }, | ||
1090 | fadein: function(a, b) { | ||
1091 | var c = a.toHSL(); | ||
1092 | return c.a += b.value / 100, c.a = k(c.a), h(c) | ||
1093 | }, | ||
1094 | fadeout: function(a, b) { | ||
1095 | var c = a.toHSL(); | ||
1096 | return c.a -= b.value / 100, c.a = k(c.a), h(c) | ||
1097 | }, | ||
1098 | fade: function(a, b) { | ||
1099 | var c = a.toHSL(); | ||
1100 | return c.a = b.value / 100, c.a = k(c.a), h(c) | ||
1101 | }, | ||
1102 | spin: function(a, b) { | ||
1103 | var c = a.toHSL(), | ||
1104 | d = (c.h + b.value) % 360; | ||
1105 | return c.h = 0 > d ? 360 + d : d, h(c) | ||
1106 | }, | ||
1107 | mix: function(a, b, c) { | ||
1108 | c || (c = new d.Dimension(50)); | ||
1109 | var e = c.value / 100, | ||
1110 | f = 2 * e - 1, | ||
1111 | g = a.toHSL().a - b.toHSL().a, | ||
1112 | h = ((f * g == -1 ? f : (f + g) / (1 + f * g)) + 1) / 2, | ||
1113 | i = 1 - h, | ||
1114 | j = [a.rgb[0] * h + b.rgb[0] * i, a.rgb[1] * h + b.rgb[1] * i, a.rgb[2] * h + b.rgb[2] * i], | ||
1115 | k = a.alpha * e + b.alpha * (1 - e); | ||
1116 | return new d.Color(j, k) | ||
1117 | }, | ||
1118 | greyscale: function(a) { | ||
1119 | return this.desaturate(a, new d.Dimension(100)) | ||
1120 | }, | ||
1121 | contrast: function(a, b, c, d) { | ||
1122 | if (!a.rgb) return null; | ||
1123 | if ("undefined" == typeof c && (c = this.rgba(255, 255, 255, 1)), "undefined" == typeof b && (b = this.rgba(0, 0, 0, 1)), b.luma() > c.luma()) { | ||
1124 | var e = c; | ||
1125 | c = b, b = e | ||
1126 | } | ||
1127 | return d = "undefined" == typeof d ? .43 : j(d), a.luma() < d ? c : b | ||
1128 | }, | ||
1129 | e: function(a) { | ||
1130 | return new d.Anonymous(a instanceof d.JavaScript ? a.evaluated : a) | ||
1131 | }, | ||
1132 | escape: function(a) { | ||
1133 | return new d.Anonymous(encodeURI(a.value).replace(/=/g, "%3D").replace(/:/g, "%3A").replace(/#/g, "%23").replace(/;/g, "%3B").replace(/\(/g, "%28").replace(/\)/g, "%29")) | ||
1134 | }, | ||
1135 | replace: function(a, b, c, e) { | ||
1136 | var f = a.value; | ||
1137 | return f = f.replace(new RegExp(b.value, e ? e.value : ""), c.value), new d.Quoted(a.quote || "", f, a.escaped) | ||
1138 | }, | ||
1139 | "%": function(a) { | ||
1140 | for (var b = Array.prototype.slice.call(arguments, 1), c = a.value, e = 0; e < b.length; e++) c = c.replace(/%[sda]/i, function(a) { | ||
1141 | var c = a.match(/s/i) ? b[e].value : b[e].toCSS(); | ||
1142 | return a.match(/[A-Z]$/) ? encodeURIComponent(c) : c | ||
1143 | }); | ||
1144 | return c = c.replace(/%%/g, "%"), new d.Quoted(a.quote || "", c, a.escaped) | ||
1145 | }, | ||
1146 | unit: function(a, b) { | ||
1147 | if (!(a instanceof d.Dimension)) throw { | ||
1148 | type: "Argument", | ||
1149 | message: "the first argument to unit must be a number" + (a instanceof d.Operation ? ". Have you forgotten parenthesis?" : "") | ||
1150 | }; | ||
1151 | return b = b ? b instanceof d.Keyword ? b.value : b.toCSS() : "", new d.Dimension(a.value, b) | ||
1152 | }, | ||
1153 | convert: function(a, b) { | ||
1154 | return a.convertTo(b.value) | ||
1155 | }, | ||
1156 | round: function(a, b) { | ||
1157 | var c = "undefined" == typeof b ? 0 : b.value; | ||
1158 | return e(function(a) { | ||
1159 | return a.toFixed(c) | ||
1160 | }, null, a) | ||
1161 | }, | ||
1162 | pi: function() { | ||
1163 | return new d.Dimension(Math.PI) | ||
1164 | }, | ||
1165 | mod: function(a, b) { | ||
1166 | return new d.Dimension(a.value % b.value, a.unit) | ||
1167 | }, | ||
1168 | pow: function(a, b) { | ||
1169 | if ("number" == typeof a && "number" == typeof b) a = new d.Dimension(a), b = new d.Dimension(b); | ||
1170 | else if (!(a instanceof d.Dimension && b instanceof d.Dimension)) throw { | ||
1171 | type: "Argument", | ||
1172 | message: "arguments must be numbers" | ||
1173 | }; | ||
1174 | return new d.Dimension(Math.pow(a.value, b.value), a.unit) | ||
1175 | }, | ||
1176 | _minmax: function(a, c) { | ||
1177 | switch (c = Array.prototype.slice.call(c), c.length) { | ||
1178 | case 0: | ||
1179 | throw { | ||
1180 | type: "Argument", | ||
1181 | message: "one or more arguments required" | ||
1182 | } | ||
1183 | } | ||
1184 | var e, f, g, h, i, j, k, l, m = [], | ||
1185 | n = {}; | ||
1186 | for (e = 0; e < c.length; e++) | ||
1187 | if (g = c[e], g instanceof d.Dimension) | ||
1188 | if (h = "" === g.unit.toString() && l !== b ? new d.Dimension(g.value, l).unify() : g.unify(), j = "" === h.unit.toString() && k !== b ? k : h.unit.toString(), k = "" !== j && k === b || "" !== j && "" === m[0].unify().unit.toString() ? j : k, l = "" !== j && l === b ? g.unit.toString() : l, f = n[""] !== b && "" !== j && j === k ? n[""] : n[j], f !== b) i = "" === m[f].unit.toString() && l !== b ? new d.Dimension(m[f].value, l).unify() : m[f].unify(), (a && h.value < i.value || !a && h.value > i.value) && (m[f] = g); | ||
1189 | else { | ||
1190 | if (k !== b && j !== k) throw { | ||
1191 | type: "Argument", | ||
1192 | message: "incompatible types" | ||
1193 | }; | ||
1194 | n[j] = m.length, m.push(g) | ||
1195 | } else Array.isArray(c[e].value) && Array.prototype.push.apply(c, Array.prototype.slice.call(c[e].value)); | ||
1196 | return 1 == m.length ? m[0] : (c = m.map(function(a) { | ||
1197 | return a.toCSS(this.env) | ||
1198 | }).join(this.env.compress ? "," : ", "), new d.Anonymous((a ? "min" : "max") + "(" + c + ")")) | ||
1199 | }, | ||
1200 | min: function() { | ||
1201 | return this._minmax(!0, arguments) | ||
1202 | }, | ||
1203 | max: function() { | ||
1204 | return this._minmax(!1, arguments) | ||
1205 | }, | ||
1206 | "get-unit": function(a) { | ||
1207 | return new d.Anonymous(a.unit) | ||
1208 | }, | ||
1209 | argb: function(a) { | ||
1210 | return new d.Anonymous(a.toARGB()) | ||
1211 | }, | ||
1212 | percentage: function(a) { | ||
1213 | return new d.Dimension(100 * a.value, "%") | ||
1214 | }, | ||
1215 | color: function(a) { | ||
1216 | if (a instanceof d.Quoted) { | ||
1217 | var b, c = a.value; | ||
1218 | if (b = d.Color.fromKeyword(c)) return b; | ||
1219 | if (/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})/.test(c)) return new d.Color(c.slice(1)); | ||
1220 | throw { | ||
1221 | type: "Argument", | ||
1222 | message: "argument must be a color keyword or 3/6 digit hex e.g. #FFF" | ||
1223 | } | ||
1224 | } | ||
1225 | throw { | ||
1226 | type: "Argument", | ||
1227 | message: "argument must be a string" | ||
1228 | } | ||
1229 | }, | ||
1230 | iscolor: function(a) { | ||
1231 | return this._isa(a, d.Color) | ||
1232 | }, | ||
1233 | isnumber: function(a) { | ||
1234 | return this._isa(a, d.Dimension) | ||
1235 | }, | ||
1236 | isstring: function(a) { | ||
1237 | return this._isa(a, d.Quoted) | ||
1238 | }, | ||
1239 | iskeyword: function(a) { | ||
1240 | return this._isa(a, d.Keyword) | ||
1241 | }, | ||
1242 | isurl: function(a) { | ||
1243 | return this._isa(a, d.URL) | ||
1244 | }, | ||
1245 | ispixel: function(a) { | ||
1246 | return this.isunit(a, "px") | ||
1247 | }, | ||
1248 | ispercentage: function(a) { | ||
1249 | return this.isunit(a, "%") | ||
1250 | }, | ||
1251 | isem: function(a) { | ||
1252 | return this.isunit(a, "em") | ||
1253 | }, | ||
1254 | isunit: function(a, b) { | ||
1255 | return a instanceof d.Dimension && a.unit.is(b.value || b) ? d.True : d.False | ||
1256 | }, | ||
1257 | _isa: function(a, b) { | ||
1258 | return a instanceof b ? d.True : d.False | ||
1259 | }, | ||
1260 | tint: function(a, b) { | ||
1261 | return this.mix(this.rgb(255, 255, 255), a, b) | ||
1262 | }, | ||
1263 | shade: function(a, b) { | ||
1264 | return this.mix(this.rgb(0, 0, 0), a, b) | ||
1265 | }, | ||
1266 | extract: function(a, b) { | ||
1267 | return b = b.value - 1, Array.isArray(a.value) ? a.value[b] : Array(a)[b] | ||
1268 | }, | ||
1269 | length: function(a) { | ||
1270 | var b = Array.isArray(a.value) ? a.value.length : 1; | ||
1271 | return new d.Dimension(b) | ||
1272 | }, | ||
1273 | "data-uri": function(b, e) { | ||
1274 | if ("undefined" != typeof a) return new d.URL(e || b, this.currentFileInfo).eval(this.env); | ||
1275 | var f = b.value, | ||
1276 | g = e && e.value, | ||
1277 | h = c("fs"), | ||
1278 | i = c("path"), | ||
1279 | j = !1; | ||
1280 | if (arguments.length < 2 && (g = f), this.env.isPathRelative(g) && (g = this.currentFileInfo.relativeUrls ? i.join(this.currentFileInfo.currentDirectory, g) : i.join(this.currentFileInfo.entryPath, g)), arguments.length < 2) { | ||
1281 | var k; | ||
1282 | try { | ||
1283 | k = c("mime") | ||
1284 | } catch (l) { | ||
1285 | k = d._mime | ||
1286 | } | ||
1287 | f = k.lookup(g); | ||
1288 | var m = k.charsets.lookup(f); | ||
1289 | j = ["US-ASCII", "UTF-8"].indexOf(m) < 0, j && (f += ";base64") | ||
1290 | } else j = /;base64$/.test(f); | ||
1291 | var n = h.readFileSync(g), | ||
1292 | o = 32, | ||
1293 | p = parseInt(n.length / 1024, 10); | ||
1294 | if (p >= o && this.env.ieCompat !== !1) return this.env.silent || console.warn("Skipped data-uri embedding of %s because its size (%dKB) exceeds IE8-safe %dKB!", g, p, o), new d.URL(e || b, this.currentFileInfo).eval(this.env); | ||
1295 | n = j ? n.toString("base64") : encodeURIComponent(n); | ||
1296 | var q = '"data:' + f + "," + n + '"'; | ||
1297 | return new d.URL(new d.Anonymous(q)) | ||
1298 | }, | ||
1299 | "svg-gradient": function(a) { | ||
1300 | function e() { | ||
1301 | throw { | ||
1302 | type: "Argument", | ||
1303 | message: "svg-gradient expects direction, start_color [start_position], [color position,]..., end_color [end_position]" | ||
1304 | } | ||
1305 | } | ||
1306 | arguments.length < 3 && e(); | ||
1307 | var f, g, h, i, j, k, l, m = Array.prototype.slice.call(arguments, 1), | ||
1308 | n = "linear", | ||
1309 | o = 'x="0" y="0" width="1" height="1"', | ||
1310 | p = !0, | ||
1311 | q = { | ||
1312 | compress: !1 | ||
1313 | }, | ||
1314 | r = a.toCSS(q); | ||
1315 | switch (r) { | ||
1316 | case "to bottom": | ||
1317 | f = 'x1="0%" y1="0%" x2="0%" y2="100%"'; | ||
1318 | break; | ||
1319 | case "to right": | ||
1320 | f = 'x1="0%" y1="0%" x2="100%" y2="0%"'; | ||
1321 | break; | ||
1322 | case "to bottom right": | ||
1323 | f = 'x1="0%" y1="0%" x2="100%" y2="100%"'; | ||
1324 | break; | ||
1325 | case "to top right": | ||
1326 | f = 'x1="0%" y1="100%" x2="100%" y2="0%"'; | ||
1327 | break; | ||
1328 | case "ellipse": | ||
1329 | case "ellipse at center": | ||
1330 | n = "radial", f = 'cx="50%" cy="50%" r="75%"', o = 'x="-50" y="-50" width="101" height="101"'; | ||
1331 | break; | ||
1332 | default: | ||
1333 | throw { | ||
1334 | type: "Argument", | ||
1335 | message: "svg-gradient direction must be 'to bottom', 'to right', 'to bottom right', 'to top right' or 'ellipse at center'" | ||
1336 | } | ||
1337 | } | ||
1338 | for (g = '<?xml version="1.0" ?><svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100%" height="100%" viewBox="0 0 1 1" preserveAspectRatio="none"><' + n + 'Gradient id="gradient" gradientUnits="userSpaceOnUse" ' + f + ">", h = 0; h < m.length; h += 1) m[h].value ? (i = m[h].value[0], j = m[h].value[1]) : (i = m[h], j = b), i instanceof d.Color && ((0 === h || h + 1 === m.length) && j === b || j instanceof d.Dimension) || e(), k = j ? j.toCSS(q) : 0 === h ? "0%" : "100%", l = i.alpha, g += '<stop offset="' + k + '" stop-color="' + i.toRGB() + '"' + (1 > l ? ' stop-opacity="' + l + '"' : "") + "/>"; | ||
1339 | if (g += "</" + n + "Gradient><rect " + o + ' fill="url(#gradient)" /></svg>', p) try { | ||
1340 | g = c("./encoder").encodeBase64(g) | ||
1341 | } catch (s) { | ||
1342 | p = !1 | ||
1343 | } | ||
1344 | return g = "'data:image/svg+xml" + (p ? ";base64" : "") + "," + g + "'", new d.URL(new d.Anonymous(g)) | ||
1345 | } | ||
1346 | }, d._mime = { | ||
1347 | _types: { | ||
1348 | ".htm": "text/html", | ||
1349 | ".html": "text/html", | ||
1350 | ".gif": "image/gif", | ||
1351 | ".jpg": "image/jpeg", | ||
1352 | ".jpeg": "image/jpeg", | ||
1353 | ".png": "image/png" | ||
1354 | }, | ||
1355 | lookup: function(a) { | ||
1356 | var e = c("path").extname(a), | ||
1357 | f = d._mime._types[e]; | ||
1358 | if (f === b) throw new Error('Optional dependency "mime" is required for ' + e); | ||
1359 | return f | ||
1360 | }, | ||
1361 | charsets: { | ||
1362 | lookup: function(a) { | ||
1363 | return a && /^text\//.test(a) ? "UTF-8" : "" | ||
1364 | } | ||
1365 | } | ||
1366 | }; | ||
1367 | var l = { | ||
1368 | ceil: null, | ||
1369 | floor: null, | ||
1370 | sqrt: null, | ||
1371 | abs: null, | ||
1372 | tan: "", | ||
1373 | sin: "", | ||
1374 | cos: "", | ||
1375 | atan: "rad", | ||
1376 | asin: "rad", | ||
1377 | acos: "rad" | ||
1378 | }, | ||
1379 | m = { | ||
1380 | multiply: function(a, b) { | ||
1381 | return a * b | ||
1382 | }, | ||
1383 | screen: function(a, b) { | ||
1384 | return a + b - a * b | ||
1385 | }, | ||
1386 | overlay: function(a, b) { | ||
1387 | return a *= 2, 1 >= a ? m.multiply(a, b) : m.screen(a - 1, b) | ||
1388 | }, | ||
1389 | softlight: function(a, b) { | ||
1390 | var c = 1, | ||
1391 | d = a; | ||
1392 | return b > .5 && (d = 1, c = a > .25 ? Math.sqrt(a) : ((16 * a - 12) * a + 4) * a), a - (1 - 2 * b) * d * (c - a) | ||
1393 | }, | ||
1394 | hardlight: function(a, b) { | ||
1395 | return m.overlay(b, a) | ||
1396 | }, | ||
1397 | difference: function(a, b) { | ||
1398 | return Math.abs(a - b) | ||
1399 | }, | ||
1400 | exclusion: function(a, b) { | ||
1401 | return a + b - 2 * a * b | ||
1402 | }, | ||
1403 | average: function(a, b) { | ||
1404 | return (a + b) / 2 | ||
1405 | }, | ||
1406 | negation: function(a, b) { | ||
1407 | return 1 - Math.abs(a + b - 1) | ||
1408 | } | ||
1409 | }; | ||
1410 | d.defaultFunc = { | ||
1411 | eval: function() { | ||
1412 | var a = this.value_, | ||
1413 | b = this.error_; | ||
1414 | if (b) throw b; | ||
1415 | return null != a ? a ? d.True : d.False : void 0 | ||
1416 | }, | ||
1417 | value: function(a) { | ||
1418 | this.value_ = a | ||
1419 | }, | ||
1420 | error: function(a) { | ||
1421 | this.error_ = a | ||
1422 | }, | ||
1423 | reset: function() { | ||
1424 | this.value_ = this.error_ = null | ||
1425 | } | ||
1426 | }, g(), d.fround = function(a, b) { | ||
1427 | var c; | ||
1428 | return a && null != a.numPrecision ? (c = Math.pow(10, a.numPrecision), Math.round(b * c) / c) : b | ||
1429 | }, d.functionCall = function(a, b) { | ||
1430 | this.env = a, this.currentFileInfo = b | ||
1431 | }, d.functionCall.prototype = d.functions | ||
1432 | }(c("./tree")), | ||
1433 | function(a) { | ||
1434 | a.colors = { | ||
1435 | aliceblue: "#f0f8ff", | ||
1436 | antiquewhite: "#faebd7", | ||
1437 | aqua: "#00ffff", | ||
1438 | aquamarine: "#7fffd4", | ||
1439 | azure: "#f0ffff", | ||
1440 | beige: "#f5f5dc", | ||
1441 | bisque: "#ffe4c4", | ||
1442 | black: "#000000", | ||
1443 | blanchedalmond: "#ffebcd", | ||
1444 | blue: "#0000ff", | ||
1445 | blueviolet: "#8a2be2", | ||
1446 | brown: "#a52a2a", | ||
1447 | burlywood: "#deb887", | ||
1448 | cadetblue: "#5f9ea0", | ||
1449 | chartreuse: "#7fff00", | ||
1450 | chocolate: "#d2691e", | ||
1451 | coral: "#ff7f50", | ||
1452 | cornflowerblue: "#6495ed", | ||
1453 | cornsilk: "#fff8dc", | ||
1454 | crimson: "#dc143c", | ||
1455 | cyan: "#00ffff", | ||
1456 | darkblue: "#00008b", | ||
1457 | darkcyan: "#008b8b", | ||
1458 | darkgoldenrod: "#b8860b", | ||
1459 | darkgray: "#a9a9a9", | ||
1460 | darkgrey: "#a9a9a9", | ||
1461 | darkgreen: "#006400", | ||
1462 | darkkhaki: "#bdb76b", | ||
1463 | darkmagenta: "#8b008b", | ||
1464 | darkolivegreen: "#556b2f", | ||
1465 | darkorange: "#ff8c00", | ||
1466 | darkorchid: "#9932cc", | ||
1467 | darkred: "#8b0000", | ||
1468 | darksalmon: "#e9967a", | ||
1469 | darkseagreen: "#8fbc8f", | ||
1470 | darkslateblue: "#483d8b", | ||
1471 | darkslategray: "#2f4f4f", | ||
1472 | darkslategrey: "#2f4f4f", | ||
1473 | darkturquoise: "#00ced1", | ||
1474 | darkviolet: "#9400d3", | ||
1475 | deeppink: "#ff1493", | ||
1476 | deepskyblue: "#00bfff", | ||
1477 | dimgray: "#696969", | ||
1478 | dimgrey: "#696969", | ||
1479 | dodgerblue: "#1e90ff", | ||
1480 | firebrick: "#b22222", | ||
1481 | floralwhite: "#fffaf0", | ||
1482 | forestgreen: "#228b22", | ||
1483 | fuchsia: "#ff00ff", | ||
1484 | gainsboro: "#dcdcdc", | ||
1485 | ghostwhite: "#f8f8ff", | ||
1486 | gold: "#ffd700", | ||
1487 | goldenrod: "#daa520", | ||
1488 | gray: "#808080", | ||
1489 | grey: "#808080", | ||
1490 | green: "#008000", | ||
1491 | greenyellow: "#adff2f", | ||
1492 | honeydew: "#f0fff0", | ||
1493 | hotpink: "#ff69b4", | ||
1494 | indianred: "#cd5c5c", | ||
1495 | indigo: "#4b0082", | ||
1496 | ivory: "#fffff0", | ||
1497 | khaki: "#f0e68c", | ||
1498 | lavender: "#e6e6fa", | ||
1499 | lavenderblush: "#fff0f5", | ||
1500 | lawngreen: "#7cfc00", | ||
1501 | lemonchiffon: "#fffacd", | ||
1502 | lightblue: "#add8e6", | ||
1503 | lightcoral: "#f08080", | ||
1504 | lightcyan: "#e0ffff", | ||
1505 | lightgoldenrodyellow: "#fafad2", | ||
1506 | lightgray: "#d3d3d3", | ||
1507 | lightgrey: "#d3d3d3", | ||
1508 | lightgreen: "#90ee90", | ||
1509 | lightpink: "#ffb6c1", | ||
1510 | lightsalmon: "#ffa07a", | ||
1511 | lightseagreen: "#20b2aa", | ||
1512 | lightskyblue: "#87cefa", | ||
1513 | lightslategray: "#778899", | ||
1514 | lightslategrey: "#778899", | ||
1515 | lightsteelblue: "#b0c4de", | ||
1516 | lightyellow: "#ffffe0", | ||
1517 | lime: "#00ff00", | ||
1518 | limegreen: "#32cd32", | ||
1519 | linen: "#faf0e6", | ||
1520 | magenta: "#ff00ff", | ||
1521 | maroon: "#800000", | ||
1522 | mediumaquamarine: "#66cdaa", | ||
1523 | mediumblue: "#0000cd", | ||
1524 | mediumorchid: "#ba55d3", | ||
1525 | mediumpurple: "#9370d8", | ||
1526 | mediumseagreen: "#3cb371", | ||
1527 | mediumslateblue: "#7b68ee", | ||
1528 | mediumspringgreen: "#00fa9a", | ||
1529 | mediumturquoise: "#48d1cc", | ||
1530 | mediumvioletred: "#c71585", | ||
1531 | midnightblue: "#191970", | ||
1532 | mintcream: "#f5fffa", | ||
1533 | mistyrose: "#ffe4e1", | ||
1534 | moccasin: "#ffe4b5", | ||
1535 | navajowhite: "#ffdead", | ||
1536 | navy: "#000080", | ||
1537 | oldlace: "#fdf5e6", | ||
1538 | olive: "#808000", | ||
1539 | olivedrab: "#6b8e23", | ||
1540 | orange: "#ffa500", | ||
1541 | orangered: "#ff4500", | ||
1542 | orchid: "#da70d6", | ||
1543 | palegoldenrod: "#eee8aa", | ||
1544 | palegreen: "#98fb98", | ||
1545 | paleturquoise: "#afeeee", | ||
1546 | palevioletred: "#d87093", | ||
1547 | papayawhip: "#ffefd5", | ||
1548 | peachpuff: "#ffdab9", | ||
1549 | peru: "#cd853f", | ||
1550 | pink: "#ffc0cb", | ||
1551 | plum: "#dda0dd", | ||
1552 | powderblue: "#b0e0e6", | ||
1553 | purple: "#800080", | ||
1554 | red: "#ff0000", | ||
1555 | rosybrown: "#bc8f8f", | ||
1556 | royalblue: "#4169e1", | ||
1557 | saddlebrown: "#8b4513", | ||
1558 | salmon: "#fa8072", | ||
1559 | sandybrown: "#f4a460", | ||
1560 | seagreen: "#2e8b57", | ||
1561 | seashell: "#fff5ee", | ||
1562 | sienna: "#a0522d", | ||
1563 | silver: "#c0c0c0", | ||
1564 | skyblue: "#87ceeb", | ||
1565 | slateblue: "#6a5acd", | ||
1566 | slategray: "#708090", | ||
1567 | slategrey: "#708090", | ||
1568 | snow: "#fffafa", | ||
1569 | springgreen: "#00ff7f", | ||
1570 | steelblue: "#4682b4", | ||
1571 | tan: "#d2b48c", | ||
1572 | teal: "#008080", | ||
1573 | thistle: "#d8bfd8", | ||
1574 | tomato: "#ff6347", | ||
1575 | turquoise: "#40e0d0", | ||
1576 | violet: "#ee82ee", | ||
1577 | wheat: "#f5deb3", | ||
1578 | white: "#ffffff", | ||
1579 | whitesmoke: "#f5f5f5", | ||
1580 | yellow: "#ffff00", | ||
1581 | yellowgreen: "#9acd32" | ||
1582 | } | ||
1583 | }(c("./tree")), | ||
1584 | function(a) { | ||
1585 | a.debugInfo = function(b, c, d) { | ||
1586 | var e = ""; | ||
1587 | if (b.dumpLineNumbers && !b.compress) switch (b.dumpLineNumbers) { | ||
1588 | case "comments": | ||
1589 | e = a.debugInfo.asComment(c); | ||
1590 | break; | ||
1591 | case "mediaquery": | ||
1592 | e = a.debugInfo.asMediaQuery(c); | ||
1593 | break; | ||
1594 | case "all": | ||
1595 | e = a.debugInfo.asComment(c) + (d || "") + a.debugInfo.asMediaQuery(c) | ||
1596 | } | ||
1597 | return e | ||
1598 | }, a.debugInfo.asComment = function(a) { | ||
1599 | return "/* line " + a.debugInfo.lineNumber + ", " + a.debugInfo.fileName + " */\n" | ||
1600 | }, a.debugInfo.asMediaQuery = function(a) { | ||
1601 | return "@media -sass-debug-info{filename{font-family:" + ("file://" + a.debugInfo.fileName).replace(/([.:\/\\])/g, function(a) { | ||
1602 | return "\\" == a && (a = "/"), "\\" + a | ||
1603 | }) + "}line{font-family:\\00003" + a.debugInfo.lineNumber + "}}\n" | ||
1604 | }, a.find = function(a, b) { | ||
1605 | for (var c, d = 0; d < a.length; d++) | ||
1606 | if (c = b.call(a, a[d])) return c; | ||
1607 | return null | ||
1608 | }, a.jsify = function(a) { | ||
1609 | return Array.isArray(a.value) && a.value.length > 1 ? "[" + a.value.map(function(a) { | ||
1610 | return a.toCSS(!1) | ||
1611 | }).join(", ") + "]" : a.toCSS(!1) | ||
1612 | }, a.toCSS = function(a) { | ||
1613 | var b = []; | ||
1614 | return this.genCSS(a, { | ||
1615 | add: function(a) { | ||
1616 | b.push(a) | ||
1617 | }, | ||
1618 | isEmpty: function() { | ||
1619 | return 0 === b.length | ||
1620 | } | ||
1621 | }), b.join("") | ||
1622 | }, a.outputRuleset = function(a, b, c) { | ||
1623 | var d, e = c.length; | ||
1624 | if (a.tabLevel = (0 | a.tabLevel) + 1, a.compress) { | ||
1625 | for (b.add("{"), d = 0; e > d; d++) c[d].genCSS(a, b); | ||
1626 | return b.add("}"), void a.tabLevel-- | ||
1627 | } | ||
1628 | var f = "\n" + Array(a.tabLevel).join(" "), | ||
1629 | g = f + " "; | ||
1630 | if (e) { | ||
1631 | for (b.add(" {" + g), c[0].genCSS(a, b), d = 1; e > d; d++) b.add(g), c[d].genCSS(a, b); | ||
1632 | b.add(f + "}") | ||
1633 | } else b.add(" {" + f + "}"); | ||
1634 | a.tabLevel-- | ||
1635 | } | ||
1636 | }(c("./tree")), | ||
1637 | function(a) { | ||
1638 | a.Alpha = function(a) { | ||
1639 | this.value = a | ||
1640 | }, a.Alpha.prototype = { | ||
1641 | type: "Alpha", | ||
1642 | accept: function(a) { | ||
1643 | this.value = a.visit(this.value) | ||
1644 | }, | ||
1645 | eval: function(b) { | ||
1646 | return this.value.eval ? new a.Alpha(this.value.eval(b)) : this | ||
1647 | }, | ||
1648 | genCSS: function(a, b) { | ||
1649 | b.add("alpha(opacity="), this.value.genCSS ? this.value.genCSS(a, b) : b.add(this.value), b.add(")") | ||
1650 | }, | ||
1651 | toCSS: a.toCSS | ||
1652 | } | ||
1653 | }(c("../tree")), | ||
1654 | function(a) { | ||
1655 | a.Anonymous = function(a, b, c, d) { | ||
1656 | this.value = a.value || a, this.index = b, this.mapLines = d, this.currentFileInfo = c | ||
1657 | }, a.Anonymous.prototype = { | ||
1658 | type: "Anonymous", | ||
1659 | eval: function() { | ||
1660 | return new a.Anonymous(this.value, this.index, this.currentFileInfo, this.mapLines) | ||
1661 | }, | ||
1662 | compare: function(a) { | ||
1663 | if (!a.toCSS) return -1; | ||
1664 | var b = this.toCSS(), | ||
1665 | c = a.toCSS(); | ||
1666 | return b === c ? 0 : c > b ? -1 : 1 | ||
1667 | }, | ||
1668 | genCSS: function(a, b) { | ||
1669 | b.add(this.value, this.currentFileInfo, this.index, this.mapLines) | ||
1670 | }, | ||
1671 | toCSS: a.toCSS | ||
1672 | } | ||
1673 | }(c("../tree")), | ||
1674 | function(a) { | ||
1675 | a.Assignment = function(a, b) { | ||
1676 | this.key = a, this.value = b | ||
1677 | }, a.Assignment.prototype = { | ||
1678 | type: "Assignment", | ||
1679 | accept: function(a) { | ||
1680 | this.value = a.visit(this.value) | ||
1681 | }, | ||
1682 | eval: function(b) { | ||
1683 | return this.value.eval ? new a.Assignment(this.key, this.value.eval(b)) : this | ||
1684 | }, | ||
1685 | genCSS: function(a, b) { | ||
1686 | b.add(this.key + "="), this.value.genCSS ? this.value.genCSS(a, b) : b.add(this.value) | ||
1687 | }, | ||
1688 | toCSS: a.toCSS | ||
1689 | } | ||
1690 | }(c("../tree")), | ||
1691 | function(a) { | ||
1692 | a.Call = function(a, b, c, d) { | ||
1693 | this.name = a, this.args = b, this.index = c, this.currentFileInfo = d | ||
1694 | }, a.Call.prototype = { | ||
1695 | type: "Call", | ||
1696 | accept: function(a) { | ||
1697 | this.args && (this.args = a.visitArray(this.args)) | ||
1698 | }, | ||
1699 | eval: function(b) { | ||
1700 | var c, d, e = this.args.map(function(a) { | ||
1701 | return a.eval(b) | ||
1702 | }), | ||
1703 | f = this.name.toLowerCase(); | ||
1704 | if (f in a.functions) try { | ||
1705 | if (d = new a.functionCall(b, this.currentFileInfo), c = d[f].apply(d, e), null != c) return c | ||
1706 | } catch (g) { | ||
1707 | throw { | ||
1708 | type: g.type || "Runtime", | ||
1709 | message: "error evaluating function `" + this.name + "`" + (g.message ? ": " + g.message : ""), | ||
1710 | index: this.index, | ||
1711 | filename: this.currentFileInfo.filename | ||
1712 | } | ||
1713 | } | ||
1714 | return new a.Call(this.name, e, this.index, this.currentFileInfo) | ||
1715 | }, | ||
1716 | genCSS: function(a, b) { | ||
1717 | b.add(this.name + "(", this.currentFileInfo, this.index); | ||
1718 | for (var c = 0; c < this.args.length; c++) this.args[c].genCSS(a, b), c + 1 < this.args.length && b.add(", "); | ||
1719 | b.add(")") | ||
1720 | }, | ||
1721 | toCSS: a.toCSS | ||
1722 | } | ||
1723 | }(c("../tree")), | ||
1724 | function(a) { | ||
1725 | function b(a) { | ||
1726 | return "#" + a.map(function(a) { | ||
1727 | return a = c(Math.round(a), 255), (16 > a ? "0" : "") + a.toString(16) | ||
1728 | }).join("") | ||
1729 | } | ||
1730 | |||
1731 | function c(a, b) { | ||
1732 | return Math.min(Math.max(a, 0), b) | ||
1733 | } | ||
1734 | a.Color = function(a, b) { | ||
1735 | this.rgb = Array.isArray(a) ? a : 6 == a.length ? a.match(/.{2}/g).map(function(a) { | ||
1736 | return parseInt(a, 16) | ||
1737 | }) : a.split("").map(function(a) { | ||
1738 | return parseInt(a + a, 16) | ||
1739 | }), this.alpha = "number" == typeof b ? b : 1 | ||
1740 | }; | ||
1741 | var d = "transparent"; | ||
1742 | a.Color.prototype = { | ||
1743 | type: "Color", | ||
1744 | eval: function() { | ||
1745 | return this | ||
1746 | }, | ||
1747 | luma: function() { | ||
1748 | var a = this.rgb[0] / 255, | ||
1749 | b = this.rgb[1] / 255, | ||
1750 | c = this.rgb[2] / 255; | ||
1751 | return a = .03928 >= a ? a / 12.92 : Math.pow((a + .055) / 1.055, 2.4), b = .03928 >= b ? b / 12.92 : Math.pow((b + .055) / 1.055, 2.4), c = .03928 >= c ? c / 12.92 : Math.pow((c + .055) / 1.055, 2.4), .2126 * a + .7152 * b + .0722 * c | ||
1752 | }, | ||
1753 | genCSS: function(a, b) { | ||
1754 | b.add(this.toCSS(a)) | ||
1755 | }, | ||
1756 | toCSS: function(b, e) { | ||
1757 | var f = b && b.compress && !e, | ||
1758 | g = a.fround(b, this.alpha); | ||
1759 | if (1 > g) return 0 === g && this.isTransparentKeyword ? d : "rgba(" + this.rgb.map(function(a) { | ||
1760 | return c(Math.round(a), 255) | ||
1761 | }).concat(c(g, 1)).join("," + (f ? "" : " ")) + ")"; | ||
1762 | var h = this.toRGB(); | ||
1763 | if (f) { | ||
1764 | var i = h.split(""); | ||
1765 | i[1] === i[2] && i[3] === i[4] && i[5] === i[6] && (h = "#" + i[1] + i[3] + i[5]) | ||
1766 | } | ||
1767 | return h | ||
1768 | }, | ||
1769 | operate: function(b, c, d) { | ||
1770 | for (var e = [], f = this.alpha * (1 - d.alpha) + d.alpha, g = 0; 3 > g; g++) e[g] = a.operate(b, c, this.rgb[g], d.rgb[g]); | ||
1771 | return new a.Color(e, f) | ||
1772 | }, | ||
1773 | toRGB: function() { | ||
1774 | return b(this.rgb) | ||
1775 | }, | ||
1776 | toHSL: function() { | ||
1777 | var a, b, c = this.rgb[0] / 255, | ||
1778 | d = this.rgb[1] / 255, | ||
1779 | e = this.rgb[2] / 255, | ||
1780 | f = this.alpha, | ||
1781 | g = Math.max(c, d, e), | ||
1782 | h = Math.min(c, d, e), | ||
1783 | i = (g + h) / 2, | ||
1784 | j = g - h; | ||
1785 | if (g === h) a = b = 0; | ||
1786 | else { | ||
1787 | switch (b = i > .5 ? j / (2 - g - h) : j / (g + h), g) { | ||
1788 | case c: | ||
1789 | a = (d - e) / j + (e > d ? 6 : 0); | ||
1790 | break; | ||
1791 | case d: | ||
1792 | a = (e - c) / j + 2; | ||
1793 | break; | ||
1794 | case e: | ||
1795 | a = (c - d) / j + 4 | ||
1796 | } | ||
1797 | a /= 6 | ||
1798 | } | ||
1799 | return { | ||
1800 | h: 360 * a, | ||
1801 | s: b, | ||
1802 | l: i, | ||
1803 | a: f | ||
1804 | } | ||
1805 | }, | ||
1806 | toHSV: function() { | ||
1807 | var a, b, c = this.rgb[0] / 255, | ||
1808 | d = this.rgb[1] / 255, | ||
1809 | e = this.rgb[2] / 255, | ||
1810 | f = this.alpha, | ||
1811 | g = Math.max(c, d, e), | ||
1812 | h = Math.min(c, d, e), | ||
1813 | i = g, | ||
1814 | j = g - h; | ||
1815 | if (b = 0 === g ? 0 : j / g, g === h) a = 0; | ||
1816 | else { | ||
1817 | switch (g) { | ||
1818 | case c: | ||
1819 | a = (d - e) / j + (e > d ? 6 : 0); | ||
1820 | break; | ||
1821 | case d: | ||
1822 | a = (e - c) / j + 2; | ||
1823 | break; | ||
1824 | case e: | ||
1825 | a = (c - d) / j + 4 | ||
1826 | } | ||
1827 | a /= 6 | ||
1828 | } | ||
1829 | return { | ||
1830 | h: 360 * a, | ||
1831 | s: b, | ||
1832 | v: i, | ||
1833 | a: f | ||
1834 | } | ||
1835 | }, | ||
1836 | toARGB: function() { | ||
1837 | return b([255 * this.alpha].concat(this.rgb)) | ||
1838 | }, | ||
1839 | compare: function(a) { | ||
1840 | return a.rgb ? a.rgb[0] === this.rgb[0] && a.rgb[1] === this.rgb[1] && a.rgb[2] === this.rgb[2] && a.alpha === this.alpha ? 0 : -1 : -1 | ||
1841 | } | ||
1842 | }, a.Color.fromKeyword = function(b) { | ||
1843 | if (b = b.toLowerCase(), a.colors.hasOwnProperty(b)) return new a.Color(a.colors[b].slice(1)); | ||
1844 | if (b === d) { | ||
1845 | var c = new a.Color([0, 0, 0], 0); | ||
1846 | return c.isTransparentKeyword = !0, c | ||
1847 | } | ||
1848 | } | ||
1849 | }(c("../tree")), | ||
1850 | function(a) { | ||
1851 | a.Comment = function(a, b, c, d) { | ||
1852 | this.value = a, this.silent = !!b, this.currentFileInfo = d | ||
1853 | }, a.Comment.prototype = { | ||
1854 | type: "Comment", | ||
1855 | genCSS: function(b, c) { | ||
1856 | this.debugInfo && c.add(a.debugInfo(b, this), this.currentFileInfo, this.index), c.add(this.value.trim()) | ||
1857 | }, | ||
1858 | toCSS: a.toCSS, | ||
1859 | isSilent: function(a) { | ||
1860 | var b = this.currentFileInfo && this.currentFileInfo.reference && !this.isReferenced, | ||
1861 | c = a.compress && !this.value.match(/^\/\*!/); | ||
1862 | return this.silent || b || c | ||
1863 | }, | ||
1864 | eval: function() { | ||
1865 | return this | ||
1866 | }, | ||
1867 | markReferenced: function() { | ||
1868 | this.isReferenced = !0 | ||
1869 | } | ||
1870 | } | ||
1871 | }(c("../tree")), | ||
1872 | function(a) { | ||
1873 | a.Condition = function(a, b, c, d, e) { | ||
1874 | this.op = a.trim(), this.lvalue = b, this.rvalue = c, this.index = d, this.negate = e | ||
1875 | }, a.Condition.prototype = { | ||
1876 | type: "Condition", | ||
1877 | accept: function(a) { | ||
1878 | this.lvalue = a.visit(this.lvalue), this.rvalue = a.visit(this.rvalue) | ||
1879 | }, | ||
1880 | eval: function(a) { | ||
1881 | var b, c = this.lvalue.eval(a), | ||
1882 | d = this.rvalue.eval(a), | ||
1883 | e = this.index; | ||
1884 | return b = function(a) { | ||
1885 | switch (a) { | ||
1886 | case "and": | ||
1887 | return c && d; | ||
1888 | case "or": | ||
1889 | return c || d; | ||
1890 | default: | ||
1891 | if (c.compare) b = c.compare(d); | ||
1892 | else { | ||
1893 | if (!d.compare) throw { | ||
1894 | type: "Type", | ||
1895 | message: "Unable to perform comparison", | ||
1896 | index: e | ||
1897 | }; | ||
1898 | b = d.compare(c) | ||
1899 | } | ||
1900 | switch (b) { | ||
1901 | case -1: | ||
1902 | return "<" === a || "=<" === a || "<=" === a; | ||
1903 | case 0: | ||
1904 | return "=" === a || ">=" === a || "=<" === a || "<=" === a; | ||
1905 | case 1: | ||
1906 | return ">" === a || ">=" === a | ||
1907 | } | ||
1908 | } | ||
1909 | }(this.op), this.negate ? !b : b | ||
1910 | } | ||
1911 | } | ||
1912 | }(c("../tree")), | ||
1913 | function(a) { | ||
1914 | a.DetachedRuleset = function(a, b) { | ||
1915 | this.ruleset = a, this.frames = b | ||
1916 | }, a.DetachedRuleset.prototype = { | ||
1917 | type: "DetachedRuleset", | ||
1918 | accept: function(a) { | ||
1919 | this.ruleset = a.visit(this.ruleset) | ||
1920 | }, | ||
1921 | eval: function(b) { | ||
1922 | var c = this.frames || b.frames.slice(0); | ||
1923 | return new a.DetachedRuleset(this.ruleset, c) | ||
1924 | }, | ||
1925 | callEval: function(b) { | ||
1926 | return this.ruleset.eval(this.frames ? new a.evalEnv(b, this.frames.concat(b.frames)) : b) | ||
1927 | } | ||
1928 | } | ||
1929 | }(c("../tree")), | ||
1930 | function(a) { | ||
1931 | a.Dimension = function(c, d) { | ||
1932 | this.value = parseFloat(c), this.unit = d && d instanceof a.Unit ? d : new a.Unit(d ? [d] : b) | ||
1933 | }, a.Dimension.prototype = { | ||
1934 | type: "Dimension", | ||
1935 | accept: function(a) { | ||
1936 | this.unit = a.visit(this.unit) | ||
1937 | }, | ||
1938 | eval: function() { | ||
1939 | return this | ||
1940 | }, | ||
1941 | toColor: function() { | ||
1942 | return new a.Color([this.value, this.value, this.value]) | ||
1943 | }, | ||
1944 | genCSS: function(b, c) { | ||
1945 | if (b && b.strictUnits && !this.unit.isSingular()) throw new Error("Multiple units in dimension. Correct the units or use the unit function. Bad unit: " + this.unit.toString()); | ||
1946 | var d = a.fround(b, this.value), | ||
1947 | e = String(d); | ||
1948 | if (0 !== d && 1e-6 > d && d > -1e-6 && (e = d.toFixed(20).replace(/0+$/, "")), b && b.compress) { | ||
1949 | if (0 === d && this.unit.isLength()) return void c.add(e); | ||
1950 | d > 0 && 1 > d && (e = e.substr(1)) | ||
1951 | } | ||
1952 | c.add(e), this.unit.genCSS(b, c) | ||
1953 | }, | ||
1954 | toCSS: a.toCSS, | ||
1955 | operate: function(b, c, d) { | ||
1956 | var e = a.operate(b, c, this.value, d.value), | ||
1957 | f = this.unit.clone(); | ||
1958 | if ("+" === c || "-" === c) | ||
1959 | if (0 === f.numerator.length && 0 === f.denominator.length) f.numerator = d.unit.numerator.slice(0), f.denominator = d.unit.denominator.slice(0); | ||
1960 | else if (0 === d.unit.numerator.length && 0 === f.denominator.length); | ||
1961 | else { | ||
1962 | if (d = d.convertTo(this.unit.usedUnits()), b.strictUnits && d.unit.toString() !== f.toString()) throw new Error("Incompatible units. Change the units or use the unit function. Bad units: '" + f.toString() + "' and '" + d.unit.toString() + "'."); | ||
1963 | e = a.operate(b, c, this.value, d.value) | ||
1964 | } else "*" === c ? (f.numerator = f.numerator.concat(d.unit.numerator).sort(), f.denominator = f.denominator.concat(d.unit.denominator).sort(), f.cancel()) : "/" === c && (f.numerator = f.numerator.concat(d.unit.denominator).sort(), f.denominator = f.denominator.concat(d.unit.numerator).sort(), f.cancel()); | ||
1965 | return new a.Dimension(e, f) | ||
1966 | }, | ||
1967 | compare: function(b) { | ||
1968 | if (b instanceof a.Dimension) { | ||
1969 | var c, d, e, f; | ||
1970 | if (this.unit.isEmpty() || b.unit.isEmpty()) c = this, d = b; | ||
1971 | else if (c = this.unify(), d = b.unify(), 0 !== c.unit.compare(d.unit)) return -1; | ||
1972 | return e = c.value, f = d.value, f > e ? -1 : e > f ? 1 : 0 | ||
1973 | } | ||
1974 | return -1 | ||
1975 | }, | ||
1976 | unify: function() { | ||
1977 | return this.convertTo({ | ||
1978 | length: "px", | ||
1979 | duration: "s", | ||
1980 | angle: "rad" | ||
1981 | }) | ||
1982 | }, | ||
1983 | convertTo: function(b) { | ||
1984 | var c, d, e, f, g, h = this.value, | ||
1985 | i = this.unit.clone(), | ||
1986 | j = {}; | ||
1987 | if ("string" == typeof b) { | ||
1988 | for (c in a.UnitConversions) a.UnitConversions[c].hasOwnProperty(b) && (j = {}, j[c] = b); | ||
1989 | b = j | ||
1990 | } | ||
1991 | g = function(a, b) { | ||
1992 | return e.hasOwnProperty(a) ? (b ? h /= e[a] / e[f] : h *= e[a] / e[f], f) : a | ||
1993 | }; | ||
1994 | for (d in b) b.hasOwnProperty(d) && (f = b[d], e = a.UnitConversions[d], i.map(g)); | ||
1995 | return i.cancel(), new a.Dimension(h, i) | ||
1996 | } | ||
1997 | }, a.UnitConversions = { | ||
1998 | length: { | ||
1999 | m: 1, | ||
2000 | cm: .01, | ||
2001 | mm: .001, | ||
2002 | "in": .0254, | ||
2003 | px: .0254 / 96, | ||
2004 | pt: .0254 / 72, | ||
2005 | pc: .0254 / 72 * 12 | ||
2006 | }, | ||
2007 | duration: { | ||
2008 | s: 1, | ||
2009 | ms: .001 | ||
2010 | }, | ||
2011 | angle: { | ||
2012 | rad: 1 / (2 * Math.PI), | ||
2013 | deg: 1 / 360, | ||
2014 | grad: .0025, | ||
2015 | turn: 1 | ||
2016 | } | ||
2017 | }, a.Unit = function(a, b, c) { | ||
2018 | this.numerator = a ? a.slice(0).sort() : [], this.denominator = b ? b.slice(0).sort() : [], this.backupUnit = c | ||
2019 | }, a.Unit.prototype = { | ||
2020 | type: "Unit", | ||
2021 | clone: function() { | ||
2022 | return new a.Unit(this.numerator.slice(0), this.denominator.slice(0), this.backupUnit) | ||
2023 | }, | ||
2024 | genCSS: function(a, b) { | ||
2025 | this.numerator.length >= 1 ? b.add(this.numerator[0]) : this.denominator.length >= 1 ? b.add(this.denominator[0]) : a && a.strictUnits || !this.backupUnit || b.add(this.backupUnit) | ||
2026 | }, | ||
2027 | toCSS: a.toCSS, | ||
2028 | toString: function() { | ||
2029 | var a, b = this.numerator.join("*"); | ||
2030 | for (a = 0; a < this.denominator.length; a++) b += "/" + this.denominator[a]; | ||
2031 | return b | ||
2032 | }, | ||
2033 | compare: function(a) { | ||
2034 | return this.is(a.toString()) ? 0 : -1 | ||
2035 | }, | ||
2036 | is: function(a) { | ||
2037 | return this.toString() === a | ||
2038 | }, | ||
2039 | isLength: function() { | ||
2040 | return Boolean(this.toCSS().match(/px|em|%|in|cm|mm|pc|pt|ex/)) | ||
2041 | }, | ||
2042 | isEmpty: function() { | ||
2043 | return 0 === this.numerator.length && 0 === this.denominator.length | ||
2044 | }, | ||
2045 | isSingular: function() { | ||
2046 | return this.numerator.length <= 1 && 0 === this.denominator.length | ||
2047 | }, | ||
2048 | map: function(a) { | ||
2049 | var b; | ||
2050 | for (b = 0; b < this.numerator.length; b++) this.numerator[b] = a(this.numerator[b], !1); | ||
2051 | for (b = 0; b < this.denominator.length; b++) this.denominator[b] = a(this.denominator[b], !0) | ||
2052 | }, | ||
2053 | usedUnits: function() { | ||
2054 | var b, c, d = {}; | ||
2055 | c = function(a) { | ||
2056 | return b.hasOwnProperty(a) && !d[e] && (d[e] = a), a | ||
2057 | }; | ||
2058 | for (var e in a.UnitConversions) a.UnitConversions.hasOwnProperty(e) && (b = a.UnitConversions[e], this.map(c)); | ||
2059 | return d | ||
2060 | }, | ||
2061 | cancel: function() { | ||
2062 | var a, b, c, d = {}; | ||
2063 | for (b = 0; b < this.numerator.length; b++) a = this.numerator[b], c || (c = a), d[a] = (d[a] || 0) + 1; | ||
2064 | for (b = 0; b < this.denominator.length; b++) a = this.denominator[b], c || (c = a), d[a] = (d[a] || 0) - 1; | ||
2065 | this.numerator = [], this.denominator = []; | ||
2066 | for (a in d) | ||
2067 | if (d.hasOwnProperty(a)) { | ||
2068 | var e = d[a]; | ||
2069 | if (e > 0) | ||
2070 | for (b = 0; e > b; b++) this.numerator.push(a); | ||
2071 | else if (0 > e) | ||
2072 | for (b = 0; - e > b; b++) this.denominator.push(a) | ||
2073 | } | ||
2074 | 0 === this.numerator.length && 0 === this.denominator.length && c && (this.backupUnit = c), this.numerator.sort(), this.denominator.sort() | ||
2075 | } | ||
2076 | } | ||
2077 | }(c("../tree")), | ||
2078 | function(a) { | ||
2079 | a.Directive = function(a, b, c, d, e, f) { | ||
2080 | this.name = a, this.value = b, c && (this.rules = c, this.rules.allowImports = !0), this.index = d, this.currentFileInfo = e, this.debugInfo = f | ||
2081 | }, a.Directive.prototype = { | ||
2082 | type: "Directive", | ||
2083 | accept: function(a) { | ||
2084 | var b = this.value, | ||
2085 | c = this.rules; | ||
2086 | c && (c = a.visit(c)), b && (b = a.visit(b)) | ||
2087 | }, | ||
2088 | genCSS: function(b, c) { | ||
2089 | var d = this.value, | ||
2090 | e = this.rules; | ||
2091 | c.add(this.name, this.currentFileInfo, this.index), d && (c.add(" "), d.genCSS(b, c)), e ? a.outputRuleset(b, c, [e]) : c.add(";") | ||
2092 | }, | ||
2093 | toCSS: a.toCSS, | ||
2094 | eval: function(b) { | ||
2095 | var c = this.value, | ||
2096 | d = this.rules; | ||
2097 | return c && (c = c.eval(b)), d && (d = d.eval(b), d.root = !0), new a.Directive(this.name, c, d, this.index, this.currentFileInfo, this.debugInfo) | ||
2098 | }, | ||
2099 | variable: function(b) { | ||
2100 | return this.rules ? a.Ruleset.prototype.variable.call(this.rules, b) : void 0 | ||
2101 | }, | ||
2102 | find: function() { | ||
2103 | return this.rules ? a.Ruleset.prototype.find.apply(this.rules, arguments) : void 0 | ||
2104 | }, | ||
2105 | rulesets: function() { | ||
2106 | return this.rules ? a.Ruleset.prototype.rulesets.apply(this.rules) : void 0 | ||
2107 | }, | ||
2108 | markReferenced: function() { | ||
2109 | var a, b; | ||
2110 | if (this.isReferenced = !0, this.rules) | ||
2111 | for (b = this.rules.rules, a = 0; a < b.length; a++) b[a].markReferenced && b[a].markReferenced() | ||
2112 | } | ||
2113 | } | ||
2114 | }(c("../tree")), | ||
2115 | function(a) { | ||
2116 | a.Element = function(b, c, d, e) { | ||
2117 | this.combinator = b instanceof a.Combinator ? b : new a.Combinator(b), this.value = "string" == typeof c ? c.trim() : c ? c : "", this.index = d, this.currentFileInfo = e | ||
2118 | }, a.Element.prototype = { | ||
2119 | type: "Element", | ||
2120 | accept: function(a) { | ||
2121 | var b = this.value; | ||
2122 | this.combinator = a.visit(this.combinator), "object" == typeof b && (this.value = a.visit(b)) | ||
2123 | }, | ||
2124 | eval: function(b) { | ||
2125 | return new a.Element(this.combinator, this.value.eval ? this.value.eval(b) : this.value, this.index, this.currentFileInfo) | ||
2126 | }, | ||
2127 | genCSS: function(a, b) { | ||
2128 | b.add(this.toCSS(a), this.currentFileInfo, this.index) | ||
2129 | }, | ||
2130 | toCSS: function(a) { | ||
2131 | var b = this.value.toCSS ? this.value.toCSS(a) : this.value; | ||
2132 | return "" === b && "&" === this.combinator.value.charAt(0) ? "" : this.combinator.toCSS(a || {}) + b | ||
2133 | } | ||
2134 | }, a.Attribute = function(a, b, c) { | ||
2135 | this.key = a, this.op = b, this.value = c | ||
2136 | }, a.Attribute.prototype = { | ||
2137 | type: "Attribute", | ||
2138 | eval: function(b) { | ||
2139 | return new a.Attribute(this.key.eval ? this.key.eval(b) : this.key, this.op, this.value && this.value.eval ? this.value.eval(b) : this.value) | ||
2140 | }, | ||
2141 | genCSS: function(a, b) { | ||
2142 | b.add(this.toCSS(a)) | ||
2143 | }, | ||
2144 | toCSS: function(a) { | ||
2145 | var b = this.key.toCSS ? this.key.toCSS(a) : this.key; | ||
2146 | return this.op && (b += this.op, b += this.value.toCSS ? this.value.toCSS(a) : this.value), "[" + b + "]" | ||
2147 | } | ||
2148 | }, a.Combinator = function(a) { | ||
2149 | this.value = " " === a ? " " : a ? a.trim() : "" | ||
2150 | }, a.Combinator.prototype = { | ||
2151 | type: "Combinator", | ||
2152 | _outputMap: { | ||
2153 | "": "", | ||
2154 | " ": " ", | ||
2155 | ":": " :", | ||
2156 | "+": " + ", | ||
2157 | "~": " ~ ", | ||
2158 | ">": " > ", | ||
2159 | "|": "|", | ||
2160 | "^": " ^ ", | ||
2161 | "^^": " ^^ " | ||
2162 | }, | ||
2163 | _outputMapCompressed: { | ||
2164 | "": "", | ||
2165 | " ": " ", | ||
2166 | ":": " :", | ||
2167 | "+": "+", | ||
2168 | "~": "~", | ||
2169 | ">": ">", | ||
2170 | "|": "|", | ||
2171 | "^": "^", | ||
2172 | "^^": "^^" | ||
2173 | }, | ||
2174 | genCSS: function(a, b) { | ||
2175 | b.add((a.compress ? this._outputMapCompressed : this._outputMap)[this.value]) | ||
2176 | }, | ||
2177 | toCSS: a.toCSS | ||
2178 | } | ||
2179 | }(c("../tree")), | ||
2180 | function(a) { | ||
2181 | a.Expression = function(a) { | ||
2182 | this.value = a | ||
2183 | }, a.Expression.prototype = { | ||
2184 | type: "Expression", | ||
2185 | accept: function(a) { | ||
2186 | this.value && (this.value = a.visitArray(this.value)) | ||
2187 | }, | ||
2188 | eval: function(b) { | ||
2189 | var c, d = this.parens && !this.parensInOp, | ||
2190 | e = !1; | ||
2191 | return d && b.inParenthesis(), this.value.length > 1 ? c = new a.Expression(this.value.map(function(a) { | ||
2192 | return a.eval(b) | ||
2193 | })) : 1 === this.value.length ? (this.value[0].parens && !this.value[0].parensInOp && (e = !0), c = this.value[0].eval(b)) : c = this, d && b.outOfParenthesis(), this.parens && this.parensInOp && !b.isMathOn() && !e && (c = new a.Paren(c)), c | ||
2194 | }, | ||
2195 | genCSS: function(a, b) { | ||
2196 | for (var c = 0; c < this.value.length; c++) this.value[c].genCSS(a, b), c + 1 < this.value.length && b.add(" ") | ||
2197 | }, | ||
2198 | toCSS: a.toCSS, | ||
2199 | throwAwayComments: function() { | ||
2200 | this.value = this.value.filter(function(b) { | ||
2201 | return !(b instanceof a.Comment) | ||
2202 | }) | ||
2203 | } | ||
2204 | } | ||
2205 | }(c("../tree")), | ||
2206 | function(a) { | ||
2207 | a.Extend = function(b, c, d) { | ||
2208 | switch (this.selector = b, this.option = c, this.index = d, this.object_id = a.Extend.next_id++, this.parent_ids = [this.object_id], c) { | ||
2209 | case "all": | ||
2210 | this.allowBefore = !0, this.allowAfter = !0; | ||
2211 | break; | ||
2212 | default: | ||
2213 | this.allowBefore = !1, this.allowAfter = !1 | ||
2214 | } | ||
2215 | }, a.Extend.next_id = 0, a.Extend.prototype = { | ||
2216 | type: "Extend", | ||
2217 | accept: function(a) { | ||
2218 | this.selector = a.visit(this.selector) | ||
2219 | }, | ||
2220 | eval: function(b) { | ||
2221 | return new a.Extend(this.selector.eval(b), this.option, this.index) | ||
2222 | }, | ||
2223 | clone: function() { | ||
2224 | return new a.Extend(this.selector, this.option, this.index) | ||
2225 | }, | ||
2226 | findSelfSelectors: function(a) { | ||
2227 | var b, c, d = []; | ||
2228 | for (b = 0; b < a.length; b++) c = a[b].elements, b > 0 && c.length && "" === c[0].combinator.value && (c[0].combinator.value = " "), d = d.concat(a[b].elements); | ||
2229 | this.selfSelectors = [{ | ||
2230 | elements: d | ||
2231 | }] | ||
2232 | } | ||
2233 | } | ||
2234 | }(c("../tree")), | ||
2235 | function(a) { | ||
2236 | a.Import = function(a, c, d, e, f) { | ||
2237 | if (this.options = d, this.index = e, this.path = a, this.features = c, this.currentFileInfo = f, this.options.less !== b || this.options.inline) this.css = !this.options.less || this.options.inline; | ||
2238 | else { | ||
2239 | var g = this.getPath(); | ||
2240 | g && /css([\?;].*)?$/.test(g) && (this.css = !0) | ||
2241 | } | ||
2242 | }, a.Import.prototype = { | ||
2243 | type: "Import", | ||
2244 | accept: function(a) { | ||
2245 | this.features && (this.features = a.visit(this.features)), this.path = a.visit(this.path), !this.options.inline && this.root && (this.root = a.visit(this.root)) | ||
2246 | }, | ||
2247 | genCSS: function(a, b) { | ||
2248 | this.css && (b.add("@import ", this.currentFileInfo, this.index), this.path.genCSS(a, b), this.features && (b.add(" "), this.features.genCSS(a, b)), b.add(";")) | ||
2249 | }, | ||
2250 | toCSS: a.toCSS, | ||
2251 | getPath: function() { | ||
2252 | if (this.path instanceof a.Quoted) { | ||
2253 | var c = this.path.value; | ||
2254 | return this.css !== b || /(\.[a-z]*$)|([\?;].*)$/.test(c) ? c : c + ".less" | ||
2255 | } | ||
2256 | return this.path instanceof a.URL ? this.path.value.value : null | ||
2257 | }, | ||
2258 | evalForImport: function(b) { | ||
2259 | return new a.Import(this.path.eval(b), this.features, this.options, this.index, this.currentFileInfo) | ||
2260 | }, | ||
2261 | evalPath: function(b) { | ||
2262 | var c = this.path.eval(b), | ||
2263 | d = this.currentFileInfo && this.currentFileInfo.rootpath; | ||
2264 | if (!(c instanceof a.URL)) { | ||
2265 | if (d) { | ||
2266 | var e = c.value; | ||
2267 | e && b.isPathRelative(e) && (c.value = d + e) | ||
2268 | } | ||
2269 | c.value = b.normalizePath(c.value) | ||
2270 | } | ||
2271 | return c | ||
2272 | }, | ||
2273 | eval: function(b) { | ||
2274 | var c, d = this.features && this.features.eval(b); | ||
2275 | if (this.skip && ("function" == typeof this.skip && (this.skip = this.skip()), this.skip)) return []; | ||
2276 | if (this.options.inline) { | ||
2277 | var e = new a.Anonymous(this.root, 0, { | ||
2278 | filename: this.importedFilename | ||
2279 | }, !0); | ||
2280 | return this.features ? new a.Media([e], this.features.value) : [e] | ||
2281 | } | ||
2282 | if (this.css) { | ||
2283 | var f = new a.Import(this.evalPath(b), d, this.options, this.index); | ||
2284 | if (!f.css && this.error) throw this.error; | ||
2285 | return f | ||
2286 | } | ||
2287 | return c = new a.Ruleset(null, this.root.rules.slice(0)), c.evalImports(b), this.features ? new a.Media(c.rules, this.features.value) : c.rules | ||
2288 | } | ||
2289 | } | ||
2290 | }(c("../tree")), | ||
2291 | function(a) { | ||
2292 | a.JavaScript = function(a, b, c) { | ||
2293 | this.escaped = c, this.expression = a, this.index = b | ||
2294 | }, a.JavaScript.prototype = { | ||
2295 | type: "JavaScript", | ||
2296 | eval: function(b) { | ||
2297 | var c, d = this, | ||
2298 | e = {}, | ||
2299 | f = this.expression.replace(/@\{([\w-]+)\}/g, function(c, e) { | ||
2300 | return a.jsify(new a.Variable("@" + e, d.index).eval(b)) | ||
2301 | }); | ||
2302 | try { | ||
2303 | f = new Function("return (" + f + ")") | ||
2304 | } catch (g) { | ||
2305 | throw { | ||
2306 | message: "JavaScript evaluation error: " + g.message + " from `" + f + "`", | ||
2307 | index: this.index | ||
2308 | } | ||
2309 | } | ||
2310 | var h = b.frames[0].variables(); | ||
2311 | for (var i in h) h.hasOwnProperty(i) && (e[i.slice(1)] = { | ||
2312 | value: h[i].value, | ||
2313 | toJS: function() { | ||
2314 | return this.value.eval(b).toCSS() | ||
2315 | } | ||
2316 | }); | ||
2317 | try { | ||
2318 | c = f.call(e) | ||
2319 | } catch (g) { | ||
2320 | throw { | ||
2321 | message: "JavaScript evaluation error: '" + g.name + ": " + g.message.replace(/["]/g, "'") + "'", | ||
2322 | index: this.index | ||
2323 | } | ||
2324 | } | ||
2325 | return "number" == typeof c ? new a.Dimension(c) : "string" == typeof c ? new a.Quoted('"' + c + '"', c, this.escaped, this.index) : new a.Anonymous(Array.isArray(c) ? c.join(", ") : c) | ||
2326 | } | ||
2327 | } | ||
2328 | }(c("../tree")), | ||
2329 | function(a) { | ||
2330 | a.Keyword = function(a) { | ||
2331 | this.value = a | ||
2332 | }, a.Keyword.prototype = { | ||
2333 | type: "Keyword", | ||
2334 | eval: function() { | ||
2335 | return this | ||
2336 | }, | ||
2337 | genCSS: function(a, b) { | ||
2338 | if ("%" === this.value) throw { | ||
2339 | type: "Syntax", | ||
2340 | message: "Invalid % without number" | ||
2341 | }; | ||
2342 | b.add(this.value) | ||
2343 | }, | ||
2344 | toCSS: a.toCSS, | ||
2345 | compare: function(b) { | ||
2346 | return b instanceof a.Keyword ? b.value === this.value ? 0 : 1 : -1 | ||
2347 | } | ||
2348 | }, a.True = new a.Keyword("true"), a.False = new a.Keyword("false") | ||
2349 | }(c("../tree")), | ||
2350 | function(a) { | ||
2351 | a.Media = function(b, c, d, e) { | ||
2352 | this.index = d, this.currentFileInfo = e; | ||
2353 | var f = this.emptySelectors(); | ||
2354 | this.features = new a.Value(c), this.rules = [new a.Ruleset(f, b)], this.rules[0].allowImports = !0 | ||
2355 | }, a.Media.prototype = { | ||
2356 | type: "Media", | ||
2357 | accept: function(a) { | ||
2358 | this.features && (this.features = a.visit(this.features)), this.rules && (this.rules = a.visitArray(this.rules)) | ||
2359 | }, | ||
2360 | genCSS: function(b, c) { | ||
2361 | c.add("@media ", this.currentFileInfo, this.index), this.features.genCSS(b, c), a.outputRuleset(b, c, this.rules) | ||
2362 | }, | ||
2363 | toCSS: a.toCSS, | ||
2364 | eval: function(b) { | ||
2365 | b.mediaBlocks || (b.mediaBlocks = [], b.mediaPath = []); | ||
2366 | var c = new a.Media(null, [], this.index, this.currentFileInfo); | ||
2367 | this.debugInfo && (this.rules[0].debugInfo = this.debugInfo, c.debugInfo = this.debugInfo); | ||
2368 | var d = !1; | ||
2369 | b.strictMath || (d = !0, b.strictMath = !0); | ||
2370 | try { | ||
2371 | c.features = this.features.eval(b) | ||
2372 | } finally { | ||
2373 | d && (b.strictMath = !1) | ||
2374 | } | ||
2375 | return b.mediaPath.push(c), b.mediaBlocks.push(c), b.frames.unshift(this.rules[0]), c.rules = [this.rules[0].eval(b)], b.frames.shift(), b.mediaPath.pop(), 0 === b.mediaPath.length ? c.evalTop(b) : c.evalNested(b) | ||
2376 | }, | ||
2377 | variable: function(b) { | ||
2378 | return a.Ruleset.prototype.variable.call(this.rules[0], b) | ||
2379 | }, | ||
2380 | find: function() { | ||
2381 | return a.Ruleset.prototype.find.apply(this.rules[0], arguments) | ||
2382 | }, | ||
2383 | rulesets: function() { | ||
2384 | return a.Ruleset.prototype.rulesets.apply(this.rules[0]) | ||
2385 | }, | ||
2386 | emptySelectors: function() { | ||
2387 | var b = new a.Element("", "&", this.index, this.currentFileInfo), | ||
2388 | c = [new a.Selector([b], null, null, this.index, this.currentFileInfo)]; | ||
2389 | return c[0].mediaEmpty = !0, c | ||
2390 | }, | ||
2391 | markReferenced: function() { | ||
2392 | var a, b = this.rules[0].rules; | ||
2393 | for (this.rules[0].markReferenced(), this.isReferenced = !0, a = 0; a < b.length; a++) b[a].markReferenced && b[a].markReferenced() | ||
2394 | }, | ||
2395 | evalTop: function(b) { | ||
2396 | var c = this; | ||
2397 | if (b.mediaBlocks.length > 1) { | ||
2398 | var d = this.emptySelectors(); | ||
2399 | c = new a.Ruleset(d, b.mediaBlocks), c.multiMedia = !0 | ||
2400 | } | ||
2401 | return delete b.mediaBlocks, delete b.mediaPath, c | ||
2402 | }, | ||
2403 | evalNested: function(b) { | ||
2404 | var c, d, e = b.mediaPath.concat([this]); | ||
2405 | for (c = 0; c < e.length; c++) d = e[c].features instanceof a.Value ? e[c].features.value : e[c].features, e[c] = Array.isArray(d) ? d : [d]; | ||
2406 | return this.features = new a.Value(this.permute(e).map(function(b) { | ||
2407 | for (b = b.map(function(b) { | ||
2408 | return b.toCSS ? b : new a.Anonymous(b) | ||
2409 | }), c = b.length - 1; c > 0; c--) b.splice(c, 0, new a.Anonymous("and")); | ||
2410 | return new a.Expression(b) | ||
2411 | })), new a.Ruleset([], []) | ||
2412 | }, | ||
2413 | permute: function(a) { | ||
2414 | if (0 === a.length) return []; | ||
2415 | if (1 === a.length) return a[0]; | ||
2416 | for (var b = [], c = this.permute(a.slice(1)), d = 0; d < c.length; d++) | ||
2417 | for (var e = 0; e < a[0].length; e++) b.push([a[0][e]].concat(c[d])); | ||
2418 | return b | ||
2419 | }, | ||
2420 | bubbleSelectors: function(b) { | ||
2421 | b && (this.rules = [new a.Ruleset(b.slice(0), [this.rules[0]])]) | ||
2422 | } | ||
2423 | } | ||
2424 | }(c("../tree")), | ||
2425 | function(a) { | ||
2426 | a.mixin = {}, a.mixin.Call = function(b, c, d, e, f) { | ||
2427 | this.selector = new a.Selector(b), this.arguments = c && c.length ? c : null, this.index = d, this.currentFileInfo = e, this.important = f | ||
2428 | }, a.mixin.Call.prototype = { | ||
2429 | type: "MixinCall", | ||
2430 | accept: function(a) { | ||
2431 | this.selector && (this.selector = a.visit(this.selector)), this.arguments && (this.arguments = a.visitArray(this.arguments)) | ||
2432 | }, | ||
2433 | eval: function(b) { | ||
2434 | var c, d, e, f, g, h, i, j, k, l, m, n, o = [], | ||
2435 | p = !1, | ||
2436 | q = [], | ||
2437 | r = [], | ||
2438 | s = a.defaultFunc, | ||
2439 | t = 0, | ||
2440 | u = 1, | ||
2441 | v = 2; | ||
2442 | for (e = this.arguments && this.arguments.map(function(a) { | ||
2443 | return { | ||
2444 | name: a.name, | ||
2445 | value: a.value.eval(b) | ||
2446 | } | ||
2447 | }), f = 0; f < b.frames.length; f++) | ||
2448 | if ((c = b.frames[f].find(this.selector)).length > 0) { | ||
2449 | for (j = !0, g = 0; g < c.length; g++) { | ||
2450 | for (d = c[g], i = !1, h = 0; h < b.frames.length; h++) | ||
2451 | if (!(d instanceof a.mixin.Definition) && d === (b.frames[h].originalRuleset || b.frames[h])) { | ||
2452 | i = !0; | ||
2453 | break | ||
2454 | } | ||
2455 | if (!i && d.matchArgs(e, b)) { | ||
2456 | if (l = { | ||
2457 | mixin: d, | ||
2458 | group: t | ||
2459 | }, d.matchCondition) { | ||
2460 | for (h = 0; 2 > h; h++) s.value(h), r[h] = d.matchCondition(e, b); | ||
2461 | (r[0] || r[1]) && (r[0] != r[1] && (l.group = r[1] ? u : v), q.push(l)) | ||
2462 | } else q.push(l); | ||
2463 | p = !0 | ||
2464 | } | ||
2465 | } | ||
2466 | for (s.reset(), n = [0, 0, 0], g = 0; g < q.length; g++) n[q[g].group]++; | ||
2467 | if (n[t] > 0) m = v; | ||
2468 | else if (m = u, n[u] + n[v] > 1) throw { | ||
2469 | type: "Runtime", | ||
2470 | message: "Ambiguous use of `default()` found when matching for `" + this.format(e) + "`", | ||
2471 | index: this.index, | ||
2472 | filename: this.currentFileInfo.filename | ||
2473 | }; | ||
2474 | for (g = 0; g < q.length; g++) | ||
2475 | if (l = q[g].group, l === t || l === m) try { | ||
2476 | d = q[g].mixin, d instanceof a.mixin.Definition || (d = new a.mixin.Definition("", [], d.rules, null, !1), d.originalRuleset = c[g].originalRuleset || c[g]), Array.prototype.push.apply(o, d.evalCall(b, e, this.important).rules) | ||
2477 | } catch (w) { | ||
2478 | throw { | ||
2479 | message: w.message, | ||
2480 | index: this.index, | ||
2481 | filename: this.currentFileInfo.filename, | ||
2482 | stack: w.stack | ||
2483 | } | ||
2484 | } | ||
2485 | if (p) { | ||
2486 | if (!this.currentFileInfo || !this.currentFileInfo.reference) | ||
2487 | for (f = 0; f < o.length; f++) k = o[f], k.markReferenced && k.markReferenced(); | ||
2488 | return o | ||
2489 | } | ||
2490 | } | ||
2491 | throw j ? { | ||
2492 | type: "Runtime", | ||
2493 | message: "No matching definition was found for `" + this.format(e) + "`", | ||
2494 | index: this.index, | ||
2495 | filename: this.currentFileInfo.filename | ||
2496 | } : { | ||
2497 | type: "Name", | ||
2498 | message: this.selector.toCSS().trim() + " is undefined", | ||
2499 | index: this.index, | ||
2500 | filename: this.currentFileInfo.filename | ||
2501 | } | ||
2502 | }, | ||
2503 | format: function(a) { | ||
2504 | return this.selector.toCSS().trim() + "(" + (a ? a.map(function(a) { | ||
2505 | var b = ""; | ||
2506 | return a.name && (b += a.name + ":"), b += a.value.toCSS ? a.value.toCSS() : "???" | ||
2507 | }).join(", ") : "") + ")" | ||
2508 | } | ||
2509 | }, a.mixin.Definition = function(b, c, d, e, f, g) { | ||
2510 | this.name = b, this.selectors = [new a.Selector([new a.Element(null, b, this.index, this.currentFileInfo)])], this.params = c, this.condition = e, this.variadic = f, this.arity = c.length, this.rules = d, this._lookups = {}, this.required = c.reduce(function(a, b) { | ||
2511 | return !b.name || b.name && !b.value ? a + 1 : a | ||
2512 | }, 0), this.parent = a.Ruleset.prototype, this.frames = g | ||
2513 | }, a.mixin.Definition.prototype = { | ||
2514 | type: "MixinDefinition", | ||
2515 | accept: function(a) { | ||
2516 | this.params && this.params.length && (this.params = a.visitArray(this.params)), this.rules = a.visitArray(this.rules), this.condition && (this.condition = a.visit(this.condition)) | ||
2517 | }, | ||
2518 | variable: function(a) { | ||
2519 | return this.parent.variable.call(this, a) | ||
2520 | }, | ||
2521 | variables: function() { | ||
2522 | return this.parent.variables.call(this) | ||
2523 | }, | ||
2524 | find: function() { | ||
2525 | return this.parent.find.apply(this, arguments) | ||
2526 | }, | ||
2527 | rulesets: function() { | ||
2528 | return this.parent.rulesets.apply(this) | ||
2529 | }, | ||
2530 | evalParams: function(b, c, d, e) { | ||
2531 | var f, g, h, i, j, k, l, m, n = new a.Ruleset(null, null), | ||
2532 | o = this.params.slice(0), | ||
2533 | p = 0; | ||
2534 | if (c = new a.evalEnv(c, [n].concat(c.frames)), d) | ||
2535 | for (d = d.slice(0), p = d.length, h = 0; p > h; h++) | ||
2536 | if (g = d[h], k = g && g.name) { | ||
2537 | for (l = !1, i = 0; i < o.length; i++) | ||
2538 | if (!e[i] && k === o[i].name) { | ||
2539 | e[i] = g.value.eval(b), n.prependRule(new a.Rule(k, g.value.eval(b))), l = !0; | ||
2540 | break | ||
2541 | } | ||
2542 | if (l) { | ||
2543 | d.splice(h, 1), h--; | ||
2544 | continue | ||
2545 | } | ||
2546 | throw { | ||
2547 | type: "Runtime", | ||
2548 | message: "Named argument for " + this.name + " " + d[h].name + " not found" | ||
2549 | } | ||
2550 | } | ||
2551 | for (m = 0, h = 0; h < o.length; h++) | ||
2552 | if (!e[h]) { | ||
2553 | if (g = d && d[m], k = o[h].name) | ||
2554 | if (o[h].variadic) { | ||
2555 | for (f = [], i = m; p > i; i++) f.push(d[i].value.eval(b)); | ||
2556 | n.prependRule(new a.Rule(k, new a.Expression(f).eval(b))) | ||
2557 | } else { | ||
2558 | if (j = g && g.value) j = j.eval(b); | ||
2559 | else { | ||
2560 | if (!o[h].value) throw { | ||
2561 | type: "Runtime", | ||
2562 | message: "wrong number of arguments for " + this.name + " (" + p + " for " + this.arity + ")" | ||
2563 | }; | ||
2564 | j = o[h].value.eval(c), n.resetCache() | ||
2565 | } | ||
2566 | n.prependRule(new a.Rule(k, j)), e[h] = j | ||
2567 | } | ||
2568 | if (o[h].variadic && d) | ||
2569 | for (i = m; p > i; i++) e[i] = d[i].value.eval(b); | ||
2570 | m++ | ||
2571 | } | ||
2572 | return n | ||
2573 | }, | ||
2574 | eval: function(b) { | ||
2575 | return new a.mixin.Definition(this.name, this.params, this.rules, this.condition, this.variadic, this.frames || b.frames.slice(0)) | ||
2576 | }, | ||
2577 | evalCall: function(b, c, d) { | ||
2578 | var e, f, g = [], | ||
2579 | h = this.frames ? this.frames.concat(b.frames) : b.frames, | ||
2580 | i = this.evalParams(b, new a.evalEnv(b, h), c, g); | ||
2581 | return i.prependRule(new a.Rule("@arguments", new a.Expression(g).eval(b))), e = this.rules.slice(0), f = new a.Ruleset(null, e), f.originalRuleset = this, f = f.eval(new a.evalEnv(b, [this, i].concat(h))), d && (f = this.parent.makeImportant.apply(f)), f | ||
2582 | }, | ||
2583 | matchCondition: function(b, c) { | ||
2584 | return this.condition && !this.condition.eval(new a.evalEnv(c, [this.evalParams(c, new a.evalEnv(c, this.frames.concat(c.frames)), b, [])].concat(this.frames).concat(c.frames))) ? !1 : !0 | ||
2585 | }, | ||
2586 | matchArgs: function(a, b) { | ||
2587 | var c, d = a && a.length || 0; | ||
2588 | if (this.variadic) { | ||
2589 | if (d < this.required - 1) return !1 | ||
2590 | } else { | ||
2591 | if (d < this.required) return !1; | ||
2592 | if (d > this.params.length) return !1 | ||
2593 | } | ||
2594 | c = Math.min(d, this.arity); | ||
2595 | for (var e = 0; c > e; e++) | ||
2596 | if (!this.params[e].name && !this.params[e].variadic && a[e].value.eval(b).toCSS() != this.params[e].value.eval(b).toCSS()) return !1; | ||
2597 | return !0 | ||
2598 | } | ||
2599 | } | ||
2600 | }(c("../tree")), | ||
2601 | function(a) { | ||
2602 | a.Negative = function(a) { | ||
2603 | this.value = a | ||
2604 | }, a.Negative.prototype = { | ||
2605 | type: "Negative", | ||
2606 | accept: function(a) { | ||
2607 | this.value = a.visit(this.value) | ||
2608 | }, | ||
2609 | genCSS: function(a, b) { | ||
2610 | b.add("-"), this.value.genCSS(a, b) | ||
2611 | }, | ||
2612 | toCSS: a.toCSS, | ||
2613 | eval: function(b) { | ||
2614 | return b.isMathOn() ? new a.Operation("*", [new a.Dimension(-1), this.value]).eval(b) : new a.Negative(this.value.eval(b)) | ||
2615 | } | ||
2616 | } | ||
2617 | }(c("../tree")), | ||
2618 | function(a) { | ||
2619 | a.Operation = function(a, b, c) { | ||
2620 | this.op = a.trim(), this.operands = b, this.isSpaced = c | ||
2621 | }, a.Operation.prototype = { | ||
2622 | type: "Operation", | ||
2623 | accept: function(a) { | ||
2624 | this.operands = a.visit(this.operands) | ||
2625 | }, | ||
2626 | eval: function(b) { | ||
2627 | var c = this.operands[0].eval(b), | ||
2628 | d = this.operands[1].eval(b); | ||
2629 | if (b.isMathOn()) { | ||
2630 | if (c instanceof a.Dimension && d instanceof a.Color && (c = c.toColor()), d instanceof a.Dimension && c instanceof a.Color && (d = d.toColor()), !c.operate) throw { | ||
2631 | type: "Operation", | ||
2632 | message: "Operation on an invalid type" | ||
2633 | }; | ||
2634 | return c.operate(b, this.op, d) | ||
2635 | } | ||
2636 | return new a.Operation(this.op, [c, d], this.isSpaced) | ||
2637 | }, | ||
2638 | genCSS: function(a, b) { | ||
2639 | this.operands[0].genCSS(a, b), this.isSpaced && b.add(" "), b.add(this.op), this.isSpaced && b.add(" "), this.operands[1].genCSS(a, b) | ||
2640 | }, | ||
2641 | toCSS: a.toCSS | ||
2642 | }, a.operate = function(a, b, c, d) { | ||
2643 | switch (b) { | ||
2644 | case "+": | ||
2645 | return c + d; | ||
2646 | case "-": | ||
2647 | return c - d; | ||
2648 | case "*": | ||
2649 | return c * d; | ||
2650 | case "/": | ||
2651 | return c / d | ||
2652 | } | ||
2653 | } | ||
2654 | }(c("../tree")), | ||
2655 | function(a) { | ||
2656 | a.Paren = function(a) { | ||
2657 | this.value = a | ||
2658 | }, a.Paren.prototype = { | ||
2659 | type: "Paren", | ||
2660 | accept: function(a) { | ||
2661 | this.value = a.visit(this.value) | ||
2662 | }, | ||
2663 | genCSS: function(a, b) { | ||
2664 | b.add("("), this.value.genCSS(a, b), b.add(")") | ||
2665 | }, | ||
2666 | toCSS: a.toCSS, | ||
2667 | eval: function(b) { | ||
2668 | return new a.Paren(this.value.eval(b)) | ||
2669 | } | ||
2670 | } | ||
2671 | }(c("../tree")), | ||
2672 | function(a) { | ||
2673 | a.Quoted = function(a, b, c, d, e) { | ||
2674 | this.escaped = c, this.value = b || "", this.quote = a.charAt(0), this.index = d, this.currentFileInfo = e | ||
2675 | }, a.Quoted.prototype = { | ||
2676 | type: "Quoted", | ||
2677 | genCSS: function(a, b) { | ||
2678 | this.escaped || b.add(this.quote, this.currentFileInfo, this.index), b.add(this.value), this.escaped || b.add(this.quote) | ||
2679 | }, | ||
2680 | toCSS: a.toCSS, | ||
2681 | eval: function(b) { | ||
2682 | var c = this, | ||
2683 | d = this.value.replace(/`([^`]+)`/g, function(d, e) { | ||
2684 | return new a.JavaScript(e, c.index, !0).eval(b).value | ||
2685 | }).replace(/@\{([\w-]+)\}/g, function(d, e) { | ||
2686 | var f = new a.Variable("@" + e, c.index, c.currentFileInfo).eval(b, !0); | ||
2687 | return f instanceof a.Quoted ? f.value : f.toCSS() | ||
2688 | }); | ||
2689 | return new a.Quoted(this.quote + d + this.quote, d, this.escaped, this.index, this.currentFileInfo) | ||
2690 | }, | ||
2691 | compare: function(a) { | ||
2692 | if (!a.toCSS) return -1; | ||
2693 | var b = this.toCSS(), | ||
2694 | c = a.toCSS(); | ||
2695 | return b === c ? 0 : c > b ? -1 : 1 | ||
2696 | } | ||
2697 | } | ||
2698 | }(c("../tree")), | ||
2699 | function(a) { | ||
2700 | function b(a, b) { | ||
2701 | var c, d = "", | ||
2702 | e = b.length, | ||
2703 | f = { | ||
2704 | add: function(a) { | ||
2705 | d += a | ||
2706 | } | ||
2707 | }; | ||
2708 | for (c = 0; e > c; c++) b[c].eval(a).genCSS(a, f); | ||
2709 | return d | ||
2710 | } | ||
2711 | a.Rule = function(b, c, d, e, f, g, h) { | ||
2712 | this.name = b, this.value = c instanceof a.Value || c instanceof a.Ruleset ? c : new a.Value([c]), this.important = d ? " " + d.trim() : "", this.merge = e, this.index = f, this.currentFileInfo = g, this.inline = h || !1, this.variable = b.charAt && "@" === b.charAt(0) | ||
2713 | }, a.Rule.prototype = { | ||
2714 | type: "Rule", | ||
2715 | accept: function(a) { | ||
2716 | this.value = a.visit(this.value) | ||
2717 | }, | ||
2718 | genCSS: function(a, b) { | ||
2719 | b.add(this.name + (a.compress ? ":" : ": "), this.currentFileInfo, this.index); | ||
2720 | try { | ||
2721 | this.value.genCSS(a, b) | ||
2722 | } catch (c) { | ||
2723 | throw c.index = this.index, c.filename = this.currentFileInfo.filename, c | ||
2724 | } | ||
2725 | b.add(this.important + (this.inline || a.lastRule && a.compress ? "" : ";"), this.currentFileInfo, this.index) | ||
2726 | }, | ||
2727 | toCSS: a.toCSS, | ||
2728 | eval: function(c) { | ||
2729 | var d, e = !1, | ||
2730 | f = this.name; | ||
2731 | "string" != typeof f && (f = 1 === f.length && f[0] instanceof a.Keyword ? f[0].value : b(c, f)), "font" !== f || c.strictMath || (e = !0, c.strictMath = !0); | ||
2732 | try { | ||
2733 | if (d = this.value.eval(c), !this.variable && "DetachedRuleset" === d.type) throw { | ||
2734 | message: "Rulesets cannot be evaluated on a property.", | ||
2735 | index: this.index, | ||
2736 | filename: this.currentFileInfo.filename | ||
2737 | }; | ||
2738 | return new a.Rule(f, d, this.important, this.merge, this.index, this.currentFileInfo, this.inline) | ||
2739 | } catch (g) { | ||
2740 | throw "number" != typeof g.index && (g.index = this.index, g.filename = this.currentFileInfo.filename), g | ||
2741 | } finally { | ||
2742 | e && (c.strictMath = !1) | ||
2743 | } | ||
2744 | }, | ||
2745 | makeImportant: function() { | ||
2746 | return new a.Rule(this.name, this.value, "!important", this.merge, this.index, this.currentFileInfo, this.inline) | ||
2747 | } | ||
2748 | } | ||
2749 | }(c("../tree")), | ||
2750 | function(a) { | ||
2751 | a.RulesetCall = function(a) { | ||
2752 | this.variable = a | ||
2753 | }, a.RulesetCall.prototype = { | ||
2754 | type: "RulesetCall", | ||
2755 | accept: function() {}, | ||
2756 | eval: function(b) { | ||
2757 | var c = new a.Variable(this.variable).eval(b); | ||
2758 | return c.callEval(b) | ||
2759 | } | ||
2760 | } | ||
2761 | }(c("../tree")), | ||
2762 | function(a) { | ||
2763 | a.Ruleset = function(a, b, c) { | ||
2764 | this.selectors = a, this.rules = b, this._lookups = {}, this.strictImports = c | ||
2765 | }, a.Ruleset.prototype = { | ||
2766 | type: "Ruleset", | ||
2767 | accept: function(a) { | ||
2768 | this.paths ? a.visitArray(this.paths, !0) : this.selectors && (this.selectors = a.visitArray(this.selectors)), this.rules && this.rules.length && (this.rules = a.visitArray(this.rules)) | ||
2769 | }, | ||
2770 | eval: function(b) { | ||
2771 | var c, d, e, f, g = this.selectors, | ||
2772 | h = a.defaultFunc, | ||
2773 | i = !1; | ||
2774 | if (g && (d = g.length)) { | ||
2775 | for (c = [], h.error({ | ||
2776 | type: "Syntax", | ||
2777 | message: "it is currently only allowed in parametric mixin guards," | ||
2778 | }), f = 0; d > f; f++) e = g[f].eval(b), c.push(e), e.evaldCondition && (i = !0); | ||
2779 | h.reset() | ||
2780 | } else i = !0; | ||
2781 | var j, k, l = this.rules ? this.rules.slice(0) : null, | ||
2782 | m = new a.Ruleset(c, l, this.strictImports); | ||
2783 | m.originalRuleset = this, m.root = this.root, m.firstRoot = this.firstRoot, m.allowImports = this.allowImports, this.debugInfo && (m.debugInfo = this.debugInfo), i || (l.length = 0); | ||
2784 | var n = b.frames; | ||
2785 | n.unshift(m); | ||
2786 | var o = b.selectors; | ||
2787 | o || (b.selectors = o = []), o.unshift(this.selectors), (m.root || m.allowImports || !m.strictImports) && m.evalImports(b); | ||
2788 | var p = m.rules, | ||
2789 | q = p ? p.length : 0; | ||
2790 | for (f = 0; q > f; f++)(p[f] instanceof a.mixin.Definition || p[f] instanceof a.DetachedRuleset) && (p[f] = p[f].eval(b)); | ||
2791 | var r = b.mediaBlocks && b.mediaBlocks.length || 0; | ||
2792 | for (f = 0; q > f; f++) p[f] instanceof a.mixin.Call ? (l = p[f].eval(b).filter(function(b) { | ||
2793 | return b instanceof a.Rule && b.variable ? !m.variable(b.name) : !0 | ||
2794 | }), p.splice.apply(p, [f, 1].concat(l)), q += l.length - 1, f += l.length - 1, m.resetCache()) : p[f] instanceof a.RulesetCall && (l = p[f].eval(b).rules.filter(function(b) { | ||
2795 | return b instanceof a.Rule && b.variable ? !1 : !0 | ||
2796 | }), p.splice.apply(p, [f, 1].concat(l)), q += l.length - 1, f += l.length - 1, m.resetCache()); | ||
2797 | for (f = 0; f < p.length; f++) j = p[f], j instanceof a.mixin.Definition || j instanceof a.DetachedRuleset || (p[f] = j = j.eval ? j.eval(b) : j); | ||
2798 | for (f = 0; f < p.length; f++) | ||
2799 | if (j = p[f], j instanceof a.Ruleset && j.selectors && 1 === j.selectors.length && j.selectors[0].isJustParentSelector()) { | ||
2800 | p.splice(f--, 1); | ||
2801 | for (var s = 0; s < j.rules.length; s++) k = j.rules[s], k instanceof a.Rule && k.variable || p.splice(++f, 0, k) | ||
2802 | } | ||
2803 | if (n.shift(), o.shift(), b.mediaBlocks) | ||
2804 | for (f = r; f < b.mediaBlocks.length; f++) b.mediaBlocks[f].bubbleSelectors(c); | ||
2805 | return m | ||
2806 | }, | ||
2807 | evalImports: function(b) { | ||
2808 | var c, d, e = this.rules; | ||
2809 | if (e) | ||
2810 | for (c = 0; c < e.length; c++) e[c] instanceof a.Import && (d = e[c].eval(b), d && d.length ? (e.splice.apply(e, [c, 1].concat(d)), c += d.length - 1) : e.splice(c, 1, d), this.resetCache()) | ||
2811 | }, | ||
2812 | makeImportant: function() { | ||
2813 | return new a.Ruleset(this.selectors, this.rules.map(function(a) { | ||
2814 | return a.makeImportant ? a.makeImportant() : a | ||
2815 | }), this.strictImports) | ||
2816 | }, | ||
2817 | matchArgs: function(a) { | ||
2818 | return !a || 0 === a.length | ||
2819 | }, | ||
2820 | matchCondition: function(b, c) { | ||
2821 | var d = this.selectors[this.selectors.length - 1]; | ||
2822 | return d.evaldCondition ? d.condition && !d.condition.eval(new a.evalEnv(c, c.frames)) ? !1 : !0 : !1 | ||
2823 | }, | ||
2824 | resetCache: function() { | ||
2825 | this._rulesets = null, this._variables = null, this._lookups = {} | ||
2826 | }, | ||
2827 | variables: function() { | ||
2828 | return this._variables || (this._variables = this.rules ? this.rules.reduce(function(b, c) { | ||
2829 | return c instanceof a.Rule && c.variable === !0 && (b[c.name] = c), b | ||
2830 | }, {}) : {}), this._variables | ||
2831 | }, | ||
2832 | variable: function(a) { | ||
2833 | return this.variables()[a] | ||
2834 | }, | ||
2835 | rulesets: function() { | ||
2836 | if (!this.rules) return null; | ||
2837 | var b, c, d = a.Ruleset, | ||
2838 | e = a.mixin.Definition, | ||
2839 | f = [], | ||
2840 | g = this.rules, | ||
2841 | h = g.length; | ||
2842 | for (b = 0; h > b; b++) c = g[b], (c instanceof d || c instanceof e) && f.push(c); | ||
2843 | return f | ||
2844 | }, | ||
2845 | prependRule: function(a) { | ||
2846 | var b = this.rules; | ||
2847 | b ? b.unshift(a) : this.rules = [a] | ||
2848 | }, | ||
2849 | find: function(b, c) { | ||
2850 | c = c || this; | ||
2851 | var d, e = [], | ||
2852 | f = b.toCSS(); | ||
2853 | return f in this._lookups ? this._lookups[f] : (this.rulesets().forEach(function(f) { | ||
2854 | if (f !== c) | ||
2855 | for (var g = 0; g < f.selectors.length; g++) | ||
2856 | if (d = b.match(f.selectors[g])) { | ||
2857 | b.elements.length > d ? Array.prototype.push.apply(e, f.find(new a.Selector(b.elements.slice(d)), c)) : e.push(f); | ||
2858 | break | ||
2859 | } | ||
2860 | }), this._lookups[f] = e, e) | ||
2861 | }, | ||
2862 | genCSS: function(b, c) { | ||
2863 | var d, e, f, g, h, i, j = [], | ||
2864 | k = []; | ||
2865 | b.tabLevel = b.tabLevel || 0, this.root || b.tabLevel++; | ||
2866 | var l, m = b.compress ? "" : Array(b.tabLevel + 1).join(" "), | ||
2867 | n = b.compress ? "" : Array(b.tabLevel).join(" "); | ||
2868 | for (d = 0; d < this.rules.length; d++) h = this.rules[d], h.rules || h instanceof a.Media || h instanceof a.Directive || this.root && h instanceof a.Comment ? k.push(h) : j.push(h); | ||
2869 | if (!this.root) { | ||
2870 | g = a.debugInfo(b, this, n), g && (c.add(g), c.add(n)); | ||
2871 | var o, p = this.paths, | ||
2872 | q = p.length; | ||
2873 | for (l = b.compress ? "," : ",\n" + n, d = 0; q > d; d++) | ||
2874 | if (i = p[d], o = i.length) | ||
2875 | for (d > 0 && c.add(l), b.firstSelector = !0, i[0].genCSS(b, c), b.firstSelector = !1, e = 1; o > e; e++) i[e].genCSS(b, c); | ||
2876 | c.add((b.compress ? "{" : " {\n") + m) | ||
2877 | } | ||
2878 | for (d = 0; d < j.length; d++) h = j[d], d + 1 !== j.length || this.root && 0 !== k.length && !this.firstRoot || (b.lastRule = !0), h.genCSS ? h.genCSS(b, c) : h.value && c.add(h.value.toString()), b.lastRule ? b.lastRule = !1 : c.add(b.compress ? "" : "\n" + m); | ||
2879 | if (this.root || (c.add(b.compress ? "}" : "\n" + n + "}"), b.tabLevel--), l = (b.compress ? "" : "\n") + (this.root ? m : n), f = k.length) | ||
2880 | for (j.length && l && c.add(l), k[0].genCSS(b, c), d = 1; f > d; d++) l && c.add(l), k[d].genCSS(b, c); | ||
2881 | c.isEmpty() || b.compress || !this.firstRoot || c.add("\n") | ||
2882 | }, | ||
2883 | toCSS: a.toCSS, | ||
2884 | markReferenced: function() { | ||
2885 | if (this.selectors) | ||
2886 | for (var a = 0; a < this.selectors.length; a++) this.selectors[a].markReferenced() | ||
2887 | }, | ||
2888 | joinSelectors: function(a, b, c) { | ||
2889 | for (var d = 0; d < c.length; d++) this.joinSelector(a, b, c[d]) | ||
2890 | }, | ||
2891 | joinSelector: function(b, c, d) { | ||
2892 | var e, f, g, h, i, j, k, l, m, n, o, p, q, r, s; | ||
2893 | for (e = 0; e < d.elements.length; e++) j = d.elements[e], "&" === j.value && (h = !0); | ||
2894 | if (h) { | ||
2895 | for (r = [], i = [ | ||
2896 | [] | ||
2897 | ], e = 0; e < d.elements.length; e++) | ||
2898 | if (j = d.elements[e], "&" !== j.value) r.push(j); | ||
2899 | else { | ||
2900 | for (s = [], r.length > 0 && this.mergeElementsOnToSelectors(r, i), f = 0; f < i.length; f++) | ||
2901 | if (k = i[f], 0 === c.length) k.length > 0 && (k[0].elements = k[0].elements.slice(0), k[0].elements.push(new a.Element(j.combinator, "", j.index, j.currentFileInfo))), s.push(k); | ||
2902 | else | ||
2903 | for (g = 0; g < c.length; g++) l = c[g], m = [], n = [], p = !0, k.length > 0 ? (m = k.slice(0), q = m.pop(), o = d.createDerived(q.elements.slice(0)), p = !1) : o = d.createDerived([]), l.length > 1 && (n = n.concat(l.slice(1))), l.length > 0 && (p = !1, o.elements.push(new a.Element(j.combinator, l[0].elements[0].value, j.index, j.currentFileInfo)), o.elements = o.elements.concat(l[0].elements.slice(1))), p || m.push(o), m = m.concat(n), s.push(m); | ||
2904 | i = s, r = [] | ||
2905 | } | ||
2906 | for (r.length > 0 && this.mergeElementsOnToSelectors(r, i), e = 0; e < i.length; e++) i[e].length > 0 && b.push(i[e]) | ||
2907 | } else if (c.length > 0) | ||
2908 | for (e = 0; e < c.length; e++) b.push(c[e].concat(d)); | ||
2909 | else b.push([d]) | ||
2910 | }, | ||
2911 | mergeElementsOnToSelectors: function(b, c) { | ||
2912 | var d, e; | ||
2913 | if (0 === c.length) return void c.push([new a.Selector(b)]); | ||
2914 | for (d = 0; d < c.length; d++) e = c[d], e.length > 0 ? e[e.length - 1] = e[e.length - 1].createDerived(e[e.length - 1].elements.concat(b)) : e.push(new a.Selector(b)) | ||
2915 | } | ||
2916 | } | ||
2917 | }(c("../tree")), | ||
2918 | function(a) { | ||
2919 | a.Selector = function(a, b, c, d, e, f) { | ||
2920 | this.elements = a, this.extendList = b, this.condition = c, this.currentFileInfo = e || {}, this.isReferenced = f, c || (this.evaldCondition = !0) | ||
2921 | }, a.Selector.prototype = { | ||
2922 | type: "Selector", | ||
2923 | accept: function(a) { | ||
2924 | this.elements && (this.elements = a.visitArray(this.elements)), this.extendList && (this.extendList = a.visitArray(this.extendList)), this.condition && (this.condition = a.visit(this.condition)) | ||
2925 | }, | ||
2926 | createDerived: function(b, c, d) { | ||
2927 | d = null != d ? d : this.evaldCondition; | ||
2928 | var e = new a.Selector(b, c || this.extendList, null, this.index, this.currentFileInfo, this.isReferenced); | ||
2929 | return e.evaldCondition = d, e.mediaEmpty = this.mediaEmpty, e | ||
2930 | }, | ||
2931 | match: function(a) { | ||
2932 | var b, c, d = this.elements, | ||
2933 | e = d.length; | ||
2934 | if (a.CacheElements(), b = a._elements.length, 0 === b || b > e) return 0; | ||
2935 | for (c = 0; b > c; c++) | ||
2936 | if (d[c].value !== a._elements[c]) return 0; | ||
2937 | return b | ||
2938 | }, | ||
2939 | CacheElements: function() { | ||
2940 | var a, b, c, d = ""; | ||
2941 | if (!this._elements) { | ||
2942 | for (a = this.elements.length, c = 0; a > c; c++) | ||
2943 | if (b = this.elements[c], d += b.combinator.value, b.value.value) { | ||
2944 | if ("string" != typeof b.value.value) { | ||
2945 | d = ""; | ||
2946 | break | ||
2947 | } | ||
2948 | d += b.value.value | ||
2949 | } else d += b.value; | ||
2950 | this._elements = d.match(/[,&#\.\w-]([\w-]|(\\.))*/g), this._elements ? "&" === this._elements[0] && this._elements.shift() : this._elements = [] | ||
2951 | } | ||
2952 | }, | ||
2953 | isJustParentSelector: function() { | ||
2954 | return !this.mediaEmpty && 1 === this.elements.length && "&" === this.elements[0].value && (" " === this.elements[0].combinator.value || "" === this.elements[0].combinator.value) | ||
2955 | }, | ||
2956 | eval: function(a) { | ||
2957 | var b = this.condition && this.condition.eval(a), | ||
2958 | c = this.elements, | ||
2959 | d = this.extendList; | ||
2960 | return c = c && c.map(function(b) { | ||
2961 | return b.eval(a) | ||
2962 | }), d = d && d.map(function(b) { | ||
2963 | return b.eval(a) | ||
2964 | }), this.createDerived(c, d, b) | ||
2965 | }, | ||
2966 | genCSS: function(a, b) { | ||
2967 | var c, d; | ||
2968 | if (a && a.firstSelector || "" !== this.elements[0].combinator.value || b.add(" ", this.currentFileInfo, this.index), !this._css) | ||
2969 | for (c = 0; c < this.elements.length; c++) d = this.elements[c], d.genCSS(a, b) | ||
2970 | }, | ||
2971 | toCSS: a.toCSS, | ||
2972 | markReferenced: function() { | ||
2973 | this.isReferenced = !0 | ||
2974 | }, | ||
2975 | getIsReferenced: function() { | ||
2976 | return !this.currentFileInfo.reference || this.isReferenced | ||
2977 | }, | ||
2978 | getIsOutput: function() { | ||
2979 | return this.evaldCondition | ||
2980 | } | ||
2981 | } | ||
2982 | }(c("../tree")), | ||
2983 | function(a) { | ||
2984 | a.UnicodeDescriptor = function(a) { | ||
2985 | this.value = a | ||
2986 | }, a.UnicodeDescriptor.prototype = { | ||
2987 | type: "UnicodeDescriptor", | ||
2988 | genCSS: function(a, b) { | ||
2989 | b.add(this.value) | ||
2990 | }, | ||
2991 | toCSS: a.toCSS, | ||
2992 | eval: function() { | ||
2993 | return this | ||
2994 | } | ||
2995 | } | ||
2996 | }(c("../tree")), | ||
2997 | function(a) { | ||
2998 | a.URL = function(a, b, c) { | ||
2999 | this.value = a, this.currentFileInfo = b, this.isEvald = c | ||
3000 | }, a.URL.prototype = { | ||
3001 | type: "Url", | ||
3002 | accept: function(a) { | ||
3003 | this.value = a.visit(this.value) | ||
3004 | }, | ||
3005 | genCSS: function(a, b) { | ||
3006 | b.add("url("), this.value.genCSS(a, b), b.add(")") | ||
3007 | }, | ||
3008 | toCSS: a.toCSS, | ||
3009 | eval: function(b) { | ||
3010 | var c, d = this.value.eval(b); | ||
3011 | if (!this.isEvald && (c = this.currentFileInfo && this.currentFileInfo.rootpath, c && "string" == typeof d.value && b.isPathRelative(d.value) && (d.quote || (c = c.replace(/[\(\)'"\s]/g, function(a) { | ||
3012 | return "\\" + a | ||
3013 | })), d.value = c + d.value), d.value = b.normalizePath(d.value), b.urlArgs && !d.value.match(/^\s*data:/))) { | ||
3014 | var e = -1 === d.value.indexOf("?") ? "?" : "&", | ||
3015 | f = e + b.urlArgs; - 1 !== d.value.indexOf("#") ? d.value = d.value.replace("#", f + "#") : d.value += f | ||
3016 | } | ||
3017 | return new a.URL(d, this.currentFileInfo, !0) | ||
3018 | } | ||
3019 | } | ||
3020 | }(c("../tree")), | ||
3021 | function(a) { | ||
3022 | a.Value = function(a) { | ||
3023 | this.value = a | ||
3024 | }, a.Value.prototype = { | ||
3025 | type: "Value", | ||
3026 | accept: function(a) { | ||
3027 | this.value && (this.value = a.visitArray(this.value)) | ||
3028 | }, | ||
3029 | eval: function(b) { | ||
3030 | return 1 === this.value.length ? this.value[0].eval(b) : new a.Value(this.value.map(function(a) { | ||
3031 | return a.eval(b) | ||
3032 | })) | ||
3033 | }, | ||
3034 | genCSS: function(a, b) { | ||
3035 | var c; | ||
3036 | for (c = 0; c < this.value.length; c++) this.value[c].genCSS(a, b), c + 1 < this.value.length && b.add(a && a.compress ? "," : ", ") | ||
3037 | }, | ||
3038 | toCSS: a.toCSS | ||
3039 | } | ||
3040 | }(c("../tree")), | ||
3041 | function(a) { | ||
3042 | a.Variable = function(a, b, c) { | ||
3043 | this.name = a, this.index = b, this.currentFileInfo = c || {} | ||
3044 | }, a.Variable.prototype = { | ||
3045 | type: "Variable", | ||
3046 | eval: function(b) { | ||
3047 | var c, d = this.name; | ||
3048 | if (0 === d.indexOf("@@") && (d = "@" + new a.Variable(d.slice(1)).eval(b).value), this.evaluating) throw { | ||
3049 | type: "Name", | ||
3050 | message: "Recursive variable definition for " + d, | ||
3051 | filename: this.currentFileInfo.file, | ||
3052 | index: this.index | ||
3053 | }; | ||
3054 | if (this.evaluating = !0, c = a.find(b.frames, function(a) { | ||
3055 | var c = a.variable(d); | ||
3056 | return c ? c.value.eval(b) : void 0 | ||
3057 | })) return this.evaluating = !1, c; | ||
3058 | throw { | ||
3059 | type: "Name", | ||
3060 | message: "variable " + d + " is undefined", | ||
3061 | filename: this.currentFileInfo.filename, | ||
3062 | index: this.index | ||
3063 | } | ||
3064 | } | ||
3065 | } | ||
3066 | }(c("../tree")), | ||
3067 | function(a) { | ||
3068 | var b = ["paths", "optimization", "files", "contents", "contentsIgnoredChars", "relativeUrls", "rootpath", "strictImports", "insecure", "dumpLineNumbers", "compress", "processImports", "syncImport", "javascriptEnabled", "mime", "useFileCache", "currentFileInfo"]; | ||
3069 | a.parseEnv = function(a) { | ||
3070 | if (d(a, this, b), this.contents || (this.contents = {}), this.contentsIgnoredChars || (this.contentsIgnoredChars = {}), this.files || (this.files = {}), !this.currentFileInfo) { | ||
3071 | var c = a && a.filename || "input", | ||
3072 | e = c.replace(/[^\/\\]*$/, ""); | ||
3073 | a && (a.filename = null), this.currentFileInfo = { | ||
3074 | filename: c, | ||
3075 | relativeUrls: this.relativeUrls, | ||
3076 | rootpath: a && a.rootpath || "", | ||
3077 | currentDirectory: e, | ||
3078 | entryPath: e, | ||
3079 | rootFilename: c | ||
3080 | } | ||
3081 | } | ||
3082 | }; | ||
3083 | var c = ["silent", "verbose", "compress", "yuicompress", "ieCompat", "strictMath", "strictUnits", "cleancss", "sourceMap", "importMultiple", "urlArgs"]; | ||
3084 | a.evalEnv = function(a, b) { | ||
3085 | d(a, this, c), this.frames = b || [] | ||
3086 | }, a.evalEnv.prototype.inParenthesis = function() { | ||
3087 | this.parensStack || (this.parensStack = []), this.parensStack.push(!0) | ||
3088 | }, a.evalEnv.prototype.outOfParenthesis = function() { | ||
3089 | this.parensStack.pop() | ||
3090 | }, a.evalEnv.prototype.isMathOn = function() { | ||
3091 | return this.strictMath ? this.parensStack && this.parensStack.length : !0 | ||
3092 | }, a.evalEnv.prototype.isPathRelative = function(a) { | ||
3093 | return !/^(?:[a-z-]+:|\/)/.test(a) | ||
3094 | }, a.evalEnv.prototype.normalizePath = function(a) { | ||
3095 | var b, c = a.split("/").reverse(); | ||
3096 | for (a = []; 0 !== c.length;) switch (b = c.pop()) { | ||
3097 | case ".": | ||
3098 | break; | ||
3099 | case "..": | ||
3100 | 0 === a.length || ".." === a[a.length - 1] ? a.push(b) : a.pop(); | ||
3101 | break; | ||
3102 | default: | ||
3103 | a.push(b) | ||
3104 | } | ||
3105 | return a.join("/") | ||
3106 | }; | ||
3107 | var d = function(a, b, c) { | ||
3108 | if (a) | ||
3109 | for (var d = 0; d < c.length; d++) a.hasOwnProperty(c[d]) && (b[c[d]] = a[c[d]]) | ||
3110 | } | ||
3111 | }(c("./tree")), | ||
3112 | function(a) { | ||
3113 | function b(a) { | ||
3114 | return a | ||
3115 | } | ||
3116 | |||
3117 | function c(a, b) { | ||
3118 | var d, e; | ||
3119 | for (d in a) | ||
3120 | if (a.hasOwnProperty(d)) switch (e = a[d], typeof e) { | ||
3121 | case "function": | ||
3122 | e.prototype && e.prototype.type && (e.prototype.typeIndex = b++); | ||
3123 | break; | ||
3124 | case "object": | ||
3125 | b = c(e, b) | ||
3126 | } | ||
3127 | return b | ||
3128 | } | ||
3129 | var d = { | ||
3130 | visitDeeper: !0 | ||
3131 | }, | ||
3132 | e = !1; | ||
3133 | a.visitor = function(b) { | ||
3134 | this._implementation = b, this._visitFnCache = [], e || (c(a, 1), e = !0) | ||
3135 | }, a.visitor.prototype = { | ||
3136 | visit: function(a) { | ||
3137 | if (!a) return a; | ||
3138 | var c = a.typeIndex; | ||
3139 | if (!c) return a; | ||
3140 | var e, f = this._visitFnCache, | ||
3141 | g = this._implementation, | ||
3142 | h = c << 1, | ||
3143 | i = 1 | h, | ||
3144 | j = f[h], | ||
3145 | k = f[i], | ||
3146 | l = d; | ||
3147 | if (l.visitDeeper = !0, j || (e = "visit" + a.type, j = g[e] || b, k = g[e + "Out"] || b, f[h] = j, f[i] = k), j !== b) { | ||
3148 | var m = j.call(g, a, l); | ||
3149 | g.isReplacing && (a = m) | ||
3150 | } | ||
3151 | return l.visitDeeper && a && a.accept && a.accept(this), k != b && k.call(g, a), a | ||
3152 | }, | ||
3153 | visitArray: function(a, b) { | ||
3154 | if (!a) return a; | ||
3155 | var c, d = a.length; | ||
3156 | if (b || !this._implementation.isReplacing) { | ||
3157 | for (c = 0; d > c; c++) this.visit(a[c]); | ||
3158 | return a | ||
3159 | } | ||
3160 | var e = []; | ||
3161 | for (c = 0; d > c; c++) { | ||
3162 | var f = this.visit(a[c]); | ||
3163 | f.splice ? f.length && this.flatten(f, e) : e.push(f) | ||
3164 | } | ||
3165 | return e | ||
3166 | }, | ||
3167 | flatten: function(a, b) { | ||
3168 | b || (b = []); | ||
3169 | var c, d, e, f, g, h; | ||
3170 | for (d = 0, c = a.length; c > d; d++) | ||
3171 | if (e = a[d], e.splice) | ||
3172 | for (g = 0, f = e.length; f > g; g++) h = e[g], h.splice ? h.length && this.flatten(h, b) : b.push(h); | ||
3173 | else b.push(e); | ||
3174 | return b | ||
3175 | } | ||
3176 | } | ||
3177 | }(c("./tree")), | ||
3178 | function(a) { | ||
3179 | a.importVisitor = function(b, c, d, e, f) { | ||
3180 | if (this._visitor = new a.visitor(this), this._importer = b, this._finish = c, this.env = d || new a.evalEnv, this.importCount = 0, this.onceFileDetectionMap = e || {}, this.recursionDetector = {}, f) | ||
3181 | for (var g in f) f.hasOwnProperty(g) && (this.recursionDetector[g] = !0) | ||
3182 | }, a.importVisitor.prototype = { | ||
3183 | isReplacing: !0, | ||
3184 | run: function(a) { | ||
3185 | var b; | ||
3186 | try { | ||
3187 | this._visitor.visit(a) | ||
3188 | } catch (c) { | ||
3189 | b = c | ||
3190 | } | ||
3191 | this.isFinished = !0, 0 === this.importCount && this._finish(b) | ||
3192 | }, | ||
3193 | visitImport: function(b, c) { | ||
3194 | var d, e = this, | ||
3195 | f = b.options.inline; | ||
3196 | if (!b.css || f) { | ||
3197 | try { | ||
3198 | d = b.evalForImport(this.env) | ||
3199 | } catch (g) { | ||
3200 | g.filename || (g.index = b.index, g.filename = b.currentFileInfo.filename), b.css = !0, b.error = g | ||
3201 | } | ||
3202 | if (d && (!d.css || f)) { | ||
3203 | b = d, this.importCount++; | ||
3204 | var h = new a.evalEnv(this.env, this.env.frames.slice(0)); | ||
3205 | b.options.multiple && (h.importMultiple = !0), this._importer.push(b.getPath(), b.currentFileInfo, b.options, function(c, d, g, i) { | ||
3206 | c && !c.filename && (c.index = b.index, c.filename = b.currentFileInfo.filename), h.importMultiple || (b.skip = g ? !0 : function() { | ||
3207 | return i in e.onceFileDetectionMap ? !0 : (e.onceFileDetectionMap[i] = !0, !1) | ||
3208 | }); | ||
3209 | var j = function(a) { | ||
3210 | e.importCount--, 0 === e.importCount && e.isFinished && e._finish(a) | ||
3211 | }; | ||
3212 | if (d) { | ||
3213 | b.root = d, b.importedFilename = i; | ||
3214 | var k = g || i in e.recursionDetector; | ||
3215 | if (!f && (h.importMultiple || !k)) return e.recursionDetector[i] = !0, void new a.importVisitor(e._importer, j, h, e.onceFileDetectionMap, e.recursionDetector).run(d) | ||
3216 | } | ||
3217 | j() | ||
3218 | }) | ||
3219 | } | ||
3220 | } | ||
3221 | return c.visitDeeper = !1, b | ||
3222 | }, | ||
3223 | visitRule: function(a, b) { | ||
3224 | return b.visitDeeper = !1, a | ||
3225 | }, | ||
3226 | visitDirective: function(a) { | ||
3227 | return this.env.frames.unshift(a), a | ||
3228 | }, | ||
3229 | visitDirectiveOut: function() { | ||
3230 | this.env.frames.shift() | ||
3231 | }, | ||
3232 | visitMixinDefinition: function(a) { | ||
3233 | return this.env.frames.unshift(a), a | ||
3234 | }, | ||
3235 | visitMixinDefinitionOut: function() { | ||
3236 | this.env.frames.shift() | ||
3237 | }, | ||
3238 | visitRuleset: function(a) { | ||
3239 | return this.env.frames.unshift(a), a | ||
3240 | }, | ||
3241 | visitRulesetOut: function() { | ||
3242 | this.env.frames.shift() | ||
3243 | }, | ||
3244 | visitMedia: function(a) { | ||
3245 | return this.env.frames.unshift(a.ruleset), a | ||
3246 | }, | ||
3247 | visitMediaOut: function() { | ||
3248 | this.env.frames.shift() | ||
3249 | } | ||
3250 | } | ||
3251 | }(c("./tree")), | ||
3252 | function(a) { | ||
3253 | a.joinSelectorVisitor = function() { | ||
3254 | this.contexts = [ | ||
3255 | [] | ||
3256 | ], this._visitor = new a.visitor(this) | ||
3257 | }, a.joinSelectorVisitor.prototype = { | ||
3258 | run: function(a) { | ||
3259 | return this._visitor.visit(a) | ||
3260 | }, | ||
3261 | visitRule: function(a, b) { | ||
3262 | b.visitDeeper = !1 | ||
3263 | }, | ||
3264 | visitMixinDefinition: function(a, b) { | ||
3265 | b.visitDeeper = !1 | ||
3266 | }, | ||
3267 | visitRuleset: function(a) { | ||
3268 | var b, c = this.contexts[this.contexts.length - 1], | ||
3269 | d = []; | ||
3270 | this.contexts.push(d), a.root || (b = a.selectors, b && (b = b.filter(function(a) { | ||
3271 | return a.getIsOutput() | ||
3272 | }), a.selectors = b.length ? b : b = null, b && a.joinSelectors(d, c, b)), b || (a.rules = null), a.paths = d) | ||
3273 | }, | ||
3274 | visitRulesetOut: function() { | ||
3275 | this.contexts.length = this.contexts.length - 1 | ||
3276 | }, | ||
3277 | visitMedia: function(a) { | ||
3278 | var b = this.contexts[this.contexts.length - 1]; | ||
3279 | a.rules[0].root = 0 === b.length || b[0].multiMedia | ||
3280 | } | ||
3281 | } | ||
3282 | }(c("./tree")), | ||
3283 | function(a) { | ||
3284 | a.toCSSVisitor = function(b) { | ||
3285 | this._visitor = new a.visitor(this), this._env = b | ||
3286 | }, a.toCSSVisitor.prototype = { | ||
3287 | isReplacing: !0, | ||
3288 | run: function(a) { | ||
3289 | return this._visitor.visit(a) | ||
3290 | }, | ||
3291 | visitRule: function(a) { | ||
3292 | return a.variable ? [] : a | ||
3293 | }, | ||
3294 | visitMixinDefinition: function(a) { | ||
3295 | return a.frames = [], [] | ||
3296 | }, | ||
3297 | visitExtend: function() { | ||
3298 | return [] | ||
3299 | }, | ||
3300 | visitComment: function(a) { | ||
3301 | return a.isSilent(this._env) ? [] : a | ||
3302 | }, | ||
3303 | visitMedia: function(a, b) { | ||
3304 | return a.accept(this._visitor), b.visitDeeper = !1, a.rules.length ? a : [] | ||
3305 | }, | ||
3306 | visitDirective: function(b) { | ||
3307 | if (b.currentFileInfo.reference && !b.isReferenced) return []; | ||
3308 | if ("@charset" === b.name) { | ||
3309 | if (this.charset) { | ||
3310 | if (b.debugInfo) { | ||
3311 | var c = new a.Comment("/* " + b.toCSS(this._env).replace(/\n/g, "") + " */\n"); | ||
3312 | return c.debugInfo = b.debugInfo, this._visitor.visit(c) | ||
3313 | } | ||
3314 | return [] | ||
3315 | } | ||
3316 | this.charset = !0 | ||
3317 | } | ||
3318 | return b | ||
3319 | }, | ||
3320 | checkPropertiesInRoot: function(b) { | ||
3321 | for (var c, d = 0; d < b.length; d++) | ||
3322 | if (c = b[d], c instanceof a.Rule && !c.variable) throw { | ||
3323 | message: "properties must be inside selector blocks, they cannot be in the root.", | ||
3324 | index: c.index, | ||
3325 | filename: c.currentFileInfo ? c.currentFileInfo.filename : null | ||
3326 | } | ||
3327 | }, | ||
3328 | visitRuleset: function(b, c) { | ||
3329 | var d, e = []; | ||
3330 | if (b.firstRoot && this.checkPropertiesInRoot(b.rules), b.root) b.accept(this._visitor), c.visitDeeper = !1, (b.firstRoot || b.rules && b.rules.length > 0) && e.splice(0, 0, b); | ||
3331 | else { | ||
3332 | b.paths && (b.paths = b.paths.filter(function(b) { | ||
3333 | var c; | ||
3334 | for (" " === b[0].elements[0].combinator.value && (b[0].elements[0].combinator = new a.Combinator("")), c = 0; c < b.length; c++) | ||
3335 | if (b[c].getIsReferenced() && b[c].getIsOutput()) return !0; | ||
3336 | return !1 | ||
3337 | })); | ||
3338 | for (var f = b.rules, g = f ? f.length : 0, h = 0; g > h;) d = f[h], d && d.rules ? (e.push(this._visitor.visit(d)), f.splice(h, 1), g--) : h++; | ||
3339 | g > 0 ? b.accept(this._visitor) : b.rules = null, c.visitDeeper = !1, f = b.rules, f && (this._mergeRules(f), f = b.rules), f && (this._removeDuplicateRules(f), f = b.rules), f && f.length > 0 && b.paths.length > 0 && e.splice(0, 0, b) | ||
3340 | } | ||
3341 | return 1 === e.length ? e[0] : e | ||
3342 | }, | ||
3343 | _removeDuplicateRules: function(b) { | ||
3344 | if (b) { | ||
3345 | var c, d, e, f = {}; | ||
3346 | for (e = b.length - 1; e >= 0; e--) | ||
3347 | if (d = b[e], d instanceof a.Rule) | ||
3348 | if (f[d.name]) { | ||
3349 | c = f[d.name], c instanceof a.Rule && (c = f[d.name] = [f[d.name].toCSS(this._env)]); | ||
3350 | var g = d.toCSS(this._env); - 1 !== c.indexOf(g) ? b.splice(e, 1) : c.push(g) | ||
3351 | } else f[d.name] = d | ||
3352 | } | ||
3353 | }, | ||
3354 | _mergeRules: function(b) { | ||
3355 | if (b) { | ||
3356 | for (var c, d, e, f = {}, g = 0; g < b.length; g++) d = b[g], d instanceof a.Rule && d.merge && (e = [d.name, d.important ? "!" : ""].join(","), f[e] ? b.splice(g--, 1) : f[e] = [], f[e].push(d)); | ||
3357 | Object.keys(f).map(function(b) { | ||
3358 | function e(b) { | ||
3359 | return new a.Expression(b.map(function(a) { | ||
3360 | return a.value | ||
3361 | })) | ||
3362 | } | ||
3363 | |||
3364 | function g(b) { | ||
3365 | return new a.Value(b.map(function(a) { | ||
3366 | return a | ||
3367 | })) | ||
3368 | } | ||
3369 | if (c = f[b], c.length > 1) { | ||
3370 | d = c[0]; | ||
3371 | var h = [], | ||
3372 | i = []; | ||
3373 | c.map(function(a) { | ||
3374 | "+" === a.merge && (i.length > 0 && h.push(e(i)), i = []), i.push(a) | ||
3375 | }), h.push(e(i)), d.value = g(h) | ||
3376 | } | ||
3377 | }) | ||
3378 | } | ||
3379 | } | ||
3380 | } | ||
3381 | }(c("./tree")), | ||
3382 | function(a) { | ||
3383 | a.extendFinderVisitor = function() { | ||
3384 | this._visitor = new a.visitor(this), this.contexts = [], this.allExtendsStack = [ | ||
3385 | [] | ||
3386 | ] | ||
3387 | }, a.extendFinderVisitor.prototype = { | ||
3388 | run: function(a) { | ||
3389 | return a = this._visitor.visit(a), a.allExtends = this.allExtendsStack[0], a | ||
3390 | }, | ||
3391 | visitRule: function(a, b) { | ||
3392 | b.visitDeeper = !1 | ||
3393 | }, | ||
3394 | visitMixinDefinition: function(a, b) { | ||
3395 | b.visitDeeper = !1 | ||
3396 | }, | ||
3397 | visitRuleset: function(b) { | ||
3398 | if (!b.root) { | ||
3399 | var c, d, e, f, g = [], | ||
3400 | h = b.rules, | ||
3401 | i = h ? h.length : 0; | ||
3402 | for (c = 0; i > c; c++) b.rules[c] instanceof a.Extend && (g.push(h[c]), b.extendOnEveryPath = !0); | ||
3403 | var j = b.paths; | ||
3404 | for (c = 0; c < j.length; c++) { | ||
3405 | var k = j[c], | ||
3406 | l = k[k.length - 1], | ||
3407 | m = l.extendList; | ||
3408 | for (f = m ? m.slice(0).concat(g) : g, f && (f = f.map(function(a) { | ||
3409 | return a.clone() | ||
3410 | })), d = 0; d < f.length; d++) this.foundExtends = !0, e = f[d], e.findSelfSelectors(k), e.ruleset = b, 0 === d && (e.firstExtendOnThisSelectorPath = !0), this.allExtendsStack[this.allExtendsStack.length - 1].push(e) | ||
3411 | } | ||
3412 | this.contexts.push(b.selectors) | ||
3413 | } | ||
3414 | }, | ||
3415 | visitRulesetOut: function(a) { | ||
3416 | a.root || (this.contexts.length = this.contexts.length - 1) | ||
3417 | }, | ||
3418 | visitMedia: function(a) { | ||
3419 | a.allExtends = [], this.allExtendsStack.push(a.allExtends) | ||
3420 | }, | ||
3421 | visitMediaOut: function() { | ||
3422 | this.allExtendsStack.length = this.allExtendsStack.length - 1 | ||
3423 | }, | ||
3424 | visitDirective: function(a) { | ||
3425 | a.allExtends = [], this.allExtendsStack.push(a.allExtends) | ||
3426 | }, | ||
3427 | visitDirectiveOut: function() { | ||
3428 | this.allExtendsStack.length = this.allExtendsStack.length - 1 | ||
3429 | } | ||
3430 | }, a.processExtendsVisitor = function() { | ||
3431 | this._visitor = new a.visitor(this) | ||
3432 | }, a.processExtendsVisitor.prototype = { | ||
3433 | run: function(b) { | ||
3434 | var c = new a.extendFinderVisitor; | ||
3435 | return c.run(b), c.foundExtends ? (b.allExtends = b.allExtends.concat(this.doExtendChaining(b.allExtends, b.allExtends)), this.allExtendsStack = [b.allExtends], this._visitor.visit(b)) : b | ||
3436 | }, | ||
3437 | doExtendChaining: function(b, c, d) { | ||
3438 | var e, f, g, h, i, j, k, l, m = [], | ||
3439 | n = this; | ||
3440 | for (d = d || 0, e = 0; e < b.length; e++) | ||
3441 | for (f = 0; f < c.length; f++) j = b[e], k = c[f], j.parent_ids.indexOf(k.object_id) >= 0 || (i = [k.selfSelectors[0]], g = n.findMatch(j, i), g.length && j.selfSelectors.forEach(function(b) { | ||
3442 | h = n.extendSelector(g, i, b), l = new a.Extend(k.selector, k.option, 0), l.selfSelectors = h, h[h.length - 1].extendList = [l], m.push(l), l.ruleset = k.ruleset, l.parent_ids = l.parent_ids.concat(k.parent_ids, j.parent_ids), k.firstExtendOnThisSelectorPath && (l.firstExtendOnThisSelectorPath = !0, k.ruleset.paths.push(h)) | ||
3443 | })); | ||
3444 | if (m.length) { | ||
3445 | if (this.extendChainCount++, d > 100) { | ||
3446 | var o = "{unable to calculate}", | ||
3447 | p = "{unable to calculate}"; | ||
3448 | try { | ||
3449 | o = m[0].selfSelectors[0].toCSS(), p = m[0].selector.toCSS() | ||
3450 | } catch (q) {} | ||
3451 | throw { | ||
3452 | message: "extend circular reference detected. One of the circular extends is currently:" + o + ":extend(" + p + ")" | ||
3453 | } | ||
3454 | } | ||
3455 | return m.concat(n.doExtendChaining(m, c, d + 1)) | ||
3456 | } | ||
3457 | return m | ||
3458 | }, | ||
3459 | visitRule: function(a, b) { | ||
3460 | b.visitDeeper = !1 | ||
3461 | }, | ||
3462 | visitMixinDefinition: function(a, b) { | ||
3463 | b.visitDeeper = !1 | ||
3464 | }, | ||
3465 | visitSelector: function(a, b) { | ||
3466 | b.visitDeeper = !1 | ||
3467 | }, | ||
3468 | visitRuleset: function(a) { | ||
3469 | if (!a.root) { | ||
3470 | var b, c, d, e, f = this.allExtendsStack[this.allExtendsStack.length - 1], | ||
3471 | g = [], | ||
3472 | h = this; | ||
3473 | for (d = 0; d < f.length; d++) | ||
3474 | for (c = 0; c < a.paths.length; c++) | ||
3475 | if (e = a.paths[c], !a.extendOnEveryPath) { | ||
3476 | var i = e[e.length - 1].extendList; | ||
3477 | i && i.length || (b = this.findMatch(f[d], e), b.length && f[d].selfSelectors.forEach(function(a) { | ||
3478 | g.push(h.extendSelector(b, e, a)) | ||
3479 | })) | ||
3480 | } | ||
3481 | a.paths = a.paths.concat(g) | ||
3482 | } | ||
3483 | }, | ||
3484 | findMatch: function(a, b) { | ||
3485 | var c, d, e, f, g, h, i, j = this, | ||
3486 | k = a.selector.elements, | ||
3487 | l = [], | ||
3488 | m = []; | ||
3489 | for (c = 0; c < b.length; c++) | ||
3490 | for (d = b[c], e = 0; e < d.elements.length; e++) | ||
3491 | for (f = d.elements[e], (a.allowBefore || 0 === c && 0 === e) && l.push({ | ||
3492 | pathIndex: c, | ||
3493 | index: e, | ||
3494 | matched: 0, | ||
3495 | initialCombinator: f.combinator | ||
3496 | }), h = 0; h < l.length; h++) i = l[h], g = f.combinator.value, "" === g && 0 === e && (g = " "), !j.isElementValuesEqual(k[i.matched].value, f.value) || i.matched > 0 && k[i.matched].combinator.value !== g ? i = null : i.matched++, i && (i.finished = i.matched === k.length, i.finished && !a.allowAfter && (e + 1 < d.elements.length || c + 1 < b.length) && (i = null)), i ? i.finished && (i.length = k.length, i.endPathIndex = c, i.endPathElementIndex = e + 1, l.length = 0, m.push(i)) : (l.splice(h, 1), h--); | ||
3497 | return m | ||
3498 | }, | ||
3499 | isElementValuesEqual: function(b, c) { | ||
3500 | if ("string" == typeof b || "string" == typeof c) return b === c; | ||
3501 | if (b instanceof a.Attribute) return b.op !== c.op || b.key !== c.key ? !1 : b.value && c.value ? (b = b.value.value || b.value, c = c.value.value || c.value, b === c) : b.value || c.value ? !1 : !0; | ||
3502 | if (b = b.value, c = c.value, b instanceof a.Selector) { | ||
3503 | if (!(c instanceof a.Selector) || b.elements.length !== c.elements.length) return !1; | ||
3504 | for (var d = 0; d < b.elements.length; d++) { | ||
3505 | if (b.elements[d].combinator.value !== c.elements[d].combinator.value && (0 !== d || (b.elements[d].combinator.value || " ") !== (c.elements[d].combinator.value || " "))) return !1; | ||
3506 | if (!this.isElementValuesEqual(b.elements[d].value, c.elements[d].value)) return !1 | ||
3507 | } | ||
3508 | return !0 | ||
3509 | } | ||
3510 | return !1 | ||
3511 | }, | ||
3512 | extendSelector: function(b, c, d) { | ||
3513 | var e, f, g, h, i, j = 0, | ||
3514 | k = 0, | ||
3515 | l = []; | ||
3516 | for (e = 0; e < b.length; e++) h = b[e], f = c[h.pathIndex], g = new a.Element(h.initialCombinator, d.elements[0].value, d.elements[0].index, d.elements[0].currentFileInfo), h.pathIndex > j && k > 0 && (l[l.length - 1].elements = l[l.length - 1].elements.concat(c[j].elements.slice(k)), k = 0, j++), i = f.elements.slice(k, h.index).concat([g]).concat(d.elements.slice(1)), j === h.pathIndex && e > 0 ? l[l.length - 1].elements = l[l.length - 1].elements.concat(i) : (l = l.concat(c.slice(j, h.pathIndex)), l.push(new a.Selector(i))), j = h.endPathIndex, k = h.endPathElementIndex, k >= c[j].elements.length && (k = 0, j++); | ||
3517 | return j < c.length && k > 0 && (l[l.length - 1].elements = l[l.length - 1].elements.concat(c[j].elements.slice(k)), j++), l = l.concat(c.slice(j, c.length)) | ||
3518 | }, | ||
3519 | visitRulesetOut: function() {}, | ||
3520 | visitMedia: function(a) { | ||
3521 | var b = a.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length - 1]); | ||
3522 | b = b.concat(this.doExtendChaining(b, a.allExtends)), this.allExtendsStack.push(b) | ||
3523 | }, | ||
3524 | visitMediaOut: function() { | ||
3525 | this.allExtendsStack.length = this.allExtendsStack.length - 1 | ||
3526 | }, | ||
3527 | visitDirective: function(a) { | ||
3528 | var b = a.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length - 1]); | ||
3529 | b = b.concat(this.doExtendChaining(b, a.allExtends)), this.allExtendsStack.push(b) | ||
3530 | }, | ||
3531 | visitDirectiveOut: function() { | ||
3532 | this.allExtendsStack.length = this.allExtendsStack.length - 1 | ||
3533 | } | ||
3534 | } | ||
3535 | }(c("./tree")), | ||
3536 | function(a) { | ||
3537 | a.sourceMapOutput = function(a) { | ||
3538 | this._css = [], this._rootNode = a.rootNode, this._writeSourceMap = a.writeSourceMap, this._contentsMap = a.contentsMap, this._contentsIgnoredCharsMap = a.contentsIgnoredCharsMap, this._sourceMapFilename = a.sourceMapFilename, this._outputFilename = a.outputFilename, this._sourceMapURL = a.sourceMapURL, a.sourceMapBasepath && (this._sourceMapBasepath = a.sourceMapBasepath.replace(/\\/g, "/")), this._sourceMapRootpath = a.sourceMapRootpath, this._outputSourceFiles = a.outputSourceFiles, this._sourceMapGeneratorConstructor = a.sourceMapGenerator || c("source-map").SourceMapGenerator, this._sourceMapRootpath && "/" !== this._sourceMapRootpath.charAt(this._sourceMapRootpath.length - 1) && (this._sourceMapRootpath += "/"), this._lineNumber = 0, this._column = 0 | ||
3539 | }, a.sourceMapOutput.prototype.normalizeFilename = function(a) { | ||
3540 | return a = a.replace(/\\/g, "/"), this._sourceMapBasepath && 0 === a.indexOf(this._sourceMapBasepath) && (a = a.substring(this._sourceMapBasepath.length), ("\\" === a.charAt(0) || "/" === a.charAt(0)) && (a = a.substring(1))), (this._sourceMapRootpath || "") + a | ||
3541 | }, a.sourceMapOutput.prototype.add = function(a, b, c, d) { | ||
3542 | if (a) { | ||
3543 | var e, f, g, h, i; | ||
3544 | if (b) { | ||
3545 | var j = this._contentsMap[b.filename]; | ||
3546 | this._contentsIgnoredCharsMap[b.filename] && (c -= this._contentsIgnoredCharsMap[b.filename], 0 > c && (c = 0), j = j.slice(this._contentsIgnoredCharsMap[b.filename])), j = j.substring(0, c), f = j.split("\n"), h = f[f.length - 1] | ||
3547 | } | ||
3548 | if (e = a.split("\n"), g = e[e.length - 1], b) | ||
3549 | if (d) | ||
3550 | for (i = 0; i < e.length; i++) this._sourceMapGenerator.addMapping({ | ||
3551 | generated: { | ||
3552 | line: this._lineNumber + i + 1, | ||
3553 | column: 0 === i ? this._column : 0 | ||
3554 | }, | ||
3555 | original: { | ||
3556 | line: f.length + i, | ||
3557 | column: 0 === i ? h.length : 0 | ||
3558 | }, | ||
3559 | source: this.normalizeFilename(b.filename) | ||
3560 | }); | ||
3561 | else this._sourceMapGenerator.addMapping({ | ||
3562 | generated: { | ||
3563 | line: this._lineNumber + 1, | ||
3564 | column: this._column | ||
3565 | }, | ||
3566 | original: { | ||
3567 | line: f.length, | ||
3568 | column: h.length | ||
3569 | }, | ||
3570 | source: this.normalizeFilename(b.filename) | ||
3571 | }); | ||
3572 | 1 === e.length ? this._column += g.length : (this._lineNumber += e.length - 1, this._column = g.length), this._css.push(a) | ||
3573 | } | ||
3574 | }, a.sourceMapOutput.prototype.isEmpty = function() { | ||
3575 | return 0 === this._css.length | ||
3576 | }, a.sourceMapOutput.prototype.toCSS = function(a) { | ||
3577 | if (this._sourceMapGenerator = new this._sourceMapGeneratorConstructor({ | ||
3578 | file: this._outputFilename, | ||
3579 | sourceRoot: null | ||
3580 | }), this._outputSourceFiles) | ||
3581 | for (var b in this._contentsMap) | ||
3582 | if (this._contentsMap.hasOwnProperty(b)) { | ||
3583 | var c = this._contentsMap[b]; | ||
3584 | this._contentsIgnoredCharsMap[b] && (c = c.slice(this._contentsIgnoredCharsMap[b])), this._sourceMapGenerator.setSourceContent(this.normalizeFilename(b), c) | ||
3585 | } | ||
3586 | if (this._rootNode.genCSS(a, this), this._css.length > 0) { | ||
3587 | var d, e = JSON.stringify(this._sourceMapGenerator.toJSON()); | ||
3588 | this._sourceMapURL ? d = this._sourceMapURL : this._sourceMapFilename && (d = this.normalizeFilename(this._sourceMapFilename)), this._writeSourceMap ? this._writeSourceMap(e) : d = "data:application/json," + encodeURIComponent(e), d && this._css.push("/*# sourceMappingURL=" + d + " */") | ||
3589 | } | ||
3590 | return this._css.join("") | ||
3591 | } | ||
3592 | }(c("./tree")); | ||
3593 | var y = /^(file|chrome(-extension)?|resource|qrc|app):/.test(location.protocol); | ||
3594 | w.env = w.env || ("127.0.0.1" == location.hostname || "0.0.0.0" == location.hostname || "localhost" == location.hostname || location.port && location.port.length > 0 || y ? "development" : "production"); | ||
3595 | var z = { | ||
3596 | debug: 3, | ||
3597 | info: 2, | ||
3598 | errors: 1, | ||
3599 | none: 0 | ||
3600 | }; | ||
3601 | if (w.logLevel = "undefined" != typeof w.logLevel ? w.logLevel : "development" === w.env ? z.debug : z.errors, w.async = w.async || !1, w.fileAsync = w.fileAsync || !1, w.poll = w.poll || (y ? 1e3 : 1500), w.functions) | ||
3602 | for (var A in w.functions) w.functions.hasOwnProperty(A) && (w.tree.functions[A] = w.functions[A]); | ||
3603 | var B = /!dumpLineNumbers:(comments|mediaquery|all)/.exec(location.hash); | ||
3604 | B && (w.dumpLineNumbers = B[1]); | ||
3605 | var C = /^text\/(x-)?less$/, | ||
3606 | D = null, | ||
3607 | E = {}; | ||
3608 | if (w.watch = function() { | ||
3609 | return w.watchMode || (w.env = "development", v()), this.watchMode = !0, !0 | ||
3610 | }, w.unwatch = function() { | ||
3611 | return clearInterval(w.watchTimer), this.watchMode = !1, !1 | ||
3612 | }, /!watch/.test(location.hash) && w.watch(), "development" != w.env) try { | ||
3613 | D = "undefined" == typeof a.localStorage ? null : a.localStorage | ||
3614 | } catch (F) {} | ||
3615 | var G = document.getElementsByTagName("link"); | ||
3616 | w.sheets = []; | ||
3617 | for (var H = 0; H < G.length; H++)("stylesheet/less" === G[H].rel || G[H].rel.match(/stylesheet/) && G[H].type.match(C)) && w.sheets.push(G[H]); | ||
3618 | w.modifyVars = function(a) { | ||
3619 | w.refresh(!1, a) | ||
3620 | }, w.refresh = function(a, b) { | ||
3621 | var c, e; | ||
3622 | c = e = new Date, u(function(a, b, f, i, k) { | ||
3623 | if (a) return j(a, i.href); | ||
3624 | if (k.local) d("loading " + i.href + " from cache.", z.info); | ||
3625 | else { | ||
3626 | d("parsed " + i.href + " successfully.", z.debug); | ||
3627 | var l = b.toCSS(w); | ||
3628 | l = h(l), g(l, i, k.lastModified) | ||
3629 | } | ||
3630 | d("css for " + i.href + " generated in " + (new Date - e) + "ms", z.info), 0 === k.remaining && d("less has finished. css generated in " + (new Date - c) + "ms", z.info), e = new Date | ||
3631 | }, a, b), n(b) | ||
3632 | }, w.refreshStyles = n, w.Parser.fileLoader = s, w.refresh("development" === w.env), "function" == typeof define && define.amd && define(function() { | ||
3633 | return w | ||
3634 | }) | ||
3635 | }(window); \ No newline at end of file | ||