anime.min.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851
  1. /*
  2. 2017 Julian Garnier
  3. Released under the MIT license
  4. */
  5. var $jscomp = {
  6. scope: {}
  7. };
  8. $jscomp.defineProperty = "function" == typeof Object.defineProperties ? Object.defineProperty : function(e, r, p) {
  9. if (p.get || p.set) throw new TypeError("ES3 does not support getters and setters.");
  10. e != Array.prototype && e != Object.prototype && (e[r] = p.value)
  11. };
  12. $jscomp.getGlobal = function(e) {
  13. return "undefined" != typeof window && window === e ? e : "undefined" != typeof global && null != global ? global : e
  14. };
  15. $jscomp.global = $jscomp.getGlobal(this);
  16. $jscomp.SYMBOL_PREFIX = "jscomp_symbol_";
  17. $jscomp.initSymbol = function() {
  18. $jscomp.initSymbol = function() {};
  19. $jscomp.global.Symbol || ($jscomp.global.Symbol = $jscomp.Symbol)
  20. };
  21. $jscomp.symbolCounter_ = 0;
  22. $jscomp.Symbol = function(e) {
  23. return $jscomp.SYMBOL_PREFIX + (e || "") + $jscomp.symbolCounter_++
  24. };
  25. $jscomp.initSymbolIterator = function() {
  26. $jscomp.initSymbol();
  27. var e = $jscomp.global.Symbol.iterator;
  28. e || (e = $jscomp.global.Symbol.iterator = $jscomp.global.Symbol("iterator"));
  29. "function" != typeof Array.prototype[e] && $jscomp.defineProperty(Array.prototype, e, {
  30. configurable: !0,
  31. writable: !0,
  32. value: function() {
  33. return $jscomp.arrayIterator(this)
  34. }
  35. });
  36. $jscomp.initSymbolIterator = function() {}
  37. };
  38. $jscomp.arrayIterator = function(e) {
  39. var r = 0;
  40. return $jscomp.iteratorPrototype(function() {
  41. return r < e.length ? {
  42. done: !1,
  43. value: e[r++]
  44. } : {
  45. done: !0
  46. }
  47. })
  48. };
  49. $jscomp.iteratorPrototype = function(e) {
  50. $jscomp.initSymbolIterator();
  51. e = {
  52. next: e
  53. };
  54. e[$jscomp.global.Symbol.iterator] = function() {
  55. return this
  56. };
  57. return e
  58. };
  59. $jscomp.array = $jscomp.array || {};
  60. $jscomp.iteratorFromArray = function(e, r) {
  61. $jscomp.initSymbolIterator();
  62. e instanceof String && (e += "");
  63. var p = 0,
  64. m = {
  65. next: function() {
  66. if (p < e.length) {
  67. var u = p++;
  68. return {
  69. value: r(u, e[u]),
  70. done: !1
  71. }
  72. }
  73. m.next = function() {
  74. return {
  75. done: !0,
  76. value: void 0
  77. }
  78. };
  79. return m.next()
  80. }
  81. };
  82. m[Symbol.iterator] = function() {
  83. return m
  84. };
  85. return m
  86. };
  87. $jscomp.polyfill = function(e, r, p, m) {
  88. if (r) {
  89. p = $jscomp.global;
  90. e = e.split(".");
  91. for (m = 0; m < e.length - 1; m++) {
  92. var u = e[m];
  93. u in p || (p[u] = {});
  94. p = p[u]
  95. }
  96. e = e[e.length - 1];
  97. m = p[e];
  98. r = r(m);
  99. r != m && null != r && $jscomp.defineProperty(p, e, {
  100. configurable: !0,
  101. writable: !0,
  102. value: r
  103. })
  104. }
  105. };
  106. $jscomp.polyfill("Array.prototype.keys", function(e) {
  107. return e ? e : function() {
  108. return $jscomp.iteratorFromArray(this, function(e) {
  109. return e
  110. })
  111. }
  112. }, "es6-impl", "es3");
  113. var $jscomp$this = this;
  114. (function(e, r) {
  115. "function" === typeof define && define.amd ? define([], r) : "object" === typeof module && module.exports ? module.exports = r() : e.anime = r()
  116. })(this, function() {
  117. function e(a) {
  118. if (!h.col(a)) try {
  119. return document.querySelectorAll(a)
  120. } catch (c) {}
  121. }
  122. function r(a, c) {
  123. for (var d = a.length, b = 2 <= arguments.length ? arguments[1] : void 0, f = [], n = 0; n < d; n++)
  124. if (n in a) {
  125. var k = a[n];
  126. c.call(b, k, n, a) && f.push(k)
  127. } return f
  128. }
  129. function p(a) {
  130. return a.reduce(function(a, d) {
  131. return a.concat(h.arr(d) ? p(d) : d)
  132. }, [])
  133. }
  134. function m(a) {
  135. if (h.arr(a)) return a;
  136. h.str(a) && (a = e(a) || a);
  137. return a instanceof NodeList || a instanceof HTMLCollection ? [].slice.call(a) : [a]
  138. }
  139. function u(a, c) {
  140. return a.some(function(a) {
  141. return a === c
  142. })
  143. }
  144. function C(a) {
  145. var c = {},
  146. d;
  147. for (d in a) c[d] = a[d];
  148. return c
  149. }
  150. function D(a, c) {
  151. var d = C(a),
  152. b;
  153. for (b in a) d[b] = c.hasOwnProperty(b) ? c[b] : a[b];
  154. return d
  155. }
  156. function z(a, c) {
  157. var d = C(a),
  158. b;
  159. for (b in c) d[b] = h.und(a[b]) ? c[b] : a[b];
  160. return d
  161. }
  162. function T(a) {
  163. a = a.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i, function(a, c, d, k) {
  164. return c + c + d + d + k + k
  165. });
  166. var c = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(a);
  167. a = parseInt(c[1], 16);
  168. var d = parseInt(c[2], 16),
  169. c = parseInt(c[3], 16);
  170. return "rgba(" + a + "," + d + "," + c + ",1)"
  171. }
  172. function U(a) {
  173. function c(a, c, b) {
  174. 0 > b && (b += 1);
  175. 1 < b && --b;
  176. return b < 1 / 6 ? a + 6 * (c - a) * b : .5 > b ? c : b < 2 / 3 ? a + (c - a) * (2 / 3 - b) * 6 : a
  177. }
  178. var d = /hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(a) || /hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(a);
  179. a = parseInt(d[1]) / 360;
  180. var b = parseInt(d[2]) / 100,
  181. f = parseInt(d[3]) / 100,
  182. d = d[4] || 1;
  183. if (0 == b) f = b = a = f;
  184. else {
  185. var n = .5 > f ? f * (1 + b) : f + b - f * b,
  186. k = 2 * f - n,
  187. f = c(k, n, a + 1 / 3),
  188. b = c(k, n, a);
  189. a = c(k, n, a - 1 / 3)
  190. }
  191. return "rgba(" +
  192. 255 * f + "," + 255 * b + "," + 255 * a + "," + d + ")"
  193. }
  194. function y(a) {
  195. if (a = /([\+\-]?[0-9#\.]+)(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(a)) return a[2]
  196. }
  197. function V(a) {
  198. if (-1 < a.indexOf("translate") || "perspective" === a) return "px";
  199. if (-1 < a.indexOf("rotate") || -1 < a.indexOf("skew")) return "deg"
  200. }
  201. function I(a, c) {
  202. return h.fnc(a) ? a(c.target, c.id, c.total) : a
  203. }
  204. function E(a, c) {
  205. if (c in a.style) return getComputedStyle(a).getPropertyValue(c.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase()) || "0"
  206. }
  207. function J(a, c) {
  208. if (h.dom(a) &&
  209. u(W, c)) return "transform";
  210. if (h.dom(a) && (a.getAttribute(c) || h.svg(a) && a[c])) return "attribute";
  211. if (h.dom(a) && "transform" !== c && E(a, c)) return "css";
  212. if (null != a[c]) return "object"
  213. }
  214. function X(a, c) {
  215. var d = V(c),
  216. d = -1 < c.indexOf("scale") ? 1 : 0 + d;
  217. a = a.style.transform;
  218. if (!a) return d;
  219. for (var b = [], f = [], n = [], k = /(\w+)\((.+?)\)/g; b = k.exec(a);) f.push(b[1]), n.push(b[2]);
  220. a = r(n, function(a, b) {
  221. return f[b] === c
  222. });
  223. return a.length ? a[0] : d
  224. }
  225. function K(a, c) {
  226. switch (J(a, c)) {
  227. case "transform":
  228. return X(a, c);
  229. case "css":
  230. return E(a, c);
  231. case "attribute":
  232. return a.getAttribute(c)
  233. }
  234. return a[c] ||
  235. 0
  236. }
  237. function L(a, c) {
  238. var d = /^(\*=|\+=|-=)/.exec(a);
  239. if (!d) return a;
  240. var b = y(a) || 0;
  241. c = parseFloat(c);
  242. a = parseFloat(a.replace(d[0], ""));
  243. switch (d[0][0]) {
  244. case "+":
  245. return c + a + b;
  246. case "-":
  247. return c - a + b;
  248. case "*":
  249. return c * a + b
  250. }
  251. }
  252. function F(a, c) {
  253. return Math.sqrt(Math.pow(c.x - a.x, 2) + Math.pow(c.y - a.y, 2))
  254. }
  255. function M(a) {
  256. a = a.points;
  257. for (var c = 0, d, b = 0; b < a.numberOfItems; b++) {
  258. var f = a.getItem(b);
  259. 0 < b && (c += F(d, f));
  260. d = f
  261. }
  262. return c
  263. }
  264. function N(a) {
  265. if (a.getTotalLength) return a.getTotalLength();
  266. switch (a.tagName.toLowerCase()) {
  267. case "circle":
  268. return 2 *
  269. Math.PI * a.getAttribute("r");
  270. case "rect":
  271. return 2 * a.getAttribute("width") + 2 * a.getAttribute("height");
  272. case "line":
  273. return F({
  274. x: a.getAttribute("x1"),
  275. y: a.getAttribute("y1")
  276. }, {
  277. x: a.getAttribute("x2"),
  278. y: a.getAttribute("y2")
  279. });
  280. case "polyline":
  281. return M(a);
  282. case "polygon":
  283. var c = a.points;
  284. return M(a) + F(c.getItem(c.numberOfItems - 1), c.getItem(0))
  285. }
  286. }
  287. function Y(a, c) {
  288. function d(b) {
  289. b = void 0 === b ? 0 : b;
  290. return a.el.getPointAtLength(1 <= c + b ? c + b : 0)
  291. }
  292. var b = d(),
  293. f = d(-1),
  294. n = d(1);
  295. switch (a.property) {
  296. case "x":
  297. return b.x;
  298. case "y":
  299. return b.y;
  300. case "angle":
  301. return 180 * Math.atan2(n.y - f.y, n.x - f.x) / Math.PI
  302. }
  303. }
  304. function O(a, c) {
  305. var d = /-?\d*\.?\d+/g,
  306. b;
  307. b = h.pth(a) ? a.totalLength : a;
  308. if (h.col(b))
  309. if (h.rgb(b)) {
  310. var f = /rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(b);
  311. b = f ? "rgba(" + f[1] + ",1)" : b
  312. } else b = h.hex(b) ? T(b) : h.hsl(b) ? U(b) : void 0;
  313. else f = (f = y(b)) ? b.substr(0, b.length - f.length) : b, b = c && !/\s/g.test(b) ? f + c : f;
  314. b += "";
  315. return {
  316. original: b,
  317. numbers: b.match(d) ? b.match(d).map(Number) : [0],
  318. strings: h.str(a) || c ? b.split(d) : []
  319. }
  320. }
  321. function P(a) {
  322. a = a ? p(h.arr(a) ? a.map(m) : m(a)) : [];
  323. return r(a,
  324. function(a, d, b) {
  325. return b.indexOf(a) === d
  326. })
  327. }
  328. function Z(a) {
  329. var c = P(a);
  330. return c.map(function(a, b) {
  331. return {
  332. target: a,
  333. id: b,
  334. total: c.length
  335. }
  336. })
  337. }
  338. function aa(a, c) {
  339. var d = C(c);
  340. if (h.arr(a)) {
  341. var b = a.length;
  342. 2 !== b || h.obj(a[0]) ? h.fnc(c.duration) || (d.duration = c.duration / b) : a = {
  343. value: a
  344. }
  345. }
  346. return m(a).map(function(a, b) {
  347. b = b ? 0 : c.delay;
  348. a = h.obj(a) && !h.pth(a) ? a : {
  349. value: a
  350. };
  351. h.und(a.delay) && (a.delay = b);
  352. return a
  353. }).map(function(a) {
  354. return z(a, d)
  355. })
  356. }
  357. function ba(a, c) {
  358. var d = {},
  359. b;
  360. for (b in a) {
  361. var f = I(a[b], c);
  362. h.arr(f) && (f = f.map(function(a) {
  363. return I(a,
  364. c)
  365. }), 1 === f.length && (f = f[0]));
  366. d[b] = f
  367. }
  368. d.duration = parseFloat(d.duration);
  369. d.delay = parseFloat(d.delay);
  370. return d
  371. }
  372. function ca(a) {
  373. return h.arr(a) ? A.apply(this, a) : Q[a]
  374. }
  375. function da(a, c) {
  376. var d;
  377. return a.tweens.map(function(b) {
  378. b = ba(b, c);
  379. var f = b.value,
  380. e = K(c.target, a.name),
  381. k = d ? d.to.original : e,
  382. k = h.arr(f) ? f[0] : k,
  383. w = L(h.arr(f) ? f[1] : f, k),
  384. e = y(w) || y(k) || y(e);
  385. b.from = O(k, e);
  386. b.to = O(w, e);
  387. b.start = d ? d.end : a.offset;
  388. b.end = b.start + b.delay + b.duration;
  389. b.easing = ca(b.easing);
  390. b.elasticity = (1E3 - Math.min(Math.max(b.elasticity, 1), 999)) /
  391. 1E3;
  392. b.isPath = h.pth(f);
  393. b.isColor = h.col(b.from.original);
  394. b.isColor && (b.round = 1);
  395. return d = b
  396. })
  397. }
  398. function ea(a, c) {
  399. return r(p(a.map(function(a) {
  400. return c.map(function(b) {
  401. var c = J(a.target, b.name);
  402. if (c) {
  403. var d = da(b, a);
  404. b = {
  405. type: c,
  406. property: b.name,
  407. animatable: a,
  408. tweens: d,
  409. duration: d[d.length - 1].end,
  410. delay: d[0].delay
  411. }
  412. } else b = void 0;
  413. return b
  414. })
  415. })), function(a) {
  416. return !h.und(a)
  417. })
  418. }
  419. function R(a, c, d, b) {
  420. var f = "delay" === a;
  421. return c.length ? (f ? Math.min : Math.max).apply(Math, c.map(function(b) {
  422. return b[a]
  423. })) : f ? b.delay : d.offset + b.delay +
  424. b.duration
  425. }
  426. function fa(a) {
  427. var c = D(ga, a),
  428. d = D(S, a),
  429. b = Z(a.targets),
  430. f = [],
  431. e = z(c, d),
  432. k;
  433. for (k in a) e.hasOwnProperty(k) || "targets" === k || f.push({
  434. name: k,
  435. offset: e.offset,
  436. tweens: aa(a[k], d)
  437. });
  438. a = ea(b, f);
  439. return z(c, {
  440. children: [],
  441. animatables: b,
  442. animations: a,
  443. duration: R("duration", a, c, d),
  444. delay: R("delay", a, c, d)
  445. })
  446. }
  447. function q(a) {
  448. function c() {
  449. return window.Promise && new Promise(function(a) {
  450. return p = a
  451. })
  452. }
  453. function d(a) {
  454. return g.reversed ? g.duration - a : a
  455. }
  456. function b(a) {
  457. for (var b = 0, c = {}, d = g.animations, f = d.length; b < f;) {
  458. var e = d[b],
  459. k = e.animatable,
  460. h = e.tweens,
  461. n = h.length - 1,
  462. l = h[n];
  463. n && (l = r(h, function(b) {
  464. return a < b.end
  465. })[0] || l);
  466. for (var h = Math.min(Math.max(a - l.start - l.delay, 0), l.duration) / l.duration, w = isNaN(h) ? 1 : l.easing(h, l.elasticity), h = l.to.strings, p = l.round, n = [], m = void 0, m = l.to.numbers.length, t = 0; t < m; t++) {
  467. var x = void 0,
  468. x = l.to.numbers[t],
  469. q = l.from.numbers[t],
  470. x = l.isPath ? Y(l.value, w * x) : q + w * (x - q);
  471. p && (l.isColor && 2 < t || (x = Math.round(x * p) / p));
  472. n.push(x)
  473. }
  474. if (l = h.length)
  475. for (m = h[0], w = 0; w < l; w++) p = h[w + 1], t = n[w], isNaN(t) || (m = p ? m + (t + p) : m + (t + " "));
  476. else m = n[0];
  477. ha[e.type](k.target, e.property, m, c, k.id);
  478. e.currentValue = m;
  479. b++
  480. }
  481. if (b = Object.keys(c).length)
  482. for (d = 0; d < b; d++) H || (H = E(document.body, "transform") ? "transform" : "-webkit-transform"), g.animatables[d].target.style[H] = c[d].join(" ");
  483. g.currentTime = a;
  484. g.progress = a / g.duration * 100
  485. }
  486. function f(a) {
  487. if (g[a]) g[a](g)
  488. }
  489. function e() {
  490. g.remaining && !0 !== g.remaining && g.remaining--
  491. }
  492. function k(a) {
  493. var k = g.duration,
  494. n = g.offset,
  495. w = n + g.delay,
  496. r = g.currentTime,
  497. x = g.reversed,
  498. q = d(a);
  499. if (g.children.length) {
  500. var u = g.children,
  501. v = u.length;
  502. if (q >= g.currentTime)
  503. for (var G = 0; G < v; G++) u[G].seek(q);
  504. else
  505. for (; v--;) u[v].seek(q)
  506. }
  507. if (q >= w || !k) g.began || (g.began = !0, f("begin")), f("run");
  508. if (q > n && q < k) b(q);
  509. else if (q <= n && 0 !== r && (b(0), x && e()), q >= k && r !== k || !k) b(k), x || e();
  510. f("update");
  511. a >= k && (g.remaining ? (t = h, "alternate" === g.direction && (g.reversed = !g.reversed)) : (g.pause(), g.completed || (g.completed = !0, f("complete"), "Promise" in window && (p(), m = c()))), l = 0)
  512. }
  513. a = void 0 === a ? {} : a;
  514. var h, t, l = 0,
  515. p = null,
  516. m = c(),
  517. g = fa(a);
  518. g.reset = function() {
  519. var a = g.direction,
  520. c = g.loop;
  521. g.currentTime =
  522. 0;
  523. g.progress = 0;
  524. g.paused = !0;
  525. g.began = !1;
  526. g.completed = !1;
  527. g.reversed = "reverse" === a;
  528. g.remaining = "alternate" === a && 1 === c ? 2 : c;
  529. b(0);
  530. for (a = g.children.length; a--;) g.children[a].reset()
  531. };
  532. g.tick = function(a) {
  533. h = a;
  534. t || (t = h);
  535. k((l + h - t) * q.speed)
  536. };
  537. g.seek = function(a) {
  538. k(d(a))
  539. };
  540. g.pause = function() {
  541. var a = v.indexOf(g); - 1 < a && v.splice(a, 1);
  542. g.paused = !0
  543. };
  544. g.play = function() {
  545. g.paused && (g.paused = !1, t = 0, l = d(g.currentTime), v.push(g), B || ia())
  546. };
  547. g.reverse = function() {
  548. g.reversed = !g.reversed;
  549. t = 0;
  550. l = d(g.currentTime)
  551. };
  552. g.restart = function() {
  553. g.pause();
  554. g.reset();
  555. g.play()
  556. };
  557. g.finished = m;
  558. g.reset();
  559. g.autoplay && g.play();
  560. return g
  561. }
  562. var ga = {
  563. update: void 0,
  564. begin: void 0,
  565. run: void 0,
  566. complete: void 0,
  567. loop: 1,
  568. direction: "normal",
  569. autoplay: !0,
  570. offset: 0
  571. },
  572. S = {
  573. duration: 1E3,
  574. delay: 0,
  575. easing: "easeOutElastic",
  576. elasticity: 500,
  577. round: 0
  578. },
  579. W = "translateX translateY translateZ rotate rotateX rotateY rotateZ scale scaleX scaleY scaleZ skewX skewY perspective".split(" "),
  580. H, h = {
  581. arr: function(a) {
  582. return Array.isArray(a)
  583. },
  584. obj: function(a) {
  585. return -1 < Object.prototype.toString.call(a).indexOf("Object")
  586. },
  587. pth: function(a) {
  588. return h.obj(a) && a.hasOwnProperty("totalLength")
  589. },
  590. svg: function(a) {
  591. return a instanceof SVGElement
  592. },
  593. dom: function(a) {
  594. return a.nodeType || h.svg(a)
  595. },
  596. str: function(a) {
  597. return "string" === typeof a
  598. },
  599. fnc: function(a) {
  600. return "function" === typeof a
  601. },
  602. und: function(a) {
  603. return "undefined" === typeof a
  604. },
  605. hex: function(a) {
  606. return /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(a)
  607. },
  608. rgb: function(a) {
  609. return /^rgb/.test(a)
  610. },
  611. hsl: function(a) {
  612. return /^hsl/.test(a)
  613. },
  614. col: function(a) {
  615. return h.hex(a) || h.rgb(a) || h.hsl(a)
  616. }
  617. },
  618. A = function() {
  619. function a(a,
  620. d, b) {
  621. return (((1 - 3 * b + 3 * d) * a + (3 * b - 6 * d)) * a + 3 * d) * a
  622. }
  623. return function(c, d, b, f) {
  624. if (0 <= c && 1 >= c && 0 <= b && 1 >= b) {
  625. var e = new Float32Array(11);
  626. if (c !== d || b !== f)
  627. for (var k = 0; 11 > k; ++k) e[k] = a(.1 * k, c, b);
  628. return function(k) {
  629. if (c === d && b === f) return k;
  630. if (0 === k) return 0;
  631. if (1 === k) return 1;
  632. for (var h = 0, l = 1; 10 !== l && e[l] <= k; ++l) h += .1;
  633. --l;
  634. var l = h + (k - e[l]) / (e[l + 1] - e[l]) * .1,
  635. n = 3 * (1 - 3 * b + 3 * c) * l * l + 2 * (3 * b - 6 * c) * l + 3 * c;
  636. if (.001 <= n) {
  637. for (h = 0; 4 > h; ++h) {
  638. n = 3 * (1 - 3 * b + 3 * c) * l * l + 2 * (3 * b - 6 * c) * l + 3 * c;
  639. if (0 === n) break;
  640. var m = a(l, c, b) - k,
  641. l = l - m / n
  642. }
  643. k = l
  644. } else if (0 ===
  645. n) k = l;
  646. else {
  647. var l = h,
  648. h = h + .1,
  649. g = 0;
  650. do m = l + (h - l) / 2, n = a(m, c, b) - k, 0 < n ? h = m : l = m; while (1e-7 < Math.abs(n) && 10 > ++g);
  651. k = m
  652. }
  653. return a(k, d, f)
  654. }
  655. }
  656. }
  657. }(),
  658. Q = function() {
  659. function a(a, b) {
  660. return 0 === a || 1 === a ? a : -Math.pow(2, 10 * (a - 1)) * Math.sin(2 * (a - 1 - b / (2 * Math.PI) * Math.asin(1)) * Math.PI / b)
  661. }
  662. var c = "Quad Cubic Quart Quint Sine Expo Circ Back Elastic".split(" "),
  663. d = {
  664. In: [
  665. [.55, .085, .68, .53],
  666. [.55, .055, .675, .19],
  667. [.895, .03, .685, .22],
  668. [.755, .05, .855, .06],
  669. [.47, 0, .745, .715],
  670. [.95, .05, .795, .035],
  671. [.6, .04, .98, .335],
  672. [.6, -.28, .735, .045], a
  673. ],
  674. Out: [
  675. [.25,
  676. .46, .45, .94
  677. ],
  678. [.215, .61, .355, 1],
  679. [.165, .84, .44, 1],
  680. [.23, 1, .32, 1],
  681. [.39, .575, .565, 1],
  682. [.19, 1, .22, 1],
  683. [.075, .82, .165, 1],
  684. [.175, .885, .32, 1.275],
  685. function(b, c) {
  686. return 1 - a(1 - b, c)
  687. }
  688. ],
  689. InOut: [
  690. [.455, .03, .515, .955],
  691. [.645, .045, .355, 1],
  692. [.77, 0, .175, 1],
  693. [.86, 0, .07, 1],
  694. [.445, .05, .55, .95],
  695. [1, 0, 0, 1],
  696. [.785, .135, .15, .86],
  697. [.68, -.55, .265, 1.55],
  698. function(b, c) {
  699. return .5 > b ? a(2 * b, c) / 2 : 1 - a(-2 * b + 2, c) / 2
  700. }
  701. ]
  702. },
  703. b = {
  704. linear: A(.25, .25, .75, .75)
  705. },
  706. f = {},
  707. e;
  708. for (e in d) f.type = e, d[f.type].forEach(function(a) {
  709. return function(d, f) {
  710. b["ease" + a.type + c[f]] = h.fnc(d) ?
  711. d : A.apply($jscomp$this, d)
  712. }
  713. }(f)), f = {
  714. type: f.type
  715. };
  716. return b
  717. }(),
  718. ha = {
  719. css: function(a, c, d) {
  720. return a.style[c] = d
  721. },
  722. attribute: function(a, c, d) {
  723. return a.setAttribute(c, d)
  724. },
  725. object: function(a, c, d) {
  726. return a[c] = d
  727. },
  728. transform: function(a, c, d, b, f) {
  729. b[f] || (b[f] = []);
  730. b[f].push(c + "(" + d + ")")
  731. }
  732. },
  733. v = [],
  734. B = 0,
  735. ia = function() {
  736. function a() {
  737. B = requestAnimationFrame(c)
  738. }
  739. function c(c) {
  740. var b = v.length;
  741. if (b) {
  742. for (var d = 0; d < b;) v[d] && v[d].tick(c), d++;
  743. a()
  744. } else cancelAnimationFrame(B), B = 0
  745. }
  746. return a
  747. }();
  748. q.version = "2.2.0";
  749. q.speed = 1;
  750. q.running = v;
  751. q.remove =
  752. function(a) {
  753. a = P(a);
  754. for (var c = v.length; c--;)
  755. for (var d = v[c], b = d.animations, f = b.length; f--;) u(a, b[f].animatable.target) && (b.splice(f, 1), b.length || d.pause())
  756. };
  757. q.getValue = K;
  758. q.path = function(a, c) {
  759. var d = h.str(a) ? e(a)[0] : a,
  760. b = c || 100;
  761. return function(a) {
  762. return {
  763. el: d,
  764. property: a,
  765. totalLength: N(d) * (b / 100)
  766. }
  767. }
  768. };
  769. q.setDashoffset = function(a) {
  770. var c = N(a);
  771. a.setAttribute("stroke-dasharray", c);
  772. return c
  773. };
  774. q.bezier = A;
  775. q.easings = Q;
  776. q.timeline = function(a) {
  777. var c = q(a);
  778. c.pause();
  779. c.duration = 0;
  780. c.add = function(d) {
  781. c.children.forEach(function(a) {
  782. a.began = !0;
  783. a.completed = !0
  784. });
  785. m(d).forEach(function(b) {
  786. var d = z(b, D(S, a || {}));
  787. d.targets = d.targets || a.targets;
  788. b = c.duration;
  789. var e = d.offset;
  790. d.autoplay = !1;
  791. d.direction = c.direction;
  792. d.offset = h.und(e) ? b : L(e, b);
  793. c.began = !0;
  794. c.completed = !0;
  795. c.seek(d.offset);
  796. d = q(d);
  797. d.began = !0;
  798. d.completed = !0;
  799. d.duration > b && (c.duration = d.duration);
  800. c.children.push(d)
  801. });
  802. c.seek(0);
  803. c.reset();
  804. c.autoplay && c.restart();
  805. return c
  806. };
  807. return c
  808. };
  809. q.random = function(a, c) {
  810. return Math.floor(Math.random() * (c - a + 1)) + a
  811. };
  812. return q
  813. });