index.0da3a506.js 73 KB

1234567
  1. var Ge=Object.defineProperty,Ze=Object.defineProperties;var Qe=Object.getOwnPropertyDescriptors;var re=Object.getOwnPropertySymbols;var be=Object.prototype.hasOwnProperty,we=Object.prototype.propertyIsEnumerable;var ve=(e,t,s)=>t in e?Ge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,J=(e,t)=>{for(var s in t||(t={}))be.call(t,s)&&ve(e,s,t[s]);if(re)for(var s of re(t))we.call(t,s)&&ve(e,s,t[s]);return e},he=(e,t)=>Ze(e,Qe(t));var Ce=(e,t)=>{var s={};for(var i in e)be.call(e,i)&&t.indexOf(i)<0&&(s[i]=e[i]);if(e!=null&&re)for(var i of re(e))t.indexOf(i)<0&&we.call(e,i)&&(s[i]=e[i]);return s};import{C as Je}from"./index.fc1b358b.js";import{w as ce,aY as $e,aO as Te,n as $,bB as Ue,ah as _e,d as U,l as M,bC as et,E as j,bD as tt,m as T,bE as st,a5 as it,y as ot,e as D,bs as rt,r as Be,j as F,bF as ye,be as Le,a9 as at,bG as lt,o as nt,g as ct,bH as ht,a2 as ut,_ as pt,bI as dt,k as z,C as E,D as O,G as I,H as _,I as ee,c as l,J as g,K as y,M as P,a4 as ae,O as q,V as le,W as k,a3 as V,aq as ne,U as ft,a as w,T as gt,N as mt,aT as At,b3 as te,X as vt,aR as bt,bJ as Oe,bK as xe,h as wt,b6 as W,b as H,b4 as Ct,bw as G,b1 as Xe,b2 as S,ak as ue,b9 as de,ba as se,bb as We,b8 as Ve,bL as yt,bM as Lt,bN as xt,av as Et,aw as Ee,F as qe}from"./index.f06d32fc.js";import{E as St,a as Re,C as It,i as kt}from"./index.16857836.js";import{d as Mt}from"./icon_teacher.584214d2.js";import{i as Tt,E as Ut,a as Bt}from"./index2.b94ac0d9.js";import{v as Ot}from"./toolsValidate.2c211d6c.js";import{E as Xt,b as Wt}from"./index2.727af89f.js";import"./index2.d2718ad2.js";const Vt='a[href],button:not([disabled]),button:not([hidden]),:not([tabindex="-1"]),input:not([disabled]),input:not([type="hidden"]),select:not([disabled]),textarea:not([disabled])',qt=e=>getComputedStyle(e).position==="fixed"?!1:e.offsetParent!==null,Se=e=>Array.from(e.querySelectorAll(Vt)).filter(t=>Rt(t)&&qt(t)),Rt=e=>{if(e.tabIndex>0||e.tabIndex===0&&e.getAttribute("tabIndex")!==null)return!0;if(e.disabled)return!1;switch(e.nodeName){case"A":return!!e.href&&e.rel!=="ignore";case"INPUT":return!(e.type==="hidden"||e.type==="file");case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}},Nt=(e,t)=>{let s;ce(()=>e.value,i=>{var r,o;i?(s=document.activeElement,$e(t)&&((o=(r=t.value).focus)==null||o.call(r))):s.focus()})},pe="_trap-focus-children",R=[],Ie=e=>{if(R.length===0)return;const t=R[R.length-1][pe];if(t.length>0&&e.code===_e.tab){if(t.length===1){e.preventDefault(),document.activeElement!==t[0]&&t[0].focus();return}const s=e.shiftKey,i=e.target===t[0],r=e.target===t[t.length-1];i&&s&&(e.preventDefault(),t[t.length-1].focus()),r&&!s&&(e.preventDefault(),t[0].focus())}},Ht={beforeMount(e){e[pe]=Se(e),R.push(e),R.length<=1&&Te(document,"keydown",Ie)},updated(e){$(()=>{e[pe]=Se(e)})},unmounted(){R.shift(),R.length===0&&Ue(document,"keydown",Ie)}},Yt=U({name:"ElMessageBox",directives:{TrapFocus:Ht},components:J({ElButton:M,ElFocusTrap:et,ElInput:j,ElOverlay:tt,ElIcon:T},st),inheritAttrs:!1,props:{buttonSize:{type:String,validator:Tt},modal:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},closeOnHashChange:{type:Boolean,default:!0},center:Boolean,draggable:Boolean,roundButton:{default:!1,type:Boolean},container:{type:String,default:"body"},boxType:{type:String,default:""}},emits:["vanish","action"],setup(e,{emit:t}){const{t:s}=it(),i=ot("message-box"),r=D(!1),{nextZIndex:o}=rt(),a=Be({beforeClose:null,callback:null,cancelButtonText:"",cancelButtonClass:"",confirmButtonText:"",confirmButtonClass:"",customClass:"",customStyle:{},dangerouslyUseHTMLString:!1,distinguishCancelAndClose:!1,icon:"",inputPattern:null,inputPlaceholder:"",inputType:"text",inputValue:null,inputValidator:null,inputErrorMessage:"",message:null,modalFade:!0,modalClass:"",showCancelButton:!1,showConfirmButton:!0,type:"",title:void 0,showInput:!1,action:"",confirmButtonLoading:!1,cancelButtonLoading:!1,confirmButtonDisabled:!1,editorErrorMessage:"",validateError:!1,zIndex:o()}),n=F(()=>{const C=a.type;return{[i.bm("icon",C)]:C&&ye[C]}}),h=Le(),d=Le(),u=at(F(()=>e.buttonSize),{prop:!0,form:!0,formItem:!0}),f=F(()=>a.icon||ye[a.type]||""),p=F(()=>!!a.message),L=D(),A=D(),m=D(),v=D(),b=D(),De=F(()=>a.confirmButtonClass);ce(()=>a.inputValue,async C=>{await $(),e.boxType==="prompt"&&C!==null&&ge()},{immediate:!0}),ce(()=>r.value,C=>{var B,Y;C&&((e.boxType==="alert"||e.boxType==="confirm")&&(m.value=(Y=(B=b.value)==null?void 0:B.$el)!=null?Y:L.value),a.zIndex=o()),e.boxType==="prompt"&&(C?$().then(()=>{var Ae;v.value&&v.value.$el&&(m.value=(Ae=Pe())!=null?Ae:L.value)}):(a.editorErrorMessage="",a.validateError=!1))});const Fe=F(()=>e.draggable);lt(L,A,Fe),nt(async()=>{await $(),e.closeOnHashChange&&Te(window,"hashchange",Q)}),ct(()=>{e.closeOnHashChange&&Ue(window,"hashchange",Q)});function Q(){!r.value||(r.value=!1,$(()=>{a.action&&t("action",a.action)}))}const fe=()=>{e.closeOnClickModal&&oe(a.distinguishCancelAndClose?"close":"cancel")},ze=dt(fe),Ke=C=>{if(a.inputType!=="textarea")return C.preventDefault(),oe("confirm")},oe=C=>{var B;e.boxType==="prompt"&&C==="confirm"&&!ge()||(a.action=C,a.beforeClose?(B=a.beforeClose)==null||B.call(a,C,a,Q):Q())},ge=()=>{if(e.boxType==="prompt"){const C=a.inputPattern;if(C&&!C.test(a.inputValue||""))return a.editorErrorMessage=a.inputErrorMessage||s("el.messagebox.error"),a.validateError=!0,!1;const B=a.inputValidator;if(typeof B=="function"){const Y=B(a.inputValue);if(Y===!1)return a.editorErrorMessage=a.inputErrorMessage||s("el.messagebox.error"),a.validateError=!0,!1;if(typeof Y=="string")return a.editorErrorMessage=Y,a.validateError=!0,!1}}return a.editorErrorMessage="",a.validateError=!1,!0},Pe=()=>{const C=v.value.$refs;return C.input||C.textarea},me=()=>{oe("close")},je=()=>{e.closeOnPressEscape&&me()};return e.lockScroll&&ht(r),Nt(r),he(J({},ut(a)),{ns:i,overlayEvent:ze,visible:r,hasMessage:p,typeClass:n,contentId:h,inputId:d,btnSize:u,iconComponent:f,confirmButtonClasses:De,rootRef:L,focusStartRef:m,headerRef:A,inputRef:v,confirmRef:b,doClose:Q,handleClose:me,onCloseRequested:je,handleWrapperClick:fe,handleInputEnter:Ke,handleAction:oe,t:s})}}),Dt=["aria-label","aria-describedby"],Ft=["aria-label"],zt=["id"];function Kt(e,t,s,i,r,o){const a=z("el-icon"),n=z("close"),h=z("el-input"),d=z("el-button"),u=z("el-focus-trap"),f=z("el-overlay");return E(),O(gt,{name:"fade-in-linear",onAfterLeave:t[11]||(t[11]=p=>e.$emit("vanish")),persisted:""},{default:I(()=>[_(l(f,{"z-index":e.zIndex,"overlay-class":[e.ns.is("message-box"),e.modalClass],mask:e.modal},{default:I(()=>[g("div",{role:"dialog","aria-label":e.title,"aria-modal":"true","aria-describedby":e.showInput?void 0:e.contentId,class:y(`${e.ns.namespace.value}-overlay-message-box`),onClick:t[8]||(t[8]=(...p)=>e.overlayEvent.onClick&&e.overlayEvent.onClick(...p)),onMousedown:t[9]||(t[9]=(...p)=>e.overlayEvent.onMousedown&&e.overlayEvent.onMousedown(...p)),onMouseup:t[10]||(t[10]=(...p)=>e.overlayEvent.onMouseup&&e.overlayEvent.onMouseup(...p))},[l(u,{loop:"",trapped:e.visible,"focus-trap-el":e.rootRef,"focus-start-el":e.focusStartRef,onReleaseRequested:e.onCloseRequested},{default:I(()=>[g("div",{ref:"rootRef",class:y([e.ns.b(),e.customClass,e.ns.is("draggable",e.draggable),{[e.ns.m("center")]:e.center}]),style:P(e.customStyle),tabindex:"-1",onClick:t[7]||(t[7]=ae(()=>{},["stop"]))},[e.title!==null&&e.title!==void 0?(E(),q("div",{key:0,ref:"headerRef",class:y(e.ns.e("header"))},[g("div",{class:y(e.ns.e("title"))},[e.iconComponent&&e.center?(E(),O(a,{key:0,class:y([e.ns.e("status"),e.typeClass])},{default:I(()=>[(E(),O(le(e.iconComponent)))]),_:1},8,["class"])):k("v-if",!0),g("span",null,V(e.title),1)],2),e.showClose?(E(),q("button",{key:0,type:"button",class:y(e.ns.e("headerbtn")),"aria-label":e.t("el.messagebox.close"),onClick:t[0]||(t[0]=p=>e.handleAction(e.distinguishCancelAndClose?"close":"cancel")),onKeydown:t[1]||(t[1]=ne(ae(p=>e.handleAction(e.distinguishCancelAndClose?"close":"cancel"),["prevent"]),["enter"]))},[l(a,{class:y(e.ns.e("close"))},{default:I(()=>[l(n)]),_:1},8,["class"])],42,Ft)):k("v-if",!0)],2)):k("v-if",!0),g("div",{id:e.contentId,class:y(e.ns.e("content"))},[g("div",{class:y(e.ns.e("container"))},[e.iconComponent&&!e.center&&e.hasMessage?(E(),O(a,{key:0,class:y([e.ns.e("status"),e.typeClass])},{default:I(()=>[(E(),O(le(e.iconComponent)))]),_:1},8,["class"])):k("v-if",!0),e.hasMessage?(E(),q("div",{key:1,class:y(e.ns.e("message"))},[ft(e.$slots,"default",{},()=>[e.dangerouslyUseHTMLString?(E(),O(le(e.showInput?"label":"p"),{key:1,for:e.showInput?e.inputId:void 0,innerHTML:e.message},null,8,["for","innerHTML"])):(E(),O(le(e.showInput?"label":"p"),{key:0,for:e.showInput?e.inputId:void 0},{default:I(()=>[w(V(e.dangerouslyUseHTMLString?"":e.message),1)]),_:1},8,["for"]))])],2)):k("v-if",!0)],2),_(g("div",{class:y(e.ns.e("input"))},[l(h,{id:e.inputId,ref:"inputRef",modelValue:e.inputValue,"onUpdate:modelValue":t[2]||(t[2]=p=>e.inputValue=p),type:e.inputType,placeholder:e.inputPlaceholder,"aria-invalid":e.validateError,class:y({invalid:e.validateError}),onKeydown:ne(e.handleInputEnter,["enter"])},null,8,["id","modelValue","type","placeholder","aria-invalid","class","onKeydown"]),g("div",{class:y(e.ns.e("errormsg")),style:P({visibility:e.editorErrorMessage?"visible":"hidden"})},V(e.editorErrorMessage),7)],2),[[ee,e.showInput]])],10,zt),g("div",{class:y(e.ns.e("btns"))},[e.showCancelButton?(E(),O(d,{key:0,loading:e.cancelButtonLoading,class:y([e.cancelButtonClass]),round:e.roundButton,size:e.btnSize,onClick:t[3]||(t[3]=p=>e.handleAction("cancel")),onKeydown:t[4]||(t[4]=ne(ae(p=>e.handleAction("cancel"),["prevent"]),["enter"]))},{default:I(()=>[w(V(e.cancelButtonText||e.t("el.messagebox.cancel")),1)]),_:1},8,["loading","class","round","size"])):k("v-if",!0),_(l(d,{ref:"confirmRef",type:"primary",loading:e.confirmButtonLoading,class:y([e.confirmButtonClasses]),round:e.roundButton,disabled:e.confirmButtonDisabled,size:e.btnSize,onClick:t[5]||(t[5]=p=>e.handleAction("confirm")),onKeydown:t[6]||(t[6]=ne(ae(p=>e.handleAction("confirm"),["prevent"]),["enter"]))},{default:I(()=>[w(V(e.confirmButtonText||e.t("el.messagebox.confirm")),1)]),_:1},8,["loading","class","round","disabled","size"]),[[ee,e.showConfirmButton]])],2)],6)]),_:3},8,["trapped","focus-trap-el","focus-start-el","onReleaseRequested"])],42,Dt)]),_:3},8,["z-index","overlay-class","mask"]),[[ee,e.visible]])]),_:3})}var Pt=pt(Yt,[["render",Kt],["__file","/home/runner/work/element-plus/element-plus/packages/components/message-box/src/index.vue"]]);const ie=new Map,jt=(e,t,s=null)=>{const i=wt(Pt,e);return i.appContext=s,Oe(i,t),document.body.appendChild(t.firstElementChild),i.component},Gt=()=>document.createElement("div"),Zt=(e,t)=>{const s=Gt();e.onVanish=()=>{Oe(null,s),ie.delete(r)},e.onAction=o=>{const a=ie.get(r);let n;e.showInput?n={value:r.inputValue,action:o}:n=o,e.callback?e.callback(n,i.proxy):o==="cancel"||o==="close"?e.distinguishCancelAndClose&&o!=="cancel"?a.reject("close"):a.reject("cancel"):a.resolve(n)};const i=jt(e,s,t),r=i.proxy;for(const o in e)xe(e,o)&&!xe(r.$props,o)&&(r[o]=e[o]);return ce(()=>r.message,(o,a)=>{te(o)?i.slots.default=()=>[o]:te(a)&&!te(o)&&delete i.slots.default},{immediate:!0}),r.visible=!0,r};function Z(e,t=null){if(!mt)return Promise.reject();let s;return At(e)||te(e)?e={message:e}:s=e.callback,new Promise((i,r)=>{const o=Zt(e,t!=null?t:Z._context);ie.set(o,{options:e,callback:s,resolve:i,reject:r})})}const Qt=["alert","confirm","prompt"],Jt={alert:{closeOnPressEscape:!1,closeOnClickModal:!1},confirm:{showCancelButton:!0},prompt:{showCancelButton:!0,showInput:!0}};Qt.forEach(e=>{Z[e]=$t(e)});function $t(e){return(t,s,i,r)=>{let o;return vt(s)?(i=s,o=""):bt(s)?o="":o=s,Z(Object.assign(J({title:o,message:t,type:""},Jt[e]),i,{boxType:e}),r)}}Z.close=()=>{ie.forEach((e,t)=>{t.doClose()}),ie.clear()};Z._context=null;const X=Z;X.install=e=>{X._context=e._context,e.config.globalProperties.$msgbox=X,e.config.globalProperties.$messageBox=X,e.config.globalProperties.$alert=X.alert,e.config.globalProperties.$confirm=X.confirm,e.config.globalProperties.$prompt=X.prompt};const _t=X,es="_uploadSection_1p3wv_1",ts="_uploadFile_1p3wv_11",ss="_fileUpload_1p3wv_25",is="_uploadClass_1p3wv_25",os="_disabled_1p3wv_48";var K={uploadSection:es,uploadFile:ts,fileUpload:ss,uploadClass:is,disabled:os},rs="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD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C3neX5l2uAYknuKK42ouj/WSSMHpoVcaGxhNlXGVolbxTyRmyDLBCilZI5eBegC4yqvlQxMGxFIzC/AXsAMM8fFOYn7I6M0Cen4fjlOnzj2EfuTge9ZZbaseCyMml/PM/xOfOfsRbUvquxfKVhwNkDflJucXHAXJHhZm9KOblAOb2thzg55H5XX6vgzcp+Z4OXqHkOg5ml8lKruNYOEg7JPew6m0T9ZDteGXSGzkxDunaB/LQ1aItjkY/AA/7Wc4JL6xFAAAAAElFTkSuQmCC",ke=U({name:"col-upload-video",props:{modelValue:{type:String,default:""},disabled:{type:Boolean,default:!1},bucket:{type:String,default:"daya"},multiple:{type:Boolean,default:!1},limit:{type:Number,default:1},size:{type:Number,default:50},accept:{type:String,default:".mp4"},tips:{type:String,default:"\u8BF7\u4E0A\u4F20\u89C6\u9891"},extraTips:{type:String,default:"\u89C6\u9891\u6700\u5927\u4E0D\u80FD\u8D85\u8FC750MB"},multipleModel:{type:Function,default:e=>{}}},data(){return{ossUploadUrl:"https://ks3-cn-beijing.ksyuncs.com/"+this.bucket,dataObj:{policy:"",signature:"",key:"",KSSAccessKeyId:"",acl:"public-read",name:""},fileList:[],tempUrls:{},responseList:[],btnLoading:!1,loading:null}},methods:{handleSuccess(e,t,s){var i;if((i=this.loading)==null||i.close(),console.log(this.fileList,"fileList"),console.log(e,t,s,"response"),this.multiple)t.status==="success"&&this.responseList.push(this.tempUrls[t.uid]),s.length===this.responseList.length&&(this.btnLoading=!1,this.multipleModel(this.responseList));else{let r=this.ossUploadUrl+"/"+this.dataObj.key;this.$emit("update:modelValue",r)}},handleRemove(){console.log("remove")},handleChange(){console.log("handleChange")},handleProgress(e){console.log("handleProgress",e)},handleError(){var e;this.btnLoading=!1,(e=this.loading)==null||e.close()},async beforeUpload(e){var s;console.log(e);let t=!0;if(this.size&&(t=e.size/1024/1024<this.size,!t))return W.error(`\u6587\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC7${this.size}M!`),!1;this.multiple?this.btnLoading=!0:this.loading=St.service({target:this.$refs.uploadDom,lock:!0,fullscreen:!1,text:"\u4E0A\u4F20\u4E2D...",background:"rgba(0, 0, 0, 0.7)"});try{let i=e.name.replaceAll(" ","_"),r=new Date().getTime()+i,o={filename:i,bucketName:this.bucket,postData:{filename:i,acl:"public-read",key:r,unknowValueField:[]}};const{data:a}=await H.post("/api-website/getUploadSign",{data:o});this.dataObj={policy:a.policy,signature:a.signature,key:r,KSSAccessKeyId:a.kssAccessKeyId,acl:"public-read",name:i},this.tempUrls[e.uid]=this.ossUploadUrl+"/"+this.dataObj.key}catch{this.btnLoading=!1,(s=this.loading)==null||s.close()}},fileName(e=""){return e.split("/").pop()},handleExceed(e){if(e.length>this.limit)return W.error(`\u4E00\u6B21\u6027\u6700\u591A\u53EA\u80FD\u4E0A\u4F20${this.limit}\u4E2A\u6587\u4EF6`),!1}},render(){return l("div",{class:[K.colUpload,"w-full"]},[l(Re,{disabled:this.disabled,action:this.ossUploadUrl,data:this.dataObj,onSuccess:this.handleSuccess,onRemove:this.handleRemove,onChange:this.handleChange,onProgress:this.handleProgress,onError:this.handleError,fileList:this.fileList,showFileList:!1,accept:this.accept,beforeUpload:this.beforeUpload,onExceed:this.handleExceed,ref:"uploadRef",multiple:this.multiple,limit:this.limit,class:[this.multiple&&K.fileUpload,this.disabled&&K.disabled]},{default:()=>[l("div",{ref:"uploadDom",class:[K.uploadClass,"w-full"],style:{height:this.multiple?"40px":"106px"}},[this.modelValue?l("video",{ref:"videoUpload",crossorigin:"anonymous",class:K.uploadSection,src:this.modelValue},null):this.multiple?l(M,{size:"large",type:"primary",loading:this.btnLoading},{default:()=>[this.btnLoading?"\u4E0A\u4F20\u4E2D...":"\u70B9\u51FB\u4E0A\u4F20"]}):l("div",{class:[K.uploadSection,"flex items-center flex-col justify-center"]},[l("img",{src:rs,class:"w-8 h-7 mb-3"},null),l("p",null,[this.tips])])])]}),!this.multiple&&l("p",{class:"text-3 text-[#999999] leading-6 pt-1"},[this.extraTips])])}});const Ne=()=>({groupId:0,active:0,tabIndex:1,loadingStatus:!1,rate:0,subjectList:[],templateList:["https://daya.ks3-cn-beijing.ksyun.com/202204/T3unJdc.png","https://daya.ks3-cn-beijing.ksyun.com/202204/T3unJdl.png","https://daya.ks3-cn-beijing.ksyun.com/202204/T3unJdK.png","https://daya.ks3-cn-beijing.ksyun.com/202204/T3unJeA.png"],lessonGroup:{id:null,lessonName:"",lessonSubject:null,lessonDesc:"",lessonPrice:null,lessonCoverUrl:"",lessonCoverTemplateUrl:""},lessonList:[]}),c=Be(Ne()),as=()=>{Object.assign(c,Ne())},ls="_createSubmit_1kqna_7",ns="_introduction_1kqna_7",cs="_userDetail_1kqna_12",hs="_banner_1kqna_12",us="_userInfo_1kqna_18",ps="_avatar_1kqna_24",ds="_name_1kqna_30",fs="_buyNum_1kqna_39",gs="_buyNumInfo_1kqna_53",ms="_iconBuy_1kqna_59",As="_info_1kqna_62",vs="_userTitle_1kqna_68",bs="_videoImg_1kqna_74",ws="_videoStop_1kqna_81",Cs="_videoTitle_1kqna_93",ys="_videoTitleText_1kqna_101",Ls="_videoTitleContent_1kqna_106";var x={"course-preview":"_course-preview_1kqna_1",createSubmit:ls,introduction:ns,userDetail:cs,banner:hs,userInfo:us,avatar:ps,name:ds,buyNum:fs,buyNumInfo:gs,iconBuy:ms,info:As,userTitle:vs,videoImg:bs,videoStop:ws,videoTitle:Cs,videoTitleText:ys,videoTitleContent:Ls},xs="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAMAAADW3miqAAAAAXNSR0IArs4c6QAAAMxQTFRFAAAA/wAA/4AA/1VV/4BA/3hL/3lR/3lJ/3tM/3lK/3ZJ/3VL/3dK/3hM/3dL/3ZL/3lL/3dK/3hL/3dK/3hM/3hM/3ZN/3lK/3dM/3ZL/3dK/3hL/3dL/3hK/3ZM/3dK/3ZL/3ZK/3dL/3dL/3ZL/3dM/3dL/3dM/3dL/3dL/72U/7yT/7yU/3dM/3dL/3ZK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ZRRP0bQL7Ijn6lIugJEGfErDpoC8dUPTSh15o0qwoDYdknmXlk3ARnWMZc1G4Cqbz9JBPB+ElMlCgi8JABOXUpuepmU/XoqJY+5jJInOsPQa/jGi8sTEeNfD//AORQWsF93/GiwAAAABJRU5ErkJggg==",Is=U({name:"course-preview",computed:{userInfo(){const e=c.lessonGroup,t=Ct.user.data||{};return{id:t.id,username:t.username||`\u6E38\u5BA2${t.id||""}`,headUrl:t.headUrl,lessonName:e.lessonName,buyNum:0,lessonDesc:e.lessonDesc,lessonPrice:e.lessonPrice,lessonCoverUrl:e.lessonCoverTemplateUrl||e.lessonCoverUrl,lessonNum:c.lessonList.length}},lessonList(){return c.lessonList||[]}},render(){return l("div",{class:[x["course-preview"],"pb-3"]},[l("div",{class:x.userDetail},[l(G,{class:[x.banner],src:this.userInfo.lessonCoverUrl,fit:"cover"},null),l("div",{class:"bg-white"},[l("div",{class:"p-[14px] text-lg text-[#1a1a1a] font-medium leading-none"},[w("\u6807\u9898")]),l("div",{class:[x.userInfo,"mx-[14px] py-[14px]"]},[l("div",{class:"flex"},[l(G,{class:x.avatar,src:this.userInfo.headUrl||Mt,fit:""},null),l("div",{class:x.name},[this.userInfo.username||`\u6E38\u5BA2${this.userInfo.id||""}`,l("div",{class:x.buyNum},[this.userInfo.buyNum,w("\u4EBA\u5DF2\u8D2D\u4E70")])])]),l("div",{class:x.info},[w("\uFFE5"),this.userInfo.lessonPrice,w("/"),this.userInfo.lessonNum,w("\u8BFE\u65F6")])])])]),l("div",{class:[x["section-detail"],"mt-[10px] mx-[14px] rounded-lg bg-white"]},[l("div",{class:"flex items-center py-3 px-[10px] text-[#333333] text-base"},[l(T,{size:18,class:"mr-2"},{default:()=>[l("img",{src:xs},null)]}),w("\u8BFE\u7A0B\u4ECB\u7ECD")]),l("div",{class:"mx-[10px] pt-[10px] pb-4 text-sm text-[#7A7A7A] border-t border-t-[#EBEBEB]"},[this.userInfo.lessonDesc])]),l("div",{class:[x["section-detail"],"mt-[10px] mx-[14px] rounded-lg bg-white"]},[l("div",{class:"flex items-center py-3 px-[10px] text-[#333333] text-base"},[l(T,{size:18,class:"mr-2"},{default:()=>[l("img",{src:Es},null)]}),w("\u8BFE\u7A0B\u5217\u8868")]),l("div",{class:"mx-[10px] pt-[10px] pb-4 text-sm text-[#7A7A7A] border-t border-t-[#EBEBEB] flex flex-col"},[c.lessonList.map(e=>l("div",{class:"flex mb-3"},[l("div",{class:x.videoImg},[l(G,{class:"align-middle h-[70px] w-[100px]",src:e.coverUrl,fit:"cover"},null),l(T,{class:x.videoStop,size:26},{default:()=>[l("img",{src:Ss},null)]})]),l("div",{class:[x.videoTitle,"!h-[70px]"]},[l("p",{class:[x.videoTitleText,"whitespace-nowrap overflow-hidden text-ellipsis"]},[e.videoTitle]),l("p",{class:[x.videoTitleContent]},[e.videoContent])])]))])])])}});const ks="_courseContent_ca6ve_1";var Ms={courseContent:ks},Ts="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADoAAAA6CAMAAADWZboaAAAAAXNSR0IArs4c6QAAAKtQTFRFAAAA////////9vb28/Pz9PT09PT08/Pz8/Pz8/Pz9PT0DQ0NDg4ODw8PERERExMTFRUVFxcXGBgYGxsbHh4eICAgISEhJCQkQUFBRERER0dHS0tLTExMTk5OVVVVXFxcYWFhjY2Nk5OTlZWVlpaWmJiYmZmZnZ2dpaWlrKyss7Ozubm5v7+/xcXFysrKzc3N19fX2NjY5eXl6Ojo6+vr7e3t7u7u7+/v8/PzuMr56AAAAAt0Uk5TAAIFUVWKpNjc8v4WawkrAAABMklEQVRIx+3Xt3LDMBBF0RWDGC6Vc7ICZeVgK9j8/y9zISsV1oBA44KvYIM5DbGYeSsiImI5eS9IlBJ4eceSW2w/SRXf/oU5N0xSJnRzIiLiJhpxRUTsUIeGtojlJ1rxLXESzTiS16V58XSpJ4EuDeTV6bTZnP59+oruIoh2WnQGMNOiMUCc0YxmNKP/gn70G6PDMz2MGv1PBdoD2sdHemwDPQVaAeie7vTUBago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FAAAA////////9vb28/Pz9PT09PT08/Pz8/Pz8/Pz9PT0AAAACwsLGhoaLS0tNDQ0RUVFi4uLra2t19fX2NjY2dnZ7Ozs8/PzedusZQAAAAt0Uk5TAAIFUVWKpNjc8v4WawkrAAABBElEQVRIx+2XUQ6DIAxAq6KoExHd4P43HbppnNKAVLMf3w9Jw4uVlLQAjKSs4JUJouIFS2EhK80hyuwrJnltDlLnyaTmJoJ8yraOUWubc1qaKMoUmImEQRGrFsCd8V48vogeUTm4K2ExrYvVBphY1SBqQMKYGsI5ar/6QTe/yYPzaFD3fJWQ8H9O+JO0uwRccdgVoEAKU3jU8TDWX5nXOR6gzl+Z1wMqtt7qrd7qRZeOcNW3XKs2dsuwNwcbbjyqtHu6nTt0Niw9qsK7hvKousXMVvsaxxNx25e/52glm63XSKUdPaeK7VYVMnIFwCmDHmG8JAy1hFGaMsBTng2Ex0rsE+kNjFEHody3dJ8AAAAASUVORK5CYII=",Os=U({name:"course-content",data(){return{show:!1,form:{lessonList:[{key:1,videoTitle:"",videoContent:"",videoUrl:"",coverUrl:""}]}}},methods:{handleUpload(e){console.log(e),(e||[]).forEach(s=>{c.lessonList.push({videoTitle:"",videoContent:"",videoUrl:s,coverUrl:""})})},handleSubmit(){this.$refs.form.validate(async e=>{if(e){if(c.lessonList.length<=0){W.error("\u8BF7\u4E0A\u4F20\u8BFE\u7A0B\u89C6\u9891");return}console.log("\u63D0\u4EA4\u6570\u636E"),this.show=!0}else return this.$nextTick(()=>{document.getElementsByClassName("is-error")[0].scrollIntoView({block:"center",behavior:"smooth"})}),!1})},async createSubmit(){try{const e=c.lessonGroup;let t={lessonList:c.lessonList,lessonGroup:he(J({},e),{lessonCoverUrl:e.lessonCoverTemplateUrl||e.lessonCoverUrl})};c.groupId?(await H.post("/api-website/videoLessonGroup/update",{data:t}),W.success("\u4FEE\u6539\u6210\u529F")):(await H.post("/api-website/videoLessonGroup/add",{data:t}),W.success("\u521B\u5EFA\u6210\u529F")),sessionStorage.setItem("videoActiveName","DOING"),this.$router.back()}catch{}},swapItems(e,t,s){return e[t]=e.splice(s,1,e[t])[0],e}},render(){return l("div",{class:Ms.courseContent},[l(Xe,{class:"px-[140px] pb-10 pt-7 min-h-[280px]",size:"large",labelWidth:"90px",labelPosition:"left",ref:"form",model:c},{default:()=>[l(S,{label:"\u8BFE\u7A0B\u89C6\u9891",required:!0},{default:()=>[l(ke,{multiple:!0,limit:3,bucket:"video-course",multipleModel:e=>{this.handleUpload(e)}},null)]}),c.lessonList.map((e,t)=>l("div",{class:"p-4 pt-5 rounded-xl mb-3 border border-dashed border-gray-300 relative",key:e.key},[l("div",{class:"absolute right-4 top-4 z-10 flex"},[t!==0&&l(ue,{class:"box-item",effect:"dark",content:"\u4E0A\u79FB",placement:"top"},{default:()=>[l("div",{onClick:()=>{this.swapItems(c.lessonList,t,t-1)}},[l(T,{size:29},{default:()=>[l("img",{src:Us},null)]})])]}),c.lessonList.length-1!==t&&l(ue,{class:"box-item",effect:"dark",content:"\u4E0B\u79FB",placement:"top"},{default:()=>[l("div",{onClick:()=>{this.swapItems(c.lessonList,t,t+1)}},[l(T,{size:29,class:"ml-3"},{default:()=>[l("img",{src:Ts,title:"\u5411\u4E0B\u79FB\u52A8"},null)]})])]}),c.lessonList.length>1&&l(ue,{class:"box-item",effect:"dark",content:"\u5220\u9664",placement:"top"},{default:()=>[l("div",{onClick:()=>{_t.confirm("\u786E\u5B9A\u5220\u9664\u8BE5\u6761\u6570\u636E\u5417\uFF1F","\u63D0\u793A",{type:"warning"}).then(()=>{c.lessonList.splice(t,1)})}},[l(T,{size:29,class:"ml-3"},{default:()=>[l("img",{src:Bs},null)]})])]})]),l(de,null,{default:()=>[l(se,{span:10},{default:()=>[l(S,{label:`\u7B2C${t+1}\u8BFE`},{default:()=>[l(ke,{modelValue:e.videoUrl,"onUpdate:modelValue":s=>e.videoUrl=s,disabled:!0},null)]})]}),l(se,{span:10},{default:()=>[l(S,{label:"\u89C6\u9891\u5C01\u9762",prop:`lessonList.${t}.coverUrl`,rules:[{required:!0,message:"\u8BF7\u4E0A\u4F20\u89C6\u9891\u5C01\u9762"}]},{default:()=>[l(It,{modelValue:e.coverUrl,"onUpdate:modelValue":s=>e.coverUrl=s},null)]})]})]}),l(S,{label:"\u8BFE\u7A0B\u6807\u9898",prop:`lessonList.${t}.videoTitle`,rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u8BFE\u7A0B\u6807\u9898"}]},{default:()=>[l(j,{placeholder:"\u8BF7\u8F93\u5165\u8BFE\u7A0B\u6807\u9898",modelValue:e.videoTitle,"onUpdate:modelValue":s=>e.videoTitle=s},null)]}),l(S,{label:"\u8BFE\u7A0B\u4ECB\u7ECD",prop:`lessonList.${t}.videoContent`,rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u8BFE\u7A0B\u4ECB\u7ECD"}]},{default:()=>[l(j,{placeholder:"\u8BF7\u8F93\u5165\u8BFE\u7A0B\u4ECB\u7ECD",modelValue:e.videoContent,"onUpdate:modelValue":s=>e.videoContent=s,type:"textarea",maxlength:200,rows:4,showWordLimit:!0},null)]})]))]}),l("div",{class:"border-t border-t-[#E5E5E5] text-center pt-6 pb-7"},[l(M,{class:"!w-40 !h-[38px]",onClick:()=>{c.active=0;const e=document.documentElement.scrollTop||document.body.scrollTop;We(e,0)}},{default:()=>[w("\u4E0A\u4E00\u6B65")]}),l(M,{type:"primary",class:"!w-40 !h-[38px]",onClick:this.handleSubmit},{default:()=>[w("\u4E0B\u4E00\u6B65")]})]),l(Ve,{modelValue:this.show,"onUpdate:modelValue":e=>this.show=e,title:"\u9884\u89C8"},{default:()=>[l(Is,null,null)],footer:()=>l("span",{class:"dialog-footer !text-center block "},[l(M,{size:"large",round:!0,onClick:()=>{this.show=!1}},{default:()=>[w("\u8FD4\u56DE\u7F16\u8F91")]}),l(M,{size:"large",round:!0,type:"primary",onClick:this.createSubmit},{default:()=>[w("\u521B\u5EFA\u5B8C\u6210")]})])})])}});const Xs="_uploadSection_1scl2_1",Ws="_uploadClass_1scl2_11",Vs="_previewImg_1scl2_34",qs="_operation_1scl2_44";var N={uploadSection:Xs,uploadClass:Ws,"avatar-upload-preview_range":"_avatar-upload-preview_range_1scl2_19","avatar-upload-preview":"_avatar-upload-preview_1scl2_19",previewImg:Vs,operation:qs,"icon-rate":"_icon-rate_1scl2_54","vue-cropper":"_vue-cropper_1scl2_61","el-dialog":"_el-dialog_1scl2_65","el-dialog__header":"_el-dialog__header_1scl2_68","el-dialog__title":"_el-dialog__title_1scl2_72","el-dialog__headerbtn":"_el-dialog__headerbtn_1scl2_75","el-dialog__close":"_el-dialog__close_1scl2_75","el-dialog__body":"_el-dialog__body_1scl2_78"};const He={};He.getData=e=>new Promise((t,s)=>{let i={};Rs(e).then(r=>{i.arrayBuffer=r,i.orientation=Ds(r),t(i)}).catch(r=>{s(r)})});function Rs(e){let t=null;return new Promise((s,i)=>{if(e.src)if(/^data\:/i.test(e.src))t=Hs(e.src),s(t);else if(/^blob\:/i.test(e.src)){var r=new FileReader;r.onload=function(a){t=a.target.result,s(t)},Ns(e.src,function(a){r.readAsArrayBuffer(a)})}else{var o=new XMLHttpRequest;o.onload=function(){if(this.status==200||this.status===0)t=o.response,s(t);else throw"Could not load image";o=null},o.open("GET",e.src,!0),o.responseType="arraybuffer",o.send(null)}else i("img error")})}function Ns(e,t){var s=new XMLHttpRequest;s.open("GET",e,!0),s.responseType="blob",s.onload=function(i){(this.status==200||this.status===0)&&t(this.response)},s.send()}function Hs(e){e=e.replace(/^data\:([^\;]+)\;base64,/gmi,"");for(var t=atob(e),s=t.length,i=new ArrayBuffer(s),r=new Uint8Array(i),o=0;o<s;o++)r[o]=t.charCodeAt(o);return i}function Ys(e,t,s){var i="",r;for(r=t,s+=t;r<s;r++)i+=String.fromCharCode(e.getUint8(r));return i}function Ds(e){var t=new DataView(e),s=t.byteLength,i,r,o,a,n,h,d,u,f,p;if(t.getUint8(0)===255&&t.getUint8(1)===216)for(f=2;f<s;){if(t.getUint8(f)===255&&t.getUint8(f+1)===225){d=f;break}f++}if(d&&(r=d+4,o=d+10,Ys(t,r,4)==="Exif"&&(h=t.getUint16(o),n=h===18761,(n||h===19789)&&t.getUint16(o+2,n)===42&&(a=t.getUint32(o+4,n),a>=8&&(u=o+a)))),u){for(s=t.getUint16(u,n),p=0;p<s;p++)if(f=u+p*12+2,t.getUint16(f,n)===274){f+=8,i=t.getUint16(f,n);break}}return i}var Fs=(e,t)=>{const s=e.__vccOpts||e;for(const[i,r]of t)s[i]=r;return s};const zs=U({data:function(){return{w:0,h:0,scale:1,x:0,y:0,loading:!0,trueWidth:0,trueHeight:0,move:!0,moveX:0,moveY:0,crop:!1,cropping:!1,cropW:0,cropH:0,cropOldW:0,cropOldH:0,canChangeX:!1,canChangeY:!1,changeCropTypeX:1,changeCropTypeY:1,cropX:0,cropY:0,cropChangeX:0,cropChangeY:0,cropOffsertX:0,cropOffsertY:0,support:"",touches:[],touchNow:!1,rotate:0,isIos:!1,orientation:0,imgs:"",coe:.2,scaling:!1,scalingSet:"",coeStatus:"",isCanShow:!0}},props:{img:{type:[String,Blob,null,File],default:""},outputSize:{type:Number,default:1},outputType:{type:String,default:"jpeg"},info:{type:Boolean,default:!0},canScale:{type:Boolean,default:!0},autoCrop:{type:Boolean,default:!1},autoCropWidth:{type:[Number,String],default:0},autoCropHeight:{type:[Number,String],default:0},fixed:{type:Boolean,default:!1},fixedNumber:{type:Array,default:()=>[1,1]},fixedBox:{type:Boolean,default:!1},full:{type:Boolean,default:!1},canMove:{type:Boolean,default:!0},canMoveBox:{type:Boolean,default:!0},original:{type:Boolean,default:!1},centerBox:{type:Boolean,default:!1},high:{type:Boolean,default:!0},infoTrue:{type:Boolean,default:!1},maxImgSize:{type:[Number,String],default:2e3},enlarge:{type:[Number,String],default:1},preW:{type:[Number,String],default:0},mode:{type:String,default:"contain"},limitMinSize:{type:[Number,Array,String],default:()=>10}},computed:{cropInfo(){let e={};if(e.top=this.cropOffsertY>21?"-21px":"0px",e.width=this.cropW>0?this.cropW:0,e.height=this.cropH>0?this.cropH:0,this.infoTrue){let t=1;this.high&&!this.full&&(t=window.devicePixelRatio),this.enlarge!==1&!this.full&&(t=Math.abs(Number(this.enlarge))),e.width=e.width*t,e.height=e.height*t,this.full&&(e.width=e.width/this.scale,e.height=e.height/this.scale)}return e.width=e.width.toFixed(0),e.height=e.height.toFixed(0),e},isIE(){return!!window.ActiveXObject||"ActiveXObject"in window},passive(){return this.isIE?null:{passive:!1}}},watch:{img(){this.checkedImg()},imgs(e){e!==""&&this.reload()},cropW(){this.showPreview()},cropH(){this.showPreview()},cropOffsertX(){this.showPreview()},cropOffsertY(){this.showPreview()},scale(e,t){this.showPreview()},x(){this.showPreview()},y(){this.showPreview()},autoCrop(e){e&&this.goAutoCrop()},autoCropWidth(){this.autoCrop&&this.goAutoCrop()},autoCropHeight(){this.autoCrop&&this.goAutoCrop()},mode(){this.checkedImg()},rotate(){this.showPreview(),this.autoCrop?this.goAutoCrop(this.cropW,this.cropH):(this.cropW>0||this.cropH>0)&&this.goAutoCrop(this.cropW,this.cropH)}},methods:{getVersion(e){var t=navigator.userAgent.split(" "),s="";let i=0;const r=new RegExp(e,"i");for(var o=0;o<t.length;o++)r.test(t[o])&&(s=t[o]);return s?i=s.split("/")[1].split("."):i=["0","0","0"],i},checkOrientationImage(e,t,s,i){if(this.getVersion("chrome")[0]>=81)t=-1;else if(this.getVersion("safari")[0]>=605){const a=this.getVersion("version");a[0]>13&&a[1]>1&&(t=-1)}else{const a=navigator.userAgent.toLowerCase().match(/cpu iphone os (.*?) like mac os/);if(a){let n=a[1];n=n.split("_"),(n[0]>13||n[0]>=13&&n[1]>=4)&&(t=-1)}}let r=document.createElement("canvas"),o=r.getContext("2d");switch(o.save(),t){case 2:r.width=s,r.height=i,o.translate(s,0),o.scale(-1,1);break;case 3:r.width=s,r.height=i,o.translate(s/2,i/2),o.rotate(180*Math.PI/180),o.translate(-s/2,-i/2);break;case 4:r.width=s,r.height=i,o.translate(0,i),o.scale(1,-1);break;case 5:r.height=s,r.width=i,o.rotate(.5*Math.PI),o.scale(1,-1);break;case 6:r.width=i,r.height=s,o.translate(i/2,s/2),o.rotate(90*Math.PI/180),o.translate(-s/2,-i/2);break;case 7:r.height=s,r.width=i,o.rotate(.5*Math.PI),o.translate(s,-i),o.scale(-1,1);break;case 8:r.height=s,r.width=i,o.translate(i/2,s/2),o.rotate(-90*Math.PI/180),o.translate(-s/2,-i/2);break;default:r.width=s,r.height=i}o.drawImage(e,0,0,s,i),o.restore(),r.toBlob(a=>{let n=URL.createObjectURL(a);URL.revokeObjectURL(this.imgs),this.imgs=n},"image/"+this.outputType,1)},checkedImg(){if(this.img===null||this.img===""){this.imgs="",this.clearCrop();return}this.loading=!0,this.scale=1,this.rotate=0,this.clearCrop();let e=new Image;if(e.onload=()=>{if(this.img==="")return this.$emit("img-load","error"),!1;let s=e.width,i=e.height;He.getData(e).then(r=>{this.orientation=r.orientation||1;let o=Number(this.maxImgSize);if(!this.orientation&&s<o&i<o){this.imgs=this.img;return}s>o&&(i=i/s*o,s=o),i>o&&(s=s/i*o,i=o),this.checkOrientationImage(e,this.orientation,s,i)})},e.onerror=()=>{this.$emit("img-load","error")},this.img.substr(0,4)!=="data"&&(e.crossOrigin=""),this.isIE){var t=new XMLHttpRequest;t.onload=function(){var s=URL.createObjectURL(this.response);e.src=s},t.open("GET",this.img,!0),t.responseType="blob",t.send()}else e.src=this.img},startMove(e){if(e.preventDefault(),this.move&&!this.crop){if(!this.canMove)return!1;this.moveX=("clientX"in e?e.clientX:e.touches[0].clientX)-this.x,this.moveY=("clientY"in e?e.clientY:e.touches[0].clientY)-this.y,e.touches?(window.addEventListener("touchmove",this.moveImg),window.addEventListener("touchend",this.leaveImg),e.touches.length==2&&(this.touches=e.touches,window.addEventListener("touchmove",this.touchScale),window.addEventListener("touchend",this.cancelTouchScale))):(window.addEventListener("mousemove",this.moveImg),window.addEventListener("mouseup",this.leaveImg)),this.$emit("imgMoving",{moving:!0,axis:this.getImgAxis()}),this.$emit("img-moving",{moving:!0,axis:this.getImgAxis()})}else this.cropping=!0,window.addEventListener("mousemove",this.createCrop),window.addEventListener("mouseup",this.endCrop),window.addEventListener("touchmove",this.createCrop),window.addEventListener("touchend",this.endCrop),this.cropOffsertX=e.offsetX?e.offsetX:e.touches[0].pageX-this.$refs.cropper.offsetLeft,this.cropOffsertY=e.offsetY?e.offsetY:e.touches[0].pageY-this.$refs.cropper.offsetTop,this.cropX="clientX"in e?e.clientX:e.touches[0].clientX,this.cropY="clientY"in e?e.clientY:e.touches[0].clientY,this.cropChangeX=this.cropOffsertX,this.cropChangeY=this.cropOffsertY,this.cropW=0,this.cropH=0},touchScale(e){e.preventDefault();let t=this.scale;var s={x:this.touches[0].clientX,y:this.touches[0].clientY},i={x:e.touches[0].clientX,y:e.touches[0].clientY},r={x:this.touches[1].clientX,y:this.touches[1].clientY},o={x:e.touches[1].clientX,y:e.touches[1].clientY},a=Math.sqrt(Math.pow(s.x-r.x,2)+Math.pow(s.y-r.y,2)),n=Math.sqrt(Math.pow(i.x-o.x,2)+Math.pow(i.y-o.y,2)),h=n-a,d=1;d=d/this.trueWidth>d/this.trueHeight?d/this.trueHeight:d/this.trueWidth,d=d>.1?.1:d;var u=d*h;if(!this.touchNow){if(this.touchNow=!0,h>0?t+=Math.abs(u):h<0&&t>Math.abs(u)&&(t-=Math.abs(u)),this.touches=e.touches,setTimeout(()=>{this.touchNow=!1},8),!this.checkoutImgAxis(this.x,this.y,t))return!1;this.scale=t}},cancelTouchScale(e){window.removeEventListener("touchmove",this.touchScale)},moveImg(e){if(e.preventDefault(),e.touches&&e.touches.length===2)return this.touches=e.touches,window.addEventListener("touchmove",this.touchScale),window.addEventListener("touchend",this.cancelTouchScale),window.removeEventListener("touchmove",this.moveImg),!1;let t="clientX"in e?e.clientX:e.touches[0].clientX,s="clientY"in e?e.clientY:e.touches[0].clientY,i,r;i=t-this.moveX,r=s-this.moveY,this.$nextTick(()=>{if(this.centerBox){let o=this.getImgAxis(i,r,this.scale),a=this.getCropAxis(),n=this.trueHeight*this.scale,h=this.trueWidth*this.scale,d,u,f,p;switch(this.rotate){case 1:case-1:case 3:case-3:d=this.cropOffsertX-this.trueWidth*(1-this.scale)/2+(n-h)/2,u=this.cropOffsertY-this.trueHeight*(1-this.scale)/2+(h-n)/2,f=d-n+this.cropW,p=u-h+this.cropH;break;default:d=this.cropOffsertX-this.trueWidth*(1-this.scale)/2,u=this.cropOffsertY-this.trueHeight*(1-this.scale)/2,f=d-h+this.cropW,p=u-n+this.cropH;break}o.x1>=a.x1&&(i=d),o.y1>=a.y1&&(r=u),o.x2<=a.x2&&(i=f),o.y2<=a.y2&&(r=p)}this.x=i,this.y=r,this.$emit("imgMoving",{moving:!0,axis:this.getImgAxis()}),this.$emit("img-moving",{moving:!0,axis:this.getImgAxis()})})},leaveImg(e){window.removeEventListener("mousemove",this.moveImg),window.removeEventListener("touchmove",this.moveImg),window.removeEventListener("mouseup",this.leaveImg),window.removeEventListener("touchend",this.leaveImg),this.$emit("imgMoving",{moving:!1,axis:this.getImgAxis()}),this.$emit("img-moving",{moving:!1,axis:this.getImgAxis()})},scaleImg(){this.canScale&&window.addEventListener(this.support,this.changeSize,this.passive)},cancelScale(){this.canScale&&window.removeEventListener(this.support,this.changeSize)},changeSize(e){e.preventDefault();let t=this.scale;var s=e.deltaY||e.wheelDelta,i=navigator.userAgent.indexOf("Firefox");s=i>0?s*30:s,this.isIE&&(s=-s);var r=this.coe;r=r/this.trueWidth>r/this.trueHeight?r/this.trueHeight:r/this.trueWidth;var o=r*s;o<0?t+=Math.abs(o):t>Math.abs(o)&&(t-=Math.abs(o));let a=o<0?"add":"reduce";if(a!==this.coeStatus&&(this.coeStatus=a,this.coe=.2),this.scaling||(this.scalingSet=setTimeout(()=>{this.scaling=!1,this.coe=this.coe+=.01},50)),this.scaling=!0,!this.checkoutImgAxis(this.x,this.y,t))return!1;this.scale=t},changeScale(e){let t=this.scale;e=e||1;var s=20;if(s=s/this.trueWidth>s/this.trueHeight?s/this.trueHeight:s/this.trueWidth,e=e*s,e>0?t+=Math.abs(e):t>Math.abs(e)&&(t-=Math.abs(e)),!this.checkoutImgAxis(this.x,this.y,t))return!1;this.scale=t},createCrop(e){e.preventDefault();var t="clientX"in e?e.clientX:e.touches?e.touches[0].clientX:0,s="clientY"in e?e.clientY:e.touches?e.touches[0].clientY:0;this.$nextTick(()=>{var i=t-this.cropX,r=s-this.cropY;if(i>0?(this.cropW=i+this.cropChangeX>this.w?this.w-this.cropChangeX:i,this.cropOffsertX=this.cropChangeX):(this.cropW=this.w-this.cropChangeX+Math.abs(i)>this.w?this.cropChangeX:Math.abs(i),this.cropOffsertX=this.cropChangeX+i>0?this.cropChangeX+i:0),!this.fixed)r>0?(this.cropH=r+this.cropChangeY>this.h?this.h-this.cropChangeY:r,this.cropOffsertY=this.cropChangeY):(this.cropH=this.h-this.cropChangeY+Math.abs(r)>this.h?this.cropChangeY:Math.abs(r),this.cropOffsertY=this.cropChangeY+r>0?this.cropChangeY+r:0);else{var o=this.cropW/this.fixedNumber[0]*this.fixedNumber[1];o+this.cropOffsertY>this.h?(this.cropH=this.h-this.cropOffsertY,this.cropW=this.cropH/this.fixedNumber[1]*this.fixedNumber[0],i>0?this.cropOffsertX=this.cropChangeX:this.cropOffsertX=this.cropChangeX-this.cropW):this.cropH=o,this.cropOffsertY=this.cropOffsertY}})},changeCropSize(e,t,s,i,r){e.preventDefault(),window.addEventListener("mousemove",this.changeCropNow),window.addEventListener("mouseup",this.changeCropEnd),window.addEventListener("touchmove",this.changeCropNow),window.addEventListener("touchend",this.changeCropEnd),this.canChangeX=t,this.canChangeY=s,this.changeCropTypeX=i,this.changeCropTypeY=r,this.cropX="clientX"in e?e.clientX:e.touches[0].clientX,this.cropY="clientY"in e?e.clientY:e.touches[0].clientY,this.cropOldW=this.cropW,this.cropOldH=this.cropH,this.cropChangeX=this.cropOffsertX,this.cropChangeY=this.cropOffsertY,this.fixed&&this.canChangeX&&this.canChangeY&&(this.canChangeY=0),this.$emit("change-crop-size",{width:this.cropW,height:this.cropH})},changeCropNow(e){e.preventDefault();var t="clientX"in e?e.clientX:e.touches?e.touches[0].clientX:0,s="clientY"in e?e.clientY:e.touches?e.touches[0].clientY:0;let i=this.w,r=this.h,o=0,a=0;if(this.centerBox){let n=this.getImgAxis(),h=n.x2,d=n.y2;o=n.x1>0?n.x1:0,a=n.y1>0?n.y1:0,i>h&&(i=h),r>d&&(r=d)}this.$nextTick(()=>{var n=t-this.cropX,h=s-this.cropY;if(this.canChangeX&&(this.changeCropTypeX===1?this.cropOldW-n>0?(this.cropW=i-this.cropChangeX-n<=i-o?this.cropOldW-n:this.cropOldW+this.cropChangeX-o,this.cropOffsertX=i-this.cropChangeX-n<=i-o?this.cropChangeX+n:o):(this.cropW=Math.abs(n)+this.cropChangeX<=i?Math.abs(n)-this.cropOldW:i-this.cropOldW-this.cropChangeX,this.cropOffsertX=this.cropChangeX+this.cropOldW):this.changeCropTypeX===2&&(this.cropOldW+n>0?(this.cropW=this.cropOldW+n+this.cropOffsertX<=i?this.cropOldW+n:i-this.cropOffsertX,this.cropOffsertX=this.cropChangeX):(this.cropW=i-this.cropChangeX+Math.abs(n+this.cropOldW)<=i-o?Math.abs(n+this.cropOldW):this.cropChangeX-o,this.cropOffsertX=i-this.cropChangeX+Math.abs(n+this.cropOldW)<=i-o?this.cropChangeX-Math.abs(n+this.cropOldW):o))),this.canChangeY&&(this.changeCropTypeY===1?this.cropOldH-h>0?(this.cropH=r-this.cropChangeY-h<=r-a?this.cropOldH-h:this.cropOldH+this.cropChangeY-a,this.cropOffsertY=r-this.cropChangeY-h<=r-a?this.cropChangeY+h:a):(this.cropH=Math.abs(h)+this.cropChangeY<=r?Math.abs(h)-this.cropOldH:r-this.cropOldH-this.cropChangeY,this.cropOffsertY=this.cropChangeY+this.cropOldH):this.changeCropTypeY===2&&(this.cropOldH+h>0?(this.cropH=this.cropOldH+h+this.cropOffsertY<=r?this.cropOldH+h:r-this.cropOffsertY,this.cropOffsertY=this.cropChangeY):(this.cropH=r-this.cropChangeY+Math.abs(h+this.cropOldH)<=r-a?Math.abs(h+this.cropOldH):this.cropChangeY-a,this.cropOffsertY=r-this.cropChangeY+Math.abs(h+this.cropOldH)<=r-a?this.cropChangeY-Math.abs(h+this.cropOldH):a))),this.canChangeX&&this.fixed){var d=this.cropW/this.fixedNumber[0]*this.fixedNumber[1];d+this.cropOffsertY>r?(this.cropH=r-this.cropOffsertY,this.cropW=this.cropH/this.fixedNumber[1]*this.fixedNumber[0]):this.cropH=d}if(this.canChangeY&&this.fixed){var u=this.cropH/this.fixedNumber[1]*this.fixedNumber[0];u+this.cropOffsertX>i?(this.cropW=i-this.cropOffsertX,this.cropH=this.cropW/this.fixedNumber[0]*this.fixedNumber[1]):this.cropW=u}})},checkCropLimitSize(){let{cropW:e,cropH:t,limitMinSize:s}=this,i=new Array;return Array.isArray[s]?i=s:i=[s,s],e=parseFloat(i[0]),t=parseFloat(i[1]),[e,t]},changeCropEnd(e){window.removeEventListener("mousemove",this.changeCropNow),window.removeEventListener("mouseup",this.changeCropEnd),window.removeEventListener("touchmove",this.changeCropNow),window.removeEventListener("touchend",this.changeCropEnd)},endCrop(){this.cropW===0&&this.cropH===0&&(this.cropping=!1),window.removeEventListener("mousemove",this.createCrop),window.removeEventListener("mouseup",this.endCrop),window.removeEventListener("touchmove",this.createCrop),window.removeEventListener("touchend",this.endCrop)},startCrop(){this.crop=!0},stopCrop(){this.crop=!1},clearCrop(){this.cropping=!1,this.cropW=0,this.cropH=0},cropMove(e){if(e.preventDefault(),!this.canMoveBox)return this.crop=!1,this.startMove(e),!1;if(e.touches&&e.touches.length===2)return this.crop=!1,this.startMove(e),this.leaveCrop(),!1;window.addEventListener("mousemove",this.moveCrop),window.addEventListener("mouseup",this.leaveCrop),window.addEventListener("touchmove",this.moveCrop),window.addEventListener("touchend",this.leaveCrop);let t="clientX"in e?e.clientX:e.touches[0].clientX,s="clientY"in e?e.clientY:e.touches[0].clientY,i,r;i=t-this.cropOffsertX,r=s-this.cropOffsertY,this.cropX=i,this.cropY=r,this.$emit("cropMoving",{moving:!0,axis:this.getCropAxis()}),this.$emit("crop-moving",{moving:!0,axis:this.getCropAxis()})},moveCrop(e,t){let s=0,i=0;e&&(e.preventDefault(),s="clientX"in e?e.clientX:e.touches[0].clientX,i="clientY"in e?e.clientY:e.touches[0].clientY),this.$nextTick(()=>{let r,o,a=s-this.cropX,n=i-this.cropY;if(t&&(a=this.cropOffsertX,n=this.cropOffsertY),a<=0?r=0:a+this.cropW>this.w?r=this.w-this.cropW:r=a,n<=0?o=0:n+this.cropH>this.h?o=this.h-this.cropH:o=n,this.centerBox){let h=this.getImgAxis();r<=h.x1&&(r=h.x1),r+this.cropW>h.x2&&(r=h.x2-this.cropW),o<=h.y1&&(o=h.y1),o+this.cropH>h.y2&&(o=h.y2-this.cropH)}this.cropOffsertX=r,this.cropOffsertY=o,this.$emit("cropMoving",{moving:!0,axis:this.getCropAxis()}),this.$emit("crop-moving",{moving:!0,axis:this.getCropAxis()})})},getImgAxis(e,t,s){e=e||this.x,t=t||this.y,s=s||this.scale;let i={x1:0,x2:0,y1:0,y2:0},r=this.trueWidth*s,o=this.trueHeight*s;switch(this.rotate){case 0:i.x1=e+this.trueWidth*(1-s)/2,i.x2=i.x1+this.trueWidth*s,i.y1=t+this.trueHeight*(1-s)/2,i.y2=i.y1+this.trueHeight*s;break;case 1:case-1:case 3:case-3:i.x1=e+this.trueWidth*(1-s)/2+(r-o)/2,i.x2=i.x1+this.trueHeight*s,i.y1=t+this.trueHeight*(1-s)/2+(o-r)/2,i.y2=i.y1+this.trueWidth*s;break;default:i.x1=e+this.trueWidth*(1-s)/2,i.x2=i.x1+this.trueWidth*s,i.y1=t+this.trueHeight*(1-s)/2,i.y2=i.y1+this.trueHeight*s;break}return i},getCropAxis(){let e={x1:0,x2:0,y1:0,y2:0};return e.x1=this.cropOffsertX,e.x2=e.x1+this.cropW,e.y1=this.cropOffsertY,e.y2=e.y1+this.cropH,e},leaveCrop(e){window.removeEventListener("mousemove",this.moveCrop),window.removeEventListener("mouseup",this.leaveCrop),window.removeEventListener("touchmove",this.moveCrop),window.removeEventListener("touchend",this.leaveCrop),this.$emit("cropMoving",{moving:!1,axis:this.getCropAxis()}),this.$emit("crop-moving",{moving:!1,axis:this.getCropAxis()})},getCropChecked(e){let t=document.createElement("canvas"),s=new Image,i=this.rotate,r=this.trueWidth,o=this.trueHeight,a=this.cropOffsertX,n=this.cropOffsertY;s.onload=()=>{if(this.cropW!==0){let u=t.getContext("2d"),f=1;this.high&!this.full&&(f=window.devicePixelRatio),this.enlarge!==1&!this.full&&(f=Math.abs(Number(this.enlarge)));let p=this.cropW*f,L=this.cropH*f,A=r*this.scale*f,m=o*this.scale*f,v=(this.x-a+this.trueWidth*(1-this.scale)/2)*f,b=(this.y-n+this.trueHeight*(1-this.scale)/2)*f;switch(d(p,L),u.save(),i){case 0:this.full?(d(p/this.scale,L/this.scale),u.drawImage(s,v/this.scale,b/this.scale,A/this.scale,m/this.scale)):u.drawImage(s,v,b,A,m);break;case 1:case-3:this.full?(d(p/this.scale,L/this.scale),v=v/this.scale+(A/this.scale-m/this.scale)/2,b=b/this.scale+(m/this.scale-A/this.scale)/2,u.rotate(i*90*Math.PI/180),u.drawImage(s,b,-v-m/this.scale,A/this.scale,m/this.scale)):(v=v+(A-m)/2,b=b+(m-A)/2,u.rotate(i*90*Math.PI/180),u.drawImage(s,b,-v-m,A,m));break;case 2:case-2:this.full?(d(p/this.scale,L/this.scale),u.rotate(i*90*Math.PI/180),v=v/this.scale,b=b/this.scale,u.drawImage(s,-v-A/this.scale,-b-m/this.scale,A/this.scale,m/this.scale)):(u.rotate(i*90*Math.PI/180),u.drawImage(s,-v-A,-b-m,A,m));break;case 3:case-1:this.full?(d(p/this.scale,L/this.scale),v=v/this.scale+(A/this.scale-m/this.scale)/2,b=b/this.scale+(m/this.scale-A/this.scale)/2,u.rotate(i*90*Math.PI/180),u.drawImage(s,-b-A/this.scale,v,A/this.scale,m/this.scale)):(v=v+(A-m)/2,b=b+(m-A)/2,u.rotate(i*90*Math.PI/180),u.drawImage(s,-b-A,v,A,m));break;default:this.full?(d(p/this.scale,L/this.scale),u.drawImage(s,v/this.scale,b/this.scale,A/this.scale,m/this.scale)):u.drawImage(s,v,b,A,m)}u.restore()}else{let u=r*this.scale,f=o*this.scale,p=t.getContext("2d");switch(p.save(),i){case 0:d(u,f),p.drawImage(s,0,0,u,f);break;case 1:case-3:d(f,u),p.rotate(i*90*Math.PI/180),p.drawImage(s,0,-f,u,f);break;case 2:case-2:d(u,f),p.rotate(i*90*Math.PI/180),p.drawImage(s,-u,-f,u,f);break;case 3:case-1:d(f,u),p.rotate(i*90*Math.PI/180),p.drawImage(s,-u,0,u,f);break;default:d(u,f),p.drawImage(s,0,0,u,f)}p.restore()}e(t)};var h=this.img.substr(0,4);h!=="data"&&(s.crossOrigin="Anonymous"),s.src=this.imgs;function d(u,f){t.width=Math.round(u),t.height=Math.round(f)}},getCropData(e){this.getCropChecked(t=>{e(t.toDataURL("image/"+this.outputType,this.outputSize))})},getCropBlob(e){this.getCropChecked(t=>{t.toBlob(s=>e(s),"image/"+this.outputType,this.outputSize)})},showPreview(){if(this.isCanShow)this.isCanShow=!1,setTimeout(()=>{this.isCanShow=!0},16);else return!1;let e=this.cropW,t=this.cropH,s=this.scale;var i={};i.div={width:`${e}px`,height:`${t}px`};let r=(this.x-this.cropOffsertX)/s,o=(this.y-this.cropOffsertY)/s,a=0;i.w=e,i.h=t,i.url=this.imgs,i.img={width:`${this.trueWidth}px`,height:`${this.trueHeight}px`,transform:`scale(${s})translate3d(${r}px, ${o}px, ${a}px)rotateZ(${this.rotate*90}deg)`},i.html=`
  2. <div class="show-preview" style="width: ${i.w}px; height: ${i.h}px,; overflow: hidden">
  3. <div style="width: ${e}px; height: ${t}px">
  4. <img src=${i.url} style="width: ${this.trueWidth}px; height: ${this.trueHeight}px; transform:
  5. scale(${s})translate3d(${r}px, ${o}px, ${a}px)rotateZ(${this.rotate*90}deg)">
  6. </div>
  7. </div>`,this.$emit("realTime",i),this.$emit("real-time",i)},reload(){let e=new Image;e.onload=()=>{this.w=parseFloat(window.getComputedStyle(this.$refs.cropper).width),this.h=parseFloat(window.getComputedStyle(this.$refs.cropper).height),this.trueWidth=e.width,this.trueHeight=e.height,this.original?this.scale=1:this.scale=this.checkedMode(),this.$nextTick(()=>{this.x=-(this.trueWidth-this.trueWidth*this.scale)/2+(this.w-this.trueWidth*this.scale)/2,this.y=-(this.trueHeight-this.trueHeight*this.scale)/2+(this.h-this.trueHeight*this.scale)/2,this.loading=!1,this.autoCrop&&this.goAutoCrop(),this.$emit("img-load","success"),this.$emit("imgLoad","success"),setTimeout(()=>{this.showPreview()},20)})},e.onerror=()=>{this.$emit("imgLoad","error"),this.$emit("img-load","error")},e.src=this.imgs},checkedMode(){let e=1,t=this.trueWidth,s=this.trueHeight;const i=this.mode.split(" ");switch(i[0]){case"contain":this.trueWidth>this.w&&(e=this.w/this.trueWidth),this.trueHeight*e>this.h&&(e=this.h/this.trueHeight);break;case"cover":t=this.w,e=t/this.trueWidth,s=s*e,s<this.h&&(s=this.h,e=s/this.trueHeight);break;default:try{let r=i[0];if(r.search("px")!==-1){r=r.replace("px",""),t=parseFloat(r);const o=t/this.trueWidth;let a=1,n=i[1];n.search("px")!==-1&&(n=n.replace("px",""),s=parseFloat(n),a=s/this.trueHeight),e=Math.min(o,a)}if(r.search("%")!==-1&&(r=r.replace("%",""),t=parseFloat(r)/100*this.w,e=t/this.trueWidth),i.length===2&&r==="auto"){let o=i[1];o.search("px")!==-1&&(o=o.replace("px",""),s=parseFloat(o),e=s/this.trueHeight),o.search("%")!==-1&&(o=o.replace("%",""),s=parseFloat(o)/100*this.h,e=s/this.trueHeight)}}catch{e=1}}return e},goAutoCrop(e,t){if(this.imgs===""||this.imgs===null)return;this.clearCrop(),this.cropping=!0;let s=this.w,i=this.h;if(this.centerBox){const a=Math.abs(this.rotate)%2>0;let n=(a?this.trueHeight:this.trueWidth)*this.scale,h=(a?this.trueWidth:this.trueHeight)*this.scale;s=n<s?n:s,i=h<i?h:i}var r=e||parseFloat(this.autoCropWidth),o=t||parseFloat(this.autoCropHeight);(r===0||o===0)&&(r=s*.8,o=i*.8),r=r>s?s:r,o=o>i?i:o,this.fixed&&(o=r/this.fixedNumber[0]*this.fixedNumber[1]),o>this.h&&(o=this.h,r=o/this.fixedNumber[1]*this.fixedNumber[0]),this.changeCrop(r,o)},changeCrop(e,t){if(this.centerBox){let s=this.getImgAxis();e>s.x2-s.x1&&(e=s.x2-s.x1,t=e/this.fixedNumber[0]*this.fixedNumber[1]),t>s.y2-s.y1&&(t=s.y2-s.y1,e=t/this.fixedNumber[1]*this.fixedNumber[0])}this.cropW=e,this.cropH=t,this.checkCropLimitSize(),this.$nextTick(()=>{this.cropOffsertX=(this.w-this.cropW)/2,this.cropOffsertY=(this.h-this.cropH)/2,this.centerBox&&this.moveCrop(null,!0)})},refresh(){this.img,this.imgs="",this.scale=1,this.crop=!1,this.rotate=0,this.w=0,this.h=0,this.trueWidth=0,this.trueHeight=0,this.clearCrop(),this.$nextTick(()=>{this.checkedImg()})},rotateLeft(){this.rotate=this.rotate<=-3?0:this.rotate-1},rotateRight(){this.rotate=this.rotate>=3?0:this.rotate+1},rotateClear(){this.rotate=0},checkoutImgAxis(e,t,s){e=e||this.x,t=t||this.y,s=s||this.scale;let i=!0;if(this.centerBox){let r=this.getImgAxis(e,t,s),o=this.getCropAxis();r.x1>=o.x1&&(i=!1),r.x2<=o.x2&&(i=!1),r.y1>=o.y1&&(i=!1),r.y2<=o.y2&&(i=!1)}return i}},mounted(){this.support="onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll";let e=this;var t=navigator.userAgent;this.isIOS=!!t.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),HTMLCanvasElement.prototype.toBlob||Object.defineProperty(HTMLCanvasElement.prototype,"toBlob",{value:function(s,i,r){for(var o=atob(this.toDataURL(i,r).split(",")[1]),a=o.length,n=new Uint8Array(a),h=0;h<a;h++)n[h]=o.charCodeAt(h);s(new Blob([n],{type:e.type||"image/png"}))}}),this.showPreview(),this.checkedImg()},destroyed(){window.removeEventListener("mousemove",this.moveCrop),window.removeEventListener("mouseup",this.leaveCrop),window.removeEventListener("touchmove",this.moveCrop),window.removeEventListener("touchend",this.leaveCrop),this.cancelScale()}}),Ks={key:0,class:"cropper-box"},Ps=["src"],js={class:"cropper-view-box"},Gs=["src"],Zs={key:1};function Qs(e,t,s,i,r,o){return E(),q("div",{class:"vue-cropper",ref:"cropper",onMouseover:t[28]||(t[28]=(...a)=>e.scaleImg&&e.scaleImg(...a)),onMouseout:t[29]||(t[29]=(...a)=>e.cancelScale&&e.cancelScale(...a))},[e.imgs?(E(),q("div",Ks,[_(g("div",{class:"cropper-box-canvas",style:P({width:e.trueWidth+"px",height:e.trueHeight+"px",transform:"scale("+e.scale+","+e.scale+") translate3d("+e.x/e.scale+"px,"+e.y/e.scale+"px,0)rotateZ("+e.rotate*90+"deg)"})},[g("img",{src:e.imgs,alt:"cropper-img",ref:"cropperImg"},null,8,Ps)],4),[[ee,!e.loading]])])):k("",!0),g("div",{class:y(["cropper-drag-box",{"cropper-move":e.move&&!e.crop,"cropper-crop":e.crop,"cropper-modal":e.cropping}]),onMousedown:t[0]||(t[0]=(...a)=>e.startMove&&e.startMove(...a)),onTouchstart:t[1]||(t[1]=(...a)=>e.startMove&&e.startMove(...a))},null,34),_(g("div",{class:"cropper-crop-box",style:P({width:e.cropW+"px",height:e.cropH+"px",transform:"translate3d("+e.cropOffsertX+"px,"+e.cropOffsertY+"px,0)"})},[g("span",js,[g("img",{style:P({width:e.trueWidth+"px",height:e.trueHeight+"px",transform:"scale("+e.scale+","+e.scale+") translate3d("+(e.x-e.cropOffsertX)/e.scale+"px,"+(e.y-e.cropOffsertY)/e.scale+"px,0)rotateZ("+e.rotate*90+"deg)"}),src:e.imgs,alt:"cropper-img"},null,12,Gs)]),g("span",{class:"cropper-face cropper-move",onMousedown:t[2]||(t[2]=(...a)=>e.cropMove&&e.cropMove(...a)),onTouchstart:t[3]||(t[3]=(...a)=>e.cropMove&&e.cropMove(...a))},null,32),e.info?(E(),q("span",{key:0,class:"crop-info",style:P({top:e.cropInfo.top})},V(e.cropInfo.width)+" \xD7 "+V(e.cropInfo.height),5)):k("",!0),e.fixedBox?k("",!0):(E(),q("span",Zs,[g("span",{class:"crop-line line-w",onMousedown:t[4]||(t[4]=a=>e.changeCropSize(a,!1,!0,0,1)),onTouchstart:t[5]||(t[5]=a=>e.changeCropSize(a,!1,!0,0,1))},null,32),g("span",{class:"crop-line line-a",onMousedown:t[6]||(t[6]=a=>e.changeCropSize(a,!0,!1,1,0)),onTouchstart:t[7]||(t[7]=a=>e.changeCropSize(a,!0,!1,1,0))},null,32),g("span",{class:"crop-line line-s",onMousedown:t[8]||(t[8]=a=>e.changeCropSize(a,!1,!0,0,2)),onTouchstart:t[9]||(t[9]=a=>e.changeCropSize(a,!1,!0,0,2))},null,32),g("span",{class:"crop-line line-d",onMousedown:t[10]||(t[10]=a=>e.changeCropSize(a,!0,!1,2,0)),onTouchstart:t[11]||(t[11]=a=>e.changeCropSize(a,!0,!1,2,0))},null,32),g("span",{class:"crop-point point1",onMousedown:t[12]||(t[12]=a=>e.changeCropSize(a,!0,!0,1,1)),onTouchstart:t[13]||(t[13]=a=>e.changeCropSize(a,!0,!0,1,1))},null,32),g("span",{class:"crop-point point2",onMousedown:t[14]||(t[14]=a=>e.changeCropSize(a,!1,!0,0,1)),onTouchstart:t[15]||(t[15]=a=>e.changeCropSize(a,!1,!0,0,1))},null,32),g("span",{class:"crop-point point3",onMousedown:t[16]||(t[16]=a=>e.changeCropSize(a,!0,!0,2,1)),onTouchstart:t[17]||(t[17]=a=>e.changeCropSize(a,!0,!0,2,1))},null,32),g("span",{class:"crop-point point4",onMousedown:t[18]||(t[18]=a=>e.changeCropSize(a,!0,!1,1,0)),onTouchstart:t[19]||(t[19]=a=>e.changeCropSize(a,!0,!1,1,0))},null,32),g("span",{class:"crop-point point5",onMousedown:t[20]||(t[20]=a=>e.changeCropSize(a,!0,!1,2,0)),onTouchstart:t[21]||(t[21]=a=>e.changeCropSize(a,!0,!1,2,0))},null,32),g("span",{class:"crop-point point6",onMousedown:t[22]||(t[22]=a=>e.changeCropSize(a,!0,!0,1,2)),onTouchstart:t[23]||(t[23]=a=>e.changeCropSize(a,!0,!0,1,2))},null,32),g("span",{class:"crop-point point7",onMousedown:t[24]||(t[24]=a=>e.changeCropSize(a,!1,!0,0,2)),onTouchstart:t[25]||(t[25]=a=>e.changeCropSize(a,!1,!0,0,2))},null,32),g("span",{class:"crop-point point8",onMousedown:t[26]||(t[26]=a=>e.changeCropSize(a,!0,!0,2,2)),onTouchstart:t[27]||(t[27]=a=>e.changeCropSize(a,!0,!0,2,2))},null,32)]))],4),[[ee,e.cropping]])],544)}var Ye=Fs(zs,[["render",Qs],["__scopeId","data-v-be5e5ddc"]]);typeof window!="undefined"&&window.Vue&&window.Vue.createApp({}).component("VueCropper",Ye);var Js="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAABBlJREFUaEPtmVuoVkUUx3/HFxWflFIQFPGCL0mBmhdCBEW8PqhkUSEmomjpiyTqiwpeUXxIFE1KyEIzCcUoBStQwhteMJTIEgzRoBTSXnoy/jIT6wyz9579fXt/ng8c2Jzz7Zm91v+/1po1M2s6aPPW0eb4eU4g8OArwERgODDIPH8Dv5vnHHASeNxsBFThgZnAXAdcoMu0L4EfgGPA/TIf+rHNEBDwxcCsRhQH39wD9gP7yhJphEBfYI+zeoj9Z+B7QJb9C3jg/vYAepvnbUBPzwwi61ONUpbAKOA40D9Q8BFwADifqhjoA7wJLARGBt/JAPNSZJUhIKusiwAX+MspynLGKBT1WCI3gJeK5KYSWOrCxsqThWSpKpu8uCAQmIsxhcBs4KtA6ADgbpXIjazNwBrz+1tgepauIgID3aQc4gQ8BAYDyut1tknAaaNgO7AqprCIgLKNwkftV2AO8FOdyI1sTe6Pze/3ImGcu5WYAXxtBMgqSpGtbLuBZU7hb8A44E8LIM8DZ4HX3OBtwOpWIne6XgR+BIa531uD+ZHpgbeAz91H14AJVexbGjTAEmCv+/ZfYDxwxcvK8oBCRyGkthLYGShPXSn9uLLjQ66ngCnupWRtyCOgsFH4qCnrjAC0V7EttqiFSqXEEggXwbzxYd+7wCfu5QVgbB6BLSbelYU0+8PWagJad7Qd901p/bZ+xELokNujqH8+cLCAwP/udOO8pbM8kDI+opKLwGjXsQLYlUXAZp+XgesJBGKhkkegaHyMgPX6DuCDLALKt1pts/r13gprBmiWnBiB5cCHrkNnB23+OoWQXKLdnxaL7kaC0paOgLaFim1fSgg14gGdHz5zio4Ab4QEZPXv3DnWA1I6jZ24mpnEKR6LeWAa8I3rUFqdGgsR6yb163D+S8EciCnTOwtUXvFWr5WAFMs9r7uN1KIMdAKkDPYkksmeWQh5rCqNXAVecGfaLAsXZQq7YqZ4oNMKGxFeOInDSZq6/OdN7qLJWiYLJafRFIvnkUsJoaKsFcOQvJClEiiztymbtUIMpbYSVRHImgNZ8vPmQKnNXCqBonHKUH7fkzKf7PhQtt1O2zTcFtXphg401gLvuNV5Y5HJa+hv+EgpLK+6s4C21GrRqkANoK3Ipg71EnQ0KOKK1KWaQXvxTZdVvKA/gH4GdFEtqQp+lRW2BEYljXBDNwaenpDqaJWWFj1Am4f9u/cBxWiVrZbirgeoG5kTAdpP3a71TJMsai+ve3zaoaq8ER5yVIj9AjgM/JNIpuUXHBbXWmBTBOgdQHUbFYJvAbqkuAl06ypXTBazavY6+OjplWj1rGEtveQLQehq1RPxdZtUPs/0mjUGcjIwFFDlTH/9/4+68kV3qrVrGdeKVbUW4F5o2xP4DzVSDEAyxtmHAAAAAElFTkSuQmCC",$s=U({name:"cropper",props:{cropperNo:{type:Function,default:e=>{}},cropperOk:{type:Function,default:e=>{}},bucket:{type:String,default:"daya"}},data(){return{ossUploadUrl:"https://ks3-cn-beijing.ksyuncs.com/"+this.bucket,dataObj:{policy:"",signature:"",key:"",KSSAccessKeyId:"",acl:"public-read",name:""},visible:!1,img:null,options:{img:"",autoCrop:!0,autoCropWidth:180,autoCropHeight:180,fixedBox:!0,full:!1,enlarge:1,previewsCircle:!0,centerBox:!0,outputType:"png",title:"\u4FEE\u6539\u5934\u50CF",name:null},previews:{},url:{upload:"/sys/common/saveToImgByStr"},submitLoading:!1}},methods:{edit(e){const{options:t}=this;this.visible=!0,this.options=Object.assign({},t,e),console.log(this.options)},cancelHandel(){this.visible=!1,this.cropperNo()},okHandel(){this.$refs.cropperRef.getCropBlob(async e=>{this.submitLoading=!0;const t=this.options,s=(t.name?t.name.split(".")[0]:+new Date)+".png";try{let i=new Date().getTime()+s,r={filename:s,bucketName:this.bucket,postData:{filename:s,acl:"public-read",key:i,unknowValueField:[]}};const o=await H.post("/api-website/getUploadSign",{data:r});this.dataObj={policy:o.data.policy,signature:o.data.signature,key:i,KSSAccessKeyId:o.data.kssAccessKeyId,acl:"public-read",name:s};let a=new FormData;for(let h in this.dataObj)a.append(h,this.dataObj[h]);a.append("file",this.blobToFile(e,s),s),await yt(this.ossUploadUrl,{method:"POST",data:a}),console.log(this.ossUploadUrl+"/"+i);const n=this.ossUploadUrl+"/"+i;this.cropperOk(n)}catch(i){W.error(i)}finally{this.submitLoading=!1,this.cancelHandel()}})},blobToFile(e,t){return e.lastModifiedDate=new Date,e.name=t,e},base64ToFile(e,t){let s=e.split(","),i=s[0].match(/:(.*?);/)[1],r=atob(s[1]),o=r.length,a=new Uint8Array(o);for(;o--;)a[o]=r.charCodeAt(o);return new File([a],t,{type:i})},realTime(e){this.previews=e},changeScale(e){e=e||1,this.$refs.cropperRef.changeScale(e)},rotateLeft(){this.$refs.cropperRef.rotateLeft()},rotateRight(){this.$refs.cropperRef.rotateRight()}},render(){return l(Ve,{modelValue:this.visible,"onUpdate:modelValue":e=>this.visible=e,appendToBody:!0,title:this.options.title,closeOnClickModal:!1,width:"800px"},{default:()=>[l(de,null,{default:()=>[l(se,{xs:24,md:12,style:{width:"350px"}},{default:()=>[l(Ye,{ref:"cropperRef",img:this.options.img,info:!0,autoCrop:this.options.autoCrop,autoCropWidth:this.options.autoCropWidth,full:this.options.full,outputType:this.options.outputType,autoCropHeight:this.options.autoCropHeight,fixedBox:this.options.fixedBox,enlarge:this.options.enlarge,onRealTime:this.realTime,style:{height:"350px"}},null),l("div",{class:"flex pt-2"},[l("div",{onClick:()=>{this.changeScale(1)},class:"mr-2 cursor-pointer",title:"\u653E\u5927"},[l(T,{size:30,color:"#333"},{default:()=>[l(Lt,null,null)]})]),l("div",{onClick:()=>{this.changeScale(-1)},class:"mr-2 cursor-pointer",title:"\u7F29\u5C0F"},[l(T,{size:30,color:"#333"},{default:()=>[l(xt,null,null)]})]),l("div",{onClick:this.rotateRight,title:"\u5411\u53F3\u65CB\u8F6C",class:"cursor-pointer"},[l("img",{src:Js,class:"w-[30px] h-[30px]"},null)])])]}),l(se,{xs:24,md:12,style:{height:"350px"}},{default:()=>[l("div",{class:N.previewImg},[l("span",null,[w("\u9884\u89C8\u56FE\u7247")]),l("div",{class:this.options.previewsCircle?N["avatar-upload-preview"]:N["avatar-upload-preview_range"],style:{width:this.options.autoCropWidth+"px",height:this.options.autoCropHeight+"px"}},[l(G,{src:this.previews.url,style:this.previews.img},null)])])]})]})],footer:()=>l("span",{class:"dialog-footer !text-center block"},[l(M,{onClick:this.cancelHandel,disabled:this.submitLoading},{default:()=>[w("\u53D6\u6D88")]}),l(M,{type:"primary",onClick:this.okHandel,loading:this.submitLoading},{default:()=>[w("\u4FDD \u5B58")]})])})}}),_s=U({name:"col-cropper",props:{modelValue:{type:String,default:""},options:{type:Object,default:{autoCrop:!0,enlarge:1,autoCropWidth:200,autoCropHeight:200,fixedBox:!0,previewsCircle:!0,title:"\u4E0A\u4F20\u56FE\u7247"}},showSize:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},bucket:{type:String,default:"daya"},size:{type:Number,default:5},accept:{type:String,default:"images/*"},tips:{type:String,default:"\u8BF7\u4E0A\u4F20\u56FE\u7247"},extraTips:{type:String,default:"\u56FE\u7247\u6700\u5927\u4E0D\u80FD\u8D85\u8FC75MB"},cropUploadSuccess:{type:Function,default:e=>{}}},data(){return{isStopRun:!1,loading:!1}},methods:{onDelete(){this.$emit("update:modelValue","")},async handleChange(e){if(this.isStopRun)return;this.loading=!0;const t=this.options;this.getBase64(e.file,s=>{const i=Object.assign({},t,{img:s,name:e.file.name});this.$refs.CropperModal.edit(i)})},beforeUpload(e){this.isStopRun=!1;var t=e.type;if(t.indexOf("image")<0)return W.warning("\u8BF7\u4E0A\u4F20\u56FE\u7247"),this.isStopRun=!0,!1;console.log(this.size);const s=this.size||0,i=e.size<s*1024*1024;return i||(W.error("\u56FE\u7247\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC7"+this.size+"MB!"),this.isStopRun=!0),i},error(){this.remove(),this.loading=!1},remove(){this.onDelete()},handleCropperSuccess(e){this.loading=!1,console.log(e,"success"),this.$emit("update:modelValue",e),this.cropUploadSuccess(e)},handleCropperClose(){this.loading=!1,this.remove()},getBase64(e,t){const s=new FileReader;s.addEventListener("load",()=>t(s.result)),s.readAsDataURL(e)}},render(){return l("div",{class:[N.colUpload,"w-full"]},[l(Re,{disabled:this.disabled,showFileList:!1,accept:this.accept,beforeUpload:this.beforeUpload,httpRequest:this.handleChange,ref:"uploadRef"},{default:()=>[l("div",{ref:"uploadDom",class:[N.uploadClass,"w-full"],style:{height:"106px"}},[this.modelValue?l(G,{src:this.modelValue,fit:"cover",class:N.uploadSection},null):l("div",{class:[N.uploadSection,"flex items-center flex-col justify-center"]},[l("img",{src:kt,class:"w-8 h-7 mb-3"},null),l("p",null,[this.tips])])])]}),l("p",{class:"text-3 text-[#999999] leading-6 pt-1"},[this.extraTips]),l($s,{ref:"CropperModal",bucket:this.bucket,cropperNo:this.handleCropperClose,cropperOk:this.handleCropperSuccess},null)])}});const ei="_tabs_1gmo5_1";var ti={tabs:ei};function Me(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!te(e)}var si=U({name:"course-info",data(){return{url:"",calcRatePrice:0}},computed:{choiceSubjectIds(){let e=c.lessonGroup.lessonSubject?Number(c.lessonGroup.lessonSubject):null;return e?[e]:[]},subjectList(){return c.subjectList||[]},lessonSubjectName(){let e="";return this.subjectList.forEach(t=>{this.choiceSubjectIds.includes(t.id)&&(e=t.name)}),e}},async mounted(){try{if(c.subjectList.length<=0){const e=await H.post("/api-website/teacher/querySubject");c.subjectList=e.data||[]}}catch{}},methods:{onFormatter(e){e.target.value=Ot(e.target.value);let t=c.rate||0,s=e.target.value||0;this.calcRatePrice=(s-t/100*s).toFixed(2)},tabChange(e){this.$refs.form.clearValidate("lessonCoverTemplateUrl"),this.$refs.form.clearValidate("lessonCoverUrl"),c.tabIndex=e},selectImg(e){c.lessonGroup.lessonCoverUrl="",c.lessonGroup.lessonCoverTemplateUrl=e}},render(){let e,t;return l(qe,null,[l(Xe,{class:"px-[200px] pb-10 pt-7",size:"large",ref:"form",labelWidth:"100px",labelPosition:"left",model:c.lessonGroup},{default:()=>[l(S,{label:"\u8BFE\u7A0B\u540D\u79F0",prop:"lessonName",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u8BFE\u7A0B\u540D\u79F0"}]},{default:()=>[l(j,{modelValue:c.lessonGroup.lessonName,"onUpdate:modelValue":s=>c.lessonGroup.lessonName=s,placeholder:"\u8BF7\u8F93\u5165\u8BFE\u7A0B\u540D\u79F0"},null)]}),l(S,{label:"\u8BFE\u7A0B\u58F0\u90E8",prop:"lessonSubject",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u8BFE\u7A0B\u58F0\u90E8"}]},{default:()=>[l(Ut,{class:"w-full",modelValue:c.lessonGroup.lessonSubject,"onUpdate:modelValue":s=>c.lessonGroup.lessonSubject=s,placeholder:"\u8BF7\u9009\u62E9\u8BFE\u7A0B\u58F0\u90E8"},Me(e=c.subjectList.map(s=>l(Bt,{key:s.id,value:s.id,label:s.name},null)))?e:{default:()=>[e]})]}),l(S,{label:"\u8BFE\u7A0B\u4ECB\u7ECD",prop:"lessonDesc",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u8BFE\u7A0B\u4ECB\u7ECD"}]},{default:()=>[l(j,{placeholder:"\u8BF7\u8F93\u5165\u8BFE\u7A0B\u4ECB\u7ECD",modelValue:c.lessonGroup.lessonDesc,"onUpdate:modelValue":s=>c.lessonGroup.lessonDesc=s,type:"textarea",maxlength:200,rows:4,showWordLimit:!0},null)]}),l(S,{label:"\u8BFE\u7A0B\u7EC4\u552E\u4EF7",prop:"lessonPrice",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u8BFE\u7A0B\u7EC4\u552E\u4EF7"}]},{default:()=>[l(j,{placeholder:"\u8BF7\u8F93\u5165\u8BFE\u7A0B\u7EC4\u552E\u4EF7",modelValue:c.lessonGroup.lessonPrice,"onUpdate:modelValue":s=>c.lessonGroup.lessonPrice=s,onKeyup:this.onFormatter},{append:()=>l("span",{class:"text-base text-[#333]"},[w("\u5143")])})]}),l("div",{class:"text-sm text-[#999] pl-[90px] leading-relaxed pb-2"},[l("p",null,[w("\u6263\u9664\u624B\u7EED\u8D39\u540E\u60A8\u7684\u8BFE\u7A0B\u9884\u8BA1\u6536\u5165\u4E3A\uFF1A ")]),l("p",null,[w("\u8BFE\u7A0B\u7EC4\u603B\u6536\u5165"),l("span",{class:"px-1 text-[#FF4E19]"},[this.calcRatePrice]),w("\u5143/\u4EBA")]),l("p",null,[w("\u60A8\u7684\u8BFE\u7A0B\u6536\u5165\u5C06\u5728\u8BFE\u7A0B\u7ED3\u675F\u540E\u7ED3\u7B97\u5230\u60A8\u7684\u8D26\u6237\u4E2D ")])]),l(S,{label:"\u8BFE\u7A0B\u5C01\u9762",class:"!mb-0"},{default:()=>[l(Et,{modelValue:c.tabIndex,"onUpdate:modelValue":s=>c.tabIndex=s,class:ti.tabs,"onTab-change":s=>{this.tabChange(s)}},{default:()=>[l(Ee,{label:"\u56FE\u7247\u6A21\u677F",name:1},null),l(Ee,{label:"\u81EA\u5B9A\u4E49\u6A21\u677F",name:2},null)]})]}),c.tabIndex===1&&l(S,{prop:"lessonCoverTemplateUrl",rules:[{required:!0,message:"\u8BF7\u4E0A\u4F20\u8BFE\u7A0B\u5C01\u9762"}]},{default:()=>[l(Xt,{modelValue:c.lessonGroup.lessonCoverTemplateUrl,"onUpdate:modelValue":s=>c.lessonGroup.lessonCoverTemplateUrl=s},{default:()=>[l(de,null,Me(t=c.templateList.map(s=>l(se,{span:10,class:"mb-3 cursor-pointer"},{default:()=>[l("div",{class:"w-40 relative rounded-xl overflow-hidden border",onClick:()=>{this.selectImg(s)}},[l(G,{src:s,class:"align-middle"},null),l(Wt,{label:s,class:"!absolute bottom-2 right-0 !h-auto z-10"},{default:()=>[""]})])]})))?t:{default:()=>[t]})]})]}),c.tabIndex===2&&l(S,{prop:"lessonCoverUrl",rules:[{required:!0,message:"\u8BF7\u4E0A\u4F20\u8BFE\u7A0B\u5C01\u9762",trigger:"change"}]},{default:()=>[l(_s,{modelValue:c.lessonGroup.lessonCoverUrl,bucket:"video-course",cropUploadSuccess:s=>{c.lessonGroup.lessonCoverUrl=s,c.lessonGroup.lessonCoverTemplateUrl=""},options:{fixedNumber:[3,2],autoCropWidth:300,autoCropHeight:200}},null)]})]}),l("div",{class:"border-t border-t-[#E5E5E5] text-center pt-6 pb-7"},[l(M,{type:"primary",class:"!w-40 !h-[38px]",onClick:()=>{this.$refs.form.validate(async s=>{if(s){c.active=1;const i=document.documentElement.scrollTop||document.body.scrollTop;We(i,0)}else return this.$nextTick(()=>{document.getElementsByClassName("is-error")[0].scrollIntoView({block:"center",behavior:"smooth"})}),!1})}},{default:()=>[w("\u4E0B\u4E00\u6B65")]})])])}}),pi=U({name:"video-operation",data(){return{type:this.$route.query.type||"create"}},async created(){as();const e=this.$route.query;if(c.groupId=Number(e.groupId)||0,!c.groupId)return!1;try{c.loadingStatus=!0;const i=(await H.get("/api-website/videoLessonGroup/selectVideoLesson",{params:{groupId:c.groupId}})).data,t=i.lessonGroup,{auditStatus:r,lessonCoverUrl:o,lessonPrice:a,lessonDesc:n,lessonSubject:h,lessonName:d,id:u}=t,f=Ce(t,["auditStatus","lessonCoverUrl","lessonPrice","lessonDesc","lessonSubject","lessonName","id"]);let p=!!c.templateList.includes(o);c.lessonGroup={id:u,lessonName:d,lessonSubject:h,lessonDesc:n,lessonPrice:a,lessonCoverTemplateUrl:p?o:"",lessonCoverUrl:p?"":o},c.lessonList=[],i.detailList&&i.detailList.forEach(L=>{c.lessonList.push({videoTitle:L.videoTitle,videoContent:L.videoContent,videoUrl:L.videoUrl,coverUrl:L.coverUrl,posterUrl:L.posterUrl})}),c.loadingStatus=!1}catch{}c.lessonGroup.lessonCoverUrl&&!c.templateList.includes(c.lessonGroup.lessonCoverUrl)?c.tabIndex=2:c.tabIndex=1},async mounted(){try{const e=await H.get("/api-website/sysConfig/queryByParamName",{params:{paramName:"video_lesson_service_fee"}});c.rate=e.data.paramValue}catch{}},render(){return l(qe,null,[l("div",{class:"text-base text-[#333] leading-none px-6 py-5 border-b border-b-[#E5E5E5]"},[this.type==="create"?"\u65B0\u5EFA\u89C6\u9891\u8BFE":"\u7F16\u8F91\u89C6\u9891\u8BFE"]),l("div",{class:"pt-12"},[l(Je,{class:"px-[200px]",type:"large",active:c.active},null),c.active===0&&l(si,null,null),c.active===1&&l(Os,null,null)])])}});export{pi as default};