stylis.cjs.prod.js 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476
  1. "use strict";
  2. function stylis_min(W) {
  3. function X(d, c, e) {
  4. var h = c.trim().split(ia);
  5. c = h;
  6. var a = h.length, m = d.length;
  7. switch (m) {
  8. case 0:
  9. case 1:
  10. var b = 0;
  11. for (d = 0 === m ? "" : d[0] + " "; b < a; ++b) c[b] = Z(d, c[b], e).trim();
  12. break;
  13. default:
  14. var v = b = 0;
  15. for (c = []; b < a; ++b) for (var n = 0; n < m; ++n) c[v++] = Z(d[n] + " ", h[b], e).trim();
  16. }
  17. return c;
  18. }
  19. function Z(d, c, e) {
  20. var h = c.charCodeAt(0);
  21. switch (33 > h && (h = (c = c.trim()).charCodeAt(0)), h) {
  22. case 38:
  23. return c.replace(F, "$1" + d.trim());
  24. case 58:
  25. return d.trim() + c.replace(F, "$1" + d.trim());
  26. default:
  27. if (0 < 1 * e && 0 < c.indexOf("\f")) return c.replace(F, (58 === d.charCodeAt(0) ? "" : "$1") + d.trim());
  28. }
  29. return d + c;
  30. }
  31. function P(d, c, e, h) {
  32. var a = d + ";", m = 2 * c + 3 * e + 4 * h;
  33. if (944 === m) {
  34. d = a.indexOf(":", 9) + 1;
  35. var b = a.substring(d, a.length - 1).trim();
  36. return b = a.substring(0, d).trim() + b + ";", 1 === w || 2 === w && L(b, 1) ? "-webkit-" + b + b : b;
  37. }
  38. if (0 === w || 2 === w && !L(a, 1)) return a;
  39. switch (m) {
  40. case 1015:
  41. return 97 === a.charCodeAt(10) ? "-webkit-" + a + a : a;
  42. case 951:
  43. return 116 === a.charCodeAt(3) ? "-webkit-" + a + a : a;
  44. case 963:
  45. return 110 === a.charCodeAt(5) ? "-webkit-" + a + a : a;
  46. case 1009:
  47. if (100 !== a.charCodeAt(4)) break;
  48. case 969:
  49. case 942:
  50. return "-webkit-" + a + a;
  51. case 978:
  52. return "-webkit-" + a + "-moz-" + a + a;
  53. case 1019:
  54. case 983:
  55. return "-webkit-" + a + "-moz-" + a + "-ms-" + a + a;
  56. case 883:
  57. if (45 === a.charCodeAt(8)) return "-webkit-" + a + a;
  58. if (0 < a.indexOf("image-set(", 11)) return a.replace(ja, "$1-webkit-$2") + a;
  59. break;
  60. case 932:
  61. if (45 === a.charCodeAt(4)) switch (a.charCodeAt(5)) {
  62. case 103:
  63. return "-webkit-box-" + a.replace("-grow", "") + "-webkit-" + a + "-ms-" + a.replace("grow", "positive") + a;
  64. case 115:
  65. return "-webkit-" + a + "-ms-" + a.replace("shrink", "negative") + a;
  66. case 98:
  67. return "-webkit-" + a + "-ms-" + a.replace("basis", "preferred-size") + a;
  68. }
  69. return "-webkit-" + a + "-ms-" + a + a;
  70. case 964:
  71. return "-webkit-" + a + "-ms-flex-" + a + a;
  72. case 1023:
  73. if (99 !== a.charCodeAt(8)) break;
  74. return "-webkit-box-pack" + (b = a.substring(a.indexOf(":", 15)).replace("flex-", "").replace("space-between", "justify")) + "-webkit-" + a + "-ms-flex-pack" + b + a;
  75. case 1005:
  76. return ka.test(a) ? a.replace(aa, ":-webkit-") + a.replace(aa, ":-moz-") + a : a;
  77. case 1e3:
  78. switch (c = (b = a.substring(13).trim()).indexOf("-") + 1, b.charCodeAt(0) + b.charCodeAt(c)) {
  79. case 226:
  80. b = a.replace(G, "tb");
  81. break;
  82. case 232:
  83. b = a.replace(G, "tb-rl");
  84. break;
  85. case 220:
  86. b = a.replace(G, "lr");
  87. break;
  88. default:
  89. return a;
  90. }
  91. return "-webkit-" + a + "-ms-" + b + a;
  92. case 1017:
  93. if (-1 === a.indexOf("sticky", 9)) break;
  94. case 975:
  95. switch (c = (a = d).length - 10, m = (b = (33 === a.charCodeAt(c) ? a.substring(0, c) : a).substring(d.indexOf(":", 7) + 1).trim()).charCodeAt(0) + (0 | b.charCodeAt(7))) {
  96. case 203:
  97. if (111 > b.charCodeAt(8)) break;
  98. case 115:
  99. a = a.replace(b, "-webkit-" + b) + ";" + a;
  100. break;
  101. case 207:
  102. case 102:
  103. a = a.replace(b, "-webkit-" + (102 < m ? "inline-" : "") + "box") + ";" + a.replace(b, "-webkit-" + b) + ";" + a.replace(b, "-ms-" + b + "box") + ";" + a;
  104. }
  105. return a + ";";
  106. case 938:
  107. if (45 === a.charCodeAt(5)) switch (a.charCodeAt(6)) {
  108. case 105:
  109. return b = a.replace("-items", ""), "-webkit-" + a + "-webkit-box-" + b + "-ms-flex-" + b + a;
  110. case 115:
  111. return "-webkit-" + a + "-ms-flex-item-" + a.replace(ba, "") + a;
  112. default:
  113. return "-webkit-" + a + "-ms-flex-line-pack" + a.replace("align-content", "").replace(ba, "") + a;
  114. }
  115. break;
  116. case 973:
  117. case 989:
  118. if (45 !== a.charCodeAt(3) || 122 === a.charCodeAt(4)) break;
  119. case 931:
  120. case 953:
  121. if (!0 === la.test(d)) return 115 === (b = d.substring(d.indexOf(":") + 1)).charCodeAt(0) ? P(d.replace("stretch", "fill-available"), c, e, h).replace(":fill-available", ":stretch") : a.replace(b, "-webkit-" + b) + a.replace(b, "-moz-" + b.replace("fill-", "")) + a;
  122. break;
  123. case 962:
  124. if (a = "-webkit-" + a + (102 === a.charCodeAt(5) ? "-ms-" + a : "") + a, 211 === e + h && 105 === a.charCodeAt(13) && 0 < a.indexOf("transform", 10)) return a.substring(0, a.indexOf(";", 27) + 1).replace(ma, "$1-webkit-$2") + a;
  125. }
  126. return a;
  127. }
  128. function L(d, c) {
  129. var e = d.indexOf(1 === c ? ":" : "{"), h = d.substring(0, 3 !== c ? e : 10);
  130. return e = d.substring(e + 1, d.length - 1), R(2 !== c ? h : h.replace(na, "$1"), e, c);
  131. }
  132. function ea(d, c) {
  133. var e = P(c, c.charCodeAt(0), c.charCodeAt(1), c.charCodeAt(2));
  134. return e !== c + ";" ? e.replace(oa, " or ($1)").substring(4) : "(" + c + ")";
  135. }
  136. function H(d, c, e, h, a, m, b, v, n, q) {
  137. for (var w, g = 0, x = c; g < A; ++g) switch (w = S[g].call(B, d, x, e, h, a, m, b, v, n, q)) {
  138. case void 0:
  139. case !1:
  140. case !0:
  141. case null:
  142. break;
  143. default:
  144. x = w;
  145. }
  146. if (x !== c) return x;
  147. }
  148. function U(d) {
  149. return void 0 !== (d = d.prefix) && (R = null, d ? "function" != typeof d ? w = 1 : (w = 2,
  150. R = d) : w = 0), U;
  151. }
  152. function B(d, c) {
  153. var e = d;
  154. if (33 > e.charCodeAt(0) && (e = e.trim()), e = [ e ], 0 < A) {
  155. var h = H(-1, c, e, e, D, z, 0, 0, 0, 0);
  156. void 0 !== h && "string" == typeof h && (c = h);
  157. }
  158. var a = function M(d, c, e, h, a) {
  159. for (var q, g, k, y, C, m = 0, b = 0, v = 0, n = 0, x = 0, K = 0, u = k = q = 0, l = 0, r = 0, I = 0, t = 0, B = e.length, J = B - 1, f = "", p = "", F = "", G = ""; l < B; ) {
  160. if (g = e.charCodeAt(l), l === J && 0 !== b + n + v + m && (0 !== b && (g = 47 === b ? 10 : 47),
  161. n = v = m = 0, B++, J++), 0 === b + n + v + m) {
  162. if (l === J && (0 < r && (f = f.replace(N, "")), 0 < f.trim().length)) {
  163. switch (g) {
  164. case 32:
  165. case 9:
  166. case 59:
  167. case 13:
  168. case 10:
  169. break;
  170. default:
  171. f += e.charAt(l);
  172. }
  173. g = 59;
  174. }
  175. switch (g) {
  176. case 123:
  177. for (q = (f = f.trim()).charCodeAt(0), k = 1, t = ++l; l < B; ) {
  178. switch (g = e.charCodeAt(l)) {
  179. case 123:
  180. k++;
  181. break;
  182. case 125:
  183. k--;
  184. break;
  185. case 47:
  186. switch (g = e.charCodeAt(l + 1)) {
  187. case 42:
  188. case 47:
  189. a: {
  190. for (u = l + 1; u < J; ++u) switch (e.charCodeAt(u)) {
  191. case 47:
  192. if (42 === g && 42 === e.charCodeAt(u - 1) && l + 2 !== u) {
  193. l = u + 1;
  194. break a;
  195. }
  196. break;
  197. case 10:
  198. if (47 === g) {
  199. l = u + 1;
  200. break a;
  201. }
  202. }
  203. l = u;
  204. }
  205. }
  206. break;
  207. case 91:
  208. g++;
  209. case 40:
  210. g++;
  211. case 34:
  212. case 39:
  213. for (;l++ < J && e.charCodeAt(l) !== g; ) ;
  214. }
  215. if (0 === k) break;
  216. l++;
  217. }
  218. switch (k = e.substring(t, l), 0 === q && (q = (f = f.replace(ca, "").trim()).charCodeAt(0)),
  219. q) {
  220. case 64:
  221. switch (0 < r && (f = f.replace(N, "")), g = f.charCodeAt(1)) {
  222. case 100:
  223. case 109:
  224. case 115:
  225. case 45:
  226. r = c;
  227. break;
  228. default:
  229. r = O;
  230. }
  231. if (t = (k = M(c, r, k, g, a + 1)).length, 0 < A && (C = H(3, k, r = X(O, f, I), c, D, z, t, g, a, h),
  232. f = r.join(""), void 0 !== C && 0 === (t = (k = C.trim()).length) && (g = 0, k = "")),
  233. 0 < t) switch (g) {
  234. case 115:
  235. f = f.replace(da, ea);
  236. case 100:
  237. case 109:
  238. case 45:
  239. k = f + "{" + k + "}";
  240. break;
  241. case 107:
  242. k = (f = f.replace(fa, "$1 $2")) + "{" + k + "}", k = 1 === w || 2 === w && L("@" + k, 3) ? "@-webkit-" + k + "@" + k : "@" + k;
  243. break;
  244. default:
  245. k = f + k, 112 === h && (p += k, k = "");
  246. } else k = "";
  247. break;
  248. default:
  249. k = M(c, X(c, f, I), k, h, a + 1);
  250. }
  251. F += k, k = I = r = u = q = 0, f = "", g = e.charCodeAt(++l);
  252. break;
  253. case 125:
  254. case 59:
  255. if (1 < (t = (f = (0 < r ? f.replace(N, "") : f).trim()).length)) switch (0 === u && (q = f.charCodeAt(0),
  256. 45 === q || 96 < q && 123 > q) && (t = (f = f.replace(" ", ":")).length), 0 < A && void 0 !== (C = H(1, f, c, d, D, z, p.length, h, a, h)) && 0 === (t = (f = C.trim()).length) && (f = "\0\0"),
  257. q = f.charCodeAt(0), g = f.charCodeAt(1), q) {
  258. case 0:
  259. break;
  260. case 64:
  261. if (105 === g || 99 === g) {
  262. G += f + e.charAt(l);
  263. break;
  264. }
  265. default:
  266. 58 !== f.charCodeAt(t - 1) && (p += P(f, q, g, f.charCodeAt(2)));
  267. }
  268. I = r = u = q = 0, f = "", g = e.charCodeAt(++l);
  269. }
  270. }
  271. switch (g) {
  272. case 13:
  273. case 10:
  274. 47 === b ? b = 0 : 0 === 1 + q && 107 !== h && 0 < f.length && (r = 1, f += "\0"),
  275. 0 < A * Y && H(0, f, c, d, D, z, p.length, h, a, h), z = 1, D++;
  276. break;
  277. case 59:
  278. case 125:
  279. if (0 === b + n + v + m) {
  280. z++;
  281. break;
  282. }
  283. default:
  284. switch (z++, y = e.charAt(l), g) {
  285. case 9:
  286. case 32:
  287. if (0 === n + m + b) switch (x) {
  288. case 44:
  289. case 58:
  290. case 9:
  291. case 32:
  292. y = "";
  293. break;
  294. default:
  295. 32 !== g && (y = " ");
  296. }
  297. break;
  298. case 0:
  299. y = "\\0";
  300. break;
  301. case 12:
  302. y = "\\f";
  303. break;
  304. case 11:
  305. y = "\\v";
  306. break;
  307. case 38:
  308. 0 === n + b + m && (r = I = 1, y = "\f" + y);
  309. break;
  310. case 108:
  311. if (0 === n + b + m + E && 0 < u) switch (l - u) {
  312. case 2:
  313. 112 === x && 58 === e.charCodeAt(l - 3) && (E = x);
  314. case 8:
  315. 111 === K && (E = K);
  316. }
  317. break;
  318. case 58:
  319. 0 === n + b + m && (u = l);
  320. break;
  321. case 44:
  322. 0 === b + v + n + m && (r = 1, y += "\r");
  323. break;
  324. case 34:
  325. case 39:
  326. 0 === b && (n = n === g ? 0 : 0 === n ? g : n);
  327. break;
  328. case 91:
  329. 0 === n + b + v && m++;
  330. break;
  331. case 93:
  332. 0 === n + b + v && m--;
  333. break;
  334. case 41:
  335. 0 === n + b + m && v--;
  336. break;
  337. case 40:
  338. if (0 === n + b + m) {
  339. if (0 === q) switch (2 * x + 3 * K) {
  340. case 533:
  341. break;
  342. default:
  343. q = 1;
  344. }
  345. v++;
  346. }
  347. break;
  348. case 64:
  349. 0 === b + v + n + m + u + k && (k = 1);
  350. break;
  351. case 42:
  352. case 47:
  353. if (!(0 < n + m + v)) switch (b) {
  354. case 0:
  355. switch (2 * g + 3 * e.charCodeAt(l + 1)) {
  356. case 235:
  357. b = 47;
  358. break;
  359. case 220:
  360. t = l, b = 42;
  361. }
  362. break;
  363. case 42:
  364. 47 === g && 42 === x && t + 2 !== l && (33 === e.charCodeAt(t + 2) && (p += e.substring(t, l + 1)),
  365. y = "", b = 0);
  366. }
  367. }
  368. 0 === b && (f += y);
  369. }
  370. K = x, x = g, l++;
  371. }
  372. if (0 < (t = p.length)) {
  373. if (r = c, 0 < A && void 0 !== (C = H(2, p, r, d, D, z, t, h, a, h)) && 0 === (p = C).length) return G + p + F;
  374. if (p = r.join(",") + "{" + p + "}", 0 != w * E) {
  375. switch (2 !== w || L(p, 2) || (E = 0), E) {
  376. case 111:
  377. p = p.replace(ha, ":-moz-$1") + p;
  378. break;
  379. case 112:
  380. p = p.replace(Q, "::-webkit-input-$1") + p.replace(Q, "::-moz-$1") + p.replace(Q, ":-ms-input-$1") + p;
  381. }
  382. E = 0;
  383. }
  384. }
  385. return G + p + F;
  386. }(O, e, c, 0, 0);
  387. return 0 < A && (void 0 !== (h = H(-2, a, e, e, D, z, a.length, 0, 0, 0)) && (a = h)),
  388. "", E = 0, z = D = 1, a;
  389. }
  390. var ca = /^\0+/g, N = /[\0\r\f]/g, aa = /: */g, ka = /zoo|gra/, ma = /([,: ])(transform)/g, ia = /,\r+?/g, F = /([\t\r\n ])*\f?&/g, fa = /@(k\w+)\s*(\S*)\s*/, Q = /::(place)/g, ha = /:(read-only)/g, G = /[svh]\w+-[tblr]{2}/, da = /\(\s*(.*)\s*\)/g, oa = /([\s\S]*?);/g, ba = /-self|flex-/g, na = /[^]*?(:[rp][el]a[\w-]+)[^]*/, la = /stretch|:\s*\w+\-(?:conte|avail)/, ja = /([^-])(image-set\()/, z = 1, D = 1, E = 0, w = 1, O = [], S = [], A = 0, R = null, Y = 0;
  391. return B.use = function T(d) {
  392. switch (d) {
  393. case void 0:
  394. case null:
  395. A = S.length = 0;
  396. break;
  397. default:
  398. if ("function" == typeof d) S[A++] = d; else if ("object" == typeof d) for (var c = 0, e = d.length; c < e; ++c) T(d[c]); else Y = 0 | !!d;
  399. }
  400. return T;
  401. }, B.set = U, void 0 !== W && U(W), B;
  402. }
  403. Object.defineProperty(exports, "__esModule", {
  404. value: !0
  405. }), exports.default = stylis_min;