import{d as Ie,x as ke,r as ae,y as Fe,a7 as li,a as H,V as Ve,A as Ot,F as Ue,C as ce,ah as Bi,q as hi,M as Ne,al as Wi,w as ji,z as ze,E as Hi,a5 as ui,e as zi,h as ri,a0 as qi,Q as Gi}from"./index-2eaca48c.js";import{a as Vi,b as Ui,c as Xi,d as $i,e as Yi,f as Zi,g as Ki,h as Qi}from"./fade-in-scale-up.cssr-5fd97bec.js";import{N as Ji,T as tn}from"./index-e0af7ef7.js";import{q as en}from"./base-aba1ba3e.js";import{g as me,s as kt,a as ci,b as di}from"./api-9372293f.js";import{d as qe}from"./deep-clone-c0d00fc2.js";import{T as nn,a as Ge}from"./index-b5fb4922.js";import{T as oi}from"./index-2ceb0c19.js";import"./use-tab-status-8946c989.js";import"./index-87cddea8.js";const sn="_container_8nt1j_1",rn="_head_8nt1j_10",on="_back_8nt1j_18",an="_tabs_8nt1j_21",ln="_downBtn_8nt1j_37",hn="_activeBtn_8nt1j_48",un="_icon_8nt1j_48",cn="_iconUp_8nt1j_73",dn="_popover_8nt1j_78",pn="_content_8nt1j_97",fn="_wrap_8nt1j_103",gn="_emtpyWrap_8nt1j_109",mn="_wrapItem_8nt1j_120",yn="_item_8nt1j_130",vn="_name_8nt1j_161",wn="_favoriteBtn_8nt1j_168",xn="_containerImg_8nt1j_174",bn="_cover_8nt1j_200",Pn="_loaded_8nt1j_230",Sn="_book_8nt1j_233",Tn="_bookWrap_8nt1j_247",Cn="_show_8nt1j_255",An="_popupContainer_8nt1j_260",kn="_searchList_8nt1j_266",_n="_popoverTitle_8nt1j_272",Mn="_popupList_8nt1j_288",Dn="_btnGroup_8nt1j_309",En="_btnSure_8nt1j_324",mt={container:sn,head:rn,back:on,tabs:an,downBtn:ln,activeBtn:hn,icon:un,iconUp:cn,popover:dn,content:pn,wrap:fn,emtpyWrap:gn,wrapItem:mn,item:yn,name:vn,favoriteBtn:wn,containerImg:xn,cover:bn,loaded:Pn,book:Sn,bookWrap:Tn,show:Cn,popupContainer:An,searchList:kn,popoverTitle:_n,popupList:Mn,btnGroup:Dn,btnSure:En},pi=""+new URL("icon_back-b80c2fc2.svg",import.meta.url).href,Nn="_book_1v6y0_1",Ln="_back_1v6y0_11",In="_bookHide_1v6y0_16",Fn="_wrap_1v6y0_36",On="_wrapItem_1v6y0_53",Rn="_item_1v6y0_60",Bn="_des_1v6y0_69",Wn="_icon_1v6y0_74",jn="_last_1v6y0_79",Ut={book:Nn,back:Ln,bookHide:In,wrap:Fn,wrapItem:On,item:Rn,des:Bn,icon:Wn,last:jn},Hn="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAKKADAAQAAAABAAAAKAAAAAB65masAAAFDElEQVRYCcWZy24cRRSGT3XPxbHj+MIlwXLCJkJKkLJmzSICicfIhi0Pwg55k9dASF6AxAOwQAIhgRRkQpwQRMaZxjOeme7i/8+pmqtlVwMzLqlVl66u+uo/p0731DiZS/6s+754eYTmhyL+DsrX57r892obQzon0nkmUlUF5jnCoIcizcfujXd+mJ4AvSx571tyVnyO2qfifRbbl5K3NwCIKU5eiJSDyRTOVagcyM7+Z845vaGAAe4rgH046b3EUuuaSNYQOX0l0oeAC8l9Lbv7HxPSlKJyq4IjTFkaUgtKnpsg1KuntKa44HPfL92sMyAwnJoZefGXyODvmbtaobl940GmG2LZPrcwvZ/43saOSKO10MMEGz6iibFbryCNsAfKke3mzbdN0UWMh873X3eXEkoWJzu/pYkNk2PDMJVDmPtUhPAV/dQVzvdeQ+8rTjlMTDMzNs6lgD7XmlTFukZ9XEPx1UA8Vu0rlGG2CkpU2KllWUnlR8i9lJWXUVXJta1bcuOt27MzMBbyypsWfhgjA2w64M9firz8EdIT6gwvAEzqGlJlTSmlgXLTymgrxcoVy2zHpX2Rd4tiETDi0sS8plIiINT67Vu8kezJyuU6KQHsAgQgWfaA8Ch7vWftpfYnLPr4RTNO8SwUEwHDcxjbS6Yg40mpngAYbwYqWY3LOYC4kLgIgybkN0/gBhjpvd1cbm/Zu2KBLDSkA3oPVUy5aC6aNyrH3ANyUg/3CA0ohScs6s8LvnKxWF/+j4CAU6WQm/kAS7W0DhiFoGoRCPcIHKAM3u4HcZKyZAVpLvoXFYgKTnKCEsZAI5T2jSaP9/F8nXSxA0yNZGAThQyIZm2JW9sOgKauKQ3goGD0TbZzoXVS8nI4me5QNRkmUvM2ZOv+R9Lc2pM+Pj47v/8kvdPClEY/6xNVxe6Gz3KMGA1SQNMBaVoqgJybw8ydS7Z2Q+dZ296TW7hOOy/kz+MnMuz1gsnNT6m4PV9PwXQTB3PpBlFQbgKoIbNxbX37pty594G8uXcXiyDUrG+qginShT7JCkaTTmKbmXmObzx13myrv9mOByh8T1Vcjg+6MDjVMBNz09Cn5hXswwf/eP5UOt3uJCbyGaqpeT0TJyvICUwNvnttNzIOjgZ9yVvrctYr5OXxr9I5OVHTR19lHtWPz49lTijUADQwew/bjib08S/fSWN9Wwp8BNiHQVBZfS/ERy0HUCyqTkoHxMDxy8XMFXwKn1T9AuZE+Bj72XRflmlaQsIlqGidlNxbgy4m01eWmtvim4Yb1OMrzlwhqm1QsQ9dgs/XScm9LVzQfAYWYxpNHu9FECo53r1UEFf0Qy6gTkruHb9UxmCMi/wwBTBhDCCYE/W4EDUv6hGept5slfiSEXn3kk8tLiQZUFWCD2l4oYr0qRjbUGbIYZuBTvwxgkUX4InCJ3eT3w/4+kxMa7v7AAgbI4AZ1JRqhOSlChps3DhqZlUyWRMlq/2rzuPnYIWdWyIv8SMo/hjiacYQZsMt5E6GVYYfSZkMcA418DnacuQNubnh5N7O7O+OizSqDXjRYMu4l+Fdet7x0jLmqj8m2OCD7qj+k6t6wh1xkxyuarp/Mc/hFR2/JaDy+M3Jg8y1N3kmfJDwyKq7HJBNP4dXfgR82VIdjoDb1ydHwHpgjQYc2HyBy35VXzbIMu6rWcEQ4DjF7A8KNKzkb4jpxWmY00hyCJrHweXGPf4B6HyHtp8LqjYAAAAASUVORK5CYII=",zn=Ie({name:"courseware-detail",emits:["close"],setup(E,{emit:O}){const Z=ke({box:{},show:!1,steps:[{ele:"",eleRect:{},img:me("courseware-detail1.png"),handStyle:{top:"-0.4rem",left:"0.98rem",transform:"rotate(-90deg)"},boxStyle:{borderRadius:"0.1rem"},imgStyle:{top:"-1.3rem",left:"2.2rem"},btnsStyle:{top:"1.5rem",left:"3.5rem"}}],step:0}),et=ae(!1),J=ae({});(async()=>{var nt;try{const dt=await ci({guideTag:"guideInfo"});dt.data?J.value=JSON.parse((nt=dt.data)==null?void 0:nt.guideValue)||null:J.value={},J.value&&J.value.coursewareDetail?et.value=!1:et.value=!0}catch(dt){console.log(dt)}})();const $=()=>{console.log(`coursewareDetail-${Z.step}`);const nt=document.getElementById(`coursewareDetail-${Z.step}`);if(nt){const dt=nt.getBoundingClientRect();Z.box={left:dt.x+"px",top:dt.y+"px",width:dt.width+"px",height:dt.height+"px"}}else bt()};Fe(()=>{$(),window.addEventListener("resize",ut)});const ut=()=>{$()};li(()=>{window.removeEventListener("resize",ut)});const bt=()=>{if(Z.step>=2){Pt();return}Z.step=Z.step+1,$()},Pt=async()=>{J.value?J.value.coursewareDetail=!0:J.value={coursewareDetail:!0};try{const nt=await di({guideTag:"guideInfo",guideValue:JSON.stringify(J.value)})}catch(nt){console.log(nt)}et.value=!1};return()=>H(Ve,{teleport:"body",overlay:!1,closeOnClickOverlay:!1,class:["popup-custom",kt.guidePopup],show:et.value,"onUpdate:show":nt=>et.value=nt},{default:()=>[H("div",{class:kt.content,onClick:()=>bt()},[Z.step!=Z.steps.length-1&&H("div",{class:kt.backBtn,onClick:nt=>{nt.stopPropagation(),Pt()}},[Ot("跳过")]),H("div",{class:kt.box,style:{...Z.box,...Z.steps[Z.step].boxStyle},id:`modeType-${Z.step}`},[Z.steps.map((nt,dt)=>{var Et,_t;return H("div",{onClick:Ct=>Ct.stopPropagation(),class:kt.item,style:{display:dt===Z.step?"":"none",left:`${(Et=nt.eleRect)==null?void 0:Et.left}px`,top:`${(_t=nt.eleRect)==null?void 0:_t.top}px`}},[H("img",{class:kt.img,style:nt.imgStyle,src:nt.img},null),H("img",{class:kt.iconHead,style:nt.handStyle,src:me("indexDot.png")},null),H("div",{class:kt.btns,style:nt.btnsStyle},[Z.step+1==Z.steps.length?H(Ue,null,[H(ce,{class:[kt.btn,kt.endBtn],round:!0,type:"primary",onClick:()=>Pt()},{default:()=>[Ot("完成")]})]):H(ce,{class:kt.btn,round:!0,type:"primary",onClick:()=>bt()},{default:()=>[Ot("下一步 ("),Z.step+1,Ot("/"),Z.steps.length,Ot(")")]})])])})])])]})}});var Le={},qn={get exports(){return Le},set exports(E){Le=E}};(function(E,O){(function(Z,et){et(O)})(Bi,function(Z){class et{constructor(a,h){this.state={angle:0,area:[],position:{x:0,y:0},hardAngle:0,hardDrawingAngle:0},this.createdDensity=h,this.nowDrawingDensity=this.createdDensity,this.render=a}setDensity(a){this.createdDensity=a,this.nowDrawingDensity=a}setDrawingDensity(a){this.nowDrawingDensity=a}setPosition(a){this.state.position=a}setAngle(a){this.state.angle=a}setArea(a){this.state.area=a}setHardDrawingAngle(a){this.state.hardDrawingAngle=a}setHardAngle(a){this.state.hardAngle=a,this.state.hardDrawingAngle=a}setOrientation(a){this.orientation=a}getDrawingDensity(){return this.nowDrawingDensity}getDensity(){return this.createdDensity}getHardAngle(){return this.state.hardAngle}}class J extends et{constructor(a,h,y){super(a,y),this.image=null,this.isLoad=!1,this.loadingAngle=0,this.image=new Image,this.image.src=h}draw(a){const h=this.render.getContext(),y=this.render.convertToGlobal(this.state.position),x=this.render.getRect().pageWidth,k=this.render.getRect().height;h.save(),h.translate(y.x,y.y),h.beginPath();for(let F of this.state.area)F!==null&&(F=this.render.convertToGlobal(F),h.lineTo(F.x-y.x,F.y-y.y));h.rotate(this.state.angle),h.clip(),this.isLoad?h.drawImage(this.image,0,0,x,k):this.drawLoader(h,{x:0,y:0},x,k),h.restore()}simpleDraw(a){const h=this.render.getRect(),y=this.render.getContext(),x=h.pageWidth,k=h.height,F=a===1?h.left+h.pageWidth:h.left,tt=h.top;this.isLoad?y.drawImage(this.image,F,tt,x,k):this.drawLoader(y,{x:F,y:tt},x,k)}drawLoader(a,h,y,x){a.beginPath(),a.strokeStyle="rgb(200, 200, 200)",a.fillStyle="rgb(255, 255, 255)",a.lineWidth=1,a.rect(h.x+1,h.y+1,y-1,x-1),a.stroke(),a.fill();const k={x:h.x+y/2,y:h.y+x/2};a.beginPath(),a.lineWidth=10,a.arc(k.x,k.y,20,this.loadingAngle,3*Math.PI/2+this.loadingAngle),a.stroke(),a.closePath(),this.loadingAngle+=.07,this.loadingAngle>=2*Math.PI&&(this.loadingAngle=0)}load(){this.isLoad||(this.image.onload=()=>{this.isLoad=!0})}newTemporaryCopy(){return this}getTemporaryCopy(){return this}hideTemporaryCopy(){}}class Bt{constructor(a,h){this.pages=[],this.currentPageIndex=0,this.currentSpreadIndex=0,this.landscapeSpread=[],this.portraitSpread=[],this.render=h,this.app=a,this.currentPageIndex=0,this.isShowCover=this.app.getSettings().showCover}destroy(){this.pages=[]}createSpread(){this.landscapeSpread=[],this.portraitSpread=[];for(let h=0;h=0&&a0?this.pages[h-1]:null}getFlippingPage(a){const h=this.currentSpreadIndex;if(this.render.getOrientation()==="portrait")return a===0?this.pages[h].newTemporaryCopy():this.pages[h-1];{const y=a===0?this.getSpread()[h+1]:this.getSpread()[h-1];return y.length===1||a===0?this.pages[y[0]]:this.pages[y[1]]}}getBottomPage(a){const h=this.currentSpreadIndex;if(this.render.getOrientation()==="portrait")return a===0?this.pages[h+1]:this.pages[h-1];{const y=a===0?this.getSpread()[h+1]:this.getSpread()[h-1];return y.length===1?this.pages[y[0]]:a===0?this.pages[y[1]]:this.pages[y[0]]}}showNext(){this.currentSpreadIndex0&&(this.currentSpreadIndex--,this.showSpread())}getCurrentPageIndex(){return this.currentPageIndex}show(a=null){if(a===null&&(a=this.currentPageIndex),a<0||a>=this.pages.length)return;const h=this.getSpreadIndexByPage(a);h!==null&&(this.currentSpreadIndex=h,this.showSpread())}getCurrentSpreadIndex(){return this.currentSpreadIndex}setCurrentSpreadIndex(a){if(!(a>=0&&a=a.left&&h.x<=a.width+a.left&&h.y>=a.top&&h.y<=a.top+a.height?h:null}static GetRotatedPoint(a,h,y){return{x:a.x*Math.cos(y)+a.y*Math.sin(y)+h.x,y:a.y*Math.cos(y)-a.x*Math.sin(y)+h.y}}static LimitPointToCircle(a,h,y){if(ut.GetDistanceBetweenTwoPoint(a,y)<=h)return y;const x=a.x,k=a.y,F=y.x,tt=y.y;let st=Math.sqrt(Math.pow(h,2)*Math.pow(x-F,2)/(Math.pow(x-F,2)+Math.pow(k-tt,2)))+x;y.x<0&&(st*=-1);let yt=(st-x)*(k-tt)/(x-F)+k;return x-F+k===0&&(yt=h),{x:st,y:yt}}static GetIntersectBetweenTwoSegment(a,h,y){return ut.PointInRect(a,ut.GetIntersectBeetwenTwoLine(h,y))}static GetIntersectBeetwenTwoLine(a,h){const y=a[0].y-a[1].y,x=h[0].y-h[1].y,k=a[1].x-a[0].x,F=h[1].x-h[0].x,tt=a[0].x*a[1].y-a[1].x*a[0].y,st=h[0].x*h[1].y-h[1].x*h[0].y,yt=y*st-x*tt,xt=k*st-F*tt,At=-(tt*F-st*k)/(y*F-x*k),Xt=-(y*st-x*tt)/(y*F-x*k);if(isFinite(At)&&isFinite(Xt))return{x:At,y:Xt};if(Math.abs(yt-xt)<.1)throw new Error("Segment included");return null}static GetCordsFromTwoPoint(a,h){const y=Math.abs(a.x-h.x),x=Math.abs(a.y-h.y),k=Math.max(y,x),F=[a];function tt(st,yt,xt,At,Xt){return yt>st?st+Xt*(xt/At):yt=10&&a.push(this.sideIntersectPoint):this.corner==="top"&&a.push({x:this.pageWidth,y:this.pageHeight}),a.push(this.bottomIntersectPoint),a.push(this.topIntersectPoint),a}getAngle(){return this.direction===0?-this.angle:this.angle}getRect(){return this.rect}getPosition(){return this.position}getActiveCorner(){return this.direction===0?this.rect.topLeft:this.rect.topRight}getDirection(){return this.direction}getFlippingProgress(){return Math.abs((this.position.x-this.pageWidth)/(2*this.pageWidth)*100)}getCorner(){return this.corner}getBottomPagePosition(){return this.direction===1?{x:this.pageWidth,y:0}:{x:0,y:0}}getShadowStartPoint(){return this.corner==="top"?this.topIntersectPoint:this.sideIntersectPoint!==null?this.sideIntersectPoint:this.topIntersectPoint}getShadowAngle(){const a=ut.GetAngleBetweenTwoLine(this.getSegmentToShadowLine(),[{x:0,y:0},{x:this.pageWidth,y:0}]);return this.direction===0?a:Math.PI-a}calcAngleAndPosition(a){let h=a;if(this.updateAngleAndGeometry(h),h=this.corner==="top"?this.checkPositionAtCenterLine(h,{x:0,y:0},{x:0,y:this.pageHeight}):this.checkPositionAtCenterLine(h,{x:0,y:this.pageHeight},{x:0,y:0}),Math.abs(h.x-this.pageWidth)<1&&Math.abs(h.y)<1)throw new Error("Point is too small");return h}updateAngleAndGeometry(a){this.angle=this.calculateAngle(a),this.rect=this.getPageRect(a)}calculateAngle(a){const h=this.pageWidth-a.x+1,y=this.corner==="bottom"?this.pageHeight-a.y:a.y;let x=2*Math.acos(h/Math.sqrt(y*y+h*h));y<0&&(x=-x);const k=Math.PI-x;if(!isFinite(x)||k>=0&&k<.003)throw new Error("The G point is too small");return this.corner==="bottom"&&(x=-x),x}getPageRect(a){return this.corner==="top"?this.getRectFromBasePoint([{x:0,y:0},{x:this.pageWidth,y:0},{x:0,y:this.pageHeight},{x:this.pageWidth,y:this.pageHeight}],a):this.getRectFromBasePoint([{x:0,y:-this.pageHeight},{x:this.pageWidth,y:-this.pageHeight},{x:0,y:0},{x:this.pageWidth,y:0}],a)}getRectFromBasePoint(a,h){return{topLeft:this.getRotatedPoint(a[0],h),topRight:this.getRotatedPoint(a[1],h),bottomLeft:this.getRotatedPoint(a[2],h),bottomRight:this.getRotatedPoint(a[3],h)}}getRotatedPoint(a,h){return{x:a.x*Math.cos(this.angle)+a.y*Math.sin(this.angle)+h.x,y:a.y*Math.cos(this.angle)-a.x*Math.sin(this.angle)+h.y}}calculateIntersectPoint(a){const h={left:-1,top:-1,width:this.pageWidth+2,height:this.pageHeight+2};this.corner==="top"?(this.topIntersectPoint=ut.GetIntersectBetweenTwoSegment(h,[a,this.rect.topRight],[{x:0,y:0},{x:this.pageWidth,y:0}]),this.sideIntersectPoint=ut.GetIntersectBetweenTwoSegment(h,[a,this.rect.bottomLeft],[{x:this.pageWidth,y:0},{x:this.pageWidth,y:this.pageHeight}]),this.bottomIntersectPoint=ut.GetIntersectBetweenTwoSegment(h,[this.rect.bottomLeft,this.rect.bottomRight],[{x:0,y:this.pageHeight},{x:this.pageWidth,y:this.pageHeight}])):(this.topIntersectPoint=ut.GetIntersectBetweenTwoSegment(h,[this.rect.topLeft,this.rect.topRight],[{x:0,y:0},{x:this.pageWidth,y:0}]),this.sideIntersectPoint=ut.GetIntersectBetweenTwoSegment(h,[a,this.rect.topLeft],[{x:this.pageWidth,y:0},{x:this.pageWidth,y:this.pageHeight}]),this.bottomIntersectPoint=ut.GetIntersectBetweenTwoSegment(h,[this.rect.bottomLeft,this.rect.bottomRight],[{x:0,y:this.pageHeight},{x:this.pageWidth,y:this.pageHeight}]))}checkPositionAtCenterLine(a,h,y){let x=a;const k=ut.LimitPointToCircle(h,this.pageWidth,x);x!==k&&(x=k,this.updateAngleAndGeometry(x));const F=Math.sqrt(Math.pow(this.pageWidth,2)+Math.pow(this.pageHeight,2));let tt=this.rect.bottomRight,st=this.rect.topLeft;if(this.corner==="bottom"&&(tt=this.rect.topRight,st=this.rect.bottomLeft),tt.x<=0){const yt=ut.LimitPointToCircle(y,F,st);yt!==x&&(x=yt,this.updateAngleAndGeometry(x))}return x}getSegmentToShadowLine(){const a=this.getShadowStartPoint();return[a,a!==this.sideIntersectPoint&&this.sideIntersectPoint!==null?this.sideIntersectPoint:this.bottomIntersectPoint]}}class dt{constructor(a,h){this.flippingPage=null,this.bottomPage=null,this.calc=null,this.state="read",this.render=a,this.app=h}fold(a){this.setState("user_fold"),this.calc===null&&this.start(a),this.do(this.render.convertToPage(a))}flip(a){if(this.app.getSettings().disableFlipByClick&&!this.isPointOnCorners(a)||(this.calc!==null&&this.render.finishAnimation(),!this.start(a)))return;const h=this.getBoundsRect();this.setState("flipping");const y=h.height/10,x=this.calc.getCorner()==="bottom"?h.height-y:y,k=this.calc.getCorner()==="bottom"?h.height:0;this.calc.calc({x:h.pageWidth-y,y:x}),this.animateFlippingTo({x:h.pageWidth-y,y:x},{x:-h.pageWidth,y:k},!0)}start(a){this.reset();const h=this.render.convertToBook(a),y=this.getBoundsRect(),x=this.getDirectionByPoint(h),k=h.y>=y.height/2?"bottom":"top";if(!this.checkDirection(x))return!1;try{if(this.flippingPage=this.app.getPageCollection().getFlippingPage(x),this.bottomPage=this.app.getPageCollection().getBottomPage(x),this.render.getOrientation()==="landscape")if(x===1){const F=this.app.getPageCollection().nextBy(this.flippingPage);F!==null&&this.flippingPage.getDensity()!==F.getDensity()&&(this.flippingPage.setDrawingDensity("hard"),F.setDrawingDensity("hard"))}else{const F=this.app.getPageCollection().prevBy(this.flippingPage);F!==null&&this.flippingPage.getDensity()!==F.getDensity()&&(this.flippingPage.setDrawingDensity("hard"),F.setDrawingDensity("hard"))}return this.render.setDirection(x),this.calc=new nt(x,k,y.pageWidth.toString(10),y.height.toString(10)),!0}catch(F){return!1}}do(a){if(this.calc!==null&&this.calc.calc(a)){const h=this.calc.getFlippingProgress();this.bottomPage.setArea(this.calc.getBottomClipArea()),this.bottomPage.setPosition(this.calc.getBottomPagePosition()),this.bottomPage.setAngle(0),this.bottomPage.setHardAngle(0),this.flippingPage.setArea(this.calc.getFlippingClipArea()),this.flippingPage.setPosition(this.calc.getActiveCorner()),this.flippingPage.setAngle(this.calc.getAngle()),this.calc.getDirection()===0?this.flippingPage.setHardAngle(90*(200-2*h)/100):this.flippingPage.setHardAngle(-90*(200-2*h)/100),this.render.setPageRect(this.calc.getRect()),this.render.setBottomPage(this.bottomPage),this.render.setFlippingPage(this.flippingPage),this.render.setShadowData(this.calc.getShadowStartPoint(),this.calc.getShadowAngle(),h,this.calc.getDirection())}}flipToPage(a,h){const y=this.app.getPageCollection().getCurrentSpreadIndex(),x=this.app.getPageCollection().getSpreadIndexByPage(a);try{x>y&&(this.app.getPageCollection().setCurrentSpreadIndex(x-1),this.flipNext(h)),xthis.do(st));const tt=this.getAnimationDuration(k.length);this.render.startAnimation(F,tt,()=>{this.calc&&(y&&(this.calc.getDirection()===1?this.app.turnToPrevPage():this.app.turnToNextPage()),x&&(this.render.setBottomPage(null),this.render.setFlippingPage(null),this.render.clearShadow(),this.setState("read"),this.reset()))})}getCalculation(){return this.calc}getState(){return this.state}setState(a){this.state!==a&&(this.app.updateState(a),this.state=a)}getDirectionByPoint(a){const h=this.getBoundsRect();if(this.render.getOrientation()==="portrait"){if(a.x-h.pageWidth<=h.width/5)return 1}else if(a.x=1e3?h:a/1e3*h}checkDirection(a){return a===0?this.app.getCurrentPageIndex()=1}reset(){this.calc=null,this.flippingPage=null,this.bottomPage=null}getBoundsRect(){return this.render.getRect()}checkState(...a){for(const h of a)if(this.state===h)return!0;return!1}isPointOnCorners(a){const h=this.getBoundsRect(),y=h.pageWidth,x=Math.sqrt(Math.pow(y,2)+Math.pow(h.height,2))/5,k=this.render.convertToBook(a);return k.x>0&&k.y>0&&k.xh.width-x)&&(k.yh.height-x)}}class Et{constructor(a,h){this.leftPage=null,this.rightPage=null,this.flippingPage=null,this.bottomPage=null,this.direction=null,this.orientation=null,this.shadow=null,this.animation=null,this.pageRect=null,this.boundsRect=null,this.timer=0,this.safari=!1,this.setting=h,this.app=a;const y=new RegExp("Version\\/[\\d\\.]+.*Safari/");this.safari=y.exec(window.navigator.userAgent)!==null}render(a){if(this.animation!==null){const h=Math.round((a-this.animation.startedAt)/this.animation.durationFrame);h{this.render(h),requestAnimationFrame(a)};requestAnimationFrame(a)}startAnimation(a,h,y){this.finishAnimation(),this.animation={frames:a,duration:h,durationFrame:h/a.length,onAnimateEnd:y,startedAt:this.timer}}finishAnimation(){this.animation!==null&&(this.animation.frames[this.animation.frames.length-1](),this.animation.onAnimateEnd!==null&&this.animation.onAnimateEnd()),this.animation=null}update(){this.boundsRect=null;const a=this.calculateBoundsRect();this.orientation!==a&&(this.orientation=a,this.app.updateOrientation(a))}calculateBoundsRect(){let a="landscape";const h=this.getBlockWidth(),y=h/2,x=this.getBlockHeight()/2,k=this.setting.width/this.setting.height;let F=this.setting.width,tt=this.setting.height,st=y-F;return this.setting.size==="stretch"?(h<2*this.setting.minWidth&&this.app.getSettings().usePortrait&&(a="portrait"),F=a==="portrait"?this.getBlockWidth():this.getBlockWidth()/2,F>this.setting.maxWidth&&(F=this.setting.maxWidth),tt=F/k,tt>this.getBlockHeight()&&(tt=this.getBlockHeight(),F=tt*k),st=a==="portrait"?y-F/2-F:y-F):h<2*F&&this.app.getSettings().usePortrait&&(a="portrait",st=y-F/2-F),this.boundsRect={left:st,top:x-tt/2,width:2*F,height:tt,pageWidth:F},a}setShadowData(a,h,y,x){if(!this.app.getSettings().drawShadow)return;const k=100*this.getSettings().maxShadowOpacity;this.shadow={pos:a,angle:h,width:3*this.getRect().pageWidth/4*y/100,opacity:(100-y)*k/100/100,direction:x,progress:2*y}}clearShadow(){this.shadow=null}getBlockWidth(){return this.app.getUI().getDistElement().offsetWidth}getBlockHeight(){return this.app.getUI().getDistElement().offsetHeight}getDirection(){return this.direction}getRect(){return this.boundsRect===null&&this.calculateBoundsRect(),this.boundsRect}getSettings(){return this.app.getSettings()}getOrientation(){return this.orientation}setPageRect(a){this.pageRect=a}setDirection(a){this.direction=a}setRightPage(a){a!==null&&a.setOrientation(1),this.rightPage=a}setLeftPage(a){a!==null&&a.setOrientation(0),this.leftPage=a}setBottomPage(a){a!==null&&a.setOrientation(this.direction===1?0:1),this.bottomPage=a}setFlippingPage(a){a!==null&&a.setOrientation(this.direction===0&&this.orientation!=="portrait"?0:1),this.flippingPage=a}convertToBook(a){const h=this.getRect();return{x:a.x-h.left,y:a.y-h.top}}isSafari(){return this.safari}convertToPage(a,h){h||(h=this.direction);const y=this.getRect();return{x:h===0?a.x-y.left-y.width/2:y.width/2-a.x+y.left,y:a.y-y.top}}convertToGlobal(a,h){if(h||(h=this.direction),a==null)return null;const y=this.getRect();return{x:h===0?a.x+y.left+y.width/2:y.width/2-a.x+y.left,y:a.y+y.top}}convertRectToGlobal(a,h){return h||(h=this.direction),{topLeft:this.convertToGlobal(a.topLeft,h),topRight:this.convertToGlobal(a.topRight,h),bottomLeft:this.convertToGlobal(a.bottomLeft,h),bottomRight:this.convertToGlobal(a.bottomRight,h)}}}class _t extends Et{constructor(a,h,y){super(a,h),this.canvas=y,this.ctx=y.getContext("2d")}getContext(){return this.ctx}reload(){}drawFrame(){this.clear(),this.orientation!=="portrait"&&this.leftPage!=null&&this.leftPage.simpleDraw(0),this.rightPage!=null&&this.rightPage.simpleDraw(1),this.bottomPage!=null&&this.bottomPage.draw(),this.drawBookShadow(),this.flippingPage!=null&&this.flippingPage.draw(),this.shadow!=null&&(this.drawOuterShadow(),this.drawInnerShadow());const a=this.getRect();this.orientation==="portrait"&&(this.ctx.beginPath(),this.ctx.rect(a.left+a.pageWidth,a.top,a.width,a.height),this.ctx.clip())}drawBookShadow(){const a=this.getRect();this.ctx.save(),this.ctx.beginPath();const h=a.width/20;this.ctx.rect(a.left,a.top,a.width,a.height);const y={x:a.left+a.width/2-h/2,y:0};this.ctx.translate(y.x,y.y);const x=this.ctx.createLinearGradient(0,0,h,0);x.addColorStop(0,"rgba(0, 0, 0, 0)"),x.addColorStop(.4,"rgba(0, 0, 0, 0.2)"),x.addColorStop(.49,"rgba(0, 0, 0, 0.1)"),x.addColorStop(.5,"rgba(0, 0, 0, 0.5)"),x.addColorStop(.51,"rgba(0, 0, 0, 0.4)"),x.addColorStop(1,"rgba(0, 0, 0, 0)"),this.ctx.clip(),this.ctx.fillStyle=x,this.ctx.fillRect(0,0,h,2*a.height),this.ctx.restore()}drawOuterShadow(){const a=this.getRect();this.ctx.save(),this.ctx.beginPath(),this.ctx.rect(a.left,a.top,a.width,a.height);const h=this.convertToGlobal({x:this.shadow.pos.x,y:this.shadow.pos.y});this.ctx.translate(h.x,h.y),this.ctx.rotate(Math.PI+this.shadow.angle+Math.PI/2);const y=this.ctx.createLinearGradient(0,0,this.shadow.width,0);this.shadow.direction===0?(this.ctx.translate(0,-100),y.addColorStop(0,"rgba(0, 0, 0, "+this.shadow.opacity+")"),y.addColorStop(1,"rgba(0, 0, 0, 0)")):(this.ctx.translate(-this.shadow.width,-100),y.addColorStop(0,"rgba(0, 0, 0, 0)"),y.addColorStop(1,"rgba(0, 0, 0, "+this.shadow.opacity+")")),this.ctx.clip(),this.ctx.fillStyle=y,this.ctx.fillRect(0,0,this.shadow.width,2*a.height),this.ctx.restore()}drawInnerShadow(){const a=this.getRect();this.ctx.save(),this.ctx.beginPath();const h=this.convertToGlobal({x:this.shadow.pos.x,y:this.shadow.pos.y}),y=this.convertRectToGlobal(this.pageRect);this.ctx.moveTo(y.topLeft.x,y.topLeft.y),this.ctx.lineTo(y.topRight.x,y.topRight.y),this.ctx.lineTo(y.bottomRight.x,y.bottomRight.y),this.ctx.lineTo(y.bottomLeft.x,y.bottomLeft.y),this.ctx.translate(h.x,h.y),this.ctx.rotate(Math.PI+this.shadow.angle+Math.PI/2);const x=3*this.shadow.width/4,k=this.ctx.createLinearGradient(0,0,x,0);this.shadow.direction===0?(this.ctx.translate(-x,-100),k.addColorStop(1,"rgba(0, 0, 0, "+this.shadow.opacity+")"),k.addColorStop(.9,"rgba(0, 0, 0, 0.05)"),k.addColorStop(.7,"rgba(0, 0, 0, "+this.shadow.opacity+")"),k.addColorStop(0,"rgba(0, 0, 0, 0)")):(this.ctx.translate(0,-100),k.addColorStop(0,"rgba(0, 0, 0, "+this.shadow.opacity+")"),k.addColorStop(.1,"rgba(0, 0, 0, 0.05)"),k.addColorStop(.3,"rgba(0, 0, 0, "+this.shadow.opacity+")"),k.addColorStop(1,"rgba(0, 0, 0, 0)")),this.ctx.clip(),this.ctx.fillStyle=k,this.ctx.fillRect(0,0,x,2*a.height),this.ctx.restore()}clear(){this.ctx.fillStyle="white",this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height)}}class Ct{constructor(a,h,y){this.touchPoint=null,this.swipeTimeout=250,this.onResize=()=>{this.update()},this.onMouseDown=k=>{if(this.checkTarget(k.target)){const F=this.getMousePos(k.clientX,k.clientY);this.app.startUserTouch(F),k.preventDefault()}},this.onTouchStart=k=>{if(this.checkTarget(k.target)&&k.changedTouches.length>0){const F=k.changedTouches[0],tt=this.getMousePos(F.clientX,F.clientY);this.touchPoint={point:tt,time:Date.now()},setTimeout(()=>{this.touchPoint!==null&&this.app.startUserTouch(tt)},this.swipeTimeout),this.app.getSettings().mobileScrollSupport||k.preventDefault()}},this.onMouseUp=k=>{const F=this.getMousePos(k.clientX,k.clientY);this.app.userStop(F)},this.onMouseMove=k=>{const F=this.getMousePos(k.clientX,k.clientY);this.app.userMove(F,!1)},this.onTouchMove=k=>{if(k.changedTouches.length>0){const F=k.changedTouches[0],tt=this.getMousePos(F.clientX,F.clientY);this.app.getSettings().mobileScrollSupport?(this.touchPoint!==null&&(Math.abs(this.touchPoint.point.x-tt.x)>10||this.app.getState()!=="read")&&k.cancelable&&this.app.userMove(tt,!0),this.app.getState()!=="read"&&k.preventDefault()):this.app.userMove(tt,!0)}},this.onTouchEnd=k=>{if(k.changedTouches.length>0){const F=k.changedTouches[0],tt=this.getMousePos(F.clientX,F.clientY);let st=!1;if(this.touchPoint!==null){const yt=tt.x-this.touchPoint.point.x,xt=Math.abs(tt.y-this.touchPoint.point.y);Math.abs(yt)>this.swipeDistance&&xt<2*this.swipeDistance&&Date.now()-this.touchPoint.time0?this.app.flipPrev(this.touchPoint.point.y'),this.wrapper=a.querySelector(".stf__wrapper"),this.app=h;const x=this.app.getSettings().usePortrait?1:2;a.style.minWidth=y.minWidth*x+"px",a.style.minHeight=y.minHeight+"px",y.size==="fixed"&&(a.style.minWidth=y.width*x+"px",a.style.minHeight=y.height+"px"),y.autoSize&&(a.style.width="100%",a.style.maxWidth=2*y.maxWidth+"px"),a.style.display="block",window.addEventListener("resize",this.onResize,!1),this.swipeDistance=y.swipeDistance}destroy(){this.app.getSettings().useMouseEvents&&this.removeHandlers(),this.distElement.remove(),this.wrapper.remove()}getDistElement(){return this.distElement}getWrapper(){return this.wrapper}setOrientationStyle(a){this.wrapper.classList.remove("--portrait","--landscape"),a==="portrait"?(this.app.getSettings().autoSize&&(this.wrapper.style.paddingBottom=this.app.getSettings().height/this.app.getSettings().width*100+"%"),this.wrapper.classList.add("--portrait")):(this.app.getSettings().autoSize&&(this.wrapper.style.paddingBottom=this.app.getSettings().height/(2*this.app.getSettings().width)*100+"%"),this.wrapper.classList.add("--landscape")),this.update()}removeHandlers(){window.removeEventListener("resize",this.onResize),this.distElement.removeEventListener("mousedown",this.onMouseDown),this.distElement.removeEventListener("touchstart",this.onTouchStart),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("touchend",this.onTouchEnd)}setHandlers(){window.addEventListener("resize",this.onResize,!1),this.app.getSettings().useMouseEvents&&(this.distElement.addEventListener("mousedown",this.onMouseDown),this.distElement.addEventListener("touchstart",this.onTouchStart),window.addEventListener("mousemove",this.onMouseMove),window.addEventListener("touchmove",this.onTouchMove,{passive:!this.app.getSettings().mobileScrollSupport}),window.addEventListener("mouseup",this.onMouseUp),window.addEventListener("touchend",this.onTouchEnd))}getMousePos(a,h){const y=this.distElement.getBoundingClientRect();return{x:a-y.left,y:h-y.top}}checkTarget(a){return!this.app.getSettings().clickEventForward||!["a","button"].includes(a.tagName.toLowerCase())}}class U extends Ct{constructor(a,h,y,x){super(a,h,y),this.wrapper.insertAdjacentHTML("afterbegin",'
'),this.distElement=a.querySelector(".stf__block"),this.items=x;for(const k of x)this.distElement.appendChild(k);this.setHandlers()}clear(){for(const a of this.items)this.parentElement.appendChild(a)}updateItems(a){this.removeHandlers(),this.distElement.innerHTML="";for(const h of a)this.distElement.appendChild(h);this.items=a,this.setHandlers()}update(){this.app.getRender().update()}}class K extends Ct{constructor(a,h,y){super(a,h,y),this.wrapper.innerHTML='',this.canvas=a.querySelectorAll("canvas")[0],this.distElement=this.canvas,this.resizeCanvas(),this.setHandlers()}resizeCanvas(){const a=getComputedStyle(this.canvas),h=parseInt(a.getPropertyValue("width"),10),y=parseInt(a.getPropertyValue("height"),10);this.canvas.width=h,this.canvas.height=y}getCanvas(){return this.canvas}update(){this.resizeCanvas(),this.app.getRender().update()}}class ht extends Et{constructor(a,h,y){super(a,h),this.outerShadow=null,this.innerShadow=null,this.hardShadow=null,this.hardInnerShadow=null,this.element=y,this.createShadows()}createShadows(){this.element.insertAdjacentHTML("beforeend",`
`),this.outerShadow=this.element.querySelector(".stf__outerShadow"),this.innerShadow=this.element.querySelector(".stf__innerShadow"),this.hardShadow=this.element.querySelector(".stf__hardShadow"),this.hardInnerShadow=this.element.querySelector(".stf__hardInnerShadow")}clearShadow(){super.clearShadow(),this.outerShadow.style.cssText="display: none",this.innerShadow.style.cssText="display: none",this.hardShadow.style.cssText="display: none",this.hardInnerShadow.style.cssText="display: none"}reload(){this.element.querySelector(".stf__outerShadow")||this.createShadows()}drawHardInnerShadow(){const a=this.getRect(),h=this.shadow.progress>100?200-this.shadow.progress:this.shadow.progress;let y=(100-h)*(2.5*a.pageWidth)/100+20;y>a.pageWidth&&(y=a.pageWidth);let x=` display: block; z-index: ${(this.getSettings().startZIndex+5).toString(10)}; width: ${y}px; height: ${a.height}px; background: linear-gradient(to right, rgba(0, 0, 0, ${this.shadow.opacity*h/100}) 5%, rgba(0, 0, 0, 0) 100%); left: ${a.left+a.width/2}px; transform-origin: 0 0; `;x+=this.getDirection()===0&&this.shadow.progress>100||this.getDirection()===1&&this.shadow.progress<=100?"transform: translate3d(0, 0, 0);":"transform: translate3d(0, 0, 0) rotateY(180deg);",this.hardInnerShadow.style.cssText=x}drawHardOuterShadow(){const a=this.getRect();let h=(100-(this.shadow.progress>100?200-this.shadow.progress:this.shadow.progress))*(2.5*a.pageWidth)/100+20;h>a.pageWidth&&(h=a.pageWidth);let y=` display: block; z-index: ${(this.getSettings().startZIndex+4).toString(10)}; width: ${h}px; height: ${a.height}px; background: linear-gradient(to left, rgba(0, 0, 0, ${this.shadow.opacity}) 5%, rgba(0, 0, 0, 0) 100%); left: ${a.left+a.width/2}px; transform-origin: 0 0; `;y+=this.getDirection()===0&&this.shadow.progress>100||this.getDirection()===1&&this.shadow.progress<=100?"transform: translate3d(0, 0, 0) rotateY(180deg);":"transform: translate3d(0, 0, 0);",this.hardShadow.style.cssText=y}drawInnerShadow(){const a=this.getRect(),h=3*this.shadow.width/4,y=this.getDirection()===0?h:0,x=this.getDirection()===0?"to left":"to right",k=this.convertToGlobal(this.shadow.pos),F=this.shadow.angle+3*Math.PI/2,tt=[this.pageRect.topLeft,this.pageRect.topRight,this.pageRect.bottomRight,this.pageRect.bottomLeft];let st="polygon( ";for(const xt of tt){let At=this.getDirection()===1?{x:-xt.x+this.shadow.pos.x,y:xt.y-this.shadow.pos.y}:{x:xt.x-this.shadow.pos.x,y:xt.y-this.shadow.pos.y};At=ut.GetRotatedPoint(At,{x:y,y:100},F),st+=At.x+"px "+At.y+"px, "}st=st.slice(0,-2),st+=")";const yt=` display: block; z-index: ${(this.getSettings().startZIndex+10).toString(10)}; width: ${h}px; height: ${2*a.height}px; background: linear-gradient(${x}, rgba(0, 0, 0, ${this.shadow.opacity}) 5%, rgba(0, 0, 0, 0.05) 15%, rgba(0, 0, 0, ${this.shadow.opacity}) 35%, rgba(0, 0, 0, 0) 100%); transform-origin: ${y}px 100px; transform: translate3d(${k.x-y}px, ${k.y-100}px, 0) rotate(${F}rad); clip-path: ${st}; -webkit-clip-path: ${st}; `;this.innerShadow.style.cssText=yt}drawOuterShadow(){const a=this.getRect(),h=this.convertToGlobal({x:this.shadow.pos.x,y:this.shadow.pos.y}),y=this.shadow.angle+3*Math.PI/2,x=this.getDirection()===1?this.shadow.width:0,k=this.getDirection()===0?"to right":"to left",F=[{x:0,y:0},{x:a.pageWidth,y:0},{x:a.pageWidth,y:a.height},{x:0,y:a.height}];let tt="polygon( ";for(const yt of F)if(yt!==null){let xt=this.getDirection()===1?{x:-yt.x+this.shadow.pos.x,y:yt.y-this.shadow.pos.y}:{x:yt.x-this.shadow.pos.x,y:yt.y-this.shadow.pos.y};xt=ut.GetRotatedPoint(xt,{x,y:100},y),tt+=xt.x+"px "+xt.y+"px, "}tt=tt.slice(0,-2),tt+=")";const st=` display: block; z-index: ${(this.getSettings().startZIndex+10).toString(10)}; width: ${this.shadow.width}px; height: ${2*a.height}px; background: linear-gradient(${k}, rgba(0, 0, 0, ${this.shadow.opacity}), rgba(0, 0, 0, 0)); transform-origin: ${x}px 100px; transform: translate3d(${h.x-x}px, ${h.y-100}px, 0) rotate(${y}rad); clip-path: ${tt}; -webkit-clip-path: ${tt}; `;this.outerShadow.style.cssText=st}drawLeftPage(){this.orientation!=="portrait"&&this.leftPage!==null&&(this.direction===1&&this.flippingPage!==null&&this.flippingPage.getDrawingDensity()==="hard"?(this.leftPage.getElement().style.zIndex=(this.getSettings().startZIndex+5).toString(10),this.leftPage.setHardDrawingAngle(180+this.flippingPage.getHardAngle()),this.leftPage.draw(this.flippingPage.getDrawingDensity())):this.leftPage.simpleDraw(0))}drawRightPage(){this.rightPage!==null&&(this.direction===0&&this.flippingPage!==null&&this.flippingPage.getDrawingDensity()==="hard"?(this.rightPage.getElement().style.zIndex=(this.getSettings().startZIndex+5).toString(10),this.rightPage.setHardDrawingAngle(180+this.flippingPage.getHardAngle()),this.rightPage.draw(this.flippingPage.getDrawingDensity())):this.rightPage.simpleDraw(1))}drawBottomPage(){if(this.bottomPage===null)return;const a=this.flippingPage!=null?this.flippingPage.getDrawingDensity():null;this.orientation==="portrait"&&this.direction===1||(this.bottomPage.getElement().style.zIndex=(this.getSettings().startZIndex+3).toString(10),this.bottomPage.draw(a))}drawFrame(){this.clear(),this.drawLeftPage(),this.drawRightPage(),this.drawBottomPage(),this.flippingPage!=null&&(this.flippingPage.getElement().style.zIndex=(this.getSettings().startZIndex+5).toString(10),this.flippingPage.draw()),this.shadow!=null&&this.flippingPage!==null&&(this.flippingPage.getDrawingDensity()==="soft"?(this.drawOuterShadow(),this.drawInnerShadow()):(this.drawHardOuterShadow(),this.drawHardInnerShadow()))}clear(){for(const a of this.app.getPageCollection().getPages())a!==this.leftPage&&a!==this.rightPage&&a!==this.flippingPage&&a!==this.bottomPage&&(a.getElement().style.cssText="display: none"),a.getTemporaryCopy()!==this.flippingPage&&a.hideTemporaryCopy()}update(){super.update(),this.rightPage!==null&&this.rightPage.setOrientation(1),this.leftPage!==null&&this.leftPage.setOrientation(0)}}class at{constructor(){this._default={startPage:0,size:"fixed",width:0,height:0,minWidth:0,maxWidth:0,minHeight:0,maxHeight:0,drawShadow:!0,flippingTime:1e3,usePortrait:!0,startZIndex:0,autoSize:!0,maxShadowOpacity:1,showCover:!1,mobileScrollSupport:!0,swipeDistance:30,clickEventForward:!0,useMouseEvents:!0,showPageCorners:!0,disableFlipByClick:!1}}getSettings(a){const h=this._default;if(Object.assign(h,a),h.size!=="stretch"&&h.size!=="fixed")throw new Error('Invalid size type. Available only "fixed" and "stretch" value');if(h.width<=0||h.height<=0)throw new Error("Invalid width or height");if(h.flippingTime<=0)throw new Error("Invalid flipping time");return h.size==="stretch"?(h.minWidth<=0&&(h.minWidth=100),h.maxWidth{this.ui.update(),this.trigger("init",this,{page:this.setting.startPage,mode:this.render.getOrientation()})},1)}loadFromHTML(B){this.ui=new U(this.block,this,this.setting,B),this.render=new ht(this,this.setting,this.ui.getDistElement()),this.flipController=new dt(this.render,this),this.pages=new Pt(this,this.render,this.ui.getDistElement(),B),this.pages.load(),this.render.start(),this.pages.show(this.setting.startPage),setTimeout(()=>{this.ui.update(),this.trigger("init",this,{page:this.setting.startPage,mode:this.render.getOrientation()})},1)}updateFromImages(B){const a=this.pages.getCurrentPageIndex();this.pages.destroy(),this.pages=new $(this,this.render,B),this.pages.load(),this.pages.show(a),this.trigger("update",this,{page:a,mode:this.render.getOrientation()})}updateFromHtml(B){const a=this.pages.getCurrentPageIndex();this.pages.destroy(),this.pages=new Pt(this,this.render,this.ui.getDistElement(),B),this.pages.load(),this.ui.updateItems(B),this.render.reload(),this.pages.show(a),this.trigger("update",this,{page:a,mode:this.render.getOrientation()})}clear(){this.pages.destroy(),this.ui.clear()}turnToPrevPage(){this.pages.showPrev()}turnToNextPage(){this.pages.showNext()}turnToPage(B){this.pages.show(B)}flipNext(B="top"){this.flipController.flipNext(B)}flipPrev(B="top"){this.flipController.flipPrev(B)}flip(B,a="top"){this.flipController.flipToPage(B,a)}updateState(B){this.trigger("changeState",this,B)}updatePageIndex(B){this.trigger("flip",this,B)}updateOrientation(B){this.ui.setOrientationStyle(B),this.update(),this.trigger("changeOrientation",this,B)}getPageCount(){return this.pages.getPageCount()}getCurrentPageIndex(){return this.pages.getCurrentPageIndex()}getPage(B){return this.pages.getPage(B)}getRender(){return this.render}getFlipController(){return this.flipController}getOrientation(){return this.render.getOrientation()}getBoundsRect(){return this.render.getRect()}getSettings(){return this.setting}getUI(){return this.ui}getState(){return this.flipController.getState()}getPageCollection(){return this.pages}startUserTouch(B){this.mousePosition=B,this.isUserTouch=!0,this.isUserMove=!1}userMove(B,a){this.isUserTouch||a||!this.setting.showPageCorners?this.isUserTouch&&ut.GetDistanceBetweenTwoPoint(this.mousePosition,B)>5&&(this.isUserMove=!0,this.flipController.fold(B)):this.flipController.showCorner(B)}userStop(B,a=!1){this.isUserTouch&&(this.isUserTouch=!1,a||(this.isUserMove?this.flipController.stopMove():this.flipController.flip(B)))}},Object.defineProperty(Z,"__esModule",{value:!0})})})(qn,Le);const Gn=Ie({name:"the-book",props:{bookData:{type:Object,default:()=>({})},tab:{type:String,default:""},show:{type:Boolean,default:!1},rect:{type:Object,default:()=>({})}},emits:["close"],setup(E,{emit:O}){var _t,Ct,U,K;hi(),console.log(Ne.user.data.phone);const Z="lastTime"+((K=(U=(Ct=(_t=Ne)==null?void 0:_t.user)==null?void 0:Ct.data)==null?void 0:U.phone)!=null?K:""),et=ke({show:!1,width:0,height:0,transform:"",list:[],lastTime:localStorage.getItem(Z)}),J=ae(!1),Bt=async()=>{console.log("初始化完成")};let $=null,ut=null;const bt=()=>{window.$("#flipbook");const ht=document.body.clientHeight*.8;et.height=ht,et.width=ht*(210/297)*2;const at=document.getElementById("flipbook");$=new Le.PageFlip(at,{width:et.width/2,height:et.height,showCover:!0,maxShadowOpacity:.3}),$.loadFromHTML(document.querySelectorAll(".page"))},Pt=()=>{const ht=document.querySelector(".bookWrap");if(ht){const at=ht.getBoundingClientRect(),B=E.rect.width/(at.width/2),a=E.rect.height/at.height,h=(at.width/2*(B-1)+E.rect.x-at.x-E.rect.width)/B,y=(at.height*(a-1)/2+E.rect.y-at.y)/a,x=`scale3d(${B}, ${a}, 1) translate(${h}px, ${y}px)`;ht.style.transform=et.transform=x,ht.style.transition="transform 0s",ze(()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{ht.style.transition="transform 1s",ht.style.transform="",et.show=!0,ut=setTimeout(()=>{},500),setTimeout(()=>{J.value=!0},1500)})})})}},nt=()=>{clearTimeout(ut);const ht=document.querySelector(".bookWrap");console.log("🚀 ~ pageFlip:",$),$.flip(0),ht&&(ht.style.transform=et.transform),O("close"),setTimeout(()=>{ht.style.transition="",ht.style.transform="",et.show=!1,et.list=[]},1e3)};Fe(async()=>{await Bt(),Wi("webViewOnResume",()=>{et.lastTime=localStorage.getItem(Z)})});const dt=()=>{var a;if(!((a=E.bookData)!=null&&a.lessonList))return;const ht=Math.floor((document.body.clientHeight*.8-40)/50);console.log("🚀 ~ step:",ht);const at=[];let B=[];for(let h=0;h=ht?(at.push([...B]),B=[{name:y.name}]):B.push({name:y.name});for(let x=0;x=ht?(at.push([...B]),B=[y.knowledgeList[x]]):B.push(y.knowledgeList[x])}B.length&&at.push(B),et.list=at};ji(()=>E.show,()=>{E.show&&(dt(),ze(()=>{bt(),ze(()=>{requestAnimationFrame(()=>{Pt()})})}))});const Et=ht=>{if(ht.id){if(!ht.containMaterial){Hi("暂无资源");return}localStorage.setItem(Z,ht.id);const at=en.stringify({id:ht.id,lessonCoursewareId:ht.lessonCoursewareId,lessonCoursewareDetailId:ht.lessonCoursewareDetailId,name:ht.name,tab:E.tab}),B=location.origin+location.pathname+"#/courseware-play?"+at;console.log("🚀 ~ url:",B),ui({api:"openWebView",content:{url:B,orientation:0,isHideTitle:!1,c_orientation:0}})}};return()=>H("div",{class:[Ut.book,et.show?"":Ut.bookHide]},[H("div",{class:Ut.back,onClick:nt},[H("img",{src:pi},null)]),H("div",{class:"bookWrap",style:{width:et.width+"px",height:et.height+"px"}},[!!et.list.length&&H("div",{id:"flipbook",class:[et.show&&"animated"]},[H("div",{class:"page coverImg","data-density":"hard"},[H("img",{style:"width: 100%; height: 100%; object-fit: cover;",src:E.bookData.coverImg},null)]),et.list.map(ht=>H("div",{class:"page"},[H("div",{class:Ut.wrap},[H("div",{class:Ut.wrapItem},[ht.map((at,B)=>H(Ue,null,[H("div",{class:[Ut.item,at.id&&Ut.des],onTouchstart:a=>{a.stopPropagation()},onClick:a=>{a.stopPropagation(),Et(at)}},[at.id?H("img",{id:B==1?"coursewareDetail-0":"",class:Ut.icon,src:Hn},null):null,H("div",{class:Ut.name,style:{lineHeight:"20Px"}},[at.name,et.lastTime===at.id&&H("span",{class:Ut.last},[Ot("上次观看")])])])]))])])])),et.list.length%2===1&&H("div",{class:"page","data-density":"hard"},[H("div",{class:Ut.wrap},[H("div",{class:Ut.wrapItem},null)])])])]),J.value?H(zn,null,null):null])}}),Vn=Ie({name:"courseware-list",emits:["close"],setup(E,{emit:O}){const Z=ke({box:{},show:!1,steps:[{ele:"",eleRect:{},img:me("courseware-list1.png"),handStyle:{top:"1.5rem",left:"3.5rem",transform:"rotate(-90deg)"},imgStyle:{top:".7rem",left:"5rem"},btnsStyle:{top:"3.5rem",left:"6.2rem"},boxStyle:{},eleRectPadding:{left:-4,top:-4,width:-8,height:-8}},{ele:"",img:me("courseware-list2.png"),handStyle:{top:"-.25rem",left:"1.38rem",transform:"rotate(-90deg)"},imgStyle:{top:"-1.2rem",left:"2.4rem"},btnsStyle:{top:"1.6rem",left:"3.6rem"},eleRectPadding:{left:4,top:4,width:8,height:8}},{ele:"",img:me("courseware-list3.png"),handStyle:{bottom:"-2.1rem",left:"0.66rem"},imgStyle:{top:"1.1rem",left:"-2rem"},btnsStyle:{top:"4.2rem",left:"-0.5rem"},eleRectPadding:{left:4,top:4,width:8,height:8}},{ele:"",img:me("courseware-list4.png"),handStyle:{top:".8rem",left:"1rem"},imgStyle:{top:"1.1rem",left:"-4.6rem"},btnsStyle:{top:"4rem",left:"-4.5rem","justify-content":"center",padding:0}}],step:0}),et=ae(!1),J=ae({});(async()=>{var nt;try{const dt=await ci({guideTag:"guideInfo"});dt.data?J.value=JSON.parse((nt=dt.data)==null?void 0:nt.guideValue)||null:J.value={},J.value&&J.value.courseware?et.value=!1:et.value=!0}catch(dt){console.log(dt)}})();const $=()=>{var dt,Et,_t,Ct;const nt=document.getElementById(`courseware-${Z.step}`);if(nt){const U=nt.getBoundingClientRect(),K=((dt=Z.steps[Z.step].eleRectPadding)==null?void 0:dt.left)||0,ht=((Et=Z.steps[Z.step].eleRectPadding)==null?void 0:Et.top)||0,at=((_t=Z.steps[Z.step].eleRectPadding)==null?void 0:_t.width)||0,B=((Ct=Z.steps[Z.step].eleRectPadding)==null?void 0:Ct.height)||0;Z.box={left:U.x-K+"px",top:U.y-ht+"px",width:U.width+at+"px",height:U.height+B+"px"}}else bt()};Fe(()=>{$(),window.addEventListener("resize",ut)});const ut=()=>{$()};li(()=>{window.removeEventListener("resize",ut)});const bt=()=>{if(Z.step>=3){Pt();return}Z.step=Z.step+1,$()},Pt=async()=>{J.value?J.value.courseware=!0:J.value={courseware:!0};try{const nt=await di({guideTag:"guideInfo",guideValue:JSON.stringify(J.value)})}catch(nt){console.log(nt)}et.value=!1};return()=>H(Ve,{teleport:"body",overlay:!1,closeOnClickOverlay:!1,class:["popup-custom",kt.guidePopup],show:et.value,"onUpdate:show":nt=>et.value=nt},{default:()=>[H("div",{class:kt.content,onClick:()=>bt()},[Z.step!=Z.steps.length-1&&H("div",{class:kt.backBtn,onClick:nt=>{nt.stopPropagation(),Pt()}},[Ot("跳过")]),H("div",{class:kt.box,style:{...Z.box,...Z.steps[Z.step].boxStyle},id:`modeType-${Z.step}`},[Z.steps.map((nt,dt)=>{var Et,_t;return H("div",{onClick:Ct=>Ct.stopPropagation(),class:kt.item,style:{display:dt===Z.step?"":"none",left:`${(Et=nt.eleRect)==null?void 0:Et.left}px`,top:`${(_t=nt.eleRect)==null?void 0:_t.top}px`}},[H("img",{class:kt.img,style:nt.imgStyle,src:nt.img},null),H("img",{class:kt.iconHead,style:nt.handStyle,src:me("indexDot.png")},null),H("div",{class:kt.btns,style:nt.btnsStyle},[Z.step+1==Z.steps.length?H(Ue,null,[H(ce,{class:[kt.btn],round:!0,type:"primary",onClick:()=>Pt()},{default:()=>[Ot("完成")]}),H(ce,{class:[kt.btn,kt.endBtn],round:!0,color:"transparent",style:{"border-color":"#fff"},type:"primary",onClick:()=>{Z.step=0,$()}},{default:()=>[Ot("再看一遍")]})]):H(ce,{class:kt.btn,round:!0,type:"primary",onClick:()=>bt()},{default:()=>[Ot("下一步 ("),Z.step+1,Ot("/"),Z.steps.length,Ot(")")]})])])})])])]})}});/*! jQuery v1.7 jquery.com | jquery.org/license */(function(E,O){function Z(t){return e.isWindow(t)?t:t.nodeType===9?t.defaultView||t.parentWindow:!1}function et(t){if(!je[t]){var i=j.body,n=e("<"+t+">").appendTo(i),s=n.css("display");n.remove(),(s==="none"||s==="")&&(Jt||(Jt=j.createElement("iframe"),Jt.frameBorder=Jt.width=Jt.height=0),i.appendChild(Jt),(!Te||!Jt.createElement)&&(Te=(Jt.contentWindow||Jt.contentDocument).document,Te.write((j.compatMode==="CSS1Compat"?"":"")+""),Te.close()),n=Te.createElement(t),Te.body.appendChild(n),s=e.css(n,"display"),i.removeChild(Jt)),je[t]=s}return je[t]}function J(t,i){var n={};return e.each(ni.concat.apply([],ni.slice(0,i)),function(){n[this]=t}),n}function Bt(){Ee=O}function $(){return setTimeout(Bt,0),Ee=e.now()}function ut(){try{return new E.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function bt(){try{return new E.XMLHttpRequest}catch(t){}}function Pt(t,i){t.dataFilter&&(i=t.dataFilter(i,t.dataType));var n=t.dataTypes,s={},l,u,d=n.length,p,w=n[0],S,b,P,A,N;for(l=1;l0?(n!=="border"&&e.each(l,function(){n||(s-=parseFloat(e.css(t,"padding"+this))||0),n==="margin"?s+=parseFloat(e.css(t,n+this))||0:s-=parseFloat(e.css(t,"border"+this+"Width"))||0}),s+"px"):(s=Pe(t,i,i),(s<0||s==null)&&(s=t.style[i]||0),s=parseFloat(s)||0,n&&e.each(l,function(){s+=parseFloat(e.css(t,"padding"+this))||0,n!=="padding"&&(s+=parseFloat(e.css(t,"border"+this+"Width"))||0),n==="margin"&&(s+=parseFloat(e.css(t,n+this))||0)}),s+"px")}function K(t,i){i.src?e.ajax({url:i.src,async:!1,dataType:"script"}):e.globalEval((i.text||i.textContent||i.innerHTML||"").replace(oe,"/*$0*/")),i.parentNode&&i.parentNode.removeChild(i)}function ht(t){var i=(t.nodeName||"").toLowerCase();i==="input"?at(t):i!=="script"&&typeof t.getElementsByTagName<"u"&&e.grep(t.getElementsByTagName("input"),at)}function at(t){(t.type==="checkbox"||t.type==="radio")&&(t.defaultChecked=t.checked)}function B(t){return typeof t.getElementsByTagName<"u"?t.getElementsByTagName("*"):typeof t.querySelectorAll<"u"?t.querySelectorAll("*"):[]}function a(t,i){var n;i.nodeType===1&&(i.clearAttributes&&i.clearAttributes(),i.mergeAttributes&&i.mergeAttributes(t),n=i.nodeName.toLowerCase(),n==="object"?i.outerHTML=t.outerHTML:n!=="input"||t.type!=="checkbox"&&t.type!=="radio"?n==="option"?i.selected=t.defaultSelected:(n==="input"||n==="textarea")&&(i.defaultValue=t.defaultValue):(t.checked&&(i.defaultChecked=i.checked=t.checked),i.value!==t.value&&(i.value=t.value)),i.removeAttribute(e.expando))}function h(t,i){if(i.nodeType===1&&e.hasData(t)){var n,s,l,u=e._data(t),d=e._data(i,u),p=u.events;if(p){delete d.handle,d.events={};for(n in p)for(s=0,l=p[n].length;s=0===n})}function F(t){return!t||!t.parentNode||t.parentNode.nodeType===11}function tt(){return!0}function st(){return!1}function yt(t,i,n){var s=i+"defer",l=i+"queue",u=i+"mark",d=e._data(t,s);d&&(n==="queue"||!e._data(t,l))&&(n==="mark"||!e._data(t,u))&&setTimeout(function(){!e._data(t,l)&&!e._data(t,u)&&(e.removeData(t,s,!0),d.fire())},0)}function xt(t){for(var i in t)if(!(i==="data"&&e.isEmptyObject(t[i]))&&i!=="toJSON")return!1;return!0}function At(t,i,n){if(n===O&&t.nodeType===1){var s="data-"+i.replace(V,"-$1").toLowerCase();if(n=t.getAttribute(s),typeof n=="string"){try{n=n==="true"?!0:n==="false"?!1:n==="null"?null:e.isNumeric(n)?parseFloat(n):_.test(n)?e.parseJSON(n):n}catch(l){}e.data(t,i,n)}else n=O}return n}function Xt(t){var i=f[t]={},n,s;for(t=t.split(/\s+/),n=0,s=t.length;n)[^>]*$|#([\w\-]*)$)/,d=/\S/,p=/^\s+/,w=/\s+$/,S=/\d/,b=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=/^[\],:{}\s]*$/,A=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,N=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,W=/(?:^|:|,)(?:\s*\[)+/g,Q=/(webkit)[ \/]([\w.]+)/,lt=/(opera)(?:.*version)?[ \/]([\w.]+)/,ot=/(msie) ([\w.]+)/,Lt=/(mozilla)(?:.*? rv:([\w.]+))?/,It=/-([a-z]|[0-9])/ig,it=/^-ms-/,c=function(g,I){return(I+"").toUpperCase()},m=r.userAgent,T,C,M,D=Object.prototype.toString,R=Object.prototype.hasOwnProperty,G=Array.prototype.push,z=Array.prototype.slice,Y=String.prototype.trim,Wt=Array.prototype.indexOf,Dt={};return i.fn=i.prototype={constructor:i,init:function(g,I,q){var L,ct,pt,gt;if(!g)return this;if(g.nodeType)return this.context=this[0]=g,this.length=1,this;if(g==="body"&&!I&&j.body)return this.context=j,this[0]=j.body,this.selector=g,this.length=1,this;if(typeof g=="string"){if(g.charAt(0)!=="<"||g.charAt(g.length-1)!==">"||g.length<3?L=u.exec(g):L=[null,g,null],L&&(L[1]||!I)){if(L[1])return I=I instanceof i?I[0]:I,gt=I?I.ownerDocument||I:j,pt=b.exec(g),pt?i.isPlainObject(I)?(g=[j.createElement(pt[1])],i.fn.attr.call(g,I,!0)):g=[gt.createElement(pt[1])]:(pt=i.buildFragment([L[1]],[gt]),g=(pt.cacheable?i.clone(pt.fragment):pt.fragment).childNodes),i.merge(this,g);if(ct=j.getElementById(L[2]),ct&&ct.parentNode){if(ct.id!==L[2])return q.find(g);this.length=1,this[0]=ct}return this.context=j,this.selector=g,this}return!I||I.jquery?(I||q).find(g):this.constructor(I).find(g)}return i.isFunction(g)?q.ready(g):(g.selector!==O&&(this.selector=g.selector,this.context=g.context),i.makeArray(g,this))},selector:"",jquery:"1.7",length:0,size:function(){return this.length},toArray:function(){return z.call(this,0)},get:function(g){return g==null?this.toArray():g<0?this[this.length+g]:this[g]},pushStack:function(g,I,q){var L=this.constructor();return i.isArray(g)?G.apply(L,g):i.merge(L,g),L.prevObject=this,L.context=this.context,I==="find"?L.selector=this.selector+(this.selector?" ":"")+q:I&&(L.selector=this.selector+"."+I+"("+q+")"),L},each:function(g,I){return i.each(this,g,I)},ready:function(g){return i.bindReady(),C.add(g),this},eq:function(g){return g===-1?this.slice(g):this.slice(g,+g+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(z.apply(this,arguments),"slice",z.call(arguments).join(","))},map:function(g){return this.pushStack(i.map(this,function(I,q){return g.call(I,q,I)}))},end:function(){return this.prevObject||this.constructor(null)},push:G,sort:[].sort,splice:[].splice},i.fn.init.prototype=i.fn,i.extend=i.fn.extend=function(){var g,I,q,L,ct,pt,gt=arguments[0]||{},jt=1,Yt=arguments.length,He=!1;for(typeof gt=="boolean"&&(He=gt,gt=arguments[1]||{},jt=2),typeof gt!="object"&&!i.isFunction(gt)&&(gt={}),Yt===jt&&(gt=this,--jt);jt0)return;C.fireWith(j,[i]),i.fn.trigger&&i(j).trigger("ready").unbind("ready")}},bindReady:function(){if(!C){if(C=i.Callbacks("once memory"),j.readyState==="complete")return setTimeout(i.ready,1);if(j.addEventListener)j.addEventListener("DOMContentLoaded",M,!1),E.addEventListener("load",i.ready,!1);else if(j.attachEvent){j.attachEvent("onreadystatechange",M),E.attachEvent("onload",i.ready);var g=!1;try{g=E.frameElement==null}catch(I){}j.documentElement.doScroll&&g&&t()}}},isFunction:function(g){return i.type(g)==="function"},isArray:Array.isArray||function(g){return i.type(g)==="array"},isWindow:function(g){return g&&typeof g=="object"&&"setInterval"in g},isNumeric:function(g){return g!=null&&S.test(g)&&!isNaN(g)},type:function(g){return g==null?String(g):Dt[D.call(g)]||"object"},isPlainObject:function(g){if(!g||i.type(g)!=="object"||g.nodeType||i.isWindow(g))return!1;try{if(g.constructor&&!R.call(g,"constructor")&&!R.call(g.constructor.prototype,"isPrototypeOf"))return!1}catch(q){return!1}var I;for(I in g);return I===O||R.call(g,I)},isEmptyObject:function(g){for(var I in g)return!1;return!0},error:function(g){throw g},parseJSON:function(g){if(typeof g!="string"||!g)return null;if(g=i.trim(g),E.JSON&&E.JSON.parse)return E.JSON.parse(g);if(P.test(g.replace(A,"@").replace(N,"]").replace(W,"")))return new Function("return "+g)();i.error("Invalid JSON: "+g)},parseXML:function(g){var I,q;try{E.DOMParser?(q=new DOMParser,I=q.parseFromString(g,"text/xml")):(I=new ActiveXObject("Microsoft.XMLDOM"),I.async="false",I.loadXML(g))}catch(L){I=O}return(!I||!I.documentElement||I.getElementsByTagName("parsererror").length)&&i.error("Invalid XML: "+g),I},noop:function(){},globalEval:function(g){g&&d.test(g)&&(E.execScript||function(I){E.eval.call(E,I)})(g)},camelCase:function(g){return g.replace(it,"ms-").replace(It,c)},nodeName:function(g,I){return g.nodeName&&g.nodeName.toUpperCase()===I.toUpperCase()},each:function(g,I,q){var L,ct=0,pt=g.length,gt=pt===O||i.isFunction(g);if(q)if(gt){for(L in g)if(I.apply(g[L],q)===!1)break}else for(;ct0&&g[0]&&g[jt-1]||jt===0||i.isArray(g));if(Yt)for(;gt1?v.call(arguments,0):P,w.notifyWith(S,d)}}function n(b){return function(P){s[b]=arguments.length>1?v.call(arguments,0):P,--p||w.resolveWith(w,s)}}var s=v.call(arguments,0),l=0,u=s.length,d=Array(u),p=u,w=u<=1&&t&&e.isFunction(t.promise)?t:e.Deferred(),S=w.promise();if(u>1){for(;l
a",n=t.getElementsByTagName("*"),s=t.getElementsByTagName("a")[0],!n||!n.length||!s)return{};l=j.createElement("select"),u=l.appendChild(j.createElement("option")),d=t.getElementsByTagName("input")[0],w={leadingWhitespace:t.firstChild.nodeType===3,tbody:!t.getElementsByTagName("tbody").length,htmlSerialize:!!t.getElementsByTagName("link").length,style:/top/.test(s.getAttribute("style")),hrefNormalized:s.getAttribute("href")==="/a",opacity:/^0.55/.test(s.style.opacity),cssFloat:!!s.style.cssFloat,unknownElems:!!t.getElementsByTagName("nav").length,checkOn:d.value==="on",optSelected:u.selected,getSetAttribute:t.className!=="t",enctype:!!j.createElement("form").enctype,submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},d.checked=!0,w.noCloneChecked=d.cloneNode(!0).checked,l.disabled=!0,w.optDisabled=!u.disabled;try{delete t.test}catch(Lt){w.deleteExpando=!1}!t.addEventListener&&t.attachEvent&&t.fireEvent&&(t.attachEvent("onclick",function(){w.noCloneEvent=!1}),t.cloneNode(!0).fireEvent("onclick")),d=j.createElement("input"),d.value="t",d.setAttribute("type","radio"),w.radioValue=d.value==="t",d.setAttribute("checked","checked"),t.appendChild(d),S=j.createDocumentFragment(),S.appendChild(t.lastChild),w.checkClone=S.cloneNode(!0).cloneNode(!0).lastChild.checked,t.innerHTML="",t.style.width=t.style.paddingLeft="1px",b=j.getElementsByTagName("body")[0],A=j.createElement(b?"div":"body"),N={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},b&&e.extend(N,{position:"absolute",left:"-999px",top:"-999px"});for(lt in N)A.style[lt]=N[lt];if(A.appendChild(t),P=b||i,P.insertBefore(A,P.firstChild),w.appendChecked=d.checked,w.boxModel=t.offsetWidth===2,"zoom"in t.style&&(t.style.display="inline",t.style.zoom=1,w.inlineBlockNeedsLayout=t.offsetWidth===2,t.style.display="",t.innerHTML="
",w.shrinkWrapBlocks=t.offsetWidth!==2),t.innerHTML="
t
",W=t.getElementsByTagName("td"),ot=W[0].offsetHeight===0,W[0].style.display="",W[1].style.display="none",w.reliableHiddenOffsets=ot&&W[0].offsetHeight===0,t.innerHTML="",j.defaultView&&j.defaultView.getComputedStyle&&(p=j.createElement("div"),p.style.width="0",p.style.marginRight="0",t.appendChild(p),w.reliableMarginRight=(parseInt((j.defaultView.getComputedStyle(p,null)||{marginRight:0}).marginRight,10)||0)===0),t.attachEvent)for(lt in{submit:1,change:1,focusin:1})Q="on"+lt,ot=Q in t,ot||(t.setAttribute(Q,"return;"),ot=typeof t[Q]=="function"),w[lt+"Bubbles"]=ot;return e(function(){var Lt,It,it,c,m,T=1,C="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",M="visibility:hidden;border:0;",D="style='"+C+"border:5px solid #000;padding:0;'",R="
";b=j.getElementsByTagName("body")[0],!b||(Lt=j.createElement("div"),Lt.style.cssText=M+"width:0;height:0;position:static;top:0;margin-top:"+T+"px",b.insertBefore(Lt,b.firstChild),A=j.createElement("div"),A.style.cssText=C+M,A.innerHTML=R,Lt.appendChild(A),It=A.firstChild,it=It.firstChild,c=It.nextSibling.firstChild.firstChild,m={doesNotAddBorder:it.offsetTop!==5,doesAddBorderForTableAndCells:c.offsetTop===5},it.style.position="fixed",it.style.top="20px",m.fixedPosition=it.offsetTop===20||it.offsetTop===15,it.style.position=it.style.top="",It.style.overflow="hidden",It.style.position="relative",m.subtractsBorderForOverflowNotVisible=it.offsetTop===-5,m.doesNotIncludeMarginInBodyOffset=b.offsetTop!==T,b.removeChild(Lt),A=Lt=null,e.extend(w,m))}),A.innerHTML="",P.removeChild(A),A=S=l=u=b=p=t=d=null,w}(),e.boxModel=e.support.boxModel;var _=/^(?:\{.*\}|\[.*\])$/,V=/([A-Z])/g;e.extend({cache:{},uuid:0,expando:"jQuery"+(e.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(t){return t=t.nodeType?e.cache[t[e.expando]]:t[e.expando],!!t&&!xt(t)},data:function(t,i,n,s){if(e.acceptData(t)){var l,u,d;e.expando;var p=typeof i=="string",w=t.nodeType,S=w?e.cache:t,b=w?t[e.expando]:t[e.expando]&&e.expando,P=i==="events";return(!b||!S[b]||!P&&!s&&!S[b].data)&&p&&n===O?void 0:(b||(w?t[e.expando]=b=++e.uuid:b=e.expando),S[b]||(S[b]={},w||(S[b].toJSON=e.noop)),(typeof i=="object"||typeof i=="function")&&(s?S[b]=e.extend(S[b],i):S[b].data=e.extend(S[b].data,i)),l=u=S[b],s||(u.data||(u.data={}),u=u.data),n!==O&&(u[e.camelCase(i)]=n),P&&!u[i]?l.events:(p?(d=u[i],d==null&&(d=u[e.camelCase(i)])):d=u,d))}},removeData:function(t,i,n){if(e.acceptData(t)){var s,l,u;e.expando;var d=t.nodeType,p=d?e.cache:t,w=d?t[e.expando]:e.expando;if(!p[w])return;if(i&&(s=n?p[w]:p[w].data,s)){for(e.isArray(i)?i=i:(i in s)?i=[i]:(i=e.camelCase(i),i in s?i=[i]:i=i.split(" ")),l=0,u=i.length;l"u"){if(this.length&&(u=e.data(this[0]),this[0].nodeType===1&&!e._data(this[0],"parsedAttrs"))){s=this[0].attributes;for(var d=0,p=s.length;d-1)return!0;return!1},val:function(t){var i,n,s,l=this[0];return arguments.length?(s=e.isFunction(t),this.each(function(u){var d=e(this),p;this.nodeType===1&&(s?p=t.call(this,u,d.val()):p=t,p==null?p="":typeof p=="number"?p+="":e.isArray(p)&&(p=e.map(p,function(w){return w==null?"":w+""})),i=e.valHooks[this.nodeName.toLowerCase()]||e.valHooks[this.type],(!i||!("set"in i)||i.set(this,p,"value")===O)&&(this.value=p))})):l?(i=e.valHooks[l.nodeName.toLowerCase()]||e.valHooks[l.type],i&&"get"in i&&(n=i.get(l,"value"))!==O?n:(n=l.value,typeof n=="string"?n.replace(ft,""):n==null?"":n)):O}}),e.extend({valHooks:{option:{get:function(t){var i=t.attributes.value;return!i||i.specified?t.value:t.text}},select:{get:function(t){var i,n,s,l,u=t.selectedIndex,d=[],p=t.options,w=t.type==="select-one";if(u<0)return null;for(n=w?u:0,s=w?u+1:p.length;n=0}),n.length||(t.selectedIndex=-1),n}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(t,i,n,s){var l,u,d,p=t.nodeType;return!t||p===3||p===8||p===2?O:s&&i in e.attrFn?e(t)[i](n):"getAttribute"in t?(d=p!==1||!e.isXMLDoc(t),d&&(i=i.toLowerCase(),u=e.attrHooks[i]||(zt.test(i)?Zt:Nt)),n!==O?n===null?(e.removeAttr(t,i),O):u&&"set"in u&&d&&(l=u.set(t,n,i))!==O?l:(t.setAttribute(i,""+n),n):u&&"get"in u&&d&&(l=u.get(t,i))!==null?l:(l=t.getAttribute(i),l===null?O:l)):e.prop(t,i,n)},removeAttr:function(t,i){var n,s,l,u,d=0;if(t.nodeType===1)for(s=(i||"").split(rt),u=s.length;d=0}})});var $t=/^(?:textarea|input|select)$/i,ye=/^([^\.]*)?(?:\.(.+))?$/,te=/\bhover(\.\S+)?/,ee=/^key/,ve=/^(?:mouse|contextmenu)|click/,Qt=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,we=function(t){var i=Qt.exec(t);return i&&(i[1]=(i[1]||"").toLowerCase(),i[3]=i[3]&&new RegExp("(?:^|\\s)"+i[3]+"(?:\\s|$)")),i},_e=function(t,i){return(!i[1]||t.nodeName.toLowerCase()===i[1])&&(!i[2]||t.id===i[2])&&(!i[3]||i[3].test(t.className))},Gt=function(t){return e.event.special.hover?t:t.replace(te,"mouseenter$1 mouseleave$1")};e.event={add:function(t,i,n,s,l){var u,d,p,w,S,b,P,A,N,W,Q;if(!(t.nodeType===3||t.nodeType===8||!i||!n||!(u=e._data(t)))){for(n.handler&&(N=n,n=N.handler),n.guid||(n.guid=e.guid++),p=u.events,p||(u.events=p={}),d=u.handle,d||(u.handle=d=function(lt){return typeof e<"u"&&(!lt||e.event.triggered!==lt.type)?e.event.dispatch.apply(d.elem,arguments):O},d.elem=t),i=Gt(i).split(" "),w=0;w=0&&(l=l.slice(0,-1),p=!0),l.indexOf(".")>=0&&(u=l.split("."),l=u.shift(),u.sort()),(!n||e.event.customEvent[l])&&!e.event.global[l])return;if(t=typeof t=="object"?t[e.expando]?t:new e.Event(l,t):new e.Event(l),t.type=l,t.isTrigger=!0,t.exclusive=p,t.namespace=u.join("."),t.namespace_re=t.namespace?new RegExp("(^|\\.)"+u.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,P=l.indexOf(":")<0?"on"+l:"",(s||!n)&&t.preventDefault(),!n){d=e.cache;for(w in d)d[w].events&&d[w].events[l]&&e.event.trigger(t,i,d[w].handle.elem,!0);return}if(t.result=O,t.target||(t.target=n),i=i!=null?e.makeArray(i):[],i.unshift(t),A=e.event.special[l]||{},A.trigger&&A.trigger.apply(n,i)===!1)return;if(W=[[n,A.bindType||l]],!s&&!A.noBubble&&!e.isWindow(n)){for(Q=A.delegateType||l,b=null,S=n.parentNode;S;S=S.parentNode)W.push([S,Q]),b=S;b&&b===n.ownerDocument&&W.push([b.defaultView||b.parentWindow||E,Q])}for(w=0;w=0:lt===O&&(lt=P[Q]=W.quick?_e(S,W.quick):e(S).is(Q)),lt&&N.push(W);N.length&&d.push({elem:S,matches:N})}for(i.length>n&&d.push({elem:this,matches:i.slice(n)}),p=0;p0?this.bind(i,n,s):this.trigger(i)},e.attrFn&&(e.attrFn[i]=!0),ee.test(i)&&(e.event.fixHooks[i]=e.event.keyHooks),ve.test(i)&&(e.event.fixHooks[i]=e.event.mouseHooks)}),function(){function t(c,m,T,C,M,D){for(var R=0,G=C.length;R0){Y=z;break}}z=z[c]}C[R]=Y}}}function i(c,m,T,C,M,D){for(var R=0,G=C.length;R+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,s="sizcache"+(Math.random()+"").replace(".",""),l=0,u=Object.prototype.toString,d=!1,p=!0,w=/\\/g,S=/\r\n/g,b=/\W/;[0,0].sort(function(){return p=!1,0});var P=function(c,m,T,C){T=T||[],m=m||j;var M=m;if(m.nodeType!==1&&m.nodeType!==9)return[];if(!c||typeof c!="string")return T;var D,R,G,z,Y,Wt,Dt,g,I=!0,q=P.isXML(m),L=[],ct=c;do if(n.exec(""),D=n.exec(ct),D&&(ct=D[3],L.push(D[1]),D[2])){z=D[3];break}while(D);if(L.length>1&&W.exec(c))if(L.length===2&&N.relative[L[0]])R=it(L[0]+L[1],m,C);else for(R=N.relative[L[0]]?[m]:P(L.shift(),m);L.length;)c=L.shift(),N.relative[c]&&(c+=L.shift()),R=it(c,R,C);else if(!C&&L.length>1&&m.nodeType===9&&!q&&N.match.ID.test(L[0])&&!N.match.ID.test(L[L.length-1])&&(Y=P.find(L.shift(),m,q),m=Y.expr?P.filter(Y.expr,Y.set)[0]:Y.set[0]),m)for(Y=C?{expr:L.pop(),set:ot(C)}:P.find(L.pop(),L.length===1&&(L[0]==="~"||L[0]==="+")&&m.parentNode?m.parentNode:m,q),R=Y.expr?P.filter(Y.expr,Y.set):Y.set,L.length>0?G=ot(R):I=!1;L.length;)Wt=L.pop(),Dt=Wt,N.relative[Wt]?Dt=L.pop():Wt="",Dt==null&&(Dt=m),N.relative[Wt](G,Dt,q);else G=L=[];if(G||(G=R),G||P.error(Wt||c),u.call(G)==="[object Array]")if(!I)T.push.apply(T,G);else if(m&&m.nodeType===1)for(g=0;G[g]!=null;g++)G[g]&&(G[g]===!0||G[g].nodeType===1&&P.contains(m,G[g]))&&T.push(R[g]);else for(g=0;G[g]!=null;g++)G[g]&&G[g].nodeType===1&&T.push(R[g]);else ot(G,T);return z&&(P(z,M,T,C),P.uniqueSort(T)),T};P.uniqueSort=function(c){if(Lt&&(d=p,c.sort(Lt),d))for(var m=1;m0},P.find=function(c,m,T){var C,M,D,R,G,z;if(!c)return[];for(M=0,D=N.order.length;M":function(c,m){var T,C=typeof m=="string",M=0,D=c.length;if(C&&!b.test(m)){for(m=m.toLowerCase();M=0)?T||C.push(G):T&&(m[R]=!1));return!1},ID:function(c){return c[1].replace(w,"")},TAG:function(c,m){return c[1].replace(w,"").toLowerCase()},CHILD:function(c){if(c[1]==="nth"){c[2]||P.error(c[0]),c[2]=c[2].replace(/^\+|\s*/g,"");var m=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(c[2]==="even"&&"2n"||c[2]==="odd"&&"2n+1"||!/\D/.test(c[2])&&"0n+"+c[2]||c[2]);c[2]=m[1]+(m[2]||1)-0,c[3]=m[3]-0}else c[2]&&P.error(c[0]);return c[0]=l++,c},ATTR:function(c,m,T,C,M,D){var R=c[1]=c[1].replace(w,"");return!D&&N.attrMap[R]&&(c[1]=N.attrMap[R]),c[4]=(c[4]||c[5]||"").replace(w,""),c[2]==="~="&&(c[4]=" "+c[4]+" "),c},PSEUDO:function(c,m,T,C,M){if(c[1]==="not")if((n.exec(c[3])||"").length>1||/^\w/.test(c[3]))c[3]=P(c[3],null,null,m);else{var D=P.filter(c[3],m,T,!0^M);return T||C.push.apply(C,D),!1}else if(N.match.POS.test(c[0])||N.match.CHILD.test(c[0]))return!0;return c},POS:function(c){return c.unshift(!0),c}},filters:{enabled:function(c){return c.disabled===!1&&c.type!=="hidden"},disabled:function(c){return c.disabled===!0},checked:function(c){return c.checked===!0},selected:function(c){return c.parentNode&&c.parentNode.selectedIndex,c.selected===!0},parent:function(c){return!!c.firstChild},empty:function(c){return!c.firstChild},has:function(c,m,T){return!!P(T[3],c).length},header:function(c){return/h\d/i.test(c.nodeName)},text:function(c){var m=c.getAttribute("type"),T=c.type;return c.nodeName.toLowerCase()==="input"&&T==="text"&&(m===T||m===null)},radio:function(c){return c.nodeName.toLowerCase()==="input"&&c.type==="radio"},checkbox:function(c){return c.nodeName.toLowerCase()==="input"&&c.type==="checkbox"},file:function(c){return c.nodeName.toLowerCase()==="input"&&c.type==="file"},password:function(c){return c.nodeName.toLowerCase()==="input"&&c.type==="password"},submit:function(c){var m=c.nodeName.toLowerCase();return(m==="input"||m==="button")&&c.type==="submit"},image:function(c){return c.nodeName.toLowerCase()==="input"&&c.type==="image"},reset:function(c){var m=c.nodeName.toLowerCase();return(m==="input"||m==="button")&&c.type==="reset"},button:function(c){var m=c.nodeName.toLowerCase();return m==="input"&&c.type==="button"||m==="button"},input:function(c){return/input|select|textarea|button/i.test(c.nodeName)},focus:function(c){return c===c.ownerDocument.activeElement}},setFilters:{first:function(c,m){return m===0},last:function(c,m,T,C){return m===C.length-1},even:function(c,m){return m%2===0},odd:function(c,m){return m%2===1},lt:function(c,m,T){return mT[3]-0},nth:function(c,m,T){return T[3]-0===m},eq:function(c,m,T){return T[3]-0===m}},filter:{PSEUDO:function(c,m,T,C){var M=m[1],D=N.filters[M];if(D)return D(c,T,m,C);if(M==="contains")return(c.textContent||c.innerText||A([c])||"").indexOf(m[3])>=0;if(M==="not"){for(var R=m[3],G=0,z=R.length;G=0}},ID:function(c,m){return c.nodeType===1&&c.getAttribute("id")===m},TAG:function(c,m){return m==="*"&&c.nodeType===1||!!c.nodeName&&c.nodeName.toLowerCase()===m},CLASS:function(c,m){return(" "+(c.className||c.getAttribute("class"))+" ").indexOf(m)>-1},ATTR:function(c,m){var T=m[1],C=P.attr?P.attr(c,T):N.attrHandle[T]?N.attrHandle[T](c):c[T]!=null?c[T]:c.getAttribute(T),M=C+"",D=m[2],R=m[4];return C==null?D==="!=":!D&&P.attr?C!=null:D==="="?M===R:D==="*="?M.indexOf(R)>=0:D==="~="?(" "+M+" ").indexOf(R)>=0:R?D==="!="?M!==R:D==="^="?M.indexOf(R)===0:D==="$="?M.substr(M.length-R.length)===R:D==="|="?M===R||M.substr(0,R.length+1)===R+"-":!1:M&&C!==!1},POS:function(c,m,T,C){var M=m[2],D=N.setFilters[M];if(D)return D(c,T,m,C)}}},W=N.match.POS,Q=function(c,m){return"\\"+(m-0+1)};for(var lt in N.match)N.match[lt]=new RegExp(N.match[lt].source+/(?![^\[]*\])(?![^\(]*\))/.source),N.leftMatch[lt]=new RegExp(/(^(?:.|\r|\n)*?)/.source+N.match[lt].source.replace(/\\(\d+)/g,Q));var ot=function(c,m){return c=Array.prototype.slice.call(c,0),m?(m.push.apply(m,c),m):c};try{Array.prototype.slice.call(j.documentElement.childNodes,0)[0].nodeType}catch(c){ot=function(m,T){var C=0,M=T||[];if(u.call(m)==="[object Array]")Array.prototype.push.apply(M,m);else if(typeof m.length=="number")for(var D=m.length;C",T.insertBefore(c,T.firstChild),j.getElementById(m)&&(N.find.ID=function(C,M,D){if(typeof M.getElementById<"u"&&!D){var R=M.getElementById(C[1]);return R?R.id===C[1]||typeof R.getAttributeNode<"u"&&R.getAttributeNode("id").nodeValue===C[1]?[R]:O:[]}},N.filter.ID=function(C,M){var D=typeof C.getAttributeNode<"u"&&C.getAttributeNode("id");return C.nodeType===1&&D&&D.nodeValue===M}),T.removeChild(c),T=c=null}(),function(){var c=j.createElement("div");c.appendChild(j.createComment("")),c.getElementsByTagName("*").length>0&&(N.find.TAG=function(m,T){var C=T.getElementsByTagName(m[1]);if(m[1]==="*"){for(var M=[],D=0;C[D];D++)C[D].nodeType===1&&M.push(C[D]);C=M}return C}),c.innerHTML="",c.firstChild&&typeof c.firstChild.getAttribute<"u"&&c.firstChild.getAttribute("href")!=="#"&&(N.attrHandle.href=function(m){return m.getAttribute("href",2)}),c=null}(),j.querySelectorAll&&function(){var c=P,m=j.createElement("div"),T="__sizzle__";if(m.innerHTML="

",!m.querySelectorAll||m.querySelectorAll(".TEST").length!==0){P=function(M,D,R,G){if(D=D||j,!G&&!P.isXML(D)){var z=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(M);if(z&&(D.nodeType===1||D.nodeType===9)){if(z[1])return ot(D.getElementsByTagName(M),R);if(z[2]&&N.find.CLASS&&D.getElementsByClassName)return ot(D.getElementsByClassName(z[2]),R)}if(D.nodeType===9){if(M==="body"&&D.body)return ot([D.body],R);if(z&&z[3]){var Y=D.getElementById(z[3]);if(!Y||!Y.parentNode)return ot([],R);if(Y.id===z[3])return ot([Y],R)}try{return ot(D.querySelectorAll(M),R)}catch(L){}}else if(D.nodeType===1&&D.nodeName.toLowerCase()!=="object"){var Wt=D,Dt=D.getAttribute("id"),g=Dt||T,I=D.parentNode,q=/^\s*[+~]/.test(M);Dt?g=g.replace(/'/g,"\\$&"):D.setAttribute("id",g),q&&I&&(D=D.parentNode);try{if(!q||I)return ot(D.querySelectorAll("[id='"+g+"'] "+M),R)}catch(L){}finally{Dt||Wt.removeAttribute("id")}}}return c(M,D,R,G)};for(var C in c)P[C]=c[C];m=null}}(),function(){var c=j.documentElement,m=c.matchesSelector||c.mozMatchesSelector||c.webkitMatchesSelector||c.msMatchesSelector;if(m){var T=!m.call(j.createElement("div"),"div"),C=!1;try{m.call(j.documentElement,"[test!='']:sizzle")}catch(M){C=!0}P.matchesSelector=function(M,D){if(D=D.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']"),!P.isXML(M))try{if(C||!N.match.PSEUDO.test(D)&&!/!=/.test(D)){var R=m.call(M,D);if(R||!T||M.document&&M.document.nodeType!==11)return R}}catch(G){}return P(D,null,null,[M]).length>0}}}(),function(){var c=j.createElement("div");if(c.innerHTML="
",c.getElementsByClassName&&c.getElementsByClassName("e").length!==0){if(c.lastChild.className="e",c.getElementsByClassName("e").length===1)return;N.order.splice(1,0,"CLASS"),N.find.CLASS=function(m,T,C){if(typeof T.getElementsByClassName<"u"&&!C)return T.getElementsByClassName(m[1])},c=null}}(),j.documentElement.contains?P.contains=function(c,m){return c!==m&&(c.contains?c.contains(m):!0)}:j.documentElement.compareDocumentPosition?P.contains=function(c,m){return!!(c.compareDocumentPosition(m)&16)}:P.contains=function(){return!1},P.isXML=function(c){var m=(c?c.ownerDocument||c:0).documentElement;return m?m.nodeName!=="HTML":!1};var it=function(c,m,T){for(var C,M=[],D="",R=m.nodeType?[m]:m;C=N.match.PSEUDO.exec(c);)D+=C[0],c=c.replace(N.match.PSEUDO,"");c=N.relative[c]?c+"*":c;for(var G=0,z=R.length;G0){for(d=u;d=0:e.filter(t,this).length>0:this.filter(t).length>0)},closest:function(t,i){var n=[],s,l,u=this[0];if(e.isArray(t)){for(var d=1;u&&u.ownerDocument&&u!==i;){for(s=0;s-1:e.find.matchesSelector(u,t)){n.push(u);break}if(u=u.parentNode,!u||!u.ownerDocument||u===i||u.nodeType===11)break}return n=n.length>1?e.unique(n):n,this.pushStack(n,"closest",t)},index:function(t){return t?typeof t=="string"?e.inArray(this[0],e(t)):e.inArray(t.jquery?t[0]:t,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(t,i){var n=typeof t=="string"?e(t,i):e.makeArray(t&&t.nodeType?[t]:t),s=e.merge(this.get(),n);return this.pushStack(F(n[0])||F(s[0])?s:e.unique(s))},andSelf:function(){return this.add(this.prevObject)}}),e.each({parent:function(t){var i=t.parentNode;return i&&i.nodeType!==11?i:null},parents:function(t){return e.dir(t,"parentNode")},parentsUntil:function(t,i,n){return e.dir(t,"parentNode",n)},next:function(t){return e.nth(t,2,"nextSibling")},prev:function(t){return e.nth(t,2,"previousSibling")},nextAll:function(t){return e.dir(t,"nextSibling")},prevAll:function(t){return e.dir(t,"previousSibling")},nextUntil:function(t,i,n){return e.dir(t,"nextSibling",n)},prevUntil:function(t,i,n){return e.dir(t,"previousSibling",n)},siblings:function(t){return e.sibling(t.parentNode.firstChild,t)},children:function(t){return e.sibling(t.firstChild)},contents:function(t){return e.nodeName(t,"iframe")?t.contentDocument||t.contentWindow.document:e.makeArray(t.childNodes)}},function(t,i){e.fn[t]=function(n,s){var l=e.map(this,i,n),u=Ae.call(arguments);return Ce.test(t)||(s=n),s&&typeof s=="string"&&(l=e.filter(s,l)),l=this.length>1&&!ne[t]?e.unique(l):l,(this.length>1||Oe.test(s))&&Mt.test(t)&&(l=l.reverse()),this.pushStack(l,t,u.join(","))}}),e.extend({filter:function(t,i,n){return n&&(t=":not("+t+")"),i.length===1?e.find.matchesSelector(i[0],t)?[i[0]]:[]:e.find.matches(t,i)},dir:function(t,i,n){for(var s=[],l=t[i];l&&l.nodeType!==9&&(n===O||l.nodeType!==1||!e(l).is(n));)l.nodeType===1&&s.push(l),l=l[i];return s},nth:function(t,i,n,s){i=i||1;for(var l=0;t&&!(t.nodeType===1&&++l===i);t=t[n]);return t},sibling:function(t,i){for(var n=[];t;t=t.nextSibling)t.nodeType===1&&t!==i&&n.push(t);return n}});var le="abbr article aside audio canvas datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",be=/ jQuery\d+="(?:\d+|null)"/g,Tt=/^\s+/,Ht=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,vt=/<([\w:]+)/,Vt=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},fi=x(j);Rt.optgroup=Rt.option,Rt.tbody=Rt.tfoot=Rt.colgroup=Rt.caption=Rt.thead,Rt.th=Rt.td,e.support.htmlSerialize||(Rt._default=[1,"div
","
"]),e.fn.extend({text:function(t){return e.isFunction(t)?this.each(function(i){var n=e(this);n.text(t.call(this,i,n.text()))}):typeof t!="object"&&t!==O?this.empty().append((this[0]&&this[0].ownerDocument||j).createTextNode(t)):e.text(this)},wrapAll:function(t){if(e.isFunction(t))return this.each(function(n){e(this).wrapAll(t.call(this,n))});if(this[0]){var i=e(t,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&i.insertBefore(this[0]),i.map(function(){for(var n=this;n.firstChild&&n.firstChild.nodeType===1;)n=n.firstChild;return n}).append(this)}return this},wrapInner:function(t){return e.isFunction(t)?this.each(function(i){e(this).wrapInner(t.call(this,i))}):this.each(function(){var i=e(this),n=i.contents();n.length?n.wrapAll(t):i.append(t)})},wrap:function(t){return this.each(function(){e(this).wrapAll(t)})},unwrap:function(){return this.parent().each(function(){e.nodeName(this,"body")||e(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(t){this.nodeType===1&&this.appendChild(t)})},prepend:function(){return this.domManip(arguments,!0,function(t){this.nodeType===1&&this.insertBefore(t,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(i){this.parentNode.insertBefore(i,this)});if(arguments.length){var t=e(arguments[0]);return t.push.apply(t,this.toArray()),this.pushStack(t,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(i){this.parentNode.insertBefore(i,this.nextSibling)});if(arguments.length){var t=this.pushStack(this,"after",arguments);return t.push.apply(t,e(arguments[0]).toArray()),t}},remove:function(t,i){for(var n=0,s;(s=this[n])!=null;n++)(!t||e.filter(t,[s]).length)&&(!i&&s.nodeType===1&&(e.cleanData(s.getElementsByTagName("*")),e.cleanData([s])),s.parentNode&&s.parentNode.removeChild(s));return this},empty:function(){for(var t=0,i;(i=this[t])!=null;t++)for(i.nodeType===1&&e.cleanData(i.getElementsByTagName("*"));i.firstChild;)i.removeChild(i.firstChild);return this},clone:function(t,i){return t=t==null?!1:t,i=i==null?t:i,this.map(function(){return e.clone(this,t,i)})},html:function(t){if(t===O)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(be,""):null;if(typeof t=="string"&&!he.test(t)&&(e.support.leadingWhitespace||!Tt.test(t))&&!Rt[(vt.exec(t)||["",""])[1].toLowerCase()]){t=t.replace(Ht,"<$1>");try{for(var i=0,n=this.length;i1&&S0?this.clone(!0):this).get();e(l[d])[i](w),s=s.concat(w)}return this.pushStack(s,t,l.selector)}}),e.extend({clone:function(t,i,n){var s=t.cloneNode(!0),l,u,d;if((!e.support.noCloneEvent||!e.support.noCloneChecked)&&(t.nodeType===1||t.nodeType===11)&&!e.isXMLDoc(t))for(a(t,s),l=B(t),u=B(s),d=0;l[d];++d)u[d]&&a(l[d],u[d]);if(i&&(h(t,s),n))for(l=B(t),u=B(s),d=0;l[d];++d)h(l[d],u[d]);return l=u=null,s},clean:function(t,i,n,s){var l;i=i||j,typeof i.createElement>"u"&&(i=i.ownerDocument||i[0]&&i[0].ownerDocument||j);for(var u=[],d,p=0,w;(w=t[p])!=null;p++)if(typeof w=="number"&&(w+=""),!!w){if(typeof w=="string")if(!se.test(w))w=i.createTextNode(w);else{w=w.replace(Ht,"<$1>");var S=(vt.exec(w)||["",""])[1].toLowerCase(),b=Rt[S]||Rt._default,P=b[0],A=i.createElement("div");for(i===j?fi.appendChild(A):x(i).appendChild(A),A.innerHTML=b[1]+w+b[2];P--;)A=A.lastChild;if(!e.support.tbody){var N=Vt.test(w),W=S==="table"&&!N?A.firstChild&&A.firstChild.childNodes:b[1]===""&&!N?A.childNodes:[];for(d=W.length-1;d>=0;--d)e.nodeName(W[d],"tbody")&&!W[d].childNodes.length&&W[d].parentNode.removeChild(W[d])}!e.support.leadingWhitespace&&Tt.test(w)&&A.insertBefore(i.createTextNode(Tt.exec(w)[0]),A.firstChild),w=A.childNodes}var Q;if(!e.support.appendChecked)if(w[0]&&typeof(Q=w.length)=="number")for(d=0;d=0)return s+"px"}}}),e.support.opacity||(e.cssHooks.opacity={get:function(t,i){return gi.test((i&&t.currentStyle?t.currentStyle.filter:t.style.filter)||"")?parseFloat(RegExp.$1)/100+"":i?"1":""},set:function(t,i){var n=t.style,s=t.currentStyle,l=e.isNumeric(i)?"alpha(opacity="+i*100+")":"",u=s&&s.filter||n.filter||"";n.zoom=1,!(i>=1&&e.trim(u.replace(Re,""))===""&&(n.removeAttribute("filter"),s&&!s.filter))&&(n.filter=Re.test(u)?u.replace(Re,l):u+" "+l)}}),e(function(){e.support.reliableMarginRight||(e.cssHooks.marginRight={get:function(t,i){var n;return e.swap(t,{display:"inline-block"},function(){i?n=Pe(t,"margin-right","marginRight"):n=t.style.marginRight}),n}})}),j.defaultView&&j.defaultView.getComputedStyle&&($e=function(t,i){var n,s,l;return i=i.replace(mi,"-$1").toLowerCase(),(s=t.ownerDocument.defaultView)?((l=s.getComputedStyle(t,null))&&(n=l.getPropertyValue(i),n===""&&!e.contains(t.ownerDocument.documentElement,t)&&(n=e.style(t,i))),n):O}),j.documentElement.currentStyle&&(Ye=function(t,i){var n,s,l,u=t.currentStyle&&t.currentStyle[i],d=t.style;return u===null&&d&&(l=d[i])&&(u=l),!Xe.test(u)&&yi.test(u)&&(n=d.left,s=t.runtimeStyle&&t.runtimeStyle.left,s&&(t.runtimeStyle.left=t.currentStyle.left),d.left=i==="fontSize"?"1em":u||0,u=d.pixelLeft+"px",d.left=n,s&&(t.runtimeStyle.left=s)),u===""?"auto":u}),Pe=$e||Ye,e.expr&&e.expr.filters&&(e.expr.filters.hidden=function(t){var i=t.offsetWidth,n=t.offsetHeight;return i===0&&n===0||!e.support.reliableHiddenOffsets&&(t.style&&t.style.display||e.css(t,"display"))==="none"},e.expr.filters.visible=function(t){return!e.expr.filters.hidden(t)});var Pi=/%20/g,Si=/\[\]$/,Ze=/\r?\n/g,Ti=/#.*$/,Ci=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,Ai=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,ki=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,_i=/^(?:GET|HEAD)$/,Mi=/^\/\//,Ke=/\?/,Di=/)<[^<]*)*<\/script>/gi,Ei=/^(?:select|textarea)/i,Qe=/\s+/,Ni=/([?&])_=[^&]*/,Je=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,ti=e.fn.load,Be={},ei={},fe,ge,ii=["*/"]+["*"];try{fe=o.href}catch(t){fe=j.createElement("a"),fe.href="",fe=fe.href}ge=Je.exec(fe.toLowerCase())||[],e.fn.extend({load:function(t,i,n){if(typeof t!="string"&&ti)return ti.apply(this,arguments);if(!this.length)return this;var s=t.indexOf(" ");if(s>=0){var l=t.slice(s,t.length);t=t.slice(0,s)}var u="GET";i&&(e.isFunction(i)?(n=i,i=O):typeof i=="object"&&(i=e.param(i,e.ajaxSettings.traditional),u="POST"));var d=this;return e.ajax({url:t,type:u,dataType:"html",data:i,complete:function(p,w,S){S=p.responseText,p.isResolved()&&(p.done(function(b){S=b}),d.html(l?e("
").append(S.replace(Di,"")).find(l):S)),n&&d.each(n,[S,w,p])}}),this},serialize:function(){return e.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?e.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||Ei.test(this.nodeName)||Ai.test(this.type))}).map(function(t,i){var n=e(this).val();return n==null?null:e.isArray(n)?e.map(n,function(s,l){return{name:i.name,value:s.replace(Ze,`\r `)}}):{name:i.name,value:n.replace(Ze,`\r `)}}).get()}}),e.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(t,i){e.fn[i]=function(n){return this.bind(i,n)}}),e.each(["get","post"],function(t,i){e[i]=function(n,s,l,u){return e.isFunction(s)&&(u=u||l,l=s,s=O),e.ajax({type:i,url:n,data:s,success:l,dataType:u})}}),e.extend({getScript:function(t,i){return e.get(t,O,i,"script")},getJSON:function(t,i,n){return e.get(t,i,n,"json")},ajaxSetup:function(t,i){return i?Et(t,e.ajaxSettings):(i=t,t=e.ajaxSettings),Et(t,i),t},ajaxSettings:{url:fe,isLocal:ki.test(ge[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":ii},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":E.String,"text html":!0,"text json":e.parseJSON,"text xml":e.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:Ct(Be),ajaxTransport:Ct(ei),ajax:function(t,i){function n(T,C,M,D){if(ot!==2){ot=2,Q&&clearTimeout(Q),W=O,A=D||"",it.readyState=T>0?4:0;var R,G,z,Y=C,Wt=M?nt(s,it,M):O,Dt,g;if(T>=200&&T<300||T===304)if(s.ifModified&&((Dt=it.getResponseHeader("Last-Modified"))&&(e.lastModified[S]=Dt),(g=it.getResponseHeader("Etag"))&&(e.etag[S]=g)),T===304)Y="notmodified",R=!0;else try{G=Pt(s,Wt),Y="success",R=!0}catch(I){Y="parsererror",z=I}else z=Y,(!Y||T)&&(Y="error",T<0&&(T=0));it.status=T,it.statusText=""+(C||Y),R?d.resolveWith(l,[G,Y,it]):d.rejectWith(l,[it,Y,z]),it.statusCode(w),w=O,Lt&&u.trigger("ajax"+(R?"Success":"Error"),[it,s,R?G:z]),p.fireWith(l,[it,Y]),Lt&&(u.trigger("ajaxComplete",[it,s]),--e.active||e.event.trigger("ajaxStop"))}}typeof t=="object"&&(i=t,t=O),i=i||{};var s=e.ajaxSetup({},i),l=s.context||s,u=l!==s&&(l.nodeType||l instanceof e)?e(l):e.event,d=e.Deferred(),p=e.Callbacks("once memory"),w=s.statusCode||{},S,b={},P={},A,N,W,Q,lt,ot=0,Lt,It,it={readyState:0,setRequestHeader:function(T,C){if(!ot){var M=T.toLowerCase();T=P[M]=P[M]||T,b[T]=C}return this},getAllResponseHeaders:function(){return ot===2?A:null},getResponseHeader:function(T){var C;if(ot===2){if(!N)for(N={};C=Ci.exec(A);)N[C[1].toLowerCase()]=C[2];C=N[T.toLowerCase()]}return C===O?null:C},overrideMimeType:function(T){return ot||(s.mimeType=T),this},abort:function(T){return T=T||"abort",W&&W.abort(T),n(0,T),this}};if(d.promise(it),it.success=it.done,it.error=it.fail,it.complete=p.add,it.statusCode=function(T){if(T){var C;if(ot<2)for(C in T)w[C]=[w[C],T[C]];else C=T[it.status],it.then(C,C)}return this},s.url=((t||s.url)+"").replace(Ti,"").replace(Mi,ge[1]+"//"),s.dataTypes=e.trim(s.dataType||"*").toLowerCase().split(Qe),s.crossDomain==null&&(lt=Je.exec(s.url.toLowerCase()),s.crossDomain=!(!lt||lt[1]==ge[1]&<[2]==ge[2]&&(lt[3]||(lt[1]==="http:"?80:443))==(ge[3]||(ge[1]==="http:"?80:443)))),s.data&&s.processData&&typeof s.data!="string"&&(s.data=e.param(s.data,s.traditional)),_t(Be,s,i,it),ot===2)return!1;if(Lt=s.global,s.type=s.type.toUpperCase(),s.hasContent=!_i.test(s.type),Lt&&e.active++===0&&e.event.trigger("ajaxStart"),!s.hasContent&&(s.data&&(s.url+=(Ke.test(s.url)?"&":"?")+s.data,delete s.data),S=s.url,s.cache===!1)){var c=e.now(),m=s.url.replace(Ni,"$1_="+c);s.url=m+(m===s.url?(Ke.test(s.url)?"&":"?")+"_="+c:"")}(s.data&&s.hasContent&&s.contentType!==!1||i.contentType)&&it.setRequestHeader("Content-Type",s.contentType),s.ifModified&&(S=S||s.url,e.lastModified[S]&&it.setRequestHeader("If-Modified-Since",e.lastModified[S]),e.etag[S]&&it.setRequestHeader("If-None-Match",e.etag[S])),it.setRequestHeader("Accept",s.dataTypes[0]&&s.accepts[s.dataTypes[0]]?s.accepts[s.dataTypes[0]]+(s.dataTypes[0]!=="*"?", "+ii+"; q=0.01":""):s.accepts["*"]);for(It in s.headers)it.setRequestHeader(It,s.headers[It]);if(s.beforeSend&&(s.beforeSend.call(l,it,s)===!1||ot===2))return it.abort(),!1;for(It in{success:1,error:1,complete:1})it[It](s[It]);if(W=_t(ei,s,i,it),!W)n(-1,"No Transport");else{it.readyState=1,Lt&&u.trigger("ajaxSend",[it,s]),s.async&&s.timeout>0&&(Q=setTimeout(function(){it.abort("timeout")},s.timeout));try{ot=1,W.send(b,n)}catch(T){ot<2?n(-1,T):e.error(T)}}return it},param:function(t,i){var n=[],s=function(u,d){d=e.isFunction(d)?d():d,n[n.length]=encodeURIComponent(u)+"="+encodeURIComponent(d)};if(i===O&&(i=e.ajaxSettings.traditional),e.isArray(t)||t.jquery&&!e.isPlainObject(t))e.each(t,function(){s(this.name,this.value)});else for(var l in t)dt(l,t[l],i,s);return n.join("&").replace(Pi,"+")}}),e.extend({active:0,lastModified:{},etag:{}});var Li=e.now(),Me=/(\=)\?(&|$)|\?\?/i;e.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return e.expando+"_"+Li++}}),e.ajaxPrefilter("json jsonp",function(t,i,n){var s=t.contentType==="application/x-www-form-urlencoded"&&typeof t.data=="string";if(t.dataTypes[0]==="jsonp"||t.jsonp!==!1&&(Me.test(t.url)||s&&Me.test(t.data))){var l,u=t.jsonpCallback=e.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,d=E[u],p=t.url,w=t.data,S="$1"+u+"$2";return t.jsonp!==!1&&(p=p.replace(Me,S),t.url===p&&(s&&(w=w.replace(Me,S)),t.data===w&&(p+=(/\?/.test(p)?"&":"?")+t.jsonp+"="+u))),t.url=p,t.data=w,E[u]=function(b){l=[b]},n.always(function(){E[u]=d,l&&e.isFunction(d)&&E[u](l[0])}),t.converters["script json"]=function(){return l||e.error(u+" was not called"),l[0]},t.dataTypes[0]="json","script"}}),e.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(t){return e.globalEval(t),t}}}),e.ajaxPrefilter("script",function(t){t.cache===O&&(t.cache=!1),t.crossDomain&&(t.type="GET",t.global=!1)}),e.ajaxTransport("script",function(t){if(t.crossDomain){var i,n=j.head||j.getElementsByTagName("head")[0]||j.documentElement;return{send:function(s,l){i=j.createElement("script"),i.async="async",t.scriptCharset&&(i.charset=t.scriptCharset),i.src=t.url,i.onload=i.onreadystatechange=function(u,d){(d||!i.readyState||/loaded|complete/.test(i.readyState))&&(i.onload=i.onreadystatechange=null,n&&i.parentNode&&n.removeChild(i),i=O,d||l(200,"success"))},n.insertBefore(i,n.firstChild)},abort:function(){i&&i.onload(0,1)}}}});var We=E.ActiveXObject?function(){for(var t in Se)Se[t](0,1)}:!1,Ii=0,Se;e.ajaxSettings.xhr=E.ActiveXObject?function(){return!this.isLocal&&bt()||ut()}:bt,function(t){e.extend(e.support,{ajax:!!t,cors:!!t&&"withCredentials"in t})}(e.ajaxSettings.xhr()),e.support.ajax&&e.ajaxTransport(function(t){if(!t.crossDomain||e.support.cors){var i;return{send:function(n,s){var l=t.xhr(),u,d;if(t.username?l.open(t.type,t.url,t.async,t.username,t.password):l.open(t.type,t.url,t.async),t.xhrFields)for(d in t.xhrFields)l[d]=t.xhrFields[d];t.mimeType&&l.overrideMimeType&&l.overrideMimeType(t.mimeType),!t.crossDomain&&!n["X-Requested-With"]&&(n["X-Requested-With"]="XMLHttpRequest");try{for(d in n)l.setRequestHeader(d,n[d])}catch(p){}l.send(t.hasContent&&t.data||null),i=function(p,w){var S,b,P,A,N;try{if(i&&(w||l.readyState===4))if(i=O,u&&(l.onreadystatechange=e.noop,We&&delete Se[u]),w)l.readyState!==4&&l.abort();else{S=l.status,P=l.getAllResponseHeaders(),A={},N=l.responseXML,N&&N.documentElement&&(A.xml=N),A.text=l.responseText;try{b=l.statusText}catch(W){b=""}!S&&t.isLocal&&!t.crossDomain?S=A.text?200:404:S===1223&&(S=204)}}catch(W){w||s(-1,W)}A&&s(S,b,A,P)},!t.async||l.readyState===4?i():(u=++Ii,We&&(Se||(Se={},e(E).unload(We)),Se[u]=i),l.onreadystatechange=i)},abort:function(){i&&i(0,1)}}}});var je={},Jt,Te,Fi=/^(?:toggle|show|hide)$/,Oi=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,De,ni=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],Ee;e.fn.extend({show:function(t,i,n){var s,l;if(t||t===0)return this.animate(J("show",3),t,i,n);for(var u=0,d=this.length;u=p.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),p.animatedProperties[this.prop]=!0;for(i in p.animatedProperties)p.animatedProperties[i]!==!0&&(u=!1);if(u){if(p.overflow!=null&&!e.support.shrinkWrapBlocks&&e.each(["","X","Y"],function(w,S){d.style["overflow"+S]=p.overflow[w]}),p.hide&&e(d).hide(),p.hide||p.show)for(i in p.animatedProperties)e.style(d,i,p.orig[i]),e.removeData(d,"fxshow"+i,!0),e.removeData(d,"toggle"+i,!0);s=p.complete,s&&(p.complete=!1,s.call(d))}return!1}return p.duration==1/0?this.now=l:(n=l-this.startTime,this.state=n/p.duration,this.pos=e.easing[p.animatedProperties[this.prop]](this.state,n,0,1,p.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update(),!0}},e.extend(e.fx,{tick:function(){for(var t,i=e.timers,n=0;n-1,S={},b={},P,A;w?(b=l.position(),P=b.top,A=b.left):(P=parseFloat(d)||0,A=parseFloat(p)||0),e.isFunction(i)&&(i=i.call(t,n,u)),i.top!=null&&(S.top=i.top-u.top+P),i.left!=null&&(S.left=i.left-u.left+A),"using"in i?i.using.call(t,S):l.css(S)}},e.fn.extend({position:function(){if(!this[0])return null;var t=this[0],i=this.offsetParent(),n=this.offset(),s=si.test(i[0].nodeName)?{top:0,left:0}:i.offset();return n.top-=parseFloat(e.css(t,"marginTop"))||0,n.left-=parseFloat(e.css(t,"marginLeft"))||0,s.top+=parseFloat(e.css(i[0],"borderTopWidth"))||0,s.left+=parseFloat(e.css(i[0],"borderLeftWidth"))||0,{top:n.top-s.top,left:n.left-s.left}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent||j.body;t&&!si.test(t.nodeName)&&e.css(t,"position")==="static";)t=t.offsetParent;return t})}}),e.each(["Left","Top"],function(t,i){var n="scroll"+i;e.fn[n]=function(s){var l,u;return s===O?(l=this[0],l?(u=Z(l),u?"pageXOffset"in u?u[t?"pageYOffset":"pageXOffset"]:e.support.boxModel&&u.document.documentElement[n]||u.document.body[n]:l[n]):null):this.each(function(){u=Z(this),u?u.scrollTo(t?e(u).scrollLeft():s,t?s:e(u).scrollTop()):this[n]=s})}}),e.each(["Height","Width"],function(t,i){var n=i.toLowerCase();e.fn["inner"+i]=function(){var s=this[0];return s?s.style?parseFloat(e.css(s,n,"padding")):this[n]():null},e.fn["outer"+i]=function(s){var l=this[0];return l?l.style?parseFloat(e.css(l,n,s?"margin":"border")):this[n]():null},e.fn[n]=function(s){var l=this[0];if(!l)return s==null?null:this;if(e.isFunction(s))return this.each(function(S){var b=e(this);b[n](s.call(this,S,b[n]()))});if(e.isWindow(l)){var u=l.document.documentElement["client"+i],d=l.document.body;return l.document.compatMode==="CSS1Compat"&&u||d&&d["client"+i]||u}if(l.nodeType===9)return Math.max(l.documentElement["client"+i],l.body["scroll"+i],l.documentElement["scroll"+i],l.body["offset"+i],l.documentElement["offset"+i]);if(s===O){var p=e.css(l,n),w=parseFloat(p);return e.isNumeric(w)?w:p}return this.css(n,typeof s=="string"?s:s+"px")}}),E.jQuery=E.$=e})(window);(function(E){var O,Z,et="",J="4.1.0",Bt=Math.PI,$=Bt/2,ut="ontouchstart"in window,bt=ut?{down:"touchstart",move:"touchmove",up:"touchend",over:"touchstart",out:"touchend"}:{down:"mousedown",move:"mousemove",up:"mouseup",over:"mouseover",out:"mouseout"},Pt={backward:["bl","tl"],forward:["br","tr"],all:["tl","bl","tr","br","l","r"]},nt=["single","double"],dt=["ltr","rtl"],Et={acceleration:!0,display:"double",duration:600,page:1,gradients:!0,turnCorners:"bl,br",when:null},_t={cornerSize:100},Ct=6,U={init:function(r){O="WebKitCSSMatrix"in window||"MozPerspective"in document.body.style,Z=y(),et=tt();var o,e=0,f=this.data(),v=this.children();if(r=E.extend({width:this.width(),height:this.height(),direction:this.attr("dir")||this.css("direction")||"ltr"},Et,r),f.opts=r,f.pageObjs={},f.pages={},f.pageWrap={},f.pageZoom={},f.pagePlace={},f.pageMv=[],f.zoom=1,f.totalPages=r.pages||0,f.eventHandlers={touchStart:E.proxy(U._touchStart,this),touchMove:E.proxy(U._touchMove,this),touchEnd:E.proxy(U._touchEnd,this),start:E.proxy(U._eventStart,this)},r.when)for(o in r.when)F(o,r.when)&&this.bind(o,r.when[o]);for(this.css({position:"relative",width:r.width,height:r.height}),this.turn("display",r.display),r.direction!==""&&this.turn("direction",r.direction),O&&!ut&&r.acceleration&&this.transform(x(0,0,!0)),o=0;oV)throw At('Page "'+o+'" cannot be inserted')}else o=V,v=!0;return o>=1&&o<=V&&(_.display=="double"?f=o%2?" odd":" even":f="",_.done&&this.turn("stop"),o in _.pageObjs&&U._movePages.call(this,o,1),v&&(_.totalPages=V),_.pageObjs[o]=E(r).css({float:"left"}).addClass("page p"+o+f),!j()&&_.pageObjs[o].hasClass("hard")&&_.pageObjs[o].removeClass("hard"),U._addPage.call(this,o),U._removeFromDOM.call(this)),this},_addPage:function(r){var o=this.data(),e=o.pageObjs[r];if(e)if(U._necessPage.call(this,r)){if(!o.pageWrap[r]){o.pageWrap[r]=E("
",{class:"page-wrapper",page:r,css:{position:"absolute",overflow:"hidden"}}),this.append(o.pageWrap[r]),o.pagePlace[r]||(o.pagePlace[r]=r,o.pageObjs[r].appendTo(o.pageWrap[r]));var f=U._pageSize.call(this,r,!0);e.css({width:f.width,height:f.height}),o.pageWrap[r].css(f)}o.pagePlace[r]==r&&U._makeFlip.call(this,r)}else o.pagePlace[r]=0,o.pageObjs[r]&&o.pageObjs[r].remove()},hasPage:function(r){return F(r,this.data().pageObjs)},center:function(r){var o=this.data(),e=E(this).turn("size"),f=0;if(!o.noCenter){if(o.display=="double"){var v=this.turn("view",r||o.tpage||o.page);o.direction=="ltr"?v[0]?v[1]||(f+=e.width/4):f-=e.width/4:v[0]?v[1]||(f-=e.width/4):f+=e.width/4}E(this).css({marginLeft:f})}return this},destroy:function(){var r=this,o=this.data(),e=["end","first","flip","last","pressed","released","start","turning","turned","zooming","missing"];if(xt("destroying",this)!="prevented"){for(o.destroying=!0,E.each(e,function(f,v){r.unbind(v)}),this.parent().unbind("start",o.eventHandlers.start),E(document).unbind(bt.move,o.eventHandlers.touchMove).unbind(bt.up,o.eventHandlers.touchEnd);o.totalPages!==0;)this.turn("removePage",o.totalPages);return o.fparent&&o.fparent.remove(),o.shadow&&o.shadow.remove(),this.removeData(),o=null,this}},is:function(){return typeof this.data().pages=="object"},zoom:function(r){var o=this.data();if(typeof r=="number"){if(r<.001||r>100)throw At(r+" is not a value for zoom");if(xt("zooming",this,[r,o.zoom])=="prevented")return this;var e=this.turn("size"),f=this.turn("view"),v=1/o.zoom,_=Math.round(e.width*v*r),V=Math.round(e.height*v*r);o.zoom=r,E(this).turn("stop").turn("size",_,V),o.opts.autoCenter&&this.turn("center"),U._updateShadow.call(this);for(var X=0;X_.totalPages)throw At('"'+r+'" is not a valid page');return v[1]=v[1]||v[0],v[0]>=1&&v[1]<=_.totalPages?(o=Math.floor((Ct-2)/2),_.totalPages-v[1]>v[0]?(e=Math.min(v[0]-1,o),f=2*o-e):(f=Math.min(_.totalPages-v[1],o),e=2*o-f)):(e=Ct-1,f=Ct-1),[Math.max(1,v[0]-e),Math.min(_.totalPages,v[1]+f)]},_necessPage:function(r){if(r===0)return!0;var o=this.turn("range");return this.data().pageObjs[r].hasClass("fixed")||r>=o[0]&&r<=o[1]},_removeFromDOM:function(){var r,o=this.data();for(r in o.pageWrap)F(r,o.pageWrap)&&!U._necessPage.call(this,r)&&U._removePageFromDOM.call(this,r)},_removePageFromDOM:function(r){var o=this.data();if(o.pages[r]){var e=o.pages[r].data();K._moveFoldingPage.call(o.pages[r],!1),e.f&&e.f.fwrapper&&e.f.fwrapper.remove(),o.pages[r].removeData(),o.pages[r].remove(),delete o.pages[r]}o.pageObjs[r]&&o.pageObjs[r].remove(),o.pageWrap[r]&&(o.pageWrap[r].remove(),delete o.pageWrap[r]),U._removeMv.call(this,r),delete o.pagePlace[r],delete o.pageZoom[r]},removePage:function(r){var o=this.data();if(r=="*")for(;o.totalPages!==0;)this.turn("removePage",o.totalPages);else{if(r<1||r>o.totalPages)throw At("The page "+r+" doesn't exist");o.pageObjs[r]&&(this.turn("stop"),U._removePageFromDOM.call(this,r),delete o.pageObjs[r]),U._movePages.call(this,r,-1),o.totalPages=o.totalPages-1,o.page>o.totalPages?(o.page=null,U._fitPage.call(this,o.totalPages)):(U._makeRange.call(this),this.turn("update"))}return this},_movePages:function(r,o){var e,f=this,v=this.data(),_=v.display=="single",V=function(X){var rt=X+o,ft=rt%2,wt=ft?" odd ":" even ";v.pageObjs[X]&&(v.pageObjs[rt]=v.pageObjs[X].removeClass("p"+X+" odd even").addClass("p"+rt+wt)),v.pagePlace[X]&&v.pageWrap[X]&&(v.pagePlace[rt]=rt,v.pageObjs[rt].hasClass("fixed")?v.pageWrap[rt]=v.pageWrap[X].attr("page",rt):v.pageWrap[rt]=v.pageWrap[X].css(U._pageSize.call(f,rt,!0)).attr("page",rt),v.pages[X]&&(v.pages[rt]=v.pages[X].flip("options",{page:rt,next:_||ft?rt+1:rt-1})),o&&(delete v.pages[X],delete v.pagePlace[X],delete v.pageZoom[X],delete v.pageObjs[X],delete v.pageWrap[X]))};if(o>0)for(e=v.totalPages;e>=r;e--)V(e);else for(e=r;e<=v.totalPages;e++)V(e)},display:function(r){var o=this.data(),e=o.display;if(r===void 0)return e;if(E.inArray(r,nt)==-1)throw At('"'+r+'" is not a value for display');switch(r){case"single":o.pageObjs[0]||(this.turn("stop").css({overflow:"hidden"}),o.pageObjs[0]=E("
",{class:"page p-temporal"}).css({width:this.width(),height:this.height()}).appendTo(this)),this.addClass("shadow");break;case"double":o.pageObjs[0]&&(this.turn("stop").css({overflow:""}),o.pageObjs[0].remove(),delete o.pageObjs[0]),this.removeClass("shadow");break}if(o.display=r,e){var f=this.turn("size");U._movePages.call(this,1,0),this.turn("size",f.width,f.height).turn("update")}return this},direction:function(r){var o=this.data();if(r===void 0)return o.direction;if(r=r.toLowerCase(),E.inArray(r,dt)==-1)throw At('"'+r+'" is not a value for direction');return r=="rtl"&&E(this).attr("dir","ltr").css({direction:"ltr"}),o.direction=r,o.done&&this.turn("size",E(this).width(),E(this).height()),this},animating:function(){return this.data().pageMv.length>0},corner:function(){var r,o,e=this.data();for(o in e.pages)if(F(o,e.pages)&&(r=e.pages[o].flip("corner")))return r;return!1},data:function(){return this.data()},disable:function(r){var o,e=this.data(),f=this.turn("view");e.disabled=r===void 0||r===!0;for(o in e.pages)F(o,e.pages)&&e.pages[o].flip("disable",e.disabled?!0:E.inArray(parseInt(o,10),f)==-1);return this},disabled:function(r){return r===void 0?this.data().disabled===!0:this.turn("disable",r)},size:function(r,o){if(r===void 0||o===void 0)return{width:this.width(),height:this.height()};this.turn("stop");var e,f,v=this.data(),_=v.display=="double"?r/2:r;this.css({width:r,height:o}),v.pageObjs[0]&&v.pageObjs[0].css({width:_,height:o});for(e in v.pageWrap)F(e,v.pageWrap)&&(f=U._pageSize.call(this,e,!0),v.pageObjs[e].css({width:f.width,height:f.height}),v.pageWrap[e].css(f),v.pages[e]&&v.pages[e].css({width:f.width,height:f.height}));return this.turn("resize"),this},resize:function(){var r,o=this.data();for(o.pages[0]&&(o.pageWrap[0].css({left:-this.width()}),o.pages[0].flip("resize",!0)),r=1;r<=o.totalPages;r++)o.pages[r]&&o.pages[r].flip("resize",!0);U._updateShadow.call(this),o.opts.autoCenter&&this.turn("center")},_removeMv:function(r){var o,e=this.data();for(o=0;o0?e[0]:0,e[1]<=o.totalPages?e[1]:0]:[e[0]>0&&e[0]<=o.totalPages?e[0]:0]},stop:function(r,o){if(this.turn("animating")){var e,f,v,_=this.data();for(_.tpage&&(_.page=_.tpage,delete _.tpage),e=0;e<_.pageMv.length;e++)!_.pageMv[e]||_.pageMv[e]===r||(v=_.pages[_.pageMv[e]],f=v.data().f.opts,v.flip("hideFoldedPage",o),o||K._moveFoldingPage.call(v,!1),f.force&&(f.next=f.page%2===0?f.page-1:f.page+1,delete f.force))}return this.turn("update"),this},pages:function(r){var o=this.data();if(r){if(rr;e--)this.turn("removePage",e);return o.totalPages=r,U._fitPage.call(this,o.page),this}else return o.totalPages},_missing:function(r){var o=this.data();if(!(o.totalPages<1)){var e,f=this.turn("range",r),v=[];for(e=f[0];e<=f[1];e++)o.pageObjs[e]||v.push(e);v.length>0&&this.trigger("missing",[v])}},_fitPage:function(r){var o=this.data(),e=this.turn("view",r);if(U._missing.call(this,r),!!o.pageObjs[r]){o.page=r,this.turn("stop");for(var f=0;f_[1]?(o=_[1],e=V[0]):_[0]&&r<_[0]&&(o=_[0],e=V[1]);var rt=f.opts.turnCorners.split(","),ft=f.pages[o].data().f,wt=ft.opts,St=ft.point;U._missing.call(this,r),f.pageObjs[r]&&(this.turn("stop"),f.page=r,U._makeRange.call(this),f.tpage=e,wt.next!=e&&(wt.next=e,wt.force=!0),this.turn("update"),ft.point=St,ft.effect=="hard"?f.direction=="ltr"?f.pages[o].flip("turnPage",r>o?"r":"l"):f.pages[o].flip("turnPage",r>o?"l":"r"):f.direction=="ltr"?f.pages[o].flip("turnPage",rt[r>o?1:0]):f.pages[o].flip("turnPage",rt[r>o?0:1]))},page:function(r){var o=this.data();if(r===void 0)return o.page;if(!o.disabled&&!o.destroying){if(r=parseInt(r,10),r>0&&r<=o.totalPages)return r!=o.page&&(!o.done||E.inArray(r,this.turn("view"))!=-1?U._fitPage.call(this,r):U._turnPage.call(this,r)),this;throw At("The page "+r+" does not exist")}},next:function(){return this.turn("page",Math.min(this.data().totalPages,U._view.call(this,this.data().page).pop()+1))},previous:function(){return this.turn("page",Math.max(1,U._view.call(this,this.data().page).shift()-1))},peel:function(r,o){var e=this.data(),f=this.turn("view");if(o=o===void 0?!0:o===!0,r===!1)this.turn("stop",null,o);else if(e.display=="single")e.pages[e.page].flip("peel",r,o);else{var v;e.direction=="ltr"?v=r.indexOf("l")!=-1?f[0]:f[1]:v=r.indexOf("l")!=-1?f[1]:f[0],e.pages[v]&&e.pages[v].flip("peel",r,o)}return this},_addMotionPage:function(){var r=E(this).data().f.opts,o=r.turn;o.data(),U._addMv.call(o,r.page)},_eventStart:function(r,o,e){var f=o.turn.data(),v=f.pageZoom[o.page];if(r.isDefaultPrevented()){U._updateShadow.call(o.turn);return}v&&v!=f.zoom&&(o.turn.trigger("zoomed",[o.page,o.turn.turn("view",o.page),v,f.zoom]),f.pageZoom[o.page]=f.zoom),f.display=="single"&&e&&(e.charAt(1)=="l"&&f.direction=="ltr"||e.charAt(1)=="r"&&f.direction=="rtl"?(o.next=o.nexto.page?o.next:o.page+1),U._addMotionPage.call(r.target),U._updateShadow.call(o.turn)},_eventEnd:function(r,o,e){var f=E(r.target);f.data().f;var v=o.turn,_=v.data();if(e){var V=_.tpage||_.page;(V==o.next||V==o.page)&&(delete _.tpage,U._fitPage.call(v,V||o.next,!0))}else U._removeMv.call(v,o.page),U._updateShadow.call(v),v.turn("update")},_eventPressed:function(r){var o=E(r.target).data().f,e=o.opts.turn,f=e.data();return f.pages,f.mouseAction=!0,e.turn("update"),o.time=new Date().getTime()},_eventReleased:function(r,o){var e,f=E(r.target),v=f.data().f,_=v.opts.turn,V=_.data();V.display=="single"?e=o.corner=="br"||o.corner=="tr"?o.xf.width()/2:e=o.x<0||o.x>f.width(),(new Date().getTime()-v.time<200||e)&&(r.preventDefault(),U._turnPage.call(_,v.opts.next)),V.mouseAction=!1},_flip:function(r){r.stopPropagation();var o=E(r.target).data().f.opts;o.turn.trigger("turn",[o.next]),o.turn.data().opts.autoCenter&&o.turn.turn("center",o.next)},_touchStart:function(){var r=this.data();for(var o in r.pages)if(F(o,r.pages)&&K._eventStart.apply(r.pages[o],arguments)===!1)return!1},_touchMove:function(){var r=this.data();for(var o in r.pages)F(o,r.pages)&&K._eventMove.apply(r.pages[o],arguments)},_touchEnd:function(){var r=this.data();for(var o in r.pages)F(o,r.pages)&&K._eventEnd.apply(r.pages[o],arguments)},calculateZ:function(r){var o,e,f,v,_,V=this,X=this.data(),rt=this.turn("view"),ft=rt[0]||rt[1],wt=r.length-1,St={pageZ:{},partZ:{},pageV:{}},qt=function(zt){var Ft=V.turn("view",zt);Ft[0]&&(St.pageV[Ft[0]]=!0),Ft[1]&&(St.pageV[Ft[1]]=!0)};for(o=0;o<=wt;o++)e=r[o],f=X.pages[e].data().f.opts.next,v=X.pagePlace[e],qt(e),qt(f),_=X.pagePlace[f]==f?f:e,St.pageZ[_]=X.totalPages-Math.abs(ft-_),St.partZ[v]=X.totalPages*2-wt+o;return St},update:function(){var r,o=this.data();if(this.turn("animating")&&o.pageMv[0]!==0){var e,f,v=this.turn("calculateZ",o.pageMv),_=this.turn("corner"),V=this.turn("view"),X=this.turn("view",o.tpage);for(r in o.pageWrap)F(r,o.pageWrap)&&(f=o.pageObjs[r].hasClass("fixed"),o.pageWrap[r].css({display:v.pageV[r]||f?"":"none",zIndex:(o.pageObjs[r].hasClass("hard")?v.partZ[r]:v.pageZ[r])||(f?-1:0)}),(e=o.pages[r])&&(e.flip("z",v.partZ[r]||null),v.pageV[r]&&e.flip("resize"),o.tpage?e.flip("hover",!1).flip("disable",E.inArray(parseInt(r,10),o.pageMv)==-1&&r!=X[0]&&r!=X[1]):e.flip("hover",_===!1).flip("disable",r!=V[0]&&r!=V[1])))}else for(r in o.pageWrap)if(F(r,o.pageWrap)){var rt=U._setPageLoc.call(this,r);o.pages[r]&&o.pages[r].flip("disable",o.disabled||rt!=1).flip("hover",!0).flip("z",null)}return this},_updateShadow:function(){var r,o,e,f=this.data(),v=this.width(),_=this.height(),V=f.display=="single"?v:v/2;r=this.turn("view"),f.shadow||(f.shadow=E("
",{class:"shadow",css:at(0,0,0).css}).appendTo(this));for(var X=0;X=e||v.y>=f)return!1;var V=K._cAllowed.call(this);switch(o.effect){case"hard":if(v.x>e-_)v.corner="r";else if(v.x<_)v.corner="l";else return!1;break;case"sheet":if(v.y<_)v.corner+="t";else if(v.y>=f-_)v.corner+="b";else return!1;if(v.x<=_)v.corner+="l";else if(v.x>=e-_)v.corner+="r";else return!1;break}return!v.corner||E.inArray(v.corner,V)==-1?!1:v},_isIArea:function(r){var o=this.data().f.parent.offset();return r=ut&&r.originalEvent?r.originalEvent.touches[0]:r,K._cornerActivated.call(this,{x:r.pageX-o.left,y:r.pageY-o.top})},_c:function(r,o){switch(o=o||0,r){case"tl":return h(o,o);case"tr":return h(this.width()-o,o);case"bl":return h(o,this.height()-o);case"br":return h(this.width()-o,this.height()-o);case"l":return h(o,0);case"r":return h(this.width()-o,0)}},_c2:function(r){switch(r){case"tl":return h(this.width()*2,0);case"tr":return h(-this.width(),0);case"bl":return h(this.width()*2,this.height());case"br":return h(-this.width(),this.height());case"l":return h(this.width()*2,0);case"r":return h(-this.width(),0)}},_foldingPage:function(){var r=this.data().f;if(r){var o=r.opts;if(o.turn)return r=o.turn.data(),r.display=="single"?o.next>1||o.page>1?r.pageObjs[0]:null:r.pageObjs[o.next]}},_backGradient:function(){var r=this.data().f,o=r.opts.turn.data(),e=o.opts.gradients&&(o.display=="single"||r.opts.page!=2&&r.opts.page!=o.totalPages-1);return e&&!r.bshadow&&(r.bshadow=E("
",at(0,0,1)).css({position:"",width:this.width(),height:this.height()}).appendTo(r.parent)),e},type:function(){return this.data().f.effect},resize:function(r){var o=this.data().f,e=o.opts.turn.data(),f=this.width(),v=this.height();switch(o.effect){case"hard":r&&(o.wrapper.css({width:f,height:v}),o.fpage.css({width:f,height:v}),e.opts.gradients&&(o.ashadow.css({width:f,height:v}),o.bshadow.css({width:f,height:v})));break;case"sheet":if(r){var _=Math.round(Math.sqrt(Math.pow(f,2)+Math.pow(v,2)));o.wrapper.css({width:_,height:_}),o.fwrapper.css({width:_,height:_}).children(":first-child").css({width:f,height:v}),o.fpage.css({width:f,height:v}),e.opts.gradients&&o.ashadow.css({width:f,height:v}),K._backGradient.call(this)&&o.bshadow.css({width:f,height:v})}if(o.parent.is(":visible")){var V=Xt(o.parent[0]);o.fwrapper.css({top:V.top,left:V.left}),V=Xt(o.opts.turn[0]),o.fparent.css({top:-V.top,left:-V.left})}this.flip("z",o.opts["z-index"]);break}},_addPageWrapper:function(){var r=this.data().f,o=r.opts.turn.data(),e=this.parent();if(r.parent=e,!r.wrapper)switch(r.effect){case"hard":var f={};f[et+"transform-style"]="preserve-3d",f[et+"backface-visibility"]="hidden",r.wrapper=E("
",at(0,0,2)).css(f).appendTo(e).prepend(this),r.fpage=E("
",at(0,0,1)).css(f).appendTo(e),o.opts.gradients&&(r.ashadow=E("
",at(0,0,0)).hide().appendTo(e),r.bshadow=E("
",at(0,0,0)));break;case"sheet":if(this.width(),this.height(),r.fparent=r.opts.turn.data().fparent,!r.fparent){var v=E("
",{css:{"pointer-events":"none"}}).hide();v.data().flips=0,v.css(at(0,0,"auto","visible").css).appendTo(r.opts.turn),r.opts.turn.data().fparent=v,r.fparent=v}this.css({position:"absolute",top:0,left:0,bottom:"auto",right:"auto"}),r.wrapper=E("
",at(0,0,this.css("z-index"))).appendTo(e).prepend(this),r.fwrapper=E("
",at(e.offset().top,e.offset().left)).hide().appendTo(r.fparent),r.fpage=E("
",at(0,0,0,"visible")).css({cursor:"default"}).appendTo(r.fwrapper),o.opts.gradients&&(r.ashadow=E("
",at(0,0,1)).appendTo(r.fpage)),K.setData.call(this,r);break}K.resize.call(this,!0)},_fold:function(r){var o=this.data().f,e=o.opts.turn.data(),f=K._c.call(this,r.corner),v=this.width(),_=this.height();switch(o.effect){case"hard":r.corner=="l"?r.x=Math.min(Math.max(r.x,0),v*2):r.x=Math.max(Math.min(r.x,v),-v);var V,X,rt,ft,wt,St=e.totalPages,qt=o.opts["z-index"]||St,zt={overflow:"visible"},Ft=f.x?(f.x-r.x)/v:r.x/v,Nt=Ft*90,Zt=Nt<90;switch(r.corner){case"l":ft="0% 50%",wt="100% 50%",Zt?(V=0,X=o.opts.next-1>0,rt=1):(V="100%",X=o.opts.page+1$&&(Mt.x=Mt.x+Math.abs(Mt.y*Tt.y/Tt.x),Mt.y=0,Math.round(Mt.x*Math.tan(Bt-vt))<_))return r.y=Math.sqrt(Math.pow(_,2)+2*Ht.x*Tt.x),ie&&(r.y=_-r.y),le();if(vt>$){var he=Bt-vt,de=Ae-_/Math.sin(he);Gt=h(Math.round(de*Math.cos(he)),Math.round(de*Math.sin(he))),ne&&(Gt.x=-Gt.x),ie&&(Gt.y=-Gt.y)}ye=Math.round(Mt.y/Math.tan(vt)+Mt.x);var re=v-ye,ue=re*Math.cos(vt*2),pe=re*Math.sin(vt*2);if(Ce=h(Math.round(ne?re-ue:ye+ue),Math.round(ie?pe:_-pe)),e.opts.gradients){Qt=re*Math.sin(vt);var oe=K._c2.call(Kt,r.corner),Rt=Math.sqrt(Math.pow(oe.x-r.x,2)+Math.pow(oe.y-r.y,2))/v;_e=Math.sin($*(Rt>1?2-Rt:Rt)),we=Math.min(Rt,1),ve=Qt>100?(Qt-100)/Qt:0,te=h(Qt*Math.sin(vt)/v*100,Qt*Math.cos(vt)/_*100),K._backGradient.call(Kt)&&(ee=h(Qt*1.2*Math.sin(vt)/v*100,Qt*1.2*Math.cos(vt)/_*100),ne||(ee.x=100-ee.x),ie||(ee.y=100-ee.y))}return Mt.x=Math.round(Mt.x),Mt.y=Math.round(Mt.y),!0},be=function(Tt,Ht,vt,Vt){var se=["0","auto"],he=(v-Ae)*vt[0]/100,de=(_-Ae)*vt[1]/100,re={left:se[Ht[0]],top:se[Ht[1]],right:se[Ht[2]],bottom:se[Ht[3]]},ue={},pe=Vt!=90&&Vt!=-90?ne?-1:1:0,oe=vt[0]+"% "+vt[1]+"%";Kt.css(re).transform(k(Vt)+x(Tt.x+pe,Tt.y,xe),oe),o.fpage.css(re).transform(k(Vt)+x(Tt.x+Ce.x-Gt.x-v*vt[0]/100,Tt.y+Ce.y-Gt.y-_*vt[1]/100,xe)+k((180/Vt-2)*Vt),oe),o.wrapper.transform(x(-Tt.x+he-pe,-Tt.y+de,xe)+k(-Vt),oe),o.fwrapper.transform(x(-Tt.x+Gt.x+he,-Tt.y+Gt.y+de,xe)+k(-Vt),oe),e.opts.gradients&&(vt[0]&&(te.x=100-te.x),vt[1]&&(te.y=100-te.y),ue["box-shadow"]="0 0 20px rgba(0,0,0,"+.5*_e+")",Oe.css(ue),yt(o.ashadow,h(ne?100:0,ie?0:100),h(te.x,te.y),[[ve,"rgba(0,0,0,0)"],[(1-ve)*.8+ve,"rgba(0,0,0,"+.2*we+")"],[1,"rgba(255,255,255,"+.2*we+")"]],3),K._backGradient.call(Kt)&&yt(o.bshadow,h(ne?0:100,ie?0:100),h(ee.x,ee.y),[[.6,"rgba(0,0,0,0)"],[.8,"rgba(0,0,0,"+.3*we+")"],[1,"rgba(0,0,0,0)"]],3))};switch(r.corner){case"l":break;case"r":break;case"tl":r.x=Math.max(r.x,1),le(),be(Mt,[1,0,0,1],[100,0],$t);break;case"tr":r.x=Math.min(r.x,v-1),le(),be(h(-Mt.x,Mt.y),[0,0,0,1],[0,0],-$t);break;case"bl":r.x=Math.max(r.x,1),le(),be(h(Mt.x,-Mt.y),[1,1,0,0],[100,100],-$t);break;case"br":r.x=Math.min(r.x,v-1),le(),be(h(-Mt.x,-Mt.y),[0,1,1,0],[0,100],$t);break}break}o.point=r},_moveFoldingPage:function(r){var o=this.data().f;if(o){var e=o.opts.turn,f=e.data(),v=f.pagePlace;if(r){var _=o.opts.next;if(v[_]!=o.opts.page){o.folding&&K._moveFoldingPage.call(this,!1);var V=K._foldingPage.call(this);V.appendTo(o.fpage),v[_]=o.opts.page,o.folding=_}e.turn("update")}else if(o.folding){if(f.pages[o.folding]){var X=f.pages[o.folding].data().f;f.pageObjs[o.folding].appendTo(X.wrapper)}else f.pageWrap[o.folding]&&f.pageObjs[o.folding].appendTo(f.pageWrap[o.folding]);o.folding in v&&(v[o.folding]=o.folding),delete o.folding}}},_showFoldedPage:function(r,o){var e=K._foldingPage.call(this),f=this.data(),v=f.f,_=v.visible;if(e){if(!_||!v.point||v.point.corner!=r.corner){var V=v.status=="hover"||v.status=="peel"||v.opts.turn.data().mouseAction?r.corner:null;if(_=!1,xt("start",this,[v.opts,V])=="prevented")return!1}if(o){var X=this,rt=v.point&&v.point.corner==r.corner?v.point:K._c.call(this,r.corner,1);this.animatef({from:[rt.x,rt.y],to:[r.x,r.y],duration:500,frame:function(ft){r.x=Math.round(ft[0]),r.y=Math.round(ft[1]),K._fold.call(X,r)}})}else K._fold.call(this,r),f.effect&&!f.effect.turning&&this.animatef(!1);if(!_)switch(v.effect){case"hard":v.visible=!0,K._moveFoldingPage.call(this,!0),v.fpage.show(),v.opts.shadows&&v.bshadow.show();break;case"sheet":v.visible=!0,v.fparent.show().data().flips++,K._moveFoldingPage.call(this,!0),v.fwrapper.show(),v.bshadow&&v.bshadow.show();break}return!0}return!1},hide:function(){var r=this.data().f,o=r.opts.turn.data(),e=K._foldingPage.call(this);switch(r.effect){case"hard":o.opts.gradients&&(r.bshadowLoc=0,r.bshadow.remove(),r.ashadow.hide()),r.wrapper.transform(""),r.fpage.hide();break;case"sheet":--r.fparent.data().flips===0&&r.fparent.hide(),this.css({left:0,top:0,right:"auto",bottom:"auto"}).transform(""),r.wrapper.transform(""),r.fwrapper.hide(),r.bshadow&&r.bshadow.hide(),e.transform("");break}return r.visible=!1,this},hideFoldedPage:function(r){var o=this.data().f;if(o.point){var e=this,f=o.point,v=function(){o.point=null,o.status="",e.flip("hide"),e.trigger("end",[o.opts,!1])};if(r){var _=K._c.call(this,f.corner),V=f.corner.substr(0,1)=="t",X=V?Math.min(0,f.y-_.y)/2:Math.max(0,f.y-_.y)/2,rt=h(f.x,f.y+X),ft=h(_.x,_.y-X);this.animatef({from:0,to:1,frame:function(wt){var St=B(f,rt,ft,_,wt);f.x=St.x,f.y=St.y,K._fold.call(e,f)},complete:v,duration:800,hiding:!0})}else this.animatef(!1),v()}},turnPage:function(r){var o=this,e=this.data().f,f=e.opts.turn.data();r={corner:e.corner?e.corner.corner:r||K._cAllowed.call(this)[0]};var v=e.point||K._c.call(this,r.corner,e.opts.turn?f.opts.elevation:0),_=K._c2.call(this,r.corner);this.trigger("flip").animatef({from:0,to:1,frame:function(V){var X=B(v,v,_,_,V);r.x=X.x,r.y=X.y,K._showFoldedPage.call(o,r)},complete:function(){o.trigger("end",[e.opts,!0])},duration:f.opts.duration,turning:!0}),e.corner=null},moving:function(){return"effect"in this.data()},isTurning:function(){return this.flip("moving")&&this.data().effect.turning},corner:function(){return this.data().f.corner},_eventStart:function(r){var o=this.data().f,e=o.opts.turn;if(!o.corner&&!o.disabled&&!this.flip("isTurning")&&o.opts.page==e.data().pagePlace[o.opts.page]){if(o.corner=K._isIArea.call(this,r),o.corner&&K._foldingPage.call(this))return this.trigger("pressed",[o.point]),K._showFoldedPage.call(this,o.corner),!1;o.corner=null}},_eventMove:function(r){var o=this.data().f;if(!o.disabled){if(r=ut?r.originalEvent.touches:[r],o.corner){var e=o.parent.offset();o.corner.x=r[0].pageX-e.left,o.corner.y=r[0].pageY-e.top,K._showFoldedPage.call(this,o.corner)}else if(o.hover&&!this.data().effect&&this.is(":visible")){var f=K._isIArea.call(this,r[0]);if(f){if(o.effect=="sheet"&&f.corner.length==2||o.effect=="hard"){o.status="hover";var v=K._c.call(this,f.corner,o.opts.cornerSize/2);f.x=v.x,f.y=v.y,K._showFoldedPage.call(this,f,!0)}}else o.status=="hover"&&(o.status="",K.hideFoldedPage.call(this,!0))}}},_eventEnd:function(){var r=this.data().f,o=r.corner;!r.disabled&&o&&xt("released",this,[r.point||o])!="prevented"&&K.hideFoldedPage.call(this,!0),r.corner=null},disable:function(r){return K.setData.call(this,{disabled:r}),this},hover:function(r){return K.setData.call(this,{hover:r}),this},peel:function(r,o){var e=this.data().f;if(r){if(E.inArray(r,Pt.all)==-1)throw At("Corner "+r+" is not permitted");if(E.inArray(r,K._cAllowed.call(this))!=-1){var f=K._c.call(this,r,e.opts.cornerSize/2);e.status="peel",K._showFoldedPage.call(this,{corner:r,x:f.x,y:f.y},o)}}else e.status="",K.hideFoldedPage.call(this,o);return this}};function ht(r,o,e){if(!e[0]||typeof e[0]=="object")return o.init.apply(r,e);if(o[e[0]])return o[e[0]].apply(r,Array.prototype.slice.call(e,1));throw At(e[0]+" is not a method or property")}function at(r,o,e,f){return{css:{position:"absolute",top:r,left:o,overflow:f||"hidden",zIndex:e||"auto"}}}function B(r,o,e,f,v){var _=1-v,V=_*_*_,X=v*v*v;return h(Math.round(V*r.x+3*v*_*_*o.x+3*v*v*_*e.x+X*f.x),Math.round(V*r.y+3*v*_*_*o.y+3*v*v*_*e.y+X*f.y))}function a(r){return r/Bt*180}function h(r,o){return{x:r,y:o}}function y(){var r;if(r=/AppleWebkit\/([0-9\.]+)/i.exec(navigator.userAgent)){var o=parseFloat(r[1]);return o>534.3}else return!0}function x(r,o,e){return O&&e?" translate3d("+r+"px,"+o+"px, 0px) ":" translate("+r+"px, "+o+"px) "}function k(r){return" rotate("+r+"deg) "}function F(r,o){return Object.prototype.hasOwnProperty.call(o,r)}function tt(){for(var r=["Moz","Webkit","Khtml","O","ms"],o=r.length,e="";o--;)r[o]+"Transform"in document.body.style&&(e="-"+r[o].toLowerCase()+"-");return e}function st(){var r,o=document.createElement("fakeelement"),e={transition:"transitionend",OTransition:"oTransitionEnd",MSTransition:"transitionend",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(r in e)if(o.style[r]!==void 0)return e[r]}function yt(r,o,e,f,v){var _,V=[];if(et=="-webkit-"){for(_=0;_{ui({api:"goBack"})},J=ke({currentGradeNum:null,bookVersionId:null,page:1,rows:999,type:"COURSEWARE"});zi(()=>ai.grades.map((a,h)=>({...a,color:J.currentGradeNum===h?"var(--van-primary-color)":"",className:J.currentGradeNum===h?"fontBlod":""})));const Bt=ae(!1),$=ke({list:[],loading:!1,favoriteList:[],tab:"all",details:[],bookData:{},showBook:!1,book:{}}),ut=async()=>{try{const a=Ne.user.data.schoolInfos,h=a.length>0?a[0].tenantId:null;if(h){const{data:y}=await Vi({id:h});O.value=y.bookVersionList||[],Z.value=qe(O.value)}}catch(a){}},bt=async()=>{var k;$.loading=!0;const{bookVersionId:a,currentGradeNum:h,...y}=J,x=await Ui({...y,bookversionId:a==-1?null:a,currentGradeNum:h||""});(x==null?void 0:x.code)===200&&Array.isArray((k=x==null?void 0:x.data)==null?void 0:k.rows)&&($.list=x.data.rows.map(F=>(F.load=!1,F.key=Date.now()+F.id,F))),$.loading=!1,Bt.value=!0},Pt=async()=>{var h,y,x;$.loading=!0;const a=await Xi({clientType:"STUDENT",userId:(y=(h=Ne.user)==null?void 0:h.data)==null?void 0:y.id,page:J.page,rows:J.rows,bookVersionId:J.bookVersionId!=-1?J.bookVersionId:"",currentGradeNum:J.currentGradeNum?J.currentGradeNum:""});(a==null?void 0:a.code)===200&&Array.isArray((x=a==null?void 0:a.data)==null?void 0:x.rows)&&($.list=a.data.rows.map(k=>(k.name=`${k.name}`,k.load=!1,k.favoriteFlag=!0,k.key=Date.now()+k.id,k))),$.loading=!1},nt=async()=>{var h;$.loading=!0;const a=await $i({bookVersionId:J.bookVersionId?J.bookVersionId:"",page:J.page,rows:J.rows});(a==null?void 0:a.code)===200&&Array.isArray((h=a==null?void 0:a.data)==null?void 0:h.rows)&&($.list=a.data.rows.map(y=>(y.load=!1,y.key=Date.now()+y.id,y))),$.loading=!1,Bt.value=!0},dt=()=>{$.tab==="all"&&bt(),$.tab==="favorite"&&Pt(),$.tab==="course"&&nt()},Et=()=>{$.tab==="course"?Z.value=[...qe(O.value),{bookVersionId:-1,bookVersionName:"自定义"}]:Z.value=qe(O.value),dt()};Fe(()=>{ut(),dt()});const _t=async a=>{a.favoriteFlag?await Yi({lessonCoursewareId:a.id}):(await Zi({lessonCoursewareId:a.id}),$.tab==="favorite"&&dt())};let Ct=null;const U=(a,h=300)=>{Ct&&clearTimeout(Ct),Ct=setTimeout(a,h)},K=async a=>{var h,y;if($.tab==="course"){const x=await Ki(a.id);if((x==null?void 0:x.code)==200&&Array.isArray((h=x==null?void 0:x.data)==null?void 0:h.lessonList))$.details=x.data.lessonList||[],$.bookData=x.data,console.log("🚀 ~ data.details course:",$.details);else{Gi({title:"提示",message:"课程教材已更新,是否重新加载?"}).then(()=>{dt()}).catch(()=>{});return}}else{const x=await Qi(a.id);(x==null?void 0:x.code)==200&&Array.isArray((y=x==null?void 0:x.data)==null?void 0:y.lessonList)&&($.details=x.data.lessonList||[],$.bookData=x.data,console.log("🚀 ~ data.details:",$.details))}ht(a.id),at(()=>{$.showBook=!0})},ht=a=>{const h=document.querySelector(`[data-id="${a}"]`);if(!h)return;const y=h.getBoundingClientRect();$.book=y},at=a=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{a()})})},B=async a=>{await K(a)};return()=>H("div",{class:mt.container},[H("div",{class:mt.head,style:{opacity:$.showBook?0:""}},[H("div",{class:mt.back,onClick:et},[H("img",{src:pi},null)]),H(nn,{class:mt.tabs,active:$.tab,"onUpdate:active":a=>$.tab=a,onChange:()=>Et()},{default:()=>[H(Ge,{title:"全部教材",name:"all"},null),H(Ge,{title:"课程教材",name:"course"},null),H(Ge,{name:"favorite"},{title:()=>H("div",{id:"courseware-2"},[Ot("我的收藏")])})]}),H(ce,ri({class:[mt.downBtn,$.tab!="course"&&J.bookVersionId>0||$.tab=="course"&&J.bookVersionId||J.currentGradeNum?mt.activeBtn:""],round:!0,size:"small",onClick:()=>E.value=!0},{id:"courseware-3"}),{default:()=>[Ot("筛选"),H("svg",{class:[mt.icon,E.value?mt.iconUp:""],width:"9px",height:"5px",viewBox:"0 0 9 5",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[H("title",null,[Ot("三角形")]),H("g",{id:"演示用",stroke:"none","stroke-width":"1",fill:"currentColor","fill-rule":"evenodd"},[H("g",{id:"全部教材-筛选",transform:"translate(-769.000000, -35.000000)",fill:"currentColor"},[H("g",{id:"编组-3",transform:"translate(696.000000, 20.000000)"},[H("g",{id:"筛选目录备份-2",transform:"translate(13.000000, 7.000000)"},[H("path",{d:"M64.8716471,8.41294119 L68.2489659,12.1655176 C68.4336954,12.3707726 68.4170562,12.6869176 68.2118012,12.8716471 C68.1199888,12.9542782 68.0008397,13 67.8773188,13 L61.1226812,13 C60.8465388,13 60.6226812,12.7761424 60.6226812,12.5 C60.6226812,12.3764791 60.668403,12.25733 60.7510341,12.1655176 L64.1283529,8.41294119 C64.3130824,8.20768618 64.6292274,8.19104698 64.8344824,8.37577649 C64.8475136,8.38750459 64.859919,8.39990996 64.8716471,8.41294119 Z",id:"三角形",transform:"translate(64.500000, 10.500000) rotate(-180.000000) translate(-64.500000, -10.500000) "},null)])])])])])]})]),H("div",{class:mt.content},[H("div",{class:[mt.wrap,$.list.length<=0&&!$.loading?mt.emtpyWrap:""]},[$.list.map((a,h)=>H("div",{class:[mt.wrapItem,$.bookData.id===a.id&&$.showBook?mt.wrapItemHide:""],key:a.key,onClick:()=>B(a)},[H("div",{class:mt.item},[H(Ji,ri({"data-id":a.id},{id:h==0?"courseware-0":""},{class:[mt.cover,a.load?mt.loaded:""],objectFit:"cover",src:a.coverImg,onLoad:()=>{a.load=!0},onError:()=>{a.load=!0}}),null)]),H("div",{class:mt.name},[a.name]),!$.loading&&$.tab!=="course"&&H("div",{id:h===0?"courseware-1":"",class:mt.favoriteBtn,onClick:y=>{y.stopPropagation(),a.favoriteFlag=!a.favoriteFlag,U(()=>_t(a))}},[H(tn,{isFavorite:a.favoriteFlag},null)])])),$.list.length<=0&&!$.loading&&H(qi,{image:"list",description:"暂无数据"},null)])]),H(Gn,{show:$.showBook,bookData:$.bookData,tab:$.tab,rect:$.book,onClose:()=>{$.showBook=!1}},null),Bt.value?H(Vn,null,null):null,H(Ve,{show:E.value,"onUpdate:show":a=>E.value=a,class:mt.popupContainer},{default:()=>[H("div",{class:mt.popoverContainer},[H("div",{class:mt.searchList},[H("div",{class:mt.popoverTitle},[Ot("教材版本")]),H("div",{class:[mt.popupList,mt.versionList]},[Z.value.map(a=>H(oi,{plain:J.bookVersionId==a.bookVersionId,round:!0,onClick:()=>J.bookVersionId=a.bookVersionId},{default:()=>[a.bookVersionName]}))]),H("div",{class:mt.popoverTitle},[Ot("选择年级")]),H("div",{class:[mt.popupList,mt.versionList]},[ai.grades.map(a=>H(oi,{plain:J.currentGradeNum===a.value,round:!0,onClick:()=>J.currentGradeNum=a.value},{default:()=>[a.text]}))])]),H("div",{class:mt.btnGroup},[H(ce,{round:!0,onClick:()=>{J.bookVersionId=null,J.currentGradeNum=null}},{default:()=>[Ot("重置")]}),H(ce,{round:!0,class:mt.btnSure,onClick:()=>{dt(),E.value=!1}},{default:()=>[Ot("确认")]})])])]})])}});export{ai as BOOK_DATA,is as default};