go-captcha-vue 2.0.3 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/go-captcha-vue.es.js +2187 -611
- package/dist/go-captcha-vue.umd.js +24 -8
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(Y,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],o):(Y=typeof globalThis<"u"?globalThis:Y||self,o(Y["go-captcha-vue"]={},Y.Vue))})(this,function(Y,o){"use strict";const hr="",Pt=()=>({width:300,height:220,thumbWidth:150,thumbHeight:40,verticalPadding:16,horizontalPadding:12,showTheme:!0,title:"请在下图依次点击",buttonText:"确认",iconSize:22,dotSize:24}),Rn=[o.createElementVNode("path",{d:`M100.1,189.9C100.1,189.9,100,189.9,100.1,189.9c-49.7,0-90-40.4-90-89.9c0-49.6,40.4-89.9,89.9-89.9
|
|
2
2
|
c49.6,0,89.9,40.4,89.9,89.9c0,18.2-5.4,35.7-15.6,50.7c-1.5,2.1-3.6,3.4-6.1,3.9c-2.5,0.4-5-0.1-7-1.6c-4.2-3-5.3-8.6-2.4-12.9
|
|
3
3
|
c8.1-11.9,12.4-25.7,12.4-40.1c0-39.2-31.9-71.1-71.1-71.1c-39.2,0-71.1,31.9-71.1,71.1c0,39.2,31.9,71.1,71.1,71.1
|
|
4
4
|
c7.7,0,15.3-1.2,22.6-3.6c2.4-0.8,4.9-0.6,7.2,0.5c2.2,1.1,3.9,3.1,4.7,5.5c1.6,4.9-1,10.2-5.9,11.9
|
|
5
5
|
C119.3,188.4,109.8,189.9,100.1,189.9z M73,136.4C73,136.4,73,136.4,73,136.4c-2.5,0-4.9-1-6.7-2.8c-3.7-3.7-3.7-9.6,0-13.3
|
|
6
6
|
L86.7,100L66.4,79.7c-3.7-3.7-3.7-9.6,0-13.3c3.7-3.7,9.6-3.7,13.3,0L100,86.7l20.3-20.3c1.8-1.8,4.1-2.8,6.7-2.8c0,0,0,0,0,0
|
|
7
7
|
c2.5,0,4.9,1,6.7,2.8c1.8,1.8,2.8,4.1,2.8,6.7c0,2.5-1,4.9-2.8,6.7L113.3,100l20.3,20.3c3.7,3.7,3.7,9.6,0,13.3
|
|
8
|
-
c-3.7,3.7-9.6,3.7-13.3,0L100,113.3l-20.3,20.3C77.9,135.4,75.5,136.4,73,136.4z`},null,-1)],
|
|
8
|
+
c-3.7,3.7-9.6,3.7-13.3,0L100,113.3l-20.3,20.3C77.9,135.4,75.5,136.4,73,136.4z`},null,-1)],je=o.defineComponent({__name:"close-icon",emits:["click"],setup(e,{emit:t}){const n=t;function r(s){n("click",s)}return(s,c)=>(o.openBlock(),o.createElementBlock("svg",o.mergeProps({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 200 200",width:"20",height:"20"},s.$attrs,{onClick:r}),Rn,16))}}),Pn=[o.createElementVNode("path",{d:`M135,149.9c-10.7,7.6-23.2,11.4-36,11.2c-1.7,0-3.4-0.1-5-0.3c-0.7-0.1-1.4-0.2-2-0.3c-1.3-0.2-2.6-0.4-3.9-0.6
|
|
9
9
|
c-0.8-0.2-1.6-0.4-2.3-0.5c-1.2-0.3-2.5-0.6-3.7-1c-0.6-0.2-1.2-0.4-1.7-0.6c-1.4-0.5-2.8-1-4.2-1.5c-0.3-0.1-0.6-0.3-0.9-0.4
|
|
10
10
|
c-1.6-0.7-3.2-1.4-4.7-2.3c-0.1,0-0.1-0.1-0.2-0.1c-5.1-2.9-9.8-6.4-14-10.6c-0.1-0.1-0.1-0.1-0.2-0.2c-1.3-1.3-2.5-2.7-3.7-4.1
|
|
11
11
|
c-0.2-0.3-0.5-0.6-0.7-0.9c-8.4-10.6-13.5-24.1-13.5-38.8h14.3c0.4,0,0.7-0.2,0.9-0.5c0.2-0.3,0.2-0.8,0-1.1L29.5,60.9
|
|
@@ -22,18 +22,34 @@
|
|
|
22
22
|
c0.6,0.1,1.3,0.3,1.9,0.4c1.4,0.3,2.8,0.7,4.2,1.1c0.4,0.1,0.9,0.3,1.3,0.4c1.6,0.5,3.1,1.1,4.6,1.7c0.2,0.1,0.3,0.1,0.5,0.2
|
|
23
23
|
c9,3.9,17,10,23.2,17.6c0,0,0.1,0.1,0.1,0.2c8.7,10.7,14,24.5,14,39.4H147c-0.4,0-0.7,0.2-0.9,0.5c-0.2,0.3-0.2,0.8,0,1.1l24,36.4
|
|
24
24
|
c0.2,0.3,0.5,0.5,0.9,0.5c0.4,0,0.7-0.2,0.9-0.5l23.9-36.4c0.2-0.3,0.2-0.7,0-1.1c-0.2-0.3-0.5-0.5-0.9-0.5L180.6,98.9L180.6,98.9
|
|
25
|
-
L180.6,98.9z`},null,-1)],
|
|
25
|
+
L180.6,98.9z`},null,-1)],Fe=o.defineComponent({__name:"refresh-icon",emits:["click"],setup(e,{emit:t}){const n=t;function r(s){n("click",s)}return(s,c)=>(o.openBlock(),o.createElementBlock("svg",o.mergeProps({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 200 200",width:"20",height:"20"},s.$attrs,{onClick:r}),Pn,16))}}),Tn=[o.createElementVNode("circle",{cx:"50",cy:"36.8101",r:"10"},[o.createElementVNode("animate",{attributeName:"cy",dur:"1s",repeatCount:"indefinite",calcMode:"spline",keySplines:"0.45 0 0.9 0.55;0 0.45 0.55 0.9",keyTimes:"0;0.5;1",values:"23;77;23"})],-1)],Ae=o.defineComponent({__name:"loading-icon",emits:["click"],setup(e,{emit:t}){const n=t;function r(s){n("click",s)}return(s,c)=>(o.openBlock(),o.createElementBlock("svg",o.mergeProps({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid",width:"84",height:"84"},s.$attrs,{onClick:r}),Tn,16))}});function kn(e){let t=0,n=0;if(e.getBoundingClientRect){const r=e.getBoundingClientRect(),s=document.documentElement;t=r.left+Math.max(s.scrollLeft,document.body.scrollLeft)-s.clientLeft,n=r.top+Math.max(s.scrollTop,document.body.scrollTop)-s.clientTop}else for(;e!==document.body;)t+=e.offsetLeft,n+=e.offsetTop,e=e.offsetParent;return{domX:t,domY:n}}function rt(e,t){let n=t.relatedTarget;try{for(;n&&n!==e;)n=n.parentNode}catch(r){console.warn(r)}return n!==e}function In(e,t,n){const r=o.reactive({list:[]}),s=d=>{const w=d.currentTarget,b=kn(w),h=d.pageX||d.clientX,N=d.pageY||d.clientY,g=b.domX,S=b.domY,L=h-g,_=N-S,E=parseInt(L.toString()),u=parseInt(_.toString()),y=new Date,$=r.list.length;return r.list.push({key:y.getTime(),index:$+1,x:E,y:u}),t.click&&t.click(E,u),d.cancelBubble=!0,d.preventDefault(),!1},c=d=>(t.confirm&&t.confirm(o.toRaw(r.list),()=>{m()}),d.cancelBubble=!0,d.preventDefault(),!1),i=d=>(l(),d.cancelBubble=!0,d.preventDefault(),!1),a=d=>(f(),d.cancelBubble=!0,d.preventDefault(),!1),l=()=>{t.close&&t.close(),m()},f=()=>{t.refresh&&t.refresh(),m()},m=()=>{r.list=[]};return{dots:r,clickEvent:s,confirmEvent:c,closeEvent:i,refreshEvent:a,resetData:m,clearData:()=>{m(),n&&n()},refresh:f,close:l}}const Bn={class:"gc-header"},Mn=["src"],jn={class:"gc-loading"},Fn=["src"],An={class:"gc-dots"},Hn={class:"gc-footer"},Wn={class:"gc-icon-block gc-icon-block2"},Xn={class:"gc-button-block"},ve=o.defineComponent({__name:"index",props:{config:{default:Pt},events:{default:()=>({})},data:{default:()=>({})}},setup(e,{expose:t}){const n=e,{data:r,events:s,config:c}=n,i=o.reactive({...o.toRaw(r)}),a=o.reactive({...o.toRaw(s)}),l=o.reactive({...Pt(),...o.toRaw(c)});o.watch(()=>n.data,(h,N)=>{Object.assign(i,h)},{deep:!0}),o.watch(()=>n.events,(h,N)=>{Object.assign(a,h)},{deep:!0}),o.watch(()=>n.config,(h,N)=>{Object.assign(l,h)},{deep:!0});const f=In(i,a,()=>{i.thumb="",i.image=""}),m=o.computed(()=>{const h=l.horizontalPadding||0,N=l.verticalPadding||0;return{width:(l.width||0)+h*2+(l.showTheme?2:0)+"px",paddingLeft:h+"px",paddingRight:h+"px",paddingTop:N+"px",paddingBottom:N+"px"}}),p=o.computed(()=>({width:l.thumbWidth+"px",height:l.thumbHeight+"px"})),d=o.computed(()=>({width:l.width+"px",height:l.height+"px"})),w=o.computed(()=>i.image!=""||i.thumb!=""),b=o.computed(()=>(l.width||0)>0||(l.height||0)>0);return t({reset:f.resetData,clear:f.clearData,refresh:f.refresh,close:f.close}),(h,N)=>o.withDirectives((o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(`go-captcha gc-wrapper ${l.showTheme&&"gc-theme"}`),style:o.normalizeStyle(m.value)},[o.createElementVNode("div",Bn,[o.createElementVNode("span",null,o.toDisplayString(l.title),1),o.withDirectives(o.createElementVNode("img",{style:o.normalizeStyle(p.value),src:i.thumb,alt:""},null,12,Mn),[[o.vShow,w.value]])]),o.createElementVNode("div",{class:"gc-body",style:o.normalizeStyle(d.value)},[o.createElementVNode("div",jn,[o.createVNode(Ae)]),o.withDirectives(o.createElementVNode("img",{style:o.normalizeStyle(d.value),class:"gc-picture",src:i.image,onClick:N[0]||(N[0]=(...g)=>o.unref(f).clickEvent&&o.unref(f).clickEvent(...g)),alt:""},null,12,Fn),[[o.vShow,w.value]]),o.createElementVNode("div",An,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(o.unref(f).dots.list,g=>(o.openBlock(),o.createElementBlock("div",{class:"gc-dot",key:`${g.key+"-"+g.index}`,style:o.normalizeStyle({width:l.dotSize+"px",height:l.dotSize+"px",borderRadius:l.dotSize+"px",top:g.y-(l.dotSize||1)/2-1+"px",left:g.x-(l.dotSize||1)/2-1+"px"})},o.toDisplayString(g.index),5))),128))])],4),o.createElementVNode("div",Hn,[o.createElementVNode("div",Wn,[o.createVNode(je,{width:l.iconSize,height:l.iconSize,onClick:o.unref(f).closeEvent},null,8,["width","height","onClick"]),o.createVNode(Fe,{width:l.iconSize,height:l.iconSize,onClick:o.unref(f).refreshEvent},null,8,["width","height","onClick"])]),o.createElementVNode("div",Xn,[o.createElementVNode("button",{class:o.normalizeClass(!w.value&&"disabled"),onClick:N[1]||(N[1]=(...g)=>o.unref(f).confirmEvent&&o.unref(f).confirmEvent(...g))},o.toDisplayString(l.buttonText),3)])])],6)),[[o.vShow,b.value]])}}),_r="";ve.name="gocaptcha-click",ve.install=function(e){e.component("gocaptcha-click",ve)};const Tt=()=>({width:300,height:220,thumbWidth:150,thumbHeight:40,verticalPadding:16,horizontalPadding:12,showTheme:!0,title:"请拖动滑块完成拼图",iconSize:22,scope:!0}),Yn=[o.createElementVNode("path",{d:`M131.6,116.3c0,0-75.6,0-109.7,0c-9.1,0-16.2-7.4-16.2-16.2c0-9.1,7.4-16.2,16.2-16.2c28.7,0,109.7,0,109.7,0
|
|
26
26
|
s-5.4-5.4-30.4-30.7c-6.4-6.4-6.4-16.7,0-23.1s16.7-6.4,23.1,0l58.4,58.4c6.4,6.4,6.4,16.7,0,23.1c0,0-32.9,32.9-57.9,57.9
|
|
27
|
-
c-6.4,6.4-16.7,6.4-23.1,0c-6.4-6.4-6.4-16.7,0-23.1C121.8,126.2,131.6,116.3,131.6,116.3z`},null,-1)],oe=e.defineComponent({__name:"arrows-icon",emits:["click"],setup(c,{emit:n}){const l=n;function r(a){l("click",a)}return(a,p)=>(e.openBlock(),e.createElementBlock("svg",e.mergeProps({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 200 200",width:"20",height:"20"},a.$attrs,{onClick:r}),be,16))}}),ke=()=>({thumbX:0,thumbY:0,thumbWidth:0,thumbHeight:0,image:"",thumb:""});function ye(c,n,l,r,a,p,s,d,t){const h=e.reactive({dragLeft:0,thumbLeft:c.thumbX||0,isFreeze:!1});e.watch(()=>c,(f,z)=>{h.isFreeze||(h.thumbLeft=f.thumbX||0)},{deep:!0});const y=f=>{const z=f.touches&&f.touches[0],k=s.value.offsetLeft,m=a.value.offsetWidth,g=s.value.offsetWidth,w=m-g,D=p.value.offsetWidth,W=p.value.offsetLeft,j=m-D,F=(m-(D+W))/w;let R=!1,C=null,H=0,N=0;z?H=z.pageX-k:H=f.clientX-k;const B=v=>{R=!0;const Y=v.touches&&v.touches[0];let V=0;Y?V=Y.pageX-H:V=v.clientX-H;let ot=W+V*F;if(V>=w){h.dragLeft=w,h.thumbLeft=N=j;return}if(V<=0){h.dragLeft=0,h.thumbLeft=N=W;return}h.dragLeft=V,h.thumbLeft=N=ot,n.move&&n.move(N,c.thumbY||0),v.cancelBubble=!0,v.preventDefault()},X=v=>{ee(d.value,v)&&R&&($(),!(N<0)&&(R=!1,n.confirm&&n.confirm({x:parseInt(N.toString()),y:c.thumbY||0},()=>{i()}),v.cancelBubble=!0,v.preventDefault()))},T=v=>{C=v},P=()=>{C=null},A=v=>{C&&(X(C),$())},x=l.scope,L=x?r.value:d.value,S=x?r.value:document.body,$=()=>{S.removeEventListener("mousemove",B,!1),S.removeEventListener("touchmove",B,{passive:!1}),L.removeEventListener("mouseup",X,!1),L.removeEventListener("mouseenter",P,!1),L.removeEventListener("mouseleave",T,!1),L.removeEventListener("touchend",X,!1),S.removeEventListener("mouseleave",X,!1),S.removeEventListener("mouseup",A,!1),h.isFreeze=!1};h.isFreeze=!0,S.addEventListener("mousemove",B,!1),S.addEventListener("touchmove",B,{passive:!1}),L.addEventListener("mouseup",X,!1),L.addEventListener("mouseenter",P,!1),L.addEventListener("mouseleave",T,!1),L.addEventListener("touchend",X,!1),S.addEventListener("mouseleave",X,!1),S.addEventListener("mouseup",A,!1)},b=f=>(u(),f.cancelBubble=!0,f.preventDefault(),!1),o=f=>(E(),f.cancelBubble=!0,f.preventDefault(),!1),u=()=>{n&&n.close&&n.close(),i()},E=()=>{n&&n.refresh&&n.refresh(),i()},i=()=>{h.dragLeft=0,h.thumbLeft=c.thumbX||0};return{state:h,dragEvent:y,closeEvent:b,refreshEvent:o,resetData:i,clearData:()=>{t&&t(),i()},refresh:E,close:u}}const xe={class:"gc-header"},Le={class:"gc-icon-block"},Se={class:"gc-loading"},ze=["src"],De=["src"],Ce={class:"gc-footer"},$e=e.createElementVNode("div",{class:"gc-drag-line"},null,-1),U=e.defineComponent({__name:"index",props:{config:{default:ce},events:{default:()=>({})},data:{default:()=>({})}},setup(c,{expose:n}){const l=c,{data:r,events:a,config:p}=l,s=e.reactive({...ke(),...e.toRaw(r)}),d=e.reactive({...e.toRaw(a)}),t=e.reactive({...ce(),...e.toRaw(p)});e.watch(()=>l.data,(g,w)=>{Object.assign(s,g)},{deep:!0}),e.watch(()=>l.events,(g,w)=>{Object.assign(d,g)},{deep:!0}),e.watch(()=>l.config,(g,w)=>{Object.assign(t,g)},{deep:!0});const h=e.ref(null),y=e.ref(null),b=e.ref(null),o=e.ref(null),u=e.ref(null),E=ye(s,d,t,h,b,u,o,y,()=>{s.thumb="",s.image="",s.thumbX=0,s.thumbY=0,s.thumbWidth=0,s.thumbHeight=0}),i=e.computed(()=>{const g=t.horizontalPadding||0,w=t.verticalPadding||0;return{width:(t.width||0)+g*2+(t.showTheme?2:0)+"px",paddingLeft:g+"px",paddingRight:g+"px",paddingTop:w+"px",paddingBottom:w+"px"}}),_=e.computed(()=>({width:s.thumbWidth+"px",height:s.thumbHeight+"px",top:s.thumbY+"px",left:E.state.thumbLeft+"px"})),f=e.computed(()=>({width:t.width+"px",height:t.height+"px"})),z=e.computed(()=>s.image!=""),k=e.computed(()=>s.thumb!=""),m=e.computed(()=>(t.width||0)>0||(t.height||0)>0);return e.onMounted(async()=>{await e.nextTick(),o.value&&o.value.addEventListener("dragstart",g=>g.preventDefault())}),n({reset:E.resetData,clear:E.clearData,refresh:E.refresh,close:E.close}),(g,w)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`go-captcha gc-wrapper ${t.showTheme&&"gc-theme"}`),style:e.normalizeStyle(i.value),ref_key:"rootRef",ref:h},[e.createElementVNode("div",xe,[e.createElementVNode("span",null,e.toDisplayString(t.title),1),e.createElementVNode("div",Le,[e.createVNode(K,{width:t.iconSize,height:t.iconSize,onClick:e.unref(E).closeEvent},null,8,["width","height","onClick"]),e.createVNode(Q,{width:t.iconSize,height:t.iconSize,onClick:e.unref(E).refreshEvent},null,8,["width","height","onClick"])])]),e.createElementVNode("div",{class:"gc-body",ref_key:"containerRef",ref:b,style:e.normalizeStyle(f.value)},[e.createElementVNode("div",Se,[e.createVNode(Z)]),e.withDirectives(e.createElementVNode("img",{class:"gc-picture",style:e.normalizeStyle(f.value),src:s.image,alt:""},null,12,ze),[[e.vShow,z.value]]),e.createElementVNode("div",{class:"gc-tile",ref_key:"tileRef",ref:u,style:e.normalizeStyle(_.value)},[e.withDirectives(e.createElementVNode("img",{src:s.thumb,alt:""},null,8,De),[[e.vShow,k.value]])],4)],4),e.createElementVNode("div",Ce,[e.createElementVNode("div",{class:"gc-drag-slide-bar",ref_key:"dragBarRef",ref:y},[$e,e.createElementVNode("div",{class:e.normalizeClass(["gc-drag-block",!z.value&&"disabled"]),ref_key:"dragBlockRef",ref:o,onMousedown:w[1]||(w[1]=(...D)=>e.unref(E).dragEvent&&e.unref(E).dragEvent(...D)),style:e.normalizeStyle({left:e.unref(E).state.dragLeft+"px"})},[e.createElementVNode("div",{class:"gc-drag-block-inline",onTouchstart:w[0]||(w[0]=(...D)=>e.unref(E).dragEvent&&e.unref(E).dragEvent(...D))},[e.createVNode(oe)],32)],38)],512)])],6)),[[e.vShow,m.value]])}}),ht="";U.name="gocaptcha-slide",U.install=function(c){c.component("gocaptcha-slide",U)};const se=()=>({width:300,height:220,verticalPadding:16,horizontalPadding:12,showTheme:!0,title:"请拖拽贴图完成拼图",iconSize:22,scope:!0}),ve=()=>({thumbX:0,thumbY:0,thumbWidth:0,thumbHeight:0,image:"",thumb:""});function Ve(c,n,l,r,a,p,s){const d=e.reactive({x:c.thumbX||0,y:c.thumbY||0,isFreeze:!1});e.watch(()=>c,(i,_)=>{d.isFreeze||(d.x=i.thumbX||0,d.y=i.thumbY||0)},{deep:!0});const t=i=>{const _=i.touches&&i.touches[0],f=p.value.offsetLeft,z=p.value.offsetTop,k=a.value.offsetWidth,m=a.value.offsetHeight,g=p.value.offsetWidth,w=p.value.offsetHeight,D=k-g,W=m-w;let j=!1,O=null,F=0,R=0,C=0,H=0;_?(F=_.pageX-f,R=_.pageY-z):(F=i.clientX-f,R=i.clientY-z);const N=$=>{j=!0;const v=$.touches&&$.touches[0];let Y=0,V=0;v?(Y=v.pageX-F,V=v.pageY-R):(Y=$.clientX-F,V=$.clientY-R),Y<=0&&(Y=0),V<=0&&(V=0),Y>=D&&(Y=D),V>=W&&(V=W),d.x=Y,d.y=V,C=Y,H=V,n.move&&n.move(Y,V),$.cancelBubble=!0,$.preventDefault()},B=$=>{ee(a.value,$)&&j&&(j=!1,S(),!(C<0||H<0)&&(n.confirm&&n.confirm({x:C,y:H},()=>{u()}),$.cancelBubble=!0,$.preventDefault()))},X=$=>{O=$},T=()=>{O=null},P=$=>{O&&(B(O),S())},A=l.scope,x=A?r.value:a.value,L=A?r.value:document.body,S=()=>{L.removeEventListener("mousemove",N,!1),L.removeEventListener("touchmove",N,{passive:!1}),x.removeEventListener("mouseup",B,!1),x.removeEventListener("mouseenter",T,!1),x.removeEventListener("mouseleave",X,!1),x.removeEventListener("touchend",B,!1),L.removeEventListener("mouseleave",B,!1),L.removeEventListener("mouseup",P,!1),d.isFreeze=!1};d.isFreeze=!0,L.addEventListener("mousemove",N,!1),L.addEventListener("touchmove",N,{passive:!1}),x.addEventListener("mouseup",B,!1),x.addEventListener("mouseenter",T,!1),x.addEventListener("mouseleave",X,!1),x.addEventListener("touchend",B,!1),L.addEventListener("mouseleave",B,!1),L.addEventListener("mouseup",P,!1)},h=i=>(b(),i.cancelBubble=!0,i.preventDefault(),!1),y=i=>(o(),i.cancelBubble=!0,i.preventDefault(),!1),b=()=>{n&&n.close&&n.close(),u()},o=()=>{n&&n.refresh&&n.refresh(),u()},u=()=>{d.x=c.thumbX||0,d.y=c.thumbY||0};return{state:d,dragEvent:t,closeEvent:h,refreshEvent:y,resetData:u,clearData:()=>{s&&s(),u()},refresh:o,close:b}}const Be={class:"gc-header gc-header2"},Ne={class:"gc-loading"},Te=["src"],Pe=["src"],Re={class:"gc-footer"},Xe={class:"gc-icon-block"},q=e.defineComponent({__name:"index",props:{config:{default:se},events:{default:()=>({})},data:{default:()=>({})}},setup(c,{expose:n}){const l=c,{data:r,events:a,config:p}=l,s=e.reactive({...ve(),...e.toRaw(r)}),d=e.reactive({...e.toRaw(a)}),t=e.reactive({...se(),...e.toRaw(p)});e.watch(()=>l.data,(k,m)=>{Object.assign(s,k)},{deep:!0}),e.watch(()=>l.events,(k,m)=>{Object.assign(d,k)},{deep:!0}),e.watch(()=>l.config,(k,m)=>{Object.assign(t,k)},{deep:!0});const h=e.ref(null),y=e.ref(null),b=e.ref(null),o=Ve(s,d,t,h,y,b,()=>{s.thumb="",s.image="",s.thumbX=0,s.thumbY=0,s.thumbWidth=0,s.thumbHeight=0}),u=e.computed(()=>{const k=t.horizontalPadding||0,m=t.verticalPadding||0;return{width:(t.width||0)+k*2+(t.showTheme?2:0)+"px",paddingLeft:k+"px",paddingRight:k+"px",paddingTop:m+"px",paddingBottom:m+"px"}}),E=e.computed(()=>({width:s.thumbWidth+"px",height:s.thumbHeight+"px",top:o.state.y+"px",left:o.state.x+"px"})),i=e.computed(()=>({width:t.width+"px",height:t.height+"px"})),_=e.computed(()=>s.image!=""),f=e.computed(()=>s.thumb!=""),z=e.computed(()=>(t.width||0)>0||(t.height||0)>0);return e.onMounted(async()=>{await e.nextTick(),b.value&&b.value.addEventListener("dragstart",k=>k.preventDefault())}),n({reset:o.resetData,clear:o.clearData,refresh:o.refresh,close:o.close}),(k,m)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`go-captcha gc-wrapper ${t.showTheme&&"gc-theme"}`),style:e.normalizeStyle(u.value),ref_key:"rootRef",ref:h},[e.createElementVNode("div",Be,[e.createElementVNode("span",null,e.toDisplayString(t.title),1)]),e.createElementVNode("div",{class:"gc-body",ref_key:"containerRef",ref:y,style:e.normalizeStyle(i.value)},[e.createElementVNode("div",Ne,[e.createVNode(Z)]),e.withDirectives(e.createElementVNode("img",{class:"gc-picture",style:e.normalizeStyle(i.value),src:s.image,alt:""},null,12,Te),[[e.vShow,_.value]]),e.createElementVNode("div",{class:"gc-tile",ref_key:"tileRef",ref:b,style:e.normalizeStyle(E.value),onMousedown:m[0]||(m[0]=(...g)=>e.unref(o).dragEvent&&e.unref(o).dragEvent(...g)),onTouchstart:m[1]||(m[1]=(...g)=>e.unref(o).dragEvent&&e.unref(o).dragEvent(...g))},[e.withDirectives(e.createElementVNode("img",{src:s.thumb,alt:""},null,8,Pe),[[e.vShow,f.value]])],36)],4),e.createElementVNode("div",Re,[e.createElementVNode("div",Xe,[e.createVNode(K,{width:t.iconSize,height:t.iconSize,onClick:e.unref(o).closeEvent},null,8,["width","height","onClick"]),e.createVNode(Q,{width:t.iconSize,height:t.iconSize,onClick:e.unref(o).refreshEvent},null,8,["width","height","onClick"])])])],6)),[[e.vShow,z.value]])}}),mt="";q.name="gocaptcha-slide-region",q.install=function(c){c.component("gocaptcha-slide-region",q)};const te=()=>({width:300,height:220,size:220,verticalPadding:16,horizontalPadding:12,showTheme:!0,title:"请拖动滑块完成拼图",iconSize:22,scope:!0}),Me=()=>({angle:0,image:"",thumb:""});function We(c,n,l,r,a,p,s){const d=e.reactive({dragLeft:0,thumbAngle:c.angle||0,isFreeze:!1});e.watch(()=>c,(i,_)=>{d.isFreeze||(d.thumbAngle=i.angle||0)},{deep:!0});const t=i=>{const _=i.touches&&i.touches[0],f=a.value.offsetLeft,z=p.value.offsetWidth,k=a.value.offsetWidth,m=z-k,g=360,w=(g-c.angle)/m;let D=0,W=!1,j=null,O=0,F=0;_?O=_.pageX-f:O=i.clientX-f;const R=x=>{W=!0;const L=x.touches&&x.touches[0];let S=0;if(L?S=L.pageX-O:S=x.clientX-O,D=c.angle+S*w,S>=m){d.dragLeft=m,d.thumbAngle=F=g;return}if(S<=0){d.dragLeft=0,d.thumbAngle=F=c.angle;return}d.dragLeft=S,d.thumbAngle=F=D,n.rotate&&n.rotate(D),x.cancelBubble=!0,x.preventDefault()},C=x=>{ee(p.value,x)&&W&&(A(),!(F<0)&&(W=!1,n.confirm&&n.confirm(parseInt(F.toString()),()=>{u()}),x.cancelBubble=!0,x.preventDefault()))},H=x=>{j=x},N=()=>{j=null},B=x=>{j&&(C(j),A())},X=l.scope,T=X?r.value:p.value,P=X?r.value:document.body,A=()=>{P.removeEventListener("mousemove",R,!1),P.removeEventListener("touchmove",R,{passive:!1}),T.removeEventListener("mouseup",C,!1),T.removeEventListener("mouseenter",N,!1),T.removeEventListener("mouseleave",H,!1),T.removeEventListener("touchend",C,!1),P.removeEventListener("mouseleave",C,!1),P.removeEventListener("mouseup",B,!1),d.isFreeze=!1};d.isFreeze=!0,P.addEventListener("mousemove",R,!1),P.addEventListener("touchmove",R,{passive:!1}),T.addEventListener("mouseup",C,!1),T.addEventListener("mouseenter",N,!1),T.addEventListener("mouseleave",H,!1),T.addEventListener("touchend",C,!1),P.addEventListener("mouseleave",C,!1),P.addEventListener("mouseup",B,!1)},h=i=>(b(),i.cancelBubble=!0,i.preventDefault(),!1),y=i=>(o(),i.cancelBubble=!0,i.preventDefault(),!1),b=()=>{n&&n.close&&n.close(),u()},o=()=>{n&&n.refresh&&n.refresh(),u()},u=()=>{d.dragLeft=0,d.thumbAngle=c.angle};return{state:d,dragEvent:t,closeEvent:h,refreshEvent:y,resetData:u,clearData:()=>{s&&s(),u()},refresh:o,close:b}}const Fe={class:"gc-header"},Ye={class:"gc-icon-block"},He={class:"gc-loading"},je=["src"],Oe=e.createElementVNode("div",{class:"gc-round"},null,-1),Ae={class:"gc-thumb gc-rotate-thumb"},Ie=["src"],Ue={class:"gc-footer"},qe=e.createElementVNode("div",{class:"gc-drag-line"},null,-1),G=e.defineComponent({__name:"index",props:{config:{default:te},events:{default:()=>({})},data:{default:()=>({})}},setup(c,{expose:n}){const l=c,{data:r,events:a,config:p}=l,s=e.reactive({...Me(),...e.toRaw(r)}),d=e.reactive({...e.toRaw(a)}),t=e.reactive({...te(),...e.toRaw(p)});e.watch(()=>l.data,(m,g)=>{Object.assign(s,m)},{deep:!0}),e.watch(()=>l.events,(m,g)=>{Object.assign(d,m)},{deep:!0}),e.watch(()=>l.config,(m,g)=>{Object.assign(t,m)},{deep:!0});const h=e.ref(null),y=e.ref(null),b=e.ref(null),o=We(s,d,t,h,b,y,()=>{s.thumb="",s.image="",s.angle=0}),u=e.computed(()=>{const m=t.horizontalPadding||0,g=t.verticalPadding||0;return{width:(t.width||0)+m*2+(t.showTheme?2:0)+"px",paddingLeft:m+"px",paddingRight:m+"px",paddingTop:g+"px",paddingBottom:g+"px"}}),E=e.computed(()=>({transform:`rotate(${o.state.thumbAngle}deg)`})),i=e.computed(()=>({width:t.width+"px",height:t.height+"px"})),_=e.computed(()=>{const m=(t.size||0)>0?t.size:te().size;return{width:m+"px",height:m+"px"}}),f=e.computed(()=>s.image!=""),z=e.computed(()=>s.thumb!=""),k=e.computed(()=>(t.width||0)>0||(t.height||0)>0);return e.onMounted(async()=>{await e.nextTick(),b.value&&b.value.addEventListener("dragstart",m=>m.preventDefault())}),n({reset:o.resetData,clear:o.clearData,refresh:o.refresh,close:o.close}),(m,g)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`go-captcha gc-wrapper ${t.showTheme&&"gc-theme"}`),style:e.normalizeStyle(u.value),ref_key:"rootRef",ref:h},[e.createElementVNode("div",Fe,[e.createElementVNode("span",null,e.toDisplayString(t.title),1),e.createElementVNode("div",Ye,[e.createVNode(K,{width:t.iconSize,height:t.iconSize,onClick:e.unref(o).closeEvent},null,8,["width","height","onClick"]),e.createVNode(Q,{width:t.iconSize,height:t.iconSize,onClick:e.unref(o).refreshEvent},null,8,["width","height","onClick"])])]),e.createElementVNode("div",{class:"gc-body gc-rotate-body",ref:"containerRef",style:e.normalizeStyle(i.value)},[e.createElementVNode("div",{class:"gc-body-inner",style:e.normalizeStyle(_.value)},[e.createElementVNode("div",He,[e.createVNode(Z)]),e.createElementVNode("div",{class:"gc-picture gc-rotate-picture",style:e.normalizeStyle(_.value)},[e.withDirectives(e.createElementVNode("img",{src:s.image,alt:""},null,8,je),[[e.vShow,f.value]]),Oe],4),e.createElementVNode("div",Ae,[e.createElementVNode("div",{class:"gc-rotate-thumb-block",style:e.normalizeStyle(E.value)},[e.withDirectives(e.createElementVNode("img",{src:s.thumb,alt:""},null,8,Ie),[[e.vShow,z.value]])],4)])],4)],4),e.createElementVNode("div",Ue,[e.createElementVNode("div",{class:"gc-drag-slide-bar",ref_key:"dragBarRef",ref:y},[qe,e.createElementVNode("div",{class:e.normalizeClass(["gc-drag-block",!f.value&&"disabled"]),ref_key:"dragBlockRef",ref:b,onMousedown:g[1]||(g[1]=(...w)=>e.unref(o).dragEvent&&e.unref(o).dragEvent(...w)),style:e.normalizeStyle({left:e.unref(o).state.dragLeft+"px"})},[e.createElementVNode("div",{class:"gc-drag-block-inline",onTouchstart:g[0]||(g[0]=(...w)=>e.unref(o).dragEvent&&e.unref(o).dragEvent(...w))},[e.createVNode(oe)],32)],38)],512)])],6)),[[e.vShow,k.value]])}}),ft="";G.name="gocaptcha-rotate",G.install=function(c){c.component("gocaptcha-rotate",G)};const Ge=[e.createElementVNode("circle",{fill:"#3E7CFF",cx:"100",cy:"100",r:"96.3"},null,-1),e.createElementVNode("path",{fill:"#FFFFFF",d:`M140.8,64.4l-39.6-11.9h-2.4L59.2,64.4c-1.6,0.8-2.8,2.4-2.8,4v24.1c0,25.3,15.8,45.9,42.3,54.6
|
|
28
|
-
|
|
27
|
+
c-6.4,6.4-16.7,6.4-23.1,0c-6.4-6.4-6.4-16.7,0-23.1C121.8,126.2,131.6,116.3,131.6,116.3z`},null,-1)],kt=o.defineComponent({__name:"arrows-icon",emits:["click"],setup(e,{emit:t}){const n=t;function r(s){n("click",s)}return(s,c)=>(o.openBlock(),o.createElementBlock("svg",o.mergeProps({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 200 200",width:"20",height:"20"},s.$attrs,{onClick:r}),Yn,16))}}),Kn=()=>({thumbX:0,thumbY:0,thumbWidth:0,thumbHeight:0,image:"",thumb:""});function Un(e,t,n,r,s,c,i,a,l){const f=o.reactive({dragLeft:0,thumbLeft:e.thumbX||0,isFreeze:!1});o.watch(()=>e,(g,S)=>{f.isFreeze||(f.thumbLeft=g.thumbX||0)},{deep:!0});const m=g=>{const S=g.touches&&g.touches[0],L=i.value.offsetLeft,_=s.value.offsetWidth,E=i.value.offsetWidth,u=_-E,y=c.value.offsetWidth,$=c.value.offsetLeft,te=_-y,K=(_-(y+$))/u;let W=!1,T=null,Z=0,F=0;S?Z=S.pageX-L:Z=g.clientX-L;const j=I=>{W=!0;const U=I.touches&&I.touches[0];let B=0;U?B=U.pageX-Z:B=I.clientX-Z;let ur=$+B*K;if(B>=u){f.dragLeft=u,f.thumbLeft=F=te;return}if(B<=0){f.dragLeft=0,f.thumbLeft=F=$;return}f.dragLeft=B,f.thumbLeft=F=ur,t.move&&t.move(F,e.thumbY||0),I.cancelBubble=!0,I.preventDefault()},X=I=>{rt(a.value,I)&&W&&(k(),!(F<0)&&(W=!1,t.confirm&&t.confirm({x:parseInt(F.toString()),y:e.thumbY||0},()=>{h()}),I.cancelBubble=!0,I.preventDefault()))},A=I=>{T=I},H=()=>{T=null},de=I=>{T&&(X(T),k())},D=n.scope,O=D?r.value:a.value,z=D?r.value:document.body,k=()=>{z.removeEventListener("mousemove",j,!1),z.removeEventListener("touchmove",j,{passive:!1}),O.removeEventListener("mouseup",X,!1),O.removeEventListener("mouseenter",H,!1),O.removeEventListener("mouseleave",A,!1),O.removeEventListener("touchend",X,!1),z.removeEventListener("mouseleave",X,!1),z.removeEventListener("mouseup",de,!1),f.isFreeze=!1};f.isFreeze=!0,z.addEventListener("mousemove",j,!1),z.addEventListener("touchmove",j,{passive:!1}),O.addEventListener("mouseup",X,!1),O.addEventListener("mouseenter",H,!1),O.addEventListener("mouseleave",A,!1),O.addEventListener("touchend",X,!1),z.addEventListener("mouseleave",X,!1),z.addEventListener("mouseup",de,!1)},p=g=>(w(),g.cancelBubble=!0,g.preventDefault(),!1),d=g=>(b(),g.cancelBubble=!0,g.preventDefault(),!1),w=()=>{t&&t.close&&t.close(),h()},b=()=>{t&&t.refresh&&t.refresh(),h()},h=()=>{f.dragLeft=0,f.thumbLeft=e.thumbX||0};return{state:f,dragEvent:m,closeEvent:p,refreshEvent:d,resetData:h,clearData:()=>{l&&l(),h()},refresh:b,close:w}}/**
|
|
28
|
+
* @vue/shared v3.4.27
|
|
29
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
30
|
+
* @license MIT
|
|
31
|
+
**//*! #__NO_SIDE_EFFECTS__ */function qn(e,t){const n=new Set(e.split(","));return t?r=>n.has(r.toLowerCase()):r=>n.has(r)}const re=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const me=()=>{},Jn=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),ee=Object.assign,Gn=Object.prototype.hasOwnProperty,C=(e,t)=>Gn.call(e,t),x=Array.isArray,ge=e=>He(e)==="[object Map]",Qn=e=>He(e)==="[object Set]",R=e=>typeof e=="function",q=e=>typeof e=="string",Se=e=>typeof e=="symbol",J=e=>e!==null&&typeof e=="object",Zn=e=>(J(e)||R(e))&&R(e.then)&&R(e.catch),eo=Object.prototype.toString,He=e=>eo.call(e),It=e=>He(e).slice(8,-1),to=e=>He(e)==="[object Object]",ct=e=>q(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Bt=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},Mt=Bt(e=>e.charAt(0).toUpperCase()+e.slice(1)),no=Bt(e=>e?`on${Mt(e)}`:""),_e=(e,t)=>!Object.is(e,t),oo=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})};let jt;const Ft=()=>jt||(jt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function it(e){if(x(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],s=q(r)?io(r):it(r);if(s)for(const c in s)t[c]=s[c]}return t}else if(q(e)||J(e))return e}const so=/;(?![^(]*\))/g,ro=/:([^]+)/,co=/\/\*[^]*?\*\//g;function io(e){const t={};return e.replace(co,"").split(so).forEach(n=>{if(n){const r=n.split(ro);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function lt(e){let t="";if(q(e))t=e;else if(x(e))for(let n=0;n<e.length;n++){const r=lt(e[n]);r&&(t+=r+" ")}else if(J(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}/**
|
|
32
|
+
* @vue/reactivity v3.4.27
|
|
33
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
34
|
+
* @license MIT
|
|
35
|
+
**/function xe(e,...t){console.warn(`[Vue warn] ${e}`,...t)}let lo;function ao(e,t=lo){t&&t.active&&t.effects.push(e)}let Ve;class fo{constructor(t,n,r,s){this.fn=t,this.trigger=n,this.scheduler=r,this.active=!0,this.deps=[],this._dirtyLevel=4,this._trackId=0,this._runnings=0,this._shouldSchedule=!1,this._depsLength=0,ao(this,s)}get dirty(){if(this._dirtyLevel===2||this._dirtyLevel===3){this._dirtyLevel=1,De();for(let t=0;t<this._depsLength;t++){const n=this.deps[t];if(n.computed&&(uo(n.computed),this._dirtyLevel>=4))break}this._dirtyLevel===1&&(this._dirtyLevel=0),Ce()}return this._dirtyLevel>=4}set dirty(t){this._dirtyLevel=t?4:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let t=fe,n=Ve;try{return fe=!0,Ve=this,this._runnings++,At(this),this.fn()}finally{Ht(this),this._runnings--,Ve=n,fe=t}}stop(){this.active&&(At(this),Ht(this),this.onStop&&this.onStop(),this.active=!1)}}function uo(e){return e.value}function At(e){e._trackId++,e._depsLength=0}function Ht(e){if(e.deps.length>e._depsLength){for(let t=e._depsLength;t<e.deps.length;t++)Wt(e.deps[t],e);e.deps.length=e._depsLength}}function Wt(e,t){const n=e.get(t);n!==void 0&&t._trackId!==n&&(e.delete(t),e.size===0&&e.cleanup())}let fe=!0,at=0;const Xt=[];function De(){Xt.push(fe),fe=!1}function Ce(){const e=Xt.pop();fe=e===void 0?!0:e}function dt(){at++}function ft(){for(at--;!at&&ut.length;)ut.shift()()}function ho(e,t,n){var r;if(t.get(e)!==e._trackId){t.set(e,e._trackId);const s=e.deps[e._depsLength];s!==t?(s&&Wt(s,e),e.deps[e._depsLength++]=t):e._depsLength++,process.env.NODE_ENV!=="production"&&((r=e.onTrack)==null||r.call(e,ee({effect:e},n)))}}const ut=[];function po(e,t,n){var r;dt();for(const s of e.keys()){let c;s._dirtyLevel<t&&(c??(c=e.get(s)===s._trackId))&&(s._shouldSchedule||(s._shouldSchedule=s._dirtyLevel===0),s._dirtyLevel=t),s._shouldSchedule&&(c??(c=e.get(s)===s._trackId))&&(process.env.NODE_ENV!=="production"&&((r=s.onTrigger)==null||r.call(s,ee({effect:s},n))),s.trigger(),(!s._runnings||s.allowRecurse)&&s._dirtyLevel!==2&&(s._shouldSchedule=!1,s.scheduler&&ut.push(s.scheduler)))}ft()}const mo=(e,t)=>{const n=new Map;return n.cleanup=e,n.computed=t,n},ht=new WeakMap,ue=Symbol(process.env.NODE_ENV!=="production"?"iterate":""),pt=Symbol(process.env.NODE_ENV!=="production"?"Map key iterate":"");function P(e,t,n){if(fe&&Ve){let r=ht.get(e);r||ht.set(e,r=new Map);let s=r.get(n);s||r.set(n,s=mo(()=>r.delete(n))),ho(Ve,s,process.env.NODE_ENV!=="production"?{target:e,type:t,key:n}:void 0)}}function ce(e,t,n,r,s,c){const i=ht.get(e);if(!i)return;let a=[];if(t==="clear")a=[...i.values()];else if(n==="length"&&x(e)){const l=Number(r);i.forEach((f,m)=>{(m==="length"||!Se(m)&&m>=l)&&a.push(f)})}else switch(n!==void 0&&a.push(i.get(n)),t){case"add":x(e)?ct(n)&&a.push(i.get("length")):(a.push(i.get(ue)),ge(e)&&a.push(i.get(pt)));break;case"delete":x(e)||(a.push(i.get(ue)),ge(e)&&a.push(i.get(pt)));break;case"set":ge(e)&&a.push(i.get(ue));break}dt();for(const l of a)l&&po(l,4,process.env.NODE_ENV!=="production"?{target:e,type:t,key:n,newValue:r,oldValue:s,oldTarget:c}:void 0);ft()}const go=qn("__proto__,__v_isRef,__isVue"),Yt=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Se)),Kt=_o();function _o(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...n){const r=v(this);for(let c=0,i=this.length;c<i;c++)P(r,"get",c+"");const s=r[t](...n);return s===-1||s===!1?r[t](...n.map(v)):s}}),["push","pop","shift","unshift","splice"].forEach(t=>{e[t]=function(...n){De(),dt();const r=v(this)[t].apply(this,n);return ft(),Ce(),r}}),e}function Eo(e){Se(e)||(e=String(e));const t=v(this);return P(t,"has",e),t.hasOwnProperty(e)}class Ut{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,r){const s=this._isReadonly,c=this._isShallow;if(n==="__v_isReactive")return!s;if(n==="__v_isReadonly")return s;if(n==="__v_isShallow")return c;if(n==="__v_raw")return r===(s?c?on:nn:c?$o:tn).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const i=x(t);if(!s){if(i&&C(Kt,n))return Reflect.get(Kt,n,r);if(n==="hasOwnProperty")return Eo}const a=Reflect.get(t,n,r);return(Se(n)?Yt.has(n):go(n))||(s||P(t,"get",n),c)?a:G(a)?i&&ct(n)?a:a.value:J(a)?s?rn(a):sn(a):a}}class wo extends Ut{constructor(t=!1){super(!1,t)}set(t,n,r,s){let c=t[n];if(!this._isShallow){const l=Ge(c);if(!Et(r)&&!Ge(r)&&(c=v(c),r=v(r)),!x(t)&&G(c)&&!G(r))return l?!1:(c.value=r,!0)}const i=x(t)&&ct(n)?Number(n)<t.length:C(t,n),a=Reflect.set(t,n,r,s);return t===v(s)&&(i?_e(r,c)&&ce(t,"set",n,r,c):ce(t,"add",n,r)),a}deleteProperty(t,n){const r=C(t,n),s=t[n],c=Reflect.deleteProperty(t,n);return c&&r&&ce(t,"delete",n,void 0,s),c}has(t,n){const r=Reflect.has(t,n);return(!Se(n)||!Yt.has(n))&&P(t,"has",n),r}ownKeys(t){return P(t,"iterate",x(t)?"length":ue),Reflect.ownKeys(t)}}class qt extends Ut{constructor(t=!1){super(!0,t)}set(t,n){return process.env.NODE_ENV!=="production"&&xe(`Set operation on key "${String(n)}" failed: target is readonly.`,t),!0}deleteProperty(t,n){return process.env.NODE_ENV!=="production"&&xe(`Delete operation on key "${String(n)}" failed: target is readonly.`,t),!0}}const bo=new wo,No=new qt,yo=new qt(!0),mt=e=>e,We=e=>Reflect.getPrototypeOf(e);function Xe(e,t,n=!1,r=!1){e=e.__v_raw;const s=v(e),c=v(t);n||(_e(t,c)&&P(s,"get",t),P(s,"get",c));const{has:i}=We(s),a=r?mt:n?Nt:bt;if(i.call(s,t))return a(e.get(t));if(i.call(s,c))return a(e.get(c));e!==s&&e.get(t)}function Ye(e,t=!1){const n=this.__v_raw,r=v(n),s=v(e);return t||(_e(e,s)&&P(r,"has",e),P(r,"has",s)),e===s?n.has(e):n.has(e)||n.has(s)}function Ke(e,t=!1){return e=e.__v_raw,!t&&P(v(e),"iterate",ue),Reflect.get(e,"size",e)}function Jt(e){e=v(e);const t=v(this);return We(t).has.call(t,e)||(t.add(e),ce(t,"add",e,e)),this}function Gt(e,t){t=v(t);const n=v(this),{has:r,get:s}=We(n);let c=r.call(n,e);c?process.env.NODE_ENV!=="production"&&en(n,r,e):(e=v(e),c=r.call(n,e));const i=s.call(n,e);return n.set(e,t),c?_e(t,i)&&ce(n,"set",e,t,i):ce(n,"add",e,t),this}function Qt(e){const t=v(this),{has:n,get:r}=We(t);let s=n.call(t,e);s?process.env.NODE_ENV!=="production"&&en(t,n,e):(e=v(e),s=n.call(t,e));const c=r?r.call(t,e):void 0,i=t.delete(e);return s&&ce(t,"delete",e,void 0,c),i}function Zt(){const e=v(this),t=e.size!==0,n=process.env.NODE_ENV!=="production"?ge(e)?new Map(e):new Set(e):void 0,r=e.clear();return t&&ce(e,"clear",void 0,void 0,n),r}function Ue(e,t){return function(r,s){const c=this,i=c.__v_raw,a=v(i),l=t?mt:e?Nt:bt;return!e&&P(a,"iterate",ue),i.forEach((f,m)=>r.call(s,l(f),l(m),c))}}function qe(e,t,n){return function(...r){const s=this.__v_raw,c=v(s),i=ge(c),a=e==="entries"||e===Symbol.iterator&&i,l=e==="keys"&&i,f=s[e](...r),m=n?mt:t?Nt:bt;return!t&&P(c,"iterate",l?pt:ue),{next(){const{value:p,done:d}=f.next();return d?{value:p,done:d}:{value:a?[m(p[0]),m(p[1])]:m(p),done:d}},[Symbol.iterator](){return this}}}}function ie(e){return function(...t){if(process.env.NODE_ENV!=="production"){const n=t[0]?`on key "${t[0]}" `:"";xe(`${Mt(e)} operation ${n}failed: target is readonly.`,v(this))}return e==="delete"?!1:e==="clear"?void 0:this}}function vo(){const e={get(c){return Xe(this,c)},get size(){return Ke(this)},has:Ye,add:Jt,set:Gt,delete:Qt,clear:Zt,forEach:Ue(!1,!1)},t={get(c){return Xe(this,c,!1,!0)},get size(){return Ke(this)},has:Ye,add:Jt,set:Gt,delete:Qt,clear:Zt,forEach:Ue(!1,!0)},n={get(c){return Xe(this,c,!0)},get size(){return Ke(this,!0)},has(c){return Ye.call(this,c,!0)},add:ie("add"),set:ie("set"),delete:ie("delete"),clear:ie("clear"),forEach:Ue(!0,!1)},r={get(c){return Xe(this,c,!0,!0)},get size(){return Ke(this,!0)},has(c){return Ye.call(this,c,!0)},add:ie("add"),set:ie("set"),delete:ie("delete"),clear:ie("clear"),forEach:Ue(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(c=>{e[c]=qe(c,!1,!1),n[c]=qe(c,!0,!1),t[c]=qe(c,!1,!0),r[c]=qe(c,!0,!0)}),[e,n,t,r]}const[So,xo,Vo,Do]=vo();function gt(e,t){const n=t?e?Do:Vo:e?xo:So;return(r,s,c)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?r:Reflect.get(C(n,s)&&s in r?n:r,s,c)}const Co={get:gt(!1,!1)},Lo={get:gt(!0,!1)},Oo={get:gt(!0,!0)};function en(e,t,n){const r=v(n);if(r!==n&&t.call(e,r)){const s=It(e);xe(`Reactive ${s} contains both the raw and reactive versions of the same object${s==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}const tn=new WeakMap,$o=new WeakMap,nn=new WeakMap,on=new WeakMap;function zo(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Ro(e){return e.__v_skip||!Object.isExtensible(e)?0:zo(It(e))}function sn(e){return Ge(e)?e:_t(e,!1,bo,Co,tn)}function rn(e){return _t(e,!0,No,Lo,nn)}function Je(e){return _t(e,!0,yo,Oo,on)}function _t(e,t,n,r,s){if(!J(e))return process.env.NODE_ENV!=="production"&&xe(`value cannot be made reactive: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;const c=s.get(e);if(c)return c;const i=Ro(e);if(i===0)return e;const a=new Proxy(e,i===2?r:n);return s.set(e,a),a}function Le(e){return Ge(e)?Le(e.__v_raw):!!(e&&e.__v_isReactive)}function Ge(e){return!!(e&&e.__v_isReadonly)}function Et(e){return!!(e&&e.__v_isShallow)}function wt(e){return e?!!e.__v_raw:!1}function v(e){const t=e&&e.__v_raw;return t?v(t):e}function Po(e){return Object.isExtensible(e)&&oo(e,"__v_skip",!0),e}const bt=e=>J(e)?sn(e):e,Nt=e=>J(e)?rn(e):e;function G(e){return!!(e&&e.__v_isRef===!0)}function To(e){return G(e)?e.value:e}const ko={get:(e,t,n)=>To(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const s=e[t];return G(s)&&!G(n)?(s.value=n,!0):Reflect.set(e,t,n,r)}};function Io(e){return Le(e)?e:new Proxy(e,ko)}/**
|
|
36
|
+
* @vue/runtime-core v3.4.27
|
|
37
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
38
|
+
* @license MIT
|
|
39
|
+
**/const he=[];function Bo(e){he.push(e)}function Mo(){he.pop()}function V(e,...t){De();const n=he.length?he[he.length-1].component:null,r=n&&n.appContext.config.warnHandler,s=jo();if(r)pe(r,n,11,[e+t.map(c=>{var i,a;return(a=(i=c.toString)==null?void 0:i.call(c))!=null?a:JSON.stringify(c)}).join(""),n&&n.proxy,s.map(({vnode:c})=>`at <${Ln(n,c.type)}>`).join(`
|
|
40
|
+
`),s]);else{const c=[`[Vue warn]: ${e}`,...t];s.length&&c.push(`
|
|
41
|
+
`,...Fo(s)),console.warn(...c)}Ce()}function jo(){let e=he[he.length-1];if(!e)return[];const t=[];for(;e;){const n=t[0];n&&n.vnode===e?n.recurseCount++:t.push({vnode:e,recurseCount:0});const r=e.component&&e.component.parent;e=r&&r.vnode}return t}function Fo(e){const t=[];return e.forEach((n,r)=>{t.push(...r===0?[]:[`
|
|
42
|
+
`],...Ao(n))}),t}function Ao({vnode:e,recurseCount:t}){const n=t>0?`... (${t} recursive calls)`:"",r=e.component?e.component.parent==null:!1,s=` at <${Ln(e.component,e.type,r)}`,c=">"+n;return e.props?[s,...Ho(e.props),c]:[s+c]}function Ho(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach(r=>{t.push(...cn(r,e[r]))}),n.length>3&&t.push(" ..."),t}function cn(e,t,n){return q(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?n?t:[`${e}=${t}`]:G(t)?(t=cn(e,v(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):R(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=v(t),n?t:[`${e}=`,t])}const yt={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush. This is likely a Vue internals bug. Please open an issue at https://github.com/vuejs/core ."};function pe(e,t,n,r){try{return r?e(...r):e()}catch(s){vt(s,t,n)}}function Oe(e,t,n,r){if(R(e)){const s=pe(e,t,n,r);return s&&Zn(s)&&s.catch(c=>{vt(c,t,n)}),s}if(x(e)){const s=[];for(let c=0;c<e.length;c++)s.push(Oe(e[c],t,n,r));return s}else process.env.NODE_ENV!=="production"&&V(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof e}`)}function vt(e,t,n,r=!0){const s=t?t.vnode:null;if(t){let c=t.parent;const i=t.proxy,a=process.env.NODE_ENV!=="production"?yt[n]:`https://vuejs.org/error-reference/#runtime-${n}`;for(;c;){const f=c.ec;if(f){for(let m=0;m<f.length;m++)if(f[m](e,i,a)===!1)return}c=c.parent}const l=t.appContext.config.errorHandler;if(l){De(),pe(l,null,10,[e,i,a]),Ce();return}}Wo(e,n,s,r)}function Wo(e,t,n,r=!0){if(process.env.NODE_ENV!=="production"){const s=yt[t];if(n&&Bo(n),V(`Unhandled error${s?` during execution of ${s}`:""}`),n&&Mo(),r)throw e;console.error(e)}else console.error(e)}let Qe=!1,St=!1;const Q=[];let le=0;const Ee=[];let oe=null,ae=0;const ln=Promise.resolve();let xt=null;const Xo=100;function Yo(e){const t=xt||ln;return e?t.then(this?e.bind(this):e):t}function Ko(e){let t=le+1,n=Q.length;for(;t<n;){const r=t+n>>>1,s=Q[r],c=$e(s);c<e||c===e&&s.pre?t=r+1:n=r}return t}function Vt(e){(!Q.length||!Q.includes(e,Qe&&e.allowRecurse?le+1:le))&&(e.id==null?Q.push(e):Q.splice(Ko(e.id),0,e),an())}function an(){!Qe&&!St&&(St=!0,xt=ln.then(fn))}function dn(e){x(e)?Ee.push(...e):(!oe||!oe.includes(e,e.allowRecurse?ae+1:ae))&&Ee.push(e),an()}function Uo(e){if(Ee.length){const t=[...new Set(Ee)].sort((n,r)=>$e(n)-$e(r));if(Ee.length=0,oe){oe.push(...t);return}for(oe=t,process.env.NODE_ENV!=="production"&&(e=e||new Map),ae=0;ae<oe.length;ae++)process.env.NODE_ENV!=="production"&&un(e,oe[ae])||oe[ae]();oe=null,ae=0}}const $e=e=>e.id==null?1/0:e.id,qo=(e,t)=>{const n=$e(e)-$e(t);if(n===0){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function fn(e){St=!1,Qe=!0,process.env.NODE_ENV!=="production"&&(e=e||new Map),Q.sort(qo);const t=process.env.NODE_ENV!=="production"?n=>un(e,n):me;try{for(le=0;le<Q.length;le++){const n=Q[le];if(n&&n.active!==!1){if(process.env.NODE_ENV!=="production"&&t(n))continue;pe(n,null,14)}}}finally{le=0,Q.length=0,Uo(e),Qe=!1,xt=null,(Q.length||Ee.length)&&fn(e)}}function un(e,t){if(!e.has(t))e.set(t,1);else{const n=e.get(t);if(n>Xo){const r=t.ownerInstance,s=r&&Cn(r.type);return vt(`Maximum recursive updates exceeded${s?` in component <${s}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,null,10),!0}else e.set(t,n+1)}}const ze=new Set;process.env.NODE_ENV!=="production"&&(Ft().__VUE_HMR_RUNTIME__={createRecord:Dt(Jo),rerender:Dt(Go),reload:Dt(Qo)});const Ze=new Map;function Jo(e,t){return Ze.has(e)?!1:(Ze.set(e,{initialDef:Re(t),instances:new Set}),!0)}function Re(e){return On(e)?e.__vccOpts:e}function Go(e,t){const n=Ze.get(e);n&&(n.initialDef.render=t,[...n.instances].forEach(r=>{t&&(r.render=t,Re(r.type).render=t),r.renderCache=[],r.effect.dirty=!0,r.update()}))}function Qo(e,t){const n=Ze.get(e);if(!n)return;t=Re(t),hn(n.initialDef,t);const r=[...n.instances];for(const s of r){const c=Re(s.type);ze.has(c)||(c!==n.initialDef&&hn(c,t),ze.add(c)),s.appContext.propsCache.delete(s.type),s.appContext.emitsCache.delete(s.type),s.appContext.optionsCache.delete(s.type),s.ceReload?(ze.add(c),s.ceReload(t.styles),ze.delete(c)):s.parent?(s.parent.effect.dirty=!0,Vt(s.parent.update)):s.appContext.reload?s.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required.")}dn(()=>{for(const s of r)ze.delete(Re(s.type))})}function hn(e,t){ee(e,t);for(const n in e)n!=="__file"&&!(n in t)&&delete e[n]}function Dt(e){return(t,n)=>{try{return e(t,n)}catch(r){console.error(r),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let we,et=[];function pn(e,t){var n,r;we=e,we?(we.enabled=!0,et.forEach(({event:s,args:c})=>we.emit(s,...c)),et=[]):typeof window<"u"&&window.HTMLElement&&!((r=(n=window.navigator)==null?void 0:n.userAgent)!=null&&r.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(c=>{pn(c,t)}),setTimeout(()=>{we||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,et=[])},3e3)):et=[]}let se=null,Zo=null;function wr(){}const es=Symbol.for("v-ndc"),ts=e=>e.__isSuspense;function ns(e,t){t&&t.pendingBranch?x(e)?t.effects.push(...e):t.effects.push(e):dn(e)}const os=Symbol.for("v-scx"),ss=()=>{{const e=ms(os);return e||process.env.NODE_ENV!=="production"&&V("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),e}},tt={};function rs(e,t,{immediate:n,deep:r,flush:s,once:c,onTrack:i,onTrigger:a}=re){if(t&&c){const u=t;t=(...y)=>{u(...y),E()}}process.env.NODE_ENV!=="production"&&r!==void 0&&typeof r=="number"&&V('watch() "deep" option with number value will be used as watch depth in future versions. Please use a boolean instead to avoid potential breakage.'),process.env.NODE_ENV!=="production"&&!t&&(n!==void 0&&V('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),r!==void 0&&V('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'),c!==void 0&&V('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const l=u=>{V("Invalid watch source: ",u,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},f=ye,m=u=>r===!0?u:be(u,r===!1?1:void 0);let p,d=!1,w=!1;if(G(e)?(p=()=>e.value,d=Et(e)):Le(e)?(p=()=>m(e),d=!0):x(e)?(w=!0,d=e.some(u=>Le(u)||Et(u)),p=()=>e.map(u=>{if(G(u))return u.value;if(Le(u))return m(u);if(R(u))return pe(u,f,2);process.env.NODE_ENV!=="production"&&l(u)})):R(e)?t?p=()=>pe(e,f,2):p=()=>(b&&b(),Oe(e,f,3,[h])):(p=me,process.env.NODE_ENV!=="production"&&l(e)),t&&r){const u=p;p=()=>be(u())}let b,h=u=>{b=_.onStop=()=>{pe(u,f,4),b=_.onStop=void 0}},N;if(zt)if(h=me,t?n&&Oe(t,f,3,[p(),w?[]:void 0,h]):p(),s==="sync"){const u=ss();N=u.__watcherHandles||(u.__watcherHandles=[])}else return me;let g=w?new Array(e.length).fill(tt):tt;const S=()=>{if(!(!_.active||!_.dirty))if(t){const u=_.run();(r||d||(w?u.some((y,$)=>_e(y,g[$])):_e(u,g)))&&(b&&b(),Oe(t,f,3,[u,g===tt?void 0:w&&g[0]===tt?[]:g,h]),g=u)}else _.run()};S.allowRecurse=!!t;let L;s==="sync"?L=S:s==="post"?L=()=>yn(S,f&&f.suspense):(S.pre=!0,f&&(S.id=f.uid),L=()=>Vt(S));const _=new fo(p,me,L),E=()=>{_.stop()};return process.env.NODE_ENV!=="production"&&(_.onTrack=i,_.onTrigger=a),t?n?S():g=_.run():s==="post"?yn(_.run.bind(_),f&&f.suspense):_.run(),N&&N.push(E),E}function cs(e,t,n){const r=this.proxy,s=q(e)?e.includes(".")?is(r,e):()=>r[e]:e.bind(r,r);let c;R(t)?c=t:(c=t.handler,n=t);const i=Dn(this),a=rs(s,c.bind(r),n);return i(),a}function is(e,t){const n=t.split(".");return()=>{let r=e;for(let s=0;s<n.length&&r;s++)r=r[n[s]];return r}}function be(e,t=1/0,n){if(t<=0||!J(e)||e.__v_skip||(n=n||new Set,n.has(e)))return e;if(n.add(e),t--,G(e))be(e.value,t,n);else if(x(e))for(let r=0;r<e.length;r++)be(e[r],t,n);else if(Qn(e)||ge(e))e.forEach(r=>{be(r,t,n)});else if(to(e))for(const r in e)be(e[r],t,n);return e}function ls(e,t,n=ye,r=!1){if(n){const s=n[e]||(n[e]=[]),c=t.__weh||(t.__weh=(...i)=>{if(n.isUnmounted)return;De();const a=Dn(n),l=Oe(t,n,e,i);return a(),Ce(),l});return r?s.unshift(c):s.push(c),c}else if(process.env.NODE_ENV!=="production"){const s=no(yt[e].replace(/ hook$/,""));V(`${s} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.`)}}const mn=(e=>(t,n=ye)=>(!zt||e==="sp")&&ls(e,(...r)=>t(...r),n))("um"),Ct=e=>e?Ds(e)?Cs(e)||e.proxy:Ct(e.parent):null,Pe=ee(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>process.env.NODE_ENV!=="production"?Je(e.props):e.props,$attrs:e=>process.env.NODE_ENV!=="production"?Je(e.attrs):e.attrs,$slots:e=>process.env.NODE_ENV!=="production"?Je(e.slots):e.slots,$refs:e=>process.env.NODE_ENV!=="production"?Je(e.refs):e.refs,$parent:e=>Ct(e.parent),$root:e=>Ct(e.root),$emit:e=>e.emit,$options:e=>fs(e),$forceUpdate:e=>e.f||(e.f=()=>{e.effect.dirty=!0,Vt(e.update)}),$nextTick:e=>e.n||(e.n=Yo.bind(e.proxy)),$watch:e=>cs.bind(e)}),as=e=>e==="_"||e==="$",Lt=(e,t)=>e!==re&&!e.__isScriptSetup&&C(e,t),ds={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:r,data:s,props:c,accessCache:i,type:a,appContext:l}=e;if(process.env.NODE_ENV!=="production"&&t==="__isVue")return!0;let f;if(t[0]!=="$"){const w=i[t];if(w!==void 0)switch(w){case 1:return r[t];case 2:return s[t];case 4:return n[t];case 3:return c[t]}else{if(Lt(r,t))return i[t]=1,r[t];if(s!==re&&C(s,t))return i[t]=2,s[t];if((f=e.propsOptions[0])&&C(f,t))return i[t]=3,c[t];if(n!==re&&C(n,t))return i[t]=4,n[t];i[t]=0}}const m=Pe[t];let p,d;if(m)return t==="$attrs"?(P(e.attrs,"get",""),process.env.NODE_ENV!=="production"&&void 0):process.env.NODE_ENV!=="production"&&t==="$slots"&&P(e,"get",t),m(e);if((p=a.__cssModules)&&(p=p[t]))return p;if(n!==re&&C(n,t))return i[t]=4,n[t];if(d=l.config.globalProperties,C(d,t))return d[t];process.env.NODE_ENV!=="production"&&se&&(!q(t)||t.indexOf("__v")!==0)&&(s!==re&&as(t[0])&&C(s,t)?V(`Property ${JSON.stringify(t)} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`):e===se&&V(`Property ${JSON.stringify(t)} was accessed during render but is not defined on instance.`))},set({_:e},t,n){const{data:r,setupState:s,ctx:c}=e;return Lt(s,t)?(s[t]=n,!0):process.env.NODE_ENV!=="production"&&s.__isScriptSetup&&C(s,t)?(V(`Cannot mutate <script setup> binding "${t}" from Options API.`),!1):r!==re&&C(r,t)?(r[t]=n,!0):C(e.props,t)?(process.env.NODE_ENV!=="production"&&V(`Attempting to mutate prop "${t}". Props are readonly.`),!1):t[0]==="$"&&t.slice(1)in e?(process.env.NODE_ENV!=="production"&&V(`Attempting to mutate public property "${t}". Properties starting with $ are reserved and readonly.`),!1):(process.env.NODE_ENV!=="production"&&t in e.appContext.config.globalProperties?Object.defineProperty(c,t,{enumerable:!0,configurable:!0,value:n}):c[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:s,propsOptions:c}},i){let a;return!!n[i]||e!==re&&C(e,i)||Lt(t,i)||(a=c[0])&&C(a,i)||C(r,i)||C(Pe,i)||C(s.config.globalProperties,i)},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:C(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};process.env.NODE_ENV!=="production"&&(ds.ownKeys=e=>(V("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."),Reflect.ownKeys(e)));function gn(e){return x(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function fs(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:s,optionsCache:c,config:{optionMergeStrategies:i}}=e.appContext,a=c.get(t);let l;return a?l=a:!s.length&&!n&&!r?l=t:(l={},s.length&&s.forEach(f=>nt(l,f,i,!0)),nt(l,t,i)),J(t)&&c.set(t,l),l}function nt(e,t,n,r=!1){const{mixins:s,extends:c}=t;c&&nt(e,c,n,!0),s&&s.forEach(i=>nt(e,i,n,!0));for(const i in t)if(r&&i==="expose")process.env.NODE_ENV!=="production"&&V('"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.');else{const a=us[i]||n&&n[i];e[i]=a?a(e[i],t[i]):t[i]}return e}const us={data:_n,props:wn,emits:wn,methods:Te,computed:Te,beforeCreate:M,created:M,beforeMount:M,mounted:M,beforeUpdate:M,updated:M,beforeDestroy:M,beforeUnmount:M,destroyed:M,unmounted:M,activated:M,deactivated:M,errorCaptured:M,serverPrefetch:M,components:Te,directives:Te,watch:ps,provide:_n,inject:hs};function _n(e,t){return t?e?function(){return ee(R(e)?e.call(this,this):e,R(t)?t.call(this,this):t)}:t:e}function hs(e,t){return Te(En(e),En(t))}function En(e){if(x(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function M(e,t){return e?[...new Set([].concat(e,t))]:t}function Te(e,t){return e?ee(Object.create(null),e,t):t}function wn(e,t){return e?x(e)&&x(t)?[...new Set([...e,...t])]:ee(Object.create(null),gn(e),gn(t??{})):t}function ps(e,t){if(!e)return t;if(!t)return e;const n=ee(Object.create(null),e);for(const r in t)n[r]=M(e[r],t[r]);return n}let bn=null;function ms(e,t,n=!1){const r=ye||se;if(r||bn){const s=r?r.parent==null?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:bn._context.provides;if(s&&e in s)return s[e];if(arguments.length>1)return n&&R(t)?t.call(r&&r.proxy):t;process.env.NODE_ENV!=="production"&&V(`injection "${String(e)}" not found.`)}else process.env.NODE_ENV!=="production"&&V("inject() can only be used inside setup() or functional components.")}const gs={},Nn=e=>Object.getPrototypeOf(e)===gs,yn=ns,_s=e=>e.__isTeleport,vn=Symbol.for("v-fgt"),Es=Symbol.for("v-txt"),ws=Symbol.for("v-cmt");let Ne=null;function bs(e){return e?e.__v_isVNode===!0:!1}const Ns=(...e)=>xn(...e),Sn=({key:e})=>e??null,ot=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?q(e)||G(e)||R(e)?{i:se,r:e,k:t,f:!!n}:e:null);function ys(e,t=null,n=null,r=0,s=null,c=e===vn?0:1,i=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Sn(t),ref:t&&ot(t),scopeId:Zo,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:c,patchFlag:r,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:se};return a?(Ot(l,n),c&128&&e.normalize(l)):n&&(l.shapeFlag|=q(n)?8:16),process.env.NODE_ENV!=="production"&&l.key!==l.key&&V("VNode created with invalid key (NaN). VNode type:",l.type),!i&&Ne&&(l.patchFlag>0||c&6)&&l.patchFlag!==32&&Ne.push(l),l}const vs=process.env.NODE_ENV!=="production"?Ns:xn;function xn(e,t=null,n=null,r=0,s=null,c=!1){if((!e||e===es)&&(process.env.NODE_ENV!=="production"&&!e&&V(`Invalid vnode type when creating vnode: ${e}.`),e=ws),bs(e)){const a=st(e,t,!0);return n&&Ot(a,n),!c&&Ne&&(a.shapeFlag&6?Ne[Ne.indexOf(e)]=a:Ne.push(a)),a.patchFlag|=-2,a}if(On(e)&&(e=e.__vccOpts),t){t=Ss(t);let{class:a,style:l}=t;a&&!q(a)&&(t.class=lt(a)),J(l)&&(wt(l)&&!x(l)&&(l=ee({},l)),t.style=it(l))}const i=q(e)?1:ts(e)?128:_s(e)?64:J(e)?4:R(e)?2:0;return process.env.NODE_ENV!=="production"&&i&4&&wt(e)&&(e=v(e),V("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
|
|
43
|
+
Component that was made reactive: `,e)),ys(e,t,n,r,s,i,c,!0)}function Ss(e){return e?wt(e)||Nn(e)?ee({},e):e:null}function st(e,t,n=!1,r=!1){const{props:s,ref:c,patchFlag:i,children:a,transition:l}=e,f=t?Vs(s||{},t):s,m={__v_isVNode:!0,__v_skip:!0,type:e.type,props:f,key:f&&Sn(f),ref:t&&t.ref?n&&c?x(c)?c.concat(ot(t)):[c,ot(t)]:ot(t):c,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:process.env.NODE_ENV!=="production"&&i===-1&&x(a)?a.map(Vn):a,target:e.target,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==vn?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&st(e.ssContent),ssFallback:e.ssFallback&&st(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&(m.transition=l.clone(m)),m}function Vn(e){const t=st(e);return x(e.children)&&(t.children=e.children.map(Vn)),t}function xs(e=" ",t=0){return vs(Es,null,e,t)}function Ot(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(x(t))n=16;else if(typeof t=="object")if(r&65){const s=t.default;s&&(s._c&&(s._d=!1),Ot(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!Nn(t)?t._ctx=se:s===3&&se&&(se.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else R(t)?(t={default:t,_ctx:se},n=32):(t=String(t),r&64?(n=16,t=[xs(t)]):n=8);e.children=t,e.shapeFlag|=n}function Vs(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const s in r)if(s==="class")t.class!==r.class&&(t.class=lt([t.class,r.class]));else if(s==="style")t.style=it([t.style,r.style]);else if(Jn(s)){const c=t[s],i=r[s];i&&c!==i&&!(x(c)&&c.includes(i))&&(t[s]=c?[].concat(c,i):i)}else s!==""&&(t[s]=r[s])}return t}let ye=null,$t;{const e=Ft(),t=(n,r)=>{let s;return(s=e[n])||(s=e[n]=[]),s.push(r),c=>{s.length>1?s.forEach(i=>i(c)):s[0](c)}};$t=t("__VUE_INSTANCE_SETTERS__",n=>ye=n),t("__VUE_SSR_SETTERS__",n=>zt=n)}const Dn=e=>{const t=ye;return $t(e),e.scope.on(),()=>{e.scope.off(),$t(t)}};function Ds(e){return e.vnode.shapeFlag&4}let zt=!1;process.env.NODE_ENV;function Cs(e){if(e.exposed)return e.exposeProxy||(e.exposeProxy=new Proxy(Io(Po(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Pe)return Pe[n](e)},has(t,n){return n in t||n in Pe}}))}const Ls=/(?:^|[-_])(\w)/g,Os=e=>e.replace(Ls,t=>t.toUpperCase()).replace(/[-_]/g,"");function Cn(e,t=!0){return R(e)?e.displayName||e.name:e.name||t&&e.__name}function Ln(e,t,n=!1){let r=Cn(t);if(!r&&t.__file){const s=t.__file.match(/([^/\\]+)\.\w+$/);s&&(r=s[1])}if(!r&&e&&e.parent){const s=c=>{for(const i in c)if(c[i]===t)return i};r=s(e.components||e.parent.type.components)||s(e.appContext.components)}return r?Os(r):n?"App":"Anonymous"}function On(e){return R(e)&&"__vccOpts"in e}process.env.NODE_ENV,process.env.NODE_ENV,process.env.NODE_ENV;const $s={class:"gc-header"},zs={class:"gc-icon-block"},Rs={class:"gc-loading"},Ps=["src"],Ts=["src"],ks={class:"gc-footer"},Is=o.createElementVNode("div",{class:"gc-drag-line"},null,-1),ke=o.defineComponent({__name:"index",props:{config:{default:Tt},events:{default:()=>({})},data:{default:()=>({})}},setup(e,{expose:t}){const n=e,{data:r,events:s,config:c}=n,i=o.reactive({...Kn(),...o.toRaw(r)}),a=o.reactive({...o.toRaw(s)}),l=o.reactive({...Tt(),...o.toRaw(c)});o.watch(()=>n.data,(u,y)=>{Object.assign(i,u)},{deep:!0}),o.watch(()=>n.events,(u,y)=>{Object.assign(a,u)},{deep:!0}),o.watch(()=>n.config,(u,y)=>{Object.assign(l,u)},{deep:!0});const f=o.ref(null),m=o.ref(null),p=o.ref(null),d=o.ref(null),w=o.ref(null),b=Un(i,a,l,f,p,w,d,m,()=>{i.thumb="",i.image="",i.thumbX=0,i.thumbY=0,i.thumbWidth=0,i.thumbHeight=0}),h=o.computed(()=>{const u=l.horizontalPadding||0,y=l.verticalPadding||0;return{width:(l.width||0)+u*2+(l.showTheme?2:0)+"px",paddingLeft:u+"px",paddingRight:u+"px",paddingTop:y+"px",paddingBottom:y+"px"}}),N=o.computed(()=>({width:i.thumbWidth+"px",height:i.thumbHeight+"px",top:i.thumbY+"px",left:b.state.thumbLeft+"px"})),g=o.computed(()=>({width:l.width+"px",height:l.height+"px"})),S=o.computed(()=>i.image!=""),L=o.computed(()=>i.thumb!=""),_=o.computed(()=>(l.width||0)>0||(l.height||0)>0),E=u=>u.preventDefault();return o.onMounted(async()=>{await o.nextTick(),d.value&&d.value.addEventListener("dragstart",E)}),mn(()=>{d.value&&d.value.removeEventListener("dragstart",E)}),t({reset:b.resetData,clear:b.clearData,refresh:b.refresh,close:b.close}),(u,y)=>o.withDirectives((o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(`go-captcha gc-wrapper ${l.showTheme&&"gc-theme"}`),style:o.normalizeStyle(h.value),ref_key:"rootRef",ref:f},[o.createElementVNode("div",$s,[o.createElementVNode("span",null,o.toDisplayString(l.title),1),o.createElementVNode("div",zs,[o.createVNode(je,{width:l.iconSize,height:l.iconSize,onClick:o.unref(b).closeEvent},null,8,["width","height","onClick"]),o.createVNode(Fe,{width:l.iconSize,height:l.iconSize,onClick:o.unref(b).refreshEvent},null,8,["width","height","onClick"])])]),o.createElementVNode("div",{class:"gc-body",ref_key:"containerRef",ref:p,style:o.normalizeStyle(g.value)},[o.createElementVNode("div",Rs,[o.createVNode(Ae)]),o.withDirectives(o.createElementVNode("img",{class:"gc-picture",style:o.normalizeStyle(g.value),src:i.image,alt:""},null,12,Ps),[[o.vShow,S.value]]),o.createElementVNode("div",{class:"gc-tile",ref_key:"tileRef",ref:w,style:o.normalizeStyle(N.value)},[o.withDirectives(o.createElementVNode("img",{src:i.thumb,alt:""},null,8,Ts),[[o.vShow,L.value]])],4)],4),o.createElementVNode("div",ks,[o.createElementVNode("div",{class:"gc-drag-slide-bar",ref_key:"dragBarRef",ref:m},[Is,o.createElementVNode("div",{class:o.normalizeClass(["gc-drag-block",!S.value&&"disabled"]),ref_key:"dragBlockRef",ref:d,onMousedown:y[1]||(y[1]=(...$)=>o.unref(b).dragEvent&&o.unref(b).dragEvent(...$)),style:o.normalizeStyle({left:o.unref(b).state.dragLeft+"px"})},[o.createElementVNode("div",{class:"gc-drag-block-inline",onTouchstart:y[0]||(y[0]=(...$)=>o.unref(b).dragEvent&&o.unref(b).dragEvent(...$))},[o.createVNode(kt)],32)],38)],512)])],6)),[[o.vShow,_.value]])}}),Nr="";ke.name="gocaptcha-slide",ke.install=function(e){e.component("gocaptcha-slide",ke)};const $n=()=>({width:300,height:220,verticalPadding:16,horizontalPadding:12,showTheme:!0,title:"请拖拽贴图完成拼图",iconSize:22,scope:!0}),Bs=()=>({thumbX:0,thumbY:0,thumbWidth:0,thumbHeight:0,image:"",thumb:""});function Ms(e,t,n,r,s,c,i){const a=o.reactive({x:e.thumbX||0,y:e.thumbY||0,isFreeze:!1});o.watch(()=>e,(h,N)=>{a.isFreeze||(a.x=h.thumbX||0,a.y=h.thumbY||0)},{deep:!0});const l=h=>{const N=h.touches&&h.touches[0],g=c.value.offsetLeft,S=c.value.offsetTop,L=s.value.offsetWidth,_=s.value.offsetHeight,E=c.value.offsetWidth,u=c.value.offsetHeight,y=L-E,$=_-u;let te=!1,ne=null,K=0,W=0,T=0,Z=0;N?(K=N.pageX-g,W=N.pageY-S):(K=h.clientX-g,W=h.clientY-S);const F=k=>{te=!0;const I=k.touches&&k.touches[0];let U=0,B=0;I?(U=I.pageX-K,B=I.pageY-W):(U=k.clientX-K,B=k.clientY-W),U<=0&&(U=0),B<=0&&(B=0),U>=y&&(U=y),B>=$&&(B=$),a.x=U,a.y=B,T=U,Z=B,t.move&&t.move(U,B),k.cancelBubble=!0,k.preventDefault()},j=k=>{rt(s.value,k)&&te&&(te=!1,z(),!(T<0||Z<0)&&(t.confirm&&t.confirm({x:T,y:Z},()=>{w()}),k.cancelBubble=!0,k.preventDefault()))},X=k=>{ne=k},A=()=>{ne=null},H=k=>{ne&&(j(ne),z())},de=n.scope,D=de?r.value:s.value,O=de?r.value:document.body,z=()=>{O.removeEventListener("mousemove",F,!1),O.removeEventListener("touchmove",F,{passive:!1}),D.removeEventListener("mouseup",j,!1),D.removeEventListener("mouseenter",A,!1),D.removeEventListener("mouseleave",X,!1),D.removeEventListener("touchend",j,!1),O.removeEventListener("mouseleave",j,!1),O.removeEventListener("mouseup",H,!1),a.isFreeze=!1};a.isFreeze=!0,O.addEventListener("mousemove",F,!1),O.addEventListener("touchmove",F,{passive:!1}),D.addEventListener("mouseup",j,!1),D.addEventListener("mouseenter",A,!1),D.addEventListener("mouseleave",X,!1),D.addEventListener("touchend",j,!1),O.addEventListener("mouseleave",j,!1),O.addEventListener("mouseup",H,!1)},f=h=>(p(),h.cancelBubble=!0,h.preventDefault(),!1),m=h=>(d(),h.cancelBubble=!0,h.preventDefault(),!1),p=()=>{t&&t.close&&t.close(),w()},d=()=>{t&&t.refresh&&t.refresh(),w()},w=()=>{a.x=e.thumbX||0,a.y=e.thumbY||0};return{state:a,dragEvent:l,closeEvent:f,refreshEvent:m,resetData:w,clearData:()=>{i&&i(),w()},refresh:d,close:p}}const js={class:"gc-header gc-header2"},Fs={class:"gc-loading"},As=["src"],Hs=["src"],Ws={class:"gc-footer"},Xs={class:"gc-icon-block"},Ie=o.defineComponent({__name:"index",props:{config:{default:$n},events:{default:()=>({})},data:{default:()=>({})}},setup(e,{expose:t}){const n=e,{data:r,events:s,config:c}=n,i=o.reactive({...Bs(),...o.toRaw(r)}),a=o.reactive({...o.toRaw(s)}),l=o.reactive({...$n(),...o.toRaw(c)});o.watch(()=>n.data,(_,E)=>{Object.assign(i,_)},{deep:!0}),o.watch(()=>n.events,(_,E)=>{Object.assign(a,_)},{deep:!0}),o.watch(()=>n.config,(_,E)=>{Object.assign(l,_)},{deep:!0});const f=o.ref(null),m=o.ref(null),p=o.ref(null),d=Ms(i,a,l,f,m,p,()=>{i.thumb="",i.image="",i.thumbX=0,i.thumbY=0,i.thumbWidth=0,i.thumbHeight=0}),w=o.computed(()=>{const _=l.horizontalPadding||0,E=l.verticalPadding||0;return{width:(l.width||0)+_*2+(l.showTheme?2:0)+"px",paddingLeft:_+"px",paddingRight:_+"px",paddingTop:E+"px",paddingBottom:E+"px"}}),b=o.computed(()=>({width:i.thumbWidth+"px",height:i.thumbHeight+"px",top:d.state.y+"px",left:d.state.x+"px"})),h=o.computed(()=>({width:l.width+"px",height:l.height+"px"})),N=o.computed(()=>i.image!=""),g=o.computed(()=>i.thumb!=""),S=o.computed(()=>(l.width||0)>0||(l.height||0)>0),L=_=>_.preventDefault();return o.onMounted(async()=>{await o.nextTick(),p.value&&p.value.addEventListener("dragstart",L)}),mn(()=>{p.value&&p.value.removeEventListener("dragstart",L)}),t({reset:d.resetData,clear:d.clearData,refresh:d.refresh,close:d.close}),(_,E)=>o.withDirectives((o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(`go-captcha gc-wrapper ${l.showTheme&&"gc-theme"}`),style:o.normalizeStyle(w.value),ref_key:"rootRef",ref:f},[o.createElementVNode("div",js,[o.createElementVNode("span",null,o.toDisplayString(l.title),1)]),o.createElementVNode("div",{class:"gc-body",ref_key:"containerRef",ref:m,style:o.normalizeStyle(h.value)},[o.createElementVNode("div",Fs,[o.createVNode(Ae)]),o.withDirectives(o.createElementVNode("img",{class:"gc-picture",style:o.normalizeStyle(h.value),src:i.image,alt:""},null,12,As),[[o.vShow,N.value]]),o.createElementVNode("div",{class:"gc-tile",ref_key:"tileRef",ref:p,style:o.normalizeStyle(b.value),onMousedown:E[0]||(E[0]=(...u)=>o.unref(d).dragEvent&&o.unref(d).dragEvent(...u)),onTouchstart:E[1]||(E[1]=(...u)=>o.unref(d).dragEvent&&o.unref(d).dragEvent(...u))},[o.withDirectives(o.createElementVNode("img",{src:i.thumb,alt:""},null,8,Hs),[[o.vShow,g.value]])],36)],4),o.createElementVNode("div",Ws,[o.createElementVNode("div",Xs,[o.createVNode(je,{width:l.iconSize,height:l.iconSize,onClick:o.unref(d).closeEvent},null,8,["width","height","onClick"]),o.createVNode(Fe,{width:l.iconSize,height:l.iconSize,onClick:o.unref(d).refreshEvent},null,8,["width","height","onClick"])])])],6)),[[o.vShow,S.value]])}}),yr="";Ie.name="gocaptcha-slide-region",Ie.install=function(e){e.component("gocaptcha-slide-region",Ie)};const Rt=()=>({width:300,height:220,size:220,verticalPadding:16,horizontalPadding:12,showTheme:!0,title:"请拖动滑块完成拼图",iconSize:22,scope:!0}),Ys=()=>({angle:0,image:"",thumb:""});function Ks(e,t,n,r,s,c,i){const a=o.reactive({dragLeft:0,thumbAngle:e.angle||0,isFreeze:!1});o.watch(()=>e,(h,N)=>{a.isFreeze||(a.thumbAngle=h.angle||0)},{deep:!0});const l=h=>{const N=h.touches&&h.touches[0],g=s.value.offsetLeft,S=c.value.offsetWidth,L=s.value.offsetWidth,_=S-L,E=360,u=(E-e.angle)/_;let y=0,$=!1,te=null,ne=0,K=0;N?ne=N.pageX-g:ne=h.clientX-g;const W=D=>{$=!0;const O=D.touches&&D.touches[0];let z=0;if(O?z=O.pageX-ne:z=D.clientX-ne,y=e.angle+z*u,z>=_){a.dragLeft=_,a.thumbAngle=K=E;return}if(z<=0){a.dragLeft=0,a.thumbAngle=K=e.angle;return}a.dragLeft=z,a.thumbAngle=K=y,t.rotate&&t.rotate(y),D.cancelBubble=!0,D.preventDefault()},T=D=>{rt(c.value,D)&&$&&(de(),!(K<0)&&($=!1,t.confirm&&t.confirm(parseInt(K.toString()),()=>{w()}),D.cancelBubble=!0,D.preventDefault()))},Z=D=>{te=D},F=()=>{te=null},j=D=>{te&&(T(te),de())},X=n.scope,A=X?r.value:c.value,H=X?r.value:document.body,de=()=>{H.removeEventListener("mousemove",W,!1),H.removeEventListener("touchmove",W,{passive:!1}),A.removeEventListener("mouseup",T,!1),A.removeEventListener("mouseenter",F,!1),A.removeEventListener("mouseleave",Z,!1),A.removeEventListener("touchend",T,!1),H.removeEventListener("mouseleave",T,!1),H.removeEventListener("mouseup",j,!1),a.isFreeze=!1};a.isFreeze=!0,H.addEventListener("mousemove",W,!1),H.addEventListener("touchmove",W,{passive:!1}),A.addEventListener("mouseup",T,!1),A.addEventListener("mouseenter",F,!1),A.addEventListener("mouseleave",Z,!1),A.addEventListener("touchend",T,!1),H.addEventListener("mouseleave",T,!1),H.addEventListener("mouseup",j,!1)},f=h=>(p(),h.cancelBubble=!0,h.preventDefault(),!1),m=h=>(d(),h.cancelBubble=!0,h.preventDefault(),!1),p=()=>{t&&t.close&&t.close(),w()},d=()=>{t&&t.refresh&&t.refresh(),w()},w=()=>{a.dragLeft=0,a.thumbAngle=e.angle};return{state:a,dragEvent:l,closeEvent:f,refreshEvent:m,resetData:w,clearData:()=>{i&&i(),w()},refresh:d,close:p}}const Us={class:"gc-header"},qs={class:"gc-icon-block"},Js={class:"gc-loading"},Gs=["src"],Qs=o.createElementVNode("div",{class:"gc-round"},null,-1),Zs={class:"gc-thumb gc-rotate-thumb"},er=["src"],tr={class:"gc-footer"},nr=o.createElementVNode("div",{class:"gc-drag-line"},null,-1),Be=o.defineComponent({__name:"index",props:{config:{default:Rt},events:{default:()=>({})},data:{default:()=>({})}},setup(e,{expose:t}){const n=e,{data:r,events:s,config:c}=n,i=o.reactive({...Ys(),...o.toRaw(r)}),a=o.reactive({...o.toRaw(s)}),l=o.reactive({...Rt(),...o.toRaw(c)});o.watch(()=>n.data,(E,u)=>{Object.assign(i,E)},{deep:!0}),o.watch(()=>n.events,(E,u)=>{Object.assign(a,E)},{deep:!0}),o.watch(()=>n.config,(E,u)=>{Object.assign(l,E)},{deep:!0});const f=o.ref(null),m=o.ref(null),p=o.ref(null),d=Ks(i,a,l,f,p,m,()=>{i.thumb="",i.image="",i.angle=0}),w=o.computed(()=>{const E=l.horizontalPadding||0,u=l.verticalPadding||0;return{width:(l.width||0)+E*2+(l.showTheme?2:0)+"px",paddingLeft:E+"px",paddingRight:E+"px",paddingTop:u+"px",paddingBottom:u+"px"}}),b=o.computed(()=>({transform:`rotate(${d.state.thumbAngle}deg)`})),h=o.computed(()=>({width:l.width+"px",height:l.height+"px"})),N=o.computed(()=>{const E=(l.size||0)>0?l.size:Rt().size;return{width:E+"px",height:E+"px"}}),g=o.computed(()=>i.image!=""),S=o.computed(()=>i.thumb!=""),L=o.computed(()=>(l.width||0)>0||(l.height||0)>0),_=E=>E.preventDefault();return o.onMounted(async()=>{await o.nextTick(),p.value&&p.value.addEventListener("dragstart",_)}),o.onUnmounted(()=>{p.value&&p.value.removeEventListener("dragstart",_)}),t({reset:d.resetData,clear:d.clearData,refresh:d.refresh,close:d.close}),(E,u)=>o.withDirectives((o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(`go-captcha gc-wrapper ${l.showTheme&&"gc-theme"}`),style:o.normalizeStyle(w.value),ref_key:"rootRef",ref:f},[o.createElementVNode("div",Us,[o.createElementVNode("span",null,o.toDisplayString(l.title),1),o.createElementVNode("div",qs,[o.createVNode(je,{width:l.iconSize,height:l.iconSize,onClick:o.unref(d).closeEvent},null,8,["width","height","onClick"]),o.createVNode(Fe,{width:l.iconSize,height:l.iconSize,onClick:o.unref(d).refreshEvent},null,8,["width","height","onClick"])])]),o.createElementVNode("div",{class:"gc-body gc-rotate-body",ref:"containerRef",style:o.normalizeStyle(h.value)},[o.createElementVNode("div",{class:"gc-body-inner",style:o.normalizeStyle(N.value)},[o.createElementVNode("div",Js,[o.createVNode(Ae)]),o.createElementVNode("div",{class:"gc-picture gc-rotate-picture",style:o.normalizeStyle(N.value)},[o.withDirectives(o.createElementVNode("img",{src:i.image,alt:""},null,8,Gs),[[o.vShow,g.value]]),Qs],4),o.createElementVNode("div",Zs,[o.createElementVNode("div",{class:"gc-rotate-thumb-block",style:o.normalizeStyle(b.value)},[o.withDirectives(o.createElementVNode("img",{src:i.thumb,alt:""},null,8,er),[[o.vShow,S.value]])],4)])],4)],4),o.createElementVNode("div",tr,[o.createElementVNode("div",{class:"gc-drag-slide-bar",ref_key:"dragBarRef",ref:m},[nr,o.createElementVNode("div",{class:o.normalizeClass(["gc-drag-block",!g.value&&"disabled"]),ref_key:"dragBlockRef",ref:p,onMousedown:u[1]||(u[1]=(...y)=>o.unref(d).dragEvent&&o.unref(d).dragEvent(...y)),style:o.normalizeStyle({left:o.unref(d).state.dragLeft+"px"})},[o.createElementVNode("div",{class:"gc-drag-block-inline",onTouchstart:u[0]||(u[0]=(...y)=>o.unref(d).dragEvent&&o.unref(d).dragEvent(...y))},[o.createVNode(kt)],32)],38)],512)])],6)),[[o.vShow,L.value]])}}),vr="";Be.name="gocaptcha-rotate",Be.install=function(e){e.component("gocaptcha-rotate",Be)};const or=[o.createElementVNode("circle",{fill:"#3E7CFF",cx:"100",cy:"100",r:"96.3"},null,-1),o.createElementVNode("path",{fill:"#FFFFFF",d:`M140.8,64.4l-39.6-11.9h-2.4L59.2,64.4c-1.6,0.8-2.8,2.4-2.8,4v24.1c0,25.3,15.8,45.9,42.3,54.6
|
|
44
|
+
c0.4,0,0.8,0.4,1.2,0.4c0.4,0,0.8,0,1.2-0.4c26.5-8.7,42.3-28.9,42.3-54.6V68.3C143.5,66.8,142.3,65.2,140.8,64.4z`},null,-1)],sr=o.defineComponent({__name:"btn-default-icon",emits:["click"],setup(e,{emit:t}){const n=t;function r(s){n("click",s)}return(s,c)=>(o.openBlock(),o.createElementBlock("svg",o.mergeProps({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 200 200",width:"20",height:"20"},s.$attrs,{onClick:r}),or,16))}}),rr=[o.createElementVNode("path",{fill:"#FFA000",d:`M184,26.6L102.4,2.1h-4.9L16,26.6c-3.3,1.6-5.7,4.9-5.7,8.2v49.8c0,52.2,32.6,94.7,87.3,112.6
|
|
29
45
|
c0.8,0,1.6,0.8,2.4,0.8s1.6,0,2.4-0.8c54.7-18,87.3-59.6,87.3-112.6V34.7C189.8,31.5,187.3,28.2,184,26.6z M107.3,109.1
|
|
30
46
|
c-0.5,5.4-3.9,7.9-7.3,7.9c-2.5,0,0,0,0,0c-3.2-0.6-5.7-2-6.8-7.4l-4.4-50.9c0-5.1,6.2-9.7,11.5-9.7c5.3,0,11,4.7,11,9.9
|
|
31
47
|
L107.3,109.1z M109.3,133.3c0,5.1-4.2,9.3-9.3,9.3c-5.1,0-9.3-4.2-9.3-9.3c0-5.1,4.2-9.3,9.3-9.3C105.1,124,109.3,128.1,109.3,133.3
|
|
32
|
-
z`},null,-1)],
|
|
48
|
+
z`},null,-1)],cr=o.defineComponent({__name:"btn-warn-icon",emits:["click"],setup(e,{emit:t}){const n=t;function r(s){n("click",s)}return(s,c)=>(o.openBlock(),o.createElementBlock("svg",o.mergeProps({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 200 200",width:"20",height:"20"},s.$attrs,{onClick:r}),rr,16))}}),ir=[o.createElementVNode("path",{fill:"#ED4630",d:`M184,26.6L102.4,2.1h-4.9L16,26.6c-3.3,1.6-5.7,4.9-5.7,8.2v49.8c0,52.2,32.6,94.7,87.3,112.6
|
|
33
49
|
c0.8,0,1.6,0.8,2.4,0.8s1.6,0,2.4-0.8c54.7-18,87.3-59.6,87.3-112.6V34.7C189.8,31.5,187.3,28.2,184,26.6z M134.5,123.1
|
|
34
50
|
c3.1,3.1,3.1,8.2,0,11.3c-1.6,1.6-3.6,2.3-5.7,2.3s-4.1-0.8-5.7-2.3L100,111.3l-23.1,23.1c-1.6,1.6-3.6,2.3-5.7,2.3
|
|
35
51
|
c-2,0-4.1-0.8-5.7-2.3c-3.1-3.1-3.1-8.2,0-11.3L88.7,100L65.5,76.9c-3.1-3.1-3.1-8.2,0-11.3c3.1-3.1,8.2-3.1,11.3,0L100,88.7
|
|
36
|
-
l23.1-23.1c3.1-3.1,8.2-3.1,11.3,0c3.1,3.1,3.1,8.2,0,11.3L111.3,100L134.5,123.1z`},null,-1)],
|
|
52
|
+
l23.1-23.1c3.1-3.1,8.2-3.1,11.3,0c3.1,3.1,3.1,8.2,0,11.3L111.3,100L134.5,123.1z`},null,-1)],lr=o.defineComponent({__name:"btn-error-icon",emits:["click"],setup(e,{emit:t}){const n=t;function r(s){n("click",s)}return(s,c)=>(o.openBlock(),o.createElementBlock("svg",o.mergeProps({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 200 200",width:"20",height:"20"},s.$attrs,{onClick:r}),ir,16))}}),ar=[o.createElementVNode("path",{fill:"#5EAA2F",d:`M183.3,27.2L102.4,2.9h-4.9L16.7,27.2C13.4,28.8,11,32,11,35.3v49.4c0,51.8,32.4,93.9,86.6,111.7
|
|
37
53
|
c0.8,0,1.6,0.8,2.4,0.8c0.8,0,1.6,0,2.4-0.8c54.2-17.8,86.6-59.1,86.6-111.7V35.3C189,32,186.6,28.8,183.3,27.2z M146.1,81.4
|
|
38
54
|
l-48.5,48.5c-1.6,1.6-3.2,2.4-5.7,2.4c-2.4,0-4-0.8-5.7-2.4L62,105.7c-3.2-3.2-3.2-8.1,0-11.3c3.2-3.2,8.1-3.2,11.3,0l18.6,18.6
|
|
39
|
-
l42.9-42.9c3.2-3.2,8.1-3.2,11.3,0C149.4,73.3,149.4,78.2,146.1,81.4L146.1,81.4z`},null,-1)],
|
|
55
|
+
l42.9-42.9c3.2-3.2,8.1-3.2,11.3,0C149.4,73.3,149.4,78.2,146.1,81.4L146.1,81.4z`},null,-1)],dr=o.defineComponent({__name:"btn-success-icon",emits:["click"],setup(e,{emit:t}){const n=t;function r(s){n("click",s)}return(s,c)=>(o.openBlock(),o.createElementBlock("svg",o.mergeProps({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 200 200",width:"20",height:"20"},s.$attrs,{onClick:r}),ar,16))}}),zn=()=>({width:330,height:44,verticalPadding:12,horizontalPadding:16}),Me=o.defineComponent({__name:"index",props:{config:{default:zn},clickEvent:{},disabled:{type:Boolean,default:!1},type:{default:"default"},title:{default:"点击按键进行验证"}},emits:["click-event"],setup(e,{emit:t}){const n=e,{type:r,title:s,disabled:c,config:i}=o.toRefs(n),a=o.reactive({...zn(),...o.toRaw(i)});o.watch(()=>n.config,(d,w)=>{Object.assign(a,d)},{deep:!0});const l=o.computed(()=>["go-captcha","gc-btn-block",`gc-${r.value}`,c.value?"gc-disabled":""]),f=o.computed(()=>({width:a.width+"px",height:a.height+"px",paddingLeft:a.horizontalPadding+"px",paddingRight:a.horizontalPadding+"px",paddingTop:a.verticalPadding+"px",paddingBottom:a.verticalPadding+"px"})),m=t;function p(d){m("click-event",d)}return(d,w)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(l.value),style:o.normalizeStyle(f.value),onClick:p},[o.createElementVNode("div",{class:o.normalizeClass(o.unref(r)==="default"?"gc-ripple":"")},[o.unref(r)==="default"?(o.openBlock(),o.createBlock(sr,{key:0})):o.unref(r)==="warn"?(o.openBlock(),o.createBlock(cr,{key:1})):o.unref(r)==="error"?(o.openBlock(),o.createBlock(lr,{key:2})):o.unref(r)==="success"?(o.openBlock(),o.createBlock(dr,{key:3})):o.createCommentVNode("",!0)],2),o.createElementVNode("span",null,o.toDisplayString(o.unref(s)),1)],6))}}),Lr="";Me.name="gocaptcha-button",Me.install=function(e){e.component("gocaptcha-button",Me)};const fr={install(e){ve.install(e),ke.install(e),Ie.install(e),Be.install(e),Me.install(e)}};Y.Button=Me,Y.Click=ve,Y.Rotate=Be,Y.Slide=ke,Y.SlideRegion=Ie,Y.default=fr,Object.defineProperties(Y,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|