
/**
 * 由 Fantastic-admin 提供技术支持
 * Powered by Fantastic-admin
 * https://fantastic-admin.hurui.me
 */
  
import{Vt as e,at as t,it as n,nn as r}from"./src-CLMBPGj1.js";import{B as i,C as a,Ct as o,F as s,N as c,O as l,P as u,S as d,St as f,Tt as p,_ as m,bt as ee,l as h,m as g,o as _,x as v}from"./reactivity.esm-bundler-D9OPVc9J.js";import{$ as y,B as b,D as x,E as S,Ft as C,Ht as w,J as T,Pt as E,Ut as te,_ as D,b as O,bt as k,ct as A,et as j,ft as M,g as N,gt as P,k as F,mt as I,o as L,qt as R,v as z,xt as B,y as V,z as H}from"./runtime-core.esm-bundler-D-xeQwTN.js";import{n as U}from"./checkbox-CvI_gMWp.js";function ne(e){return h()?(m(e),!0):!1}function re(e){if(!g(e))return v(e);let t=new Proxy({},{get(t,n,r){return i(Reflect.get(e.value,n,r))},set(t,n,r){return g(e.value[n])&&!g(r)?e.value[n].value=r:e.value[n]=r,!0},deleteProperty(t,n){return Reflect.deleteProperty(e.value,n)},has(t,n){return Reflect.has(e.value,n)},ownKeys(){return Object.keys(e.value)},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}});return v(t)}function ie(e){return re(N(e))}function ae(e,...t){let n=t.flat(),r=n[0];return ie(()=>Object.fromEntries(typeof r==`function`?Object.entries(u(e)).filter(([e,t])=>!r(s(t),e)):Object.entries(u(e)).filter(e=>!n.includes(e[0]))))}var W=typeof window<`u`&&typeof document<`u`;typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope;var G=Object.prototype.toString,K=e=>G.call(e)===`[object Object]`,q=()=>{};function J(e){return Array.isArray(e)?e:[e]}function oe(...e){if(e.length!==1)return c(...e);let t=e[0];return typeof t==`function`?d(_(()=>({get:t,set:q}))):a(t)}function se(e,t,n){return w(e,t,{...n,immediate:!0})}var Y=W?window:void 0,X=W?window.document:void 0;W&&window.navigator,W&&window.location;function ce(e){let t=s(e);return t?.$el??t}function Z(...e){let t=[],n=()=>{t.forEach(e=>e()),t.length=0},r=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)),a=N(()=>{let t=J(s(e[0])).filter(e=>e!=null);return t.every(e=>typeof e!=`string`)?t:void 0}),o=se(()=>[a.value?.map(e=>ce(e))??[Y].filter(e=>e!=null),J(s(a.value?e[1]:e[0])),J(i(a.value?e[2]:e[1])),s(a.value?e[3]:e[2])],([e,i,a,o])=>{if(n(),!e?.length||!i?.length||!a?.length)return;let s=K(o)?{...o}:o;t.push(...e.flatMap(e=>i.flatMap(t=>a.map(n=>r(e,t,n,s)))))},{flush:`post`});return ne(n),()=>{o(),n()}}function le(e,t){let n=l(t);return w(oe(e),(e,t)=>{n.value=t},{flush:`sync`}),d(n)}var ue=`
[data-input-otp] {
  --nojs-bg: white !important;
  --nojs-fg: black !important;

  background-color: var(--nojs-bg) !important;
  color: var(--nojs-fg) !important;
  caret-color: var(--nojs-fg) !important;
  letter-spacing: .25em !important;
  text-align: center !important;
  border: 1px solid var(--nojs-fg) !important;
  border-radius: 4px !important;
  width: 100% !important;
}
@media (prefers-color-scheme: dark) {
  [data-input-otp] {
    --nojs-bg: black !important;
    --nojs-fg: white !important;
  }
}`,de=F({props:{fallback:{type:String,required:!0}},setup(e){return()=>b(`noscript`,{innerHTML:`<style>${e.fallback}</style>`})}}),Q=Symbol(`vue-otp-context`);function fe(e){return[setTimeout(e,0),setTimeout(e,10),setTimeout(e,50)]}var pe=18,$=40,me=`${$}px`,he=[`[data-lastpass-icon-root]`,`com-1password-button`,`[data-dashlanecreated]`,`[style$="2147483647 !important;"]`].join(`,`);function ge({containerRef:e,inputRef:t,pushPasswordManagerStrategy:n,isFocused:r}){let i=a({done:!1,refocused:!1}),o=a(!1),s=a(!1),c=a(!1),l=N(()=>n!==`none`&&(n===`increase-width`||n===`experimental-no-flickering`)&&o.value&&s.value),u=()=>{let r=e.value,a=t.value;if(!r||!a||c.value||n===`none`)return;let s=r,l=s.getBoundingClientRect().left+s.offsetWidth,u=s.getBoundingClientRect().top+s.offsetHeight/2,d=l-pe,f=u;if((document.querySelectorAll(he).length!==0||document.elementFromPoint(d,f)!==r)&&(o.value=!0,c.value=!0,!i.value.refocused&&document.activeElement===a)){let e=[a.selectionStart,a.selectionEnd];a.blur(),a.focus(),a.setSelectionRange(e[0],e[1]),i.value.refocused=!0}},d=()=>{let t=e.value;!t||n===`none`||(s.value=window.innerWidth-t.getBoundingClientRect().right>=$)},f;return A(()=>{d(),f=setInterval(d,1e3)}),M(()=>{clearInterval(f)}),w([r,t],(e,t,r)=>{let[i,a]=e,o=i||document.activeElement===a;if(n===`none`||!o)return;let s=setTimeout(u,0),l=setTimeout(u,2e3),d=setTimeout(u,5e3),f=setTimeout(()=>{c.value=!0},6e3);r(()=>{clearTimeout(s),clearTimeout(l),clearTimeout(d),clearTimeout(f)})}),{hasPWMBadge:o,willPushPWMBadge:l,PWM_BADGE_SPACE_WIDTH:me}}var _e={style:{position:`absolute`,inset:`0`,"pointer-events":`none`}},ve=[`value`,`data-input-otp-placeholder-shown`,`data-input-otp-mss`,`data-input-otp-mse`,`aria-placeholder`,`pattern`],ye=F({name:`OTPInput`,inheritAttrs:!1,__name:`OTPInput`,props:y({maxlength:{},textAlign:{default:`left`},inputmode:{default:`numeric`},containerClass:{},pushPasswordManagerStrategy:{default:`increase-width`},noScriptCssFallback:{default:ue},defaultValue:{default:``},pasteTransformer:{},accept:{},alt:{},autocomplete:{default:`one-time-code`},autofocus:{type:Boolean},capture:{type:[Boolean,String]},checked:{type:[Boolean,Array,Set]},crossorigin:{},disabled:{type:Boolean},enterKeyHint:{},form:{},formaction:{},formenctype:{},formmethod:{},formnovalidate:{type:Boolean},formtarget:{},height:{},indeterminate:{type:Boolean},list:{},max:{},min:{},minlength:{},multiple:{type:Boolean},name:{},pattern:{},placeholder:{},readonly:{type:Boolean},required:{type:Boolean},size:{},src:{},step:{},type:{},value:{},width:{}},{modelValue:{default(e){return e.defaultValue}},modelModifiers:{}}),emits:y([`complete`,`change`,`select`,`input`,`focus`,`blur`,`mouseover`,`mouseleave`,`paste`],[`update:modelValue`]),setup(e,{expose:n,emit:r}){let a=e,s=r,[c]=C(e,`modelValue`),u=le(c),d=N(()=>a.pattern?typeof a.pattern==`string`?new RegExp(a.pattern):a.pattern:null),f=l(!1),p=l(!1),m=l(null),h=l(null),g=l(null),_=l(null),v=Y?.CSS?.supports?.(`-webkit-touch-callout`,`none`),y={prev:[g.value?.selectionStart,g.value?.selectionEnd,g.value?.selectionDirection]};function b(e,t){try{e.insertRule(t)}catch{console.error(`input-otp could not insert CSS rule:`,t)}}A(()=>{let e=g.value,t=_.value;if(!e||!t)return;y.prev=[e.selectionStart,e.selectionEnd,e.selectionDirection??`none`];let n=Z(X,`selectionchange`,r,{capture:!0});function r(){if(!e)return;if(X?.activeElement!==e){m.value=null,h.value=null;return}let t=e.selectionStart,n=e.selectionEnd,r=e.selectionDirection,i=e.maxLength,a=e.value,o=y.prev,s=-1,c=-1,l;if(a.length!==0&&t!==null&&n!==null){let r=t===n,u=t===a.length&&a.length<i;if(r&&!u){let e=t;if(e===0)s=0,c=1,l=`forward`;else if(e===i)s=e-1,c=e,l=`backward`;else if(i>1&&a.length>1){let t=0;if(o[0]!==null&&o[1]!==null){l=e<o[1]?`backward`:`forward`;let n=o[0]===o[1]&&o[0]<i;l===`backward`&&!n&&(t=-1)}s=t+e,c=t+e+1}}s!==-1&&c!==-1&&s!==c&&e.setSelectionRange(s,c,l)}let u=s===-1?t:s,d=c===-1?n:c,f=l??r;m.value=u,h.value=d,y.prev=[u,d,f]}if(r(),X?.activeElement===e&&(p.value=!0),!X?.getElementById(`input-otp-style`)){let e=X?.createElement(`style`);if(e.id=`input-otp-style`,X?.head.appendChild(e),e.sheet){let t=`background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;`;b(e.sheet,`[data-input-otp]::selection { background: transparent !important; color: transparent !important; }`),b(e.sheet,`[data-input-otp]:autofill { ${t} }`),b(e.sheet,`[data-input-otp]:-webkit-autofill { ${t} }`),b(e.sheet,`@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }`),b(e.sheet,`[data-input-otp] + * { pointer-events: all !important; }`)}}let i=()=>{t&&t.style.setProperty(`--root-height`,`${e.clientHeight}px`)};i();let a=new ResizeObserver(i);a.observe(e),M(()=>{n(),a.disconnect()})}),w([c],()=>{fe(()=>{if(!g.value)return;g.value?.dispatchEvent(new Event(`input`));let e=g.value?.selectionStart,t=g.value?.selectionEnd,n=g.value?.selectionDirection;e!==null&&t!==null&&(m.value=e??null,h.value=t??null,y.prev=[e,t,n])})},{immediate:!0}),te(()=>{u.value!==void 0&&c.value!==u.value&&u.value.length<a.maxlength&&c.value.length===a.maxlength&&s(`complete`,c.value)});let x=ge({containerRef:_,inputRef:g,pushPasswordManagerStrategy:a.pushPasswordManagerStrategy,isFocused:p});function S(e){if(e.inputType===`insertText`&&e.data!==null){let t=e.currentTarget,n=t.selectionStart??0,r=t.selectionEnd??0,i=t.value,o=(n===r?i.slice(0,n)+e.data+i.slice(n):i.slice(0,n)+e.data+i.slice(r)).slice(0,a.maxlength);o.length>0&&d.value&&!d.value.test(o)&&e.preventDefault()}}function T(e){let t=e.currentTarget.value.slice(0,a.maxlength);if(t.length>0&&d.value&&!d.value.test(t)){e.preventDefault();return}typeof u.value==`string`&&t.length<u.value.length&&X?.dispatchEvent(new Event(`selectionchange`)),c.value=t,s(`input`,t)}function E(){let e=g.value;if(e){let t=Math.min(e.value.length,a.maxlength-1),n=e.value.length;e.setSelectionRange(t,n),m.value=t,h.value=n}p.value=!0}function k(e){let t=g.value;if(!t||!a.pasteTransformer&&(!v||!e.clipboardData||!t))return;let n=e?.clipboardData?.getData(`text/plain`),r=a?.pasteTransformer?a.pasteTransformer(n):n;e.preventDefault();let i=g.value?.selectionStart,o=g.value?.selectionEnd,l=(i===o?c.value.slice(0,i)+r+c.value.slice(i):c.value.slice(0,i)+r+c.value.slice(o)).slice(0,a.maxlength);if(l.length>0&&d.value&&!d.value.test(l))return;c.value=l,s(`input`,l);let u=Math.min(l.length,a.maxlength-1),f=l.length;t?.setSelectionRange(u,f),m.value=u,h.value=f}let F=t(ae(a,`containerClass`,`value`,`pattern`,`defaultValue`,`pushPasswordManagerStrategy`,`noScriptCssFallback`,`modelValue`)),R=N(()=>({position:`relative`,cursor:a.disabled?`default`:`text`,userSelect:`none`,WebkitUserSelect:`none`,pointerEvents:`none`})),H=N(()=>({position:`absolute`,inset:0,width:x.willPushPWMBadge.value?`calc(100% + ${x.PWM_BADGE_SPACE_WIDTH})`:`100%`,clipPath:x.willPushPWMBadge.value?`inset(0 ${x.PWM_BADGE_SPACE_WIDTH} 0 0)`:void 0,height:`100%`,display:`flex`,textAlign:a.textAlign,opacity:`1`,color:`transparent`,pointerEvents:`all`,background:`transparent`,caretColor:`transparent`,border:`0 solid transparent`,outline:`0 solid transparent`,boxShadow:`none`,lineHeight:`1`,letterSpacing:`-.5em`,fontSize:`var(--root-height)`,fontFamily:`monospace`,fontVariantNumeric:`tabular-nums`})),U=N(()=>({slots:Array.from({length:Number(a.maxlength)}).map((e,t)=>{let n=p.value&&m.value!==null&&h.value!==null&&(m.value===h.value&&t===m.value||t>=m.value&&t<h.value),r=c.value[t]===void 0?null:c.value[t];return{char:r,placeholderChar:r??a?.placeholder?.[t]??null,isActive:n,hasFakeCaret:n&&r===null}}),isFocused:p.value,isHovering:!a.disabled&&f.value}));return P(Q,U),n(Object.defineProperty({},"$el",{enumerable:!0,configurable:!0,get:()=>g})),(t,n)=>(I(),O(L,null,[e.noScriptCssFallback===null?V(`v-if`,!0):(I(),z(i(de),{key:0,fallback:e.noScriptCssFallback},null,8,[`fallback`])),D(`div`,{ref_key:`containerRef`,ref:_,"data-input-otp-container":``,style:o(R.value),class:ee(e.containerClass)},[B(t.$slots,`default`,{slots:U.value.slots,isFocused:p.value,isHovering:!e.disabled&&f.value}),D(`div`,_e,[D(`input`,j({ref_key:`inputRef`,ref:g,value:i(c),"data-input-otp":``,"data-input-otp-placeholder-shown":i(c).length===0||void 0,"data-input-otp-mss":m.value,"data-input-otp-mse":h.value,"aria-placeholder":e.placeholder,style:H.value,pattern:d.value?.source},{...t.$attrs,...i(F)},{onBeforeinput:S,onMouseover:n[0]||(n[0]=e=>{f.value=!0,s(`mouseover`,e)}),onMouseleave:n[1]||(n[1]=e=>{f.value=!1,s(`mouseleave`,e)}),onPaste:n[2]||(n[2]=e=>{k(e),s(`paste`,e)}),onInput:T,onFocus:n[3]||(n[3]=e=>{E(),s(`focus`,e)}),onBlur:n[4]||(n[4]=e=>{p.value=!1,s(`blur`,e)})}),null,16,ve)])],6)],64))}}),be=`^\\d+$`,xe=`^[a-zA-Z]+$`,Se=`^[a-zA-Z0-9]+$`;function Ce(){return T(Q)}var we=F({__name:`InputOTP`,props:{maxlength:{},textAlign:{},inputmode:{},containerClass:{},pushPasswordManagerStrategy:{},noScriptCssFallback:{},defaultValue:{},pasteTransformer:{type:Function},accept:{},alt:{},autocomplete:{},autofocus:{type:Boolean},capture:{type:[Boolean,String]},checked:{type:[Boolean,Array,Set]},crossorigin:{},disabled:{type:Boolean},enterKeyHint:{},form:{},formaction:{},formenctype:{},formmethod:{},formnovalidate:{type:Boolean},formtarget:{},height:{},indeterminate:{type:Boolean},list:{},max:{},min:{},minlength:{},multiple:{type:Boolean},name:{},pattern:{},placeholder:{},readonly:{type:Boolean},required:{type:Boolean},size:{},src:{},step:{},type:{},value:{},width:{},class:{type:[Boolean,null,String,Object,Array]}},emits:[`complete`,`change`,`select`,`input`,`focus`,`blur`,`mouseover`,`mouseleave`,`paste`],setup(t,{emit:a}){let o=t,s=a,c=r(o,`class`),l=n(c,s);return(t,n)=>(I(),z(i(ye),j(i(l),{"container-class":i(e)(`flex items-center gap-2 has-disabled:opacity-50`,o.class),"data-slot":`input-otp`,class:`disabled:cursor-not-allowed`}),{default:R(e=>[B(t.$slots,`default`,f(H(e)))]),_:3},16,[`container-class`]))}}),Te=F({__name:`InputOTPGroup`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(n){let a=n,o=r(a,`class`),s=t(o);return(t,n)=>(I(),O(`div`,j({"data-slot":`input-otp-group`},i(s),{class:i(e)(`flex items-center`,a.class)}),[B(t.$slots,`default`)],16))}}),Ee=F({__name:`InputOTPSeparator`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let n=t(e);return(e,t)=>(I(),O(`div`,j({"data-slot":`input-otp-separator`,role:`separator`},i(n)),[B(e.$slots,`default`,{},()=>[x(i(U))])],16))}}),De=[`data-active`],Oe={key:0,class:`flex pointer-events-none items-center inset-0 justify-center absolute`},ke=F({__name:`InputOTPSlot`,props:{index:{},class:{type:[Boolean,null,String,Object,Array]}},setup(n){let a=n,o=r(a,`class`),s=t(o),c=Ce(),l=N(()=>c?.value.slots[a.index]);return(t,n)=>(I(),O(`div`,j(i(s),{"data-slot":`input-otp-slot`,"data-active":l.value?.isActive,class:i(e)(`data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-e text-sm shadow-xs transition-all outline-none first:rounded-ss-md first:rounded-es-md first:border-s last:rounded-se-md last:rounded-ee-md data-[active=true]:z-10 data-[active=true]:ring-3`,a.class)}),[S(p(l.value?.char)+` `,1),l.value?.hasFakeCaret?(I(),O(`div`,Oe,[...n[0]||(n[0]=[D(`div`,{class:`animate-caret-blink bg-foreground h-4 w-px duration-1000`},null,-1)])])):V(``,!0)],16,De))}}),Ae=F({name:`BuiltInInputOTP`,__name:`index`,props:y({length:{default:6},pattern:{},separator:{default:()=>[]},disabled:{type:Boolean}},{modelValue:{},modelModifiers:{}}),emits:y([`input`,`complete`],[`update:modelValue`]),setup(e,{emit:t}){let n=e,r=t,a=C(e,`modelValue`),o=E(),s=N(()=>{switch(n.pattern){case`only-chars`:return xe;case`only-digits`:return be;case`only-digits-and-chars`:return Se;default:return n.pattern}}),c=N(()=>{let e=[],t=0;for(let r of n.separator){let i=Math.trunc(r);if(!(i<=0)){if(t>=n.length)break;e.push({start:t,length:Math.min(i,n.length-t)}),t+=i}}return t<n.length&&e.push({start:t,length:n.length-t}),e});return(t,n)=>(I(),z(i(we),{id:i(o),modelValue:a.value,"onUpdate:modelValue":n[0]||(n[0]=e=>a.value=e),maxlength:e.length,pattern:s.value,disabled:e.disabled,onInput:n[1]||(n[1]=e=>r(`input`,e)),onComplete:n[2]||(n[2]=e=>r(`complete`,e))},{default:R(()=>[(I(!0),O(L,null,k(c.value,(e,t)=>(I(),O(L,{key:e.start},[x(i(Te),null,{default:R(()=>[(I(!0),O(L,null,k(e.length,t=>(I(),z(i(ke),{key:e.start+t,index:e.start+t-1},null,8,[`index`]))),128))]),_:2},1024),t<c.value.length-1?(I(),z(i(Ee),{key:0})):V(``,!0)],64))),128))]),_:1},8,[`id`,`modelValue`,`maxlength`,`pattern`,`disabled`]))}});export{Ae as t};