import{A as e,U as t,et as n,s as r}from"./runtime-core.esm-bundler-Babufkcf.js";import{r as i}from"./Platform-BxNC0BGj.js";function a(){if(typeof crypto>`u`)return()=>{throw Error(`[Quasar uid()] Secure RNG not available. Cannot generate collision-resistant UUID.`)};if(crypto.randomUUID)return()=>crypto.randomUUID();let e=Array.from({length:256},(e,t)=>(t+256).toString(16).slice(1)),t,n;return()=>{(t===void 0||n+16>4096)&&(n=0,t=new Uint8Array(4096),crypto.getRandomValues(t));let r=n;return n+=16,t[r+6]=t[r+6]&15|64,t[r+8]=t[r+8]&63|128,e[t[r]]+e[t[r+1]]+e[t[r+2]]+e[t[r+3]]+`-`+e[t[r+4]]+e[t[r+5]]+`-`+e[t[r+6]]+e[t[r+7]]+`-`+e[t[r+8]]+e[t[r+9]]+`-`+e[t[r+10]]+e[t[r+11]]+e[t[r+12]]+e[t[r+13]]+e[t[r+14]]+e[t[r+15]]}}var o=a();function s(e){return e??null}function c(e,t){return e??(t?`f_${o()}`:null)}function l({getValue:a,required:l=!0}={}){if(i.value){let r=n(a===void 0?null:s(a()));return l&&r.value===null&&e(()=>{r.value=`f_${o()}`}),a!==void 0&&t(a,e=>{r.value=c(e,l)}),r}return a===void 0?n(`f_${o()}`):r(()=>c(a(),l))}export{o as n,l as t};