var p=(e,t,n)=>(Object.defineProperty(e,t,{value:n}),n),$=e=>({get value(){let t=e();return p(this,"value",t)}}),T=Array.isArray,x=e=>typeof e=="object"&&e!==null&&!T(e),j=$(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});var _=(e,t)=>e?{ok:!1,code:"join",left:e,right:t}:t,k=(e,t)=>({ok:!1,code:"prepend",key:e,tree:t}),b=e=>({ok:!0,value:e}),A=0,h=1,R=2,B=(e,t)=>{let{ok:n,msg:s,...r}=e;return{...r,path:t}},N=(e,t=[],n=[])=>{for(;;)switch(e.code){case"join":{N(e.left,t.slice(),n),e=e.right;continue}case"prepend":{t.push(e.key),e=e.tree;continue}default:return n.push(B(e,t)),n}},P=e=>{let t=0;for(;;)switch(e.code){case"join":{t+=P(e.left),e=e.right;continue}case"prepend":{e=e.tree;continue}default:return t+1}};var z=e=>{let t="",n=0;for(;;){switch(e.code){case"join":{n+=P(e.right),e=e.left;continue}case"prepend":{t+=`.${e.key}`,e=e.tree;continue}}break}let s=e.msg(),r=`${e.code} at ${t||"."} (${s})`;return n>0&&(r+=` (+${n} other issue(s))`),r},v=class extends Error{name="ValidationError";#e;constructor(t){super(),this.#e=t}get message(){return z(this.#e)}get issues(){return N(this.#e)}};var O=(e,t,n)=>{let s=A;n?.strict&&(s|=R);let r=e["~run"](t,s);if(r===void 0)return t;if(r.ok)return r.value;throw new v(r)},C=(e,t=[],n=[])=>{for(;;)switch(e.code){case"join":{C(e.left,t.slice(),n),e=e.right;continue}case"prepend":{t.push(e.key),e=e.tree;continue}default:return n.push({message:e.msg(),path:t.length>0?t:void 0}),n}},S=e=>({version:1,vendor:"@atcute/lexicons",validate(t){let n=e["~run"](t,A);return n===void 0?{value:t}:n.ok?{value:n.value}:{issues:C(n)}}});var G={ok:!1,code:"invalid_type",expected:"string",msg(){return"expected string"}},M={kind:"schema",type:"string",format:null,"~run"(e,t){if(typeof e!="string")return G},get"~standard"(){return p(this,"~standard",S(this))}},y=()=>M;var E=(e,t)=>({kind:"schema",type:"optional",wrapped:e,default:t,"~run"(n,s){if(n===void 0){if(t===void 0)return;let r=typeof t=="function"?t():t;return b(r)}return e["~run"](n,s)},get"~standard"(){return p(this,"~standard",S(this))}}),Y=e=>e.type==="optional";var w={ok:!1,code:"invalid_type",expected:"object",msg(){return"expected object"}},D={ok:!1,code:"missing_value",msg(){return"missing value"}},F=(e,t,n)=>{t==="__proto__"?Object.defineProperty(e,t,{value:n}):e[t]=n},L=e=>{let t=$(()=>{let n=[];for(let s in e){let r=e[s];n.push({key:s,schema:r,optional:Y(r),missing:k(s,D)})}return n});return{kind:"schema",type:"object",get shape(){let n=t.value,s={};for(let r of n)s[r.key]=r.schema;return p(this,"shape",s)},get"~run"(){let n=t.value,s=n.length,r=()=>{let a=[["$ok",b],["$joinIssues",_],["$prependPath",k]],o="let $iss,$out;";for(let i=0;ii).join(",")}]`,`return function matcher($in,$flags){${o}}`)(a.map(([,i])=>i))};if(j.value){let a=r();return p(this,"~run",(u,i)=>x(u)?a(u,i):w)}return p(this,"~run",(a,o)=>{if(!x(a))return w;let u,i;for(let l=0;lO(K,e);export{q as parseIdentityProfile};