gsap.js 157 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167
  1. // node_modules/.pnpm/gsap@3.11.4/node_modules/gsap/gsap-core.js
  2. function _assertThisInitialized(self) {
  3. if (self === void 0) {
  4. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  5. }
  6. return self;
  7. }
  8. function _inheritsLoose(subClass, superClass) {
  9. subClass.prototype = Object.create(superClass.prototype);
  10. subClass.prototype.constructor = subClass;
  11. subClass.__proto__ = superClass;
  12. }
  13. var _config = {
  14. autoSleep: 120,
  15. force3D: "auto",
  16. nullTargetWarn: 1,
  17. units: {
  18. lineHeight: ""
  19. }
  20. };
  21. var _defaults = {
  22. duration: 0.5,
  23. overwrite: false,
  24. delay: 0
  25. };
  26. var _suppressOverwrites;
  27. var _reverting;
  28. var _context;
  29. var _bigNum = 1e8;
  30. var _tinyNum = 1 / _bigNum;
  31. var _2PI = Math.PI * 2;
  32. var _HALF_PI = _2PI / 4;
  33. var _gsID = 0;
  34. var _sqrt = Math.sqrt;
  35. var _cos = Math.cos;
  36. var _sin = Math.sin;
  37. var _isString = function _isString2(value) {
  38. return typeof value === "string";
  39. };
  40. var _isFunction = function _isFunction2(value) {
  41. return typeof value === "function";
  42. };
  43. var _isNumber = function _isNumber2(value) {
  44. return typeof value === "number";
  45. };
  46. var _isUndefined = function _isUndefined2(value) {
  47. return typeof value === "undefined";
  48. };
  49. var _isObject = function _isObject2(value) {
  50. return typeof value === "object";
  51. };
  52. var _isNotFalse = function _isNotFalse2(value) {
  53. return value !== false;
  54. };
  55. var _windowExists = function _windowExists2() {
  56. return typeof window !== "undefined";
  57. };
  58. var _isFuncOrString = function _isFuncOrString2(value) {
  59. return _isFunction(value) || _isString(value);
  60. };
  61. var _isTypedArray = typeof ArrayBuffer === "function" && ArrayBuffer.isView || function() {
  62. };
  63. var _isArray = Array.isArray;
  64. var _strictNumExp = /(?:-?\.?\d|\.)+/gi;
  65. var _numExp = /[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g;
  66. var _numWithUnitExp = /[-+=.]*\d+[.e-]*\d*[a-z%]*/g;
  67. var _complexStringNumExp = /[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi;
  68. var _relExp = /[+-]=-?[.\d]+/;
  69. var _delimitedValueExp = /[^,'"\[\]\s]+/gi;
  70. var _unitExp = /^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i;
  71. var _globalTimeline;
  72. var _win;
  73. var _coreInitted;
  74. var _doc;
  75. var _globals = {};
  76. var _installScope = {};
  77. var _coreReady;
  78. var _install = function _install2(scope) {
  79. return (_installScope = _merge(scope, _globals)) && gsap;
  80. };
  81. var _missingPlugin = function _missingPlugin2(property, value) {
  82. return console.warn("Invalid property", property, "set to", value, "Missing plugin? gsap.registerPlugin()");
  83. };
  84. var _warn = function _warn2(message, suppress) {
  85. return !suppress && console.warn(message);
  86. };
  87. var _addGlobal = function _addGlobal2(name, obj) {
  88. return name && (_globals[name] = obj) && _installScope && (_installScope[name] = obj) || _globals;
  89. };
  90. var _emptyFunc = function _emptyFunc2() {
  91. return 0;
  92. };
  93. var _startAtRevertConfig = {
  94. suppressEvents: true,
  95. isStart: true,
  96. kill: false
  97. };
  98. var _revertConfigNoKill = {
  99. suppressEvents: true,
  100. kill: false
  101. };
  102. var _revertConfig = {
  103. suppressEvents: true
  104. };
  105. var _reservedProps = {};
  106. var _lazyTweens = [];
  107. var _lazyLookup = {};
  108. var _lastRenderedFrame;
  109. var _plugins = {};
  110. var _effects = {};
  111. var _nextGCFrame = 30;
  112. var _harnessPlugins = [];
  113. var _callbackNames = "";
  114. var _harness = function _harness2(targets) {
  115. var target = targets[0], harnessPlugin, i;
  116. _isObject(target) || _isFunction(target) || (targets = [targets]);
  117. if (!(harnessPlugin = (target._gsap || {}).harness)) {
  118. i = _harnessPlugins.length;
  119. while (i-- && !_harnessPlugins[i].targetTest(target)) {
  120. }
  121. harnessPlugin = _harnessPlugins[i];
  122. }
  123. i = targets.length;
  124. while (i--) {
  125. targets[i] && (targets[i]._gsap || (targets[i]._gsap = new GSCache(targets[i], harnessPlugin))) || targets.splice(i, 1);
  126. }
  127. return targets;
  128. };
  129. var _getCache = function _getCache2(target) {
  130. return target._gsap || _harness(toArray(target))[0]._gsap;
  131. };
  132. var _getProperty = function _getProperty2(target, property, v) {
  133. return (v = target[property]) && _isFunction(v) ? target[property]() : _isUndefined(v) && target.getAttribute && target.getAttribute(property) || v;
  134. };
  135. var _forEachName = function _forEachName2(names, func) {
  136. return (names = names.split(",")).forEach(func) || names;
  137. };
  138. var _round = function _round2(value) {
  139. return Math.round(value * 1e5) / 1e5 || 0;
  140. };
  141. var _roundPrecise = function _roundPrecise2(value) {
  142. return Math.round(value * 1e7) / 1e7 || 0;
  143. };
  144. var _parseRelative = function _parseRelative2(start, value) {
  145. var operator = value.charAt(0), end = parseFloat(value.substr(2));
  146. start = parseFloat(start);
  147. return operator === "+" ? start + end : operator === "-" ? start - end : operator === "*" ? start * end : start / end;
  148. };
  149. var _arrayContainsAny = function _arrayContainsAny2(toSearch, toFind) {
  150. var l = toFind.length, i = 0;
  151. for (; toSearch.indexOf(toFind[i]) < 0 && ++i < l; ) {
  152. }
  153. return i < l;
  154. };
  155. var _lazyRender = function _lazyRender2() {
  156. var l = _lazyTweens.length, a = _lazyTweens.slice(0), i, tween;
  157. _lazyLookup = {};
  158. _lazyTweens.length = 0;
  159. for (i = 0; i < l; i++) {
  160. tween = a[i];
  161. tween && tween._lazy && (tween.render(tween._lazy[0], tween._lazy[1], true)._lazy = 0);
  162. }
  163. };
  164. var _lazySafeRender = function _lazySafeRender2(animation, time, suppressEvents, force) {
  165. _lazyTweens.length && !_reverting && _lazyRender();
  166. animation.render(time, suppressEvents, force || _reverting && time < 0 && (animation._initted || animation._startAt));
  167. _lazyTweens.length && !_reverting && _lazyRender();
  168. };
  169. var _numericIfPossible = function _numericIfPossible2(value) {
  170. var n = parseFloat(value);
  171. return (n || n === 0) && (value + "").match(_delimitedValueExp).length < 2 ? n : _isString(value) ? value.trim() : value;
  172. };
  173. var _passThrough = function _passThrough2(p) {
  174. return p;
  175. };
  176. var _setDefaults = function _setDefaults2(obj, defaults2) {
  177. for (var p in defaults2) {
  178. p in obj || (obj[p] = defaults2[p]);
  179. }
  180. return obj;
  181. };
  182. var _setKeyframeDefaults = function _setKeyframeDefaults2(excludeDuration) {
  183. return function(obj, defaults2) {
  184. for (var p in defaults2) {
  185. p in obj || p === "duration" && excludeDuration || p === "ease" || (obj[p] = defaults2[p]);
  186. }
  187. };
  188. };
  189. var _merge = function _merge2(base, toMerge) {
  190. for (var p in toMerge) {
  191. base[p] = toMerge[p];
  192. }
  193. return base;
  194. };
  195. var _mergeDeep = function _mergeDeep2(base, toMerge) {
  196. for (var p in toMerge) {
  197. p !== "__proto__" && p !== "constructor" && p !== "prototype" && (base[p] = _isObject(toMerge[p]) ? _mergeDeep2(base[p] || (base[p] = {}), toMerge[p]) : toMerge[p]);
  198. }
  199. return base;
  200. };
  201. var _copyExcluding = function _copyExcluding2(obj, excluding) {
  202. var copy = {}, p;
  203. for (p in obj) {
  204. p in excluding || (copy[p] = obj[p]);
  205. }
  206. return copy;
  207. };
  208. var _inheritDefaults = function _inheritDefaults2(vars) {
  209. var parent = vars.parent || _globalTimeline, func = vars.keyframes ? _setKeyframeDefaults(_isArray(vars.keyframes)) : _setDefaults;
  210. if (_isNotFalse(vars.inherit)) {
  211. while (parent) {
  212. func(vars, parent.vars.defaults);
  213. parent = parent.parent || parent._dp;
  214. }
  215. }
  216. return vars;
  217. };
  218. var _arraysMatch = function _arraysMatch2(a1, a2) {
  219. var i = a1.length, match = i === a2.length;
  220. while (match && i-- && a1[i] === a2[i]) {
  221. }
  222. return i < 0;
  223. };
  224. var _addLinkedListItem = function _addLinkedListItem2(parent, child, firstProp, lastProp, sortBy) {
  225. if (firstProp === void 0) {
  226. firstProp = "_first";
  227. }
  228. if (lastProp === void 0) {
  229. lastProp = "_last";
  230. }
  231. var prev = parent[lastProp], t;
  232. if (sortBy) {
  233. t = child[sortBy];
  234. while (prev && prev[sortBy] > t) {
  235. prev = prev._prev;
  236. }
  237. }
  238. if (prev) {
  239. child._next = prev._next;
  240. prev._next = child;
  241. } else {
  242. child._next = parent[firstProp];
  243. parent[firstProp] = child;
  244. }
  245. if (child._next) {
  246. child._next._prev = child;
  247. } else {
  248. parent[lastProp] = child;
  249. }
  250. child._prev = prev;
  251. child.parent = child._dp = parent;
  252. return child;
  253. };
  254. var _removeLinkedListItem = function _removeLinkedListItem2(parent, child, firstProp, lastProp) {
  255. if (firstProp === void 0) {
  256. firstProp = "_first";
  257. }
  258. if (lastProp === void 0) {
  259. lastProp = "_last";
  260. }
  261. var prev = child._prev, next = child._next;
  262. if (prev) {
  263. prev._next = next;
  264. } else if (parent[firstProp] === child) {
  265. parent[firstProp] = next;
  266. }
  267. if (next) {
  268. next._prev = prev;
  269. } else if (parent[lastProp] === child) {
  270. parent[lastProp] = prev;
  271. }
  272. child._next = child._prev = child.parent = null;
  273. };
  274. var _removeFromParent = function _removeFromParent2(child, onlyIfParentHasAutoRemove) {
  275. child.parent && (!onlyIfParentHasAutoRemove || child.parent.autoRemoveChildren) && child.parent.remove(child);
  276. child._act = 0;
  277. };
  278. var _uncache = function _uncache2(animation, child) {
  279. if (animation && (!child || child._end > animation._dur || child._start < 0)) {
  280. var a = animation;
  281. while (a) {
  282. a._dirty = 1;
  283. a = a.parent;
  284. }
  285. }
  286. return animation;
  287. };
  288. var _recacheAncestors = function _recacheAncestors2(animation) {
  289. var parent = animation.parent;
  290. while (parent && parent.parent) {
  291. parent._dirty = 1;
  292. parent.totalDuration();
  293. parent = parent.parent;
  294. }
  295. return animation;
  296. };
  297. var _rewindStartAt = function _rewindStartAt2(tween, totalTime, suppressEvents, force) {
  298. return tween._startAt && (_reverting ? tween._startAt.revert(_revertConfigNoKill) : tween.vars.immediateRender && !tween.vars.autoRevert || tween._startAt.render(totalTime, true, force));
  299. };
  300. var _hasNoPausedAncestors = function _hasNoPausedAncestors2(animation) {
  301. return !animation || animation._ts && _hasNoPausedAncestors2(animation.parent);
  302. };
  303. var _elapsedCycleDuration = function _elapsedCycleDuration2(animation) {
  304. return animation._repeat ? _animationCycle(animation._tTime, animation = animation.duration() + animation._rDelay) * animation : 0;
  305. };
  306. var _animationCycle = function _animationCycle2(tTime, cycleDuration) {
  307. var whole = Math.floor(tTime /= cycleDuration);
  308. return tTime && whole === tTime ? whole - 1 : whole;
  309. };
  310. var _parentToChildTotalTime = function _parentToChildTotalTime2(parentTime, child) {
  311. return (parentTime - child._start) * child._ts + (child._ts >= 0 ? 0 : child._dirty ? child.totalDuration() : child._tDur);
  312. };
  313. var _setEnd = function _setEnd2(animation) {
  314. return animation._end = _roundPrecise(animation._start + (animation._tDur / Math.abs(animation._ts || animation._rts || _tinyNum) || 0));
  315. };
  316. var _alignPlayhead = function _alignPlayhead2(animation, totalTime) {
  317. var parent = animation._dp;
  318. if (parent && parent.smoothChildTiming && animation._ts) {
  319. animation._start = _roundPrecise(parent._time - (animation._ts > 0 ? totalTime / animation._ts : ((animation._dirty ? animation.totalDuration() : animation._tDur) - totalTime) / -animation._ts));
  320. _setEnd(animation);
  321. parent._dirty || _uncache(parent, animation);
  322. }
  323. return animation;
  324. };
  325. var _postAddChecks = function _postAddChecks2(timeline2, child) {
  326. var t;
  327. if (child._time || child._initted && !child._dur) {
  328. t = _parentToChildTotalTime(timeline2.rawTime(), child);
  329. if (!child._dur || _clamp(0, child.totalDuration(), t) - child._tTime > _tinyNum) {
  330. child.render(t, true);
  331. }
  332. }
  333. if (_uncache(timeline2, child)._dp && timeline2._initted && timeline2._time >= timeline2._dur && timeline2._ts) {
  334. if (timeline2._dur < timeline2.duration()) {
  335. t = timeline2;
  336. while (t._dp) {
  337. t.rawTime() >= 0 && t.totalTime(t._tTime);
  338. t = t._dp;
  339. }
  340. }
  341. timeline2._zTime = -_tinyNum;
  342. }
  343. };
  344. var _addToTimeline = function _addToTimeline2(timeline2, child, position, skipChecks) {
  345. child.parent && _removeFromParent(child);
  346. child._start = _roundPrecise((_isNumber(position) ? position : position || timeline2 !== _globalTimeline ? _parsePosition(timeline2, position, child) : timeline2._time) + child._delay);
  347. child._end = _roundPrecise(child._start + (child.totalDuration() / Math.abs(child.timeScale()) || 0));
  348. _addLinkedListItem(timeline2, child, "_first", "_last", timeline2._sort ? "_start" : 0);
  349. _isFromOrFromStart(child) || (timeline2._recent = child);
  350. skipChecks || _postAddChecks(timeline2, child);
  351. timeline2._ts < 0 && _alignPlayhead(timeline2, timeline2._tTime);
  352. return timeline2;
  353. };
  354. var _scrollTrigger = function _scrollTrigger2(animation, trigger) {
  355. return (_globals.ScrollTrigger || _missingPlugin("scrollTrigger", trigger)) && _globals.ScrollTrigger.create(trigger, animation);
  356. };
  357. var _attemptInitTween = function _attemptInitTween2(tween, time, force, suppressEvents, tTime) {
  358. _initTween(tween, time, tTime);
  359. if (!tween._initted) {
  360. return 1;
  361. }
  362. if (!force && tween._pt && !_reverting && (tween._dur && tween.vars.lazy !== false || !tween._dur && tween.vars.lazy) && _lastRenderedFrame !== _ticker.frame) {
  363. _lazyTweens.push(tween);
  364. tween._lazy = [tTime, suppressEvents];
  365. return 1;
  366. }
  367. };
  368. var _parentPlayheadIsBeforeStart = function _parentPlayheadIsBeforeStart2(_ref) {
  369. var parent = _ref.parent;
  370. return parent && parent._ts && parent._initted && !parent._lock && (parent.rawTime() < 0 || _parentPlayheadIsBeforeStart2(parent));
  371. };
  372. var _isFromOrFromStart = function _isFromOrFromStart2(_ref2) {
  373. var data = _ref2.data;
  374. return data === "isFromStart" || data === "isStart";
  375. };
  376. var _renderZeroDurationTween = function _renderZeroDurationTween2(tween, totalTime, suppressEvents, force) {
  377. var prevRatio = tween.ratio, ratio = totalTime < 0 || !totalTime && (!tween._start && _parentPlayheadIsBeforeStart(tween) && !(!tween._initted && _isFromOrFromStart(tween)) || (tween._ts < 0 || tween._dp._ts < 0) && !_isFromOrFromStart(tween)) ? 0 : 1, repeatDelay = tween._rDelay, tTime = 0, pt, iteration, prevIteration;
  378. if (repeatDelay && tween._repeat) {
  379. tTime = _clamp(0, tween._tDur, totalTime);
  380. iteration = _animationCycle(tTime, repeatDelay);
  381. tween._yoyo && iteration & 1 && (ratio = 1 - ratio);
  382. if (iteration !== _animationCycle(tween._tTime, repeatDelay)) {
  383. prevRatio = 1 - ratio;
  384. tween.vars.repeatRefresh && tween._initted && tween.invalidate();
  385. }
  386. }
  387. if (ratio !== prevRatio || _reverting || force || tween._zTime === _tinyNum || !totalTime && tween._zTime) {
  388. if (!tween._initted && _attemptInitTween(tween, totalTime, force, suppressEvents, tTime)) {
  389. return;
  390. }
  391. prevIteration = tween._zTime;
  392. tween._zTime = totalTime || (suppressEvents ? _tinyNum : 0);
  393. suppressEvents || (suppressEvents = totalTime && !prevIteration);
  394. tween.ratio = ratio;
  395. tween._from && (ratio = 1 - ratio);
  396. tween._time = 0;
  397. tween._tTime = tTime;
  398. pt = tween._pt;
  399. while (pt) {
  400. pt.r(ratio, pt.d);
  401. pt = pt._next;
  402. }
  403. totalTime < 0 && _rewindStartAt(tween, totalTime, suppressEvents, true);
  404. tween._onUpdate && !suppressEvents && _callback(tween, "onUpdate");
  405. tTime && tween._repeat && !suppressEvents && tween.parent && _callback(tween, "onRepeat");
  406. if ((totalTime >= tween._tDur || totalTime < 0) && tween.ratio === ratio) {
  407. ratio && _removeFromParent(tween, 1);
  408. if (!suppressEvents && !_reverting) {
  409. _callback(tween, ratio ? "onComplete" : "onReverseComplete", true);
  410. tween._prom && tween._prom();
  411. }
  412. }
  413. } else if (!tween._zTime) {
  414. tween._zTime = totalTime;
  415. }
  416. };
  417. var _findNextPauseTween = function _findNextPauseTween2(animation, prevTime, time) {
  418. var child;
  419. if (time > prevTime) {
  420. child = animation._first;
  421. while (child && child._start <= time) {
  422. if (child.data === "isPause" && child._start > prevTime) {
  423. return child;
  424. }
  425. child = child._next;
  426. }
  427. } else {
  428. child = animation._last;
  429. while (child && child._start >= time) {
  430. if (child.data === "isPause" && child._start < prevTime) {
  431. return child;
  432. }
  433. child = child._prev;
  434. }
  435. }
  436. };
  437. var _setDuration = function _setDuration2(animation, duration, skipUncache, leavePlayhead) {
  438. var repeat = animation._repeat, dur = _roundPrecise(duration) || 0, totalProgress = animation._tTime / animation._tDur;
  439. totalProgress && !leavePlayhead && (animation._time *= dur / animation._dur);
  440. animation._dur = dur;
  441. animation._tDur = !repeat ? dur : repeat < 0 ? 1e10 : _roundPrecise(dur * (repeat + 1) + animation._rDelay * repeat);
  442. totalProgress > 0 && !leavePlayhead && _alignPlayhead(animation, animation._tTime = animation._tDur * totalProgress);
  443. animation.parent && _setEnd(animation);
  444. skipUncache || _uncache(animation.parent, animation);
  445. return animation;
  446. };
  447. var _onUpdateTotalDuration = function _onUpdateTotalDuration2(animation) {
  448. return animation instanceof Timeline ? _uncache(animation) : _setDuration(animation, animation._dur);
  449. };
  450. var _zeroPosition = {
  451. _start: 0,
  452. endTime: _emptyFunc,
  453. totalDuration: _emptyFunc
  454. };
  455. var _parsePosition = function _parsePosition2(animation, position, percentAnimation) {
  456. var labels = animation.labels, recent = animation._recent || _zeroPosition, clippedDuration = animation.duration() >= _bigNum ? recent.endTime(false) : animation._dur, i, offset, isPercent;
  457. if (_isString(position) && (isNaN(position) || position in labels)) {
  458. offset = position.charAt(0);
  459. isPercent = position.substr(-1) === "%";
  460. i = position.indexOf("=");
  461. if (offset === "<" || offset === ">") {
  462. i >= 0 && (position = position.replace(/=/, ""));
  463. return (offset === "<" ? recent._start : recent.endTime(recent._repeat >= 0)) + (parseFloat(position.substr(1)) || 0) * (isPercent ? (i < 0 ? recent : percentAnimation).totalDuration() / 100 : 1);
  464. }
  465. if (i < 0) {
  466. position in labels || (labels[position] = clippedDuration);
  467. return labels[position];
  468. }
  469. offset = parseFloat(position.charAt(i - 1) + position.substr(i + 1));
  470. if (isPercent && percentAnimation) {
  471. offset = offset / 100 * (_isArray(percentAnimation) ? percentAnimation[0] : percentAnimation).totalDuration();
  472. }
  473. return i > 1 ? _parsePosition2(animation, position.substr(0, i - 1), percentAnimation) + offset : clippedDuration + offset;
  474. }
  475. return position == null ? clippedDuration : +position;
  476. };
  477. var _createTweenType = function _createTweenType2(type, params, timeline2) {
  478. var isLegacy = _isNumber(params[1]), varsIndex = (isLegacy ? 2 : 1) + (type < 2 ? 0 : 1), vars = params[varsIndex], irVars, parent;
  479. isLegacy && (vars.duration = params[1]);
  480. vars.parent = timeline2;
  481. if (type) {
  482. irVars = vars;
  483. parent = timeline2;
  484. while (parent && !("immediateRender" in irVars)) {
  485. irVars = parent.vars.defaults || {};
  486. parent = _isNotFalse(parent.vars.inherit) && parent.parent;
  487. }
  488. vars.immediateRender = _isNotFalse(irVars.immediateRender);
  489. type < 2 ? vars.runBackwards = 1 : vars.startAt = params[varsIndex - 1];
  490. }
  491. return new Tween(params[0], vars, params[varsIndex + 1]);
  492. };
  493. var _conditionalReturn = function _conditionalReturn2(value, func) {
  494. return value || value === 0 ? func(value) : func;
  495. };
  496. var _clamp = function _clamp2(min, max, value) {
  497. return value < min ? min : value > max ? max : value;
  498. };
  499. var getUnit = function getUnit2(value, v) {
  500. return !_isString(value) || !(v = _unitExp.exec(value)) ? "" : v[1];
  501. };
  502. var clamp = function clamp2(min, max, value) {
  503. return _conditionalReturn(value, function(v) {
  504. return _clamp(min, max, v);
  505. });
  506. };
  507. var _slice = [].slice;
  508. var _isArrayLike = function _isArrayLike2(value, nonEmpty) {
  509. return value && _isObject(value) && "length" in value && (!nonEmpty && !value.length || value.length - 1 in value && _isObject(value[0])) && !value.nodeType && value !== _win;
  510. };
  511. var _flatten = function _flatten2(ar, leaveStrings, accumulator) {
  512. if (accumulator === void 0) {
  513. accumulator = [];
  514. }
  515. return ar.forEach(function(value) {
  516. var _accumulator;
  517. return _isString(value) && !leaveStrings || _isArrayLike(value, 1) ? (_accumulator = accumulator).push.apply(_accumulator, toArray(value)) : accumulator.push(value);
  518. }) || accumulator;
  519. };
  520. var toArray = function toArray2(value, scope, leaveStrings) {
  521. return _context && !scope && _context.selector ? _context.selector(value) : _isString(value) && !leaveStrings && (_coreInitted || !_wake()) ? _slice.call((scope || _doc).querySelectorAll(value), 0) : _isArray(value) ? _flatten(value, leaveStrings) : _isArrayLike(value) ? _slice.call(value, 0) : value ? [value] : [];
  522. };
  523. var selector = function selector2(value) {
  524. value = toArray(value)[0] || _warn("Invalid scope") || {};
  525. return function(v) {
  526. var el = value.current || value.nativeElement || value;
  527. return toArray(v, el.querySelectorAll ? el : el === value ? _warn("Invalid scope") || _doc.createElement("div") : value);
  528. };
  529. };
  530. var shuffle = function shuffle2(a) {
  531. return a.sort(function() {
  532. return 0.5 - Math.random();
  533. });
  534. };
  535. var distribute = function distribute2(v) {
  536. if (_isFunction(v)) {
  537. return v;
  538. }
  539. var vars = _isObject(v) ? v : {
  540. each: v
  541. }, ease = _parseEase(vars.ease), from = vars.from || 0, base = parseFloat(vars.base) || 0, cache = {}, isDecimal = from > 0 && from < 1, ratios = isNaN(from) || isDecimal, axis = vars.axis, ratioX = from, ratioY = from;
  542. if (_isString(from)) {
  543. ratioX = ratioY = {
  544. center: 0.5,
  545. edges: 0.5,
  546. end: 1
  547. }[from] || 0;
  548. } else if (!isDecimal && ratios) {
  549. ratioX = from[0];
  550. ratioY = from[1];
  551. }
  552. return function(i, target, a) {
  553. var l = (a || vars).length, distances = cache[l], originX, originY, x, y, d, j, max, min, wrapAt;
  554. if (!distances) {
  555. wrapAt = vars.grid === "auto" ? 0 : (vars.grid || [1, _bigNum])[1];
  556. if (!wrapAt) {
  557. max = -_bigNum;
  558. while (max < (max = a[wrapAt++].getBoundingClientRect().left) && wrapAt < l) {
  559. }
  560. wrapAt--;
  561. }
  562. distances = cache[l] = [];
  563. originX = ratios ? Math.min(wrapAt, l) * ratioX - 0.5 : from % wrapAt;
  564. originY = wrapAt === _bigNum ? 0 : ratios ? l * ratioY / wrapAt - 0.5 : from / wrapAt | 0;
  565. max = 0;
  566. min = _bigNum;
  567. for (j = 0; j < l; j++) {
  568. x = j % wrapAt - originX;
  569. y = originY - (j / wrapAt | 0);
  570. distances[j] = d = !axis ? _sqrt(x * x + y * y) : Math.abs(axis === "y" ? y : x);
  571. d > max && (max = d);
  572. d < min && (min = d);
  573. }
  574. from === "random" && shuffle(distances);
  575. distances.max = max - min;
  576. distances.min = min;
  577. distances.v = l = (parseFloat(vars.amount) || parseFloat(vars.each) * (wrapAt > l ? l - 1 : !axis ? Math.max(wrapAt, l / wrapAt) : axis === "y" ? l / wrapAt : wrapAt) || 0) * (from === "edges" ? -1 : 1);
  578. distances.b = l < 0 ? base - l : base;
  579. distances.u = getUnit(vars.amount || vars.each) || 0;
  580. ease = ease && l < 0 ? _invertEase(ease) : ease;
  581. }
  582. l = (distances[i] - distances.min) / distances.max || 0;
  583. return _roundPrecise(distances.b + (ease ? ease(l) : l) * distances.v) + distances.u;
  584. };
  585. };
  586. var _roundModifier = function _roundModifier2(v) {
  587. var p = Math.pow(10, ((v + "").split(".")[1] || "").length);
  588. return function(raw) {
  589. var n = _roundPrecise(Math.round(parseFloat(raw) / v) * v * p);
  590. return (n - n % 1) / p + (_isNumber(raw) ? 0 : getUnit(raw));
  591. };
  592. };
  593. var snap = function snap2(snapTo, value) {
  594. var isArray = _isArray(snapTo), radius, is2D;
  595. if (!isArray && _isObject(snapTo)) {
  596. radius = isArray = snapTo.radius || _bigNum;
  597. if (snapTo.values) {
  598. snapTo = toArray(snapTo.values);
  599. if (is2D = !_isNumber(snapTo[0])) {
  600. radius *= radius;
  601. }
  602. } else {
  603. snapTo = _roundModifier(snapTo.increment);
  604. }
  605. }
  606. return _conditionalReturn(value, !isArray ? _roundModifier(snapTo) : _isFunction(snapTo) ? function(raw) {
  607. is2D = snapTo(raw);
  608. return Math.abs(is2D - raw) <= radius ? is2D : raw;
  609. } : function(raw) {
  610. var x = parseFloat(is2D ? raw.x : raw), y = parseFloat(is2D ? raw.y : 0), min = _bigNum, closest = 0, i = snapTo.length, dx, dy;
  611. while (i--) {
  612. if (is2D) {
  613. dx = snapTo[i].x - x;
  614. dy = snapTo[i].y - y;
  615. dx = dx * dx + dy * dy;
  616. } else {
  617. dx = Math.abs(snapTo[i] - x);
  618. }
  619. if (dx < min) {
  620. min = dx;
  621. closest = i;
  622. }
  623. }
  624. closest = !radius || min <= radius ? snapTo[closest] : raw;
  625. return is2D || closest === raw || _isNumber(raw) ? closest : closest + getUnit(raw);
  626. });
  627. };
  628. var random = function random2(min, max, roundingIncrement, returnFunction) {
  629. return _conditionalReturn(_isArray(min) ? !max : roundingIncrement === true ? !!(roundingIncrement = 0) : !returnFunction, function() {
  630. return _isArray(min) ? min[~~(Math.random() * min.length)] : (roundingIncrement = roundingIncrement || 1e-5) && (returnFunction = roundingIncrement < 1 ? Math.pow(10, (roundingIncrement + "").length - 2) : 1) && Math.floor(Math.round((min - roundingIncrement / 2 + Math.random() * (max - min + roundingIncrement * 0.99)) / roundingIncrement) * roundingIncrement * returnFunction) / returnFunction;
  631. });
  632. };
  633. var pipe = function pipe2() {
  634. for (var _len = arguments.length, functions = new Array(_len), _key = 0; _key < _len; _key++) {
  635. functions[_key] = arguments[_key];
  636. }
  637. return function(value) {
  638. return functions.reduce(function(v, f) {
  639. return f(v);
  640. }, value);
  641. };
  642. };
  643. var unitize = function unitize2(func, unit) {
  644. return function(value) {
  645. return func(parseFloat(value)) + (unit || getUnit(value));
  646. };
  647. };
  648. var normalize = function normalize2(min, max, value) {
  649. return mapRange(min, max, 0, 1, value);
  650. };
  651. var _wrapArray = function _wrapArray2(a, wrapper, value) {
  652. return _conditionalReturn(value, function(index) {
  653. return a[~~wrapper(index)];
  654. });
  655. };
  656. var wrap = function wrap2(min, max, value) {
  657. var range = max - min;
  658. return _isArray(min) ? _wrapArray(min, wrap2(0, min.length), max) : _conditionalReturn(value, function(value2) {
  659. return (range + (value2 - min) % range) % range + min;
  660. });
  661. };
  662. var wrapYoyo = function wrapYoyo2(min, max, value) {
  663. var range = max - min, total = range * 2;
  664. return _isArray(min) ? _wrapArray(min, wrapYoyo2(0, min.length - 1), max) : _conditionalReturn(value, function(value2) {
  665. value2 = (total + (value2 - min) % total) % total || 0;
  666. return min + (value2 > range ? total - value2 : value2);
  667. });
  668. };
  669. var _replaceRandom = function _replaceRandom2(value) {
  670. var prev = 0, s = "", i, nums, end, isArray;
  671. while (~(i = value.indexOf("random(", prev))) {
  672. end = value.indexOf(")", i);
  673. isArray = value.charAt(i + 7) === "[";
  674. nums = value.substr(i + 7, end - i - 7).match(isArray ? _delimitedValueExp : _strictNumExp);
  675. s += value.substr(prev, i - prev) + random(isArray ? nums : +nums[0], isArray ? 0 : +nums[1], +nums[2] || 1e-5);
  676. prev = end + 1;
  677. }
  678. return s + value.substr(prev, value.length - prev);
  679. };
  680. var mapRange = function mapRange2(inMin, inMax, outMin, outMax, value) {
  681. var inRange = inMax - inMin, outRange = outMax - outMin;
  682. return _conditionalReturn(value, function(value2) {
  683. return outMin + ((value2 - inMin) / inRange * outRange || 0);
  684. });
  685. };
  686. var interpolate = function interpolate2(start, end, progress, mutate) {
  687. var func = isNaN(start + end) ? 0 : function(p2) {
  688. return (1 - p2) * start + p2 * end;
  689. };
  690. if (!func) {
  691. var isString = _isString(start), master = {}, p, i, interpolators, l, il;
  692. progress === true && (mutate = 1) && (progress = null);
  693. if (isString) {
  694. start = {
  695. p: start
  696. };
  697. end = {
  698. p: end
  699. };
  700. } else if (_isArray(start) && !_isArray(end)) {
  701. interpolators = [];
  702. l = start.length;
  703. il = l - 2;
  704. for (i = 1; i < l; i++) {
  705. interpolators.push(interpolate2(start[i - 1], start[i]));
  706. }
  707. l--;
  708. func = function func2(p2) {
  709. p2 *= l;
  710. var i2 = Math.min(il, ~~p2);
  711. return interpolators[i2](p2 - i2);
  712. };
  713. progress = end;
  714. } else if (!mutate) {
  715. start = _merge(_isArray(start) ? [] : {}, start);
  716. }
  717. if (!interpolators) {
  718. for (p in end) {
  719. _addPropTween.call(master, start, p, "get", end[p]);
  720. }
  721. func = function func2(p2) {
  722. return _renderPropTweens(p2, master) || (isString ? start.p : start);
  723. };
  724. }
  725. }
  726. return _conditionalReturn(progress, func);
  727. };
  728. var _getLabelInDirection = function _getLabelInDirection2(timeline2, fromTime, backward) {
  729. var labels = timeline2.labels, min = _bigNum, p, distance, label;
  730. for (p in labels) {
  731. distance = labels[p] - fromTime;
  732. if (distance < 0 === !!backward && distance && min > (distance = Math.abs(distance))) {
  733. label = p;
  734. min = distance;
  735. }
  736. }
  737. return label;
  738. };
  739. var _callback = function _callback2(animation, type, executeLazyFirst) {
  740. var v = animation.vars, callback = v[type], prevContext = _context, context3 = animation._ctx, params, scope, result;
  741. if (!callback) {
  742. return;
  743. }
  744. params = v[type + "Params"];
  745. scope = v.callbackScope || animation;
  746. executeLazyFirst && _lazyTweens.length && _lazyRender();
  747. context3 && (_context = context3);
  748. result = params ? callback.apply(scope, params) : callback.call(scope);
  749. _context = prevContext;
  750. return result;
  751. };
  752. var _interrupt = function _interrupt2(animation) {
  753. _removeFromParent(animation);
  754. animation.scrollTrigger && animation.scrollTrigger.kill(!!_reverting);
  755. animation.progress() < 1 && _callback(animation, "onInterrupt");
  756. return animation;
  757. };
  758. var _quickTween;
  759. var _createPlugin = function _createPlugin2(config3) {
  760. config3 = !config3.name && config3["default"] || config3;
  761. var name = config3.name, isFunc = _isFunction(config3), Plugin = name && !isFunc && config3.init ? function() {
  762. this._props = [];
  763. } : config3, instanceDefaults = {
  764. init: _emptyFunc,
  765. render: _renderPropTweens,
  766. add: _addPropTween,
  767. kill: _killPropTweensOf,
  768. modifier: _addPluginModifier,
  769. rawVars: 0
  770. }, statics = {
  771. targetTest: 0,
  772. get: 0,
  773. getSetter: _getSetter,
  774. aliases: {},
  775. register: 0
  776. };
  777. _wake();
  778. if (config3 !== Plugin) {
  779. if (_plugins[name]) {
  780. return;
  781. }
  782. _setDefaults(Plugin, _setDefaults(_copyExcluding(config3, instanceDefaults), statics));
  783. _merge(Plugin.prototype, _merge(instanceDefaults, _copyExcluding(config3, statics)));
  784. _plugins[Plugin.prop = name] = Plugin;
  785. if (config3.targetTest) {
  786. _harnessPlugins.push(Plugin);
  787. _reservedProps[name] = 1;
  788. }
  789. name = (name === "css" ? "CSS" : name.charAt(0).toUpperCase() + name.substr(1)) + "Plugin";
  790. }
  791. _addGlobal(name, Plugin);
  792. config3.register && config3.register(gsap, Plugin, PropTween);
  793. };
  794. var _255 = 255;
  795. var _colorLookup = {
  796. aqua: [0, _255, _255],
  797. lime: [0, _255, 0],
  798. silver: [192, 192, 192],
  799. black: [0, 0, 0],
  800. maroon: [128, 0, 0],
  801. teal: [0, 128, 128],
  802. blue: [0, 0, _255],
  803. navy: [0, 0, 128],
  804. white: [_255, _255, _255],
  805. olive: [128, 128, 0],
  806. yellow: [_255, _255, 0],
  807. orange: [_255, 165, 0],
  808. gray: [128, 128, 128],
  809. purple: [128, 0, 128],
  810. green: [0, 128, 0],
  811. red: [_255, 0, 0],
  812. pink: [_255, 192, 203],
  813. cyan: [0, _255, _255],
  814. transparent: [_255, _255, _255, 0]
  815. };
  816. var _hue = function _hue2(h, m1, m2) {
  817. h += h < 0 ? 1 : h > 1 ? -1 : 0;
  818. return (h * 6 < 1 ? m1 + (m2 - m1) * h * 6 : h < 0.5 ? m2 : h * 3 < 2 ? m1 + (m2 - m1) * (2 / 3 - h) * 6 : m1) * _255 + 0.5 | 0;
  819. };
  820. var splitColor = function splitColor2(v, toHSL, forceAlpha) {
  821. var a = !v ? _colorLookup.black : _isNumber(v) ? [v >> 16, v >> 8 & _255, v & _255] : 0, r, g, b, h, s, l, max, min, d, wasHSL;
  822. if (!a) {
  823. if (v.substr(-1) === ",") {
  824. v = v.substr(0, v.length - 1);
  825. }
  826. if (_colorLookup[v]) {
  827. a = _colorLookup[v];
  828. } else if (v.charAt(0) === "#") {
  829. if (v.length < 6) {
  830. r = v.charAt(1);
  831. g = v.charAt(2);
  832. b = v.charAt(3);
  833. v = "#" + r + r + g + g + b + b + (v.length === 5 ? v.charAt(4) + v.charAt(4) : "");
  834. }
  835. if (v.length === 9) {
  836. a = parseInt(v.substr(1, 6), 16);
  837. return [a >> 16, a >> 8 & _255, a & _255, parseInt(v.substr(7), 16) / 255];
  838. }
  839. v = parseInt(v.substr(1), 16);
  840. a = [v >> 16, v >> 8 & _255, v & _255];
  841. } else if (v.substr(0, 3) === "hsl") {
  842. a = wasHSL = v.match(_strictNumExp);
  843. if (!toHSL) {
  844. h = +a[0] % 360 / 360;
  845. s = +a[1] / 100;
  846. l = +a[2] / 100;
  847. g = l <= 0.5 ? l * (s + 1) : l + s - l * s;
  848. r = l * 2 - g;
  849. a.length > 3 && (a[3] *= 1);
  850. a[0] = _hue(h + 1 / 3, r, g);
  851. a[1] = _hue(h, r, g);
  852. a[2] = _hue(h - 1 / 3, r, g);
  853. } else if (~v.indexOf("=")) {
  854. a = v.match(_numExp);
  855. forceAlpha && a.length < 4 && (a[3] = 1);
  856. return a;
  857. }
  858. } else {
  859. a = v.match(_strictNumExp) || _colorLookup.transparent;
  860. }
  861. a = a.map(Number);
  862. }
  863. if (toHSL && !wasHSL) {
  864. r = a[0] / _255;
  865. g = a[1] / _255;
  866. b = a[2] / _255;
  867. max = Math.max(r, g, b);
  868. min = Math.min(r, g, b);
  869. l = (max + min) / 2;
  870. if (max === min) {
  871. h = s = 0;
  872. } else {
  873. d = max - min;
  874. s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
  875. h = max === r ? (g - b) / d + (g < b ? 6 : 0) : max === g ? (b - r) / d + 2 : (r - g) / d + 4;
  876. h *= 60;
  877. }
  878. a[0] = ~~(h + 0.5);
  879. a[1] = ~~(s * 100 + 0.5);
  880. a[2] = ~~(l * 100 + 0.5);
  881. }
  882. forceAlpha && a.length < 4 && (a[3] = 1);
  883. return a;
  884. };
  885. var _colorOrderData = function _colorOrderData2(v) {
  886. var values = [], c = [], i = -1;
  887. v.split(_colorExp).forEach(function(v2) {
  888. var a = v2.match(_numWithUnitExp) || [];
  889. values.push.apply(values, a);
  890. c.push(i += a.length + 1);
  891. });
  892. values.c = c;
  893. return values;
  894. };
  895. var _formatColors = function _formatColors2(s, toHSL, orderMatchData) {
  896. var result = "", colors = (s + result).match(_colorExp), type = toHSL ? "hsla(" : "rgba(", i = 0, c, shell, d, l;
  897. if (!colors) {
  898. return s;
  899. }
  900. colors = colors.map(function(color) {
  901. return (color = splitColor(color, toHSL, 1)) && type + (toHSL ? color[0] + "," + color[1] + "%," + color[2] + "%," + color[3] : color.join(",")) + ")";
  902. });
  903. if (orderMatchData) {
  904. d = _colorOrderData(s);
  905. c = orderMatchData.c;
  906. if (c.join(result) !== d.c.join(result)) {
  907. shell = s.replace(_colorExp, "1").split(_numWithUnitExp);
  908. l = shell.length - 1;
  909. for (; i < l; i++) {
  910. result += shell[i] + (~c.indexOf(i) ? colors.shift() || type + "0,0,0,0)" : (d.length ? d : colors.length ? colors : orderMatchData).shift());
  911. }
  912. }
  913. }
  914. if (!shell) {
  915. shell = s.split(_colorExp);
  916. l = shell.length - 1;
  917. for (; i < l; i++) {
  918. result += shell[i] + colors[i];
  919. }
  920. }
  921. return result + shell[l];
  922. };
  923. var _colorExp = function() {
  924. var s = "(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b", p;
  925. for (p in _colorLookup) {
  926. s += "|" + p + "\\b";
  927. }
  928. return new RegExp(s + ")", "gi");
  929. }();
  930. var _hslExp = /hsl[a]?\(/;
  931. var _colorStringFilter = function _colorStringFilter2(a) {
  932. var combined = a.join(" "), toHSL;
  933. _colorExp.lastIndex = 0;
  934. if (_colorExp.test(combined)) {
  935. toHSL = _hslExp.test(combined);
  936. a[1] = _formatColors(a[1], toHSL);
  937. a[0] = _formatColors(a[0], toHSL, _colorOrderData(a[1]));
  938. return true;
  939. }
  940. };
  941. var _tickerActive;
  942. var _ticker = function() {
  943. var _getTime = Date.now, _lagThreshold = 500, _adjustedLag = 33, _startTime = _getTime(), _lastUpdate = _startTime, _gap = 1e3 / 240, _nextTime = _gap, _listeners2 = [], _id, _req, _raf, _self, _delta, _i, _tick = function _tick2(v) {
  944. var elapsed = _getTime() - _lastUpdate, manual = v === true, overlap, dispatch, time, frame;
  945. elapsed > _lagThreshold && (_startTime += elapsed - _adjustedLag);
  946. _lastUpdate += elapsed;
  947. time = _lastUpdate - _startTime;
  948. overlap = time - _nextTime;
  949. if (overlap > 0 || manual) {
  950. frame = ++_self.frame;
  951. _delta = time - _self.time * 1e3;
  952. _self.time = time = time / 1e3;
  953. _nextTime += overlap + (overlap >= _gap ? 4 : _gap - overlap);
  954. dispatch = 1;
  955. }
  956. manual || (_id = _req(_tick2));
  957. if (dispatch) {
  958. for (_i = 0; _i < _listeners2.length; _i++) {
  959. _listeners2[_i](time, _delta, frame, v);
  960. }
  961. }
  962. };
  963. _self = {
  964. time: 0,
  965. frame: 0,
  966. tick: function tick() {
  967. _tick(true);
  968. },
  969. deltaRatio: function deltaRatio(fps) {
  970. return _delta / (1e3 / (fps || 60));
  971. },
  972. wake: function wake() {
  973. if (_coreReady) {
  974. if (!_coreInitted && _windowExists()) {
  975. _win = _coreInitted = window;
  976. _doc = _win.document || {};
  977. _globals.gsap = gsap;
  978. (_win.gsapVersions || (_win.gsapVersions = [])).push(gsap.version);
  979. _install(_installScope || _win.GreenSockGlobals || !_win.gsap && _win || {});
  980. _raf = _win.requestAnimationFrame;
  981. }
  982. _id && _self.sleep();
  983. _req = _raf || function(f) {
  984. return setTimeout(f, _nextTime - _self.time * 1e3 + 1 | 0);
  985. };
  986. _tickerActive = 1;
  987. _tick(2);
  988. }
  989. },
  990. sleep: function sleep() {
  991. (_raf ? _win.cancelAnimationFrame : clearTimeout)(_id);
  992. _tickerActive = 0;
  993. _req = _emptyFunc;
  994. },
  995. lagSmoothing: function lagSmoothing(threshold, adjustedLag) {
  996. _lagThreshold = threshold || Infinity;
  997. _adjustedLag = Math.min(adjustedLag || 33, _lagThreshold);
  998. },
  999. fps: function fps(_fps) {
  1000. _gap = 1e3 / (_fps || 240);
  1001. _nextTime = _self.time * 1e3 + _gap;
  1002. },
  1003. add: function add(callback, once, prioritize) {
  1004. var func = once ? function(t, d, f, v) {
  1005. callback(t, d, f, v);
  1006. _self.remove(func);
  1007. } : callback;
  1008. _self.remove(callback);
  1009. _listeners2[prioritize ? "unshift" : "push"](func);
  1010. _wake();
  1011. return func;
  1012. },
  1013. remove: function remove(callback, i) {
  1014. ~(i = _listeners2.indexOf(callback)) && _listeners2.splice(i, 1) && _i >= i && _i--;
  1015. },
  1016. _listeners: _listeners2
  1017. };
  1018. return _self;
  1019. }();
  1020. var _wake = function _wake2() {
  1021. return !_tickerActive && _ticker.wake();
  1022. };
  1023. var _easeMap = {};
  1024. var _customEaseExp = /^[\d.\-M][\d.\-,\s]/;
  1025. var _quotesExp = /["']/g;
  1026. var _parseObjectInString = function _parseObjectInString2(value) {
  1027. var obj = {}, split = value.substr(1, value.length - 3).split(":"), key = split[0], i = 1, l = split.length, index, val, parsedVal;
  1028. for (; i < l; i++) {
  1029. val = split[i];
  1030. index = i !== l - 1 ? val.lastIndexOf(",") : val.length;
  1031. parsedVal = val.substr(0, index);
  1032. obj[key] = isNaN(parsedVal) ? parsedVal.replace(_quotesExp, "").trim() : +parsedVal;
  1033. key = val.substr(index + 1).trim();
  1034. }
  1035. return obj;
  1036. };
  1037. var _valueInParentheses = function _valueInParentheses2(value) {
  1038. var open = value.indexOf("(") + 1, close = value.indexOf(")"), nested = value.indexOf("(", open);
  1039. return value.substring(open, ~nested && nested < close ? value.indexOf(")", close + 1) : close);
  1040. };
  1041. var _configEaseFromString = function _configEaseFromString2(name) {
  1042. var split = (name + "").split("("), ease = _easeMap[split[0]];
  1043. return ease && split.length > 1 && ease.config ? ease.config.apply(null, ~name.indexOf("{") ? [_parseObjectInString(split[1])] : _valueInParentheses(name).split(",").map(_numericIfPossible)) : _easeMap._CE && _customEaseExp.test(name) ? _easeMap._CE("", name) : ease;
  1044. };
  1045. var _invertEase = function _invertEase2(ease) {
  1046. return function(p) {
  1047. return 1 - ease(1 - p);
  1048. };
  1049. };
  1050. var _propagateYoyoEase = function _propagateYoyoEase2(timeline2, isYoyo) {
  1051. var child = timeline2._first, ease;
  1052. while (child) {
  1053. if (child instanceof Timeline) {
  1054. _propagateYoyoEase2(child, isYoyo);
  1055. } else if (child.vars.yoyoEase && (!child._yoyo || !child._repeat) && child._yoyo !== isYoyo) {
  1056. if (child.timeline) {
  1057. _propagateYoyoEase2(child.timeline, isYoyo);
  1058. } else {
  1059. ease = child._ease;
  1060. child._ease = child._yEase;
  1061. child._yEase = ease;
  1062. child._yoyo = isYoyo;
  1063. }
  1064. }
  1065. child = child._next;
  1066. }
  1067. };
  1068. var _parseEase = function _parseEase2(ease, defaultEase) {
  1069. return !ease ? defaultEase : (_isFunction(ease) ? ease : _easeMap[ease] || _configEaseFromString(ease)) || defaultEase;
  1070. };
  1071. var _insertEase = function _insertEase2(names, easeIn, easeOut, easeInOut) {
  1072. if (easeOut === void 0) {
  1073. easeOut = function easeOut2(p) {
  1074. return 1 - easeIn(1 - p);
  1075. };
  1076. }
  1077. if (easeInOut === void 0) {
  1078. easeInOut = function easeInOut2(p) {
  1079. return p < 0.5 ? easeIn(p * 2) / 2 : 1 - easeIn((1 - p) * 2) / 2;
  1080. };
  1081. }
  1082. var ease = {
  1083. easeIn,
  1084. easeOut,
  1085. easeInOut
  1086. }, lowercaseName;
  1087. _forEachName(names, function(name) {
  1088. _easeMap[name] = _globals[name] = ease;
  1089. _easeMap[lowercaseName = name.toLowerCase()] = easeOut;
  1090. for (var p in ease) {
  1091. _easeMap[lowercaseName + (p === "easeIn" ? ".in" : p === "easeOut" ? ".out" : ".inOut")] = _easeMap[name + "." + p] = ease[p];
  1092. }
  1093. });
  1094. return ease;
  1095. };
  1096. var _easeInOutFromOut = function _easeInOutFromOut2(easeOut) {
  1097. return function(p) {
  1098. return p < 0.5 ? (1 - easeOut(1 - p * 2)) / 2 : 0.5 + easeOut((p - 0.5) * 2) / 2;
  1099. };
  1100. };
  1101. var _configElastic = function _configElastic2(type, amplitude, period) {
  1102. var p1 = amplitude >= 1 ? amplitude : 1, p2 = (period || (type ? 0.3 : 0.45)) / (amplitude < 1 ? amplitude : 1), p3 = p2 / _2PI * (Math.asin(1 / p1) || 0), easeOut = function easeOut2(p) {
  1103. return p === 1 ? 1 : p1 * Math.pow(2, -10 * p) * _sin((p - p3) * p2) + 1;
  1104. }, ease = type === "out" ? easeOut : type === "in" ? function(p) {
  1105. return 1 - easeOut(1 - p);
  1106. } : _easeInOutFromOut(easeOut);
  1107. p2 = _2PI / p2;
  1108. ease.config = function(amplitude2, period2) {
  1109. return _configElastic2(type, amplitude2, period2);
  1110. };
  1111. return ease;
  1112. };
  1113. var _configBack = function _configBack2(type, overshoot) {
  1114. if (overshoot === void 0) {
  1115. overshoot = 1.70158;
  1116. }
  1117. var easeOut = function easeOut2(p) {
  1118. return p ? --p * p * ((overshoot + 1) * p + overshoot) + 1 : 0;
  1119. }, ease = type === "out" ? easeOut : type === "in" ? function(p) {
  1120. return 1 - easeOut(1 - p);
  1121. } : _easeInOutFromOut(easeOut);
  1122. ease.config = function(overshoot2) {
  1123. return _configBack2(type, overshoot2);
  1124. };
  1125. return ease;
  1126. };
  1127. _forEachName("Linear,Quad,Cubic,Quart,Quint,Strong", function(name, i) {
  1128. var power = i < 5 ? i + 1 : i;
  1129. _insertEase(name + ",Power" + (power - 1), i ? function(p) {
  1130. return Math.pow(p, power);
  1131. } : function(p) {
  1132. return p;
  1133. }, function(p) {
  1134. return 1 - Math.pow(1 - p, power);
  1135. }, function(p) {
  1136. return p < 0.5 ? Math.pow(p * 2, power) / 2 : 1 - Math.pow((1 - p) * 2, power) / 2;
  1137. });
  1138. });
  1139. _easeMap.Linear.easeNone = _easeMap.none = _easeMap.Linear.easeIn;
  1140. _insertEase("Elastic", _configElastic("in"), _configElastic("out"), _configElastic());
  1141. (function(n, c) {
  1142. var n1 = 1 / c, n2 = 2 * n1, n3 = 2.5 * n1, easeOut = function easeOut2(p) {
  1143. return p < n1 ? n * p * p : p < n2 ? n * Math.pow(p - 1.5 / c, 2) + 0.75 : p < n3 ? n * (p -= 2.25 / c) * p + 0.9375 : n * Math.pow(p - 2.625 / c, 2) + 0.984375;
  1144. };
  1145. _insertEase("Bounce", function(p) {
  1146. return 1 - easeOut(1 - p);
  1147. }, easeOut);
  1148. })(7.5625, 2.75);
  1149. _insertEase("Expo", function(p) {
  1150. return p ? Math.pow(2, 10 * (p - 1)) : 0;
  1151. });
  1152. _insertEase("Circ", function(p) {
  1153. return -(_sqrt(1 - p * p) - 1);
  1154. });
  1155. _insertEase("Sine", function(p) {
  1156. return p === 1 ? 1 : -_cos(p * _HALF_PI) + 1;
  1157. });
  1158. _insertEase("Back", _configBack("in"), _configBack("out"), _configBack());
  1159. _easeMap.SteppedEase = _easeMap.steps = _globals.SteppedEase = {
  1160. config: function config(steps, immediateStart) {
  1161. if (steps === void 0) {
  1162. steps = 1;
  1163. }
  1164. var p1 = 1 / steps, p2 = steps + (immediateStart ? 0 : 1), p3 = immediateStart ? 1 : 0, max = 1 - _tinyNum;
  1165. return function(p) {
  1166. return ((p2 * _clamp(0, max, p) | 0) + p3) * p1;
  1167. };
  1168. }
  1169. };
  1170. _defaults.ease = _easeMap["quad.out"];
  1171. _forEachName("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt", function(name) {
  1172. return _callbackNames += name + "," + name + "Params,";
  1173. });
  1174. var GSCache = function GSCache2(target, harness) {
  1175. this.id = _gsID++;
  1176. target._gsap = this;
  1177. this.target = target;
  1178. this.harness = harness;
  1179. this.get = harness ? harness.get : _getProperty;
  1180. this.set = harness ? harness.getSetter : _getSetter;
  1181. };
  1182. var Animation = function() {
  1183. function Animation2(vars) {
  1184. this.vars = vars;
  1185. this._delay = +vars.delay || 0;
  1186. if (this._repeat = vars.repeat === Infinity ? -2 : vars.repeat || 0) {
  1187. this._rDelay = vars.repeatDelay || 0;
  1188. this._yoyo = !!vars.yoyo || !!vars.yoyoEase;
  1189. }
  1190. this._ts = 1;
  1191. _setDuration(this, +vars.duration, 1, 1);
  1192. this.data = vars.data;
  1193. if (_context) {
  1194. this._ctx = _context;
  1195. _context.data.push(this);
  1196. }
  1197. _tickerActive || _ticker.wake();
  1198. }
  1199. var _proto = Animation2.prototype;
  1200. _proto.delay = function delay(value) {
  1201. if (value || value === 0) {
  1202. this.parent && this.parent.smoothChildTiming && this.startTime(this._start + value - this._delay);
  1203. this._delay = value;
  1204. return this;
  1205. }
  1206. return this._delay;
  1207. };
  1208. _proto.duration = function duration(value) {
  1209. return arguments.length ? this.totalDuration(this._repeat > 0 ? value + (value + this._rDelay) * this._repeat : value) : this.totalDuration() && this._dur;
  1210. };
  1211. _proto.totalDuration = function totalDuration(value) {
  1212. if (!arguments.length) {
  1213. return this._tDur;
  1214. }
  1215. this._dirty = 0;
  1216. return _setDuration(this, this._repeat < 0 ? value : (value - this._repeat * this._rDelay) / (this._repeat + 1));
  1217. };
  1218. _proto.totalTime = function totalTime(_totalTime, suppressEvents) {
  1219. _wake();
  1220. if (!arguments.length) {
  1221. return this._tTime;
  1222. }
  1223. var parent = this._dp;
  1224. if (parent && parent.smoothChildTiming && this._ts) {
  1225. _alignPlayhead(this, _totalTime);
  1226. !parent._dp || parent.parent || _postAddChecks(parent, this);
  1227. while (parent && parent.parent) {
  1228. if (parent.parent._time !== parent._start + (parent._ts >= 0 ? parent._tTime / parent._ts : (parent.totalDuration() - parent._tTime) / -parent._ts)) {
  1229. parent.totalTime(parent._tTime, true);
  1230. }
  1231. parent = parent.parent;
  1232. }
  1233. if (!this.parent && this._dp.autoRemoveChildren && (this._ts > 0 && _totalTime < this._tDur || this._ts < 0 && _totalTime > 0 || !this._tDur && !_totalTime)) {
  1234. _addToTimeline(this._dp, this, this._start - this._delay);
  1235. }
  1236. }
  1237. if (this._tTime !== _totalTime || !this._dur && !suppressEvents || this._initted && Math.abs(this._zTime) === _tinyNum || !_totalTime && !this._initted && (this.add || this._ptLookup)) {
  1238. this._ts || (this._pTime = _totalTime);
  1239. _lazySafeRender(this, _totalTime, suppressEvents);
  1240. }
  1241. return this;
  1242. };
  1243. _proto.time = function time(value, suppressEvents) {
  1244. return arguments.length ? this.totalTime(Math.min(this.totalDuration(), value + _elapsedCycleDuration(this)) % (this._dur + this._rDelay) || (value ? this._dur : 0), suppressEvents) : this._time;
  1245. };
  1246. _proto.totalProgress = function totalProgress(value, suppressEvents) {
  1247. return arguments.length ? this.totalTime(this.totalDuration() * value, suppressEvents) : this.totalDuration() ? Math.min(1, this._tTime / this._tDur) : this.ratio;
  1248. };
  1249. _proto.progress = function progress(value, suppressEvents) {
  1250. return arguments.length ? this.totalTime(this.duration() * (this._yoyo && !(this.iteration() & 1) ? 1 - value : value) + _elapsedCycleDuration(this), suppressEvents) : this.duration() ? Math.min(1, this._time / this._dur) : this.ratio;
  1251. };
  1252. _proto.iteration = function iteration(value, suppressEvents) {
  1253. var cycleDuration = this.duration() + this._rDelay;
  1254. return arguments.length ? this.totalTime(this._time + (value - 1) * cycleDuration, suppressEvents) : this._repeat ? _animationCycle(this._tTime, cycleDuration) + 1 : 1;
  1255. };
  1256. _proto.timeScale = function timeScale(value) {
  1257. if (!arguments.length) {
  1258. return this._rts === -_tinyNum ? 0 : this._rts;
  1259. }
  1260. if (this._rts === value) {
  1261. return this;
  1262. }
  1263. var tTime = this.parent && this._ts ? _parentToChildTotalTime(this.parent._time, this) : this._tTime;
  1264. this._rts = +value || 0;
  1265. this._ts = this._ps || value === -_tinyNum ? 0 : this._rts;
  1266. this.totalTime(_clamp(-this._delay, this._tDur, tTime), true);
  1267. _setEnd(this);
  1268. return _recacheAncestors(this);
  1269. };
  1270. _proto.paused = function paused(value) {
  1271. if (!arguments.length) {
  1272. return this._ps;
  1273. }
  1274. if (this._ps !== value) {
  1275. this._ps = value;
  1276. if (value) {
  1277. this._pTime = this._tTime || Math.max(-this._delay, this.rawTime());
  1278. this._ts = this._act = 0;
  1279. } else {
  1280. _wake();
  1281. this._ts = this._rts;
  1282. this.totalTime(this.parent && !this.parent.smoothChildTiming ? this.rawTime() : this._tTime || this._pTime, this.progress() === 1 && Math.abs(this._zTime) !== _tinyNum && (this._tTime -= _tinyNum));
  1283. }
  1284. }
  1285. return this;
  1286. };
  1287. _proto.startTime = function startTime(value) {
  1288. if (arguments.length) {
  1289. this._start = value;
  1290. var parent = this.parent || this._dp;
  1291. parent && (parent._sort || !this.parent) && _addToTimeline(parent, this, value - this._delay);
  1292. return this;
  1293. }
  1294. return this._start;
  1295. };
  1296. _proto.endTime = function endTime(includeRepeats) {
  1297. return this._start + (_isNotFalse(includeRepeats) ? this.totalDuration() : this.duration()) / Math.abs(this._ts || 1);
  1298. };
  1299. _proto.rawTime = function rawTime(wrapRepeats) {
  1300. var parent = this.parent || this._dp;
  1301. return !parent ? this._tTime : wrapRepeats && (!this._ts || this._repeat && this._time && this.totalProgress() < 1) ? this._tTime % (this._dur + this._rDelay) : !this._ts ? this._tTime : _parentToChildTotalTime(parent.rawTime(wrapRepeats), this);
  1302. };
  1303. _proto.revert = function revert(config3) {
  1304. if (config3 === void 0) {
  1305. config3 = _revertConfig;
  1306. }
  1307. var prevIsReverting = _reverting;
  1308. _reverting = config3;
  1309. if (this._initted || this._startAt) {
  1310. this.timeline && this.timeline.revert(config3);
  1311. this.totalTime(-0.01, config3.suppressEvents);
  1312. }
  1313. this.data !== "nested" && config3.kill !== false && this.kill();
  1314. _reverting = prevIsReverting;
  1315. return this;
  1316. };
  1317. _proto.globalTime = function globalTime(rawTime) {
  1318. var animation = this, time = arguments.length ? rawTime : animation.rawTime();
  1319. while (animation) {
  1320. time = animation._start + time / (animation._ts || 1);
  1321. animation = animation._dp;
  1322. }
  1323. return !this.parent && this._sat ? this._sat.vars.immediateRender ? -1 : this._sat.globalTime(rawTime) : time;
  1324. };
  1325. _proto.repeat = function repeat(value) {
  1326. if (arguments.length) {
  1327. this._repeat = value === Infinity ? -2 : value;
  1328. return _onUpdateTotalDuration(this);
  1329. }
  1330. return this._repeat === -2 ? Infinity : this._repeat;
  1331. };
  1332. _proto.repeatDelay = function repeatDelay(value) {
  1333. if (arguments.length) {
  1334. var time = this._time;
  1335. this._rDelay = value;
  1336. _onUpdateTotalDuration(this);
  1337. return time ? this.time(time) : this;
  1338. }
  1339. return this._rDelay;
  1340. };
  1341. _proto.yoyo = function yoyo(value) {
  1342. if (arguments.length) {
  1343. this._yoyo = value;
  1344. return this;
  1345. }
  1346. return this._yoyo;
  1347. };
  1348. _proto.seek = function seek(position, suppressEvents) {
  1349. return this.totalTime(_parsePosition(this, position), _isNotFalse(suppressEvents));
  1350. };
  1351. _proto.restart = function restart(includeDelay, suppressEvents) {
  1352. return this.play().totalTime(includeDelay ? -this._delay : 0, _isNotFalse(suppressEvents));
  1353. };
  1354. _proto.play = function play(from, suppressEvents) {
  1355. from != null && this.seek(from, suppressEvents);
  1356. return this.reversed(false).paused(false);
  1357. };
  1358. _proto.reverse = function reverse(from, suppressEvents) {
  1359. from != null && this.seek(from || this.totalDuration(), suppressEvents);
  1360. return this.reversed(true).paused(false);
  1361. };
  1362. _proto.pause = function pause(atTime, suppressEvents) {
  1363. atTime != null && this.seek(atTime, suppressEvents);
  1364. return this.paused(true);
  1365. };
  1366. _proto.resume = function resume() {
  1367. return this.paused(false);
  1368. };
  1369. _proto.reversed = function reversed(value) {
  1370. if (arguments.length) {
  1371. !!value !== this.reversed() && this.timeScale(-this._rts || (value ? -_tinyNum : 0));
  1372. return this;
  1373. }
  1374. return this._rts < 0;
  1375. };
  1376. _proto.invalidate = function invalidate() {
  1377. this._initted = this._act = 0;
  1378. this._zTime = -_tinyNum;
  1379. return this;
  1380. };
  1381. _proto.isActive = function isActive() {
  1382. var parent = this.parent || this._dp, start = this._start, rawTime;
  1383. return !!(!parent || this._ts && this._initted && parent.isActive() && (rawTime = parent.rawTime(true)) >= start && rawTime < this.endTime(true) - _tinyNum);
  1384. };
  1385. _proto.eventCallback = function eventCallback(type, callback, params) {
  1386. var vars = this.vars;
  1387. if (arguments.length > 1) {
  1388. if (!callback) {
  1389. delete vars[type];
  1390. } else {
  1391. vars[type] = callback;
  1392. params && (vars[type + "Params"] = params);
  1393. type === "onUpdate" && (this._onUpdate = callback);
  1394. }
  1395. return this;
  1396. }
  1397. return vars[type];
  1398. };
  1399. _proto.then = function then(onFulfilled) {
  1400. var self = this;
  1401. return new Promise(function(resolve) {
  1402. var f = _isFunction(onFulfilled) ? onFulfilled : _passThrough, _resolve = function _resolve2() {
  1403. var _then = self.then;
  1404. self.then = null;
  1405. _isFunction(f) && (f = f(self)) && (f.then || f === self) && (self.then = _then);
  1406. resolve(f);
  1407. self.then = _then;
  1408. };
  1409. if (self._initted && self.totalProgress() === 1 && self._ts >= 0 || !self._tTime && self._ts < 0) {
  1410. _resolve();
  1411. } else {
  1412. self._prom = _resolve;
  1413. }
  1414. });
  1415. };
  1416. _proto.kill = function kill() {
  1417. _interrupt(this);
  1418. };
  1419. return Animation2;
  1420. }();
  1421. _setDefaults(Animation.prototype, {
  1422. _time: 0,
  1423. _start: 0,
  1424. _end: 0,
  1425. _tTime: 0,
  1426. _tDur: 0,
  1427. _dirty: 0,
  1428. _repeat: 0,
  1429. _yoyo: false,
  1430. parent: null,
  1431. _initted: false,
  1432. _rDelay: 0,
  1433. _ts: 1,
  1434. _dp: 0,
  1435. ratio: 0,
  1436. _zTime: -_tinyNum,
  1437. _prom: 0,
  1438. _ps: false,
  1439. _rts: 1
  1440. });
  1441. var Timeline = function(_Animation) {
  1442. _inheritsLoose(Timeline2, _Animation);
  1443. function Timeline2(vars, position) {
  1444. var _this;
  1445. if (vars === void 0) {
  1446. vars = {};
  1447. }
  1448. _this = _Animation.call(this, vars) || this;
  1449. _this.labels = {};
  1450. _this.smoothChildTiming = !!vars.smoothChildTiming;
  1451. _this.autoRemoveChildren = !!vars.autoRemoveChildren;
  1452. _this._sort = _isNotFalse(vars.sortChildren);
  1453. _globalTimeline && _addToTimeline(vars.parent || _globalTimeline, _assertThisInitialized(_this), position);
  1454. vars.reversed && _this.reverse();
  1455. vars.paused && _this.paused(true);
  1456. vars.scrollTrigger && _scrollTrigger(_assertThisInitialized(_this), vars.scrollTrigger);
  1457. return _this;
  1458. }
  1459. var _proto2 = Timeline2.prototype;
  1460. _proto2.to = function to(targets, vars, position) {
  1461. _createTweenType(0, arguments, this);
  1462. return this;
  1463. };
  1464. _proto2.from = function from(targets, vars, position) {
  1465. _createTweenType(1, arguments, this);
  1466. return this;
  1467. };
  1468. _proto2.fromTo = function fromTo(targets, fromVars, toVars, position) {
  1469. _createTweenType(2, arguments, this);
  1470. return this;
  1471. };
  1472. _proto2.set = function set(targets, vars, position) {
  1473. vars.duration = 0;
  1474. vars.parent = this;
  1475. _inheritDefaults(vars).repeatDelay || (vars.repeat = 0);
  1476. vars.immediateRender = !!vars.immediateRender;
  1477. new Tween(targets, vars, _parsePosition(this, position), 1);
  1478. return this;
  1479. };
  1480. _proto2.call = function call(callback, params, position) {
  1481. return _addToTimeline(this, Tween.delayedCall(0, callback, params), position);
  1482. };
  1483. _proto2.staggerTo = function staggerTo(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams) {
  1484. vars.duration = duration;
  1485. vars.stagger = vars.stagger || stagger;
  1486. vars.onComplete = onCompleteAll;
  1487. vars.onCompleteParams = onCompleteAllParams;
  1488. vars.parent = this;
  1489. new Tween(targets, vars, _parsePosition(this, position));
  1490. return this;
  1491. };
  1492. _proto2.staggerFrom = function staggerFrom(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams) {
  1493. vars.runBackwards = 1;
  1494. _inheritDefaults(vars).immediateRender = _isNotFalse(vars.immediateRender);
  1495. return this.staggerTo(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams);
  1496. };
  1497. _proto2.staggerFromTo = function staggerFromTo(targets, duration, fromVars, toVars, stagger, position, onCompleteAll, onCompleteAllParams) {
  1498. toVars.startAt = fromVars;
  1499. _inheritDefaults(toVars).immediateRender = _isNotFalse(toVars.immediateRender);
  1500. return this.staggerTo(targets, duration, toVars, stagger, position, onCompleteAll, onCompleteAllParams);
  1501. };
  1502. _proto2.render = function render3(totalTime, suppressEvents, force) {
  1503. var prevTime = this._time, tDur = this._dirty ? this.totalDuration() : this._tDur, dur = this._dur, tTime = totalTime <= 0 ? 0 : _roundPrecise(totalTime), crossingStart = this._zTime < 0 !== totalTime < 0 && (this._initted || !dur), time, child, next, iteration, cycleDuration, prevPaused, pauseTween, timeScale, prevStart, prevIteration, yoyo, isYoyo;
  1504. this !== _globalTimeline && tTime > tDur && totalTime >= 0 && (tTime = tDur);
  1505. if (tTime !== this._tTime || force || crossingStart) {
  1506. if (prevTime !== this._time && dur) {
  1507. tTime += this._time - prevTime;
  1508. totalTime += this._time - prevTime;
  1509. }
  1510. time = tTime;
  1511. prevStart = this._start;
  1512. timeScale = this._ts;
  1513. prevPaused = !timeScale;
  1514. if (crossingStart) {
  1515. dur || (prevTime = this._zTime);
  1516. (totalTime || !suppressEvents) && (this._zTime = totalTime);
  1517. }
  1518. if (this._repeat) {
  1519. yoyo = this._yoyo;
  1520. cycleDuration = dur + this._rDelay;
  1521. if (this._repeat < -1 && totalTime < 0) {
  1522. return this.totalTime(cycleDuration * 100 + totalTime, suppressEvents, force);
  1523. }
  1524. time = _roundPrecise(tTime % cycleDuration);
  1525. if (tTime === tDur) {
  1526. iteration = this._repeat;
  1527. time = dur;
  1528. } else {
  1529. iteration = ~~(tTime / cycleDuration);
  1530. if (iteration && iteration === tTime / cycleDuration) {
  1531. time = dur;
  1532. iteration--;
  1533. }
  1534. time > dur && (time = dur);
  1535. }
  1536. prevIteration = _animationCycle(this._tTime, cycleDuration);
  1537. !prevTime && this._tTime && prevIteration !== iteration && (prevIteration = iteration);
  1538. if (yoyo && iteration & 1) {
  1539. time = dur - time;
  1540. isYoyo = 1;
  1541. }
  1542. if (iteration !== prevIteration && !this._lock) {
  1543. var rewinding = yoyo && prevIteration & 1, doesWrap = rewinding === (yoyo && iteration & 1);
  1544. iteration < prevIteration && (rewinding = !rewinding);
  1545. prevTime = rewinding ? 0 : dur;
  1546. this._lock = 1;
  1547. this.render(prevTime || (isYoyo ? 0 : _roundPrecise(iteration * cycleDuration)), suppressEvents, !dur)._lock = 0;
  1548. this._tTime = tTime;
  1549. !suppressEvents && this.parent && _callback(this, "onRepeat");
  1550. this.vars.repeatRefresh && !isYoyo && (this.invalidate()._lock = 1);
  1551. if (prevTime && prevTime !== this._time || prevPaused !== !this._ts || this.vars.onRepeat && !this.parent && !this._act) {
  1552. return this;
  1553. }
  1554. dur = this._dur;
  1555. tDur = this._tDur;
  1556. if (doesWrap) {
  1557. this._lock = 2;
  1558. prevTime = rewinding ? dur : -1e-4;
  1559. this.render(prevTime, true);
  1560. this.vars.repeatRefresh && !isYoyo && this.invalidate();
  1561. }
  1562. this._lock = 0;
  1563. if (!this._ts && !prevPaused) {
  1564. return this;
  1565. }
  1566. _propagateYoyoEase(this, isYoyo);
  1567. }
  1568. }
  1569. if (this._hasPause && !this._forcing && this._lock < 2) {
  1570. pauseTween = _findNextPauseTween(this, _roundPrecise(prevTime), _roundPrecise(time));
  1571. if (pauseTween) {
  1572. tTime -= time - (time = pauseTween._start);
  1573. }
  1574. }
  1575. this._tTime = tTime;
  1576. this._time = time;
  1577. this._act = !timeScale;
  1578. if (!this._initted) {
  1579. this._onUpdate = this.vars.onUpdate;
  1580. this._initted = 1;
  1581. this._zTime = totalTime;
  1582. prevTime = 0;
  1583. }
  1584. if (!prevTime && time && !suppressEvents) {
  1585. _callback(this, "onStart");
  1586. if (this._tTime !== tTime) {
  1587. return this;
  1588. }
  1589. }
  1590. if (time >= prevTime && totalTime >= 0) {
  1591. child = this._first;
  1592. while (child) {
  1593. next = child._next;
  1594. if ((child._act || time >= child._start) && child._ts && pauseTween !== child) {
  1595. if (child.parent !== this) {
  1596. return this.render(totalTime, suppressEvents, force);
  1597. }
  1598. child.render(child._ts > 0 ? (time - child._start) * child._ts : (child._dirty ? child.totalDuration() : child._tDur) + (time - child._start) * child._ts, suppressEvents, force);
  1599. if (time !== this._time || !this._ts && !prevPaused) {
  1600. pauseTween = 0;
  1601. next && (tTime += this._zTime = -_tinyNum);
  1602. break;
  1603. }
  1604. }
  1605. child = next;
  1606. }
  1607. } else {
  1608. child = this._last;
  1609. var adjustedTime = totalTime < 0 ? totalTime : time;
  1610. while (child) {
  1611. next = child._prev;
  1612. if ((child._act || adjustedTime <= child._end) && child._ts && pauseTween !== child) {
  1613. if (child.parent !== this) {
  1614. return this.render(totalTime, suppressEvents, force);
  1615. }
  1616. child.render(child._ts > 0 ? (adjustedTime - child._start) * child._ts : (child._dirty ? child.totalDuration() : child._tDur) + (adjustedTime - child._start) * child._ts, suppressEvents, force || _reverting && (child._initted || child._startAt));
  1617. if (time !== this._time || !this._ts && !prevPaused) {
  1618. pauseTween = 0;
  1619. next && (tTime += this._zTime = adjustedTime ? -_tinyNum : _tinyNum);
  1620. break;
  1621. }
  1622. }
  1623. child = next;
  1624. }
  1625. }
  1626. if (pauseTween && !suppressEvents) {
  1627. this.pause();
  1628. pauseTween.render(time >= prevTime ? 0 : -_tinyNum)._zTime = time >= prevTime ? 1 : -1;
  1629. if (this._ts) {
  1630. this._start = prevStart;
  1631. _setEnd(this);
  1632. return this.render(totalTime, suppressEvents, force);
  1633. }
  1634. }
  1635. this._onUpdate && !suppressEvents && _callback(this, "onUpdate", true);
  1636. if (tTime === tDur && this._tTime >= this.totalDuration() || !tTime && prevTime) {
  1637. if (prevStart === this._start || Math.abs(timeScale) !== Math.abs(this._ts)) {
  1638. if (!this._lock) {
  1639. (totalTime || !dur) && (tTime === tDur && this._ts > 0 || !tTime && this._ts < 0) && _removeFromParent(this, 1);
  1640. if (!suppressEvents && !(totalTime < 0 && !prevTime) && (tTime || prevTime || !tDur)) {
  1641. _callback(this, tTime === tDur && totalTime >= 0 ? "onComplete" : "onReverseComplete", true);
  1642. this._prom && !(tTime < tDur && this.timeScale() > 0) && this._prom();
  1643. }
  1644. }
  1645. }
  1646. }
  1647. }
  1648. return this;
  1649. };
  1650. _proto2.add = function add(child, position) {
  1651. var _this2 = this;
  1652. _isNumber(position) || (position = _parsePosition(this, position, child));
  1653. if (!(child instanceof Animation)) {
  1654. if (_isArray(child)) {
  1655. child.forEach(function(obj) {
  1656. return _this2.add(obj, position);
  1657. });
  1658. return this;
  1659. }
  1660. if (_isString(child)) {
  1661. return this.addLabel(child, position);
  1662. }
  1663. if (_isFunction(child)) {
  1664. child = Tween.delayedCall(0, child);
  1665. } else {
  1666. return this;
  1667. }
  1668. }
  1669. return this !== child ? _addToTimeline(this, child, position) : this;
  1670. };
  1671. _proto2.getChildren = function getChildren(nested, tweens, timelines, ignoreBeforeTime) {
  1672. if (nested === void 0) {
  1673. nested = true;
  1674. }
  1675. if (tweens === void 0) {
  1676. tweens = true;
  1677. }
  1678. if (timelines === void 0) {
  1679. timelines = true;
  1680. }
  1681. if (ignoreBeforeTime === void 0) {
  1682. ignoreBeforeTime = -_bigNum;
  1683. }
  1684. var a = [], child = this._first;
  1685. while (child) {
  1686. if (child._start >= ignoreBeforeTime) {
  1687. if (child instanceof Tween) {
  1688. tweens && a.push(child);
  1689. } else {
  1690. timelines && a.push(child);
  1691. nested && a.push.apply(a, child.getChildren(true, tweens, timelines));
  1692. }
  1693. }
  1694. child = child._next;
  1695. }
  1696. return a;
  1697. };
  1698. _proto2.getById = function getById2(id) {
  1699. var animations = this.getChildren(1, 1, 1), i = animations.length;
  1700. while (i--) {
  1701. if (animations[i].vars.id === id) {
  1702. return animations[i];
  1703. }
  1704. }
  1705. };
  1706. _proto2.remove = function remove(child) {
  1707. if (_isString(child)) {
  1708. return this.removeLabel(child);
  1709. }
  1710. if (_isFunction(child)) {
  1711. return this.killTweensOf(child);
  1712. }
  1713. _removeLinkedListItem(this, child);
  1714. if (child === this._recent) {
  1715. this._recent = this._last;
  1716. }
  1717. return _uncache(this);
  1718. };
  1719. _proto2.totalTime = function totalTime(_totalTime2, suppressEvents) {
  1720. if (!arguments.length) {
  1721. return this._tTime;
  1722. }
  1723. this._forcing = 1;
  1724. if (!this._dp && this._ts) {
  1725. this._start = _roundPrecise(_ticker.time - (this._ts > 0 ? _totalTime2 / this._ts : (this.totalDuration() - _totalTime2) / -this._ts));
  1726. }
  1727. _Animation.prototype.totalTime.call(this, _totalTime2, suppressEvents);
  1728. this._forcing = 0;
  1729. return this;
  1730. };
  1731. _proto2.addLabel = function addLabel(label, position) {
  1732. this.labels[label] = _parsePosition(this, position);
  1733. return this;
  1734. };
  1735. _proto2.removeLabel = function removeLabel(label) {
  1736. delete this.labels[label];
  1737. return this;
  1738. };
  1739. _proto2.addPause = function addPause(position, callback, params) {
  1740. var t = Tween.delayedCall(0, callback || _emptyFunc, params);
  1741. t.data = "isPause";
  1742. this._hasPause = 1;
  1743. return _addToTimeline(this, t, _parsePosition(this, position));
  1744. };
  1745. _proto2.removePause = function removePause(position) {
  1746. var child = this._first;
  1747. position = _parsePosition(this, position);
  1748. while (child) {
  1749. if (child._start === position && child.data === "isPause") {
  1750. _removeFromParent(child);
  1751. }
  1752. child = child._next;
  1753. }
  1754. };
  1755. _proto2.killTweensOf = function killTweensOf(targets, props, onlyActive) {
  1756. var tweens = this.getTweensOf(targets, onlyActive), i = tweens.length;
  1757. while (i--) {
  1758. _overwritingTween !== tweens[i] && tweens[i].kill(targets, props);
  1759. }
  1760. return this;
  1761. };
  1762. _proto2.getTweensOf = function getTweensOf2(targets, onlyActive) {
  1763. var a = [], parsedTargets = toArray(targets), child = this._first, isGlobalTime = _isNumber(onlyActive), children;
  1764. while (child) {
  1765. if (child instanceof Tween) {
  1766. if (_arrayContainsAny(child._targets, parsedTargets) && (isGlobalTime ? (!_overwritingTween || child._initted && child._ts) && child.globalTime(0) <= onlyActive && child.globalTime(child.totalDuration()) > onlyActive : !onlyActive || child.isActive())) {
  1767. a.push(child);
  1768. }
  1769. } else if ((children = child.getTweensOf(parsedTargets, onlyActive)).length) {
  1770. a.push.apply(a, children);
  1771. }
  1772. child = child._next;
  1773. }
  1774. return a;
  1775. };
  1776. _proto2.tweenTo = function tweenTo(position, vars) {
  1777. vars = vars || {};
  1778. var tl = this, endTime = _parsePosition(tl, position), _vars = vars, startAt = _vars.startAt, _onStart = _vars.onStart, onStartParams = _vars.onStartParams, immediateRender = _vars.immediateRender, initted, tween = Tween.to(tl, _setDefaults({
  1779. ease: vars.ease || "none",
  1780. lazy: false,
  1781. immediateRender: false,
  1782. time: endTime,
  1783. overwrite: "auto",
  1784. duration: vars.duration || Math.abs((endTime - (startAt && "time" in startAt ? startAt.time : tl._time)) / tl.timeScale()) || _tinyNum,
  1785. onStart: function onStart() {
  1786. tl.pause();
  1787. if (!initted) {
  1788. var duration = vars.duration || Math.abs((endTime - (startAt && "time" in startAt ? startAt.time : tl._time)) / tl.timeScale());
  1789. tween._dur !== duration && _setDuration(tween, duration, 0, 1).render(tween._time, true, true);
  1790. initted = 1;
  1791. }
  1792. _onStart && _onStart.apply(tween, onStartParams || []);
  1793. }
  1794. }, vars));
  1795. return immediateRender ? tween.render(0) : tween;
  1796. };
  1797. _proto2.tweenFromTo = function tweenFromTo(fromPosition, toPosition, vars) {
  1798. return this.tweenTo(toPosition, _setDefaults({
  1799. startAt: {
  1800. time: _parsePosition(this, fromPosition)
  1801. }
  1802. }, vars));
  1803. };
  1804. _proto2.recent = function recent() {
  1805. return this._recent;
  1806. };
  1807. _proto2.nextLabel = function nextLabel(afterTime) {
  1808. if (afterTime === void 0) {
  1809. afterTime = this._time;
  1810. }
  1811. return _getLabelInDirection(this, _parsePosition(this, afterTime));
  1812. };
  1813. _proto2.previousLabel = function previousLabel(beforeTime) {
  1814. if (beforeTime === void 0) {
  1815. beforeTime = this._time;
  1816. }
  1817. return _getLabelInDirection(this, _parsePosition(this, beforeTime), 1);
  1818. };
  1819. _proto2.currentLabel = function currentLabel(value) {
  1820. return arguments.length ? this.seek(value, true) : this.previousLabel(this._time + _tinyNum);
  1821. };
  1822. _proto2.shiftChildren = function shiftChildren(amount, adjustLabels, ignoreBeforeTime) {
  1823. if (ignoreBeforeTime === void 0) {
  1824. ignoreBeforeTime = 0;
  1825. }
  1826. var child = this._first, labels = this.labels, p;
  1827. while (child) {
  1828. if (child._start >= ignoreBeforeTime) {
  1829. child._start += amount;
  1830. child._end += amount;
  1831. }
  1832. child = child._next;
  1833. }
  1834. if (adjustLabels) {
  1835. for (p in labels) {
  1836. if (labels[p] >= ignoreBeforeTime) {
  1837. labels[p] += amount;
  1838. }
  1839. }
  1840. }
  1841. return _uncache(this);
  1842. };
  1843. _proto2.invalidate = function invalidate(soft) {
  1844. var child = this._first;
  1845. this._lock = 0;
  1846. while (child) {
  1847. child.invalidate(soft);
  1848. child = child._next;
  1849. }
  1850. return _Animation.prototype.invalidate.call(this, soft);
  1851. };
  1852. _proto2.clear = function clear(includeLabels) {
  1853. if (includeLabels === void 0) {
  1854. includeLabels = true;
  1855. }
  1856. var child = this._first, next;
  1857. while (child) {
  1858. next = child._next;
  1859. this.remove(child);
  1860. child = next;
  1861. }
  1862. this._dp && (this._time = this._tTime = this._pTime = 0);
  1863. includeLabels && (this.labels = {});
  1864. return _uncache(this);
  1865. };
  1866. _proto2.totalDuration = function totalDuration(value) {
  1867. var max = 0, self = this, child = self._last, prevStart = _bigNum, prev, start, parent;
  1868. if (arguments.length) {
  1869. return self.timeScale((self._repeat < 0 ? self.duration() : self.totalDuration()) / (self.reversed() ? -value : value));
  1870. }
  1871. if (self._dirty) {
  1872. parent = self.parent;
  1873. while (child) {
  1874. prev = child._prev;
  1875. child._dirty && child.totalDuration();
  1876. start = child._start;
  1877. if (start > prevStart && self._sort && child._ts && !self._lock) {
  1878. self._lock = 1;
  1879. _addToTimeline(self, child, start - child._delay, 1)._lock = 0;
  1880. } else {
  1881. prevStart = start;
  1882. }
  1883. if (start < 0 && child._ts) {
  1884. max -= start;
  1885. if (!parent && !self._dp || parent && parent.smoothChildTiming) {
  1886. self._start += start / self._ts;
  1887. self._time -= start;
  1888. self._tTime -= start;
  1889. }
  1890. self.shiftChildren(-start, false, -Infinity);
  1891. prevStart = 0;
  1892. }
  1893. child._end > max && child._ts && (max = child._end);
  1894. child = prev;
  1895. }
  1896. _setDuration(self, self === _globalTimeline && self._time > max ? self._time : max, 1, 1);
  1897. self._dirty = 0;
  1898. }
  1899. return self._tDur;
  1900. };
  1901. Timeline2.updateRoot = function updateRoot(time) {
  1902. if (_globalTimeline._ts) {
  1903. _lazySafeRender(_globalTimeline, _parentToChildTotalTime(time, _globalTimeline));
  1904. _lastRenderedFrame = _ticker.frame;
  1905. }
  1906. if (_ticker.frame >= _nextGCFrame) {
  1907. _nextGCFrame += _config.autoSleep || 120;
  1908. var child = _globalTimeline._first;
  1909. if (!child || !child._ts) {
  1910. if (_config.autoSleep && _ticker._listeners.length < 2) {
  1911. while (child && !child._ts) {
  1912. child = child._next;
  1913. }
  1914. child || _ticker.sleep();
  1915. }
  1916. }
  1917. }
  1918. };
  1919. return Timeline2;
  1920. }(Animation);
  1921. _setDefaults(Timeline.prototype, {
  1922. _lock: 0,
  1923. _hasPause: 0,
  1924. _forcing: 0
  1925. });
  1926. var _addComplexStringPropTween = function _addComplexStringPropTween2(target, prop, start, end, setter, stringFilter, funcParam) {
  1927. var pt = new PropTween(this._pt, target, prop, 0, 1, _renderComplexString, null, setter), index = 0, matchIndex = 0, result, startNums, color, endNum, chunk, startNum, hasRandom, a;
  1928. pt.b = start;
  1929. pt.e = end;
  1930. start += "";
  1931. end += "";
  1932. if (hasRandom = ~end.indexOf("random(")) {
  1933. end = _replaceRandom(end);
  1934. }
  1935. if (stringFilter) {
  1936. a = [start, end];
  1937. stringFilter(a, target, prop);
  1938. start = a[0];
  1939. end = a[1];
  1940. }
  1941. startNums = start.match(_complexStringNumExp) || [];
  1942. while (result = _complexStringNumExp.exec(end)) {
  1943. endNum = result[0];
  1944. chunk = end.substring(index, result.index);
  1945. if (color) {
  1946. color = (color + 1) % 5;
  1947. } else if (chunk.substr(-5) === "rgba(") {
  1948. color = 1;
  1949. }
  1950. if (endNum !== startNums[matchIndex++]) {
  1951. startNum = parseFloat(startNums[matchIndex - 1]) || 0;
  1952. pt._pt = {
  1953. _next: pt._pt,
  1954. p: chunk || matchIndex === 1 ? chunk : ",",
  1955. s: startNum,
  1956. c: endNum.charAt(1) === "=" ? _parseRelative(startNum, endNum) - startNum : parseFloat(endNum) - startNum,
  1957. m: color && color < 4 ? Math.round : 0
  1958. };
  1959. index = _complexStringNumExp.lastIndex;
  1960. }
  1961. }
  1962. pt.c = index < end.length ? end.substring(index, end.length) : "";
  1963. pt.fp = funcParam;
  1964. if (_relExp.test(end) || hasRandom) {
  1965. pt.e = 0;
  1966. }
  1967. this._pt = pt;
  1968. return pt;
  1969. };
  1970. var _addPropTween = function _addPropTween2(target, prop, start, end, index, targets, modifier, stringFilter, funcParam, optional) {
  1971. _isFunction(end) && (end = end(index || 0, target, targets));
  1972. var currentValue = target[prop], parsedStart = start !== "get" ? start : !_isFunction(currentValue) ? currentValue : funcParam ? target[prop.indexOf("set") || !_isFunction(target["get" + prop.substr(3)]) ? prop : "get" + prop.substr(3)](funcParam) : target[prop](), setter = !_isFunction(currentValue) ? _setterPlain : funcParam ? _setterFuncWithParam : _setterFunc, pt;
  1973. if (_isString(end)) {
  1974. if (~end.indexOf("random(")) {
  1975. end = _replaceRandom(end);
  1976. }
  1977. if (end.charAt(1) === "=") {
  1978. pt = _parseRelative(parsedStart, end) + (getUnit(parsedStart) || 0);
  1979. if (pt || pt === 0) {
  1980. end = pt;
  1981. }
  1982. }
  1983. }
  1984. if (!optional || parsedStart !== end || _forceAllPropTweens) {
  1985. if (!isNaN(parsedStart * end) && end !== "") {
  1986. pt = new PropTween(this._pt, target, prop, +parsedStart || 0, end - (parsedStart || 0), typeof currentValue === "boolean" ? _renderBoolean : _renderPlain, 0, setter);
  1987. funcParam && (pt.fp = funcParam);
  1988. modifier && pt.modifier(modifier, this, target);
  1989. return this._pt = pt;
  1990. }
  1991. !currentValue && !(prop in target) && _missingPlugin(prop, end);
  1992. return _addComplexStringPropTween.call(this, target, prop, parsedStart, end, setter, stringFilter || _config.stringFilter, funcParam);
  1993. }
  1994. };
  1995. var _processVars = function _processVars2(vars, index, target, targets, tween) {
  1996. _isFunction(vars) && (vars = _parseFuncOrString(vars, tween, index, target, targets));
  1997. if (!_isObject(vars) || vars.style && vars.nodeType || _isArray(vars) || _isTypedArray(vars)) {
  1998. return _isString(vars) ? _parseFuncOrString(vars, tween, index, target, targets) : vars;
  1999. }
  2000. var copy = {}, p;
  2001. for (p in vars) {
  2002. copy[p] = _parseFuncOrString(vars[p], tween, index, target, targets);
  2003. }
  2004. return copy;
  2005. };
  2006. var _checkPlugin = function _checkPlugin2(property, vars, tween, index, target, targets) {
  2007. var plugin, pt, ptLookup, i;
  2008. if (_plugins[property] && (plugin = new _plugins[property]()).init(target, plugin.rawVars ? vars[property] : _processVars(vars[property], index, target, targets, tween), tween, index, targets) !== false) {
  2009. tween._pt = pt = new PropTween(tween._pt, target, property, 0, 1, plugin.render, plugin, 0, plugin.priority);
  2010. if (tween !== _quickTween) {
  2011. ptLookup = tween._ptLookup[tween._targets.indexOf(target)];
  2012. i = plugin._props.length;
  2013. while (i--) {
  2014. ptLookup[plugin._props[i]] = pt;
  2015. }
  2016. }
  2017. }
  2018. return plugin;
  2019. };
  2020. var _overwritingTween;
  2021. var _forceAllPropTweens;
  2022. var _initTween = function _initTween2(tween, time, tTime) {
  2023. var vars = tween.vars, ease = vars.ease, startAt = vars.startAt, immediateRender = vars.immediateRender, lazy = vars.lazy, onUpdate = vars.onUpdate, onUpdateParams = vars.onUpdateParams, callbackScope = vars.callbackScope, runBackwards = vars.runBackwards, yoyoEase = vars.yoyoEase, keyframes = vars.keyframes, autoRevert = vars.autoRevert, dur = tween._dur, prevStartAt = tween._startAt, targets = tween._targets, parent = tween.parent, fullTargets = parent && parent.data === "nested" ? parent.vars.targets : targets, autoOverwrite = tween._overwrite === "auto" && !_suppressOverwrites, tl = tween.timeline, cleanVars, i, p, pt, target, hasPriority, gsData, harness, plugin, ptLookup, index, harnessVars, overwritten;
  2024. tl && (!keyframes || !ease) && (ease = "none");
  2025. tween._ease = _parseEase(ease, _defaults.ease);
  2026. tween._yEase = yoyoEase ? _invertEase(_parseEase(yoyoEase === true ? ease : yoyoEase, _defaults.ease)) : 0;
  2027. if (yoyoEase && tween._yoyo && !tween._repeat) {
  2028. yoyoEase = tween._yEase;
  2029. tween._yEase = tween._ease;
  2030. tween._ease = yoyoEase;
  2031. }
  2032. tween._from = !tl && !!vars.runBackwards;
  2033. if (!tl || keyframes && !vars.stagger) {
  2034. harness = targets[0] ? _getCache(targets[0]).harness : 0;
  2035. harnessVars = harness && vars[harness.prop];
  2036. cleanVars = _copyExcluding(vars, _reservedProps);
  2037. if (prevStartAt) {
  2038. prevStartAt._zTime < 0 && prevStartAt.progress(1);
  2039. time < 0 && runBackwards && immediateRender && !autoRevert ? prevStartAt.render(-1, true) : prevStartAt.revert(runBackwards && dur ? _revertConfigNoKill : _startAtRevertConfig);
  2040. prevStartAt._lazy = 0;
  2041. }
  2042. if (startAt) {
  2043. _removeFromParent(tween._startAt = Tween.set(targets, _setDefaults({
  2044. data: "isStart",
  2045. overwrite: false,
  2046. parent,
  2047. immediateRender: true,
  2048. lazy: !prevStartAt && _isNotFalse(lazy),
  2049. startAt: null,
  2050. delay: 0,
  2051. onUpdate,
  2052. onUpdateParams,
  2053. callbackScope,
  2054. stagger: 0
  2055. }, startAt)));
  2056. tween._startAt._dp = 0;
  2057. tween._startAt._sat = tween;
  2058. time < 0 && (_reverting || !immediateRender && !autoRevert) && tween._startAt.revert(_revertConfigNoKill);
  2059. if (immediateRender) {
  2060. if (dur && time <= 0 && tTime <= 0) {
  2061. time && (tween._zTime = time);
  2062. return;
  2063. }
  2064. }
  2065. } else if (runBackwards && dur) {
  2066. if (!prevStartAt) {
  2067. time && (immediateRender = false);
  2068. p = _setDefaults({
  2069. overwrite: false,
  2070. data: "isFromStart",
  2071. lazy: immediateRender && !prevStartAt && _isNotFalse(lazy),
  2072. immediateRender,
  2073. stagger: 0,
  2074. parent
  2075. }, cleanVars);
  2076. harnessVars && (p[harness.prop] = harnessVars);
  2077. _removeFromParent(tween._startAt = Tween.set(targets, p));
  2078. tween._startAt._dp = 0;
  2079. tween._startAt._sat = tween;
  2080. time < 0 && (_reverting ? tween._startAt.revert(_revertConfigNoKill) : tween._startAt.render(-1, true));
  2081. tween._zTime = time;
  2082. if (!immediateRender) {
  2083. _initTween2(tween._startAt, _tinyNum, _tinyNum);
  2084. } else if (!time) {
  2085. return;
  2086. }
  2087. }
  2088. }
  2089. tween._pt = tween._ptCache = 0;
  2090. lazy = dur && _isNotFalse(lazy) || lazy && !dur;
  2091. for (i = 0; i < targets.length; i++) {
  2092. target = targets[i];
  2093. gsData = target._gsap || _harness(targets)[i]._gsap;
  2094. tween._ptLookup[i] = ptLookup = {};
  2095. _lazyLookup[gsData.id] && _lazyTweens.length && _lazyRender();
  2096. index = fullTargets === targets ? i : fullTargets.indexOf(target);
  2097. if (harness && (plugin = new harness()).init(target, harnessVars || cleanVars, tween, index, fullTargets) !== false) {
  2098. tween._pt = pt = new PropTween(tween._pt, target, plugin.name, 0, 1, plugin.render, plugin, 0, plugin.priority);
  2099. plugin._props.forEach(function(name) {
  2100. ptLookup[name] = pt;
  2101. });
  2102. plugin.priority && (hasPriority = 1);
  2103. }
  2104. if (!harness || harnessVars) {
  2105. for (p in cleanVars) {
  2106. if (_plugins[p] && (plugin = _checkPlugin(p, cleanVars, tween, index, target, fullTargets))) {
  2107. plugin.priority && (hasPriority = 1);
  2108. } else {
  2109. ptLookup[p] = pt = _addPropTween.call(tween, target, p, "get", cleanVars[p], index, fullTargets, 0, vars.stringFilter);
  2110. }
  2111. }
  2112. }
  2113. tween._op && tween._op[i] && tween.kill(target, tween._op[i]);
  2114. if (autoOverwrite && tween._pt) {
  2115. _overwritingTween = tween;
  2116. _globalTimeline.killTweensOf(target, ptLookup, tween.globalTime(time));
  2117. overwritten = !tween.parent;
  2118. _overwritingTween = 0;
  2119. }
  2120. tween._pt && lazy && (_lazyLookup[gsData.id] = 1);
  2121. }
  2122. hasPriority && _sortPropTweensByPriority(tween);
  2123. tween._onInit && tween._onInit(tween);
  2124. }
  2125. tween._onUpdate = onUpdate;
  2126. tween._initted = (!tween._op || tween._pt) && !overwritten;
  2127. keyframes && time <= 0 && tl.render(_bigNum, true, true);
  2128. };
  2129. var _updatePropTweens = function _updatePropTweens2(tween, property, value, start, startIsRelative, ratio, time) {
  2130. var ptCache = (tween._pt && tween._ptCache || (tween._ptCache = {}))[property], pt, rootPT, lookup, i;
  2131. if (!ptCache) {
  2132. ptCache = tween._ptCache[property] = [];
  2133. lookup = tween._ptLookup;
  2134. i = tween._targets.length;
  2135. while (i--) {
  2136. pt = lookup[i][property];
  2137. if (pt && pt.d && pt.d._pt) {
  2138. pt = pt.d._pt;
  2139. while (pt && pt.p !== property && pt.fp !== property) {
  2140. pt = pt._next;
  2141. }
  2142. }
  2143. if (!pt) {
  2144. _forceAllPropTweens = 1;
  2145. tween.vars[property] = "+=0";
  2146. _initTween(tween, time);
  2147. _forceAllPropTweens = 0;
  2148. return 1;
  2149. }
  2150. ptCache.push(pt);
  2151. }
  2152. }
  2153. i = ptCache.length;
  2154. while (i--) {
  2155. rootPT = ptCache[i];
  2156. pt = rootPT._pt || rootPT;
  2157. pt.s = (start || start === 0) && !startIsRelative ? start : pt.s + (start || 0) + ratio * pt.c;
  2158. pt.c = value - pt.s;
  2159. rootPT.e && (rootPT.e = _round(value) + getUnit(rootPT.e));
  2160. rootPT.b && (rootPT.b = pt.s + getUnit(rootPT.b));
  2161. }
  2162. };
  2163. var _addAliasesToVars = function _addAliasesToVars2(targets, vars) {
  2164. var harness = targets[0] ? _getCache(targets[0]).harness : 0, propertyAliases = harness && harness.aliases, copy, p, i, aliases;
  2165. if (!propertyAliases) {
  2166. return vars;
  2167. }
  2168. copy = _merge({}, vars);
  2169. for (p in propertyAliases) {
  2170. if (p in copy) {
  2171. aliases = propertyAliases[p].split(",");
  2172. i = aliases.length;
  2173. while (i--) {
  2174. copy[aliases[i]] = copy[p];
  2175. }
  2176. }
  2177. }
  2178. return copy;
  2179. };
  2180. var _parseKeyframe = function _parseKeyframe2(prop, obj, allProps, easeEach) {
  2181. var ease = obj.ease || easeEach || "power1.inOut", p, a;
  2182. if (_isArray(obj)) {
  2183. a = allProps[prop] || (allProps[prop] = []);
  2184. obj.forEach(function(value, i) {
  2185. return a.push({
  2186. t: i / (obj.length - 1) * 100,
  2187. v: value,
  2188. e: ease
  2189. });
  2190. });
  2191. } else {
  2192. for (p in obj) {
  2193. a = allProps[p] || (allProps[p] = []);
  2194. p === "ease" || a.push({
  2195. t: parseFloat(prop),
  2196. v: obj[p],
  2197. e: ease
  2198. });
  2199. }
  2200. }
  2201. };
  2202. var _parseFuncOrString = function _parseFuncOrString2(value, tween, i, target, targets) {
  2203. return _isFunction(value) ? value.call(tween, i, target, targets) : _isString(value) && ~value.indexOf("random(") ? _replaceRandom(value) : value;
  2204. };
  2205. var _staggerTweenProps = _callbackNames + "repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert";
  2206. var _staggerPropsToSkip = {};
  2207. _forEachName(_staggerTweenProps + ",id,stagger,delay,duration,paused,scrollTrigger", function(name) {
  2208. return _staggerPropsToSkip[name] = 1;
  2209. });
  2210. var Tween = function(_Animation2) {
  2211. _inheritsLoose(Tween2, _Animation2);
  2212. function Tween2(targets, vars, position, skipInherit) {
  2213. var _this3;
  2214. if (typeof vars === "number") {
  2215. position.duration = vars;
  2216. vars = position;
  2217. position = null;
  2218. }
  2219. _this3 = _Animation2.call(this, skipInherit ? vars : _inheritDefaults(vars)) || this;
  2220. var _this3$vars = _this3.vars, duration = _this3$vars.duration, delay = _this3$vars.delay, immediateRender = _this3$vars.immediateRender, stagger = _this3$vars.stagger, overwrite = _this3$vars.overwrite, keyframes = _this3$vars.keyframes, defaults2 = _this3$vars.defaults, scrollTrigger = _this3$vars.scrollTrigger, yoyoEase = _this3$vars.yoyoEase, parent = vars.parent || _globalTimeline, parsedTargets = (_isArray(targets) || _isTypedArray(targets) ? _isNumber(targets[0]) : "length" in vars) ? [targets] : toArray(targets), tl, i, copy, l, p, curTarget, staggerFunc, staggerVarsToMerge;
  2221. _this3._targets = parsedTargets.length ? _harness(parsedTargets) : _warn("GSAP target " + targets + " not found. https://greensock.com", !_config.nullTargetWarn) || [];
  2222. _this3._ptLookup = [];
  2223. _this3._overwrite = overwrite;
  2224. if (keyframes || stagger || _isFuncOrString(duration) || _isFuncOrString(delay)) {
  2225. vars = _this3.vars;
  2226. tl = _this3.timeline = new Timeline({
  2227. data: "nested",
  2228. defaults: defaults2 || {},
  2229. targets: parent && parent.data === "nested" ? parent.vars.targets : parsedTargets
  2230. });
  2231. tl.kill();
  2232. tl.parent = tl._dp = _assertThisInitialized(_this3);
  2233. tl._start = 0;
  2234. if (stagger || _isFuncOrString(duration) || _isFuncOrString(delay)) {
  2235. l = parsedTargets.length;
  2236. staggerFunc = stagger && distribute(stagger);
  2237. if (_isObject(stagger)) {
  2238. for (p in stagger) {
  2239. if (~_staggerTweenProps.indexOf(p)) {
  2240. staggerVarsToMerge || (staggerVarsToMerge = {});
  2241. staggerVarsToMerge[p] = stagger[p];
  2242. }
  2243. }
  2244. }
  2245. for (i = 0; i < l; i++) {
  2246. copy = _copyExcluding(vars, _staggerPropsToSkip);
  2247. copy.stagger = 0;
  2248. yoyoEase && (copy.yoyoEase = yoyoEase);
  2249. staggerVarsToMerge && _merge(copy, staggerVarsToMerge);
  2250. curTarget = parsedTargets[i];
  2251. copy.duration = +_parseFuncOrString(duration, _assertThisInitialized(_this3), i, curTarget, parsedTargets);
  2252. copy.delay = (+_parseFuncOrString(delay, _assertThisInitialized(_this3), i, curTarget, parsedTargets) || 0) - _this3._delay;
  2253. if (!stagger && l === 1 && copy.delay) {
  2254. _this3._delay = delay = copy.delay;
  2255. _this3._start += delay;
  2256. copy.delay = 0;
  2257. }
  2258. tl.to(curTarget, copy, staggerFunc ? staggerFunc(i, curTarget, parsedTargets) : 0);
  2259. tl._ease = _easeMap.none;
  2260. }
  2261. tl.duration() ? duration = delay = 0 : _this3.timeline = 0;
  2262. } else if (keyframes) {
  2263. _inheritDefaults(_setDefaults(tl.vars.defaults, {
  2264. ease: "none"
  2265. }));
  2266. tl._ease = _parseEase(keyframes.ease || vars.ease || "none");
  2267. var time = 0, a, kf, v;
  2268. if (_isArray(keyframes)) {
  2269. keyframes.forEach(function(frame) {
  2270. return tl.to(parsedTargets, frame, ">");
  2271. });
  2272. tl.duration();
  2273. } else {
  2274. copy = {};
  2275. for (p in keyframes) {
  2276. p === "ease" || p === "easeEach" || _parseKeyframe(p, keyframes[p], copy, keyframes.easeEach);
  2277. }
  2278. for (p in copy) {
  2279. a = copy[p].sort(function(a2, b) {
  2280. return a2.t - b.t;
  2281. });
  2282. time = 0;
  2283. for (i = 0; i < a.length; i++) {
  2284. kf = a[i];
  2285. v = {
  2286. ease: kf.e,
  2287. duration: (kf.t - (i ? a[i - 1].t : 0)) / 100 * duration
  2288. };
  2289. v[p] = kf.v;
  2290. tl.to(parsedTargets, v, time);
  2291. time += v.duration;
  2292. }
  2293. }
  2294. tl.duration() < duration && tl.to({}, {
  2295. duration: duration - tl.duration()
  2296. });
  2297. }
  2298. }
  2299. duration || _this3.duration(duration = tl.duration());
  2300. } else {
  2301. _this3.timeline = 0;
  2302. }
  2303. if (overwrite === true && !_suppressOverwrites) {
  2304. _overwritingTween = _assertThisInitialized(_this3);
  2305. _globalTimeline.killTweensOf(parsedTargets);
  2306. _overwritingTween = 0;
  2307. }
  2308. _addToTimeline(parent, _assertThisInitialized(_this3), position);
  2309. vars.reversed && _this3.reverse();
  2310. vars.paused && _this3.paused(true);
  2311. if (immediateRender || !duration && !keyframes && _this3._start === _roundPrecise(parent._time) && _isNotFalse(immediateRender) && _hasNoPausedAncestors(_assertThisInitialized(_this3)) && parent.data !== "nested") {
  2312. _this3._tTime = -_tinyNum;
  2313. _this3.render(Math.max(0, -delay) || 0);
  2314. }
  2315. scrollTrigger && _scrollTrigger(_assertThisInitialized(_this3), scrollTrigger);
  2316. return _this3;
  2317. }
  2318. var _proto3 = Tween2.prototype;
  2319. _proto3.render = function render3(totalTime, suppressEvents, force) {
  2320. var prevTime = this._time, tDur = this._tDur, dur = this._dur, isNegative = totalTime < 0, tTime = totalTime > tDur - _tinyNum && !isNegative ? tDur : totalTime < _tinyNum ? 0 : totalTime, time, pt, iteration, cycleDuration, prevIteration, isYoyo, ratio, timeline2, yoyoEase;
  2321. if (!dur) {
  2322. _renderZeroDurationTween(this, totalTime, suppressEvents, force);
  2323. } else if (tTime !== this._tTime || !totalTime || force || !this._initted && this._tTime || this._startAt && this._zTime < 0 !== isNegative) {
  2324. time = tTime;
  2325. timeline2 = this.timeline;
  2326. if (this._repeat) {
  2327. cycleDuration = dur + this._rDelay;
  2328. if (this._repeat < -1 && isNegative) {
  2329. return this.totalTime(cycleDuration * 100 + totalTime, suppressEvents, force);
  2330. }
  2331. time = _roundPrecise(tTime % cycleDuration);
  2332. if (tTime === tDur) {
  2333. iteration = this._repeat;
  2334. time = dur;
  2335. } else {
  2336. iteration = ~~(tTime / cycleDuration);
  2337. if (iteration && iteration === tTime / cycleDuration) {
  2338. time = dur;
  2339. iteration--;
  2340. }
  2341. time > dur && (time = dur);
  2342. }
  2343. isYoyo = this._yoyo && iteration & 1;
  2344. if (isYoyo) {
  2345. yoyoEase = this._yEase;
  2346. time = dur - time;
  2347. }
  2348. prevIteration = _animationCycle(this._tTime, cycleDuration);
  2349. if (time === prevTime && !force && this._initted) {
  2350. this._tTime = tTime;
  2351. return this;
  2352. }
  2353. if (iteration !== prevIteration) {
  2354. timeline2 && this._yEase && _propagateYoyoEase(timeline2, isYoyo);
  2355. if (this.vars.repeatRefresh && !isYoyo && !this._lock) {
  2356. this._lock = force = 1;
  2357. this.render(_roundPrecise(cycleDuration * iteration), true).invalidate()._lock = 0;
  2358. }
  2359. }
  2360. }
  2361. if (!this._initted) {
  2362. if (_attemptInitTween(this, isNegative ? totalTime : time, force, suppressEvents, tTime)) {
  2363. this._tTime = 0;
  2364. return this;
  2365. }
  2366. if (prevTime !== this._time) {
  2367. return this;
  2368. }
  2369. if (dur !== this._dur) {
  2370. return this.render(totalTime, suppressEvents, force);
  2371. }
  2372. }
  2373. this._tTime = tTime;
  2374. this._time = time;
  2375. if (!this._act && this._ts) {
  2376. this._act = 1;
  2377. this._lazy = 0;
  2378. }
  2379. this.ratio = ratio = (yoyoEase || this._ease)(time / dur);
  2380. if (this._from) {
  2381. this.ratio = ratio = 1 - ratio;
  2382. }
  2383. if (time && !prevTime && !suppressEvents) {
  2384. _callback(this, "onStart");
  2385. if (this._tTime !== tTime) {
  2386. return this;
  2387. }
  2388. }
  2389. pt = this._pt;
  2390. while (pt) {
  2391. pt.r(ratio, pt.d);
  2392. pt = pt._next;
  2393. }
  2394. timeline2 && timeline2.render(totalTime < 0 ? totalTime : !time && isYoyo ? -_tinyNum : timeline2._dur * timeline2._ease(time / this._dur), suppressEvents, force) || this._startAt && (this._zTime = totalTime);
  2395. if (this._onUpdate && !suppressEvents) {
  2396. isNegative && _rewindStartAt(this, totalTime, suppressEvents, force);
  2397. _callback(this, "onUpdate");
  2398. }
  2399. this._repeat && iteration !== prevIteration && this.vars.onRepeat && !suppressEvents && this.parent && _callback(this, "onRepeat");
  2400. if ((tTime === this._tDur || !tTime) && this._tTime === tTime) {
  2401. isNegative && !this._onUpdate && _rewindStartAt(this, totalTime, true, true);
  2402. (totalTime || !dur) && (tTime === this._tDur && this._ts > 0 || !tTime && this._ts < 0) && _removeFromParent(this, 1);
  2403. if (!suppressEvents && !(isNegative && !prevTime) && (tTime || prevTime || isYoyo)) {
  2404. _callback(this, tTime === tDur ? "onComplete" : "onReverseComplete", true);
  2405. this._prom && !(tTime < tDur && this.timeScale() > 0) && this._prom();
  2406. }
  2407. }
  2408. }
  2409. return this;
  2410. };
  2411. _proto3.targets = function targets() {
  2412. return this._targets;
  2413. };
  2414. _proto3.invalidate = function invalidate(soft) {
  2415. (!soft || !this.vars.runBackwards) && (this._startAt = 0);
  2416. this._pt = this._op = this._onUpdate = this._lazy = this.ratio = 0;
  2417. this._ptLookup = [];
  2418. this.timeline && this.timeline.invalidate(soft);
  2419. return _Animation2.prototype.invalidate.call(this, soft);
  2420. };
  2421. _proto3.resetTo = function resetTo(property, value, start, startIsRelative) {
  2422. _tickerActive || _ticker.wake();
  2423. this._ts || this.play();
  2424. var time = Math.min(this._dur, (this._dp._time - this._start) * this._ts), ratio;
  2425. this._initted || _initTween(this, time);
  2426. ratio = this._ease(time / this._dur);
  2427. if (_updatePropTweens(this, property, value, start, startIsRelative, ratio, time)) {
  2428. return this.resetTo(property, value, start, startIsRelative);
  2429. }
  2430. _alignPlayhead(this, 0);
  2431. this.parent || _addLinkedListItem(this._dp, this, "_first", "_last", this._dp._sort ? "_start" : 0);
  2432. return this.render(0);
  2433. };
  2434. _proto3.kill = function kill(targets, vars) {
  2435. if (vars === void 0) {
  2436. vars = "all";
  2437. }
  2438. if (!targets && (!vars || vars === "all")) {
  2439. this._lazy = this._pt = 0;
  2440. return this.parent ? _interrupt(this) : this;
  2441. }
  2442. if (this.timeline) {
  2443. var tDur = this.timeline.totalDuration();
  2444. this.timeline.killTweensOf(targets, vars, _overwritingTween && _overwritingTween.vars.overwrite !== true)._first || _interrupt(this);
  2445. this.parent && tDur !== this.timeline.totalDuration() && _setDuration(this, this._dur * this.timeline._tDur / tDur, 0, 1);
  2446. return this;
  2447. }
  2448. var parsedTargets = this._targets, killingTargets = targets ? toArray(targets) : parsedTargets, propTweenLookup = this._ptLookup, firstPT = this._pt, overwrittenProps, curLookup, curOverwriteProps, props, p, pt, i;
  2449. if ((!vars || vars === "all") && _arraysMatch(parsedTargets, killingTargets)) {
  2450. vars === "all" && (this._pt = 0);
  2451. return _interrupt(this);
  2452. }
  2453. overwrittenProps = this._op = this._op || [];
  2454. if (vars !== "all") {
  2455. if (_isString(vars)) {
  2456. p = {};
  2457. _forEachName(vars, function(name) {
  2458. return p[name] = 1;
  2459. });
  2460. vars = p;
  2461. }
  2462. vars = _addAliasesToVars(parsedTargets, vars);
  2463. }
  2464. i = parsedTargets.length;
  2465. while (i--) {
  2466. if (~killingTargets.indexOf(parsedTargets[i])) {
  2467. curLookup = propTweenLookup[i];
  2468. if (vars === "all") {
  2469. overwrittenProps[i] = vars;
  2470. props = curLookup;
  2471. curOverwriteProps = {};
  2472. } else {
  2473. curOverwriteProps = overwrittenProps[i] = overwrittenProps[i] || {};
  2474. props = vars;
  2475. }
  2476. for (p in props) {
  2477. pt = curLookup && curLookup[p];
  2478. if (pt) {
  2479. if (!("kill" in pt.d) || pt.d.kill(p) === true) {
  2480. _removeLinkedListItem(this, pt, "_pt");
  2481. }
  2482. delete curLookup[p];
  2483. }
  2484. if (curOverwriteProps !== "all") {
  2485. curOverwriteProps[p] = 1;
  2486. }
  2487. }
  2488. }
  2489. }
  2490. this._initted && !this._pt && firstPT && _interrupt(this);
  2491. return this;
  2492. };
  2493. Tween2.to = function to(targets, vars) {
  2494. return new Tween2(targets, vars, arguments[2]);
  2495. };
  2496. Tween2.from = function from(targets, vars) {
  2497. return _createTweenType(1, arguments);
  2498. };
  2499. Tween2.delayedCall = function delayedCall(delay, callback, params, scope) {
  2500. return new Tween2(callback, 0, {
  2501. immediateRender: false,
  2502. lazy: false,
  2503. overwrite: false,
  2504. delay,
  2505. onComplete: callback,
  2506. onReverseComplete: callback,
  2507. onCompleteParams: params,
  2508. onReverseCompleteParams: params,
  2509. callbackScope: scope
  2510. });
  2511. };
  2512. Tween2.fromTo = function fromTo(targets, fromVars, toVars) {
  2513. return _createTweenType(2, arguments);
  2514. };
  2515. Tween2.set = function set(targets, vars) {
  2516. vars.duration = 0;
  2517. vars.repeatDelay || (vars.repeat = 0);
  2518. return new Tween2(targets, vars);
  2519. };
  2520. Tween2.killTweensOf = function killTweensOf(targets, props, onlyActive) {
  2521. return _globalTimeline.killTweensOf(targets, props, onlyActive);
  2522. };
  2523. return Tween2;
  2524. }(Animation);
  2525. _setDefaults(Tween.prototype, {
  2526. _targets: [],
  2527. _lazy: 0,
  2528. _startAt: 0,
  2529. _op: 0,
  2530. _onInit: 0
  2531. });
  2532. _forEachName("staggerTo,staggerFrom,staggerFromTo", function(name) {
  2533. Tween[name] = function() {
  2534. var tl = new Timeline(), params = _slice.call(arguments, 0);
  2535. params.splice(name === "staggerFromTo" ? 5 : 4, 0, 0);
  2536. return tl[name].apply(tl, params);
  2537. };
  2538. });
  2539. var _setterPlain = function _setterPlain2(target, property, value) {
  2540. return target[property] = value;
  2541. };
  2542. var _setterFunc = function _setterFunc2(target, property, value) {
  2543. return target[property](value);
  2544. };
  2545. var _setterFuncWithParam = function _setterFuncWithParam2(target, property, value, data) {
  2546. return target[property](data.fp, value);
  2547. };
  2548. var _setterAttribute = function _setterAttribute2(target, property, value) {
  2549. return target.setAttribute(property, value);
  2550. };
  2551. var _getSetter = function _getSetter2(target, property) {
  2552. return _isFunction(target[property]) ? _setterFunc : _isUndefined(target[property]) && target.setAttribute ? _setterAttribute : _setterPlain;
  2553. };
  2554. var _renderPlain = function _renderPlain2(ratio, data) {
  2555. return data.set(data.t, data.p, Math.round((data.s + data.c * ratio) * 1e6) / 1e6, data);
  2556. };
  2557. var _renderBoolean = function _renderBoolean2(ratio, data) {
  2558. return data.set(data.t, data.p, !!(data.s + data.c * ratio), data);
  2559. };
  2560. var _renderComplexString = function _renderComplexString2(ratio, data) {
  2561. var pt = data._pt, s = "";
  2562. if (!ratio && data.b) {
  2563. s = data.b;
  2564. } else if (ratio === 1 && data.e) {
  2565. s = data.e;
  2566. } else {
  2567. while (pt) {
  2568. s = pt.p + (pt.m ? pt.m(pt.s + pt.c * ratio) : Math.round((pt.s + pt.c * ratio) * 1e4) / 1e4) + s;
  2569. pt = pt._next;
  2570. }
  2571. s += data.c;
  2572. }
  2573. data.set(data.t, data.p, s, data);
  2574. };
  2575. var _renderPropTweens = function _renderPropTweens2(ratio, data) {
  2576. var pt = data._pt;
  2577. while (pt) {
  2578. pt.r(ratio, pt.d);
  2579. pt = pt._next;
  2580. }
  2581. };
  2582. var _addPluginModifier = function _addPluginModifier2(modifier, tween, target, property) {
  2583. var pt = this._pt, next;
  2584. while (pt) {
  2585. next = pt._next;
  2586. pt.p === property && pt.modifier(modifier, tween, target);
  2587. pt = next;
  2588. }
  2589. };
  2590. var _killPropTweensOf = function _killPropTweensOf2(property) {
  2591. var pt = this._pt, hasNonDependentRemaining, next;
  2592. while (pt) {
  2593. next = pt._next;
  2594. if (pt.p === property && !pt.op || pt.op === property) {
  2595. _removeLinkedListItem(this, pt, "_pt");
  2596. } else if (!pt.dep) {
  2597. hasNonDependentRemaining = 1;
  2598. }
  2599. pt = next;
  2600. }
  2601. return !hasNonDependentRemaining;
  2602. };
  2603. var _setterWithModifier = function _setterWithModifier2(target, property, value, data) {
  2604. data.mSet(target, property, data.m.call(data.tween, value, data.mt), data);
  2605. };
  2606. var _sortPropTweensByPriority = function _sortPropTweensByPriority2(parent) {
  2607. var pt = parent._pt, next, pt2, first, last;
  2608. while (pt) {
  2609. next = pt._next;
  2610. pt2 = first;
  2611. while (pt2 && pt2.pr > pt.pr) {
  2612. pt2 = pt2._next;
  2613. }
  2614. if (pt._prev = pt2 ? pt2._prev : last) {
  2615. pt._prev._next = pt;
  2616. } else {
  2617. first = pt;
  2618. }
  2619. if (pt._next = pt2) {
  2620. pt2._prev = pt;
  2621. } else {
  2622. last = pt;
  2623. }
  2624. pt = next;
  2625. }
  2626. parent._pt = first;
  2627. };
  2628. var PropTween = function() {
  2629. function PropTween2(next, target, prop, start, change, renderer, data, setter, priority) {
  2630. this.t = target;
  2631. this.s = start;
  2632. this.c = change;
  2633. this.p = prop;
  2634. this.r = renderer || _renderPlain;
  2635. this.d = data || this;
  2636. this.set = setter || _setterPlain;
  2637. this.pr = priority || 0;
  2638. this._next = next;
  2639. if (next) {
  2640. next._prev = this;
  2641. }
  2642. }
  2643. var _proto4 = PropTween2.prototype;
  2644. _proto4.modifier = function modifier(func, tween, target) {
  2645. this.mSet = this.mSet || this.set;
  2646. this.set = _setterWithModifier;
  2647. this.m = func;
  2648. this.mt = target;
  2649. this.tween = tween;
  2650. };
  2651. return PropTween2;
  2652. }();
  2653. _forEachName(_callbackNames + "parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger", function(name) {
  2654. return _reservedProps[name] = 1;
  2655. });
  2656. _globals.TweenMax = _globals.TweenLite = Tween;
  2657. _globals.TimelineLite = _globals.TimelineMax = Timeline;
  2658. _globalTimeline = new Timeline({
  2659. sortChildren: false,
  2660. defaults: _defaults,
  2661. autoRemoveChildren: true,
  2662. id: "root",
  2663. smoothChildTiming: true
  2664. });
  2665. _config.stringFilter = _colorStringFilter;
  2666. var _media = [];
  2667. var _listeners = {};
  2668. var _emptyArray = [];
  2669. var _lastMediaTime = 0;
  2670. var _dispatch = function _dispatch2(type) {
  2671. return (_listeners[type] || _emptyArray).map(function(f) {
  2672. return f();
  2673. });
  2674. };
  2675. var _onMediaChange = function _onMediaChange2() {
  2676. var time = Date.now(), matches = [];
  2677. if (time - _lastMediaTime > 2) {
  2678. _dispatch("matchMediaInit");
  2679. _media.forEach(function(c) {
  2680. var queries = c.queries, conditions = c.conditions, match, p, anyMatch, toggled;
  2681. for (p in queries) {
  2682. match = _win.matchMedia(queries[p]).matches;
  2683. match && (anyMatch = 1);
  2684. if (match !== conditions[p]) {
  2685. conditions[p] = match;
  2686. toggled = 1;
  2687. }
  2688. }
  2689. if (toggled) {
  2690. c.revert();
  2691. anyMatch && matches.push(c);
  2692. }
  2693. });
  2694. _dispatch("matchMediaRevert");
  2695. matches.forEach(function(c) {
  2696. return c.onMatch(c);
  2697. });
  2698. _lastMediaTime = time;
  2699. _dispatch("matchMedia");
  2700. }
  2701. };
  2702. var Context = function() {
  2703. function Context2(func, scope) {
  2704. this.selector = scope && selector(scope);
  2705. this.data = [];
  2706. this._r = [];
  2707. this.isReverted = false;
  2708. func && this.add(func);
  2709. }
  2710. var _proto5 = Context2.prototype;
  2711. _proto5.add = function add(name, func, scope) {
  2712. if (_isFunction(name)) {
  2713. scope = func;
  2714. func = name;
  2715. name = _isFunction;
  2716. }
  2717. var self = this, f = function f2() {
  2718. var prev = _context, prevSelector = self.selector, result;
  2719. prev && prev !== self && prev.data.push(self);
  2720. scope && (self.selector = selector(scope));
  2721. _context = self;
  2722. result = func.apply(self, arguments);
  2723. _isFunction(result) && self._r.push(result);
  2724. _context = prev;
  2725. self.selector = prevSelector;
  2726. self.isReverted = false;
  2727. return result;
  2728. };
  2729. self.last = f;
  2730. return name === _isFunction ? f(self) : name ? self[name] = f : f;
  2731. };
  2732. _proto5.ignore = function ignore(func) {
  2733. var prev = _context;
  2734. _context = null;
  2735. func(this);
  2736. _context = prev;
  2737. };
  2738. _proto5.getTweens = function getTweens() {
  2739. var a = [];
  2740. this.data.forEach(function(e) {
  2741. return e instanceof Context2 ? a.push.apply(a, e.getTweens()) : e instanceof Tween && !(e.parent && e.parent.data === "nested") && a.push(e);
  2742. });
  2743. return a;
  2744. };
  2745. _proto5.clear = function clear() {
  2746. this._r.length = this.data.length = 0;
  2747. };
  2748. _proto5.kill = function kill(revert, matchMedia2) {
  2749. var _this4 = this;
  2750. if (revert) {
  2751. var tweens = this.getTweens();
  2752. this.data.forEach(function(t) {
  2753. if (t.data === "isFlip") {
  2754. t.revert();
  2755. t.getChildren(true, true, false).forEach(function(tween) {
  2756. return tweens.splice(tweens.indexOf(tween), 1);
  2757. });
  2758. }
  2759. });
  2760. tweens.map(function(t) {
  2761. return {
  2762. g: t.globalTime(0),
  2763. t
  2764. };
  2765. }).sort(function(a, b) {
  2766. return b.g - a.g || -1;
  2767. }).forEach(function(o) {
  2768. return o.t.revert(revert);
  2769. });
  2770. this.data.forEach(function(e) {
  2771. return !(e instanceof Animation) && e.revert && e.revert(revert);
  2772. });
  2773. this._r.forEach(function(f) {
  2774. return f(revert, _this4);
  2775. });
  2776. this.isReverted = true;
  2777. } else {
  2778. this.data.forEach(function(e) {
  2779. return e.kill && e.kill();
  2780. });
  2781. }
  2782. this.clear();
  2783. if (matchMedia2) {
  2784. var i = _media.indexOf(this);
  2785. !!~i && _media.splice(i, 1);
  2786. }
  2787. };
  2788. _proto5.revert = function revert(config3) {
  2789. this.kill(config3 || {});
  2790. };
  2791. return Context2;
  2792. }();
  2793. var MatchMedia = function() {
  2794. function MatchMedia2(scope) {
  2795. this.contexts = [];
  2796. this.scope = scope;
  2797. }
  2798. var _proto6 = MatchMedia2.prototype;
  2799. _proto6.add = function add(conditions, func, scope) {
  2800. _isObject(conditions) || (conditions = {
  2801. matches: conditions
  2802. });
  2803. var context3 = new Context(0, scope || this.scope), cond = context3.conditions = {}, mq, p, active;
  2804. this.contexts.push(context3);
  2805. func = context3.add("onMatch", func);
  2806. context3.queries = conditions;
  2807. for (p in conditions) {
  2808. if (p === "all") {
  2809. active = 1;
  2810. } else {
  2811. mq = _win.matchMedia(conditions[p]);
  2812. if (mq) {
  2813. _media.indexOf(context3) < 0 && _media.push(context3);
  2814. (cond[p] = mq.matches) && (active = 1);
  2815. mq.addListener ? mq.addListener(_onMediaChange) : mq.addEventListener("change", _onMediaChange);
  2816. }
  2817. }
  2818. }
  2819. active && func(context3);
  2820. return this;
  2821. };
  2822. _proto6.revert = function revert(config3) {
  2823. this.kill(config3 || {});
  2824. };
  2825. _proto6.kill = function kill(revert) {
  2826. this.contexts.forEach(function(c) {
  2827. return c.kill(revert, true);
  2828. });
  2829. };
  2830. return MatchMedia2;
  2831. }();
  2832. var _gsap = {
  2833. registerPlugin: function registerPlugin() {
  2834. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  2835. args[_key2] = arguments[_key2];
  2836. }
  2837. args.forEach(function(config3) {
  2838. return _createPlugin(config3);
  2839. });
  2840. },
  2841. timeline: function timeline(vars) {
  2842. return new Timeline(vars);
  2843. },
  2844. getTweensOf: function getTweensOf(targets, onlyActive) {
  2845. return _globalTimeline.getTweensOf(targets, onlyActive);
  2846. },
  2847. getProperty: function getProperty(target, property, unit, uncache) {
  2848. _isString(target) && (target = toArray(target)[0]);
  2849. var getter = _getCache(target || {}).get, format = unit ? _passThrough : _numericIfPossible;
  2850. unit === "native" && (unit = "");
  2851. return !target ? target : !property ? function(property2, unit2, uncache2) {
  2852. return format((_plugins[property2] && _plugins[property2].get || getter)(target, property2, unit2, uncache2));
  2853. } : format((_plugins[property] && _plugins[property].get || getter)(target, property, unit, uncache));
  2854. },
  2855. quickSetter: function quickSetter(target, property, unit) {
  2856. target = toArray(target);
  2857. if (target.length > 1) {
  2858. var setters = target.map(function(t) {
  2859. return gsap.quickSetter(t, property, unit);
  2860. }), l = setters.length;
  2861. return function(value) {
  2862. var i = l;
  2863. while (i--) {
  2864. setters[i](value);
  2865. }
  2866. };
  2867. }
  2868. target = target[0] || {};
  2869. var Plugin = _plugins[property], cache = _getCache(target), p = cache.harness && (cache.harness.aliases || {})[property] || property, setter = Plugin ? function(value) {
  2870. var p2 = new Plugin();
  2871. _quickTween._pt = 0;
  2872. p2.init(target, unit ? value + unit : value, _quickTween, 0, [target]);
  2873. p2.render(1, p2);
  2874. _quickTween._pt && _renderPropTweens(1, _quickTween);
  2875. } : cache.set(target, p);
  2876. return Plugin ? setter : function(value) {
  2877. return setter(target, p, unit ? value + unit : value, cache, 1);
  2878. };
  2879. },
  2880. quickTo: function quickTo(target, property, vars) {
  2881. var _merge22;
  2882. var tween = gsap.to(target, _merge((_merge22 = {}, _merge22[property] = "+=0.1", _merge22.paused = true, _merge22), vars || {})), func = function func2(value, start, startIsRelative) {
  2883. return tween.resetTo(property, value, start, startIsRelative);
  2884. };
  2885. func.tween = tween;
  2886. return func;
  2887. },
  2888. isTweening: function isTweening(targets) {
  2889. return _globalTimeline.getTweensOf(targets, true).length > 0;
  2890. },
  2891. defaults: function defaults(value) {
  2892. value && value.ease && (value.ease = _parseEase(value.ease, _defaults.ease));
  2893. return _mergeDeep(_defaults, value || {});
  2894. },
  2895. config: function config2(value) {
  2896. return _mergeDeep(_config, value || {});
  2897. },
  2898. registerEffect: function registerEffect(_ref3) {
  2899. var name = _ref3.name, effect = _ref3.effect, plugins = _ref3.plugins, defaults2 = _ref3.defaults, extendTimeline = _ref3.extendTimeline;
  2900. (plugins || "").split(",").forEach(function(pluginName) {
  2901. return pluginName && !_plugins[pluginName] && !_globals[pluginName] && _warn(name + " effect requires " + pluginName + " plugin.");
  2902. });
  2903. _effects[name] = function(targets, vars, tl) {
  2904. return effect(toArray(targets), _setDefaults(vars || {}, defaults2), tl);
  2905. };
  2906. if (extendTimeline) {
  2907. Timeline.prototype[name] = function(targets, vars, position) {
  2908. return this.add(_effects[name](targets, _isObject(vars) ? vars : (position = vars) && {}, this), position);
  2909. };
  2910. }
  2911. },
  2912. registerEase: function registerEase(name, ease) {
  2913. _easeMap[name] = _parseEase(ease);
  2914. },
  2915. parseEase: function parseEase(ease, defaultEase) {
  2916. return arguments.length ? _parseEase(ease, defaultEase) : _easeMap;
  2917. },
  2918. getById: function getById(id) {
  2919. return _globalTimeline.getById(id);
  2920. },
  2921. exportRoot: function exportRoot(vars, includeDelayedCalls) {
  2922. if (vars === void 0) {
  2923. vars = {};
  2924. }
  2925. var tl = new Timeline(vars), child, next;
  2926. tl.smoothChildTiming = _isNotFalse(vars.smoothChildTiming);
  2927. _globalTimeline.remove(tl);
  2928. tl._dp = 0;
  2929. tl._time = tl._tTime = _globalTimeline._time;
  2930. child = _globalTimeline._first;
  2931. while (child) {
  2932. next = child._next;
  2933. if (includeDelayedCalls || !(!child._dur && child instanceof Tween && child.vars.onComplete === child._targets[0])) {
  2934. _addToTimeline(tl, child, child._start - child._delay);
  2935. }
  2936. child = next;
  2937. }
  2938. _addToTimeline(_globalTimeline, tl, 0);
  2939. return tl;
  2940. },
  2941. context: function context(func, scope) {
  2942. return func ? new Context(func, scope) : _context;
  2943. },
  2944. matchMedia: function matchMedia(scope) {
  2945. return new MatchMedia(scope);
  2946. },
  2947. matchMediaRefresh: function matchMediaRefresh() {
  2948. return _media.forEach(function(c) {
  2949. var cond = c.conditions, found, p;
  2950. for (p in cond) {
  2951. if (cond[p]) {
  2952. cond[p] = false;
  2953. found = 1;
  2954. }
  2955. }
  2956. found && c.revert();
  2957. }) || _onMediaChange();
  2958. },
  2959. addEventListener: function addEventListener(type, callback) {
  2960. var a = _listeners[type] || (_listeners[type] = []);
  2961. ~a.indexOf(callback) || a.push(callback);
  2962. },
  2963. removeEventListener: function removeEventListener(type, callback) {
  2964. var a = _listeners[type], i = a && a.indexOf(callback);
  2965. i >= 0 && a.splice(i, 1);
  2966. },
  2967. utils: {
  2968. wrap,
  2969. wrapYoyo,
  2970. distribute,
  2971. random,
  2972. snap,
  2973. normalize,
  2974. getUnit,
  2975. clamp,
  2976. splitColor,
  2977. toArray,
  2978. selector,
  2979. mapRange,
  2980. pipe,
  2981. unitize,
  2982. interpolate,
  2983. shuffle
  2984. },
  2985. install: _install,
  2986. effects: _effects,
  2987. ticker: _ticker,
  2988. updateRoot: Timeline.updateRoot,
  2989. plugins: _plugins,
  2990. globalTimeline: _globalTimeline,
  2991. core: {
  2992. PropTween,
  2993. globals: _addGlobal,
  2994. Tween,
  2995. Timeline,
  2996. Animation,
  2997. getCache: _getCache,
  2998. _removeLinkedListItem,
  2999. reverting: function reverting() {
  3000. return _reverting;
  3001. },
  3002. context: function context2(toAdd) {
  3003. if (toAdd && _context) {
  3004. _context.data.push(toAdd);
  3005. toAdd._ctx = _context;
  3006. }
  3007. return _context;
  3008. },
  3009. suppressOverwrites: function suppressOverwrites(value) {
  3010. return _suppressOverwrites = value;
  3011. }
  3012. }
  3013. };
  3014. _forEachName("to,from,fromTo,delayedCall,set,killTweensOf", function(name) {
  3015. return _gsap[name] = Tween[name];
  3016. });
  3017. _ticker.add(Timeline.updateRoot);
  3018. _quickTween = _gsap.to({}, {
  3019. duration: 0
  3020. });
  3021. var _getPluginPropTween = function _getPluginPropTween2(plugin, prop) {
  3022. var pt = plugin._pt;
  3023. while (pt && pt.p !== prop && pt.op !== prop && pt.fp !== prop) {
  3024. pt = pt._next;
  3025. }
  3026. return pt;
  3027. };
  3028. var _addModifiers = function _addModifiers2(tween, modifiers) {
  3029. var targets = tween._targets, p, i, pt;
  3030. for (p in modifiers) {
  3031. i = targets.length;
  3032. while (i--) {
  3033. pt = tween._ptLookup[i][p];
  3034. if (pt && (pt = pt.d)) {
  3035. if (pt._pt) {
  3036. pt = _getPluginPropTween(pt, p);
  3037. }
  3038. pt && pt.modifier && pt.modifier(modifiers[p], tween, targets[i], p);
  3039. }
  3040. }
  3041. }
  3042. };
  3043. var _buildModifierPlugin = function _buildModifierPlugin2(name, modifier) {
  3044. return {
  3045. name,
  3046. rawVars: 1,
  3047. init: function init4(target, vars, tween) {
  3048. tween._onInit = function(tween2) {
  3049. var temp, p;
  3050. if (_isString(vars)) {
  3051. temp = {};
  3052. _forEachName(vars, function(name2) {
  3053. return temp[name2] = 1;
  3054. });
  3055. vars = temp;
  3056. }
  3057. if (modifier) {
  3058. temp = {};
  3059. for (p in vars) {
  3060. temp[p] = modifier(vars[p]);
  3061. }
  3062. vars = temp;
  3063. }
  3064. _addModifiers(tween2, vars);
  3065. };
  3066. }
  3067. };
  3068. };
  3069. var gsap = _gsap.registerPlugin({
  3070. name: "attr",
  3071. init: function init(target, vars, tween, index, targets) {
  3072. var p, pt, v;
  3073. this.tween = tween;
  3074. for (p in vars) {
  3075. v = target.getAttribute(p) || "";
  3076. pt = this.add(target, "setAttribute", (v || 0) + "", vars[p], index, targets, 0, 0, p);
  3077. pt.op = p;
  3078. pt.b = v;
  3079. this._props.push(p);
  3080. }
  3081. },
  3082. render: function render(ratio, data) {
  3083. var pt = data._pt;
  3084. while (pt) {
  3085. _reverting ? pt.set(pt.t, pt.p, pt.b, pt) : pt.r(ratio, pt.d);
  3086. pt = pt._next;
  3087. }
  3088. }
  3089. }, {
  3090. name: "endArray",
  3091. init: function init2(target, value) {
  3092. var i = value.length;
  3093. while (i--) {
  3094. this.add(target, i, target[i] || 0, value[i], 0, 0, 0, 0, 0, 1);
  3095. }
  3096. }
  3097. }, _buildModifierPlugin("roundProps", _roundModifier), _buildModifierPlugin("modifiers"), _buildModifierPlugin("snap", snap)) || _gsap;
  3098. Tween.version = Timeline.version = gsap.version = "3.11.4";
  3099. _coreReady = 1;
  3100. _windowExists() && _wake();
  3101. var Power0 = _easeMap.Power0;
  3102. var Power1 = _easeMap.Power1;
  3103. var Power2 = _easeMap.Power2;
  3104. var Power3 = _easeMap.Power3;
  3105. var Power4 = _easeMap.Power4;
  3106. var Linear = _easeMap.Linear;
  3107. var Quad = _easeMap.Quad;
  3108. var Cubic = _easeMap.Cubic;
  3109. var Quart = _easeMap.Quart;
  3110. var Quint = _easeMap.Quint;
  3111. var Strong = _easeMap.Strong;
  3112. var Elastic = _easeMap.Elastic;
  3113. var Back = _easeMap.Back;
  3114. var SteppedEase = _easeMap.SteppedEase;
  3115. var Bounce = _easeMap.Bounce;
  3116. var Sine = _easeMap.Sine;
  3117. var Expo = _easeMap.Expo;
  3118. var Circ = _easeMap.Circ;
  3119. // node_modules/.pnpm/gsap@3.11.4/node_modules/gsap/CSSPlugin.js
  3120. var _win2;
  3121. var _doc2;
  3122. var _docElement;
  3123. var _pluginInitted;
  3124. var _tempDiv;
  3125. var _tempDivStyler;
  3126. var _recentSetterPlugin;
  3127. var _reverting2;
  3128. var _windowExists3 = function _windowExists4() {
  3129. return typeof window !== "undefined";
  3130. };
  3131. var _transformProps = {};
  3132. var _RAD2DEG = 180 / Math.PI;
  3133. var _DEG2RAD = Math.PI / 180;
  3134. var _atan2 = Math.atan2;
  3135. var _bigNum2 = 1e8;
  3136. var _capsExp = /([A-Z])/g;
  3137. var _horizontalExp = /(left|right|width|margin|padding|x)/i;
  3138. var _complexExp = /[\s,\(]\S/;
  3139. var _propertyAliases = {
  3140. autoAlpha: "opacity,visibility",
  3141. scale: "scaleX,scaleY",
  3142. alpha: "opacity"
  3143. };
  3144. var _renderCSSProp = function _renderCSSProp2(ratio, data) {
  3145. return data.set(data.t, data.p, Math.round((data.s + data.c * ratio) * 1e4) / 1e4 + data.u, data);
  3146. };
  3147. var _renderPropWithEnd = function _renderPropWithEnd2(ratio, data) {
  3148. return data.set(data.t, data.p, ratio === 1 ? data.e : Math.round((data.s + data.c * ratio) * 1e4) / 1e4 + data.u, data);
  3149. };
  3150. var _renderCSSPropWithBeginning = function _renderCSSPropWithBeginning2(ratio, data) {
  3151. return data.set(data.t, data.p, ratio ? Math.round((data.s + data.c * ratio) * 1e4) / 1e4 + data.u : data.b, data);
  3152. };
  3153. var _renderRoundedCSSProp = function _renderRoundedCSSProp2(ratio, data) {
  3154. var value = data.s + data.c * ratio;
  3155. data.set(data.t, data.p, ~~(value + (value < 0 ? -0.5 : 0.5)) + data.u, data);
  3156. };
  3157. var _renderNonTweeningValue = function _renderNonTweeningValue2(ratio, data) {
  3158. return data.set(data.t, data.p, ratio ? data.e : data.b, data);
  3159. };
  3160. var _renderNonTweeningValueOnlyAtEnd = function _renderNonTweeningValueOnlyAtEnd2(ratio, data) {
  3161. return data.set(data.t, data.p, ratio !== 1 ? data.b : data.e, data);
  3162. };
  3163. var _setterCSSStyle = function _setterCSSStyle2(target, property, value) {
  3164. return target.style[property] = value;
  3165. };
  3166. var _setterCSSProp = function _setterCSSProp2(target, property, value) {
  3167. return target.style.setProperty(property, value);
  3168. };
  3169. var _setterTransform = function _setterTransform2(target, property, value) {
  3170. return target._gsap[property] = value;
  3171. };
  3172. var _setterScale = function _setterScale2(target, property, value) {
  3173. return target._gsap.scaleX = target._gsap.scaleY = value;
  3174. };
  3175. var _setterScaleWithRender = function _setterScaleWithRender2(target, property, value, data, ratio) {
  3176. var cache = target._gsap;
  3177. cache.scaleX = cache.scaleY = value;
  3178. cache.renderTransform(ratio, cache);
  3179. };
  3180. var _setterTransformWithRender = function _setterTransformWithRender2(target, property, value, data, ratio) {
  3181. var cache = target._gsap;
  3182. cache[property] = value;
  3183. cache.renderTransform(ratio, cache);
  3184. };
  3185. var _transformProp = "transform";
  3186. var _transformOriginProp = _transformProp + "Origin";
  3187. var _saveStyle = function _saveStyle2(property, isNotCSS) {
  3188. var _this = this;
  3189. var target = this.target, style = target.style;
  3190. if (property in _transformProps) {
  3191. this.tfm = this.tfm || {};
  3192. if (property !== "transform") {
  3193. property = _propertyAliases[property] || property;
  3194. ~property.indexOf(",") ? property.split(",").forEach(function(a) {
  3195. return _this.tfm[a] = _get(target, a);
  3196. }) : this.tfm[property] = target._gsap.x ? target._gsap[property] : _get(target, property);
  3197. }
  3198. if (this.props.indexOf(_transformProp) >= 0) {
  3199. return;
  3200. }
  3201. if (target._gsap.svg) {
  3202. this.svgo = target.getAttribute("data-svg-origin");
  3203. this.props.push(_transformOriginProp, isNotCSS, "");
  3204. }
  3205. property = _transformProp;
  3206. }
  3207. (style || isNotCSS) && this.props.push(property, isNotCSS, style[property]);
  3208. };
  3209. var _removeIndependentTransforms = function _removeIndependentTransforms2(style) {
  3210. if (style.translate) {
  3211. style.removeProperty("translate");
  3212. style.removeProperty("scale");
  3213. style.removeProperty("rotate");
  3214. }
  3215. };
  3216. var _revertStyle = function _revertStyle2() {
  3217. var props = this.props, target = this.target, style = target.style, cache = target._gsap, i, p;
  3218. for (i = 0; i < props.length; i += 3) {
  3219. props[i + 1] ? target[props[i]] = props[i + 2] : props[i + 2] ? style[props[i]] = props[i + 2] : style.removeProperty(props[i].replace(_capsExp, "-$1").toLowerCase());
  3220. }
  3221. if (this.tfm) {
  3222. for (p in this.tfm) {
  3223. cache[p] = this.tfm[p];
  3224. }
  3225. if (cache.svg) {
  3226. cache.renderTransform();
  3227. target.setAttribute("data-svg-origin", this.svgo || "");
  3228. }
  3229. i = _reverting2();
  3230. if (i && !i.isStart && !style[_transformProp]) {
  3231. _removeIndependentTransforms(style);
  3232. cache.uncache = 1;
  3233. }
  3234. }
  3235. };
  3236. var _getStyleSaver = function _getStyleSaver2(target, properties) {
  3237. var saver = {
  3238. target,
  3239. props: [],
  3240. revert: _revertStyle,
  3241. save: _saveStyle
  3242. };
  3243. properties && properties.split(",").forEach(function(p) {
  3244. return saver.save(p);
  3245. });
  3246. return saver;
  3247. };
  3248. var _supports3D;
  3249. var _createElement = function _createElement2(type, ns) {
  3250. var e = _doc2.createElementNS ? _doc2.createElementNS((ns || "http://www.w3.org/1999/xhtml").replace(/^https/, "http"), type) : _doc2.createElement(type);
  3251. return e.style ? e : _doc2.createElement(type);
  3252. };
  3253. var _getComputedProperty = function _getComputedProperty2(target, property, skipPrefixFallback) {
  3254. var cs = getComputedStyle(target);
  3255. return cs[property] || cs.getPropertyValue(property.replace(_capsExp, "-$1").toLowerCase()) || cs.getPropertyValue(property) || !skipPrefixFallback && _getComputedProperty2(target, _checkPropPrefix(property) || property, 1) || "";
  3256. };
  3257. var _prefixes = "O,Moz,ms,Ms,Webkit".split(",");
  3258. var _checkPropPrefix = function _checkPropPrefix2(property, element, preferPrefix) {
  3259. var e = element || _tempDiv, s = e.style, i = 5;
  3260. if (property in s && !preferPrefix) {
  3261. return property;
  3262. }
  3263. property = property.charAt(0).toUpperCase() + property.substr(1);
  3264. while (i-- && !(_prefixes[i] + property in s)) {
  3265. }
  3266. return i < 0 ? null : (i === 3 ? "ms" : i >= 0 ? _prefixes[i] : "") + property;
  3267. };
  3268. var _initCore = function _initCore2() {
  3269. if (_windowExists3() && window.document) {
  3270. _win2 = window;
  3271. _doc2 = _win2.document;
  3272. _docElement = _doc2.documentElement;
  3273. _tempDiv = _createElement("div") || {
  3274. style: {}
  3275. };
  3276. _tempDivStyler = _createElement("div");
  3277. _transformProp = _checkPropPrefix(_transformProp);
  3278. _transformOriginProp = _transformProp + "Origin";
  3279. _tempDiv.style.cssText = "border-width:0;line-height:0;position:absolute;padding:0";
  3280. _supports3D = !!_checkPropPrefix("perspective");
  3281. _reverting2 = gsap.core.reverting;
  3282. _pluginInitted = 1;
  3283. }
  3284. };
  3285. var _getBBoxHack = function _getBBoxHack2(swapIfPossible) {
  3286. var svg = _createElement("svg", this.ownerSVGElement && this.ownerSVGElement.getAttribute("xmlns") || "http://www.w3.org/2000/svg"), oldParent = this.parentNode, oldSibling = this.nextSibling, oldCSS = this.style.cssText, bbox;
  3287. _docElement.appendChild(svg);
  3288. svg.appendChild(this);
  3289. this.style.display = "block";
  3290. if (swapIfPossible) {
  3291. try {
  3292. bbox = this.getBBox();
  3293. this._gsapBBox = this.getBBox;
  3294. this.getBBox = _getBBoxHack2;
  3295. } catch (e) {
  3296. }
  3297. } else if (this._gsapBBox) {
  3298. bbox = this._gsapBBox();
  3299. }
  3300. if (oldParent) {
  3301. if (oldSibling) {
  3302. oldParent.insertBefore(this, oldSibling);
  3303. } else {
  3304. oldParent.appendChild(this);
  3305. }
  3306. }
  3307. _docElement.removeChild(svg);
  3308. this.style.cssText = oldCSS;
  3309. return bbox;
  3310. };
  3311. var _getAttributeFallbacks = function _getAttributeFallbacks2(target, attributesArray) {
  3312. var i = attributesArray.length;
  3313. while (i--) {
  3314. if (target.hasAttribute(attributesArray[i])) {
  3315. return target.getAttribute(attributesArray[i]);
  3316. }
  3317. }
  3318. };
  3319. var _getBBox = function _getBBox2(target) {
  3320. var bounds;
  3321. try {
  3322. bounds = target.getBBox();
  3323. } catch (error) {
  3324. bounds = _getBBoxHack.call(target, true);
  3325. }
  3326. bounds && (bounds.width || bounds.height) || target.getBBox === _getBBoxHack || (bounds = _getBBoxHack.call(target, true));
  3327. return bounds && !bounds.width && !bounds.x && !bounds.y ? {
  3328. x: +_getAttributeFallbacks(target, ["x", "cx", "x1"]) || 0,
  3329. y: +_getAttributeFallbacks(target, ["y", "cy", "y1"]) || 0,
  3330. width: 0,
  3331. height: 0
  3332. } : bounds;
  3333. };
  3334. var _isSVG = function _isSVG2(e) {
  3335. return !!(e.getCTM && (!e.parentNode || e.ownerSVGElement) && _getBBox(e));
  3336. };
  3337. var _removeProperty = function _removeProperty2(target, property) {
  3338. if (property) {
  3339. var style = target.style;
  3340. if (property in _transformProps && property !== _transformOriginProp) {
  3341. property = _transformProp;
  3342. }
  3343. if (style.removeProperty) {
  3344. if (property.substr(0, 2) === "ms" || property.substr(0, 6) === "webkit") {
  3345. property = "-" + property;
  3346. }
  3347. style.removeProperty(property.replace(_capsExp, "-$1").toLowerCase());
  3348. } else {
  3349. style.removeAttribute(property);
  3350. }
  3351. }
  3352. };
  3353. var _addNonTweeningPT = function _addNonTweeningPT2(plugin, target, property, beginning, end, onlySetAtEnd) {
  3354. var pt = new PropTween(plugin._pt, target, property, 0, 1, onlySetAtEnd ? _renderNonTweeningValueOnlyAtEnd : _renderNonTweeningValue);
  3355. plugin._pt = pt;
  3356. pt.b = beginning;
  3357. pt.e = end;
  3358. plugin._props.push(property);
  3359. return pt;
  3360. };
  3361. var _nonConvertibleUnits = {
  3362. deg: 1,
  3363. rad: 1,
  3364. turn: 1
  3365. };
  3366. var _nonStandardLayouts = {
  3367. grid: 1,
  3368. flex: 1
  3369. };
  3370. var _convertToUnit = function _convertToUnit2(target, property, value, unit) {
  3371. var curValue = parseFloat(value) || 0, curUnit = (value + "").trim().substr((curValue + "").length) || "px", style = _tempDiv.style, horizontal = _horizontalExp.test(property), isRootSVG = target.tagName.toLowerCase() === "svg", measureProperty = (isRootSVG ? "client" : "offset") + (horizontal ? "Width" : "Height"), amount = 100, toPixels = unit === "px", toPercent = unit === "%", px, parent, cache, isSVG;
  3372. if (unit === curUnit || !curValue || _nonConvertibleUnits[unit] || _nonConvertibleUnits[curUnit]) {
  3373. return curValue;
  3374. }
  3375. curUnit !== "px" && !toPixels && (curValue = _convertToUnit2(target, property, value, "px"));
  3376. isSVG = target.getCTM && _isSVG(target);
  3377. if ((toPercent || curUnit === "%") && (_transformProps[property] || ~property.indexOf("adius"))) {
  3378. px = isSVG ? target.getBBox()[horizontal ? "width" : "height"] : target[measureProperty];
  3379. return _round(toPercent ? curValue / px * amount : curValue / 100 * px);
  3380. }
  3381. style[horizontal ? "width" : "height"] = amount + (toPixels ? curUnit : unit);
  3382. parent = ~property.indexOf("adius") || unit === "em" && target.appendChild && !isRootSVG ? target : target.parentNode;
  3383. if (isSVG) {
  3384. parent = (target.ownerSVGElement || {}).parentNode;
  3385. }
  3386. if (!parent || parent === _doc2 || !parent.appendChild) {
  3387. parent = _doc2.body;
  3388. }
  3389. cache = parent._gsap;
  3390. if (cache && toPercent && cache.width && horizontal && cache.time === _ticker.time && !cache.uncache) {
  3391. return _round(curValue / cache.width * amount);
  3392. } else {
  3393. (toPercent || curUnit === "%") && !_nonStandardLayouts[_getComputedProperty(parent, "display")] && (style.position = _getComputedProperty(target, "position"));
  3394. parent === target && (style.position = "static");
  3395. parent.appendChild(_tempDiv);
  3396. px = _tempDiv[measureProperty];
  3397. parent.removeChild(_tempDiv);
  3398. style.position = "absolute";
  3399. if (horizontal && toPercent) {
  3400. cache = _getCache(parent);
  3401. cache.time = _ticker.time;
  3402. cache.width = parent[measureProperty];
  3403. }
  3404. }
  3405. return _round(toPixels ? px * curValue / amount : px && curValue ? amount / px * curValue : 0);
  3406. };
  3407. var _get = function _get2(target, property, unit, uncache) {
  3408. var value;
  3409. _pluginInitted || _initCore();
  3410. if (property in _propertyAliases && property !== "transform") {
  3411. property = _propertyAliases[property];
  3412. if (~property.indexOf(",")) {
  3413. property = property.split(",")[0];
  3414. }
  3415. }
  3416. if (_transformProps[property] && property !== "transform") {
  3417. value = _parseTransform(target, uncache);
  3418. value = property !== "transformOrigin" ? value[property] : value.svg ? value.origin : _firstTwoOnly(_getComputedProperty(target, _transformOriginProp)) + " " + value.zOrigin + "px";
  3419. } else {
  3420. value = target.style[property];
  3421. if (!value || value === "auto" || uncache || ~(value + "").indexOf("calc(")) {
  3422. value = _specialProps[property] && _specialProps[property](target, property, unit) || _getComputedProperty(target, property) || _getProperty(target, property) || (property === "opacity" ? 1 : 0);
  3423. }
  3424. }
  3425. return unit && !~(value + "").trim().indexOf(" ") ? _convertToUnit(target, property, value, unit) + unit : value;
  3426. };
  3427. var _tweenComplexCSSString = function _tweenComplexCSSString2(target, prop, start, end) {
  3428. if (!start || start === "none") {
  3429. var p = _checkPropPrefix(prop, target, 1), s = p && _getComputedProperty(target, p, 1);
  3430. if (s && s !== start) {
  3431. prop = p;
  3432. start = s;
  3433. } else if (prop === "borderColor") {
  3434. start = _getComputedProperty(target, "borderTopColor");
  3435. }
  3436. }
  3437. var pt = new PropTween(this._pt, target.style, prop, 0, 1, _renderComplexString), index = 0, matchIndex = 0, a, result, startValues, startNum, color, startValue, endValue, endNum, chunk, endUnit, startUnit, endValues;
  3438. pt.b = start;
  3439. pt.e = end;
  3440. start += "";
  3441. end += "";
  3442. if (end === "auto") {
  3443. target.style[prop] = end;
  3444. end = _getComputedProperty(target, prop) || end;
  3445. target.style[prop] = start;
  3446. }
  3447. a = [start, end];
  3448. _colorStringFilter(a);
  3449. start = a[0];
  3450. end = a[1];
  3451. startValues = start.match(_numWithUnitExp) || [];
  3452. endValues = end.match(_numWithUnitExp) || [];
  3453. if (endValues.length) {
  3454. while (result = _numWithUnitExp.exec(end)) {
  3455. endValue = result[0];
  3456. chunk = end.substring(index, result.index);
  3457. if (color) {
  3458. color = (color + 1) % 5;
  3459. } else if (chunk.substr(-5) === "rgba(" || chunk.substr(-5) === "hsla(") {
  3460. color = 1;
  3461. }
  3462. if (endValue !== (startValue = startValues[matchIndex++] || "")) {
  3463. startNum = parseFloat(startValue) || 0;
  3464. startUnit = startValue.substr((startNum + "").length);
  3465. endValue.charAt(1) === "=" && (endValue = _parseRelative(startNum, endValue) + startUnit);
  3466. endNum = parseFloat(endValue);
  3467. endUnit = endValue.substr((endNum + "").length);
  3468. index = _numWithUnitExp.lastIndex - endUnit.length;
  3469. if (!endUnit) {
  3470. endUnit = endUnit || _config.units[prop] || startUnit;
  3471. if (index === end.length) {
  3472. end += endUnit;
  3473. pt.e += endUnit;
  3474. }
  3475. }
  3476. if (startUnit !== endUnit) {
  3477. startNum = _convertToUnit(target, prop, startValue, endUnit) || 0;
  3478. }
  3479. pt._pt = {
  3480. _next: pt._pt,
  3481. p: chunk || matchIndex === 1 ? chunk : ",",
  3482. s: startNum,
  3483. c: endNum - startNum,
  3484. m: color && color < 4 || prop === "zIndex" ? Math.round : 0
  3485. };
  3486. }
  3487. }
  3488. pt.c = index < end.length ? end.substring(index, end.length) : "";
  3489. } else {
  3490. pt.r = prop === "display" && end === "none" ? _renderNonTweeningValueOnlyAtEnd : _renderNonTweeningValue;
  3491. }
  3492. _relExp.test(end) && (pt.e = 0);
  3493. this._pt = pt;
  3494. return pt;
  3495. };
  3496. var _keywordToPercent = {
  3497. top: "0%",
  3498. bottom: "100%",
  3499. left: "0%",
  3500. right: "100%",
  3501. center: "50%"
  3502. };
  3503. var _convertKeywordsToPercentages = function _convertKeywordsToPercentages2(value) {
  3504. var split = value.split(" "), x = split[0], y = split[1] || "50%";
  3505. if (x === "top" || x === "bottom" || y === "left" || y === "right") {
  3506. value = x;
  3507. x = y;
  3508. y = value;
  3509. }
  3510. split[0] = _keywordToPercent[x] || x;
  3511. split[1] = _keywordToPercent[y] || y;
  3512. return split.join(" ");
  3513. };
  3514. var _renderClearProps = function _renderClearProps2(ratio, data) {
  3515. if (data.tween && data.tween._time === data.tween._dur) {
  3516. var target = data.t, style = target.style, props = data.u, cache = target._gsap, prop, clearTransforms, i;
  3517. if (props === "all" || props === true) {
  3518. style.cssText = "";
  3519. clearTransforms = 1;
  3520. } else {
  3521. props = props.split(",");
  3522. i = props.length;
  3523. while (--i > -1) {
  3524. prop = props[i];
  3525. if (_transformProps[prop]) {
  3526. clearTransforms = 1;
  3527. prop = prop === "transformOrigin" ? _transformOriginProp : _transformProp;
  3528. }
  3529. _removeProperty(target, prop);
  3530. }
  3531. }
  3532. if (clearTransforms) {
  3533. _removeProperty(target, _transformProp);
  3534. if (cache) {
  3535. cache.svg && target.removeAttribute("transform");
  3536. _parseTransform(target, 1);
  3537. cache.uncache = 1;
  3538. _removeIndependentTransforms(style);
  3539. }
  3540. }
  3541. }
  3542. };
  3543. var _specialProps = {
  3544. clearProps: function clearProps(plugin, target, property, endValue, tween) {
  3545. if (tween.data !== "isFromStart") {
  3546. var pt = plugin._pt = new PropTween(plugin._pt, target, property, 0, 0, _renderClearProps);
  3547. pt.u = endValue;
  3548. pt.pr = -10;
  3549. pt.tween = tween;
  3550. plugin._props.push(property);
  3551. return 1;
  3552. }
  3553. }
  3554. };
  3555. var _identity2DMatrix = [1, 0, 0, 1, 0, 0];
  3556. var _rotationalProperties = {};
  3557. var _isNullTransform = function _isNullTransform2(value) {
  3558. return value === "matrix(1, 0, 0, 1, 0, 0)" || value === "none" || !value;
  3559. };
  3560. var _getComputedTransformMatrixAsArray = function _getComputedTransformMatrixAsArray2(target) {
  3561. var matrixString = _getComputedProperty(target, _transformProp);
  3562. return _isNullTransform(matrixString) ? _identity2DMatrix : matrixString.substr(7).match(_numExp).map(_round);
  3563. };
  3564. var _getMatrix = function _getMatrix2(target, force2D) {
  3565. var cache = target._gsap || _getCache(target), style = target.style, matrix = _getComputedTransformMatrixAsArray(target), parent, nextSibling, temp, addedToDOM;
  3566. if (cache.svg && target.getAttribute("transform")) {
  3567. temp = target.transform.baseVal.consolidate().matrix;
  3568. matrix = [temp.a, temp.b, temp.c, temp.d, temp.e, temp.f];
  3569. return matrix.join(",") === "1,0,0,1,0,0" ? _identity2DMatrix : matrix;
  3570. } else if (matrix === _identity2DMatrix && !target.offsetParent && target !== _docElement && !cache.svg) {
  3571. temp = style.display;
  3572. style.display = "block";
  3573. parent = target.parentNode;
  3574. if (!parent || !target.offsetParent) {
  3575. addedToDOM = 1;
  3576. nextSibling = target.nextElementSibling;
  3577. _docElement.appendChild(target);
  3578. }
  3579. matrix = _getComputedTransformMatrixAsArray(target);
  3580. temp ? style.display = temp : _removeProperty(target, "display");
  3581. if (addedToDOM) {
  3582. nextSibling ? parent.insertBefore(target, nextSibling) : parent ? parent.appendChild(target) : _docElement.removeChild(target);
  3583. }
  3584. }
  3585. return force2D && matrix.length > 6 ? [matrix[0], matrix[1], matrix[4], matrix[5], matrix[12], matrix[13]] : matrix;
  3586. };
  3587. var _applySVGOrigin = function _applySVGOrigin2(target, origin, originIsAbsolute, smooth, matrixArray, pluginToAddPropTweensTo) {
  3588. var cache = target._gsap, matrix = matrixArray || _getMatrix(target, true), xOriginOld = cache.xOrigin || 0, yOriginOld = cache.yOrigin || 0, xOffsetOld = cache.xOffset || 0, yOffsetOld = cache.yOffset || 0, a = matrix[0], b = matrix[1], c = matrix[2], d = matrix[3], tx = matrix[4], ty = matrix[5], originSplit = origin.split(" "), xOrigin = parseFloat(originSplit[0]) || 0, yOrigin = parseFloat(originSplit[1]) || 0, bounds, determinant, x, y;
  3589. if (!originIsAbsolute) {
  3590. bounds = _getBBox(target);
  3591. xOrigin = bounds.x + (~originSplit[0].indexOf("%") ? xOrigin / 100 * bounds.width : xOrigin);
  3592. yOrigin = bounds.y + (~(originSplit[1] || originSplit[0]).indexOf("%") ? yOrigin / 100 * bounds.height : yOrigin);
  3593. } else if (matrix !== _identity2DMatrix && (determinant = a * d - b * c)) {
  3594. x = xOrigin * (d / determinant) + yOrigin * (-c / determinant) + (c * ty - d * tx) / determinant;
  3595. y = xOrigin * (-b / determinant) + yOrigin * (a / determinant) - (a * ty - b * tx) / determinant;
  3596. xOrigin = x;
  3597. yOrigin = y;
  3598. }
  3599. if (smooth || smooth !== false && cache.smooth) {
  3600. tx = xOrigin - xOriginOld;
  3601. ty = yOrigin - yOriginOld;
  3602. cache.xOffset = xOffsetOld + (tx * a + ty * c) - tx;
  3603. cache.yOffset = yOffsetOld + (tx * b + ty * d) - ty;
  3604. } else {
  3605. cache.xOffset = cache.yOffset = 0;
  3606. }
  3607. cache.xOrigin = xOrigin;
  3608. cache.yOrigin = yOrigin;
  3609. cache.smooth = !!smooth;
  3610. cache.origin = origin;
  3611. cache.originIsAbsolute = !!originIsAbsolute;
  3612. target.style[_transformOriginProp] = "0px 0px";
  3613. if (pluginToAddPropTweensTo) {
  3614. _addNonTweeningPT(pluginToAddPropTweensTo, cache, "xOrigin", xOriginOld, xOrigin);
  3615. _addNonTweeningPT(pluginToAddPropTweensTo, cache, "yOrigin", yOriginOld, yOrigin);
  3616. _addNonTweeningPT(pluginToAddPropTweensTo, cache, "xOffset", xOffsetOld, cache.xOffset);
  3617. _addNonTweeningPT(pluginToAddPropTweensTo, cache, "yOffset", yOffsetOld, cache.yOffset);
  3618. }
  3619. target.setAttribute("data-svg-origin", xOrigin + " " + yOrigin);
  3620. };
  3621. var _parseTransform = function _parseTransform2(target, uncache) {
  3622. var cache = target._gsap || new GSCache(target);
  3623. if ("x" in cache && !uncache && !cache.uncache) {
  3624. return cache;
  3625. }
  3626. var style = target.style, invertedScaleX = cache.scaleX < 0, px = "px", deg = "deg", cs = getComputedStyle(target), origin = _getComputedProperty(target, _transformOriginProp) || "0", x, y, z, scaleX, scaleY, rotation, rotationX, rotationY, skewX, skewY, perspective, xOrigin, yOrigin, matrix, angle, cos, sin, a, b, c, d, a12, a22, t1, t2, t3, a13, a23, a33, a42, a43, a32;
  3627. x = y = z = rotation = rotationX = rotationY = skewX = skewY = perspective = 0;
  3628. scaleX = scaleY = 1;
  3629. cache.svg = !!(target.getCTM && _isSVG(target));
  3630. if (cs.translate) {
  3631. if (cs.translate !== "none" || cs.scale !== "none" || cs.rotate !== "none") {
  3632. style[_transformProp] = (cs.translate !== "none" ? "translate3d(" + (cs.translate + " 0 0").split(" ").slice(0, 3).join(", ") + ") " : "") + (cs.rotate !== "none" ? "rotate(" + cs.rotate + ") " : "") + (cs.scale !== "none" ? "scale(" + cs.scale.split(" ").join(",") + ") " : "") + (cs[_transformProp] !== "none" ? cs[_transformProp] : "");
  3633. }
  3634. style.scale = style.rotate = style.translate = "none";
  3635. }
  3636. matrix = _getMatrix(target, cache.svg);
  3637. if (cache.svg) {
  3638. if (cache.uncache) {
  3639. t2 = target.getBBox();
  3640. origin = cache.xOrigin - t2.x + "px " + (cache.yOrigin - t2.y) + "px";
  3641. t1 = "";
  3642. } else {
  3643. t1 = !uncache && target.getAttribute("data-svg-origin");
  3644. }
  3645. _applySVGOrigin(target, t1 || origin, !!t1 || cache.originIsAbsolute, cache.smooth !== false, matrix);
  3646. }
  3647. xOrigin = cache.xOrigin || 0;
  3648. yOrigin = cache.yOrigin || 0;
  3649. if (matrix !== _identity2DMatrix) {
  3650. a = matrix[0];
  3651. b = matrix[1];
  3652. c = matrix[2];
  3653. d = matrix[3];
  3654. x = a12 = matrix[4];
  3655. y = a22 = matrix[5];
  3656. if (matrix.length === 6) {
  3657. scaleX = Math.sqrt(a * a + b * b);
  3658. scaleY = Math.sqrt(d * d + c * c);
  3659. rotation = a || b ? _atan2(b, a) * _RAD2DEG : 0;
  3660. skewX = c || d ? _atan2(c, d) * _RAD2DEG + rotation : 0;
  3661. skewX && (scaleY *= Math.abs(Math.cos(skewX * _DEG2RAD)));
  3662. if (cache.svg) {
  3663. x -= xOrigin - (xOrigin * a + yOrigin * c);
  3664. y -= yOrigin - (xOrigin * b + yOrigin * d);
  3665. }
  3666. } else {
  3667. a32 = matrix[6];
  3668. a42 = matrix[7];
  3669. a13 = matrix[8];
  3670. a23 = matrix[9];
  3671. a33 = matrix[10];
  3672. a43 = matrix[11];
  3673. x = matrix[12];
  3674. y = matrix[13];
  3675. z = matrix[14];
  3676. angle = _atan2(a32, a33);
  3677. rotationX = angle * _RAD2DEG;
  3678. if (angle) {
  3679. cos = Math.cos(-angle);
  3680. sin = Math.sin(-angle);
  3681. t1 = a12 * cos + a13 * sin;
  3682. t2 = a22 * cos + a23 * sin;
  3683. t3 = a32 * cos + a33 * sin;
  3684. a13 = a12 * -sin + a13 * cos;
  3685. a23 = a22 * -sin + a23 * cos;
  3686. a33 = a32 * -sin + a33 * cos;
  3687. a43 = a42 * -sin + a43 * cos;
  3688. a12 = t1;
  3689. a22 = t2;
  3690. a32 = t3;
  3691. }
  3692. angle = _atan2(-c, a33);
  3693. rotationY = angle * _RAD2DEG;
  3694. if (angle) {
  3695. cos = Math.cos(-angle);
  3696. sin = Math.sin(-angle);
  3697. t1 = a * cos - a13 * sin;
  3698. t2 = b * cos - a23 * sin;
  3699. t3 = c * cos - a33 * sin;
  3700. a43 = d * sin + a43 * cos;
  3701. a = t1;
  3702. b = t2;
  3703. c = t3;
  3704. }
  3705. angle = _atan2(b, a);
  3706. rotation = angle * _RAD2DEG;
  3707. if (angle) {
  3708. cos = Math.cos(angle);
  3709. sin = Math.sin(angle);
  3710. t1 = a * cos + b * sin;
  3711. t2 = a12 * cos + a22 * sin;
  3712. b = b * cos - a * sin;
  3713. a22 = a22 * cos - a12 * sin;
  3714. a = t1;
  3715. a12 = t2;
  3716. }
  3717. if (rotationX && Math.abs(rotationX) + Math.abs(rotation) > 359.9) {
  3718. rotationX = rotation = 0;
  3719. rotationY = 180 - rotationY;
  3720. }
  3721. scaleX = _round(Math.sqrt(a * a + b * b + c * c));
  3722. scaleY = _round(Math.sqrt(a22 * a22 + a32 * a32));
  3723. angle = _atan2(a12, a22);
  3724. skewX = Math.abs(angle) > 2e-4 ? angle * _RAD2DEG : 0;
  3725. perspective = a43 ? 1 / (a43 < 0 ? -a43 : a43) : 0;
  3726. }
  3727. if (cache.svg) {
  3728. t1 = target.getAttribute("transform");
  3729. cache.forceCSS = target.setAttribute("transform", "") || !_isNullTransform(_getComputedProperty(target, _transformProp));
  3730. t1 && target.setAttribute("transform", t1);
  3731. }
  3732. }
  3733. if (Math.abs(skewX) > 90 && Math.abs(skewX) < 270) {
  3734. if (invertedScaleX) {
  3735. scaleX *= -1;
  3736. skewX += rotation <= 0 ? 180 : -180;
  3737. rotation += rotation <= 0 ? 180 : -180;
  3738. } else {
  3739. scaleY *= -1;
  3740. skewX += skewX <= 0 ? 180 : -180;
  3741. }
  3742. }
  3743. uncache = uncache || cache.uncache;
  3744. cache.x = x - ((cache.xPercent = x && (!uncache && cache.xPercent || (Math.round(target.offsetWidth / 2) === Math.round(-x) ? -50 : 0))) ? target.offsetWidth * cache.xPercent / 100 : 0) + px;
  3745. cache.y = y - ((cache.yPercent = y && (!uncache && cache.yPercent || (Math.round(target.offsetHeight / 2) === Math.round(-y) ? -50 : 0))) ? target.offsetHeight * cache.yPercent / 100 : 0) + px;
  3746. cache.z = z + px;
  3747. cache.scaleX = _round(scaleX);
  3748. cache.scaleY = _round(scaleY);
  3749. cache.rotation = _round(rotation) + deg;
  3750. cache.rotationX = _round(rotationX) + deg;
  3751. cache.rotationY = _round(rotationY) + deg;
  3752. cache.skewX = skewX + deg;
  3753. cache.skewY = skewY + deg;
  3754. cache.transformPerspective = perspective + px;
  3755. if (cache.zOrigin = parseFloat(origin.split(" ")[2]) || 0) {
  3756. style[_transformOriginProp] = _firstTwoOnly(origin);
  3757. }
  3758. cache.xOffset = cache.yOffset = 0;
  3759. cache.force3D = _config.force3D;
  3760. cache.renderTransform = cache.svg ? _renderSVGTransforms : _supports3D ? _renderCSSTransforms : _renderNon3DTransforms;
  3761. cache.uncache = 0;
  3762. return cache;
  3763. };
  3764. var _firstTwoOnly = function _firstTwoOnly2(value) {
  3765. return (value = value.split(" "))[0] + " " + value[1];
  3766. };
  3767. var _addPxTranslate = function _addPxTranslate2(target, start, value) {
  3768. var unit = getUnit(start);
  3769. return _round(parseFloat(start) + parseFloat(_convertToUnit(target, "x", value + "px", unit))) + unit;
  3770. };
  3771. var _renderNon3DTransforms = function _renderNon3DTransforms2(ratio, cache) {
  3772. cache.z = "0px";
  3773. cache.rotationY = cache.rotationX = "0deg";
  3774. cache.force3D = 0;
  3775. _renderCSSTransforms(ratio, cache);
  3776. };
  3777. var _zeroDeg = "0deg";
  3778. var _zeroPx = "0px";
  3779. var _endParenthesis = ") ";
  3780. var _renderCSSTransforms = function _renderCSSTransforms2(ratio, cache) {
  3781. var _ref = cache || this, xPercent = _ref.xPercent, yPercent = _ref.yPercent, x = _ref.x, y = _ref.y, z = _ref.z, rotation = _ref.rotation, rotationY = _ref.rotationY, rotationX = _ref.rotationX, skewX = _ref.skewX, skewY = _ref.skewY, scaleX = _ref.scaleX, scaleY = _ref.scaleY, transformPerspective = _ref.transformPerspective, force3D = _ref.force3D, target = _ref.target, zOrigin = _ref.zOrigin, transforms = "", use3D = force3D === "auto" && ratio && ratio !== 1 || force3D === true;
  3782. if (zOrigin && (rotationX !== _zeroDeg || rotationY !== _zeroDeg)) {
  3783. var angle = parseFloat(rotationY) * _DEG2RAD, a13 = Math.sin(angle), a33 = Math.cos(angle), cos;
  3784. angle = parseFloat(rotationX) * _DEG2RAD;
  3785. cos = Math.cos(angle);
  3786. x = _addPxTranslate(target, x, a13 * cos * -zOrigin);
  3787. y = _addPxTranslate(target, y, -Math.sin(angle) * -zOrigin);
  3788. z = _addPxTranslate(target, z, a33 * cos * -zOrigin + zOrigin);
  3789. }
  3790. if (transformPerspective !== _zeroPx) {
  3791. transforms += "perspective(" + transformPerspective + _endParenthesis;
  3792. }
  3793. if (xPercent || yPercent) {
  3794. transforms += "translate(" + xPercent + "%, " + yPercent + "%) ";
  3795. }
  3796. if (use3D || x !== _zeroPx || y !== _zeroPx || z !== _zeroPx) {
  3797. transforms += z !== _zeroPx || use3D ? "translate3d(" + x + ", " + y + ", " + z + ") " : "translate(" + x + ", " + y + _endParenthesis;
  3798. }
  3799. if (rotation !== _zeroDeg) {
  3800. transforms += "rotate(" + rotation + _endParenthesis;
  3801. }
  3802. if (rotationY !== _zeroDeg) {
  3803. transforms += "rotateY(" + rotationY + _endParenthesis;
  3804. }
  3805. if (rotationX !== _zeroDeg) {
  3806. transforms += "rotateX(" + rotationX + _endParenthesis;
  3807. }
  3808. if (skewX !== _zeroDeg || skewY !== _zeroDeg) {
  3809. transforms += "skew(" + skewX + ", " + skewY + _endParenthesis;
  3810. }
  3811. if (scaleX !== 1 || scaleY !== 1) {
  3812. transforms += "scale(" + scaleX + ", " + scaleY + _endParenthesis;
  3813. }
  3814. target.style[_transformProp] = transforms || "translate(0, 0)";
  3815. };
  3816. var _renderSVGTransforms = function _renderSVGTransforms2(ratio, cache) {
  3817. var _ref2 = cache || this, xPercent = _ref2.xPercent, yPercent = _ref2.yPercent, x = _ref2.x, y = _ref2.y, rotation = _ref2.rotation, skewX = _ref2.skewX, skewY = _ref2.skewY, scaleX = _ref2.scaleX, scaleY = _ref2.scaleY, target = _ref2.target, xOrigin = _ref2.xOrigin, yOrigin = _ref2.yOrigin, xOffset = _ref2.xOffset, yOffset = _ref2.yOffset, forceCSS = _ref2.forceCSS, tx = parseFloat(x), ty = parseFloat(y), a11, a21, a12, a22, temp;
  3818. rotation = parseFloat(rotation);
  3819. skewX = parseFloat(skewX);
  3820. skewY = parseFloat(skewY);
  3821. if (skewY) {
  3822. skewY = parseFloat(skewY);
  3823. skewX += skewY;
  3824. rotation += skewY;
  3825. }
  3826. if (rotation || skewX) {
  3827. rotation *= _DEG2RAD;
  3828. skewX *= _DEG2RAD;
  3829. a11 = Math.cos(rotation) * scaleX;
  3830. a21 = Math.sin(rotation) * scaleX;
  3831. a12 = Math.sin(rotation - skewX) * -scaleY;
  3832. a22 = Math.cos(rotation - skewX) * scaleY;
  3833. if (skewX) {
  3834. skewY *= _DEG2RAD;
  3835. temp = Math.tan(skewX - skewY);
  3836. temp = Math.sqrt(1 + temp * temp);
  3837. a12 *= temp;
  3838. a22 *= temp;
  3839. if (skewY) {
  3840. temp = Math.tan(skewY);
  3841. temp = Math.sqrt(1 + temp * temp);
  3842. a11 *= temp;
  3843. a21 *= temp;
  3844. }
  3845. }
  3846. a11 = _round(a11);
  3847. a21 = _round(a21);
  3848. a12 = _round(a12);
  3849. a22 = _round(a22);
  3850. } else {
  3851. a11 = scaleX;
  3852. a22 = scaleY;
  3853. a21 = a12 = 0;
  3854. }
  3855. if (tx && !~(x + "").indexOf("px") || ty && !~(y + "").indexOf("px")) {
  3856. tx = _convertToUnit(target, "x", x, "px");
  3857. ty = _convertToUnit(target, "y", y, "px");
  3858. }
  3859. if (xOrigin || yOrigin || xOffset || yOffset) {
  3860. tx = _round(tx + xOrigin - (xOrigin * a11 + yOrigin * a12) + xOffset);
  3861. ty = _round(ty + yOrigin - (xOrigin * a21 + yOrigin * a22) + yOffset);
  3862. }
  3863. if (xPercent || yPercent) {
  3864. temp = target.getBBox();
  3865. tx = _round(tx + xPercent / 100 * temp.width);
  3866. ty = _round(ty + yPercent / 100 * temp.height);
  3867. }
  3868. temp = "matrix(" + a11 + "," + a21 + "," + a12 + "," + a22 + "," + tx + "," + ty + ")";
  3869. target.setAttribute("transform", temp);
  3870. forceCSS && (target.style[_transformProp] = temp);
  3871. };
  3872. var _addRotationalPropTween = function _addRotationalPropTween2(plugin, target, property, startNum, endValue) {
  3873. var cap = 360, isString = _isString(endValue), endNum = parseFloat(endValue) * (isString && ~endValue.indexOf("rad") ? _RAD2DEG : 1), change = endNum - startNum, finalValue = startNum + change + "deg", direction, pt;
  3874. if (isString) {
  3875. direction = endValue.split("_")[1];
  3876. if (direction === "short") {
  3877. change %= cap;
  3878. if (change !== change % (cap / 2)) {
  3879. change += change < 0 ? cap : -cap;
  3880. }
  3881. }
  3882. if (direction === "cw" && change < 0) {
  3883. change = (change + cap * _bigNum2) % cap - ~~(change / cap) * cap;
  3884. } else if (direction === "ccw" && change > 0) {
  3885. change = (change - cap * _bigNum2) % cap - ~~(change / cap) * cap;
  3886. }
  3887. }
  3888. plugin._pt = pt = new PropTween(plugin._pt, target, property, startNum, change, _renderPropWithEnd);
  3889. pt.e = finalValue;
  3890. pt.u = "deg";
  3891. plugin._props.push(property);
  3892. return pt;
  3893. };
  3894. var _assign = function _assign2(target, source) {
  3895. for (var p in source) {
  3896. target[p] = source[p];
  3897. }
  3898. return target;
  3899. };
  3900. var _addRawTransformPTs = function _addRawTransformPTs2(plugin, transforms, target) {
  3901. var startCache = _assign({}, target._gsap), exclude = "perspective,force3D,transformOrigin,svgOrigin", style = target.style, endCache, p, startValue, endValue, startNum, endNum, startUnit, endUnit;
  3902. if (startCache.svg) {
  3903. startValue = target.getAttribute("transform");
  3904. target.setAttribute("transform", "");
  3905. style[_transformProp] = transforms;
  3906. endCache = _parseTransform(target, 1);
  3907. _removeProperty(target, _transformProp);
  3908. target.setAttribute("transform", startValue);
  3909. } else {
  3910. startValue = getComputedStyle(target)[_transformProp];
  3911. style[_transformProp] = transforms;
  3912. endCache = _parseTransform(target, 1);
  3913. style[_transformProp] = startValue;
  3914. }
  3915. for (p in _transformProps) {
  3916. startValue = startCache[p];
  3917. endValue = endCache[p];
  3918. if (startValue !== endValue && exclude.indexOf(p) < 0) {
  3919. startUnit = getUnit(startValue);
  3920. endUnit = getUnit(endValue);
  3921. startNum = startUnit !== endUnit ? _convertToUnit(target, p, startValue, endUnit) : parseFloat(startValue);
  3922. endNum = parseFloat(endValue);
  3923. plugin._pt = new PropTween(plugin._pt, endCache, p, startNum, endNum - startNum, _renderCSSProp);
  3924. plugin._pt.u = endUnit || 0;
  3925. plugin._props.push(p);
  3926. }
  3927. }
  3928. _assign(endCache, startCache);
  3929. };
  3930. _forEachName("padding,margin,Width,Radius", function(name, index) {
  3931. var t = "Top", r = "Right", b = "Bottom", l = "Left", props = (index < 3 ? [t, r, b, l] : [t + l, t + r, b + r, b + l]).map(function(side) {
  3932. return index < 2 ? name + side : "border" + side + name;
  3933. });
  3934. _specialProps[index > 1 ? "border" + name : name] = function(plugin, target, property, endValue, tween) {
  3935. var a, vars;
  3936. if (arguments.length < 4) {
  3937. a = props.map(function(prop) {
  3938. return _get(plugin, prop, property);
  3939. });
  3940. vars = a.join(" ");
  3941. return vars.split(a[0]).length === 5 ? a[0] : vars;
  3942. }
  3943. a = (endValue + "").split(" ");
  3944. vars = {};
  3945. props.forEach(function(prop, i) {
  3946. return vars[prop] = a[i] = a[i] || a[(i - 1) / 2 | 0];
  3947. });
  3948. plugin.init(target, vars, tween);
  3949. };
  3950. });
  3951. var CSSPlugin = {
  3952. name: "css",
  3953. register: _initCore,
  3954. targetTest: function targetTest(target) {
  3955. return target.style && target.nodeType;
  3956. },
  3957. init: function init3(target, vars, tween, index, targets) {
  3958. var props = this._props, style = target.style, startAt = tween.vars.startAt, startValue, endValue, endNum, startNum, type, specialProp, p, startUnit, endUnit, relative, isTransformRelated, transformPropTween, cache, smooth, hasPriority, inlineProps;
  3959. _pluginInitted || _initCore();
  3960. this.styles = this.styles || _getStyleSaver(target);
  3961. inlineProps = this.styles.props;
  3962. this.tween = tween;
  3963. for (p in vars) {
  3964. if (p === "autoRound") {
  3965. continue;
  3966. }
  3967. endValue = vars[p];
  3968. if (_plugins[p] && _checkPlugin(p, vars, tween, index, target, targets)) {
  3969. continue;
  3970. }
  3971. type = typeof endValue;
  3972. specialProp = _specialProps[p];
  3973. if (type === "function") {
  3974. endValue = endValue.call(tween, index, target, targets);
  3975. type = typeof endValue;
  3976. }
  3977. if (type === "string" && ~endValue.indexOf("random(")) {
  3978. endValue = _replaceRandom(endValue);
  3979. }
  3980. if (specialProp) {
  3981. specialProp(this, target, p, endValue, tween) && (hasPriority = 1);
  3982. } else if (p.substr(0, 2) === "--") {
  3983. startValue = (getComputedStyle(target).getPropertyValue(p) + "").trim();
  3984. endValue += "";
  3985. _colorExp.lastIndex = 0;
  3986. if (!_colorExp.test(startValue)) {
  3987. startUnit = getUnit(startValue);
  3988. endUnit = getUnit(endValue);
  3989. }
  3990. endUnit ? startUnit !== endUnit && (startValue = _convertToUnit(target, p, startValue, endUnit) + endUnit) : startUnit && (endValue += startUnit);
  3991. this.add(style, "setProperty", startValue, endValue, index, targets, 0, 0, p);
  3992. props.push(p);
  3993. inlineProps.push(p, 0, style[p]);
  3994. } else if (type !== "undefined") {
  3995. if (startAt && p in startAt) {
  3996. startValue = typeof startAt[p] === "function" ? startAt[p].call(tween, index, target, targets) : startAt[p];
  3997. _isString(startValue) && ~startValue.indexOf("random(") && (startValue = _replaceRandom(startValue));
  3998. getUnit(startValue + "") || (startValue += _config.units[p] || getUnit(_get(target, p)) || "");
  3999. (startValue + "").charAt(1) === "=" && (startValue = _get(target, p));
  4000. } else {
  4001. startValue = _get(target, p);
  4002. }
  4003. startNum = parseFloat(startValue);
  4004. relative = type === "string" && endValue.charAt(1) === "=" && endValue.substr(0, 2);
  4005. relative && (endValue = endValue.substr(2));
  4006. endNum = parseFloat(endValue);
  4007. if (p in _propertyAliases) {
  4008. if (p === "autoAlpha") {
  4009. if (startNum === 1 && _get(target, "visibility") === "hidden" && endNum) {
  4010. startNum = 0;
  4011. }
  4012. inlineProps.push("visibility", 0, style.visibility);
  4013. _addNonTweeningPT(this, style, "visibility", startNum ? "inherit" : "hidden", endNum ? "inherit" : "hidden", !endNum);
  4014. }
  4015. if (p !== "scale" && p !== "transform") {
  4016. p = _propertyAliases[p];
  4017. ~p.indexOf(",") && (p = p.split(",")[0]);
  4018. }
  4019. }
  4020. isTransformRelated = p in _transformProps;
  4021. if (isTransformRelated) {
  4022. this.styles.save(p);
  4023. if (!transformPropTween) {
  4024. cache = target._gsap;
  4025. cache.renderTransform && !vars.parseTransform || _parseTransform(target, vars.parseTransform);
  4026. smooth = vars.smoothOrigin !== false && cache.smooth;
  4027. transformPropTween = this._pt = new PropTween(this._pt, style, _transformProp, 0, 1, cache.renderTransform, cache, 0, -1);
  4028. transformPropTween.dep = 1;
  4029. }
  4030. if (p === "scale") {
  4031. this._pt = new PropTween(this._pt, cache, "scaleY", cache.scaleY, (relative ? _parseRelative(cache.scaleY, relative + endNum) : endNum) - cache.scaleY || 0, _renderCSSProp);
  4032. this._pt.u = 0;
  4033. props.push("scaleY", p);
  4034. p += "X";
  4035. } else if (p === "transformOrigin") {
  4036. inlineProps.push(_transformOriginProp, 0, style[_transformOriginProp]);
  4037. endValue = _convertKeywordsToPercentages(endValue);
  4038. if (cache.svg) {
  4039. _applySVGOrigin(target, endValue, 0, smooth, 0, this);
  4040. } else {
  4041. endUnit = parseFloat(endValue.split(" ")[2]) || 0;
  4042. endUnit !== cache.zOrigin && _addNonTweeningPT(this, cache, "zOrigin", cache.zOrigin, endUnit);
  4043. _addNonTweeningPT(this, style, p, _firstTwoOnly(startValue), _firstTwoOnly(endValue));
  4044. }
  4045. continue;
  4046. } else if (p === "svgOrigin") {
  4047. _applySVGOrigin(target, endValue, 1, smooth, 0, this);
  4048. continue;
  4049. } else if (p in _rotationalProperties) {
  4050. _addRotationalPropTween(this, cache, p, startNum, relative ? _parseRelative(startNum, relative + endValue) : endValue);
  4051. continue;
  4052. } else if (p === "smoothOrigin") {
  4053. _addNonTweeningPT(this, cache, "smooth", cache.smooth, endValue);
  4054. continue;
  4055. } else if (p === "force3D") {
  4056. cache[p] = endValue;
  4057. continue;
  4058. } else if (p === "transform") {
  4059. _addRawTransformPTs(this, endValue, target);
  4060. continue;
  4061. }
  4062. } else if (!(p in style)) {
  4063. p = _checkPropPrefix(p) || p;
  4064. }
  4065. if (isTransformRelated || (endNum || endNum === 0) && (startNum || startNum === 0) && !_complexExp.test(endValue) && p in style) {
  4066. startUnit = (startValue + "").substr((startNum + "").length);
  4067. endNum || (endNum = 0);
  4068. endUnit = getUnit(endValue) || (p in _config.units ? _config.units[p] : startUnit);
  4069. startUnit !== endUnit && (startNum = _convertToUnit(target, p, startValue, endUnit));
  4070. this._pt = new PropTween(this._pt, isTransformRelated ? cache : style, p, startNum, (relative ? _parseRelative(startNum, relative + endNum) : endNum) - startNum, !isTransformRelated && (endUnit === "px" || p === "zIndex") && vars.autoRound !== false ? _renderRoundedCSSProp : _renderCSSProp);
  4071. this._pt.u = endUnit || 0;
  4072. if (startUnit !== endUnit && endUnit !== "%") {
  4073. this._pt.b = startValue;
  4074. this._pt.r = _renderCSSPropWithBeginning;
  4075. }
  4076. } else if (!(p in style)) {
  4077. if (p in target) {
  4078. this.add(target, p, startValue || target[p], relative ? relative + endValue : endValue, index, targets);
  4079. } else if (p !== "parseTransform") {
  4080. _missingPlugin(p, endValue);
  4081. continue;
  4082. }
  4083. } else {
  4084. _tweenComplexCSSString.call(this, target, p, startValue, relative ? relative + endValue : endValue);
  4085. }
  4086. isTransformRelated || (p in style ? inlineProps.push(p, 0, style[p]) : inlineProps.push(p, 1, startValue || target[p]));
  4087. props.push(p);
  4088. }
  4089. }
  4090. hasPriority && _sortPropTweensByPriority(this);
  4091. },
  4092. render: function render2(ratio, data) {
  4093. if (data.tween._time || !_reverting2()) {
  4094. var pt = data._pt;
  4095. while (pt) {
  4096. pt.r(ratio, pt.d);
  4097. pt = pt._next;
  4098. }
  4099. } else {
  4100. data.styles.revert();
  4101. }
  4102. },
  4103. get: _get,
  4104. aliases: _propertyAliases,
  4105. getSetter: function getSetter(target, property, plugin) {
  4106. var p = _propertyAliases[property];
  4107. p && p.indexOf(",") < 0 && (property = p);
  4108. return property in _transformProps && property !== _transformOriginProp && (target._gsap.x || _get(target, "x")) ? plugin && _recentSetterPlugin === plugin ? property === "scale" ? _setterScale : _setterTransform : (_recentSetterPlugin = plugin || {}) && (property === "scale" ? _setterScaleWithRender : _setterTransformWithRender) : target.style && !_isUndefined(target.style[property]) ? _setterCSSStyle : ~property.indexOf("-") ? _setterCSSProp : _getSetter(target, property);
  4109. },
  4110. core: {
  4111. _removeProperty,
  4112. _getMatrix
  4113. }
  4114. };
  4115. gsap.utils.checkPrefix = _checkPropPrefix;
  4116. gsap.core.getStyleSaver = _getStyleSaver;
  4117. (function(positionAndScale, rotation, others, aliases) {
  4118. var all = _forEachName(positionAndScale + "," + rotation + "," + others, function(name) {
  4119. _transformProps[name] = 1;
  4120. });
  4121. _forEachName(rotation, function(name) {
  4122. _config.units[name] = "deg";
  4123. _rotationalProperties[name] = 1;
  4124. });
  4125. _propertyAliases[all[13]] = positionAndScale + "," + rotation;
  4126. _forEachName(aliases, function(name) {
  4127. var split = name.split(":");
  4128. _propertyAliases[split[1]] = all[split[0]];
  4129. });
  4130. })("x,y,z,scale,scaleX,scaleY,xPercent,yPercent", "rotation,rotationX,rotationY,skewX,skewY", "transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective", "0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");
  4131. _forEachName("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective", function(name) {
  4132. _config.units[name] = "px";
  4133. });
  4134. gsap.registerPlugin(CSSPlugin);
  4135. // node_modules/.pnpm/gsap@3.11.4/node_modules/gsap/index.js
  4136. var gsapWithCSS = gsap.registerPlugin(CSSPlugin) || gsap;
  4137. var TweenMaxWithCSS = gsapWithCSS.core.Tween;
  4138. export {
  4139. Back,
  4140. Bounce,
  4141. CSSPlugin,
  4142. Circ,
  4143. Cubic,
  4144. Elastic,
  4145. Expo,
  4146. Linear,
  4147. Power0,
  4148. Power1,
  4149. Power2,
  4150. Power3,
  4151. Power4,
  4152. Quad,
  4153. Quart,
  4154. Quint,
  4155. Sine,
  4156. SteppedEase,
  4157. Strong,
  4158. Timeline as TimelineLite,
  4159. Timeline as TimelineMax,
  4160. Tween as TweenLite,
  4161. TweenMaxWithCSS as TweenMax,
  4162. gsapWithCSS as default,
  4163. gsapWithCSS as gsap
  4164. };
  4165. //# sourceMappingURL=gsap.js.map