"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-BB7fFseo.cjs"),w=r=>(e.pushScopeId("data-v-3dc25b3e"),r=r(),e.popScopeId(),r),h=w(()=>e.createBaseVNode("i",{class:"iconfont icon-form-clock"},null,-1)),S={class:"txt"},l=5,T=e.defineComponent({__name:"InputTimer",setup(r){const t=e.ref(performance.now()),c=e.FormSetting.value.test_setting.limit_minutes*60*1e3+t.value,i=()=>{t.value=performance.now(),a=window.setTimeout(i,200)};let a=window.setTimeout(i,200);e.onUnmounted(()=>{window.clearTimeout(a)});const m=e.computed(()=>{const o=c-t.value>0?c-t.value:0,n=Math.floor(o/1e3/60/60).toString().padStart(2,"0"),v=Math.floor(o/1e3/60%60).toString().padStart(2,"0"),_=Math.floor(o/1e3%60).toString().padStart(2,"0");return`${n}:${v}:${_}`}),s=e.computed(()=>t.value>=c),u=e.computed(()=>{if(s.value){const o=t.value-c,n=l*1e3-o;return n>0?Math.floor(n/1e3):0}return l}),d=e.watchEffect(()=>{u.value===0&&(d(),window.clearTimeout(a),document.dispatchEvent(new Event("form-render:autosubmit")))}),p=e.computed(()=>`自动交卷(${u.value})`),f=e.ref(null);return(o,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createBaseVNode("div",{class:"input-timer",ref_key:"inputTimerRef",ref:f},[h,e.createBaseVNode("span",S,"距结束 "+e.toDisplayString(m.value),1)],512),e.createVNode(e.ConfirmDialog,{"model-value":s.value,title:"限时交卷",content:"考试时间到，系统即将为你自动交卷!","confirm-text":p.value,"confirm-disabled":!0,"show-cancel":!1,width:400,transform:"translate(0px)"},null,8,["model-value","confirm-text"])],64))}}),g=e._export_sfc(T,[["__scopeId","data-v-3dc25b3e"]]);exports.default=g;
