1import{M as e,P as t,t as n}from"./jsx-runtime-CL-DilWO.js";import{c as r,l as i}from"./LucideIcons-9IqVpk3v.js";import{t as a}from"./IconButton-DEPHCzOB.js";import{n as o}from"./AuthFormFields.module-KMmMqFAU.js";var s=t(e(),1);function c(e,t){if(e!=null){if(typeof e==`function`){e(t);return}try{e.current=t}catch(n){throw console.error(n),Error(`Cannot assign value '${String(t)}' to ref '${typeof e==`object`?`MutableRefObject`:String(e)}'`,{cause:n})}}}function l(...e){return t=>{e.forEach(e=>{c(e,t)})}}function u(...e){return(0,s.useMemo)(()=>l(...e),e)}var d=n();function f(e){return{start:e,end:e}}function p(e){return e.selectionStart===null||e.selectionEnd===null?null:{start:e.selectionStart,end:e.selectionEnd}}function m(e,t){return t.start===0&&t.end===0&&e.value.length>0}function h(e,t){e.focus();try{e.setSelectionRange(t.start,t.end)}catch{}}var g=(0,s.forwardRef)(function({onSelect:e,onInput:t,disabled:n,...c},l){let[g,_]=(0,s.useState)(!0),v=(0,s.useRef)(null),y=(0,s.useRef)(null),b=(0,s.useRef)(!1),x=u(v,l),S=()=>{let e=v.current;if(!e||b.current)return;let t=p(e);t&&!m(e,t)&&(y.current=t)},C=()=>{let e=v.current;if(!e||b.current)return;let t=p(e);if(t&&!m(e,t)){y.current=t;return}y.current=f(e.value.length)};return(0,s.useLayoutEffect)(()=>{let e=v.current;if(!e||!b.current)return;let t=y.current??f(e.value.length);h(e,t);let n=window.requestAnimationFrame(()=>{let n=p(e);n&&m(e,n)&&h(e,t)}),r=window.setTimeout(()=>{let n=p(e);n&&m(e,n)&&h(e,t),b.current=!1},0);return()=>{window.cancelAnimationFrame(n),window.clearTimeout(r)}},[g]),(0,d.jsx)(o,{...c,ref:x,disabled:n,type:g?`password`:`text`,onSelect:t=>{S(),e?.(t)},onInput:e=>{C(),t?.(e)},suffix:(0,d.jsx)(a,{type:`button`,label:g?`Show password`:`Hide password`,size:`small`,variant:`tertiary`,disabled:n,onPointerDown:e=>{e.preventDefault(),S(),b.current=!0},onMouseDown:e=>{e.preventDefault(),S(),b.current=!0},onClick:()=>{_(e=>!e)},children:g?(0,d.jsx)(r,{size:`small`}):(0,d.jsx)(i,{size:`small`})})})});export{g as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.