"use strict";var _slicedToArray=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],n=!0,a=!1,o=void 0;try{for(var i,c=e[Symbol.iterator]();!(n=(i=c.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){a=!0,o=e}finally{try{!n&&c.return&&c.return()}finally{if(a)throw o}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();function _asyncToGenerator(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,r){return function n(a,o){try{var i=t[a](o),c=i.value}catch(e){return void r(e)}if(!i.done)return Promise.resolve(c).then(function(e){n("next",e)},function(e){n("throw",e)});e(c)}("next")})}}drill.task(function(){var e=_asyncToGenerator(regeneratorRuntime.mark(function e(t,r){var n,a,o,i,c,u,s,l,p,d,f,m,y,g,h;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.initActiveId,e.next=3,t("common/data","util/animationCSSUtil","util/pageUtil","data -r");case 3:return a=e.sent,o=_slicedToArray(a,4),i=o[0],c=o[1],u=o[2],s=o[3],e.next=11,t("../h5/h5Util");case 11:l=e.sent,c.initAnimation(s.animation),p=$(".p_main"),console.log(n),d=p.children().eq(n),f=d.prop("pageData"),i.on("pageLoaded",function(e,t){u.clearPageAnime(t.page)}),f.startLoad(),m=0,y=[],$(".p_main > .page").each(function(e,t){var r=$(t);n===e?r.attr("active",1):r.attr("active",0);var a=t.pageData;n===e&&(m=y.length),y.push({type:"page",ele:t,data:a}),e==n?r.css(c.toCSSObj(a.pos1_after)):e<n?r.css(c.toCSSObj(a.pos2_after)):r.css(c.toCSSObj(a.pos1));var o={},i=new Set;Array.from(a).forEach(function(e){e&&e.animateIn&&(i.add(e.animateInDelay),(o[e.animateInDelay]||(o[e.animateInDelay]={type:"group",arr:[]})).arr.push({type:"ele",data:e}))}),(i=Array.from(i)).sort(),i.forEach(function(e){y.push(o[e])})}),g=top,console.log(y,i),p.on("click",function(e){h()}),h=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=y[++m];if(t){switch(t.type){case"group":t.arr.forEach(function(t){u.runEleAnime($('[outer-id="'+t.data.outerId+'"] .p_ele'),t.data,{noDelay:1,noAnime:e.noAnime})});break;case"page":l.toPage($(t.ele).index())}g.postMessage({type:"pptModeBack",cid:m,count:y.length},"*"),console.log("arrId => ",m)}else console.log("最后一页了")},window.addEventListener("message",function(){var e=_asyncToGenerator(regeneratorRuntime.mark(function e(t){var r,n,a,o;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:r=t.data,console.log(t),e.t0=r.type,e.next="pptModeCommond"===e.t0?5:18;break;case 5:if((n=r.rid)!==m){e.next=8;break}return e.abrupt("return");case 8:for(a=n,o=y[n];"page"!==o.type;)o=y[--a];return e.next=13,o.data.startLoad();case 13:for(m=n-1,h(),a++;a<n;a++)y[a].arr.forEach(function(e){u.runEleAnime($('[outer-id="'+e.data.outerId+'"] .p_ele'),e.data,{noDelay:1,noAnime:!0})});return e.abrupt("break",18);case 18:case"end":return e.stop()}},e,void 0)}));return function(t){return e.apply(this,arguments)}}());case 27:case"end":return e.stop()}},e,void 0)}));return function(t,r){return e.apply(this,arguments)}}());