acbridge 1.1.3 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/acbridge.mjs +125 -113
- package/hub/dist/hub.cjs +53 -52
- package/package.json +1 -1
- package/plugin/README.md +6 -0
- package/plugin/plugins/alexa/dist/channel.mjs +33 -31
- package/plugin/plugins/alexa/scripts/codex-signal.mjs +128 -49
- package/plugin/plugins/alexa/scripts/signal.mjs +90 -20
package/dist/acbridge.mjs
CHANGED
|
@@ -1,23 +1,32 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __acbridgeCreateRequire } from "node:module";
|
|
3
3
|
const require = __acbridgeCreateRequire(import.meta.url);
|
|
4
|
-
var kI=Object.create;var iu=Object.defineProperty;var wI=Object.getOwnPropertyDescriptor;var SI=Object.getOwnPropertyNames;var _I=Object.getPrototypeOf,$I=Object.prototype.hasOwnProperty;var ue=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var ie=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},nn=(e,t)=>{for(var r in t)iu(e,r,{get:t[r],enumerable:!0})},II=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of SI(t))!$I.call(e,n)&&n!==r&&iu(e,n,{get:()=>t[n],enumerable:!(o=wI(t,n))||o.enumerable});return e};var rn=(e,t,r)=>(r=e!=null?kI(_I(e)):{},II(t||!e||!e.__esModule?iu(r,"default",{value:e,enumerable:!0}):r,e));var bl=ie(th=>{"use strict";Object.defineProperty(th,"__esModule",{value:!0});th.default=$D;var $0=/[A-Z]/g;function I0(e){return e.toLowerCase()}function $D(e,t){let r=e.replace($0,I0),o=t.replace($0,I0);return r===o}});var nh=ie(ps=>{"use strict";Object.defineProperty(ps,"__esModule",{value:!0});ps.DnsTxt=void 0;var xl=class{constructor(t={}){this.binary=t?t.binary:!1}encode(t={}){return Object.entries(t).map(([r,o])=>{let n=`${r}=${o}`;return Buffer.from(n)})}decode(t){var r={};try{let n=t.toString().split(/=(.+)/),i=n[0],s=n[1];r[i]=s}catch{}return r}decodeAll(t){return t.filter(r=>r.length>1).map(r=>this.decode(r)).reduce((r,o)=>{var n=r;let[i]=Object.keys(o),[s]=Object.values(o);return n[i]=s,n},{})}};ps.DnsTxt=xl;ps.default=xl});var rh=ie(Ho=>{"use strict";Object.defineProperty(Ho,"__esModule",{value:!0});Ho.toType=Ho.toString=void 0;var E0=e=>"_"+e,ID=e=>["name","protocol","subtype"].includes(e),ED=e=>{let t={name:e.name,protocol:e.protocol,subtype:e.subtype};return Object.entries(t).filter(([o,n])=>ID(o)&&n!==void 0).reduce((o,[n,i])=>(typeof i==="object"?i.map(s=>o.push(E0(s))):o.push(E0(i)),o),[]).join(".")};Ho.toString=ED;var AD=e=>{let t=e.split("."),r;for(let o in t)t[o][0]==="_"&&(t[o]=t[o].slice(1));return t.includes("sub")&&(r=t.shift(),t.shift()),{name:t.shift(),protocol:t.shift()||null,subtype:r}};Ho.toType=AD});var oh=ie(Er=>{"use strict";var P0=Er&&Er.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Er,"__esModule",{value:!0});Er.Service=void 0;var A0=P0(ue("os")),PD=P0(nh()),CD=ue("events"),TD=rh(),Zo=".local",kl=class extends CD.EventEmitter{constructor(t,r,o){if(super(),this.start=r,this.stop=o,this.probe=!0,this.published=!1,this.activated=!1,this.destroyed=!1,this.txtService=new PD.default,!t.name)throw new Error("ServiceConfig requires `name` property to be set");if(!t.type)throw new Error("ServiceConfig requires `type` property to be set");if(!t.port)throw new Error("ServiceConfig requires `port` property to be set");this.name=t.name.split(".").join("-"),this.protocol=t.protocol||"tcp",this.type=(0,TD.toString)({name:t.type,protocol:this.protocol}),this.port=t.port,this.host=t.host||A0.default.hostname(),this.fqdn=`${this.name}.${this.type}${Zo}`,this.txt=t.txt,this.subtypes=t.subtypes,this.disableIPv6=!!t.disableIPv6}records(){var t=[this.RecordPTR(this),this.RecordSRV(this),this.RecordTXT(this),this.RecordServicePTR(this)];for(let o of this.subtypes||[])t.push(this.RecordSubtypePTR(this,o));let r=Object.values(A0.default.networkInterfaces());for(let o of r){let n=o;for(let i of n)if(!(i.internal||i.mac==="00:00:00:00:00:00"))switch(i.family){case"IPv4":t.push(this.RecordA(this,i.address));break;case"IPv6":if(this.disableIPv6)break;t.push(this.RecordAAAA(this,i.address));break}}return t}RecordPTR(t){return{name:`${t.type}${Zo}`,type:"PTR",ttl:28800,data:t.fqdn}}RecordServicePTR(t){return{name:`_services._dns-sd._udp${Zo}`,type:"PTR",ttl:120,data:`${t.type}${Zo}`}}RecordSubtypePTR(t,r){return{name:`_${r}._sub.${t.type}${Zo}`,type:"PTR",ttl:28800,data:`${t.name}.${t.type}${Zo}`}}RecordSRV(t){return{name:t.fqdn,type:"SRV",ttl:120,data:{port:t.port,target:t.host}}}RecordTXT(t){return{name:t.fqdn,type:"TXT",ttl:4500,data:this.txtService.encode(t.txt)}}RecordA(t,r){return{name:t.host,type:"A",ttl:120,data:r}}RecordAAAA(t,r){return{name:t.host,type:"AAAA",ttl:120,data:r}}};Er.Service=kl;Er.default=kl});var T0=ie(Ar=>{"use strict";var C0=Ar&&Ar.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ar,"__esModule",{value:!0});Ar.Registry=void 0;var RD=C0(bl()),ih=C0(oh()),OD=3600*1e3,DD=3,ND=function(){},wl=class{constructor(t){this.services=[],this.server=t}publish(t){let r=t.probe!==!1,o=new ih.default(t,n.bind(null,this),i.bind(null,this));function n(s,{probe:a=r}={}){o.activated||(o.activated=!0,s.services.push(o),o instanceof ih.default&&(a?s.probe(s.server.mdns,o,l=>{if(l){o.stop!==void 0&&o.stop(),console.log(new Error("Service name is already in use on the network"));return}s.announce(s.server,o)}):s.announce(s.server,o)))}function i(s,a){if(a||(a=ND),!o.activated||!(o instanceof ih.default))return process.nextTick(a);s.teardown(s.server,o,a);let l=s.services.indexOf(o);l!==-1&&s.services.splice(l,1)}return o.start(),o}unpublishAll(t){this.teardown(this.server,this.services,t),this.services=[]}destroy(){this.services.map(t=>t.destroyed=!0)}probe(t,r,o){var n=!1,i=0,s;let a=()=>{!r.activated||r.destroyed||t.query(r.fqdn,"ANY",function(){n=!0,s=setTimeout(++i<3?a:d,250),s.unref()})},l=p=>{n&&(p.answers.some(u)||p.additionals.some(u))&&d(!0)},u=p=>(0,RD.default)(p.name,r.fqdn),d=p=>{t.removeListener("response",l),clearTimeout(s),o(!!p)};t.on("response",l),setTimeout(a,Math.random()*250)}announce(t,r){var o=1e3,n=r.records();t.register(n);let i=()=>{!r.activated||r.destroyed||t.mdns.respond(n,function(){r.published||(r.activated=!0,r.published=!0,r.emit("up")),o=o*DD,o<OD&&!r.destroyed&&setTimeout(i,o).unref()})};i()}teardown(t,r,o){Array.isArray(r)||(r=[r]),r=r.filter(i=>i.activated);var n=r.flatMap(function(i){i.activated=!1;var s=i.records();return s.forEach(a=>{a.ttl=0}),s});if(n.length===0)return o&&process.nextTick(o);t.unregister(n),t.mdns.respond(n,function(){r.forEach(function(i){i.published=!1}),typeof o=="function"&&o.apply(null,arguments)})}};Ar.Registry=wl;Ar.default=wl});var R0=ie(sh=>{"use strict";sh.toString=function(e){switch(e){case 1:return"A";case 10:return"NULL";case 28:return"AAAA";case 18:return"AFSDB";case 42:return"APL";case 257:return"CAA";case 60:return"CDNSKEY";case 59:return"CDS";case 37:return"CERT";case 5:return"CNAME";case 49:return"DHCID";case 32769:return"DLV";case 39:return"DNAME";case 48:return"DNSKEY";case 43:return"DS";case 55:return"HIP";case 13:return"HINFO";case 45:return"IPSECKEY";case 25:return"KEY";case 36:return"KX";case 29:return"LOC";case 15:return"MX";case 35:return"NAPTR";case 2:return"NS";case 47:return"NSEC";case 50:return"NSEC3";case 51:return"NSEC3PARAM";case 12:return"PTR";case 46:return"RRSIG";case 17:return"RP";case 24:return"SIG";case 6:return"SOA";case 99:return"SPF";case 33:return"SRV";case 44:return"SSHFP";case 32768:return"TA";case 249:return"TKEY";case 52:return"TLSA";case 250:return"TSIG";case 16:return"TXT";case 252:return"AXFR";case 251:return"IXFR";case 41:return"OPT";case 255:return"ANY"}return"UNKNOWN_"+e};sh.toType=function(e){switch(e.toUpperCase()){case"A":return 1;case"NULL":return 10;case"AAAA":return 28;case"AFSDB":return 18;case"APL":return 42;case"CAA":return 257;case"CDNSKEY":return 60;case"CDS":return 59;case"CERT":return 37;case"CNAME":return 5;case"DHCID":return 49;case"DLV":return 32769;case"DNAME":return 39;case"DNSKEY":return 48;case"DS":return 43;case"HIP":return 55;case"HINFO":return 13;case"IPSECKEY":return 45;case"KEY":return 25;case"KX":return 36;case"LOC":return 29;case"MX":return 15;case"NAPTR":return 35;case"NS":return 2;case"NSEC":return 47;case"NSEC3":return 50;case"NSEC3PARAM":return 51;case"PTR":return 12;case"RRSIG":return 46;case"RP":return 17;case"SIG":return 24;case"SOA":return 6;case"SPF":return 99;case"SRV":return 33;case"SSHFP":return 44;case"TA":return 32768;case"TKEY":return 249;case"TLSA":return 52;case"TSIG":return 250;case"TXT":return 16;case"AXFR":return 252;case"IXFR":return 251;case"OPT":return 41;case"ANY":return 255;case"*":return 255}return e.toUpperCase().startsWith("UNKNOWN_")?parseInt(e.slice(8)):0}});var O0=ie(ah=>{"use strict";ah.toString=function(e){switch(e){case 0:return"NOERROR";case 1:return"FORMERR";case 2:return"SERVFAIL";case 3:return"NXDOMAIN";case 4:return"NOTIMP";case 5:return"REFUSED";case 6:return"YXDOMAIN";case 7:return"YXRRSET";case 8:return"NXRRSET";case 9:return"NOTAUTH";case 10:return"NOTZONE";case 11:return"RCODE_11";case 12:return"RCODE_12";case 13:return"RCODE_13";case 14:return"RCODE_14";case 15:return"RCODE_15"}return"RCODE_"+e};ah.toRcode=function(e){switch(e.toUpperCase()){case"NOERROR":return 0;case"FORMERR":return 1;case"SERVFAIL":return 2;case"NXDOMAIN":return 3;case"NOTIMP":return 4;case"REFUSED":return 5;case"YXDOMAIN":return 6;case"YXRRSET":return 7;case"NXRRSET":return 8;case"NOTAUTH":return 9;case"NOTZONE":return 10;case"RCODE_11":return 11;case"RCODE_12":return 12;case"RCODE_13":return 13;case"RCODE_14":return 14;case"RCODE_15":return 15}return 0}});var D0=ie(ch=>{"use strict";ch.toString=function(e){switch(e){case 0:return"QUERY";case 1:return"IQUERY";case 2:return"STATUS";case 3:return"OPCODE_3";case 4:return"NOTIFY";case 5:return"UPDATE";case 6:return"OPCODE_6";case 7:return"OPCODE_7";case 8:return"OPCODE_8";case 9:return"OPCODE_9";case 10:return"OPCODE_10";case 11:return"OPCODE_11";case 12:return"OPCODE_12";case 13:return"OPCODE_13";case 14:return"OPCODE_14";case 15:return"OPCODE_15"}return"OPCODE_"+e};ch.toOpcode=function(e){switch(e.toUpperCase()){case"QUERY":return 0;case"IQUERY":return 1;case"STATUS":return 2;case"OPCODE_3":return 3;case"NOTIFY":return 4;case"UPDATE":return 5;case"OPCODE_6":return 6;case"OPCODE_7":return 7;case"OPCODE_8":return 8;case"OPCODE_9":return 9;case"OPCODE_10":return 10;case"OPCODE_11":return 11;case"OPCODE_12":return 12;case"OPCODE_13":return 13;case"OPCODE_14":return 14;case"OPCODE_15":return 15}return 0}});var N0=ie(lh=>{"use strict";lh.toString=function(e){switch(e){case 1:return"IN";case 2:return"CS";case 3:return"CH";case 4:return"HS";case 255:return"ANY"}return"UNKNOWN_"+e};lh.toClass=function(e){switch(e.toUpperCase()){case"IN":return 1;case"CS":return 2;case"CH":return 3;case"HS":return 4;case"ANY":return 255}return 0}});var L0=ie(uh=>{"use strict";uh.toString=function(e){switch(e){case 1:return"LLQ";case 2:return"UL";case 3:return"NSID";case 5:return"DAU";case 6:return"DHU";case 7:return"N3U";case 8:return"CLIENT_SUBNET";case 9:return"EXPIRE";case 10:return"COOKIE";case 11:return"TCP_KEEPALIVE";case 12:return"PADDING";case 13:return"CHAIN";case 14:return"KEY_TAG";case 26946:return"DEVICEID"}return e<0?null:`OPTION_${e}`};uh.toCode=function(e){if(typeof e=="number")return e;if(!e)return-1;switch(e.toUpperCase()){case"OPTION_0":return 0;case"LLQ":return 1;case"UL":return 2;case"NSID":return 3;case"OPTION_4":return 4;case"DAU":return 5;case"DHU":return 6;case"N3U":return 7;case"CLIENT_SUBNET":return 8;case"EXPIRE":return 9;case"COOKIE":return 10;case"TCP_KEEPALIVE":return 11;case"PADDING":return 12;case"CHAIN":return 13;case"KEY_TAG":return 14;case"DEVICEID":return 26946;case"OPTION_65535":return 65535}let t=e.match(/_(\d+)$/);return t?parseInt(t[1],10):-1}});var z0=ie((j0,dh)=>{var U0=(function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decode=p,e.encode=d,e.familyOf=u,e.name=void 0,e.sizeOf=l,e.v6=e.v4=void 0;let t=/^(\d{1,3}\.){3,3}\d{1,3}$/,r=4,o=/^(::)?(((\d{1,3}\.){3}(\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?$/i,n=16,i={name:"v4",size:r,isFormat:m=>t.test(m),encode(m,f,g){g=~~g,f=f||new Uint8Array(g+r);let h=m.length,y=0;for(let k=0;k<h;){let _=m.charCodeAt(k++);_===46?(f[g++]=y,y=0):y=y*10+(_-48)}return f[g]=y,f},decode(m,f){return f=~~f,`${m[f++]}.${m[f++]}.${m[f++]}.${m[f]}`}};e.v4=i;let s={name:"v6",size:n,isFormat:m=>m.length>0&&o.test(m),encode(m,f,g){g=~~g;let h=g+n,y=-1,k=0,_=0,I=!0,S=!1;f=f||new Uint8Array(g+n);for(let T=0;T<m.length;T++){let j=m.charCodeAt(T);j===58?(I?y!==-1?(g<h&&(f[g]=0),g<h-1&&(f[g+1]=0),g+=2):g<h&&(y=g):(S===!0?(g<h&&(f[g]=_),g++):(g<h&&(f[g]=k>>8),g<h-1&&(f[g+1]=k&255),g+=2),k=0,_=0),I=!0,S=!1):j===46?(g<h&&(f[g]=_),g++,_=0,k=0,I=!1,S=!0):(I=!1,j>=97?j-=87:j>=65?j-=55:(j-=48,_=_*10+j),k=(k<<4)+j)}if(I===!1)S===!0?(g<h&&(f[g]=_),g++):(g<h&&(f[g]=k>>8),g<h-1&&(f[g+1]=k&255),g+=2);else if(y===0)g<h&&(f[g]=0),g<h-1&&(f[g+1]=0),g+=2;else if(y!==-1){g+=2;for(let T=Math.min(g-1,h-1);T>=y+2;T--)f[T]=f[T-2];f[y]=0,f[y+1]=0,y=g}if(y!==g&&y!==-1)for(g>h-2&&(g=h-2);h>y;)f[--h]=g<h&&g>y?f[--g]:0;else for(;g<h;)f[g++]=0;return f},decode(m,f){f=~~f;let g="";for(let h=0;h<n;h+=2)h!==0&&(g+=":"),g+=(m[f+h]<<8|m[f+h+1]).toString(16);return g.replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3").replace(/:{3,4}/,"::")}};e.v6=s;let a="ip";e.name=a;function l(m){if(i.isFormat(m))return i.size;if(s.isFormat(m))return s.size;throw Error(`Invalid ip address: ${m}`)}function u(m){return l(m)===i.size?1:2}function d(m,f,g){g=~~g;let h=l(m);return typeof f=="function"&&(f=f(g+h)),h===i.size?i.encode(m,f,g):s.encode(m,f,g)}function p(m,f,g){if(f=~~f,g=g||m.length-f,g===i.size)return i.decode(m,f,g);if(g===s.size)return s.decode(m,f,g);throw Error(`Invalid buffer size needs to be ${i.size} for v4 or ${s.size} for v6.`)}return"default"in e?e.default:e})({});typeof define=="function"&&define.amd?define([],function(){return U0}):typeof dh=="object"&&typeof j0=="object"&&(dh.exports=U0)});var B0=ie(B=>{"use strict";var H=ue("buffer").Buffer,In=R0(),LD=O0(),UD=D0(),_l=N0(),ph=L0(),Pr=z0(),jD=0,F0=32768,mh=32768,zD=~mh,M0=32768,FD=~M0,U=B.name={};U.encode=function(e,t,r,{mail:o=!1}={}){t||(t=H.alloc(U.encodingLength(e))),r||(r=0);let n=r,i=e.replace(/^\.|\.$/gm,"");if(i.length){let s=[];if(o){let a="";i.split(".").forEach(l=>{l.endsWith("\\")?a+=(a.length?".":"")+l.slice(0,-1):s.length===0&&a.length?s.push(a+"."+l):s.push(l)})}else s=i.split(".");for(let a=0;a<s.length;a++){let l=t.write(s[a],r+1);t[r]=l,r+=l+1}}return t[r++]=0,U.encode.bytes=r-n,t};U.encode.bytes=0;U.decode=function(e,t,{mail:r=!1}={}){t||(t=0);let o=[],n=t,i=0,s=0,a=!1;for(;;){if(t>=e.length)throw new Error("Cannot decode name (buffer overflow)");let l=e[t++];if(s+=a?0:1,l===0)break;if((l&192)===0){if(t+l>e.length)throw new Error("Cannot decode name (buffer overflow)");if(i+=l+1,i>254)throw new Error("Cannot decode name (name too long)");let u=e.toString("utf-8",t,t+l);r&&(u=u.replace(/\./g,"\\.")),o.push(u),t+=l,s+=a?0:l}else if((l&192)===192){if(t+1>e.length)throw new Error("Cannot decode name (buffer overflow)");let u=e.readUInt16BE(t-1)-49152;if(u>=n)throw new Error("Cannot decode name (bad pointer)");t=u,n=u,s+=a?0:1,a=!0}else throw new Error("Cannot decode name (bad label)")}return U.decode.bytes=s,o.length===0?".":o.join(".")};U.decode.bytes=0;U.encodingLength=function(e){return e==="."||e===".."?1:H.byteLength(e.replace(/^\.|\.$/gm,""))+2};var re={};re.encode=function(e,t,r){t||(t=H.alloc(re.encodingLength(e))),r||(r=0);let o=t.write(e,r+1);return t[r]=o,re.encode.bytes=o+1,t};re.encode.bytes=0;re.decode=function(e,t){t||(t=0);let r=e[t],o=e.toString("utf-8",t+1,t+1+r);return re.decode.bytes=r+1,o};re.decode.bytes=0;re.encodingLength=function(e){return H.byteLength(e)+1};var Rt={};Rt.encode=function(e,t,r){t||(t=Rt.encodingLength(e)),r||(r=0);let o=(e.flags||0)&32767,n=e.type==="response"?F0:jD;return t.writeUInt16BE(e.id||0,r),t.writeUInt16BE(o|n,r+2),t.writeUInt16BE(e.questions.length,r+4),t.writeUInt16BE(e.answers.length,r+6),t.writeUInt16BE(e.authorities.length,r+8),t.writeUInt16BE(e.additionals.length,r+10),t};Rt.encode.bytes=12;Rt.decode=function(e,t){if(t||(t=0),e.length<12)throw new Error("Header must be 12 bytes");let r=e.readUInt16BE(t+2);return{id:e.readUInt16BE(t),type:r&F0?"response":"query",flags:r&32767,flag_qr:(r>>15&1)===1,opcode:UD.toString(r>>11&15),flag_aa:(r>>10&1)===1,flag_tc:(r>>9&1)===1,flag_rd:(r>>8&1)===1,flag_ra:(r>>7&1)===1,flag_z:(r>>6&1)===1,flag_ad:(r>>5&1)===1,flag_cd:(r>>4&1)===1,rcode:LD.toString(r&15),questions:new Array(e.readUInt16BE(t+4)),answers:new Array(e.readUInt16BE(t+6)),authorities:new Array(e.readUInt16BE(t+8)),additionals:new Array(e.readUInt16BE(t+10))}};Rt.decode.bytes=12;Rt.encodingLength=function(){return 12};var vn=B.unknown={};vn.encode=function(e,t,r){return t||(t=H.alloc(vn.encodingLength(e))),r||(r=0),t.writeUInt16BE(e.length,r),e.copy(t,r+2),vn.encode.bytes=e.length+2,t};vn.encode.bytes=0;vn.decode=function(e,t){t||(t=0);let r=e.readUInt16BE(t),o=e.slice(t+2,t+2+r);return vn.decode.bytes=r+2,o};vn.decode.bytes=0;vn.encodingLength=function(e){return e.length+2};var yn=B.ns={};yn.encode=function(e,t,r){return t||(t=H.alloc(yn.encodingLength(e))),r||(r=0),U.encode(e,t,r+2),t.writeUInt16BE(U.encode.bytes,r),yn.encode.bytes=U.encode.bytes+2,t};yn.encode.bytes=0;yn.decode=function(e,t){t||(t=0);let r=e.readUInt16BE(t),o=U.decode(e,t+2);return yn.decode.bytes=r+2,o};yn.decode.bytes=0;yn.encodingLength=function(e){return U.encodingLength(e)+2};var bn=B.soa={};bn.encode=function(e,t,r){t||(t=H.alloc(bn.encodingLength(e))),r||(r=0);let o=r;return r+=2,U.encode(e.mname,t,r),r+=U.encode.bytes,U.encode(e.rname,t,r,{mail:!0}),r+=U.encode.bytes,t.writeUInt32BE(e.serial||0,r),r+=4,t.writeUInt32BE(e.refresh||0,r),r+=4,t.writeUInt32BE(e.retry||0,r),r+=4,t.writeUInt32BE(e.expire||0,r),r+=4,t.writeUInt32BE(e.minimum||0,r),r+=4,t.writeUInt16BE(r-o-2,o),bn.encode.bytes=r-o,t};bn.encode.bytes=0;bn.decode=function(e,t){t||(t=0);let r=t,o={};return t+=2,o.mname=U.decode(e,t),t+=U.decode.bytes,o.rname=U.decode(e,t,{mail:!0}),t+=U.decode.bytes,o.serial=e.readUInt32BE(t),t+=4,o.refresh=e.readUInt32BE(t),t+=4,o.retry=e.readUInt32BE(t),t+=4,o.expire=e.readUInt32BE(t),t+=4,o.minimum=e.readUInt32BE(t),t+=4,bn.decode.bytes=t-r,o};bn.decode.bytes=0;bn.encodingLength=function(e){return 22+U.encodingLength(e.mname)+U.encodingLength(e.rname)};var xn=B.txt={};xn.encode=function(e,t,r){Array.isArray(e)||(e=[e]);for(let n=0;n<e.length;n++)if(typeof e[n]=="string"&&(e[n]=H.from(e[n])),!H.isBuffer(e[n]))throw new Error("Must be a Buffer");t||(t=H.alloc(xn.encodingLength(e))),r||(r=0);let o=r;return r+=2,e.forEach(function(n){t[r++]=n.length,n.copy(t,r,0,n.length),r+=n.length}),t.writeUInt16BE(r-o-2,o),xn.encode.bytes=r-o,t};xn.encode.bytes=0;xn.decode=function(e,t){t||(t=0);let r=t,o=e.readUInt16BE(t);t+=2;let n=[];for(;o>0;){let i=e[t++];if(--o,o<i)throw new Error("Buffer overflow");n.push(e.slice(t,t+i)),t+=i,o-=i}return xn.decode.bytes=t-r,n};xn.decode.bytes=0;xn.encodingLength=function(e){Array.isArray(e)||(e=[e]);let t=2;return e.forEach(function(r){typeof r=="string"?t+=H.byteLength(r)+1:t+=r.length+1}),t};var kn=B.null={};kn.encode=function(e,t,r){t||(t=H.alloc(kn.encodingLength(e))),r||(r=0),typeof e=="string"&&(e=H.from(e)),e||(e=H.alloc(0));let o=r;r+=2;let n=e.length;return e.copy(t,r,0,n),r+=n,t.writeUInt16BE(r-o-2,o),kn.encode.bytes=r-o,t};kn.encode.bytes=0;kn.decode=function(e,t){t||(t=0);let r=t,o=e.readUInt16BE(t);t+=2;let n=e.slice(t,t+o);return t+=o,kn.decode.bytes=t-r,n};kn.decode.bytes=0;kn.encodingLength=function(e){return e?(H.isBuffer(e)?e.length:H.byteLength(e))+2:2};var wn=B.hinfo={};wn.encode=function(e,t,r){t||(t=H.alloc(wn.encodingLength(e))),r||(r=0);let o=r;return r+=2,re.encode(e.cpu,t,r),r+=re.encode.bytes,re.encode(e.os,t,r),r+=re.encode.bytes,t.writeUInt16BE(r-o-2,o),wn.encode.bytes=r-o,t};wn.encode.bytes=0;wn.decode=function(e,t){t||(t=0);let r=t,o={};return t+=2,o.cpu=re.decode(e,t),t+=re.decode.bytes,o.os=re.decode(e,t),t+=re.decode.bytes,wn.decode.bytes=t-r,o};wn.decode.bytes=0;wn.encodingLength=function(e){return re.encodingLength(e.cpu)+re.encodingLength(e.os)+2};var Ct=B.ptr={},MD=B.cname=Ct,BD=B.dname=Ct;Ct.encode=function(e,t,r){return t||(t=H.alloc(Ct.encodingLength(e))),r||(r=0),U.encode(e,t,r+2),t.writeUInt16BE(U.encode.bytes,r),Ct.encode.bytes=U.encode.bytes+2,t};Ct.encode.bytes=0;Ct.decode=function(e,t){t||(t=0);let r=U.decode(e,t+2);return Ct.decode.bytes=U.decode.bytes+2,r};Ct.decode.bytes=0;Ct.encodingLength=function(e){return U.encodingLength(e)+2};var Sn=B.srv={};Sn.encode=function(e,t,r){t||(t=H.alloc(Sn.encodingLength(e))),r||(r=0),t.writeUInt16BE(e.priority||0,r+2),t.writeUInt16BE(e.weight||0,r+4),t.writeUInt16BE(e.port||0,r+6),U.encode(e.target,t,r+8);let o=U.encode.bytes+6;return t.writeUInt16BE(o,r),Sn.encode.bytes=o+2,t};Sn.encode.bytes=0;Sn.decode=function(e,t){t||(t=0);let r=e.readUInt16BE(t),o={};return o.priority=e.readUInt16BE(t+2),o.weight=e.readUInt16BE(t+4),o.port=e.readUInt16BE(t+6),o.target=U.decode(e,t+8),Sn.decode.bytes=r+2,o};Sn.decode.bytes=0;Sn.encodingLength=function(e){return 8+U.encodingLength(e.target)};var lt=B.caa={};lt.ISSUER_CRITICAL=128;lt.encode=function(e,t,r){let o=lt.encodingLength(e);return t||(t=H.alloc(lt.encodingLength(e))),r||(r=0),e.issuerCritical&&(e.flags=lt.ISSUER_CRITICAL),t.writeUInt16BE(o-2,r),r+=2,t.writeUInt8(e.flags||0,r),r+=1,re.encode(e.tag,t,r),r+=re.encode.bytes,t.write(e.value,r),r+=H.byteLength(e.value),lt.encode.bytes=o,t};lt.encode.bytes=0;lt.decode=function(e,t){t||(t=0);let r=e.readUInt16BE(t);t+=2;let o=t,n={};return n.flags=e.readUInt8(t),t+=1,n.tag=re.decode(e,t),t+=re.decode.bytes,n.value=e.toString("utf-8",t,o+r),n.issuerCritical=!!(n.flags<.ISSUER_CRITICAL),lt.decode.bytes=r+2,n};lt.decode.bytes=0;lt.encodingLength=function(e){return re.encodingLength(e.tag)+re.encodingLength(e.value)+2};var Xn=B.mx={};Xn.encode=function(e,t,r){t||(t=H.alloc(Xn.encodingLength(e))),r||(r=0);let o=r;return r+=2,t.writeUInt16BE(e.preference||0,r),r+=2,U.encode(e.exchange,t,r),r+=U.encode.bytes,t.writeUInt16BE(r-o-2,o),Xn.encode.bytes=r-o,t};Xn.encode.bytes=0;Xn.decode=function(e,t){t||(t=0);let r=t,o={};return t+=2,o.preference=e.readUInt16BE(t),t+=2,o.exchange=U.decode(e,t),t+=U.decode.bytes,Xn.decode.bytes=t-r,o};Xn.encodingLength=function(e){return 4+U.encodingLength(e.exchange)};var _n=B.a={};_n.encode=function(e,t,r){return t||(t=H.alloc(_n.encodingLength(e))),r||(r=0),t.writeUInt16BE(4,r),r+=2,Pr.v4.encode(e,t,r),_n.encode.bytes=6,t};_n.encode.bytes=0;_n.decode=function(e,t){t||(t=0),t+=2;let r=Pr.v4.decode(e,t);return _n.decode.bytes=6,r};_n.decode.bytes=0;_n.encodingLength=function(){return 6};var $n=B.aaaa={};$n.encode=function(e,t,r){return t||(t=H.alloc($n.encodingLength(e))),r||(r=0),t.writeUInt16BE(16,r),r+=2,Pr.v6.encode(e,t,r),$n.encode.bytes=18,t};$n.encode.bytes=0;$n.decode=function(e,t){t||(t=0),t+=2;let r=Pr.v6.decode(e,t);return $n.decode.bytes=18,r};$n.decode.bytes=0;$n.encodingLength=function(){return 18};var rt=B.option={};rt.encode=function(e,t,r){t||(t=H.alloc(rt.encodingLength(e))),r||(r=0);let o=r,n=ph.toCode(e.code);if(t.writeUInt16BE(n,r),r+=2,e.data)t.writeUInt16BE(e.data.length,r),r+=2,e.data.copy(t,r),r+=e.data.length;else switch(n){case 8:let i=e.sourcePrefixLength||0,s=e.family||Pr.familyOf(e.ip),a=Pr.encode(e.ip,H.alloc),l=Math.ceil(i/8);t.writeUInt16BE(l+4,r),r+=2,t.writeUInt16BE(s,r),r+=2,t.writeUInt8(i,r++),t.writeUInt8(e.scopePrefixLength||0,r++),a.copy(t,r,0,l),r+=l;break;case 11:e.timeout?(t.writeUInt16BE(2,r),r+=2,t.writeUInt16BE(e.timeout,r),r+=2):(t.writeUInt16BE(0,r),r+=2);break;case 12:let u=e.length||0;t.writeUInt16BE(u,r),r+=2,t.fill(0,r,r+u),r+=u;break;case 14:let d=e.tags.length*2;t.writeUInt16BE(d,r),r+=2;for(let p of e.tags)t.writeUInt16BE(p,r),r+=2;break;default:throw new Error(`Unknown roption code: ${e.code}`)}return rt.encode.bytes=r-o,t};rt.encode.bytes=0;rt.decode=function(e,t){t||(t=0);let r={};r.code=e.readUInt16BE(t),r.type=ph.toString(r.code),t+=2;let o=e.readUInt16BE(t);switch(t+=2,r.data=e.slice(t,t+o),r.code){case 8:r.family=e.readUInt16BE(t),t+=2,r.sourcePrefixLength=e.readUInt8(t++),r.scopePrefixLength=e.readUInt8(t++);let n=H.alloc(r.family===1?4:16);e.copy(n,0,t,t+o-4),r.ip=Pr.decode(n);break;case 11:o>0&&(r.timeout=e.readUInt16BE(t),t+=2);break;case 14:r.tags=[];for(let i=0;i<o;i+=2)r.tags.push(e.readUInt16BE(t)),t+=2}return rt.decode.bytes=o+4,r};rt.decode.bytes=0;rt.encodingLength=function(e){if(e.data)return e.data.length+4;switch(ph.toCode(e.code)){case 8:let r=e.sourcePrefixLength||0;return Math.ceil(r/8)+8;case 11:return typeof e.timeout=="number"?6:4;case 12:return e.length+4;case 14:return 4+e.tags.length*2}throw new Error(`Unknown roption code: ${e.code}`)};var dt=B.opt={};dt.encode=function(e,t,r){t||(t=H.alloc(dt.encodingLength(e))),r||(r=0);let o=r,n=Go(e,rt);return t.writeUInt16BE(n,r),r=ms(e,rt,t,r+2),dt.encode.bytes=r-o,t};dt.encode.bytes=0;dt.decode=function(e,t){t||(t=0);let r=t,o=[],n=e.readUInt16BE(t);t+=2;let i=0;for(;n>0;)o[i++]=rt.decode(e,t),t+=rt.decode.bytes,n-=rt.decode.bytes;return dt.decode.bytes=t-r,o};dt.decode.bytes=0;dt.encodingLength=function(e){return 2+Go(e||[],rt)};var qe=B.dnskey={};qe.PROTOCOL_DNSSEC=3;qe.ZONE_KEY=128;qe.SECURE_ENTRYPOINT=32768;qe.encode=function(e,t,r){t||(t=H.alloc(qe.encodingLength(e))),r||(r=0);let o=r,n=e.key;if(!H.isBuffer(n))throw new Error("Key must be a Buffer");return r+=2,t.writeUInt16BE(e.flags,r),r+=2,t.writeUInt8(qe.PROTOCOL_DNSSEC,r),r+=1,t.writeUInt8(e.algorithm,r),r+=1,n.copy(t,r,0,n.length),r+=n.length,qe.encode.bytes=r-o,t.writeUInt16BE(qe.encode.bytes-2,o),t};qe.encode.bytes=0;qe.decode=function(e,t){t||(t=0);let r=t;var o={},n=e.readUInt16BE(t);if(t+=2,o.flags=e.readUInt16BE(t),t+=2,e.readUInt8(t)!==qe.PROTOCOL_DNSSEC)throw new Error("Protocol must be 3");return t+=1,o.algorithm=e.readUInt8(t),t+=1,o.key=e.slice(t,r+n+2),t+=o.key.length,qe.decode.bytes=t-r,o};qe.decode.bytes=0;qe.encodingLength=function(e){return 6+H.byteLength(e.key)};var Wt=B.rrsig={};Wt.encode=function(e,t,r){t||(t=H.alloc(Wt.encodingLength(e))),r||(r=0);let o=r,n=e.signature;if(!H.isBuffer(n))throw new Error("Signature must be a Buffer");return r+=2,t.writeUInt16BE(In.toType(e.typeCovered),r),r+=2,t.writeUInt8(e.algorithm,r),r+=1,t.writeUInt8(e.labels,r),r+=1,t.writeUInt32BE(e.originalTTL,r),r+=4,t.writeUInt32BE(e.expiration,r),r+=4,t.writeUInt32BE(e.inception,r),r+=4,t.writeUInt16BE(e.keyTag,r),r+=2,U.encode(e.signersName,t,r),r+=U.encode.bytes,n.copy(t,r,0,n.length),r+=n.length,Wt.encode.bytes=r-o,t.writeUInt16BE(Wt.encode.bytes-2,o),t};Wt.encode.bytes=0;Wt.decode=function(e,t){t||(t=0);let r=t;var o={},n=e.readUInt16BE(t);return t+=2,o.typeCovered=In.toString(e.readUInt16BE(t)),t+=2,o.algorithm=e.readUInt8(t),t+=1,o.labels=e.readUInt8(t),t+=1,o.originalTTL=e.readUInt32BE(t),t+=4,o.expiration=e.readUInt32BE(t),t+=4,o.inception=e.readUInt32BE(t),t+=4,o.keyTag=e.readUInt16BE(t),t+=2,o.signersName=U.decode(e,t),t+=U.decode.bytes,o.signature=e.slice(t,r+n+2),t+=o.signature.length,Wt.decode.bytes=t-r,o};Wt.decode.bytes=0;Wt.encodingLength=function(e){return 20+U.encodingLength(e.signersName)+H.byteLength(e.signature)};var Vt=B.rp={};Vt.encode=function(e,t,r){t||(t=H.alloc(Vt.encodingLength(e))),r||(r=0);let o=r;return r+=2,U.encode(e.mbox||".",t,r,{mail:!0}),r+=U.encode.bytes,U.encode(e.txt||".",t,r),r+=U.encode.bytes,Vt.encode.bytes=r-o,t.writeUInt16BE(Vt.encode.bytes-2,o),t};Vt.encode.bytes=0;Vt.decode=function(e,t){t||(t=0);let r=t,o={};return t+=2,o.mbox=U.decode(e,t,{mail:!0})||".",t+=U.decode.bytes,o.txt=U.decode(e,t)||".",t+=U.decode.bytes,Vt.decode.bytes=t-r,o};Vt.decode.bytes=0;Vt.encodingLength=function(e){return 2+U.encodingLength(e.mbox||".")+U.encodingLength(e.txt||".")};var Te={};Te.encode=function(e,t,r){t||(t=H.alloc(Te.encodingLength(e))),r||(r=0);let o=r;for(var n=[],i=0;i<e.length;i++){var s=In.toType(e[i]);n[s>>8]===void 0&&(n[s>>8]=[]),n[s>>8][s>>3&31]|=1<<7-(s&7)}for(i=0;i<n.length;i++)if(n[i]!==void 0){var a=H.from(n[i]);t.writeUInt8(i,r),r+=1,t.writeUInt8(a.length,r),r+=1,a.copy(t,r),r+=a.length}return Te.encode.bytes=r-o,t};Te.encode.bytes=0;Te.decode=function(e,t,r){t||(t=0);let o=t;for(var n=[];t-o<r;){var i=e.readUInt8(t);t+=1;var s=e.readUInt8(t);t+=1;for(var a=0;a<s;a++)for(var l=e.readUInt8(t+a),u=0;u<8;u++)if(l&1<<7-u){var d=In.toString(i<<8|a<<3|u);n.push(d)}t+=s}return Te.decode.bytes=t-o,n};Te.decode.bytes=0;Te.encodingLength=function(e){for(var t=[],r=0;r<e.length;r++){var o=In.toType(e[r]);t[o>>8]=Math.max(t[o>>8]||0,o&255)}var n=0;for(r=0;r<t.length;r++)t[r]!==void 0&&(n+=2+Math.ceil((t[r]+1)/8));return n};var qt=B.nsec={};qt.encode=function(e,t,r){t||(t=H.alloc(qt.encodingLength(e))),r||(r=0);let o=r;return r+=2,U.encode(e.nextDomain,t,r),r+=U.encode.bytes,Te.encode(e.rrtypes,t,r),r+=Te.encode.bytes,qt.encode.bytes=r-o,t.writeUInt16BE(qt.encode.bytes-2,o),t};qt.encode.bytes=0;qt.decode=function(e,t){t||(t=0);let r=t;var o={},n=e.readUInt16BE(t);return t+=2,o.nextDomain=U.decode(e,t),t+=U.decode.bytes,o.rrtypes=Te.decode(e,t,n-(t-r)),t+=Te.decode.bytes,qt.decode.bytes=t-r,o};qt.decode.bytes=0;qt.encodingLength=function(e){return 2+U.encodingLength(e.nextDomain)+Te.encodingLength(e.rrtypes)};var Jt=B.nsec3={};Jt.encode=function(e,t,r){t||(t=H.alloc(Jt.encodingLength(e))),r||(r=0);let o=r,n=e.salt;if(!H.isBuffer(n))throw new Error("salt must be a Buffer");let i=e.nextDomain;if(!H.isBuffer(i))throw new Error("nextDomain must be a Buffer");return r+=2,t.writeUInt8(e.algorithm,r),r+=1,t.writeUInt8(e.flags,r),r+=1,t.writeUInt16BE(e.iterations,r),r+=2,t.writeUInt8(n.length,r),r+=1,n.copy(t,r,0,n.length),r+=n.length,t.writeUInt8(i.length,r),r+=1,i.copy(t,r,0,i.length),r+=i.length,Te.encode(e.rrtypes,t,r),r+=Te.encode.bytes,Jt.encode.bytes=r-o,t.writeUInt16BE(Jt.encode.bytes-2,o),t};Jt.encode.bytes=0;Jt.decode=function(e,t){t||(t=0);let r=t;var o={},n=e.readUInt16BE(t);t+=2,o.algorithm=e.readUInt8(t),t+=1,o.flags=e.readUInt8(t),t+=1,o.iterations=e.readUInt16BE(t),t+=2;let i=e.readUInt8(t);t+=1,o.salt=e.slice(t,t+i),t+=i;let s=e.readUInt8(t);return t+=1,o.nextDomain=e.slice(t,t+s),t+=s,o.rrtypes=Te.decode(e,t,n-(t-r)),t+=Te.decode.bytes,Jt.decode.bytes=t-r,o};Jt.decode.bytes=0;Jt.encodingLength=function(e){return 8+e.salt.length+e.nextDomain.length+Te.encodingLength(e.rrtypes)};var Kt=B.ds={};Kt.encode=function(e,t,r){t||(t=H.alloc(Kt.encodingLength(e))),r||(r=0);let o=r,n=e.digest;if(!H.isBuffer(n))throw new Error("Digest must be a Buffer");return r+=2,t.writeUInt16BE(e.keyTag,r),r+=2,t.writeUInt8(e.algorithm,r),r+=1,t.writeUInt8(e.digestType,r),r+=1,n.copy(t,r,0,n.length),r+=n.length,Kt.encode.bytes=r-o,t.writeUInt16BE(Kt.encode.bytes-2,o),t};Kt.encode.bytes=0;Kt.decode=function(e,t){t||(t=0);let r=t;var o={},n=e.readUInt16BE(t);return t+=2,o.keyTag=e.readUInt16BE(t),t+=2,o.algorithm=e.readUInt8(t),t+=1,o.digestType=e.readUInt8(t),t+=1,o.digest=e.slice(t,r+n+2),t+=o.digest.length,Kt.decode.bytes=t-r,o};Kt.decode.bytes=0;Kt.encodingLength=function(e){return 6+H.byteLength(e.digest)};var ut=B.sshfp={};ut.getFingerprintLengthForHashType=function(t){switch(t){case 1:return 20;case 2:return 32}};ut.encode=function(t,r,o){r||(r=H.alloc(ut.encodingLength(t))),o||(o=0);let n=o;o+=2,r[o]=t.algorithm,o+=1,r[o]=t.hash,o+=1;let i=H.from(t.fingerprint.toUpperCase(),"hex");if(i.length!==ut.getFingerprintLengthForHashType(t.hash))throw new Error("Invalid fingerprint length");return i.copy(r,o),o+=i.byteLength,ut.encode.bytes=o-n,r.writeUInt16BE(ut.encode.bytes-2,n),r};ut.encode.bytes=0;ut.decode=function(t,r){r||(r=0);let o=r,n={};r+=2,n.algorithm=t[r],r+=1,n.hash=t[r],r+=1;let i=ut.getFingerprintLengthForHashType(n.hash);return n.fingerprint=t.slice(r,r+i).toString("hex").toUpperCase(),r+=i,ut.decode.bytes=r-o,n};ut.decode.bytes=0;ut.encodingLength=function(e){return 4+H.from(e.fingerprint,"hex").byteLength};var Xt=B.naptr={};Xt.encode=function(e,t,r){t||(t=H.alloc(Xt.encodingLength(e))),r||(r=0);let o=r;return r+=2,t.writeUInt16BE(e.order||0,r),r+=2,t.writeUInt16BE(e.preference||0,r),r+=2,re.encode(e.flags,t,r),r+=re.encode.bytes,re.encode(e.services,t,r),r+=re.encode.bytes,re.encode(e.regexp,t,r),r+=re.encode.bytes,U.encode(e.replacement,t,r),r+=U.encode.bytes,Xt.encode.bytes=r-o,t.writeUInt16BE(Xt.encode.bytes-2,o),t};Xt.encode.bytes=0;Xt.decode=function(e,t){t||(t=0);let r=t,o={};return t+=2,o.order=e.readUInt16BE(t),t+=2,o.preference=e.readUInt16BE(t),t+=2,o.flags=re.decode(e,t),t+=re.decode.bytes,o.services=re.decode(e,t),t+=re.decode.bytes,o.regexp=re.decode(e,t),t+=re.decode.bytes,o.replacement=U.decode(e,t),t+=U.decode.bytes,Xt.decode.bytes=t-r,o};Xt.decode.bytes=0;Xt.encodingLength=function(e){return re.encodingLength(e.flags)+re.encodingLength(e.services)+re.encodingLength(e.regexp)+U.encodingLength(e.replacement)+6};var Yt=B.tlsa={};Yt.encode=function(e,t,r){t||(t=H.alloc(Yt.encodingLength(e))),r||(r=0);let o=r,n=e.certificate;if(!H.isBuffer(n))throw new Error("Certificate must be a Buffer");return r+=2,t.writeUInt8(e.usage,r),r+=1,t.writeUInt8(e.selector,r),r+=1,t.writeUInt8(e.matchingType,r),r+=1,n.copy(t,r,0,n.length),r+=n.length,Yt.encode.bytes=r-o,t.writeUInt16BE(Yt.encode.bytes-2,o),t};Yt.encode.bytes=0;Yt.decode=function(e,t){t||(t=0);let r=t,o={},n=e.readUInt16BE(t);return t+=2,o.usage=e.readUInt8(t),t+=1,o.selector=e.readUInt8(t),t+=1,o.matchingType=e.readUInt8(t),t+=1,o.certificate=e.slice(t,r+n+2),t+=o.certificate.length,Yt.decode.bytes=t-r,o};Yt.decode.bytes=0;Yt.encodingLength=function(e){return 5+H.byteLength(e.certificate)};var fh=B.record=function(e){switch(e.toUpperCase()){case"A":return _n;case"PTR":return Ct;case"CNAME":return MD;case"DNAME":return BD;case"TXT":return xn;case"NULL":return kn;case"AAAA":return $n;case"SRV":return Sn;case"HINFO":return wn;case"CAA":return lt;case"NS":return yn;case"SOA":return bn;case"MX":return Xn;case"OPT":return dt;case"DNSKEY":return qe;case"RRSIG":return Wt;case"RP":return Vt;case"NSEC":return qt;case"NSEC3":return Jt;case"SSHFP":return ut;case"DS":return Kt;case"NAPTR":return Xt;case"TLSA":return Yt}return vn},Le=B.answer={};Le.encode=function(e,t,r){t||(t=H.alloc(Le.encodingLength(e))),r||(r=0);let o=r;if(U.encode(e.name,t,r),r+=U.encode.bytes,t.writeUInt16BE(In.toType(e.type),r),e.type.toUpperCase()==="OPT"){if(e.name!==".")throw new Error("OPT name must be root.");t.writeUInt16BE(e.udpPayloadSize||4096,r+2),t.writeUInt8(e.extendedRcode||0,r+4),t.writeUInt8(e.ednsVersion||0,r+5),t.writeUInt16BE(e.flags||0,r+6),r+=8,dt.encode(e.options||[],t,r),r+=dt.encode.bytes}else{let n=_l.toClass(e.class===void 0?"IN":e.class);e.flush&&(n|=mh),t.writeUInt16BE(n,r+2),t.writeUInt32BE(e.ttl||0,r+4),r+=8;let i=fh(e.type);i.encode(e.data,t,r),r+=i.encode.bytes}return Le.encode.bytes=r-o,t};Le.encode.bytes=0;Le.decode=function(e,t){t||(t=0);let r={},o=t;if(r.name=U.decode(e,t),t+=U.decode.bytes,r.type=In.toString(e.readUInt16BE(t)),r.type==="OPT")r.udpPayloadSize=e.readUInt16BE(t+2),r.extendedRcode=e.readUInt8(t+4),r.ednsVersion=e.readUInt8(t+5),r.flags=e.readUInt16BE(t+6),r.flag_do=(r.flags>>15&1)===1,r.options=dt.decode(e,t+8),t+=8+dt.decode.bytes;else{let n=e.readUInt16BE(t+2);r.ttl=e.readUInt32BE(t+4),r.class=_l.toString(n&zD),r.flush=!!(n&mh);let i=fh(r.type);r.data=i.decode(e,t+8),t+=8+i.decode.bytes}return Le.decode.bytes=t-o,r};Le.decode.bytes=0;Le.encodingLength=function(e){let t=e.data!==null&&e.data!==void 0?e.data:e.options;return U.encodingLength(e.name)+8+fh(e.type).encodingLength(t)};var Tt=B.question={};Tt.encode=function(e,t,r){t||(t=H.alloc(Tt.encodingLength(e))),r||(r=0);let o=r;return U.encode(e.name,t,r),r+=U.encode.bytes,t.writeUInt16BE(In.toType(e.type),r),r+=2,t.writeUInt16BE(_l.toClass(e.class===void 0?"IN":e.class),r),r+=2,Tt.encode.bytes=r-o,e};Tt.encode.bytes=0;Tt.decode=function(e,t){t||(t=0);let r=t,o={};return o.name=U.decode(e,t),t+=U.decode.bytes,o.type=In.toString(e.readUInt16BE(t)),t+=2,o.class=_l.toString(e.readUInt16BE(t)),t+=2,o.class&M0&&(o.class&=FD),Tt.decode.bytes=t-r,o};Tt.decode.bytes=0;Tt.encodingLength=function(e){return U.encodingLength(e.name)+4};B.AUTHORITATIVE_ANSWER=1024;B.TRUNCATED_RESPONSE=512;B.RECURSION_DESIRED=256;B.RECURSION_AVAILABLE=128;B.AUTHENTIC_DATA=32;B.CHECKING_DISABLED=16;B.DNSSEC_OK=32768;B.encode=function(e,t,r){let o=!t;o&&(t=H.alloc(B.encodingLength(e))),r||(r=0);let n=r;return e.questions||(e.questions=[]),e.answers||(e.answers=[]),e.authorities||(e.authorities=[]),e.additionals||(e.additionals=[]),Rt.encode(e,t,r),r+=Rt.encode.bytes,r=ms(e.questions,Tt,t,r),r=ms(e.answers,Le,t,r),r=ms(e.authorities,Le,t,r),r=ms(e.additionals,Le,t,r),B.encode.bytes=r-n,o&&B.encode.bytes!==t.length?t.slice(0,B.encode.bytes):t};B.encode.bytes=0;B.decode=function(e,t){t||(t=0);let r=t,o=Rt.decode(e,t);return t+=Rt.decode.bytes,t=Sl(o.questions,Tt,e,t),t=Sl(o.answers,Le,e,t),t=Sl(o.authorities,Le,e,t),t=Sl(o.additionals,Le,e,t),B.decode.bytes=t-r,o};B.decode.bytes=0;B.encodingLength=function(e){return Rt.encodingLength(e)+Go(e.questions||[],Tt)+Go(e.answers||[],Le)+Go(e.authorities||[],Le)+Go(e.additionals||[],Le)};B.streamEncode=function(e){let t=B.encode(e),r=H.alloc(2);r.writeUInt16BE(t.byteLength);let o=H.concat([r,t]);return B.streamEncode.bytes=o.byteLength,o};B.streamEncode.bytes=0;B.streamDecode=function(e){let t=e.readUInt16BE(0);if(e.byteLength<t+2)return null;let r=B.decode(e.slice(2));return B.streamDecode.bytes=B.decode.bytes,r};B.streamDecode.bytes=0;function Go(e,t){let r=0;for(let o=0;o<e.length;o++)r+=t.encodingLength(e[o]);return r}function ms(e,t,r,o){for(let n=0;n<e.length;n++)t.encode(e[n],r,o),o+=t.encode.bytes;return o}function Sl(e,t,r,o){for(let n=0;n<e.length;n++)e[n]=t.decode(r,o),o+=t.decode.bytes;return o}});var G0=ie((tG,Z0)=>{"use strict";var H0=qD;process.nextTick(VD,42);Z0.exports=HD;function HD(e){var t=o;return r;function r(n){t(n||GD)}function o(n){var i=[n];t=s,e(a);function s(l){i.push(l)}function a(l){var u=arguments;for(t=ZD(l)?o:d;i.length;)d(i.shift());function d(p){H0(WD,p,u)}}}}function ZD(e){return Object.prototype.toString.call(e)==="[object Error]"}function GD(){}function WD(e,t){e.apply(null,t)}function VD(e){e===42&&(H0=process.nextTick)}function qD(e,t,r){process.nextTick(function(){e(t,r)})}});var q0=ie((nG,V0)=>{var gh=B0(),JD=ue("dgram"),KD=G0(),XD=ue("events"),vh=ue("os"),hh=function(){};V0.exports=function(e){e||(e={});var t=new XD.EventEmitter,r=typeof e.port=="number"?e.port:5353,o=e.type||"udp4",n=e.ip||e.host||(o==="udp4"?"224.0.0.251":null),i={address:n,port:r},s={},a=!1,l=null;if(o==="udp6"&&(!n||!e.interface))throw new Error("For IPv6 multicast you must specify `ip` and `interface`");var u=e.socket||JD.createSocket({type:o,reuseAddr:e.reuseAddr!==!1,toString:function(){return o}});u.on("error",function(p){p.code==="EACCES"||p.code==="EADDRINUSE"?t.emit("error",p):t.emit("warning",p)}),u.on("message",function(p,m){try{p=gh.decode(p)}catch(f){t.emit("warning",f);return}t.emit("packet",p,m),p.type==="query"&&t.emit("query",p,m),p.type==="response"&&t.emit("response",p,m)}),u.on("listening",function(){r||(r=i.port=u.address().port),e.multicast!==!1&&(t.update(),l=setInterval(t.update,5e3),u.setMulticastTTL(e.ttl||255),u.setMulticastLoopback(e.loopback!==!1))});var d=KD(function(p){if(!r||e.bind===!1)return p(null);u.once("error",p),u.bind(r,e.bind||e.interface,function(){u.removeListener("error",p),p(null)})});return d(function(p){if(p)return t.emit("error",p);t.emit("ready")}),t.send=function(p,m,f){if(typeof m=="function")return t.send(p,null,m);f||(f=hh),m?!m.host&&!m.address&&(m.address=i.address):m=i,d(g);function g(h){if(a)return f();if(h)return f(h);var y=gh.encode(p);u.send(y,0,y.length,m.port,m.address||m.host,f)}},t.response=t.respond=function(p,m,f){Array.isArray(p)&&(p={answers:p}),p.type="response",p.flags=(p.flags||0)|gh.AUTHORITATIVE_ANSWER,t.send(p,m,f)},t.query=function(p,m,f,g){if(typeof m=="function")return t.query(p,null,null,m);if(typeof m=="object"&&m&&m.port)return t.query(p,null,m,f);if(typeof f=="function")return t.query(p,m,null,f);g||(g=hh),typeof p=="string"&&(p=[{name:p,type:m||"ANY"}]),Array.isArray(p)&&(p={type:"query",questions:p}),p.type="query",t.send(p,f,g)},t.destroy=function(p){if(p||(p=hh),a)return process.nextTick(p);a=!0,clearInterval(l);for(var m in s)try{u.dropMembership(n,m)}catch{}s={},u.close(p)},t.update=function(){for(var p=e.interface?[].concat(e.interface):QD(),m=!1,f=0;f<p.length;f++){var g=p[f];if(!s[g])try{u.addMembership(n,g),s[g]=!0,m=!0}catch(h){t.emit("warning",h)}}if(m){if(u.setMulticastInterface)try{u.setMulticastInterface(e.interface||YD())}catch(h){t.emit("warning",h)}t.emit("networkInterface")}},t};function YD(){for(var e=vh.networkInterfaces(),t=Object.keys(e),r=0;r<t.length;r++)for(var o=e[t[r]],n=0;n<o.length;n++){var i=o[n];if(W0(i.family)&&!i.internal)return vh.platform()==="darwin"&&t[r]==="en0"?i.address:"0.0.0.0"}return"127.0.0.1"}function QD(){for(var e=vh.networkInterfaces(),t=Object.keys(e),r=[],o=0;o<t.length;o++)for(var n=e[t[o]],i=0;i<n.length;i++){var s=n[i];if(W0(s.family)){r.push(s.address);break}}return r}function W0(e){return e===4||e==="IPv4"}});var K0=ie((rG,J0)=>{"use strict";J0.exports=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var o,n,i;if(Array.isArray(t)){if(o=t.length,o!=r.length)return!1;for(n=o;n--!==0;)if(!e(t[n],r[n]))return!1;return!0}if(t instanceof Map&&r instanceof Map){if(t.size!==r.size)return!1;for(n of t.entries())if(!r.has(n[0]))return!1;for(n of t.entries())if(!e(n[1],r.get(n[0])))return!1;return!0}if(t instanceof Set&&r instanceof Set){if(t.size!==r.size)return!1;for(n of t.entries())if(!r.has(n[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(r)){if(o=t.length,o!=r.length)return!1;for(n=o;n--!==0;)if(t[n]!==r[n])return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),o=i.length,o!==Object.keys(r).length)return!1;for(n=o;n--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[n]))return!1;for(n=o;n--!==0;){var s=i[n];if(!e(t[s],r[s]))return!1}return!0}return t!==t&&r!==r}});var X0=ie(Cr=>{"use strict";var yh=Cr&&Cr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Cr,"__esModule",{value:!0});Cr.Server=void 0;var eN=yh(q0()),tN=yh(K0()),nN=yh(bl()),$l=class{constructor(t,r){this.registry={},this.mdns=(0,eN.default)(t),this.mdns.setMaxListeners(0),this.mdns.on("query",this.respondToQuery.bind(this)),this.errorCallback=r??function(o){throw o}}register(t){let r=o=>{var n=this.registry[o.type];if(!n)n=this.registry[o.type]=[];else if(n.some(this.isDuplicateRecord(o)))return;n.push(o)};Array.isArray(t)?t.forEach(r):r(t)}unregister(t){let r=o=>{let n=o.type;n in this.registry&&(this.registry[n]=this.registry[n].filter(i=>i.name!==o.name))};Array.isArray(t)?t.forEach(r):r(t)}respondToQuery(t){let r=this;t.questions.forEach(o=>{var n=o.type,i=o.name,s=n==="ANY"?Object.keys(r.registry).map(r.recordsFor.bind(r,i)).flat(1):r.recordsFor(i,n);if(s.length!==0){var a=[];n!=="ANY"&&(s.forEach(l=>{l.type==="PTR"&&(a=a.concat(r.recordsFor(l.data,"SRV")).concat(r.recordsFor(l.data,"TXT")))}),a.filter(function(l){return l.type==="SRV"}).map(function(l){return l.data.target}).filter(this.unique()).forEach(function(l){a=a.concat(r.recordsFor(l,"A")).concat(r.recordsFor(l,"AAAA"))})),r.mdns.respond({answers:s,additionals:a},l=>{l&&this.errorCallback(l)})}})}recordsFor(t,r){return r in this.registry?this.registry[r].filter(o=>{var n=~t.indexOf(".")?o.name:o.name.split(".")[0];return(0,nN.default)(n,t)}):[]}isDuplicateRecord(t){return r=>t.type===r.type&&t.name===r.name&&(0,tN.default)(t.data,r.data)}unique(){var t=[];return r=>~t.indexOf(r)?!1:(t.push(r),!0)}};Cr.Server=$l;Cr.default=$l});var Y0=ie(bh=>{"use strict";Object.defineProperty(bh,"__esModule",{value:!0});bh.default=(e,t)=>{if(t===void 0)return!0;let r=e.txt,o=Object.entries(t).map(([n,i])=>{let s=r[n];return!(s===void 0||i!=s)});return o.length==0?!0:!o.includes(!1)}});var Q0=ie(xh=>{"use strict";Object.defineProperty(xh,"__esModule",{value:!0});xh.default=e=>Object.keys(e).filter(t=>!t.includes("binary")).reduce((t,r)=>Object.assign(t,{[r]:e[r]}),{})});var eS=ie(kh=>{"use strict";Object.defineProperty(kh,"__esModule",{value:!0});kh.default=rN;function rN(e,t){if(e===void 0||t===void 0)return!1;let r=Object.keys(e),o=Object.keys(t);if(r.length!=o.length)return!1;for(let n of r)if(e[n]!=t[n])return!1;return!0}});var rS=ie(Tr=>{"use strict";var fs=Tr&&Tr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Tr,"__esModule",{value:!0});Tr.Browser=void 0;var oN=fs(nh()),Yn=fs(bl()),iN=ue("events"),wh=rh(),tS=fs(Y0()),sN=fs(Q0()),aN=fs(eS()),nS=".local",cN="_services._dns-sd._udp"+nS,Il=class e extends iN.EventEmitter{constructor(t,r,o){if(super(),this.onresponse=void 0,this.serviceMap={},this.wildcard=!1,this._services=[],typeof r=="function")return new e(t,null,r);this.mdns=t,this.txt=new oN.default(r!==null&&r.txt!=null?r.txt:void 0),r===null||r.type===void 0?(this.name=cN,this.wildcard=!0):(this.name=(0,wh.toString)({name:r.type,protocol:r.protocol||"tcp"})+nS,r.name&&(this.name=r.name+"."+this.name),this.wildcard=!1),r!=null&&r.txt!==void 0&&(this.txtQuery=(0,sN.default)(r.txt)),o&&this.on("up",o),this.start()}start(){if(!(this.onresponse||this.name===void 0)){var t=this,r={};this.wildcard||(r[this.name]=!0),this.onresponse=(o,n)=>{t.wildcard&&o.answers.forEach(s=>{s.type!=="PTR"||s.name!==t.name||s.name in r||(r[s.data]=!0,t.mdns.query(s.data,"PTR"))});let i=Date.now();Object.keys(r).forEach(function(s){t.goodbyes(s,o).forEach(t.removeService.bind(t));var a=t.buildServicesFor(s,o,t.txt,n,i);a.length!==0&&a.forEach(l=>{let u=t._services.find(d=>(0,Yn.default)(d.fqdn,l.fqdn));if(u){t.updateServiceSrv(u,l),t.updateServiceTxt(u,l);return}t.addService(l)})})},this.mdns.on("response",this.onresponse),this.update()}}stop(){this.onresponse&&(this.mdns.removeListener("response",this.onresponse),this.onresponse=void 0)}update(){this.mdns.query(this.name,"PTR")}expire(){let t=Date.now();this._services=this._services.filter(r=>!r.ttl||r.lastSeen===void 0?!0:r.lastSeen+r.ttl*1e3<t?(this.emit("down",r),!1):!0)}get services(){return this._services}addService(t){(0,tS.default)(t,this.txtQuery)!==!1&&(this._services.push(t),this.serviceMap[t.fqdn]=!0,this.emit("up",t))}updateServiceSrv(t,r){(t.name!==r.name||t.host!==r.host||t.port!==r.port||t.type!==r.type||t.protocol!==r.protocol)&&(this.replaceService(r),this.emit("srv-update",r,t))}updateServiceTxt(t,r){if(!(0,aN.default)(r.txt,t?.txt||{})){if(!(0,tS.default)(r,this.txtQuery)){this.removeService(r.fqdn);return}this.replaceService(r),this.emit("txt-update",r,t)}}replaceService(t){this._services=this._services.map(r=>(0,Yn.default)(r.fqdn,t.fqdn)?t:r)}removeService(t){var r,o;this._services.some(function(n,i){if((0,Yn.default)(n.fqdn,t))return r=n,o=i,!0}),!(!r||o===void 0)&&(this._services.splice(o,1),delete this.serviceMap[t],this.emit("down",r))}goodbyes(t,r){return r.answers.concat(r.additionals).filter(o=>o.type==="PTR"&&o.ttl===0&&(0,Yn.default)(o.name,t)).map(o=>o.data)}buildServicesFor(t,r,o,n,i){var s=r.answers.concat(r.additionals).filter(a=>a.ttl>0);return s.filter(a=>a.type==="PTR"&&(0,Yn.default)(a.name,t)).map(a=>{let l={addresses:[],subtypes:[],ttl:a.ttl,lastSeen:i};if(s.filter(u=>u.type==="PTR"&&(0,Yn.default)(u.data,a.data)&&u.name.includes("._sub")).forEach(u=>{let d=(0,wh.toType)(u.name);l.subtypes.push(d.subtype)}),s.filter(u=>(u.type==="SRV"||u.type==="TXT")&&(0,Yn.default)(u.name,a.data)).forEach(u=>{if(u.type==="SRV"){var d=u.name.split("."),p=d[0],m=(0,wh.toType)(d.slice(1,-1).join("."));l.name=p,l.fqdn=u.name,l.host=u.data.target,l.referer=n,l.port=u.data.port,l.type=m.name,l.protocol=m.protocol}else u.type==="TXT"&&(l.rawTxt=u.data,l.txt=this.txt.decodeAll(u.data))}),!!l.name)return s.filter(u=>(u.type==="A"||u.type==="AAAA")&&(0,Yn.default)(u.name,l.host)).forEach(u=>l.addresses.push(u.data)),l}).filter(a=>!!a)}};Tr.Browser=Il;Tr.default=Il});var oS=ie(En=>{"use strict";var El=En&&En.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(En,"__esModule",{value:!0});En.Browser=En.Service=void 0;var lN=El(T0()),uN=El(X0()),Sh=El(rS());En.Browser=Sh.default;var dN=El(oh());En.Service=dN.default;var _h=class{constructor(t={},r){this.server=new uN.default(t,r),this.registry=new lN.default(this.server)}publish(t){return this.registry.publish(t)}unpublishAll(t){return this.registry.unpublishAll(t)}find(t=null,r){return new Sh.default(this.server.mdns,t,r)}findOne(t=null,r=1e4,o){let n=new Sh.default(this.server.mdns,t);var i;return n.once("up",s=>{i!==void 0&&clearTimeout(i),n.stop(),o&&o(s)}),i=setTimeout(()=>{n.stop(),o&&o(null)},r),n}destroy(t){this.registry.destroy(),this.server.mdns.destroy(t)}};En.default=_h});var sS=ie((Je,iS)=>{"use strict";var pN=Je&&Je.__createBinding||(Object.create?(function(e,t,r,o){o===void 0&&(o=r);var n=Object.getOwnPropertyDescriptor(t,r);(!n||("get"in n?!t.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,o,n)}):(function(e,t,r,o){o===void 0&&(o=r),e[o]=t[r]})),mN=Je&&Je.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),fN=Je&&Je.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var o=[];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(o[o.length]=n);return o},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var o=e(t),n=0;n<o.length;n++)o[n]!=="default"&&pN(r,t,o[n]);return mN(r,t),r}})();Object.defineProperty(Je,"__esModule",{value:!0});Je.Browser=Je.Service=Je.Bonjour=void 0;var gs=fN(oS());Object.defineProperty(Je,"Service",{enumerable:!0,get:function(){return gs.Service}});Object.defineProperty(Je,"Browser",{enumerable:!0,get:function(){return gs.Browser}});var Rr=class extends gs.default{};Je.Bonjour=Rr;Je.default=Rr;iS.exports=Object.assign(Rr,{Bonjour:Rr,Service:gs.Service,Browser:gs.Browser,default:Rr})});var Tn=ie(($K,S_)=>{"use strict";var k_=["nodebuffer","arraybuffer","fragments"],w_=typeof Blob<"u";w_&&k_.push("blob");S_.exports={BINARY_TYPES:k_,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:w_,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var ks=ie((IK,Fl)=>{"use strict";var{EMPTY_BUFFER:ej}=Tn(),Hh=Buffer[Symbol.species];function tj(e,t){if(e.length===0)return ej;if(e.length===1)return e[0];let r=Buffer.allocUnsafe(t),o=0;for(let n=0;n<e.length;n++){let i=e[n];r.set(i,o),o+=i.length}return o<t?new Hh(r.buffer,r.byteOffset,o):r}function __(e,t,r,o,n){for(let i=0;i<n;i++)r[o+i]=e[i]^t[i&3]}function $_(e,t){for(let r=0;r<e.length;r++)e[r]^=t[r&3]}function nj(e){return e.length===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.length)}function Zh(e){if(Zh.readOnly=!0,Buffer.isBuffer(e))return e;let t;return e instanceof ArrayBuffer?t=new Hh(e):ArrayBuffer.isView(e)?t=new Hh(e.buffer,e.byteOffset,e.byteLength):(t=Buffer.from(e),Zh.readOnly=!1),t}Fl.exports={concat:tj,mask:__,toArrayBuffer:nj,toBuffer:Zh,unmask:$_};if(!process.env.WS_NO_BUFFER_UTIL)try{let e=ue("bufferutil");Fl.exports.mask=function(t,r,o,n,i){i<48?__(t,r,o,n,i):e.mask(t,r,o,n,i)},Fl.exports.unmask=function(t,r){t.length<32?$_(t,r):e.unmask(t,r)}}catch{}});var A_=ie((EK,E_)=>{"use strict";var I_=Symbol("kDone"),Gh=Symbol("kRun"),Wh=class{constructor(t){this[I_]=()=>{this.pending--,this[Gh]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[Gh]()}[Gh](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[I_])}}};E_.exports=Wh});var ei=ie((AK,R_)=>{"use strict";var ws=ue("zlib"),P_=ks(),rj=A_(),{kStatusCode:C_}=Tn(),oj=Buffer[Symbol.species],ij=Buffer.from([0,0,255,255]),Bl=Symbol("permessage-deflate"),Rn=Symbol("total-length"),Yo=Symbol("callback"),rr=Symbol("buffers"),Qo=Symbol("error"),Ml,Vh=class{constructor(t){if(this._options=t||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._maxPayload=this._options.maxPayload|0,this._isServer=!!this._options.isServer,this._deflate=null,this._inflate=null,this.params=null,!Ml){let r=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Ml=new rj(r)}}static get extensionName(){return"permessage-deflate"}offer(){let t={};return this._options.serverNoContextTakeover&&(t.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(t.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(t.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?t.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(t.client_max_window_bits=!0),t}accept(t){return t=this.normalizeParams(t),this.params=this._isServer?this.acceptAsServer(t):this.acceptAsClient(t),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let t=this._deflate[Yo];this._deflate.close(),this._deflate=null,t&&t(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(t){let r=this._options,o=t.find(n=>!(r.serverNoContextTakeover===!1&&n.server_no_context_takeover||n.server_max_window_bits&&(r.serverMaxWindowBits===!1||typeof r.serverMaxWindowBits=="number"&&r.serverMaxWindowBits>n.server_max_window_bits)||typeof r.clientMaxWindowBits=="number"&&!n.client_max_window_bits));if(!o)throw new Error("None of the extension offers can be accepted");return r.serverNoContextTakeover&&(o.server_no_context_takeover=!0),r.clientNoContextTakeover&&(o.client_no_context_takeover=!0),typeof r.serverMaxWindowBits=="number"&&(o.server_max_window_bits=r.serverMaxWindowBits),typeof r.clientMaxWindowBits=="number"?o.client_max_window_bits=r.clientMaxWindowBits:(o.client_max_window_bits===!0||r.clientMaxWindowBits===!1)&&delete o.client_max_window_bits,o}acceptAsClient(t){let r=t[0];if(this._options.clientNoContextTakeover===!1&&r.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!r.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(r.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&r.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return r}normalizeParams(t){return t.forEach(r=>{Object.keys(r).forEach(o=>{let n=r[o];if(n.length>1)throw new Error(`Parameter "${o}" must have only a single value`);if(n=n[0],o==="client_max_window_bits"){if(n!==!0){let i=+n;if(!Number.isInteger(i)||i<8||i>15)throw new TypeError(`Invalid value for parameter "${o}": ${n}`);n=i}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${o}": ${n}`)}else if(o==="server_max_window_bits"){let i=+n;if(!Number.isInteger(i)||i<8||i>15)throw new TypeError(`Invalid value for parameter "${o}": ${n}`);n=i}else if(o==="client_no_context_takeover"||o==="server_no_context_takeover"){if(n!==!0)throw new TypeError(`Invalid value for parameter "${o}": ${n}`)}else throw new Error(`Unknown parameter "${o}"`);r[o]=n})}),t}decompress(t,r,o){Ml.add(n=>{this._decompress(t,r,(i,s)=>{n(),o(i,s)})})}compress(t,r,o){Ml.add(n=>{this._compress(t,r,(i,s)=>{n(),o(i,s)})})}_decompress(t,r,o){let n=this._isServer?"client":"server";if(!this._inflate){let i=`${n}_max_window_bits`,s=typeof this.params[i]!="number"?ws.Z_DEFAULT_WINDOWBITS:this.params[i];this._inflate=ws.createInflateRaw({...this._options.zlibInflateOptions,windowBits:s}),this._inflate[Bl]=this,this._inflate[Rn]=0,this._inflate[rr]=[],this._inflate.on("error",aj),this._inflate.on("data",T_)}this._inflate[Yo]=o,this._inflate.write(t),r&&this._inflate.write(ij),this._inflate.flush(()=>{let i=this._inflate[Qo];if(i){this._inflate.close(),this._inflate=null,o(i);return}let s=P_.concat(this._inflate[rr],this._inflate[Rn]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Rn]=0,this._inflate[rr]=[],r&&this.params[`${n}_no_context_takeover`]&&this._inflate.reset()),o(null,s)})}_compress(t,r,o){let n=this._isServer?"server":"client";if(!this._deflate){let i=`${n}_max_window_bits`,s=typeof this.params[i]!="number"?ws.Z_DEFAULT_WINDOWBITS:this.params[i];this._deflate=ws.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:s}),this._deflate[Rn]=0,this._deflate[rr]=[],this._deflate.on("data",sj)}this._deflate[Yo]=o,this._deflate.write(t),this._deflate.flush(ws.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let i=P_.concat(this._deflate[rr],this._deflate[Rn]);r&&(i=new oj(i.buffer,i.byteOffset,i.length-4)),this._deflate[Yo]=null,this._deflate[Rn]=0,this._deflate[rr]=[],r&&this.params[`${n}_no_context_takeover`]&&this._deflate.reset(),o(null,i)})}};R_.exports=Vh;function sj(e){this[rr].push(e),this[Rn]+=e.length}function T_(e){if(this[Rn]+=e.length,this[Bl]._maxPayload<1||this[Rn]<=this[Bl]._maxPayload){this[rr].push(e);return}this[Qo]=new RangeError("Max payload size exceeded"),this[Qo].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[Qo][C_]=1009,this.removeListener("data",T_),this.reset()}function aj(e){if(this[Bl]._inflate=null,this[Qo]){this[Yo](this[Qo]);return}e[C_]=1007,this[Yo](e)}});var ti=ie((PK,Hl)=>{"use strict";var{isUtf8:O_}=ue("buffer"),{hasBlob:cj}=Tn(),lj=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function uj(e){return e>=1e3&&e<=1014&&e!==1004&&e!==1005&&e!==1006||e>=3e3&&e<=4999}function qh(e){let t=e.length,r=0;for(;r<t;)if((e[r]&128)===0)r++;else if((e[r]&224)===192){if(r+1===t||(e[r+1]&192)!==128||(e[r]&254)===192)return!1;r+=2}else if((e[r]&240)===224){if(r+2>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||e[r]===224&&(e[r+1]&224)===128||e[r]===237&&(e[r+1]&224)===160)return!1;r+=3}else if((e[r]&248)===240){if(r+3>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||(e[r+3]&192)!==128||e[r]===240&&(e[r+1]&240)===128||e[r]===244&&e[r+1]>143||e[r]>244)return!1;r+=4}else return!1;return!0}function dj(e){return cj&&typeof e=="object"&&typeof e.arrayBuffer=="function"&&typeof e.type=="string"&&typeof e.stream=="function"&&(e[Symbol.toStringTag]==="Blob"||e[Symbol.toStringTag]==="File")}Hl.exports={isBlob:dj,isValidStatusCode:uj,isValidUTF8:qh,tokenChars:lj};if(O_)Hl.exports.isValidUTF8=function(e){return e.length<24?qh(e):O_(e)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let e=ue("utf-8-validate");Hl.exports.isValidUTF8=function(t){return t.length<32?qh(t):e(t)}}catch{}});var Qh=ie((CK,F_)=>{"use strict";var{Writable:pj}=ue("stream"),D_=ei(),{BINARY_TYPES:mj,EMPTY_BUFFER:N_,kStatusCode:fj,kWebSocket:gj}=Tn(),{concat:Jh,toArrayBuffer:hj,unmask:vj}=ks(),{isValidStatusCode:yj,isValidUTF8:L_}=ti(),Zl=Buffer[Symbol.species],yt=0,U_=1,j_=2,z_=3,Kh=4,Xh=5,Gl=6,Yh=class extends pj{constructor(t={}){super(),this._allowSynchronousEvents=t.allowSynchronousEvents!==void 0?t.allowSynchronousEvents:!0,this._binaryType=t.binaryType||mj[0],this._extensions=t.extensions||{},this._isServer=!!t.isServer,this._maxBufferedChunks=t.maxBufferedChunks|0,this._maxFragments=t.maxFragments|0,this._maxPayload=t.maxPayload|0,this._skipUTF8Validation=!!t.skipUTF8Validation,this[gj]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=yt}_write(t,r,o){if(this._opcode===8&&this._state==yt)return o();if(this._maxBufferedChunks>0&&this._buffers.length>=this._maxBufferedChunks){o(this.createError(RangeError,"Too many buffered chunks",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS"));return}this._bufferedBytes+=t.length,this._buffers.push(t),this.startLoop(o)}consume(t){if(this._bufferedBytes-=t,t===this._buffers[0].length)return this._buffers.shift();if(t<this._buffers[0].length){let o=this._buffers[0];return this._buffers[0]=new Zl(o.buffer,o.byteOffset+t,o.length-t),new Zl(o.buffer,o.byteOffset,t)}let r=Buffer.allocUnsafe(t);do{let o=this._buffers[0],n=r.length-t;t>=o.length?r.set(this._buffers.shift(),n):(r.set(new Uint8Array(o.buffer,o.byteOffset,t),n),this._buffers[0]=new Zl(o.buffer,o.byteOffset+t,o.length-t)),t-=o.length}while(t>0);return r}startLoop(t){this._loop=!0;do switch(this._state){case yt:this.getInfo(t);break;case U_:this.getPayloadLength16(t);break;case j_:this.getPayloadLength64(t);break;case z_:this.getMask();break;case Kh:this.getData(t);break;case Xh:case Gl:this._loop=!1;return}while(this._loop);this._errored||t()}getInfo(t){if(this._bufferedBytes<2){this._loop=!1;return}let r=this.consume(2);if((r[0]&48)!==0){let n=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");t(n);return}let o=(r[0]&64)===64;if(o&&!this._extensions[D_.extensionName]){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(n);return}if(this._fin=(r[0]&128)===128,this._opcode=r[0]&15,this._payloadLength=r[1]&127,this._opcode===0){if(o){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(n);return}if(!this._fragmented){let n=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");t(n);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let n=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(n);return}this._compressed=o}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let n=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");t(n);return}if(o){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(n);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let n=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");t(n);return}}else{let n=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(n);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(r[1]&128)===128,this._isServer){if(!this._masked){let n=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");t(n);return}}else if(this._masked){let n=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");t(n);return}this._payloadLength===126?this._state=U_:this._payloadLength===127?this._state=j_:this.haveLength(t)}getPayloadLength16(t){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(t)}getPayloadLength64(t){if(this._bufferedBytes<8){this._loop=!1;return}let r=this.consume(8),o=r.readUInt32BE(0);if(o>Math.pow(2,21)-1){let n=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");t(n);return}this._payloadLength=o*Math.pow(2,32)+r.readUInt32BE(4),this.haveLength(t)}haveLength(t){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let r=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(r);return}this._masked?this._state=z_:this._state=Kh}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Kh}getData(t){let r=N_;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}r=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&vj(r,this._mask)}if(this._opcode>7){this.controlMessage(r,t);return}if(this._compressed){this._state=Xh,this.decompress(r,t);return}if(r.length){if(this._maxFragments>0&&this._fragments.length>=this._maxFragments){let o=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");t(o);return}this._messageLength=this._totalPayloadLength,this._fragments.push(r)}this.dataMessage(t)}decompress(t,r){this._extensions[D_.extensionName].decompress(t,this._fin,(n,i)=>{if(n)return r(n);if(i.length){if(this._messageLength+=i.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let s=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");r(s);return}if(this._maxFragments>0&&this._fragments.length>=this._maxFragments){let s=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");r(s);return}this._fragments.push(i)}this.dataMessage(r),this._state===yt&&this.startLoop(r)})}dataMessage(t){if(!this._fin){this._state=yt;return}let r=this._messageLength,o=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let n;this._binaryType==="nodebuffer"?n=Jh(o,r):this._binaryType==="arraybuffer"?n=hj(Jh(o,r)):this._binaryType==="blob"?n=new Blob(o):n=o,this._allowSynchronousEvents?(this.emit("message",n,!0),this._state=yt):(this._state=Gl,setImmediate(()=>{this.emit("message",n,!0),this._state=yt,this.startLoop(t)}))}else{let n=Jh(o,r);if(!this._skipUTF8Validation&&!L_(n)){let i=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(i);return}this._state===Xh||this._allowSynchronousEvents?(this.emit("message",n,!1),this._state=yt):(this._state=Gl,setImmediate(()=>{this.emit("message",n,!1),this._state=yt,this.startLoop(t)}))}}controlMessage(t,r){if(this._opcode===8){if(t.length===0)this._loop=!1,this.emit("conclude",1005,N_),this.end();else{let o=t.readUInt16BE(0);if(!yj(o)){let i=this.createError(RangeError,`invalid status code ${o}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");r(i);return}let n=new Zl(t.buffer,t.byteOffset+2,t.length-2);if(!this._skipUTF8Validation&&!L_(n)){let i=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");r(i);return}this._loop=!1,this.emit("conclude",o,n),this.end()}this._state=yt;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",t),this._state=yt):(this._state=Gl,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",t),this._state=yt,this.startLoop(r)}))}createError(t,r,o,n,i){this._loop=!1,this._errored=!0;let s=new t(o?`Invalid WebSocket frame: ${r}`:r);return Error.captureStackTrace(s,this.createError),s.code=i,s[fj]=n,s}};F_.exports=Yh});var nv=ie((RK,H_)=>{"use strict";var{Duplex:TK}=ue("stream"),{randomFillSync:bj}=ue("crypto"),{types:{isUint8Array:xj}}=ue("util"),M_=ei(),{EMPTY_BUFFER:kj,kWebSocket:wj,NOOP:Sj}=Tn(),{isBlob:ni,isValidStatusCode:_j}=ti(),{mask:B_,toBuffer:jr}=ks(),bt=Symbol("kByteLength"),$j=Buffer.alloc(4),Wl=8*1024,zr,ri=Wl,Dt=0,Ij=1,Ej=2,ev=class e{constructor(t,r,o){this._extensions=r||{},o&&(this._generateMask=o,this._maskBuffer=Buffer.alloc(4)),this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=Dt,this.onerror=Sj,this[wj]=void 0}static frame(t,r){let o,n=!1,i=2,s=!1;r.mask&&(o=r.maskBuffer||$j,r.generateMask?r.generateMask(o):(ri===Wl&&(zr===void 0&&(zr=Buffer.alloc(Wl)),bj(zr,0,Wl),ri=0),o[0]=zr[ri++],o[1]=zr[ri++],o[2]=zr[ri++],o[3]=zr[ri++]),s=(o[0]|o[1]|o[2]|o[3])===0,i=6);let a;typeof t=="string"?(!r.mask||s)&&r[bt]!==void 0?a=r[bt]:(t=Buffer.from(t),a=t.length):(a=t.length,n=r.mask&&r.readOnly&&!s);let l=a;a>=65536?(i+=8,l=127):a>125&&(i+=2,l=126);let u=Buffer.allocUnsafe(n?a+i:i);return u[0]=r.fin?r.opcode|128:r.opcode,r.rsv1&&(u[0]|=64),u[1]=l,l===126?u.writeUInt16BE(a,2):l===127&&(u[2]=u[3]=0,u.writeUIntBE(a,4,6)),r.mask?(u[1]|=128,u[i-4]=o[0],u[i-3]=o[1],u[i-2]=o[2],u[i-1]=o[3],s?[u,t]:n?(B_(t,o,u,i,a),[u]):(B_(t,o,t,0,a),[u,t])):[u,t]}close(t,r,o,n){let i;if(t===void 0)i=kj;else{if(typeof t!="number"||!_j(t))throw new TypeError("First argument must be a valid error code number");if(r===void 0||!r.length)i=Buffer.allocUnsafe(2),i.writeUInt16BE(t,0);else{let a=Buffer.byteLength(r);if(a>123)throw new RangeError("The message must not be greater than 123 bytes");if(i=Buffer.allocUnsafe(2+a),i.writeUInt16BE(t,0),typeof r=="string")i.write(r,2);else if(xj(r))i.set(r,2);else throw new TypeError("Second argument must be a string or a Uint8Array")}}let s={[bt]:i.length,fin:!0,generateMask:this._generateMask,mask:o,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==Dt?this.enqueue([this.dispatch,i,!1,s,n]):this.sendFrame(e.frame(i,s),n)}ping(t,r,o){let n,i;if(typeof t=="string"?(n=Buffer.byteLength(t),i=!1):ni(t)?(n=t.size,i=!1):(t=jr(t),n=t.length,i=jr.readOnly),n>125)throw new RangeError("The data size must not be greater than 125 bytes");let s={[bt]:n,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:9,readOnly:i,rsv1:!1};ni(t)?this._state!==Dt?this.enqueue([this.getBlobData,t,!1,s,o]):this.getBlobData(t,!1,s,o):this._state!==Dt?this.enqueue([this.dispatch,t,!1,s,o]):this.sendFrame(e.frame(t,s),o)}pong(t,r,o){let n,i;if(typeof t=="string"?(n=Buffer.byteLength(t),i=!1):ni(t)?(n=t.size,i=!1):(t=jr(t),n=t.length,i=jr.readOnly),n>125)throw new RangeError("The data size must not be greater than 125 bytes");let s={[bt]:n,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:10,readOnly:i,rsv1:!1};ni(t)?this._state!==Dt?this.enqueue([this.getBlobData,t,!1,s,o]):this.getBlobData(t,!1,s,o):this._state!==Dt?this.enqueue([this.dispatch,t,!1,s,o]):this.sendFrame(e.frame(t,s),o)}send(t,r,o){let n=this._extensions[M_.extensionName],i=r.binary?2:1,s=r.compress,a,l;typeof t=="string"?(a=Buffer.byteLength(t),l=!1):ni(t)?(a=t.size,l=!1):(t=jr(t),a=t.length,l=jr.readOnly),this._firstFragment?(this._firstFragment=!1,s&&n&&n.params[n._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(s=a>=n._threshold),this._compress=s):(s=!1,i=0),r.fin&&(this._firstFragment=!0);let u={[bt]:a,fin:r.fin,generateMask:this._generateMask,mask:r.mask,maskBuffer:this._maskBuffer,opcode:i,readOnly:l,rsv1:s};ni(t)?this._state!==Dt?this.enqueue([this.getBlobData,t,this._compress,u,o]):this.getBlobData(t,this._compress,u,o):this._state!==Dt?this.enqueue([this.dispatch,t,this._compress,u,o]):this.dispatch(t,this._compress,u,o)}getBlobData(t,r,o,n){this._bufferedBytes+=o[bt],this._state=Ej,t.arrayBuffer().then(i=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(tv,this,a,n);return}this._bufferedBytes-=o[bt];let s=jr(i);r?this.dispatch(s,r,o,n):(this._state=Dt,this.sendFrame(e.frame(s,o),n),this.dequeue())}).catch(i=>{process.nextTick(Aj,this,i,n)})}dispatch(t,r,o,n){if(!r){this.sendFrame(e.frame(t,o),n);return}let i=this._extensions[M_.extensionName];this._bufferedBytes+=o[bt],this._state=Ij,i.compress(t,o.fin,(s,a)=>{if(this._socket.destroyed){let l=new Error("The socket was closed while data was being compressed");tv(this,l,n);return}this._bufferedBytes-=o[bt],this._state=Dt,o.readOnly=!1,this.sendFrame(e.frame(a,o),n),this.dequeue()})}dequeue(){for(;this._state===Dt&&this._queue.length;){let t=this._queue.shift();this._bufferedBytes-=t[3][bt],Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[3][bt],this._queue.push(t)}sendFrame(t,r){t.length===2?(this._socket.cork(),this._socket.write(t[0]),this._socket.write(t[1],r),this._socket.uncork()):this._socket.write(t[0],r)}};H_.exports=ev;function tv(e,t,r){typeof r=="function"&&r(t);for(let o=0;o<e._queue.length;o++){let n=e._queue[o],i=n[n.length-1];typeof i=="function"&&i(t)}}function Aj(e,t,r){tv(e,t,r),e.onerror(t)}});var Y_=ie((OK,X_)=>{"use strict";var{kForOnEventAttribute:Ss,kListener:rv}=Tn(),Z_=Symbol("kCode"),G_=Symbol("kData"),W_=Symbol("kError"),V_=Symbol("kMessage"),q_=Symbol("kReason"),oi=Symbol("kTarget"),J_=Symbol("kType"),K_=Symbol("kWasClean"),On=class{constructor(t){this[oi]=null,this[J_]=t}get target(){return this[oi]}get type(){return this[J_]}};Object.defineProperty(On.prototype,"target",{enumerable:!0});Object.defineProperty(On.prototype,"type",{enumerable:!0});var Fr=class extends On{constructor(t,r={}){super(t),this[Z_]=r.code===void 0?0:r.code,this[q_]=r.reason===void 0?"":r.reason,this[K_]=r.wasClean===void 0?!1:r.wasClean}get code(){return this[Z_]}get reason(){return this[q_]}get wasClean(){return this[K_]}};Object.defineProperty(Fr.prototype,"code",{enumerable:!0});Object.defineProperty(Fr.prototype,"reason",{enumerable:!0});Object.defineProperty(Fr.prototype,"wasClean",{enumerable:!0});var ii=class extends On{constructor(t,r={}){super(t),this[W_]=r.error===void 0?null:r.error,this[V_]=r.message===void 0?"":r.message}get error(){return this[W_]}get message(){return this[V_]}};Object.defineProperty(ii.prototype,"error",{enumerable:!0});Object.defineProperty(ii.prototype,"message",{enumerable:!0});var _s=class extends On{constructor(t,r={}){super(t),this[G_]=r.data===void 0?null:r.data}get data(){return this[G_]}};Object.defineProperty(_s.prototype,"data",{enumerable:!0});var Pj={addEventListener(e,t,r={}){for(let n of this.listeners(e))if(!r[Ss]&&n[rv]===t&&!n[Ss])return;let o;if(e==="message")o=function(i,s){let a=new _s("message",{data:s?i:i.toString()});a[oi]=this,Vl(t,this,a)};else if(e==="close")o=function(i,s){let a=new Fr("close",{code:i,reason:s.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[oi]=this,Vl(t,this,a)};else if(e==="error")o=function(i){let s=new ii("error",{error:i,message:i.message});s[oi]=this,Vl(t,this,s)};else if(e==="open")o=function(){let i=new On("open");i[oi]=this,Vl(t,this,i)};else return;o[Ss]=!!r[Ss],o[rv]=t,r.once?this.once(e,o):this.on(e,o)},removeEventListener(e,t){for(let r of this.listeners(e))if(r[rv]===t&&!r[Ss]){this.removeListener(e,r);break}}};X_.exports={CloseEvent:Fr,ErrorEvent:ii,Event:On,EventTarget:Pj,MessageEvent:_s};function Vl(e,t,r){typeof e=="object"&&e.handleEvent?e.handleEvent.call(e,r):e.call(t,r)}});var ql=ie((DK,Q_)=>{"use strict";var{tokenChars:$s}=ti();function en(e,t,r){e[t]===void 0?e[t]=[r]:e[t].push(r)}function Cj(e){let t=Object.create(null),r=Object.create(null),o=!1,n=!1,i=!1,s,a,l=-1,u=-1,d=-1,p=0;for(;p<e.length;p++)if(u=e.charCodeAt(p),s===void 0)if(d===-1&&$s[u]===1)l===-1&&(l=p);else if(p!==0&&(u===32||u===9))d===-1&&l!==-1&&(d=p);else if(u===59||u===44){if(l===-1)throw new SyntaxError(`Unexpected character at index ${p}`);d===-1&&(d=p);let f=e.slice(l,d);u===44?(en(t,f,r),r=Object.create(null)):s=f,l=d=-1}else throw new SyntaxError(`Unexpected character at index ${p}`);else if(a===void 0)if(d===-1&&$s[u]===1)l===-1&&(l=p);else if(u===32||u===9)d===-1&&l!==-1&&(d=p);else if(u===59||u===44){if(l===-1)throw new SyntaxError(`Unexpected character at index ${p}`);d===-1&&(d=p),en(r,e.slice(l,d),!0),u===44&&(en(t,s,r),r=Object.create(null),s=void 0),l=d=-1}else if(u===61&&l!==-1&&d===-1)a=e.slice(l,p),l=d=-1;else throw new SyntaxError(`Unexpected character at index ${p}`);else if(n){if($s[u]!==1)throw new SyntaxError(`Unexpected character at index ${p}`);l===-1?l=p:o||(o=!0),n=!1}else if(i)if($s[u]===1)l===-1&&(l=p);else if(u===34&&l!==-1)i=!1,d=p;else if(u===92)n=!0;else throw new SyntaxError(`Unexpected character at index ${p}`);else if(u===34&&e.charCodeAt(p-1)===61)i=!0;else if(d===-1&&$s[u]===1)l===-1&&(l=p);else if(l!==-1&&(u===32||u===9))d===-1&&(d=p);else if(u===59||u===44){if(l===-1)throw new SyntaxError(`Unexpected character at index ${p}`);d===-1&&(d=p);let f=e.slice(l,d);o&&(f=f.replace(/\\/g,""),o=!1),en(r,a,f),u===44&&(en(t,s,r),r=Object.create(null),s=void 0),a=void 0,l=d=-1}else throw new SyntaxError(`Unexpected character at index ${p}`);if(l===-1||i||u===32||u===9)throw new SyntaxError("Unexpected end of input");d===-1&&(d=p);let m=e.slice(l,d);return s===void 0?en(t,m,r):(a===void 0?en(r,m,!0):o?en(r,a,m.replace(/\\/g,"")):en(r,a,m),en(t,s,r)),t}function Tj(e){return Object.keys(e).map(t=>{let r=e[t];return Array.isArray(r)||(r=[r]),r.map(o=>[t].concat(Object.keys(o).map(n=>{let i=o[n];return Array.isArray(i)||(i=[i]),i.map(s=>s===!0?n:`${n}=${s}`).join("; ")})).join("; ")).join(", ")}).join(", ")}Q_.exports={format:Tj,parse:Cj}});var Yl=ie((UK,d$)=>{"use strict";var Rj=ue("events"),Oj=ue("https"),Dj=ue("http"),n$=ue("net"),Nj=ue("tls"),{randomBytes:Lj,createHash:Uj}=ue("crypto"),{Duplex:NK,Readable:LK}=ue("stream"),{URL:ov}=ue("url"),or=ei(),jj=Qh(),zj=nv(),{isBlob:Fj}=ti(),{BINARY_TYPES:e$,CLOSE_TIMEOUT:Mj,EMPTY_BUFFER:Jl,GUID:Bj,kForOnEventAttribute:iv,kListener:Hj,kStatusCode:Zj,kWebSocket:Re,NOOP:r$}=Tn(),{EventTarget:{addEventListener:Gj,removeEventListener:Wj}}=Y_(),{format:Vj,parse:qj}=ql(),{toBuffer:Jj}=ks(),o$=Symbol("kAborted"),sv=[8,13],Dn=["CONNECTING","OPEN","CLOSING","CLOSED"],Kj=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,Se=class e extends Rj{constructor(t,r,o){super(),this._binaryType=e$[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=Jl,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=e.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,t!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,r===void 0?r=[]:Array.isArray(r)||(typeof r=="object"&&r!==null?(o=r,r=[]):r=[r]),i$(this,t,r,o)):(this._autoPong=o.autoPong,this._closeTimeout=o.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(t){e$.includes(t)&&(this._binaryType=t,this._receiver&&(this._receiver._binaryType=t))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(t,r,o){let n=new jj({allowSynchronousEvents:o.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxBufferedChunks:o.maxBufferedChunks,maxFragments:o.maxFragments,maxPayload:o.maxPayload,skipUTF8Validation:o.skipUTF8Validation}),i=new zj(t,this._extensions,o.generateMask);this._receiver=n,this._sender=i,this._socket=t,n[Re]=this,i[Re]=this,t[Re]=this,n.on("conclude",Qj),n.on("drain",ez),n.on("error",tz),n.on("message",nz),n.on("ping",rz),n.on("pong",oz),i.onerror=iz,t.setTimeout&&t.setTimeout(0),t.setNoDelay&&t.setNoDelay(),r.length>0&&t.unshift(r),t.on("close",c$),t.on("data",Xl),t.on("end",l$),t.on("error",u$),this._readyState=e.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[or.extensionName]&&this._extensions[or.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(t,r){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){pt(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===e.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=e.CLOSING,this._sender.close(t,r,!this._isServer,o=>{o||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),a$(this)}}pause(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!0,this._socket.pause())}ping(t,r,o){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(o=t,t=r=void 0):typeof r=="function"&&(o=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){av(this,t,o);return}r===void 0&&(r=!this._isServer),this._sender.ping(t||Jl,r,o)}pong(t,r,o){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(o=t,t=r=void 0):typeof r=="function"&&(o=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){av(this,t,o);return}r===void 0&&(r=!this._isServer),this._sender.pong(t||Jl,r,o)}resume(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(t,r,o){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof r=="function"&&(o=r,r={}),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){av(this,t,o);return}let n={binary:typeof t!="string",mask:!this._isServer,compress:!0,fin:!0,...r};this._extensions[or.extensionName]||(n.compress=!1),this._sender.send(t||Jl,n,o)}terminate(){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){pt(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=e.CLOSING,this._socket.destroy())}}};Object.defineProperty(Se,"CONNECTING",{enumerable:!0,value:Dn.indexOf("CONNECTING")});Object.defineProperty(Se.prototype,"CONNECTING",{enumerable:!0,value:Dn.indexOf("CONNECTING")});Object.defineProperty(Se,"OPEN",{enumerable:!0,value:Dn.indexOf("OPEN")});Object.defineProperty(Se.prototype,"OPEN",{enumerable:!0,value:Dn.indexOf("OPEN")});Object.defineProperty(Se,"CLOSING",{enumerable:!0,value:Dn.indexOf("CLOSING")});Object.defineProperty(Se.prototype,"CLOSING",{enumerable:!0,value:Dn.indexOf("CLOSING")});Object.defineProperty(Se,"CLOSED",{enumerable:!0,value:Dn.indexOf("CLOSED")});Object.defineProperty(Se.prototype,"CLOSED",{enumerable:!0,value:Dn.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(e=>{Object.defineProperty(Se.prototype,e,{enumerable:!0})});["open","error","close","message"].forEach(e=>{Object.defineProperty(Se.prototype,`on${e}`,{enumerable:!0,get(){for(let t of this.listeners(e))if(t[iv])return t[Hj];return null},set(t){for(let r of this.listeners(e))if(r[iv]){this.removeListener(e,r);break}typeof t=="function"&&this.addEventListener(e,t,{[iv]:!0})}})});Se.prototype.addEventListener=Gj;Se.prototype.removeEventListener=Wj;d$.exports=Se;function i$(e,t,r,o){let n={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:Mj,protocolVersion:sv[1],maxBufferedChunks:1048576,maxFragments:131072,maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...o,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(e._autoPong=n.autoPong,e._closeTimeout=n.closeTimeout,!sv.includes(n.protocolVersion))throw new RangeError(`Unsupported protocol version: ${n.protocolVersion} (supported versions: ${sv.join(", ")})`);let i;if(t instanceof ov)i=t;else try{i=new ov(t)}catch{throw new SyntaxError(`Invalid URL: ${t}`)}i.protocol==="http:"?i.protocol="ws:":i.protocol==="https:"&&(i.protocol="wss:"),e._url=i.href;let s=i.protocol==="wss:",a=i.protocol==="ws+unix:",l;if(i.protocol!=="ws:"&&!s&&!a?l=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:a&&!i.pathname?l="The URL's pathname is empty":i.hash&&(l="The URL contains a fragment identifier"),l){let h=new SyntaxError(l);if(e._redirects===0)throw h;Kl(e,h);return}let u=s?443:80,d=Lj(16).toString("base64"),p=s?Oj.request:Dj.request,m=new Set,f;if(n.createConnection=n.createConnection||(s?Yj:Xj),n.defaultPort=n.defaultPort||u,n.port=i.port||u,n.host=i.hostname.startsWith("[")?i.hostname.slice(1,-1):i.hostname,n.headers={...n.headers,"Sec-WebSocket-Version":n.protocolVersion,"Sec-WebSocket-Key":d,Connection:"Upgrade",Upgrade:"websocket"},n.path=i.pathname+i.search,n.timeout=n.handshakeTimeout,n.perMessageDeflate&&(f=new or({...n.perMessageDeflate,isServer:!1,maxPayload:n.maxPayload}),n.headers["Sec-WebSocket-Extensions"]=Vj({[or.extensionName]:f.offer()})),r.length){for(let h of r){if(typeof h!="string"||!Kj.test(h)||m.has(h))throw new SyntaxError("An invalid or duplicated subprotocol was specified");m.add(h)}n.headers["Sec-WebSocket-Protocol"]=r.join(",")}if(n.origin&&(n.protocolVersion<13?n.headers["Sec-WebSocket-Origin"]=n.origin:n.headers.Origin=n.origin),(i.username||i.password)&&(n.auth=`${i.username}:${i.password}`),a){let h=n.path.split(":");n.socketPath=h[0],n.path=h[1]}let g;if(n.followRedirects){if(e._redirects===0){e._originalIpc=a,e._originalSecure=s,e._originalHostOrSocketPath=a?n.socketPath:i.host;let h=o&&o.headers;if(o={...o,headers:{}},h)for(let[y,k]of Object.entries(h))o.headers[y.toLowerCase()]=k}else if(e.listenerCount("redirect")===0){let h=a?e._originalIpc?n.socketPath===e._originalHostOrSocketPath:!1:e._originalIpc?!1:i.host===e._originalHostOrSocketPath;(!h||e._originalSecure&&!s)&&(delete n.headers.authorization,delete n.headers.cookie,h||delete n.headers.host,n.auth=void 0)}n.auth&&!o.headers.authorization&&(o.headers.authorization="Basic "+Buffer.from(n.auth).toString("base64")),g=e._req=p(n),e._redirects&&e.emit("redirect",e.url,g)}else g=e._req=p(n);n.timeout&&g.on("timeout",()=>{pt(e,g,"Opening handshake has timed out")}),g.on("error",h=>{g===null||g[o$]||(g=e._req=null,Kl(e,h))}),g.on("response",h=>{let y=h.headers.location,k=h.statusCode;if(y&&n.followRedirects&&k>=300&&k<400){if(++e._redirects>n.maxRedirects){pt(e,g,"Maximum redirects exceeded");return}g.abort();let _;try{_=new ov(y,t)}catch{let S=new SyntaxError(`Invalid URL: ${y}`);Kl(e,S);return}i$(e,_,r,o)}else e.emit("unexpected-response",g,h)||pt(e,g,`Unexpected server response: ${h.statusCode}`)}),g.on("upgrade",(h,y,k)=>{if(e.emit("upgrade",h),e.readyState!==Se.CONNECTING)return;g=e._req=null;let _=h.headers.upgrade;if(_===void 0||_.toLowerCase()!=="websocket"){pt(e,y,"Invalid Upgrade header");return}let I=Uj("sha1").update(d+Bj).digest("base64");if(h.headers["sec-websocket-accept"]!==I){pt(e,y,"Invalid Sec-WebSocket-Accept header");return}let S=h.headers["sec-websocket-protocol"],T;if(S!==void 0?m.size?m.has(S)||(T="Server sent an invalid subprotocol"):T="Server sent a subprotocol but none was requested":m.size&&(T="Server sent no subprotocol"),T){pt(e,y,T);return}S&&(e._protocol=S);let j=h.headers["sec-websocket-extensions"];if(j!==void 0){if(!f){pt(e,y,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let F;try{F=qj(j)}catch{pt(e,y,"Invalid Sec-WebSocket-Extensions header");return}let J=Object.keys(F);if(J.length!==1||J[0]!==or.extensionName){pt(e,y,"Server indicated an extension that was not requested");return}try{f.accept(F[or.extensionName])}catch{pt(e,y,"Invalid Sec-WebSocket-Extensions header");return}e._extensions[or.extensionName]=f}e.setSocket(y,k,{allowSynchronousEvents:n.allowSynchronousEvents,generateMask:n.generateMask,maxBufferedChunks:n.maxBufferedChunks,maxFragments:n.maxFragments,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation})}),n.finishRequest?n.finishRequest(g,e):g.end()}function Kl(e,t){e._readyState=Se.CLOSING,e._errorEmitted=!0,e.emit("error",t),e.emitClose()}function Xj(e){return e.path=e.socketPath,n$.connect(e)}function Yj(e){return e.path=void 0,!e.servername&&e.servername!==""&&(e.servername=n$.isIP(e.host)?"":e.host),Nj.connect(e)}function pt(e,t,r){e._readyState=Se.CLOSING;let o=new Error(r);Error.captureStackTrace(o,pt),t.setHeader?(t[o$]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(Kl,e,o)):(t.destroy(o),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}function av(e,t,r){if(t){let o=Fj(t)?t.size:Jj(t).length;e._socket?e._sender._bufferedBytes+=o:e._bufferedAmount+=o}if(r){let o=new Error(`WebSocket is not open: readyState ${e.readyState} (${Dn[e.readyState]})`);process.nextTick(r,o)}}function Qj(e,t){let r=this[Re];r._closeFrameReceived=!0,r._closeMessage=t,r._closeCode=e,r._socket[Re]!==void 0&&(r._socket.removeListener("data",Xl),process.nextTick(s$,r._socket),e===1005?r.close():r.close(e,t))}function ez(){let e=this[Re];e.isPaused||e._socket.resume()}function tz(e){let t=this[Re];t._socket[Re]!==void 0&&(t._socket.removeListener("data",Xl),process.nextTick(s$,t._socket),t.close(e[Zj])),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e))}function t$(){this[Re].emitClose()}function nz(e,t){this[Re].emit("message",e,t)}function rz(e){let t=this[Re];t._autoPong&&t.pong(e,!this._isServer,r$),t.emit("ping",e)}function oz(e){this[Re].emit("pong",e)}function s$(e){e.resume()}function iz(e){let t=this[Re];t.readyState!==Se.CLOSED&&(t.readyState===Se.OPEN&&(t._readyState=Se.CLOSING,a$(t)),this._socket.end(),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e)))}function a$(e){e._closeTimer=setTimeout(e._socket.destroy.bind(e._socket),e._closeTimeout)}function c$(){let e=this[Re];if(this.removeListener("close",c$),this.removeListener("data",Xl),this.removeListener("end",l$),e._readyState=Se.CLOSING,!this._readableState.endEmitted&&!e._closeFrameReceived&&!e._receiver._writableState.errorEmitted&&this._readableState.length!==0){let t=this.read(this._readableState.length);e._receiver.write(t)}e._receiver.end(),this[Re]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on("error",t$),e._receiver.on("finish",t$))}function Xl(e){this[Re]._receiver.write(e)||this.pause()}function l$(){let e=this[Re];e._readyState=Se.CLOSING,e._receiver.end(),this.end()}function u$(){let e=this[Re];this.removeListener("error",u$),this.on("error",r$),e&&(e._readyState=Se.CLOSING,this.destroy())}});var g$=ie((zK,f$)=>{"use strict";var jK=Yl(),{Duplex:sz}=ue("stream");function p$(e){e.emit("close")}function az(){!this.destroyed&&this._writableState.finished&&this.destroy()}function m$(e){this.removeListener("error",m$),this.destroy(),this.listenerCount("error")===0&&this.emit("error",e)}function cz(e,t){let r=!0,o=new sz({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on("message",function(i,s){let a=!s&&o._readableState.objectMode?i.toString():i;o.push(a)||e.pause()}),e.once("error",function(i){o.destroyed||(r=!1,o.destroy(i))}),e.once("close",function(){o.destroyed||o.push(null)}),o._destroy=function(n,i){if(e.readyState===e.CLOSED){i(n),process.nextTick(p$,o);return}let s=!1;e.once("error",function(l){s=!0,i(l)}),e.once("close",function(){s||i(n),process.nextTick(p$,o)}),r&&e.terminate()},o._final=function(n){if(e.readyState===e.CONNECTING){e.once("open",function(){o._final(n)});return}e._socket!==null&&(e._socket._writableState.finished?(n(),o._readableState.endEmitted&&o.destroy()):(e._socket.once("finish",function(){n()}),e.close()))},o._read=function(){e.isPaused&&e.resume()},o._write=function(n,i,s){if(e.readyState===e.CONNECTING){e.once("open",function(){o._write(n,i,s)});return}e.send(n,s)},o.on("end",az),o.on("error",m$),o}f$.exports=cz});var cv=ie((FK,h$)=>{"use strict";var{tokenChars:lz}=ti();function uz(e){let t=new Set,r=-1,o=-1,n=0;for(n;n<e.length;n++){let s=e.charCodeAt(n);if(o===-1&&lz[s]===1)r===-1&&(r=n);else if(n!==0&&(s===32||s===9))o===-1&&r!==-1&&(o=n);else if(s===44){if(r===-1)throw new SyntaxError(`Unexpected character at index ${n}`);o===-1&&(o=n);let a=e.slice(r,o);if(t.has(a))throw new SyntaxError(`The "${a}" subprotocol is duplicated`);t.add(a),r=o=-1}else throw new SyntaxError(`Unexpected character at index ${n}`)}if(r===-1||o!==-1)throw new SyntaxError("Unexpected end of input");let i=e.slice(r,n);if(t.has(i))throw new SyntaxError(`The "${i}" subprotocol is duplicated`);return t.add(i),t}h$.exports={parse:uz}});var S$=ie((BK,w$)=>{"use strict";var dz=ue("events"),Ql=ue("http"),{Duplex:MK}=ue("stream"),{createHash:pz}=ue("crypto"),v$=ql(),Mr=ei(),mz=cv(),fz=Yl(),{CLOSE_TIMEOUT:gz,GUID:hz,kWebSocket:vz}=Tn(),yz=/^[+/0-9A-Za-z]{22}==$/,y$=0,b$=1,k$=2,lv=class extends dz{constructor(t,r){if(super(),t={allowSynchronousEvents:!0,autoPong:!0,maxBufferedChunks:1024*1024,maxFragments:128*1024,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:gz,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:fz,...t},t.port==null&&!t.server&&!t.noServer||t.port!=null&&(t.server||t.noServer)||t.server&&t.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(t.port!=null?(this._server=Ql.createServer((o,n)=>{let i=Ql.STATUS_CODES[426];n.writeHead(426,{"Content-Length":i.length,"Content-Type":"text/plain"}),n.end(i)}),this._server.listen(t.port,t.host,t.backlog,r)):t.server&&(this._server=t.server),this._server){let o=this.emit.bind(this,"connection");this._removeListeners=bz(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(n,i,s)=>{this.handleUpgrade(n,i,s,o)}})}t.perMessageDeflate===!0&&(t.perMessageDeflate={}),t.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=t,this._state=y$}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(t){if(this._state===k$){t&&this.once("close",()=>{t(new Error("The server is not running"))}),process.nextTick(Is,this);return}if(t&&this.once("close",t),this._state!==b$)if(this._state=b$,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(Is,this):process.nextTick(Is,this);else{let r=this._server;this._removeListeners(),this._removeListeners=this._server=null,r.close(()=>{Is(this)})}}shouldHandle(t){if(this.options.path){let r=t.url.indexOf("?");if((r!==-1?t.url.slice(0,r):t.url)!==this.options.path)return!1}return!0}handleUpgrade(t,r,o,n){r.on("error",x$);let i=t.headers["sec-websocket-key"],s=t.headers.upgrade,a=+t.headers["sec-websocket-version"];if(t.method!=="GET"){Br(this,t,r,405,"Invalid HTTP method");return}if(s===void 0||s.toLowerCase()!=="websocket"){Br(this,t,r,400,"Invalid Upgrade header");return}if(i===void 0||!yz.test(i)){Br(this,t,r,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){Br(this,t,r,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(t)){Es(r,400);return}let l=t.headers["sec-websocket-protocol"],u=new Set;if(l!==void 0)try{u=mz.parse(l)}catch{Br(this,t,r,400,"Invalid Sec-WebSocket-Protocol header");return}let d=t.headers["sec-websocket-extensions"],p={};if(this.options.perMessageDeflate&&d!==void 0){let m=new Mr({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let f=v$.parse(d);f[Mr.extensionName]&&(m.accept(f[Mr.extensionName]),p[Mr.extensionName]=m)}catch{Br(this,t,r,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let m={origin:t.headers[`${a===8?"sec-websocket-origin":"origin"}`],secure:!!(t.socket.authorized||t.socket.encrypted),req:t};if(this.options.verifyClient.length===2){this.options.verifyClient(m,(f,g,h,y)=>{if(!f)return Es(r,g||401,h,y);this.completeUpgrade(p,i,u,t,r,o,n)});return}if(!this.options.verifyClient(m))return Es(r,401)}this.completeUpgrade(p,i,u,t,r,o,n)}completeUpgrade(t,r,o,n,i,s,a){if(!i.readable||!i.writable)return i.destroy();if(i[vz])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>y$)return Es(i,503);let u=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${pz("sha1").update(r+hz).digest("base64")}`],d=new this.options.WebSocket(null,void 0,this.options);if(o.size){let p=this.options.handleProtocols?this.options.handleProtocols(o,n):o.values().next().value;p&&(u.push(`Sec-WebSocket-Protocol: ${p}`),d._protocol=p)}if(t[Mr.extensionName]){let p=t[Mr.extensionName].params,m=v$.format({[Mr.extensionName]:[p]});u.push(`Sec-WebSocket-Extensions: ${m}`),d._extensions=t}this.emit("headers",u,n),i.write(u.concat(`\r
|
|
4
|
+
var HI=Object.create;var fu=Object.defineProperty;var ZI=Object.getOwnPropertyDescriptor;var GI=Object.getOwnPropertyNames;var WI=Object.getPrototypeOf,VI=Object.prototype.hasOwnProperty;var ue=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var ie=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},rn=(e,t)=>{for(var r in t)fu(e,r,{get:t[r],enumerable:!0})},JI=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of GI(t))!VI.call(e,n)&&n!==r&&fu(e,n,{get:()=>t[n],enumerable:!(o=ZI(t,n))||o.enumerable});return e};var on=(e,t,r)=>(r=e!=null?HI(WI(e)):{},JI(t||!e||!e.__esModule?fu(r,"default",{value:e,enumerable:!0}):r,e));var El=ie(gh=>{"use strict";Object.defineProperty(gh,"__esModule",{value:!0});gh.default=sN;var G0=/[A-Z]/g;function W0(e){return e.toLowerCase()}function sN(e,t){let r=e.replace(G0,W0),o=t.replace(G0,W0);return r===o}});var hh=ie(gs=>{"use strict";Object.defineProperty(gs,"__esModule",{value:!0});gs.DnsTxt=void 0;var Al=class{constructor(t={}){this.binary=t?t.binary:!1}encode(t={}){return Object.entries(t).map(([r,o])=>{let n=`${r}=${o}`;return Buffer.from(n)})}decode(t){var r={};try{let n=t.toString().split(/=(.+)/),i=n[0],s=n[1];r[i]=s}catch{}return r}decodeAll(t){return t.filter(r=>r.length>1).map(r=>this.decode(r)).reduce((r,o)=>{var n=r;let[i]=Object.keys(o),[s]=Object.values(o);return n[i]=s,n},{})}};gs.DnsTxt=Al;gs.default=Al});var vh=ie(Wo=>{"use strict";Object.defineProperty(Wo,"__esModule",{value:!0});Wo.toType=Wo.toString=void 0;var V0=e=>"_"+e,aN=e=>["name","protocol","subtype"].includes(e),cN=e=>{let t={name:e.name,protocol:e.protocol,subtype:e.subtype};return Object.entries(t).filter(([o,n])=>aN(o)&&n!==void 0).reduce((o,[n,i])=>(typeof i==="object"?i.map(s=>o.push(V0(s))):o.push(V0(i)),o),[]).join(".")};Wo.toString=cN;var lN=e=>{let t=e.split("."),r;for(let o in t)t[o][0]==="_"&&(t[o]=t[o].slice(1));return t.includes("sub")&&(r=t.shift(),t.shift()),{name:t.shift(),protocol:t.shift()||null,subtype:r}};Wo.toType=lN});var bh=ie(Cr=>{"use strict";var q0=Cr&&Cr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Cr,"__esModule",{value:!0});Cr.Service=void 0;var J0=q0(ue("os")),uN=q0(hh()),dN=ue("events"),pN=vh(),Vo=".local",Cl=class extends dN.EventEmitter{constructor(t,r,o){if(super(),this.start=r,this.stop=o,this.probe=!0,this.published=!1,this.activated=!1,this.destroyed=!1,this.txtService=new uN.default,!t.name)throw new Error("ServiceConfig requires `name` property to be set");if(!t.type)throw new Error("ServiceConfig requires `type` property to be set");if(!t.port)throw new Error("ServiceConfig requires `port` property to be set");this.name=t.name.split(".").join("-"),this.protocol=t.protocol||"tcp",this.type=(0,pN.toString)({name:t.type,protocol:this.protocol}),this.port=t.port,this.host=t.host||J0.default.hostname(),this.fqdn=`${this.name}.${this.type}${Vo}`,this.txt=t.txt,this.subtypes=t.subtypes,this.disableIPv6=!!t.disableIPv6}records(){var t=[this.RecordPTR(this),this.RecordSRV(this),this.RecordTXT(this),this.RecordServicePTR(this)];for(let o of this.subtypes||[])t.push(this.RecordSubtypePTR(this,o));let r=Object.values(J0.default.networkInterfaces());for(let o of r){let n=o;for(let i of n)if(!(i.internal||i.mac==="00:00:00:00:00:00"))switch(i.family){case"IPv4":t.push(this.RecordA(this,i.address));break;case"IPv6":if(this.disableIPv6)break;t.push(this.RecordAAAA(this,i.address));break}}return t}RecordPTR(t){return{name:`${t.type}${Vo}`,type:"PTR",ttl:28800,data:t.fqdn}}RecordServicePTR(t){return{name:`_services._dns-sd._udp${Vo}`,type:"PTR",ttl:120,data:`${t.type}${Vo}`}}RecordSubtypePTR(t,r){return{name:`_${r}._sub.${t.type}${Vo}`,type:"PTR",ttl:28800,data:`${t.name}.${t.type}${Vo}`}}RecordSRV(t){return{name:t.fqdn,type:"SRV",ttl:120,data:{port:t.port,target:t.host}}}RecordTXT(t){return{name:t.fqdn,type:"TXT",ttl:4500,data:this.txtService.encode(t.txt)}}RecordA(t,r){return{name:t.host,type:"A",ttl:120,data:r}}RecordAAAA(t,r){return{name:t.host,type:"AAAA",ttl:120,data:r}}};Cr.Service=Cl;Cr.default=Cl});var X0=ie(Pr=>{"use strict";var K0=Pr&&Pr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Pr,"__esModule",{value:!0});Pr.Registry=void 0;var mN=K0(El()),yh=K0(bh()),fN=3600*1e3,gN=3,hN=function(){},Pl=class{constructor(t){this.services=[],this.server=t}publish(t){let r=t.probe!==!1,o=new yh.default(t,n.bind(null,this),i.bind(null,this));function n(s,{probe:a=r}={}){o.activated||(o.activated=!0,s.services.push(o),o instanceof yh.default&&(a?s.probe(s.server.mdns,o,l=>{if(l){o.stop!==void 0&&o.stop(),console.log(new Error("Service name is already in use on the network"));return}s.announce(s.server,o)}):s.announce(s.server,o)))}function i(s,a){if(a||(a=hN),!o.activated||!(o instanceof yh.default))return process.nextTick(a);s.teardown(s.server,o,a);let l=s.services.indexOf(o);l!==-1&&s.services.splice(l,1)}return o.start(),o}unpublishAll(t){this.teardown(this.server,this.services,t),this.services=[]}destroy(){this.services.map(t=>t.destroyed=!0)}probe(t,r,o){var n=!1,i=0,s;let a=()=>{!r.activated||r.destroyed||t.query(r.fqdn,"ANY",function(){n=!0,s=setTimeout(++i<3?a:p,250),s.unref()})},l=d=>{n&&(d.answers.some(u)||d.additionals.some(u))&&p(!0)},u=d=>(0,mN.default)(d.name,r.fqdn),p=d=>{t.removeListener("response",l),clearTimeout(s),o(!!d)};t.on("response",l),setTimeout(a,Math.random()*250)}announce(t,r){var o=1e3,n=r.records();t.register(n);let i=()=>{!r.activated||r.destroyed||t.mdns.respond(n,function(){r.published||(r.activated=!0,r.published=!0,r.emit("up")),o=o*gN,o<fN&&!r.destroyed&&setTimeout(i,o).unref()})};i()}teardown(t,r,o){Array.isArray(r)||(r=[r]),r=r.filter(i=>i.activated);var n=r.flatMap(function(i){i.activated=!1;var s=i.records();return s.forEach(a=>{a.ttl=0}),s});if(n.length===0)return o&&process.nextTick(o);t.unregister(n),t.mdns.respond(n,function(){r.forEach(function(i){i.published=!1}),typeof o=="function"&&o.apply(null,arguments)})}};Pr.Registry=Pl;Pr.default=Pl});var Y0=ie(xh=>{"use strict";xh.toString=function(e){switch(e){case 1:return"A";case 10:return"NULL";case 28:return"AAAA";case 18:return"AFSDB";case 42:return"APL";case 257:return"CAA";case 60:return"CDNSKEY";case 59:return"CDS";case 37:return"CERT";case 5:return"CNAME";case 49:return"DHCID";case 32769:return"DLV";case 39:return"DNAME";case 48:return"DNSKEY";case 43:return"DS";case 55:return"HIP";case 13:return"HINFO";case 45:return"IPSECKEY";case 25:return"KEY";case 36:return"KX";case 29:return"LOC";case 15:return"MX";case 35:return"NAPTR";case 2:return"NS";case 47:return"NSEC";case 50:return"NSEC3";case 51:return"NSEC3PARAM";case 12:return"PTR";case 46:return"RRSIG";case 17:return"RP";case 24:return"SIG";case 6:return"SOA";case 99:return"SPF";case 33:return"SRV";case 44:return"SSHFP";case 32768:return"TA";case 249:return"TKEY";case 52:return"TLSA";case 250:return"TSIG";case 16:return"TXT";case 252:return"AXFR";case 251:return"IXFR";case 41:return"OPT";case 255:return"ANY"}return"UNKNOWN_"+e};xh.toType=function(e){switch(e.toUpperCase()){case"A":return 1;case"NULL":return 10;case"AAAA":return 28;case"AFSDB":return 18;case"APL":return 42;case"CAA":return 257;case"CDNSKEY":return 60;case"CDS":return 59;case"CERT":return 37;case"CNAME":return 5;case"DHCID":return 49;case"DLV":return 32769;case"DNAME":return 39;case"DNSKEY":return 48;case"DS":return 43;case"HIP":return 55;case"HINFO":return 13;case"IPSECKEY":return 45;case"KEY":return 25;case"KX":return 36;case"LOC":return 29;case"MX":return 15;case"NAPTR":return 35;case"NS":return 2;case"NSEC":return 47;case"NSEC3":return 50;case"NSEC3PARAM":return 51;case"PTR":return 12;case"RRSIG":return 46;case"RP":return 17;case"SIG":return 24;case"SOA":return 6;case"SPF":return 99;case"SRV":return 33;case"SSHFP":return 44;case"TA":return 32768;case"TKEY":return 249;case"TLSA":return 52;case"TSIG":return 250;case"TXT":return 16;case"AXFR":return 252;case"IXFR":return 251;case"OPT":return 41;case"ANY":return 255;case"*":return 255}return e.toUpperCase().startsWith("UNKNOWN_")?parseInt(e.slice(8)):0}});var Q0=ie(kh=>{"use strict";kh.toString=function(e){switch(e){case 0:return"NOERROR";case 1:return"FORMERR";case 2:return"SERVFAIL";case 3:return"NXDOMAIN";case 4:return"NOTIMP";case 5:return"REFUSED";case 6:return"YXDOMAIN";case 7:return"YXRRSET";case 8:return"NXRRSET";case 9:return"NOTAUTH";case 10:return"NOTZONE";case 11:return"RCODE_11";case 12:return"RCODE_12";case 13:return"RCODE_13";case 14:return"RCODE_14";case 15:return"RCODE_15"}return"RCODE_"+e};kh.toRcode=function(e){switch(e.toUpperCase()){case"NOERROR":return 0;case"FORMERR":return 1;case"SERVFAIL":return 2;case"NXDOMAIN":return 3;case"NOTIMP":return 4;case"REFUSED":return 5;case"YXDOMAIN":return 6;case"YXRRSET":return 7;case"NXRRSET":return 8;case"NOTAUTH":return 9;case"NOTZONE":return 10;case"RCODE_11":return 11;case"RCODE_12":return 12;case"RCODE_13":return 13;case"RCODE_14":return 14;case"RCODE_15":return 15}return 0}});var eS=ie(wh=>{"use strict";wh.toString=function(e){switch(e){case 0:return"QUERY";case 1:return"IQUERY";case 2:return"STATUS";case 3:return"OPCODE_3";case 4:return"NOTIFY";case 5:return"UPDATE";case 6:return"OPCODE_6";case 7:return"OPCODE_7";case 8:return"OPCODE_8";case 9:return"OPCODE_9";case 10:return"OPCODE_10";case 11:return"OPCODE_11";case 12:return"OPCODE_12";case 13:return"OPCODE_13";case 14:return"OPCODE_14";case 15:return"OPCODE_15"}return"OPCODE_"+e};wh.toOpcode=function(e){switch(e.toUpperCase()){case"QUERY":return 0;case"IQUERY":return 1;case"STATUS":return 2;case"OPCODE_3":return 3;case"NOTIFY":return 4;case"UPDATE":return 5;case"OPCODE_6":return 6;case"OPCODE_7":return 7;case"OPCODE_8":return 8;case"OPCODE_9":return 9;case"OPCODE_10":return 10;case"OPCODE_11":return 11;case"OPCODE_12":return 12;case"OPCODE_13":return 13;case"OPCODE_14":return 14;case"OPCODE_15":return 15}return 0}});var tS=ie(Sh=>{"use strict";Sh.toString=function(e){switch(e){case 1:return"IN";case 2:return"CS";case 3:return"CH";case 4:return"HS";case 255:return"ANY"}return"UNKNOWN_"+e};Sh.toClass=function(e){switch(e.toUpperCase()){case"IN":return 1;case"CS":return 2;case"CH":return 3;case"HS":return 4;case"ANY":return 255}return 0}});var nS=ie(_h=>{"use strict";_h.toString=function(e){switch(e){case 1:return"LLQ";case 2:return"UL";case 3:return"NSID";case 5:return"DAU";case 6:return"DHU";case 7:return"N3U";case 8:return"CLIENT_SUBNET";case 9:return"EXPIRE";case 10:return"COOKIE";case 11:return"TCP_KEEPALIVE";case 12:return"PADDING";case 13:return"CHAIN";case 14:return"KEY_TAG";case 26946:return"DEVICEID"}return e<0?null:`OPTION_${e}`};_h.toCode=function(e){if(typeof e=="number")return e;if(!e)return-1;switch(e.toUpperCase()){case"OPTION_0":return 0;case"LLQ":return 1;case"UL":return 2;case"NSID":return 3;case"OPTION_4":return 4;case"DAU":return 5;case"DHU":return 6;case"N3U":return 7;case"CLIENT_SUBNET":return 8;case"EXPIRE":return 9;case"COOKIE":return 10;case"TCP_KEEPALIVE":return 11;case"PADDING":return 12;case"CHAIN":return 13;case"KEY_TAG":return 14;case"DEVICEID":return 26946;case"OPTION_65535":return 65535}let t=e.match(/_(\d+)$/);return t?parseInt(t[1],10):-1}});var iS=ie((oS,$h)=>{var rS=(function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decode=d,e.encode=p,e.familyOf=u,e.name=void 0,e.sizeOf=l,e.v6=e.v4=void 0;let t=/^(\d{1,3}\.){3,3}\d{1,3}$/,r=4,o=/^(::)?(((\d{1,3}\.){3}(\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?$/i,n=16,i={name:"v4",size:r,isFormat:m=>t.test(m),encode(m,f,g){g=~~g,f=f||new Uint8Array(g+r);let h=m.length,v=0;for(let k=0;k<h;){let S=m.charCodeAt(k++);S===46?(f[g++]=v,v=0):v=v*10+(S-48)}return f[g]=v,f},decode(m,f){return f=~~f,`${m[f++]}.${m[f++]}.${m[f++]}.${m[f]}`}};e.v4=i;let s={name:"v6",size:n,isFormat:m=>m.length>0&&o.test(m),encode(m,f,g){g=~~g;let h=g+n,v=-1,k=0,S=0,I=!0,_=!1;f=f||new Uint8Array(g+n);for(let C=0;C<m.length;C++){let z=m.charCodeAt(C);z===58?(I?v!==-1?(g<h&&(f[g]=0),g<h-1&&(f[g+1]=0),g+=2):g<h&&(v=g):(_===!0?(g<h&&(f[g]=S),g++):(g<h&&(f[g]=k>>8),g<h-1&&(f[g+1]=k&255),g+=2),k=0,S=0),I=!0,_=!1):z===46?(g<h&&(f[g]=S),g++,S=0,k=0,I=!1,_=!0):(I=!1,z>=97?z-=87:z>=65?z-=55:(z-=48,S=S*10+z),k=(k<<4)+z)}if(I===!1)_===!0?(g<h&&(f[g]=S),g++):(g<h&&(f[g]=k>>8),g<h-1&&(f[g+1]=k&255),g+=2);else if(v===0)g<h&&(f[g]=0),g<h-1&&(f[g+1]=0),g+=2;else if(v!==-1){g+=2;for(let C=Math.min(g-1,h-1);C>=v+2;C--)f[C]=f[C-2];f[v]=0,f[v+1]=0,v=g}if(v!==g&&v!==-1)for(g>h-2&&(g=h-2);h>v;)f[--h]=g<h&&g>v?f[--g]:0;else for(;g<h;)f[g++]=0;return f},decode(m,f){f=~~f;let g="";for(let h=0;h<n;h+=2)h!==0&&(g+=":"),g+=(m[f+h]<<8|m[f+h+1]).toString(16);return g.replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3").replace(/:{3,4}/,"::")}};e.v6=s;let a="ip";e.name=a;function l(m){if(i.isFormat(m))return i.size;if(s.isFormat(m))return s.size;throw Error(`Invalid ip address: ${m}`)}function u(m){return l(m)===i.size?1:2}function p(m,f,g){g=~~g;let h=l(m);return typeof f=="function"&&(f=f(g+h)),h===i.size?i.encode(m,f,g):s.encode(m,f,g)}function d(m,f,g){if(f=~~f,g=g||m.length-f,g===i.size)return i.decode(m,f,g);if(g===s.size)return s.decode(m,f,g);throw Error(`Invalid buffer size needs to be ${i.size} for v4 or ${s.size} for v6.`)}return"default"in e?e.default:e})({});typeof define=="function"&&define.amd?define([],function(){return rS}):typeof $h=="object"&&typeof oS=="object"&&($h.exports=rS)});var cS=ie(H=>{"use strict";var Z=ue("buffer").Buffer,En=Y0(),vN=Q0(),bN=eS(),Rl=tS(),Ih=nS(),Tr=iS(),yN=0,sS=32768,Eh=32768,xN=~Eh,aS=32768,kN=~aS,U=H.name={};U.encode=function(e,t,r,{mail:o=!1}={}){t||(t=Z.alloc(U.encodingLength(e))),r||(r=0);let n=r,i=e.replace(/^\.|\.$/gm,"");if(i.length){let s=[];if(o){let a="";i.split(".").forEach(l=>{l.endsWith("\\")?a+=(a.length?".":"")+l.slice(0,-1):s.length===0&&a.length?s.push(a+"."+l):s.push(l)})}else s=i.split(".");for(let a=0;a<s.length;a++){let l=t.write(s[a],r+1);t[r]=l,r+=l+1}}return t[r++]=0,U.encode.bytes=r-n,t};U.encode.bytes=0;U.decode=function(e,t,{mail:r=!1}={}){t||(t=0);let o=[],n=t,i=0,s=0,a=!1;for(;;){if(t>=e.length)throw new Error("Cannot decode name (buffer overflow)");let l=e[t++];if(s+=a?0:1,l===0)break;if((l&192)===0){if(t+l>e.length)throw new Error("Cannot decode name (buffer overflow)");if(i+=l+1,i>254)throw new Error("Cannot decode name (name too long)");let u=e.toString("utf-8",t,t+l);r&&(u=u.replace(/\./g,"\\.")),o.push(u),t+=l,s+=a?0:l}else if((l&192)===192){if(t+1>e.length)throw new Error("Cannot decode name (buffer overflow)");let u=e.readUInt16BE(t-1)-49152;if(u>=n)throw new Error("Cannot decode name (bad pointer)");t=u,n=u,s+=a?0:1,a=!0}else throw new Error("Cannot decode name (bad label)")}return U.decode.bytes=s,o.length===0?".":o.join(".")};U.decode.bytes=0;U.encodingLength=function(e){return e==="."||e===".."?1:Z.byteLength(e.replace(/^\.|\.$/gm,""))+2};var ne={};ne.encode=function(e,t,r){t||(t=Z.alloc(ne.encodingLength(e))),r||(r=0);let o=t.write(e,r+1);return t[r]=o,ne.encode.bytes=o+1,t};ne.encode.bytes=0;ne.decode=function(e,t){t||(t=0);let r=e[t],o=e.toString("utf-8",t+1,t+1+r);return ne.decode.bytes=r+1,o};ne.decode.bytes=0;ne.encodingLength=function(e){return Z.byteLength(e)+1};var Ot={};Ot.encode=function(e,t,r){t||(t=Ot.encodingLength(e)),r||(r=0);let o=(e.flags||0)&32767,n=e.type==="response"?sS:yN;return t.writeUInt16BE(e.id||0,r),t.writeUInt16BE(o|n,r+2),t.writeUInt16BE(e.questions.length,r+4),t.writeUInt16BE(e.answers.length,r+6),t.writeUInt16BE(e.authorities.length,r+8),t.writeUInt16BE(e.additionals.length,r+10),t};Ot.encode.bytes=12;Ot.decode=function(e,t){if(t||(t=0),e.length<12)throw new Error("Header must be 12 bytes");let r=e.readUInt16BE(t+2);return{id:e.readUInt16BE(t),type:r&sS?"response":"query",flags:r&32767,flag_qr:(r>>15&1)===1,opcode:bN.toString(r>>11&15),flag_aa:(r>>10&1)===1,flag_tc:(r>>9&1)===1,flag_rd:(r>>8&1)===1,flag_ra:(r>>7&1)===1,flag_z:(r>>6&1)===1,flag_ad:(r>>5&1)===1,flag_cd:(r>>4&1)===1,rcode:vN.toString(r&15),questions:new Array(e.readUInt16BE(t+4)),answers:new Array(e.readUInt16BE(t+6)),authorities:new Array(e.readUInt16BE(t+8)),additionals:new Array(e.readUInt16BE(t+10))}};Ot.decode.bytes=12;Ot.encodingLength=function(){return 12};var bn=H.unknown={};bn.encode=function(e,t,r){return t||(t=Z.alloc(bn.encodingLength(e))),r||(r=0),t.writeUInt16BE(e.length,r),e.copy(t,r+2),bn.encode.bytes=e.length+2,t};bn.encode.bytes=0;bn.decode=function(e,t){t||(t=0);let r=e.readUInt16BE(t),o=e.slice(t+2,t+2+r);return bn.decode.bytes=r+2,o};bn.decode.bytes=0;bn.encodingLength=function(e){return e.length+2};var yn=H.ns={};yn.encode=function(e,t,r){return t||(t=Z.alloc(yn.encodingLength(e))),r||(r=0),U.encode(e,t,r+2),t.writeUInt16BE(U.encode.bytes,r),yn.encode.bytes=U.encode.bytes+2,t};yn.encode.bytes=0;yn.decode=function(e,t){t||(t=0);let r=e.readUInt16BE(t),o=U.decode(e,t+2);return yn.decode.bytes=r+2,o};yn.decode.bytes=0;yn.encodingLength=function(e){return U.encodingLength(e)+2};var xn=H.soa={};xn.encode=function(e,t,r){t||(t=Z.alloc(xn.encodingLength(e))),r||(r=0);let o=r;return r+=2,U.encode(e.mname,t,r),r+=U.encode.bytes,U.encode(e.rname,t,r,{mail:!0}),r+=U.encode.bytes,t.writeUInt32BE(e.serial||0,r),r+=4,t.writeUInt32BE(e.refresh||0,r),r+=4,t.writeUInt32BE(e.retry||0,r),r+=4,t.writeUInt32BE(e.expire||0,r),r+=4,t.writeUInt32BE(e.minimum||0,r),r+=4,t.writeUInt16BE(r-o-2,o),xn.encode.bytes=r-o,t};xn.encode.bytes=0;xn.decode=function(e,t){t||(t=0);let r=t,o={};return t+=2,o.mname=U.decode(e,t),t+=U.decode.bytes,o.rname=U.decode(e,t,{mail:!0}),t+=U.decode.bytes,o.serial=e.readUInt32BE(t),t+=4,o.refresh=e.readUInt32BE(t),t+=4,o.retry=e.readUInt32BE(t),t+=4,o.expire=e.readUInt32BE(t),t+=4,o.minimum=e.readUInt32BE(t),t+=4,xn.decode.bytes=t-r,o};xn.decode.bytes=0;xn.encodingLength=function(e){return 22+U.encodingLength(e.mname)+U.encodingLength(e.rname)};var kn=H.txt={};kn.encode=function(e,t,r){Array.isArray(e)||(e=[e]);for(let n=0;n<e.length;n++)if(typeof e[n]=="string"&&(e[n]=Z.from(e[n])),!Z.isBuffer(e[n]))throw new Error("Must be a Buffer");t||(t=Z.alloc(kn.encodingLength(e))),r||(r=0);let o=r;return r+=2,e.forEach(function(n){t[r++]=n.length,n.copy(t,r,0,n.length),r+=n.length}),t.writeUInt16BE(r-o-2,o),kn.encode.bytes=r-o,t};kn.encode.bytes=0;kn.decode=function(e,t){t||(t=0);let r=t,o=e.readUInt16BE(t);t+=2;let n=[];for(;o>0;){let i=e[t++];if(--o,o<i)throw new Error("Buffer overflow");n.push(e.slice(t,t+i)),t+=i,o-=i}return kn.decode.bytes=t-r,n};kn.decode.bytes=0;kn.encodingLength=function(e){Array.isArray(e)||(e=[e]);let t=2;return e.forEach(function(r){typeof r=="string"?t+=Z.byteLength(r)+1:t+=r.length+1}),t};var wn=H.null={};wn.encode=function(e,t,r){t||(t=Z.alloc(wn.encodingLength(e))),r||(r=0),typeof e=="string"&&(e=Z.from(e)),e||(e=Z.alloc(0));let o=r;r+=2;let n=e.length;return e.copy(t,r,0,n),r+=n,t.writeUInt16BE(r-o-2,o),wn.encode.bytes=r-o,t};wn.encode.bytes=0;wn.decode=function(e,t){t||(t=0);let r=t,o=e.readUInt16BE(t);t+=2;let n=e.slice(t,t+o);return t+=o,wn.decode.bytes=t-r,n};wn.decode.bytes=0;wn.encodingLength=function(e){return e?(Z.isBuffer(e)?e.length:Z.byteLength(e))+2:2};var Sn=H.hinfo={};Sn.encode=function(e,t,r){t||(t=Z.alloc(Sn.encodingLength(e))),r||(r=0);let o=r;return r+=2,ne.encode(e.cpu,t,r),r+=ne.encode.bytes,ne.encode(e.os,t,r),r+=ne.encode.bytes,t.writeUInt16BE(r-o-2,o),Sn.encode.bytes=r-o,t};Sn.encode.bytes=0;Sn.decode=function(e,t){t||(t=0);let r=t,o={};return t+=2,o.cpu=ne.decode(e,t),t+=ne.decode.bytes,o.os=ne.decode(e,t),t+=ne.decode.bytes,Sn.decode.bytes=t-r,o};Sn.decode.bytes=0;Sn.encodingLength=function(e){return ne.encodingLength(e.cpu)+ne.encodingLength(e.os)+2};var Tt=H.ptr={},wN=H.cname=Tt,SN=H.dname=Tt;Tt.encode=function(e,t,r){return t||(t=Z.alloc(Tt.encodingLength(e))),r||(r=0),U.encode(e,t,r+2),t.writeUInt16BE(U.encode.bytes,r),Tt.encode.bytes=U.encode.bytes+2,t};Tt.encode.bytes=0;Tt.decode=function(e,t){t||(t=0);let r=U.decode(e,t+2);return Tt.decode.bytes=U.decode.bytes+2,r};Tt.decode.bytes=0;Tt.encodingLength=function(e){return U.encodingLength(e)+2};var _n=H.srv={};_n.encode=function(e,t,r){t||(t=Z.alloc(_n.encodingLength(e))),r||(r=0),t.writeUInt16BE(e.priority||0,r+2),t.writeUInt16BE(e.weight||0,r+4),t.writeUInt16BE(e.port||0,r+6),U.encode(e.target,t,r+8);let o=U.encode.bytes+6;return t.writeUInt16BE(o,r),_n.encode.bytes=o+2,t};_n.encode.bytes=0;_n.decode=function(e,t){t||(t=0);let r=e.readUInt16BE(t),o={};return o.priority=e.readUInt16BE(t+2),o.weight=e.readUInt16BE(t+4),o.port=e.readUInt16BE(t+6),o.target=U.decode(e,t+8),_n.decode.bytes=r+2,o};_n.decode.bytes=0;_n.encodingLength=function(e){return 8+U.encodingLength(e.target)};var lt=H.caa={};lt.ISSUER_CRITICAL=128;lt.encode=function(e,t,r){let o=lt.encodingLength(e);return t||(t=Z.alloc(lt.encodingLength(e))),r||(r=0),e.issuerCritical&&(e.flags=lt.ISSUER_CRITICAL),t.writeUInt16BE(o-2,r),r+=2,t.writeUInt8(e.flags||0,r),r+=1,ne.encode(e.tag,t,r),r+=ne.encode.bytes,t.write(e.value,r),r+=Z.byteLength(e.value),lt.encode.bytes=o,t};lt.encode.bytes=0;lt.decode=function(e,t){t||(t=0);let r=e.readUInt16BE(t);t+=2;let o=t,n={};return n.flags=e.readUInt8(t),t+=1,n.tag=ne.decode(e,t),t+=ne.decode.bytes,n.value=e.toString("utf-8",t,o+r),n.issuerCritical=!!(n.flags<.ISSUER_CRITICAL),lt.decode.bytes=r+2,n};lt.decode.bytes=0;lt.encodingLength=function(e){return ne.encodingLength(e.tag)+ne.encodingLength(e.value)+2};var Qn=H.mx={};Qn.encode=function(e,t,r){t||(t=Z.alloc(Qn.encodingLength(e))),r||(r=0);let o=r;return r+=2,t.writeUInt16BE(e.preference||0,r),r+=2,U.encode(e.exchange,t,r),r+=U.encode.bytes,t.writeUInt16BE(r-o-2,o),Qn.encode.bytes=r-o,t};Qn.encode.bytes=0;Qn.decode=function(e,t){t||(t=0);let r=t,o={};return t+=2,o.preference=e.readUInt16BE(t),t+=2,o.exchange=U.decode(e,t),t+=U.decode.bytes,Qn.decode.bytes=t-r,o};Qn.encodingLength=function(e){return 4+U.encodingLength(e.exchange)};var $n=H.a={};$n.encode=function(e,t,r){return t||(t=Z.alloc($n.encodingLength(e))),r||(r=0),t.writeUInt16BE(4,r),r+=2,Tr.v4.encode(e,t,r),$n.encode.bytes=6,t};$n.encode.bytes=0;$n.decode=function(e,t){t||(t=0),t+=2;let r=Tr.v4.decode(e,t);return $n.decode.bytes=6,r};$n.decode.bytes=0;$n.encodingLength=function(){return 6};var In=H.aaaa={};In.encode=function(e,t,r){return t||(t=Z.alloc(In.encodingLength(e))),r||(r=0),t.writeUInt16BE(16,r),r+=2,Tr.v6.encode(e,t,r),In.encode.bytes=18,t};In.encode.bytes=0;In.decode=function(e,t){t||(t=0),t+=2;let r=Tr.v6.decode(e,t);return In.decode.bytes=18,r};In.decode.bytes=0;In.encodingLength=function(){return 18};var rt=H.option={};rt.encode=function(e,t,r){t||(t=Z.alloc(rt.encodingLength(e))),r||(r=0);let o=r,n=Ih.toCode(e.code);if(t.writeUInt16BE(n,r),r+=2,e.data)t.writeUInt16BE(e.data.length,r),r+=2,e.data.copy(t,r),r+=e.data.length;else switch(n){case 8:let i=e.sourcePrefixLength||0,s=e.family||Tr.familyOf(e.ip),a=Tr.encode(e.ip,Z.alloc),l=Math.ceil(i/8);t.writeUInt16BE(l+4,r),r+=2,t.writeUInt16BE(s,r),r+=2,t.writeUInt8(i,r++),t.writeUInt8(e.scopePrefixLength||0,r++),a.copy(t,r,0,l),r+=l;break;case 11:e.timeout?(t.writeUInt16BE(2,r),r+=2,t.writeUInt16BE(e.timeout,r),r+=2):(t.writeUInt16BE(0,r),r+=2);break;case 12:let u=e.length||0;t.writeUInt16BE(u,r),r+=2,t.fill(0,r,r+u),r+=u;break;case 14:let p=e.tags.length*2;t.writeUInt16BE(p,r),r+=2;for(let d of e.tags)t.writeUInt16BE(d,r),r+=2;break;default:throw new Error(`Unknown roption code: ${e.code}`)}return rt.encode.bytes=r-o,t};rt.encode.bytes=0;rt.decode=function(e,t){t||(t=0);let r={};r.code=e.readUInt16BE(t),r.type=Ih.toString(r.code),t+=2;let o=e.readUInt16BE(t);switch(t+=2,r.data=e.slice(t,t+o),r.code){case 8:r.family=e.readUInt16BE(t),t+=2,r.sourcePrefixLength=e.readUInt8(t++),r.scopePrefixLength=e.readUInt8(t++);let n=Z.alloc(r.family===1?4:16);e.copy(n,0,t,t+o-4),r.ip=Tr.decode(n);break;case 11:o>0&&(r.timeout=e.readUInt16BE(t),t+=2);break;case 14:r.tags=[];for(let i=0;i<o;i+=2)r.tags.push(e.readUInt16BE(t)),t+=2}return rt.decode.bytes=o+4,r};rt.decode.bytes=0;rt.encodingLength=function(e){if(e.data)return e.data.length+4;switch(Ih.toCode(e.code)){case 8:let r=e.sourcePrefixLength||0;return Math.ceil(r/8)+8;case 11:return typeof e.timeout=="number"?6:4;case 12:return e.length+4;case 14:return 4+e.tags.length*2}throw new Error(`Unknown roption code: ${e.code}`)};var dt=H.opt={};dt.encode=function(e,t,r){t||(t=Z.alloc(dt.encodingLength(e))),r||(r=0);let o=r,n=Jo(e,rt);return t.writeUInt16BE(n,r),r=hs(e,rt,t,r+2),dt.encode.bytes=r-o,t};dt.encode.bytes=0;dt.decode=function(e,t){t||(t=0);let r=t,o=[],n=e.readUInt16BE(t);t+=2;let i=0;for(;n>0;)o[i++]=rt.decode(e,t),t+=rt.decode.bytes,n-=rt.decode.bytes;return dt.decode.bytes=t-r,o};dt.decode.bytes=0;dt.encodingLength=function(e){return 2+Jo(e||[],rt)};var Je=H.dnskey={};Je.PROTOCOL_DNSSEC=3;Je.ZONE_KEY=128;Je.SECURE_ENTRYPOINT=32768;Je.encode=function(e,t,r){t||(t=Z.alloc(Je.encodingLength(e))),r||(r=0);let o=r,n=e.key;if(!Z.isBuffer(n))throw new Error("Key must be a Buffer");return r+=2,t.writeUInt16BE(e.flags,r),r+=2,t.writeUInt8(Je.PROTOCOL_DNSSEC,r),r+=1,t.writeUInt8(e.algorithm,r),r+=1,n.copy(t,r,0,n.length),r+=n.length,Je.encode.bytes=r-o,t.writeUInt16BE(Je.encode.bytes-2,o),t};Je.encode.bytes=0;Je.decode=function(e,t){t||(t=0);let r=t;var o={},n=e.readUInt16BE(t);if(t+=2,o.flags=e.readUInt16BE(t),t+=2,e.readUInt8(t)!==Je.PROTOCOL_DNSSEC)throw new Error("Protocol must be 3");return t+=1,o.algorithm=e.readUInt8(t),t+=1,o.key=e.slice(t,r+n+2),t+=o.key.length,Je.decode.bytes=t-r,o};Je.decode.bytes=0;Je.encodingLength=function(e){return 6+Z.byteLength(e.key)};var Vt=H.rrsig={};Vt.encode=function(e,t,r){t||(t=Z.alloc(Vt.encodingLength(e))),r||(r=0);let o=r,n=e.signature;if(!Z.isBuffer(n))throw new Error("Signature must be a Buffer");return r+=2,t.writeUInt16BE(En.toType(e.typeCovered),r),r+=2,t.writeUInt8(e.algorithm,r),r+=1,t.writeUInt8(e.labels,r),r+=1,t.writeUInt32BE(e.originalTTL,r),r+=4,t.writeUInt32BE(e.expiration,r),r+=4,t.writeUInt32BE(e.inception,r),r+=4,t.writeUInt16BE(e.keyTag,r),r+=2,U.encode(e.signersName,t,r),r+=U.encode.bytes,n.copy(t,r,0,n.length),r+=n.length,Vt.encode.bytes=r-o,t.writeUInt16BE(Vt.encode.bytes-2,o),t};Vt.encode.bytes=0;Vt.decode=function(e,t){t||(t=0);let r=t;var o={},n=e.readUInt16BE(t);return t+=2,o.typeCovered=En.toString(e.readUInt16BE(t)),t+=2,o.algorithm=e.readUInt8(t),t+=1,o.labels=e.readUInt8(t),t+=1,o.originalTTL=e.readUInt32BE(t),t+=4,o.expiration=e.readUInt32BE(t),t+=4,o.inception=e.readUInt32BE(t),t+=4,o.keyTag=e.readUInt16BE(t),t+=2,o.signersName=U.decode(e,t),t+=U.decode.bytes,o.signature=e.slice(t,r+n+2),t+=o.signature.length,Vt.decode.bytes=t-r,o};Vt.decode.bytes=0;Vt.encodingLength=function(e){return 20+U.encodingLength(e.signersName)+Z.byteLength(e.signature)};var Jt=H.rp={};Jt.encode=function(e,t,r){t||(t=Z.alloc(Jt.encodingLength(e))),r||(r=0);let o=r;return r+=2,U.encode(e.mbox||".",t,r,{mail:!0}),r+=U.encode.bytes,U.encode(e.txt||".",t,r),r+=U.encode.bytes,Jt.encode.bytes=r-o,t.writeUInt16BE(Jt.encode.bytes-2,o),t};Jt.encode.bytes=0;Jt.decode=function(e,t){t||(t=0);let r=t,o={};return t+=2,o.mbox=U.decode(e,t,{mail:!0})||".",t+=U.decode.bytes,o.txt=U.decode(e,t)||".",t+=U.decode.bytes,Jt.decode.bytes=t-r,o};Jt.decode.bytes=0;Jt.encodingLength=function(e){return 2+U.encodingLength(e.mbox||".")+U.encodingLength(e.txt||".")};var Re={};Re.encode=function(e,t,r){t||(t=Z.alloc(Re.encodingLength(e))),r||(r=0);let o=r;for(var n=[],i=0;i<e.length;i++){var s=En.toType(e[i]);n[s>>8]===void 0&&(n[s>>8]=[]),n[s>>8][s>>3&31]|=1<<7-(s&7)}for(i=0;i<n.length;i++)if(n[i]!==void 0){var a=Z.from(n[i]);t.writeUInt8(i,r),r+=1,t.writeUInt8(a.length,r),r+=1,a.copy(t,r),r+=a.length}return Re.encode.bytes=r-o,t};Re.encode.bytes=0;Re.decode=function(e,t,r){t||(t=0);let o=t;for(var n=[];t-o<r;){var i=e.readUInt8(t);t+=1;var s=e.readUInt8(t);t+=1;for(var a=0;a<s;a++)for(var l=e.readUInt8(t+a),u=0;u<8;u++)if(l&1<<7-u){var p=En.toString(i<<8|a<<3|u);n.push(p)}t+=s}return Re.decode.bytes=t-o,n};Re.decode.bytes=0;Re.encodingLength=function(e){for(var t=[],r=0;r<e.length;r++){var o=En.toType(e[r]);t[o>>8]=Math.max(t[o>>8]||0,o&255)}var n=0;for(r=0;r<t.length;r++)t[r]!==void 0&&(n+=2+Math.ceil((t[r]+1)/8));return n};var qt=H.nsec={};qt.encode=function(e,t,r){t||(t=Z.alloc(qt.encodingLength(e))),r||(r=0);let o=r;return r+=2,U.encode(e.nextDomain,t,r),r+=U.encode.bytes,Re.encode(e.rrtypes,t,r),r+=Re.encode.bytes,qt.encode.bytes=r-o,t.writeUInt16BE(qt.encode.bytes-2,o),t};qt.encode.bytes=0;qt.decode=function(e,t){t||(t=0);let r=t;var o={},n=e.readUInt16BE(t);return t+=2,o.nextDomain=U.decode(e,t),t+=U.decode.bytes,o.rrtypes=Re.decode(e,t,n-(t-r)),t+=Re.decode.bytes,qt.decode.bytes=t-r,o};qt.decode.bytes=0;qt.encodingLength=function(e){return 2+U.encodingLength(e.nextDomain)+Re.encodingLength(e.rrtypes)};var Kt=H.nsec3={};Kt.encode=function(e,t,r){t||(t=Z.alloc(Kt.encodingLength(e))),r||(r=0);let o=r,n=e.salt;if(!Z.isBuffer(n))throw new Error("salt must be a Buffer");let i=e.nextDomain;if(!Z.isBuffer(i))throw new Error("nextDomain must be a Buffer");return r+=2,t.writeUInt8(e.algorithm,r),r+=1,t.writeUInt8(e.flags,r),r+=1,t.writeUInt16BE(e.iterations,r),r+=2,t.writeUInt8(n.length,r),r+=1,n.copy(t,r,0,n.length),r+=n.length,t.writeUInt8(i.length,r),r+=1,i.copy(t,r,0,i.length),r+=i.length,Re.encode(e.rrtypes,t,r),r+=Re.encode.bytes,Kt.encode.bytes=r-o,t.writeUInt16BE(Kt.encode.bytes-2,o),t};Kt.encode.bytes=0;Kt.decode=function(e,t){t||(t=0);let r=t;var o={},n=e.readUInt16BE(t);t+=2,o.algorithm=e.readUInt8(t),t+=1,o.flags=e.readUInt8(t),t+=1,o.iterations=e.readUInt16BE(t),t+=2;let i=e.readUInt8(t);t+=1,o.salt=e.slice(t,t+i),t+=i;let s=e.readUInt8(t);return t+=1,o.nextDomain=e.slice(t,t+s),t+=s,o.rrtypes=Re.decode(e,t,n-(t-r)),t+=Re.decode.bytes,Kt.decode.bytes=t-r,o};Kt.decode.bytes=0;Kt.encodingLength=function(e){return 8+e.salt.length+e.nextDomain.length+Re.encodingLength(e.rrtypes)};var Xt=H.ds={};Xt.encode=function(e,t,r){t||(t=Z.alloc(Xt.encodingLength(e))),r||(r=0);let o=r,n=e.digest;if(!Z.isBuffer(n))throw new Error("Digest must be a Buffer");return r+=2,t.writeUInt16BE(e.keyTag,r),r+=2,t.writeUInt8(e.algorithm,r),r+=1,t.writeUInt8(e.digestType,r),r+=1,n.copy(t,r,0,n.length),r+=n.length,Xt.encode.bytes=r-o,t.writeUInt16BE(Xt.encode.bytes-2,o),t};Xt.encode.bytes=0;Xt.decode=function(e,t){t||(t=0);let r=t;var o={},n=e.readUInt16BE(t);return t+=2,o.keyTag=e.readUInt16BE(t),t+=2,o.algorithm=e.readUInt8(t),t+=1,o.digestType=e.readUInt8(t),t+=1,o.digest=e.slice(t,r+n+2),t+=o.digest.length,Xt.decode.bytes=t-r,o};Xt.decode.bytes=0;Xt.encodingLength=function(e){return 6+Z.byteLength(e.digest)};var ut=H.sshfp={};ut.getFingerprintLengthForHashType=function(t){switch(t){case 1:return 20;case 2:return 32}};ut.encode=function(t,r,o){r||(r=Z.alloc(ut.encodingLength(t))),o||(o=0);let n=o;o+=2,r[o]=t.algorithm,o+=1,r[o]=t.hash,o+=1;let i=Z.from(t.fingerprint.toUpperCase(),"hex");if(i.length!==ut.getFingerprintLengthForHashType(t.hash))throw new Error("Invalid fingerprint length");return i.copy(r,o),o+=i.byteLength,ut.encode.bytes=o-n,r.writeUInt16BE(ut.encode.bytes-2,n),r};ut.encode.bytes=0;ut.decode=function(t,r){r||(r=0);let o=r,n={};r+=2,n.algorithm=t[r],r+=1,n.hash=t[r],r+=1;let i=ut.getFingerprintLengthForHashType(n.hash);return n.fingerprint=t.slice(r,r+i).toString("hex").toUpperCase(),r+=i,ut.decode.bytes=r-o,n};ut.decode.bytes=0;ut.encodingLength=function(e){return 4+Z.from(e.fingerprint,"hex").byteLength};var Yt=H.naptr={};Yt.encode=function(e,t,r){t||(t=Z.alloc(Yt.encodingLength(e))),r||(r=0);let o=r;return r+=2,t.writeUInt16BE(e.order||0,r),r+=2,t.writeUInt16BE(e.preference||0,r),r+=2,ne.encode(e.flags,t,r),r+=ne.encode.bytes,ne.encode(e.services,t,r),r+=ne.encode.bytes,ne.encode(e.regexp,t,r),r+=ne.encode.bytes,U.encode(e.replacement,t,r),r+=U.encode.bytes,Yt.encode.bytes=r-o,t.writeUInt16BE(Yt.encode.bytes-2,o),t};Yt.encode.bytes=0;Yt.decode=function(e,t){t||(t=0);let r=t,o={};return t+=2,o.order=e.readUInt16BE(t),t+=2,o.preference=e.readUInt16BE(t),t+=2,o.flags=ne.decode(e,t),t+=ne.decode.bytes,o.services=ne.decode(e,t),t+=ne.decode.bytes,o.regexp=ne.decode(e,t),t+=ne.decode.bytes,o.replacement=U.decode(e,t),t+=U.decode.bytes,Yt.decode.bytes=t-r,o};Yt.decode.bytes=0;Yt.encodingLength=function(e){return ne.encodingLength(e.flags)+ne.encodingLength(e.services)+ne.encodingLength(e.regexp)+U.encodingLength(e.replacement)+6};var Qt=H.tlsa={};Qt.encode=function(e,t,r){t||(t=Z.alloc(Qt.encodingLength(e))),r||(r=0);let o=r,n=e.certificate;if(!Z.isBuffer(n))throw new Error("Certificate must be a Buffer");return r+=2,t.writeUInt8(e.usage,r),r+=1,t.writeUInt8(e.selector,r),r+=1,t.writeUInt8(e.matchingType,r),r+=1,n.copy(t,r,0,n.length),r+=n.length,Qt.encode.bytes=r-o,t.writeUInt16BE(Qt.encode.bytes-2,o),t};Qt.encode.bytes=0;Qt.decode=function(e,t){t||(t=0);let r=t,o={},n=e.readUInt16BE(t);return t+=2,o.usage=e.readUInt8(t),t+=1,o.selector=e.readUInt8(t),t+=1,o.matchingType=e.readUInt8(t),t+=1,o.certificate=e.slice(t,r+n+2),t+=o.certificate.length,Qt.decode.bytes=t-r,o};Qt.decode.bytes=0;Qt.encodingLength=function(e){return 5+Z.byteLength(e.certificate)};var Ah=H.record=function(e){switch(e.toUpperCase()){case"A":return $n;case"PTR":return Tt;case"CNAME":return wN;case"DNAME":return SN;case"TXT":return kn;case"NULL":return wn;case"AAAA":return In;case"SRV":return _n;case"HINFO":return Sn;case"CAA":return lt;case"NS":return yn;case"SOA":return xn;case"MX":return Qn;case"OPT":return dt;case"DNSKEY":return Je;case"RRSIG":return Vt;case"RP":return Jt;case"NSEC":return qt;case"NSEC3":return Kt;case"SSHFP":return ut;case"DS":return Xt;case"NAPTR":return Yt;case"TLSA":return Qt}return bn},Ue=H.answer={};Ue.encode=function(e,t,r){t||(t=Z.alloc(Ue.encodingLength(e))),r||(r=0);let o=r;if(U.encode(e.name,t,r),r+=U.encode.bytes,t.writeUInt16BE(En.toType(e.type),r),e.type.toUpperCase()==="OPT"){if(e.name!==".")throw new Error("OPT name must be root.");t.writeUInt16BE(e.udpPayloadSize||4096,r+2),t.writeUInt8(e.extendedRcode||0,r+4),t.writeUInt8(e.ednsVersion||0,r+5),t.writeUInt16BE(e.flags||0,r+6),r+=8,dt.encode(e.options||[],t,r),r+=dt.encode.bytes}else{let n=Rl.toClass(e.class===void 0?"IN":e.class);e.flush&&(n|=Eh),t.writeUInt16BE(n,r+2),t.writeUInt32BE(e.ttl||0,r+4),r+=8;let i=Ah(e.type);i.encode(e.data,t,r),r+=i.encode.bytes}return Ue.encode.bytes=r-o,t};Ue.encode.bytes=0;Ue.decode=function(e,t){t||(t=0);let r={},o=t;if(r.name=U.decode(e,t),t+=U.decode.bytes,r.type=En.toString(e.readUInt16BE(t)),r.type==="OPT")r.udpPayloadSize=e.readUInt16BE(t+2),r.extendedRcode=e.readUInt8(t+4),r.ednsVersion=e.readUInt8(t+5),r.flags=e.readUInt16BE(t+6),r.flag_do=(r.flags>>15&1)===1,r.options=dt.decode(e,t+8),t+=8+dt.decode.bytes;else{let n=e.readUInt16BE(t+2);r.ttl=e.readUInt32BE(t+4),r.class=Rl.toString(n&xN),r.flush=!!(n&Eh);let i=Ah(r.type);r.data=i.decode(e,t+8),t+=8+i.decode.bytes}return Ue.decode.bytes=t-o,r};Ue.decode.bytes=0;Ue.encodingLength=function(e){let t=e.data!==null&&e.data!==void 0?e.data:e.options;return U.encodingLength(e.name)+8+Ah(e.type).encodingLength(t)};var Rt=H.question={};Rt.encode=function(e,t,r){t||(t=Z.alloc(Rt.encodingLength(e))),r||(r=0);let o=r;return U.encode(e.name,t,r),r+=U.encode.bytes,t.writeUInt16BE(En.toType(e.type),r),r+=2,t.writeUInt16BE(Rl.toClass(e.class===void 0?"IN":e.class),r),r+=2,Rt.encode.bytes=r-o,e};Rt.encode.bytes=0;Rt.decode=function(e,t){t||(t=0);let r=t,o={};return o.name=U.decode(e,t),t+=U.decode.bytes,o.type=En.toString(e.readUInt16BE(t)),t+=2,o.class=Rl.toString(e.readUInt16BE(t)),t+=2,o.class&aS&&(o.class&=kN),Rt.decode.bytes=t-r,o};Rt.decode.bytes=0;Rt.encodingLength=function(e){return U.encodingLength(e.name)+4};H.AUTHORITATIVE_ANSWER=1024;H.TRUNCATED_RESPONSE=512;H.RECURSION_DESIRED=256;H.RECURSION_AVAILABLE=128;H.AUTHENTIC_DATA=32;H.CHECKING_DISABLED=16;H.DNSSEC_OK=32768;H.encode=function(e,t,r){let o=!t;o&&(t=Z.alloc(H.encodingLength(e))),r||(r=0);let n=r;return e.questions||(e.questions=[]),e.answers||(e.answers=[]),e.authorities||(e.authorities=[]),e.additionals||(e.additionals=[]),Ot.encode(e,t,r),r+=Ot.encode.bytes,r=hs(e.questions,Rt,t,r),r=hs(e.answers,Ue,t,r),r=hs(e.authorities,Ue,t,r),r=hs(e.additionals,Ue,t,r),H.encode.bytes=r-n,o&&H.encode.bytes!==t.length?t.slice(0,H.encode.bytes):t};H.encode.bytes=0;H.decode=function(e,t){t||(t=0);let r=t,o=Ot.decode(e,t);return t+=Ot.decode.bytes,t=Tl(o.questions,Rt,e,t),t=Tl(o.answers,Ue,e,t),t=Tl(o.authorities,Ue,e,t),t=Tl(o.additionals,Ue,e,t),H.decode.bytes=t-r,o};H.decode.bytes=0;H.encodingLength=function(e){return Ot.encodingLength(e)+Jo(e.questions||[],Rt)+Jo(e.answers||[],Ue)+Jo(e.authorities||[],Ue)+Jo(e.additionals||[],Ue)};H.streamEncode=function(e){let t=H.encode(e),r=Z.alloc(2);r.writeUInt16BE(t.byteLength);let o=Z.concat([r,t]);return H.streamEncode.bytes=o.byteLength,o};H.streamEncode.bytes=0;H.streamDecode=function(e){let t=e.readUInt16BE(0);if(e.byteLength<t+2)return null;let r=H.decode(e.slice(2));return H.streamDecode.bytes=H.decode.bytes,r};H.streamDecode.bytes=0;function Jo(e,t){let r=0;for(let o=0;o<e.length;o++)r+=t.encodingLength(e[o]);return r}function hs(e,t,r,o){for(let n=0;n<e.length;n++)t.encode(e[n],r,o),o+=t.encode.bytes;return o}function Tl(e,t,r,o){for(let n=0;n<e.length;n++)e[n]=t.decode(r,o),o+=t.decode.bytes;return o}});var dS=ie((tW,uS)=>{"use strict";var lS=CN;process.nextTick(AN,42);uS.exports=_N;function _N(e){var t=o;return r;function r(n){t(n||IN)}function o(n){var i=[n];t=s,e(a);function s(l){i.push(l)}function a(l){var u=arguments;for(t=$N(l)?o:p;i.length;)p(i.shift());function p(d){lS(EN,d,u)}}}}function $N(e){return Object.prototype.toString.call(e)==="[object Error]"}function IN(){}function EN(e,t){e.apply(null,t)}function AN(e){e===42&&(lS=process.nextTick)}function CN(e,t,r){process.nextTick(function(){e(t,r)})}});var fS=ie((nW,mS)=>{var Ch=cS(),PN=ue("dgram"),TN=dS(),RN=ue("events"),Th=ue("os"),Ph=function(){};mS.exports=function(e){e||(e={});var t=new RN.EventEmitter,r=typeof e.port=="number"?e.port:5353,o=e.type||"udp4",n=e.ip||e.host||(o==="udp4"?"224.0.0.251":null),i={address:n,port:r},s={},a=!1,l=null;if(o==="udp6"&&(!n||!e.interface))throw new Error("For IPv6 multicast you must specify `ip` and `interface`");var u=e.socket||PN.createSocket({type:o,reuseAddr:e.reuseAddr!==!1,toString:function(){return o}});u.on("error",function(d){d.code==="EACCES"||d.code==="EADDRINUSE"?t.emit("error",d):t.emit("warning",d)}),u.on("message",function(d,m){try{d=Ch.decode(d)}catch(f){t.emit("warning",f);return}t.emit("packet",d,m),d.type==="query"&&t.emit("query",d,m),d.type==="response"&&t.emit("response",d,m)}),u.on("listening",function(){r||(r=i.port=u.address().port),e.multicast!==!1&&(t.update(),l=setInterval(t.update,5e3),u.setMulticastTTL(e.ttl||255),u.setMulticastLoopback(e.loopback!==!1))});var p=TN(function(d){if(!r||e.bind===!1)return d(null);u.once("error",d),u.bind(r,e.bind||e.interface,function(){u.removeListener("error",d),d(null)})});return p(function(d){if(d)return t.emit("error",d);t.emit("ready")}),t.send=function(d,m,f){if(typeof m=="function")return t.send(d,null,m);f||(f=Ph),m?!m.host&&!m.address&&(m.address=i.address):m=i,p(g);function g(h){if(a)return f();if(h)return f(h);var v=Ch.encode(d);u.send(v,0,v.length,m.port,m.address||m.host,f)}},t.response=t.respond=function(d,m,f){Array.isArray(d)&&(d={answers:d}),d.type="response",d.flags=(d.flags||0)|Ch.AUTHORITATIVE_ANSWER,t.send(d,m,f)},t.query=function(d,m,f,g){if(typeof m=="function")return t.query(d,null,null,m);if(typeof m=="object"&&m&&m.port)return t.query(d,null,m,f);if(typeof f=="function")return t.query(d,m,null,f);g||(g=Ph),typeof d=="string"&&(d=[{name:d,type:m||"ANY"}]),Array.isArray(d)&&(d={type:"query",questions:d}),d.type="query",t.send(d,f,g)},t.destroy=function(d){if(d||(d=Ph),a)return process.nextTick(d);a=!0,clearInterval(l);for(var m in s)try{u.dropMembership(n,m)}catch{}s={},u.close(d)},t.update=function(){for(var d=e.interface?[].concat(e.interface):DN(),m=!1,f=0;f<d.length;f++){var g=d[f];if(!s[g])try{u.addMembership(n,g),s[g]=!0,m=!0}catch(h){t.emit("warning",h)}}if(m){if(u.setMulticastInterface)try{u.setMulticastInterface(e.interface||ON())}catch(h){t.emit("warning",h)}t.emit("networkInterface")}},t};function ON(){for(var e=Th.networkInterfaces(),t=Object.keys(e),r=0;r<t.length;r++)for(var o=e[t[r]],n=0;n<o.length;n++){var i=o[n];if(pS(i.family)&&!i.internal)return Th.platform()==="darwin"&&t[r]==="en0"?i.address:"0.0.0.0"}return"127.0.0.1"}function DN(){for(var e=Th.networkInterfaces(),t=Object.keys(e),r=[],o=0;o<t.length;o++)for(var n=e[t[o]],i=0;i<n.length;i++){var s=n[i];if(pS(s.family)){r.push(s.address);break}}return r}function pS(e){return e===4||e==="IPv4"}});var hS=ie((rW,gS)=>{"use strict";gS.exports=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var o,n,i;if(Array.isArray(t)){if(o=t.length,o!=r.length)return!1;for(n=o;n--!==0;)if(!e(t[n],r[n]))return!1;return!0}if(t instanceof Map&&r instanceof Map){if(t.size!==r.size)return!1;for(n of t.entries())if(!r.has(n[0]))return!1;for(n of t.entries())if(!e(n[1],r.get(n[0])))return!1;return!0}if(t instanceof Set&&r instanceof Set){if(t.size!==r.size)return!1;for(n of t.entries())if(!r.has(n[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(r)){if(o=t.length,o!=r.length)return!1;for(n=o;n--!==0;)if(t[n]!==r[n])return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),o=i.length,o!==Object.keys(r).length)return!1;for(n=o;n--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[n]))return!1;for(n=o;n--!==0;){var s=i[n];if(!e(t[s],r[s]))return!1}return!0}return t!==t&&r!==r}});var vS=ie(Rr=>{"use strict";var Rh=Rr&&Rr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Rr,"__esModule",{value:!0});Rr.Server=void 0;var NN=Rh(fS()),LN=Rh(hS()),UN=Rh(El()),Ol=class{constructor(t,r){this.registry={},this.mdns=(0,NN.default)(t),this.mdns.setMaxListeners(0),this.mdns.on("query",this.respondToQuery.bind(this)),this.errorCallback=r??function(o){throw o}}register(t){let r=o=>{var n=this.registry[o.type];if(!n)n=this.registry[o.type]=[];else if(n.some(this.isDuplicateRecord(o)))return;n.push(o)};Array.isArray(t)?t.forEach(r):r(t)}unregister(t){let r=o=>{let n=o.type;n in this.registry&&(this.registry[n]=this.registry[n].filter(i=>i.name!==o.name))};Array.isArray(t)?t.forEach(r):r(t)}respondToQuery(t){let r=this;t.questions.forEach(o=>{var n=o.type,i=o.name,s=n==="ANY"?Object.keys(r.registry).map(r.recordsFor.bind(r,i)).flat(1):r.recordsFor(i,n);if(s.length!==0){var a=[];n!=="ANY"&&(s.forEach(l=>{l.type==="PTR"&&(a=a.concat(r.recordsFor(l.data,"SRV")).concat(r.recordsFor(l.data,"TXT")))}),a.filter(function(l){return l.type==="SRV"}).map(function(l){return l.data.target}).filter(this.unique()).forEach(function(l){a=a.concat(r.recordsFor(l,"A")).concat(r.recordsFor(l,"AAAA"))})),r.mdns.respond({answers:s,additionals:a},l=>{l&&this.errorCallback(l)})}})}recordsFor(t,r){return r in this.registry?this.registry[r].filter(o=>{var n=~t.indexOf(".")?o.name:o.name.split(".")[0];return(0,UN.default)(n,t)}):[]}isDuplicateRecord(t){return r=>t.type===r.type&&t.name===r.name&&(0,LN.default)(t.data,r.data)}unique(){var t=[];return r=>~t.indexOf(r)?!1:(t.push(r),!0)}};Rr.Server=Ol;Rr.default=Ol});var bS=ie(Oh=>{"use strict";Object.defineProperty(Oh,"__esModule",{value:!0});Oh.default=(e,t)=>{if(t===void 0)return!0;let r=e.txt,o=Object.entries(t).map(([n,i])=>{let s=r[n];return!(s===void 0||i!=s)});return o.length==0?!0:!o.includes(!1)}});var yS=ie(Dh=>{"use strict";Object.defineProperty(Dh,"__esModule",{value:!0});Dh.default=e=>Object.keys(e).filter(t=>!t.includes("binary")).reduce((t,r)=>Object.assign(t,{[r]:e[r]}),{})});var xS=ie(Nh=>{"use strict";Object.defineProperty(Nh,"__esModule",{value:!0});Nh.default=jN;function jN(e,t){if(e===void 0||t===void 0)return!1;let r=Object.keys(e),o=Object.keys(t);if(r.length!=o.length)return!1;for(let n of r)if(e[n]!=t[n])return!1;return!0}});var SS=ie(Or=>{"use strict";var vs=Or&&Or.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Or,"__esModule",{value:!0});Or.Browser=void 0;var zN=vs(hh()),er=vs(El()),FN=ue("events"),Lh=vh(),kS=vs(bS()),MN=vs(yS()),BN=vs(xS()),wS=".local",HN="_services._dns-sd._udp"+wS,Dl=class e extends FN.EventEmitter{constructor(t,r,o){if(super(),this.onresponse=void 0,this.serviceMap={},this.wildcard=!1,this._services=[],typeof r=="function")return new e(t,null,r);this.mdns=t,this.txt=new zN.default(r!==null&&r.txt!=null?r.txt:void 0),r===null||r.type===void 0?(this.name=HN,this.wildcard=!0):(this.name=(0,Lh.toString)({name:r.type,protocol:r.protocol||"tcp"})+wS,r.name&&(this.name=r.name+"."+this.name),this.wildcard=!1),r!=null&&r.txt!==void 0&&(this.txtQuery=(0,MN.default)(r.txt)),o&&this.on("up",o),this.start()}start(){if(!(this.onresponse||this.name===void 0)){var t=this,r={};this.wildcard||(r[this.name]=!0),this.onresponse=(o,n)=>{t.wildcard&&o.answers.forEach(s=>{s.type!=="PTR"||s.name!==t.name||s.name in r||(r[s.data]=!0,t.mdns.query(s.data,"PTR"))});let i=Date.now();Object.keys(r).forEach(function(s){t.goodbyes(s,o).forEach(t.removeService.bind(t));var a=t.buildServicesFor(s,o,t.txt,n,i);a.length!==0&&a.forEach(l=>{let u=t._services.find(p=>(0,er.default)(p.fqdn,l.fqdn));if(u){t.updateServiceSrv(u,l),t.updateServiceTxt(u,l);return}t.addService(l)})})},this.mdns.on("response",this.onresponse),this.update()}}stop(){this.onresponse&&(this.mdns.removeListener("response",this.onresponse),this.onresponse=void 0)}update(){this.mdns.query(this.name,"PTR")}expire(){let t=Date.now();this._services=this._services.filter(r=>!r.ttl||r.lastSeen===void 0?!0:r.lastSeen+r.ttl*1e3<t?(this.emit("down",r),!1):!0)}get services(){return this._services}addService(t){(0,kS.default)(t,this.txtQuery)!==!1&&(this._services.push(t),this.serviceMap[t.fqdn]=!0,this.emit("up",t))}updateServiceSrv(t,r){(t.name!==r.name||t.host!==r.host||t.port!==r.port||t.type!==r.type||t.protocol!==r.protocol)&&(this.replaceService(r),this.emit("srv-update",r,t))}updateServiceTxt(t,r){if(!(0,BN.default)(r.txt,t?.txt||{})){if(!(0,kS.default)(r,this.txtQuery)){this.removeService(r.fqdn);return}this.replaceService(r),this.emit("txt-update",r,t)}}replaceService(t){this._services=this._services.map(r=>(0,er.default)(r.fqdn,t.fqdn)?t:r)}removeService(t){var r,o;this._services.some(function(n,i){if((0,er.default)(n.fqdn,t))return r=n,o=i,!0}),!(!r||o===void 0)&&(this._services.splice(o,1),delete this.serviceMap[t],this.emit("down",r))}goodbyes(t,r){return r.answers.concat(r.additionals).filter(o=>o.type==="PTR"&&o.ttl===0&&(0,er.default)(o.name,t)).map(o=>o.data)}buildServicesFor(t,r,o,n,i){var s=r.answers.concat(r.additionals).filter(a=>a.ttl>0);return s.filter(a=>a.type==="PTR"&&(0,er.default)(a.name,t)).map(a=>{let l={addresses:[],subtypes:[],ttl:a.ttl,lastSeen:i};if(s.filter(u=>u.type==="PTR"&&(0,er.default)(u.data,a.data)&&u.name.includes("._sub")).forEach(u=>{let p=(0,Lh.toType)(u.name);l.subtypes.push(p.subtype)}),s.filter(u=>(u.type==="SRV"||u.type==="TXT")&&(0,er.default)(u.name,a.data)).forEach(u=>{if(u.type==="SRV"){var p=u.name.split("."),d=p[0],m=(0,Lh.toType)(p.slice(1,-1).join("."));l.name=d,l.fqdn=u.name,l.host=u.data.target,l.referer=n,l.port=u.data.port,l.type=m.name,l.protocol=m.protocol}else u.type==="TXT"&&(l.rawTxt=u.data,l.txt=this.txt.decodeAll(u.data))}),!!l.name)return s.filter(u=>(u.type==="A"||u.type==="AAAA")&&(0,er.default)(u.name,l.host)).forEach(u=>l.addresses.push(u.data)),l}).filter(a=>!!a)}};Or.Browser=Dl;Or.default=Dl});var _S=ie(An=>{"use strict";var Nl=An&&An.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(An,"__esModule",{value:!0});An.Browser=An.Service=void 0;var ZN=Nl(X0()),GN=Nl(vS()),Uh=Nl(SS());An.Browser=Uh.default;var WN=Nl(bh());An.Service=WN.default;var jh=class{constructor(t={},r){this.server=new GN.default(t,r),this.registry=new ZN.default(this.server)}publish(t){return this.registry.publish(t)}unpublishAll(t){return this.registry.unpublishAll(t)}find(t=null,r){return new Uh.default(this.server.mdns,t,r)}findOne(t=null,r=1e4,o){let n=new Uh.default(this.server.mdns,t);var i;return n.once("up",s=>{i!==void 0&&clearTimeout(i),n.stop(),o&&o(s)}),i=setTimeout(()=>{n.stop(),o&&o(null)},r),n}destroy(t){this.registry.destroy(),this.server.mdns.destroy(t)}};An.default=jh});var IS=ie((qe,$S)=>{"use strict";var VN=qe&&qe.__createBinding||(Object.create?(function(e,t,r,o){o===void 0&&(o=r);var n=Object.getOwnPropertyDescriptor(t,r);(!n||("get"in n?!t.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,o,n)}):(function(e,t,r,o){o===void 0&&(o=r),e[o]=t[r]})),JN=qe&&qe.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),qN=qe&&qe.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var o=[];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(o[o.length]=n);return o},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var o=e(t),n=0;n<o.length;n++)o[n]!=="default"&&VN(r,t,o[n]);return JN(r,t),r}})();Object.defineProperty(qe,"__esModule",{value:!0});qe.Browser=qe.Service=qe.Bonjour=void 0;var bs=qN(_S());Object.defineProperty(qe,"Service",{enumerable:!0,get:function(){return bs.Service}});Object.defineProperty(qe,"Browser",{enumerable:!0,get:function(){return bs.Browser}});var Dr=class extends bs.default{};qe.Bonjour=Dr;qe.default=Dr;$S.exports=Object.assign(Dr,{Bonjour:Dr,Service:bs.Service,Browser:bs.Browser,default:Dr})});var Rn=ie((PX,G_)=>{"use strict";var H_=["nodebuffer","arraybuffer","fragments"],Z_=typeof Blob<"u";Z_&&H_.push("blob");G_.exports={BINARY_TYPES:H_,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:Z_,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var _s=ie((TX,Jl)=>{"use strict";var{EMPTY_BUFFER:Lj}=Rn(),ov=Buffer[Symbol.species];function Uj(e,t){if(e.length===0)return Lj;if(e.length===1)return e[0];let r=Buffer.allocUnsafe(t),o=0;for(let n=0;n<e.length;n++){let i=e[n];r.set(i,o),o+=i.length}return o<t?new ov(r.buffer,r.byteOffset,o):r}function W_(e,t,r,o,n){for(let i=0;i<n;i++)r[o+i]=e[i]^t[i&3]}function V_(e,t){for(let r=0;r<e.length;r++)e[r]^=t[r&3]}function jj(e){return e.length===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.length)}function iv(e){if(iv.readOnly=!0,Buffer.isBuffer(e))return e;let t;return e instanceof ArrayBuffer?t=new ov(e):ArrayBuffer.isView(e)?t=new ov(e.buffer,e.byteOffset,e.byteLength):(t=Buffer.from(e),iv.readOnly=!1),t}Jl.exports={concat:Uj,mask:W_,toArrayBuffer:jj,toBuffer:iv,unmask:V_};if(!process.env.WS_NO_BUFFER_UTIL)try{let e=ue("bufferutil");Jl.exports.mask=function(t,r,o,n,i){i<48?W_(t,r,o,n,i):e.mask(t,r,o,n,i)},Jl.exports.unmask=function(t,r){t.length<32?V_(t,r):e.unmask(t,r)}}catch{}});var K_=ie((RX,q_)=>{"use strict";var J_=Symbol("kDone"),sv=Symbol("kRun"),av=class{constructor(t){this[J_]=()=>{this.pending--,this[sv]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[sv]()}[sv](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[J_])}}};q_.exports=av});var ni=ie((OX,e$)=>{"use strict";var $s=ue("zlib"),X_=_s(),zj=K_(),{kStatusCode:Y_}=Rn(),Fj=Buffer[Symbol.species],Mj=Buffer.from([0,0,255,255]),Kl=Symbol("permessage-deflate"),On=Symbol("total-length"),ei=Symbol("callback"),ir=Symbol("buffers"),ti=Symbol("error"),ql,cv=class{constructor(t){if(this._options=t||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._maxPayload=this._options.maxPayload|0,this._isServer=!!this._options.isServer,this._deflate=null,this._inflate=null,this.params=null,!ql){let r=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;ql=new zj(r)}}static get extensionName(){return"permessage-deflate"}offer(){let t={};return this._options.serverNoContextTakeover&&(t.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(t.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(t.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?t.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(t.client_max_window_bits=!0),t}accept(t){return t=this.normalizeParams(t),this.params=this._isServer?this.acceptAsServer(t):this.acceptAsClient(t),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let t=this._deflate[ei];this._deflate.close(),this._deflate=null,t&&t(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(t){let r=this._options,o=t.find(n=>!(r.serverNoContextTakeover===!1&&n.server_no_context_takeover||n.server_max_window_bits&&(r.serverMaxWindowBits===!1||typeof r.serverMaxWindowBits=="number"&&r.serverMaxWindowBits>n.server_max_window_bits)||typeof r.clientMaxWindowBits=="number"&&!n.client_max_window_bits));if(!o)throw new Error("None of the extension offers can be accepted");return r.serverNoContextTakeover&&(o.server_no_context_takeover=!0),r.clientNoContextTakeover&&(o.client_no_context_takeover=!0),typeof r.serverMaxWindowBits=="number"&&(o.server_max_window_bits=r.serverMaxWindowBits),typeof r.clientMaxWindowBits=="number"?o.client_max_window_bits=r.clientMaxWindowBits:(o.client_max_window_bits===!0||r.clientMaxWindowBits===!1)&&delete o.client_max_window_bits,o}acceptAsClient(t){let r=t[0];if(this._options.clientNoContextTakeover===!1&&r.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!r.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(r.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&r.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return r}normalizeParams(t){return t.forEach(r=>{Object.keys(r).forEach(o=>{let n=r[o];if(n.length>1)throw new Error(`Parameter "${o}" must have only a single value`);if(n=n[0],o==="client_max_window_bits"){if(n!==!0){let i=+n;if(!Number.isInteger(i)||i<8||i>15)throw new TypeError(`Invalid value for parameter "${o}": ${n}`);n=i}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${o}": ${n}`)}else if(o==="server_max_window_bits"){let i=+n;if(!Number.isInteger(i)||i<8||i>15)throw new TypeError(`Invalid value for parameter "${o}": ${n}`);n=i}else if(o==="client_no_context_takeover"||o==="server_no_context_takeover"){if(n!==!0)throw new TypeError(`Invalid value for parameter "${o}": ${n}`)}else throw new Error(`Unknown parameter "${o}"`);r[o]=n})}),t}decompress(t,r,o){ql.add(n=>{this._decompress(t,r,(i,s)=>{n(),o(i,s)})})}compress(t,r,o){ql.add(n=>{this._compress(t,r,(i,s)=>{n(),o(i,s)})})}_decompress(t,r,o){let n=this._isServer?"client":"server";if(!this._inflate){let i=`${n}_max_window_bits`,s=typeof this.params[i]!="number"?$s.Z_DEFAULT_WINDOWBITS:this.params[i];this._inflate=$s.createInflateRaw({...this._options.zlibInflateOptions,windowBits:s}),this._inflate[Kl]=this,this._inflate[On]=0,this._inflate[ir]=[],this._inflate.on("error",Hj),this._inflate.on("data",Q_)}this._inflate[ei]=o,this._inflate.write(t),r&&this._inflate.write(Mj),this._inflate.flush(()=>{let i=this._inflate[ti];if(i){this._inflate.close(),this._inflate=null,o(i);return}let s=X_.concat(this._inflate[ir],this._inflate[On]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[On]=0,this._inflate[ir]=[],r&&this.params[`${n}_no_context_takeover`]&&this._inflate.reset()),o(null,s)})}_compress(t,r,o){let n=this._isServer?"server":"client";if(!this._deflate){let i=`${n}_max_window_bits`,s=typeof this.params[i]!="number"?$s.Z_DEFAULT_WINDOWBITS:this.params[i];this._deflate=$s.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:s}),this._deflate[On]=0,this._deflate[ir]=[],this._deflate.on("data",Bj)}this._deflate[ei]=o,this._deflate.write(t),this._deflate.flush($s.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let i=X_.concat(this._deflate[ir],this._deflate[On]);r&&(i=new Fj(i.buffer,i.byteOffset,i.length-4)),this._deflate[ei]=null,this._deflate[On]=0,this._deflate[ir]=[],r&&this.params[`${n}_no_context_takeover`]&&this._deflate.reset(),o(null,i)})}};e$.exports=cv;function Bj(e){this[ir].push(e),this[On]+=e.length}function Q_(e){if(this[On]+=e.length,this[Kl]._maxPayload<1||this[On]<=this[Kl]._maxPayload){this[ir].push(e);return}this[ti]=new RangeError("Max payload size exceeded"),this[ti].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[ti][Y_]=1009,this.removeListener("data",Q_),this.reset()}function Hj(e){if(this[Kl]._inflate=null,this[ti]){this[ei](this[ti]);return}e[Y_]=1007,this[ei](e)}});var ri=ie((DX,Xl)=>{"use strict";var{isUtf8:t$}=ue("buffer"),{hasBlob:Zj}=Rn(),Gj=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function Wj(e){return e>=1e3&&e<=1014&&e!==1004&&e!==1005&&e!==1006||e>=3e3&&e<=4999}function lv(e){let t=e.length,r=0;for(;r<t;)if((e[r]&128)===0)r++;else if((e[r]&224)===192){if(r+1===t||(e[r+1]&192)!==128||(e[r]&254)===192)return!1;r+=2}else if((e[r]&240)===224){if(r+2>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||e[r]===224&&(e[r+1]&224)===128||e[r]===237&&(e[r+1]&224)===160)return!1;r+=3}else if((e[r]&248)===240){if(r+3>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||(e[r+3]&192)!==128||e[r]===240&&(e[r+1]&240)===128||e[r]===244&&e[r+1]>143||e[r]>244)return!1;r+=4}else return!1;return!0}function Vj(e){return Zj&&typeof e=="object"&&typeof e.arrayBuffer=="function"&&typeof e.type=="string"&&typeof e.stream=="function"&&(e[Symbol.toStringTag]==="Blob"||e[Symbol.toStringTag]==="File")}Xl.exports={isBlob:Vj,isValidStatusCode:Wj,isValidUTF8:lv,tokenChars:Gj};if(t$)Xl.exports.isValidUTF8=function(e){return e.length<24?lv(e):t$(e)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let e=ue("utf-8-validate");Xl.exports.isValidUTF8=function(t){return t.length<32?lv(t):e(t)}}catch{}});var fv=ie((NX,c$)=>{"use strict";var{Writable:Jj}=ue("stream"),n$=ni(),{BINARY_TYPES:qj,EMPTY_BUFFER:r$,kStatusCode:Kj,kWebSocket:Xj}=Rn(),{concat:uv,toArrayBuffer:Yj,unmask:Qj}=_s(),{isValidStatusCode:ez,isValidUTF8:o$}=ri(),Yl=Buffer[Symbol.species],bt=0,i$=1,s$=2,a$=3,dv=4,pv=5,Ql=6,mv=class extends Jj{constructor(t={}){super(),this._allowSynchronousEvents=t.allowSynchronousEvents!==void 0?t.allowSynchronousEvents:!0,this._binaryType=t.binaryType||qj[0],this._extensions=t.extensions||{},this._isServer=!!t.isServer,this._maxBufferedChunks=t.maxBufferedChunks|0,this._maxFragments=t.maxFragments|0,this._maxPayload=t.maxPayload|0,this._skipUTF8Validation=!!t.skipUTF8Validation,this[Xj]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=bt}_write(t,r,o){if(this._opcode===8&&this._state==bt)return o();if(this._maxBufferedChunks>0&&this._buffers.length>=this._maxBufferedChunks){o(this.createError(RangeError,"Too many buffered chunks",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS"));return}this._bufferedBytes+=t.length,this._buffers.push(t),this.startLoop(o)}consume(t){if(this._bufferedBytes-=t,t===this._buffers[0].length)return this._buffers.shift();if(t<this._buffers[0].length){let o=this._buffers[0];return this._buffers[0]=new Yl(o.buffer,o.byteOffset+t,o.length-t),new Yl(o.buffer,o.byteOffset,t)}let r=Buffer.allocUnsafe(t);do{let o=this._buffers[0],n=r.length-t;t>=o.length?r.set(this._buffers.shift(),n):(r.set(new Uint8Array(o.buffer,o.byteOffset,t),n),this._buffers[0]=new Yl(o.buffer,o.byteOffset+t,o.length-t)),t-=o.length}while(t>0);return r}startLoop(t){this._loop=!0;do switch(this._state){case bt:this.getInfo(t);break;case i$:this.getPayloadLength16(t);break;case s$:this.getPayloadLength64(t);break;case a$:this.getMask();break;case dv:this.getData(t);break;case pv:case Ql:this._loop=!1;return}while(this._loop);this._errored||t()}getInfo(t){if(this._bufferedBytes<2){this._loop=!1;return}let r=this.consume(2);if((r[0]&48)!==0){let n=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");t(n);return}let o=(r[0]&64)===64;if(o&&!this._extensions[n$.extensionName]){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(n);return}if(this._fin=(r[0]&128)===128,this._opcode=r[0]&15,this._payloadLength=r[1]&127,this._opcode===0){if(o){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(n);return}if(!this._fragmented){let n=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");t(n);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let n=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(n);return}this._compressed=o}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let n=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");t(n);return}if(o){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(n);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let n=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");t(n);return}}else{let n=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(n);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(r[1]&128)===128,this._isServer){if(!this._masked){let n=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");t(n);return}}else if(this._masked){let n=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");t(n);return}this._payloadLength===126?this._state=i$:this._payloadLength===127?this._state=s$:this.haveLength(t)}getPayloadLength16(t){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(t)}getPayloadLength64(t){if(this._bufferedBytes<8){this._loop=!1;return}let r=this.consume(8),o=r.readUInt32BE(0);if(o>Math.pow(2,21)-1){let n=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");t(n);return}this._payloadLength=o*Math.pow(2,32)+r.readUInt32BE(4),this.haveLength(t)}haveLength(t){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let r=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(r);return}this._masked?this._state=a$:this._state=dv}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=dv}getData(t){let r=r$;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}r=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&Qj(r,this._mask)}if(this._opcode>7){this.controlMessage(r,t);return}if(this._compressed){this._state=pv,this.decompress(r,t);return}if(r.length){if(this._maxFragments>0&&this._fragments.length>=this._maxFragments){let o=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");t(o);return}this._messageLength=this._totalPayloadLength,this._fragments.push(r)}this.dataMessage(t)}decompress(t,r){this._extensions[n$.extensionName].decompress(t,this._fin,(n,i)=>{if(n)return r(n);if(i.length){if(this._messageLength+=i.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let s=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");r(s);return}if(this._maxFragments>0&&this._fragments.length>=this._maxFragments){let s=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");r(s);return}this._fragments.push(i)}this.dataMessage(r),this._state===bt&&this.startLoop(r)})}dataMessage(t){if(!this._fin){this._state=bt;return}let r=this._messageLength,o=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let n;this._binaryType==="nodebuffer"?n=uv(o,r):this._binaryType==="arraybuffer"?n=Yj(uv(o,r)):this._binaryType==="blob"?n=new Blob(o):n=o,this._allowSynchronousEvents?(this.emit("message",n,!0),this._state=bt):(this._state=Ql,setImmediate(()=>{this.emit("message",n,!0),this._state=bt,this.startLoop(t)}))}else{let n=uv(o,r);if(!this._skipUTF8Validation&&!o$(n)){let i=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(i);return}this._state===pv||this._allowSynchronousEvents?(this.emit("message",n,!1),this._state=bt):(this._state=Ql,setImmediate(()=>{this.emit("message",n,!1),this._state=bt,this.startLoop(t)}))}}controlMessage(t,r){if(this._opcode===8){if(t.length===0)this._loop=!1,this.emit("conclude",1005,r$),this.end();else{let o=t.readUInt16BE(0);if(!ez(o)){let i=this.createError(RangeError,`invalid status code ${o}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");r(i);return}let n=new Yl(t.buffer,t.byteOffset+2,t.length-2);if(!this._skipUTF8Validation&&!o$(n)){let i=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");r(i);return}this._loop=!1,this.emit("conclude",o,n),this.end()}this._state=bt;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",t),this._state=bt):(this._state=Ql,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",t),this._state=bt,this.startLoop(r)}))}createError(t,r,o,n,i){this._loop=!1,this._errored=!0;let s=new t(o?`Invalid WebSocket frame: ${r}`:r);return Error.captureStackTrace(s,this.createError),s.code=i,s[Kj]=n,s}};c$.exports=mv});var vv=ie((UX,d$)=>{"use strict";var{Duplex:LX}=ue("stream"),{randomFillSync:tz}=ue("crypto"),{types:{isUint8Array:nz}}=ue("util"),l$=ni(),{EMPTY_BUFFER:rz,kWebSocket:oz,NOOP:iz}=Rn(),{isBlob:oi,isValidStatusCode:sz}=ri(),{mask:u$,toBuffer:Mr}=_s(),yt=Symbol("kByteLength"),az=Buffer.alloc(4),eu=8*1024,Br,ii=eu,Nt=0,cz=1,lz=2,gv=class e{constructor(t,r,o){this._extensions=r||{},o&&(this._generateMask=o,this._maskBuffer=Buffer.alloc(4)),this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=Nt,this.onerror=iz,this[oz]=void 0}static frame(t,r){let o,n=!1,i=2,s=!1;r.mask&&(o=r.maskBuffer||az,r.generateMask?r.generateMask(o):(ii===eu&&(Br===void 0&&(Br=Buffer.alloc(eu)),tz(Br,0,eu),ii=0),o[0]=Br[ii++],o[1]=Br[ii++],o[2]=Br[ii++],o[3]=Br[ii++]),s=(o[0]|o[1]|o[2]|o[3])===0,i=6);let a;typeof t=="string"?(!r.mask||s)&&r[yt]!==void 0?a=r[yt]:(t=Buffer.from(t),a=t.length):(a=t.length,n=r.mask&&r.readOnly&&!s);let l=a;a>=65536?(i+=8,l=127):a>125&&(i+=2,l=126);let u=Buffer.allocUnsafe(n?a+i:i);return u[0]=r.fin?r.opcode|128:r.opcode,r.rsv1&&(u[0]|=64),u[1]=l,l===126?u.writeUInt16BE(a,2):l===127&&(u[2]=u[3]=0,u.writeUIntBE(a,4,6)),r.mask?(u[1]|=128,u[i-4]=o[0],u[i-3]=o[1],u[i-2]=o[2],u[i-1]=o[3],s?[u,t]:n?(u$(t,o,u,i,a),[u]):(u$(t,o,t,0,a),[u,t])):[u,t]}close(t,r,o,n){let i;if(t===void 0)i=rz;else{if(typeof t!="number"||!sz(t))throw new TypeError("First argument must be a valid error code number");if(r===void 0||!r.length)i=Buffer.allocUnsafe(2),i.writeUInt16BE(t,0);else{let a=Buffer.byteLength(r);if(a>123)throw new RangeError("The message must not be greater than 123 bytes");if(i=Buffer.allocUnsafe(2+a),i.writeUInt16BE(t,0),typeof r=="string")i.write(r,2);else if(nz(r))i.set(r,2);else throw new TypeError("Second argument must be a string or a Uint8Array")}}let s={[yt]:i.length,fin:!0,generateMask:this._generateMask,mask:o,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==Nt?this.enqueue([this.dispatch,i,!1,s,n]):this.sendFrame(e.frame(i,s),n)}ping(t,r,o){let n,i;if(typeof t=="string"?(n=Buffer.byteLength(t),i=!1):oi(t)?(n=t.size,i=!1):(t=Mr(t),n=t.length,i=Mr.readOnly),n>125)throw new RangeError("The data size must not be greater than 125 bytes");let s={[yt]:n,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:9,readOnly:i,rsv1:!1};oi(t)?this._state!==Nt?this.enqueue([this.getBlobData,t,!1,s,o]):this.getBlobData(t,!1,s,o):this._state!==Nt?this.enqueue([this.dispatch,t,!1,s,o]):this.sendFrame(e.frame(t,s),o)}pong(t,r,o){let n,i;if(typeof t=="string"?(n=Buffer.byteLength(t),i=!1):oi(t)?(n=t.size,i=!1):(t=Mr(t),n=t.length,i=Mr.readOnly),n>125)throw new RangeError("The data size must not be greater than 125 bytes");let s={[yt]:n,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:10,readOnly:i,rsv1:!1};oi(t)?this._state!==Nt?this.enqueue([this.getBlobData,t,!1,s,o]):this.getBlobData(t,!1,s,o):this._state!==Nt?this.enqueue([this.dispatch,t,!1,s,o]):this.sendFrame(e.frame(t,s),o)}send(t,r,o){let n=this._extensions[l$.extensionName],i=r.binary?2:1,s=r.compress,a,l;typeof t=="string"?(a=Buffer.byteLength(t),l=!1):oi(t)?(a=t.size,l=!1):(t=Mr(t),a=t.length,l=Mr.readOnly),this._firstFragment?(this._firstFragment=!1,s&&n&&n.params[n._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(s=a>=n._threshold),this._compress=s):(s=!1,i=0),r.fin&&(this._firstFragment=!0);let u={[yt]:a,fin:r.fin,generateMask:this._generateMask,mask:r.mask,maskBuffer:this._maskBuffer,opcode:i,readOnly:l,rsv1:s};oi(t)?this._state!==Nt?this.enqueue([this.getBlobData,t,this._compress,u,o]):this.getBlobData(t,this._compress,u,o):this._state!==Nt?this.enqueue([this.dispatch,t,this._compress,u,o]):this.dispatch(t,this._compress,u,o)}getBlobData(t,r,o,n){this._bufferedBytes+=o[yt],this._state=lz,t.arrayBuffer().then(i=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(hv,this,a,n);return}this._bufferedBytes-=o[yt];let s=Mr(i);r?this.dispatch(s,r,o,n):(this._state=Nt,this.sendFrame(e.frame(s,o),n),this.dequeue())}).catch(i=>{process.nextTick(uz,this,i,n)})}dispatch(t,r,o,n){if(!r){this.sendFrame(e.frame(t,o),n);return}let i=this._extensions[l$.extensionName];this._bufferedBytes+=o[yt],this._state=cz,i.compress(t,o.fin,(s,a)=>{if(this._socket.destroyed){let l=new Error("The socket was closed while data was being compressed");hv(this,l,n);return}this._bufferedBytes-=o[yt],this._state=Nt,o.readOnly=!1,this.sendFrame(e.frame(a,o),n),this.dequeue()})}dequeue(){for(;this._state===Nt&&this._queue.length;){let t=this._queue.shift();this._bufferedBytes-=t[3][yt],Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[3][yt],this._queue.push(t)}sendFrame(t,r){t.length===2?(this._socket.cork(),this._socket.write(t[0]),this._socket.write(t[1],r),this._socket.uncork()):this._socket.write(t[0],r)}};d$.exports=gv;function hv(e,t,r){typeof r=="function"&&r(t);for(let o=0;o<e._queue.length;o++){let n=e._queue[o],i=n[n.length-1];typeof i=="function"&&i(t)}}function uz(e,t,r){hv(e,t,r),e.onerror(t)}});var x$=ie((jX,y$)=>{"use strict";var{kForOnEventAttribute:Is,kListener:bv}=Rn(),p$=Symbol("kCode"),m$=Symbol("kData"),f$=Symbol("kError"),g$=Symbol("kMessage"),h$=Symbol("kReason"),si=Symbol("kTarget"),v$=Symbol("kType"),b$=Symbol("kWasClean"),Dn=class{constructor(t){this[si]=null,this[v$]=t}get target(){return this[si]}get type(){return this[v$]}};Object.defineProperty(Dn.prototype,"target",{enumerable:!0});Object.defineProperty(Dn.prototype,"type",{enumerable:!0});var Hr=class extends Dn{constructor(t,r={}){super(t),this[p$]=r.code===void 0?0:r.code,this[h$]=r.reason===void 0?"":r.reason,this[b$]=r.wasClean===void 0?!1:r.wasClean}get code(){return this[p$]}get reason(){return this[h$]}get wasClean(){return this[b$]}};Object.defineProperty(Hr.prototype,"code",{enumerable:!0});Object.defineProperty(Hr.prototype,"reason",{enumerable:!0});Object.defineProperty(Hr.prototype,"wasClean",{enumerable:!0});var ai=class extends Dn{constructor(t,r={}){super(t),this[f$]=r.error===void 0?null:r.error,this[g$]=r.message===void 0?"":r.message}get error(){return this[f$]}get message(){return this[g$]}};Object.defineProperty(ai.prototype,"error",{enumerable:!0});Object.defineProperty(ai.prototype,"message",{enumerable:!0});var Es=class extends Dn{constructor(t,r={}){super(t),this[m$]=r.data===void 0?null:r.data}get data(){return this[m$]}};Object.defineProperty(Es.prototype,"data",{enumerable:!0});var dz={addEventListener(e,t,r={}){for(let n of this.listeners(e))if(!r[Is]&&n[bv]===t&&!n[Is])return;let o;if(e==="message")o=function(i,s){let a=new Es("message",{data:s?i:i.toString()});a[si]=this,tu(t,this,a)};else if(e==="close")o=function(i,s){let a=new Hr("close",{code:i,reason:s.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[si]=this,tu(t,this,a)};else if(e==="error")o=function(i){let s=new ai("error",{error:i,message:i.message});s[si]=this,tu(t,this,s)};else if(e==="open")o=function(){let i=new Dn("open");i[si]=this,tu(t,this,i)};else return;o[Is]=!!r[Is],o[bv]=t,r.once?this.once(e,o):this.on(e,o)},removeEventListener(e,t){for(let r of this.listeners(e))if(r[bv]===t&&!r[Is]){this.removeListener(e,r);break}}};y$.exports={CloseEvent:Hr,ErrorEvent:ai,Event:Dn,EventTarget:dz,MessageEvent:Es};function tu(e,t,r){typeof e=="object"&&e.handleEvent?e.handleEvent.call(e,r):e.call(t,r)}});var nu=ie((zX,k$)=>{"use strict";var{tokenChars:As}=ri();function tn(e,t,r){e[t]===void 0?e[t]=[r]:e[t].push(r)}function pz(e){let t=Object.create(null),r=Object.create(null),o=!1,n=!1,i=!1,s,a,l=-1,u=-1,p=-1,d=0;for(;d<e.length;d++)if(u=e.charCodeAt(d),s===void 0)if(p===-1&&As[u]===1)l===-1&&(l=d);else if(d!==0&&(u===32||u===9))p===-1&&l!==-1&&(p=d);else if(u===59||u===44){if(l===-1)throw new SyntaxError(`Unexpected character at index ${d}`);p===-1&&(p=d);let f=e.slice(l,p);u===44?(tn(t,f,r),r=Object.create(null)):s=f,l=p=-1}else throw new SyntaxError(`Unexpected character at index ${d}`);else if(a===void 0)if(p===-1&&As[u]===1)l===-1&&(l=d);else if(u===32||u===9)p===-1&&l!==-1&&(p=d);else if(u===59||u===44){if(l===-1)throw new SyntaxError(`Unexpected character at index ${d}`);p===-1&&(p=d),tn(r,e.slice(l,p),!0),u===44&&(tn(t,s,r),r=Object.create(null),s=void 0),l=p=-1}else if(u===61&&l!==-1&&p===-1)a=e.slice(l,d),l=p=-1;else throw new SyntaxError(`Unexpected character at index ${d}`);else if(n){if(As[u]!==1)throw new SyntaxError(`Unexpected character at index ${d}`);l===-1?l=d:o||(o=!0),n=!1}else if(i)if(As[u]===1)l===-1&&(l=d);else if(u===34&&l!==-1)i=!1,p=d;else if(u===92)n=!0;else throw new SyntaxError(`Unexpected character at index ${d}`);else if(u===34&&e.charCodeAt(d-1)===61)i=!0;else if(p===-1&&As[u]===1)l===-1&&(l=d);else if(l!==-1&&(u===32||u===9))p===-1&&(p=d);else if(u===59||u===44){if(l===-1)throw new SyntaxError(`Unexpected character at index ${d}`);p===-1&&(p=d);let f=e.slice(l,p);o&&(f=f.replace(/\\/g,""),o=!1),tn(r,a,f),u===44&&(tn(t,s,r),r=Object.create(null),s=void 0),a=void 0,l=p=-1}else throw new SyntaxError(`Unexpected character at index ${d}`);if(l===-1||i||u===32||u===9)throw new SyntaxError("Unexpected end of input");p===-1&&(p=d);let m=e.slice(l,p);return s===void 0?tn(t,m,r):(a===void 0?tn(r,m,!0):o?tn(r,a,m.replace(/\\/g,"")):tn(r,a,m),tn(t,s,r)),t}function mz(e){return Object.keys(e).map(t=>{let r=e[t];return Array.isArray(r)||(r=[r]),r.map(o=>[t].concat(Object.keys(o).map(n=>{let i=o[n];return Array.isArray(i)||(i=[i]),i.map(s=>s===!0?n:`${n}=${s}`).join("; ")})).join("; ")).join(", ")}).join(", ")}k$.exports={format:mz,parse:pz}});var su=ie((BX,O$)=>{"use strict";var fz=ue("events"),gz=ue("https"),hz=ue("http"),_$=ue("net"),vz=ue("tls"),{randomBytes:bz,createHash:yz}=ue("crypto"),{Duplex:FX,Readable:MX}=ue("stream"),{URL:yv}=ue("url"),sr=ni(),xz=fv(),kz=vv(),{isBlob:wz}=ri(),{BINARY_TYPES:w$,CLOSE_TIMEOUT:Sz,EMPTY_BUFFER:ru,GUID:_z,kForOnEventAttribute:xv,kListener:$z,kStatusCode:Iz,kWebSocket:Oe,NOOP:$$}=Rn(),{EventTarget:{addEventListener:Ez,removeEventListener:Az}}=x$(),{format:Cz,parse:Pz}=nu(),{toBuffer:Tz}=_s(),I$=Symbol("kAborted"),kv=[8,13],Nn=["CONNECTING","OPEN","CLOSING","CLOSED"],Rz=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,$e=class e extends fz{constructor(t,r,o){super(),this._binaryType=w$[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=ru,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=e.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,t!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,r===void 0?r=[]:Array.isArray(r)||(typeof r=="object"&&r!==null?(o=r,r=[]):r=[r]),E$(this,t,r,o)):(this._autoPong=o.autoPong,this._closeTimeout=o.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(t){w$.includes(t)&&(this._binaryType=t,this._receiver&&(this._receiver._binaryType=t))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(t,r,o){let n=new xz({allowSynchronousEvents:o.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxBufferedChunks:o.maxBufferedChunks,maxFragments:o.maxFragments,maxPayload:o.maxPayload,skipUTF8Validation:o.skipUTF8Validation}),i=new kz(t,this._extensions,o.generateMask);this._receiver=n,this._sender=i,this._socket=t,n[Oe]=this,i[Oe]=this,t[Oe]=this,n.on("conclude",Nz),n.on("drain",Lz),n.on("error",Uz),n.on("message",jz),n.on("ping",zz),n.on("pong",Fz),i.onerror=Mz,t.setTimeout&&t.setTimeout(0),t.setNoDelay&&t.setNoDelay(),r.length>0&&t.unshift(r),t.on("close",P$),t.on("data",iu),t.on("end",T$),t.on("error",R$),this._readyState=e.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[sr.extensionName]&&this._extensions[sr.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(t,r){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){pt(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===e.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=e.CLOSING,this._sender.close(t,r,!this._isServer,o=>{o||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),C$(this)}}pause(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!0,this._socket.pause())}ping(t,r,o){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(o=t,t=r=void 0):typeof r=="function"&&(o=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){wv(this,t,o);return}r===void 0&&(r=!this._isServer),this._sender.ping(t||ru,r,o)}pong(t,r,o){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(o=t,t=r=void 0):typeof r=="function"&&(o=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){wv(this,t,o);return}r===void 0&&(r=!this._isServer),this._sender.pong(t||ru,r,o)}resume(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(t,r,o){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof r=="function"&&(o=r,r={}),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){wv(this,t,o);return}let n={binary:typeof t!="string",mask:!this._isServer,compress:!0,fin:!0,...r};this._extensions[sr.extensionName]||(n.compress=!1),this._sender.send(t||ru,n,o)}terminate(){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){pt(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=e.CLOSING,this._socket.destroy())}}};Object.defineProperty($e,"CONNECTING",{enumerable:!0,value:Nn.indexOf("CONNECTING")});Object.defineProperty($e.prototype,"CONNECTING",{enumerable:!0,value:Nn.indexOf("CONNECTING")});Object.defineProperty($e,"OPEN",{enumerable:!0,value:Nn.indexOf("OPEN")});Object.defineProperty($e.prototype,"OPEN",{enumerable:!0,value:Nn.indexOf("OPEN")});Object.defineProperty($e,"CLOSING",{enumerable:!0,value:Nn.indexOf("CLOSING")});Object.defineProperty($e.prototype,"CLOSING",{enumerable:!0,value:Nn.indexOf("CLOSING")});Object.defineProperty($e,"CLOSED",{enumerable:!0,value:Nn.indexOf("CLOSED")});Object.defineProperty($e.prototype,"CLOSED",{enumerable:!0,value:Nn.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(e=>{Object.defineProperty($e.prototype,e,{enumerable:!0})});["open","error","close","message"].forEach(e=>{Object.defineProperty($e.prototype,`on${e}`,{enumerable:!0,get(){for(let t of this.listeners(e))if(t[xv])return t[$z];return null},set(t){for(let r of this.listeners(e))if(r[xv]){this.removeListener(e,r);break}typeof t=="function"&&this.addEventListener(e,t,{[xv]:!0})}})});$e.prototype.addEventListener=Ez;$e.prototype.removeEventListener=Az;O$.exports=$e;function E$(e,t,r,o){let n={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:Sz,protocolVersion:kv[1],maxBufferedChunks:1048576,maxFragments:131072,maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...o,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(e._autoPong=n.autoPong,e._closeTimeout=n.closeTimeout,!kv.includes(n.protocolVersion))throw new RangeError(`Unsupported protocol version: ${n.protocolVersion} (supported versions: ${kv.join(", ")})`);let i;if(t instanceof yv)i=t;else try{i=new yv(t)}catch{throw new SyntaxError(`Invalid URL: ${t}`)}i.protocol==="http:"?i.protocol="ws:":i.protocol==="https:"&&(i.protocol="wss:"),e._url=i.href;let s=i.protocol==="wss:",a=i.protocol==="ws+unix:",l;if(i.protocol!=="ws:"&&!s&&!a?l=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:a&&!i.pathname?l="The URL's pathname is empty":i.hash&&(l="The URL contains a fragment identifier"),l){let h=new SyntaxError(l);if(e._redirects===0)throw h;ou(e,h);return}let u=s?443:80,p=bz(16).toString("base64"),d=s?gz.request:hz.request,m=new Set,f;if(n.createConnection=n.createConnection||(s?Dz:Oz),n.defaultPort=n.defaultPort||u,n.port=i.port||u,n.host=i.hostname.startsWith("[")?i.hostname.slice(1,-1):i.hostname,n.headers={...n.headers,"Sec-WebSocket-Version":n.protocolVersion,"Sec-WebSocket-Key":p,Connection:"Upgrade",Upgrade:"websocket"},n.path=i.pathname+i.search,n.timeout=n.handshakeTimeout,n.perMessageDeflate&&(f=new sr({...n.perMessageDeflate,isServer:!1,maxPayload:n.maxPayload}),n.headers["Sec-WebSocket-Extensions"]=Cz({[sr.extensionName]:f.offer()})),r.length){for(let h of r){if(typeof h!="string"||!Rz.test(h)||m.has(h))throw new SyntaxError("An invalid or duplicated subprotocol was specified");m.add(h)}n.headers["Sec-WebSocket-Protocol"]=r.join(",")}if(n.origin&&(n.protocolVersion<13?n.headers["Sec-WebSocket-Origin"]=n.origin:n.headers.Origin=n.origin),(i.username||i.password)&&(n.auth=`${i.username}:${i.password}`),a){let h=n.path.split(":");n.socketPath=h[0],n.path=h[1]}let g;if(n.followRedirects){if(e._redirects===0){e._originalIpc=a,e._originalSecure=s,e._originalHostOrSocketPath=a?n.socketPath:i.host;let h=o&&o.headers;if(o={...o,headers:{}},h)for(let[v,k]of Object.entries(h))o.headers[v.toLowerCase()]=k}else if(e.listenerCount("redirect")===0){let h=a?e._originalIpc?n.socketPath===e._originalHostOrSocketPath:!1:e._originalIpc?!1:i.host===e._originalHostOrSocketPath;(!h||e._originalSecure&&!s)&&(delete n.headers.authorization,delete n.headers.cookie,h||delete n.headers.host,n.auth=void 0)}n.auth&&!o.headers.authorization&&(o.headers.authorization="Basic "+Buffer.from(n.auth).toString("base64")),g=e._req=d(n),e._redirects&&e.emit("redirect",e.url,g)}else g=e._req=d(n);n.timeout&&g.on("timeout",()=>{pt(e,g,"Opening handshake has timed out")}),g.on("error",h=>{g===null||g[I$]||(g=e._req=null,ou(e,h))}),g.on("response",h=>{let v=h.headers.location,k=h.statusCode;if(v&&n.followRedirects&&k>=300&&k<400){if(++e._redirects>n.maxRedirects){pt(e,g,"Maximum redirects exceeded");return}g.abort();let S;try{S=new yv(v,t)}catch{let _=new SyntaxError(`Invalid URL: ${v}`);ou(e,_);return}E$(e,S,r,o)}else e.emit("unexpected-response",g,h)||pt(e,g,`Unexpected server response: ${h.statusCode}`)}),g.on("upgrade",(h,v,k)=>{if(e.emit("upgrade",h),e.readyState!==$e.CONNECTING)return;g=e._req=null;let S=h.headers.upgrade;if(S===void 0||S.toLowerCase()!=="websocket"){pt(e,v,"Invalid Upgrade header");return}let I=yz("sha1").update(p+_z).digest("base64");if(h.headers["sec-websocket-accept"]!==I){pt(e,v,"Invalid Sec-WebSocket-Accept header");return}let _=h.headers["sec-websocket-protocol"],C;if(_!==void 0?m.size?m.has(_)||(C="Server sent an invalid subprotocol"):C="Server sent a subprotocol but none was requested":m.size&&(C="Server sent no subprotocol"),C){pt(e,v,C);return}_&&(e._protocol=_);let z=h.headers["sec-websocket-extensions"];if(z!==void 0){if(!f){pt(e,v,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let F;try{F=Pz(z)}catch{pt(e,v,"Invalid Sec-WebSocket-Extensions header");return}let K=Object.keys(F);if(K.length!==1||K[0]!==sr.extensionName){pt(e,v,"Server indicated an extension that was not requested");return}try{f.accept(F[sr.extensionName])}catch{pt(e,v,"Invalid Sec-WebSocket-Extensions header");return}e._extensions[sr.extensionName]=f}e.setSocket(v,k,{allowSynchronousEvents:n.allowSynchronousEvents,generateMask:n.generateMask,maxBufferedChunks:n.maxBufferedChunks,maxFragments:n.maxFragments,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation})}),n.finishRequest?n.finishRequest(g,e):g.end()}function ou(e,t){e._readyState=$e.CLOSING,e._errorEmitted=!0,e.emit("error",t),e.emitClose()}function Oz(e){return e.path=e.socketPath,_$.connect(e)}function Dz(e){return e.path=void 0,!e.servername&&e.servername!==""&&(e.servername=_$.isIP(e.host)?"":e.host),vz.connect(e)}function pt(e,t,r){e._readyState=$e.CLOSING;let o=new Error(r);Error.captureStackTrace(o,pt),t.setHeader?(t[I$]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(ou,e,o)):(t.destroy(o),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}function wv(e,t,r){if(t){let o=wz(t)?t.size:Tz(t).length;e._socket?e._sender._bufferedBytes+=o:e._bufferedAmount+=o}if(r){let o=new Error(`WebSocket is not open: readyState ${e.readyState} (${Nn[e.readyState]})`);process.nextTick(r,o)}}function Nz(e,t){let r=this[Oe];r._closeFrameReceived=!0,r._closeMessage=t,r._closeCode=e,r._socket[Oe]!==void 0&&(r._socket.removeListener("data",iu),process.nextTick(A$,r._socket),e===1005?r.close():r.close(e,t))}function Lz(){let e=this[Oe];e.isPaused||e._socket.resume()}function Uz(e){let t=this[Oe];t._socket[Oe]!==void 0&&(t._socket.removeListener("data",iu),process.nextTick(A$,t._socket),t.close(e[Iz])),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e))}function S$(){this[Oe].emitClose()}function jz(e,t){this[Oe].emit("message",e,t)}function zz(e){let t=this[Oe];t._autoPong&&t.pong(e,!this._isServer,$$),t.emit("ping",e)}function Fz(e){this[Oe].emit("pong",e)}function A$(e){e.resume()}function Mz(e){let t=this[Oe];t.readyState!==$e.CLOSED&&(t.readyState===$e.OPEN&&(t._readyState=$e.CLOSING,C$(t)),this._socket.end(),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e)))}function C$(e){e._closeTimer=setTimeout(e._socket.destroy.bind(e._socket),e._closeTimeout)}function P$(){let e=this[Oe];if(this.removeListener("close",P$),this.removeListener("data",iu),this.removeListener("end",T$),e._readyState=$e.CLOSING,!this._readableState.endEmitted&&!e._closeFrameReceived&&!e._receiver._writableState.errorEmitted&&this._readableState.length!==0){let t=this.read(this._readableState.length);e._receiver.write(t)}e._receiver.end(),this[Oe]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on("error",S$),e._receiver.on("finish",S$))}function iu(e){this[Oe]._receiver.write(e)||this.pause()}function T$(){let e=this[Oe];e._readyState=$e.CLOSING,e._receiver.end(),this.end()}function R$(){let e=this[Oe];this.removeListener("error",R$),this.on("error",$$),e&&(e._readyState=$e.CLOSING,this.destroy())}});var U$=ie((ZX,L$)=>{"use strict";var HX=su(),{Duplex:Bz}=ue("stream");function D$(e){e.emit("close")}function Hz(){!this.destroyed&&this._writableState.finished&&this.destroy()}function N$(e){this.removeListener("error",N$),this.destroy(),this.listenerCount("error")===0&&this.emit("error",e)}function Zz(e,t){let r=!0,o=new Bz({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on("message",function(i,s){let a=!s&&o._readableState.objectMode?i.toString():i;o.push(a)||e.pause()}),e.once("error",function(i){o.destroyed||(r=!1,o.destroy(i))}),e.once("close",function(){o.destroyed||o.push(null)}),o._destroy=function(n,i){if(e.readyState===e.CLOSED){i(n),process.nextTick(D$,o);return}let s=!1;e.once("error",function(l){s=!0,i(l)}),e.once("close",function(){s||i(n),process.nextTick(D$,o)}),r&&e.terminate()},o._final=function(n){if(e.readyState===e.CONNECTING){e.once("open",function(){o._final(n)});return}e._socket!==null&&(e._socket._writableState.finished?(n(),o._readableState.endEmitted&&o.destroy()):(e._socket.once("finish",function(){n()}),e.close()))},o._read=function(){e.isPaused&&e.resume()},o._write=function(n,i,s){if(e.readyState===e.CONNECTING){e.once("open",function(){o._write(n,i,s)});return}e.send(n,s)},o.on("end",Hz),o.on("error",N$),o}L$.exports=Zz});var Sv=ie((GX,j$)=>{"use strict";var{tokenChars:Gz}=ri();function Wz(e){let t=new Set,r=-1,o=-1,n=0;for(n;n<e.length;n++){let s=e.charCodeAt(n);if(o===-1&&Gz[s]===1)r===-1&&(r=n);else if(n!==0&&(s===32||s===9))o===-1&&r!==-1&&(o=n);else if(s===44){if(r===-1)throw new SyntaxError(`Unexpected character at index ${n}`);o===-1&&(o=n);let a=e.slice(r,o);if(t.has(a))throw new SyntaxError(`The "${a}" subprotocol is duplicated`);t.add(a),r=o=-1}else throw new SyntaxError(`Unexpected character at index ${n}`)}if(r===-1||o!==-1)throw new SyntaxError("Unexpected end of input");let i=e.slice(r,n);if(t.has(i))throw new SyntaxError(`The "${i}" subprotocol is duplicated`);return t.add(i),t}j$.exports={parse:Wz}});var G$=ie((VX,Z$)=>{"use strict";var Vz=ue("events"),au=ue("http"),{Duplex:WX}=ue("stream"),{createHash:Jz}=ue("crypto"),z$=nu(),Zr=ni(),qz=Sv(),Kz=su(),{CLOSE_TIMEOUT:Xz,GUID:Yz,kWebSocket:Qz}=Rn(),e2=/^[+/0-9A-Za-z]{22}==$/,F$=0,M$=1,H$=2,_v=class extends Vz{constructor(t,r){if(super(),t={allowSynchronousEvents:!0,autoPong:!0,maxBufferedChunks:1024*1024,maxFragments:128*1024,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:Xz,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:Kz,...t},t.port==null&&!t.server&&!t.noServer||t.port!=null&&(t.server||t.noServer)||t.server&&t.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(t.port!=null?(this._server=au.createServer((o,n)=>{let i=au.STATUS_CODES[426];n.writeHead(426,{"Content-Length":i.length,"Content-Type":"text/plain"}),n.end(i)}),this._server.listen(t.port,t.host,t.backlog,r)):t.server&&(this._server=t.server),this._server){let o=this.emit.bind(this,"connection");this._removeListeners=t2(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(n,i,s)=>{this.handleUpgrade(n,i,s,o)}})}t.perMessageDeflate===!0&&(t.perMessageDeflate={}),t.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=t,this._state=F$}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(t){if(this._state===H$){t&&this.once("close",()=>{t(new Error("The server is not running"))}),process.nextTick(Cs,this);return}if(t&&this.once("close",t),this._state!==M$)if(this._state=M$,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(Cs,this):process.nextTick(Cs,this);else{let r=this._server;this._removeListeners(),this._removeListeners=this._server=null,r.close(()=>{Cs(this)})}}shouldHandle(t){if(this.options.path){let r=t.url.indexOf("?");if((r!==-1?t.url.slice(0,r):t.url)!==this.options.path)return!1}return!0}handleUpgrade(t,r,o,n){r.on("error",B$);let i=t.headers["sec-websocket-key"],s=t.headers.upgrade,a=+t.headers["sec-websocket-version"];if(t.method!=="GET"){Gr(this,t,r,405,"Invalid HTTP method");return}if(s===void 0||s.toLowerCase()!=="websocket"){Gr(this,t,r,400,"Invalid Upgrade header");return}if(i===void 0||!e2.test(i)){Gr(this,t,r,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){Gr(this,t,r,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(t)){Ps(r,400);return}let l=t.headers["sec-websocket-protocol"],u=new Set;if(l!==void 0)try{u=qz.parse(l)}catch{Gr(this,t,r,400,"Invalid Sec-WebSocket-Protocol header");return}let p=t.headers["sec-websocket-extensions"],d={};if(this.options.perMessageDeflate&&p!==void 0){let m=new Zr({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let f=z$.parse(p);f[Zr.extensionName]&&(m.accept(f[Zr.extensionName]),d[Zr.extensionName]=m)}catch{Gr(this,t,r,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let m={origin:t.headers[`${a===8?"sec-websocket-origin":"origin"}`],secure:!!(t.socket.authorized||t.socket.encrypted),req:t};if(this.options.verifyClient.length===2){this.options.verifyClient(m,(f,g,h,v)=>{if(!f)return Ps(r,g||401,h,v);this.completeUpgrade(d,i,u,t,r,o,n)});return}if(!this.options.verifyClient(m))return Ps(r,401)}this.completeUpgrade(d,i,u,t,r,o,n)}completeUpgrade(t,r,o,n,i,s,a){if(!i.readable||!i.writable)return i.destroy();if(i[Qz])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>F$)return Ps(i,503);let u=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${Jz("sha1").update(r+Yz).digest("base64")}`],p=new this.options.WebSocket(null,void 0,this.options);if(o.size){let d=this.options.handleProtocols?this.options.handleProtocols(o,n):o.values().next().value;d&&(u.push(`Sec-WebSocket-Protocol: ${d}`),p._protocol=d)}if(t[Zr.extensionName]){let d=t[Zr.extensionName].params,m=z$.format({[Zr.extensionName]:[d]});u.push(`Sec-WebSocket-Extensions: ${m}`),p._extensions=t}this.emit("headers",u,n),i.write(u.concat(`\r
|
|
5
5
|
`).join(`\r
|
|
6
|
-
`)),i.removeListener("error",
|
|
6
|
+
`)),i.removeListener("error",B$),p.setSocket(i,s,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxBufferedChunks:this.options.maxBufferedChunks,maxFragments:this.options.maxFragments,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(p),p.on("close",()=>{this.clients.delete(p),this._shouldEmitClose&&!this.clients.size&&process.nextTick(Cs,this)})),a(p,n)}};Z$.exports=_v;function t2(e,t){for(let r of Object.keys(t))e.on(r,t[r]);return function(){for(let o of Object.keys(t))e.removeListener(o,t[o])}}function Cs(e){e._state=H$,e.emit("close")}function B$(){this.destroy()}function Ps(e,t,r,o){r=r||au.STATUS_CODES[t],o={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(r),...o},e.once("finish",e.destroy),e.end(`HTTP/1.1 ${t} ${au.STATUS_CODES[t]}\r
|
|
7
7
|
`+Object.keys(o).map(n=>`${n}: ${o[n]}`).join(`\r
|
|
8
8
|
`)+`\r
|
|
9
9
|
\r
|
|
10
|
-
`+r)}function
|
|
11
|
-
`).map(t=>t.trim()).filter(Boolean))]}function
|
|
10
|
+
`+r)}function Gr(e,t,r,o,n,i){if(e.listenerCount("wsClientError")){let s=new Error(n);Error.captureStackTrace(s,Gr),e.emit("wsClientError",s,r,t)}else Ps(r,o,n,i)}});import{createHash as fP}from"node:crypto";import{chmodSync as wy,mkdirSync as gP,readFileSync as hP,renameSync as vP,rmSync as Sy,writeFileSync as _y}from"node:fs";import bP from"node:os";import He from"node:path";import qI from"node:os";import KI from"node:path";var Y=process.env.BRIDGE_SECRET_DIR||KI.join(qI.homedir(),".claude-bridge");import{existsSync as cE,readdirSync as lE,readFileSync as uE}from"node:fs";import dE from"node:os";import Vr from"node:path";import{createHash as oE}from"node:crypto";import{readFileSync as Lv,rmSync as iE}from"node:fs";import ar from"node:path";import{mkdirSync as XI,readFileSync as YI,renameSync as QI,rmSync as eE,writeFileSync as tE}from"node:fs";import nE from"node:path";function rE(e){return[...new Set(e.split(`
|
|
11
|
+
`).map(t=>t.trim()).filter(Boolean))]}function gu(e){try{return rE(YI(e,"utf8"))}catch{return[]}}function Dv(e){let t=r=>{try{if(r.length===0){eE(e,{force:!0});return}XI(nE.dirname(e),{recursive:!0,mode:448});let o=`${e}.tmp`;tE(o,`${r.join(`
|
|
12
12
|
`)}
|
|
13
|
-
`,{mode:384}),TI(o,e)}catch{}};return{add(r){let o=su(e);o.includes(r)||t([...o,r])},remove(r){let o=su(e);o.includes(r)&&t(o.filter(n=>n!==r))}}}function xv(e,t){if(!t)return 0;let r=0;for(let o of su(e))try{t.delete(o),r++}catch{}return r}var jI=/^[A-Za-z0-9][A-Za-z0-9_.-]{0,79}$/;function mt(e){return jI.test(e)&&!e.includes("..")?e:`h_${LI("sha256").update(e,"utf8").digest("hex").slice(0,24)}`}function Ls(e){return ir.join(Q,"users",e)}function Ke(e){try{let t=JSON.parse(Buffer.from(e.split(".")[1]??"","base64url").toString("utf8"));return typeof t.sub=="string"&&t.sub?t.sub:null}catch{return null}}var ui=ir.join(Q,"active-user.json");function wv(){try{let e=JSON.parse(kv(ui,"utf8"));return typeof e.sub=="string"&&e.sub?e.sub:null}catch{return null}}var zI="layout-version.json";function on(){try{let e=JSON.parse(kv(ir.join(Q,zI),"utf8"));return typeof e.version=="number"&&Number.isFinite(e.version)?e.version:0}catch{return 0}}var sn=3;function Sv(e){if(!e||e.includes("/")||e.includes("\\")||e.includes("..")||e.includes("\0"))throw new Error(`unsafe credential segment: ${JSON.stringify(e)}`)}function xt(e){Sv(e);let t=Ls(e);return{accessFile:ir.join(t,"relay-access-token"),refreshFile:ir.join(t,"relay-refresh-token")}}function au(e,t){Sv(e);let r=ir.join(Ls(e),"providers"),o=xv(ir.join(r,".keyring-index"),t??null);return UI(r,{recursive:!0,force:!0}),o}var cu=e=>{try{return BI(e,"utf8").trim()||null}catch{return null}},sr="hub-endpoint.json",ZI=24,GI=new Set(["public","default","default user","all users","defaultapppool","administrator"]);function lu(e){if(!e)return null;try{let t=JSON.parse(e);return typeof t?.pid!="number"||typeof t?.port!="number"?null:{pid:t.pid,port:t.port,startedAt:typeof t.startedAt=="number"?t.startedAt:0,...typeof t.sub=="string"&&t.sub?{sub:t.sub}:{}}}catch{return null}}function WI(e){let o=e.readFile("/etc/wsl.conf")?.match(/^\s*root\s*=\s*(\S+)\s*$/m)?.[1]??"/mnt";return o.length>1&&o.endsWith("/")?o.slice(0,-1):o}function uu(e){let t=[],r=n=>{t.length<ZI&&!t.includes(n)&&t.push(n)},o=n=>!GI.has(n.toLowerCase());if(e.isWsl){let n=WI(e);for(let i of e.listDir(n).filter(s=>/^[a-zA-Z]$/.test(s))){let s=`${n}/${i}/Users`;o(e.userName)&&r(`${s}/${e.userName}`);for(let a of e.listDir(s))o(a)&&r(`${s}/${a}`)}return t}if(e.platform==="win32")for(let n of["\\\\wsl.localhost","\\\\wsl$"])for(let i of e.listDir(`${n}\\`)){let s=`${n}\\${i}\\home`;r(`${s}\\${e.userName}`);for(let a of e.listDir(s))r(`${s}\\${a}`)}return t}function VI(e){let t=e.isWsl?"/":"\\";return uu(e).map(r=>`${r}${t}.claude-bridge`)}function qI(e){let t=i=>lu(e.readFile(i.endsWith("\\")||i.endsWith("/")?`${i}${sr}`:`${i}${e.platform==="win32"?"\\":"/"}${sr}`)),r=e.env.BRIDGE_SECRET_DIR;if(r)return{dir:r,source:"env",beacon:t(r)};let o=t(e.secretDir);if(o&&e.pidAlive(o.pid))return{dir:e.secretDir,source:"local",beacon:o};let n=null;for(let i of VI(e)){let s=t(i);s&&(!n||s.startedAt>n.beacon.startedAt)&&(n={dir:i,beacon:s})}return n?{dir:n.dir,source:e.isWsl?"peer-wsl":"peer-windows",beacon:n.beacon}:{dir:e.secretDir,source:"local",beacon:null}}function _v(e,t,r){return t!=="linux"?!1:e.WSL_DISTRO_NAME||e.WSL_INTEROP?!0:/microsoft/i.test(r("/proc/version")??"")}function Gr(){return _v(process.env,process.platform,cu)}var Us=null;function Wr(e={}){if(Us&&!e.fresh)return Us;let t=n=>cu(n),r=n=>{try{return MI(n)}catch{return[]}},o="";try{o=HI.userInfo().username}catch{o=process.env.USER??process.env.USERNAME??""}return Us=qI({secretDir:Q,env:process.env,platform:process.platform,userName:o,isWsl:_v(process.env,process.platform,t),pidAlive:n=>{try{return process.kill(n,0),!0}catch(i){return i.code==="EPERM"}},readFile:t,listDir:r}),Us}function $v(e){return{hubTokenFile:Zr.join(e,"hub-token"),activeUserFile:Zr.join(e,"active-user.json"),sessionsDir:Zr.join(e,"sessions"),configFile:Zr.join(e,"config.json"),beaconFile:Zr.join(e,sr)}}function JI(e){let t=cu($v(e).activeUserFile);if(!t)return null;try{let r=JSON.parse(t);return typeof r.sub=="string"&&r.sub?r.sub:null}catch{return null}}function Iv(e){let t=JI(e);if(t){let r=Zr.join(e,"users",mt(t),"hub-token");if(FI(r))return r}return $v(e).hubTokenFile}function js(e){if(e?.isDevBuild!==!0)return!1;let t=e.env??process.env;return t.BRIDGE_VOICE==="1"||t.BRIDGE_VOICE==="true"}var Ev=e=>{let t=e?.subject?.CN;return typeof t=="string"?t:Array.isArray(t)?t[0]:void 0},Av=(e,t)=>typeof e=="string"&&e.toLowerCase()===t.toLowerCase();var m4=256*1024;import{readFileSync as KI}from"node:fs";import di from"node:path";var XI=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(?:\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$/;function du(e){if(typeof e!="string")return{kind:"invalid"};let t=XI.exec(e);return t?t[1]==="0"&&t[2]==="0"&&t[3]==="0"?{kind:"dev"}:{kind:"release",version:e}:{kind:"invalid"}}function Pv(e){let t=du(e);return t.kind==="release"?t.version:null}function Lt(e=process.env,t=process.argv){let r=du(e.BRIDGE_CLIENT_VERSION);if(r.kind==="release")return r.version;if(r.kind==="dev")return null;let o=di.join(Q,"payload"),n=t[1];if(!n)return null;let i=di.relative(o,di.resolve(n));if(i===""||i.startsWith("..")||di.isAbsolute(i))return null;try{let s=JSON.parse(KI(di.join(o,"version.json"),"utf8")),a=du(s.version);return a.kind==="release"?a.version:null}catch{return null}}import{readdirSync as YI}from"node:fs";import QI from"node:path";var ar=class extends Error{constructor(r,o){super(r);this.status=o;this.name="RelayError"}status},eE=e=>e.replace(/\/+$/,"");async function pu(e,t,r,o){return fetch(`${eE(e)}${t}`,{method:"POST",headers:{"content-type":"application/json",...o?{authorization:`Bearer ${o}`}:{}},body:r===void 0?void 0:JSON.stringify(r)})}async function Cv(e,t){let r=await pu(e,"/node/provision",{},t);if(!r.ok)throw new ar(`provision failed (${r.status}): ${(await r.text().catch(()=>"")).slice(0,200)}`,r.status);let o=await r.json().catch(()=>({}));if(typeof o.claim_code!="string")throw new ar("provision returned no claim_code",r.status);return o.claim_code}async function Tv(e,t){let r=await pu(e,"/node/claim",{claim_code:t});if(!r.ok)throw new ar(`pairing failed (${r.status}): ${(await r.text().catch(()=>"")).slice(0,200)}`,r.status);return await r.json()}async function tE(e,t){let r=await pu(e,"/node/token",void 0,t);if(!r.ok)throw new ar(`refresh rejected (${r.status})`,r.status);return await r.json()}function mu(e,t={}){let r=t.log??(l=>console.warn(l)),o=Ke(e.refresh_token),n=Ke(e.access_token),i=o??n;if(o&&n&&o!==n&&r(`credential: access-token sub (${n}) differs from refresh-token sub (${o}) \u2014 trusting the refresh sub (the refresh loop re-mints the access token)`),!i)throw new Error("credential: refusing to persist an unattributable token pair (no decodable sub in refresh or access token)");let s=mt(i),a=xt(s);return ke(a.refreshFile,e.refresh_token),ke(a.accessFile,e.access_token),{sub:i,segment:s}}var nE="__none__";function we(){let e=wv();if(e)return xt(mt(e));let[t,r]=ft();return t&&!r?xt(t.segment):xt(nE)}function Rv(e){let t;try{t=YI(QI.join(Q,"users"),{withFileTypes:!0})}catch{return[]}let r=[];for(let o of t){if(!o.isDirectory())continue;let n;try{n=xt(o.name)}catch{continue}let i=N(n.refreshFile),s=i?Ke(i):null;if(e){if(!s)continue;r.push({sub:s,segment:o.name});continue}let a=s?null:N(n.accessFile),l=s??(a?Ke(a):null);l&&r.push({sub:l,segment:o.name})}return r}function ft(){return Rv(!1)}function Ov(){return Rv(!0)}function rE(e=we()){return N(e.refreshFile)}function pi(e=we()){ve(e.accessFile),ve(e.refreshFile)}function oE(e=we()){let t=N(e.accessFile);if(!t)return null;try{let r=JSON.parse(Buffer.from(t.split(".")[1]??"","base64url").toString());return typeof r.exp=="number"?r.exp-Math.floor(Date.now()/1e3):null}catch{return null}}async function Ut(e,t=60,r,o=we()){let n=oE(o);if(n!==null&&n>t)return!0;let i=rE(o);if(!i)return n!==null&&n>0;try{return mu(await tE(e,i)),!0}catch(s){return r?.(`token refresh failed: ${s instanceof Error?s.message:String(s)}`),s instanceof ar&&(s.status===400||s.status===401)&&pi(o),!1}}function fu(e){return e==="node_superseded"?"This machine was unpaired when AC Bridge was set up on another computer \u2014 only one machine can be paired at a time. Sign in again here (`acbridge login`, or the app) to take the pairing back.":e==="node_revoked"?"This machine's pairing has been revoked. Sign in again (`acbridge login`, or the app) to set it up again.":null}import gu from"node:path";function hu(e){if(!e)return!1;try{return e.available()}catch{return!1}}function vu(e){return hu(e)?"keyring":"file"}function iE(e){let{file:t,account:r}=e,o=()=>N(t);return{backend(){return vu(e.keyring)},read(){if(hu(e.keyring))try{let n=e.keyring.get(r);if(n!==null)return n;let i=o();if(i===null)return null;try{e.keyring.set(r,i),ve(t),e.index?.add(r)}catch{}return i}catch{}return o()},write(n){if(hu(e.keyring))try{e.keyring.set(r,n),ve(t),e.index?.add(r);return}catch{}ke(t,n,384)},delete(){if(e.keyring){try{e.keyring.delete(r)}catch{}e.index?.remove(r)}ve(t)}}}function cr(e,t,r){let o=e.providerSecretFile(t,r);return iE({keyring:mi(),file:o,account:`${t}/${r}`,index:bv(gu.join(gu.dirname(gu.dirname(o)),".keyring-index"))})}var sE="AC Bridge",Nn,aE=new Set(["win32","darwin"]);function mi(e={}){if(Nn!==void 0)return Nn;Nn=null;let t=e.require??null;if(!aE.has(e.platform??process.platform))return Nn;try{let r=t??cE();if(!r)return Nn;let{Entry:o}=r("@napi-rs/keyring"),n=i=>new o(sE,i);Nn={available(){try{return n("__acb_probe__").getPassword(),!0}catch{return!1}},get:i=>n(i).getPassword(),set:(i,s)=>n(i).setPassword(s),delete:i=>{n(i).deletePassword()}}}catch{Nn=null}return Nn}function cE(){try{return typeof ue=="function"?ue:null}catch{return null}}import{spawnSync as lE}from"node:child_process";import{existsSync as uE}from"node:fs";import dE from"node:os";import Dv from"node:path";function zs(e){if(e==="win32"){let r="irm https://claude.ai/install.ps1 | iex";return{file:"powershell",args:["-NoProfile","-ExecutionPolicy","Bypass","-Command",r],manualCommand:r,altCommands:["winget install Anthropic.ClaudeCode"]}}let t="curl -fsSL https://claude.ai/install.sh | bash";return{file:"sh",args:["-c",t],manualCommand:t,altCommands:[]}}function Nv(e,t){if(e==="win32"){let o=Dv.win32;return[o.join(t,".local","bin","claude.exe"),o.join(t,".claude","local","claude.exe")]}let r=Dv.posix;return[r.join(t,".local","bin","claude"),r.join(t,".claude","local","claude"),"/opt/homebrew/bin/claude","/usr/local/bin/claude"]}var Lv=/\.(cmd|bat)$/i,pE=/^\/mnt\/[a-z]\//i;function Uv(e){let t=e.split(/\r?\n/).map(s=>s.trim()).filter(Boolean);if(t.length===0)return null;let r=t.filter(s=>!pE.test(s)),o=r.length>0?r:t,n=o.find(s=>/\.exe$/i.test(s));if(n)return n;let i=o.find(s=>Lv.test(s));return i||(o[0]??null)}function Fs(e){return Lv.test(e)?{file:"cmd.exe",argsPrefix:["/c",e]}:{file:e,argsPrefix:[]}}function jv(e){let r=lE(e,e==="which"?["-a","claude"]:["claude"],{encoding:"utf8"});return{status:r.status??1,stdout:r.stdout??""}}function zv(e,t){let r=t.home??dE.homedir(),o=t.fileExists??uE;for(let n of Nv(e,r))if(o(n))return n;return null}function an(e,t={}){let r=e?.trim();if(r)return Fs(r);let o=t.platform??process.platform,n=t.runFinder??jv,i=o==="win32"?"where":"which";try{let a=n(i);if(a.status===0){let l=Uv(a.stdout);if(l)return Fs(l)}}catch{}let s=zv(o,t);return Fs(s||"claude")}function Ms(e,t={}){if(e?.trim())return!0;let r=t.platform??process.platform,o=t.runFinder??jv;try{let n=o(r==="win32"?"where":"which");if(n.status===0&&Uv(n.stdout)!==null)return!0}catch{}return zv(r,t)!==null}import{spawnSync as mE}from"node:child_process";import{existsSync as Fv,readdirSync as fE}from"node:fs";import Mv from"node:os";import Hs from"node:path";var Bv=/\.(cmd|bat)$/i,gE=/^\/mnt\/[a-z]\//i;function hE(e){let t=e.split(/\r?\n/).map(s=>s.trim()).filter(Boolean);if(t.length===0)return null;let r=t.filter(s=>!gE.test(s)),o=r.length>0?r:t,n=o.find(s=>/\.exe$/i.test(s));if(n)return n;let i=o.find(s=>Bv.test(s));return i||(o[0]??null)}function Bs(e){return Bv.test(e)?{file:"cmd.exe",argsPrefix:["/c",e]}:{file:e,argsPrefix:[]}}function vE(e,t,r=[]){if(e==="win32"){let n=Hs.win32;return[n.join(t,"AppData","Roaming","npm","codex.cmd"),n.join(t,"AppData","Roaming","npm","codex.exe"),n.join(t,".local","bin","codex.exe")]}let o=Hs.posix;return[...[...r].sort().reverse().map(n=>o.join(t,".nvm","versions","node",n,"bin","codex")),"/opt/homebrew/bin/codex","/usr/local/bin/codex",o.join(t,".local","bin","codex")]}function yE(e){try{return fE(Hs.posix.join(e,".nvm","versions","node"))}catch{return[]}}function bE(e,t){let r=t.home??Mv.homedir(),o=t.fileExists??Fv,n=e==="win32"?[]:(t.nodeVersions??yE)(r);for(let i of vE(e,r,n))if(o(i))return i;return null}function xE(e){let r=mE(e,e==="which"?["-a","codex"]:["codex"],{encoding:"utf8"});return{status:r.status??1,stdout:r.stdout??""}}function Vr(e,t={}){let r=e?.trim();if(r)return Bs(r);let o=t.platform??process.platform,n=t.runFinder??xE,i=o==="win32"?"where":"which";try{let a=n(i);if(a.status===0){let l=hE(a.stdout);if(l)return Bs(l)}}catch{}let s=bE(o,t);return Bs(s||"codex")}function Zs(e){let t=e?.home??Mv.homedir();return Fv(Hs.join(t,".codex","auth.json"))}import{spawnSync as kE}from"node:child_process";import{readFileSync as Hv}from"node:fs";import Zv from"node:path";function wE(e){try{let t=Number(Hv(e,"utf8").trim());return Number.isInteger(t)&&t>0?t:null}catch{return null}}function SE(e){kE("pkill",["-f",e])}function _E(){try{return lu(Hv(Zv.join(Q,sr),"utf8"))?.pid??null}catch{return null}}function Gv(e={}){let t=e.platform??process.platform,r=e.pidFile??fi,o=e.readPid??wE,n=e.readBeaconPid??_E,i=e.kill??(l=>process.kill(l)),s=e.sweep??SE,a=o(r);if(a!==null&&n()===a)try{i(a)}catch{}if(t!=="win32"){for(let l of e.sweepPatterns??[])if(Zv.isAbsolute(l))try{s(l)}catch{}}}import{accessSync as $E,constants as IE,mkdtempSync as EE,readFileSync as AE,writeFileSync as Wv}from"node:fs";import PE from"node:os";import Gs from"node:path";var je="bridge",Xe="alexa";function lr(e=process.platform){switch(e){case"darwin":return"/Library/Application Support/ClaudeCode/managed-settings.json";case"win32":return"C:\\Program Files\\ClaudeCode\\managed-settings.json";default:return"/etc/claude-code/managed-settings.json"}}function Vv(e,t=!1){let r={...e};if(t){r.channelsEnabled=!0;let o={marketplace:je,plugin:Xe},n=Array.isArray(e.allowedChannelPlugins)?[...e.allowedChannelPlugins]:[];n.some(i=>i.marketplace===o.marketplace&&i.plugin===o.plugin)||n.push(o),r.allowedChannelPlugins=n}return r}function qr(e){return`'${e.replace(/'/g,"'\\''")}'`}function Jr(e){return`"${e}"`}function CE(e){return`'${e.replace(/'/g,"''")}'`}function TE(e,t,r){return`mkdir -p ${qr(e)} && install -m 0644 ${qr(t)} ${qr(r)}`}function bu(e,t){return(e==="win32"?Gs.win32:Gs.posix).dirname(t)}function RE(e,t,r){let o=bu(e,r);return e==="win32"?`md ${Jr(o)} 2>nul & copy /y ${Jr(t)} ${Jr(r)}`:TE(o,t,r)}function OE(e,t){return e==="darwin"?[{method:"osascript",file:"osascript",args:["-e",`do shell script "${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}" with administrator privileges`]}]:e==="win32"?[{method:"uac",file:"powershell",args:["-NoProfile","-Command",`Start-Process -Verb RunAs -Wait -FilePath cmd.exe -ArgumentList '/c',${CE(t)}`]}]:[{method:"pkexec",file:"pkexec",args:["sh","-c",t]},{method:"sudo",file:"sudo",args:["sh","-c",t]}]}function qv(e,t,r){return OE(e,RE(e,t,r))}function Jv(e,t,r){let o=bu(e,r);return e==="win32"?`md ${Jr(o)} & copy /y ${Jr(t)} ${Jr(r)}`:`sudo mkdir -p ${qr(o)} && sudo install -m 0644 ${qr(t)} ${qr(r)}`}function DE(e){try{return AE(e,"utf8")}catch{return""}}function NE(e){try{return $E(e,IE.W_OK),!0}catch{return!1}}function LE(e,t){Wv(e,t,{mode:420})}function UE(e,t,r){let o=t(e),n={};try{n=JSON.parse(o)}catch{}let i=Vv(n,r),s=JSON.stringify(i,null,2)+`
|
|
14
|
-
`;return!r&&JSON.stringify(i)===JSON.stringify(n)?{existing:n,json:s,changed:!1}:{existing:n,json:s,changed:o.trim()!==s.trim()}}function
|
|
15
|
-
${
|
|
16
|
-
${a.out}`);i=!0}let s=!1;if(i
|
|
17
|
-
${a.out}`);s=!0}return{marketplaceRepointed:i,pluginReinstalled:s}}import{mkdirSync as
|
|
18
|
-
`;try{if(
|
|
19
|
-
|
|
20
|
-
`,384),o}import{createHash as ZA,randomBytes as Uy}from"node:crypto";var Pu=e=>e.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");function jy(){let e=Pu(Uy(32)),t=Pu(ZA("sha256").update(e).digest());return{verifier:e,challenge:t}}function zy(){return Pu(Uy(24))}var GA="https://api.workos.com";var WA="client_01KW2CY31D0NZKCDKNHF2XQ7VC",VA="org_01KW0DNZ14H6JMK8RHA0WSKNVZ";function Fy(e=t=>process.env[t]){let t=e("WORKOS_CLIENT_ID")??WA,r=Number(e("WORKOS_REDIRECT_PORT")??8765)||8765,o=(e("WORKOS_API_HOST")??GA).replace(/\/+$/,""),n=e("WORKOS_REDIRECT_URI")??`http://127.0.0.1:${r}/callback`;return{clientId:t,apiHost:o,redirectUri:n,port:r,organizationId:e("WORKOS_ORG_ID")??VA,configured:!!t}}var qA={google:"GoogleOAuth",github:"GitHubOAuth",microsoft:"MicrosoftOAuth"},ea=class extends Error{constructor(r,o){super(o);this.kind=r;this.name="AuthError"}kind};function ta({cfg:e,opts:t,state:r,codeChallenge:o}){let n=new URL(`${e.apiHost}/user_management/authorize`),i=n.searchParams;return i.set("response_type","code"),i.set("client_id",e.clientId),i.set("redirect_uri",e.redirectUri),i.set("state",r),i.set("code_challenge",o),i.set("code_challenge_method","S256"),t.provider==="google"||t.provider==="github"||t.provider==="microsoft"?i.set("provider",qA[t.provider]):(i.set("provider","authkit"),t.screenHint&&i.set("screen_hint",t.screenHint),t.provider==="sso"&&e.organizationId&&i.set("organization_id",e.organizationId),t.email&&i.set("login_hint",t.email)),n.toString()}function JA(e){return{id:e.id,email:e.email,firstName:e.first_name,lastName:e.last_name,profilePictureUrl:e.profile_picture_url}}async function KA(e,t,r){try{return await r(`${e.apiHost}/user_management/authenticate`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({client_id:e.clientId,...t})})}catch(o){throw new ea("network",o instanceof Error?o.message:"Network error reaching WorkOS.")}}async function XA(e,t,r){let o=await KA(e,t,r),n=await o.text().catch(()=>"");if(!o.ok)throw new ea("rejected",`WorkOS ${o.status}: ${YA(n)}`);let i=JSON.parse(n);return{user:JA(i.user),accessToken:i.access_token,refreshToken:i.refresh_token}}function My(e,t,r,o=fetch){return XA(e,{grant_type:"authorization_code",code:t,code_verifier:r},o)}function YA(e){try{let t=JSON.parse(e);return t.error_description??t.message??t.error??e.slice(0,200)}catch{return e.slice(0,200)||"request failed"}}import{createServer as oP}from"node:http";var Qr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAD9CAYAAABTCakVAAA+DElEQVR42u1dd7wdVfFP6L0pTUoABZGqIB1CBAICQghpgCACIQgo6E8RUEKNoCDFghCUngoSVARBQoBEaSKELkoHAUFqSPLevbs7vz3cOb5z550yZ+/e93bvnj/m85LbdveU75nynZkBADAgSJAg1ZQwCEGCBAAIUlJZNJV1U9k2leGpHJbK91P5TSrTU7kjlRdTeT+Vhal0p1JHiZR/C+lK5YNUnk/lIfzuTalMTuWXqXwzlRGp7JHKZ1JZPIx/AIAgfSNLp7JbKl9L5XLcmC/ipq7hxu7Cvwvx32KDx7i5Y0US5W+i/D/WfE6CRE25Tg1fE//+MJV/Idj8NJWvprJXKiuGOQsAECSbLJ/KvqmcmcqMVN5UTmwpiWZDS4kMr9PvJBoQcL2u/k5kAA8JHP9J5XepTEhl71SWCHMbACBIb1kfT06htv9TObEj8ld3gseWUzxhfIcrLgDRaRQR0UKEVjI7lXNT2RO1mjD/AQAqJ+IkPCiVSam8ihukptjisWXzuTZjbPl+3hIzNAodeMnnXJDKozgOh6eySlgbAQA6VdZJ5RhUiRcqKr3tpE4YQBAZQCE2gELcwkZPmKaES/OINc8gAHA+mjzjUvlkWDMBAMosn0CPvPCeP6ac8DFRjxOGeh47bHGfU7mV0z7JYErEjN+i5o50OArt4LJUxiCAhnUVAKDQMjCVoRg2W6g5nblqeZzRNk+Ym1+8Dxk3fxatwgVgNr+F6vi8FSMMi4S1FgCgSCLi8Gen8pISMos04TfI4cT0OZld1wNozfbPw88QM8yMmDgTX0nlrFTWCmsvAEB/EnBGp3IXcd6Z4ul5ONVsm76dTr/Y42TP8l2T38IU6pTgKrSs36YyBLWvsC4DAPSJmj8OvfcR8XKbNnTUYijO9p3IQejhnN6tOgFjyO4ETCwbPbGAKvWlCDLSiaksFdZoAIB2yOLoxX9GUfFdaisNg0EG1TpxgEfEDAXqfg8yqvxxBhMlZpgtNm6DbWwjJarybCpHBZpyAIC8ZMlUvqfE613U2azEGd1nIaeTOWaYDe0yEbjhQpcJYHIWRobXXsGciEA2CgCQmazzbdz4NQ0FN3FQbaknuxWnWWRQ9yWpJnFsklY2MUcLyeIHcAFXFqG/LcbmjVROChpBAACurJTKaam8rsmaa3WxZnUAxuDnjc8rxOgr0AIPgKMB+DgQqcPwDeRkfDqs8QAAOhHOo9MxbTYyeJ5jhvoaW2xV7gkaA98J6Lpeqw5An1i+Dgg4Dj+OEzDxAFnbs3dh1uLKYc0HAJByOKbWdms2D01q4XiubTx4zsbgpuq6Tr88Tn3XaZvVqcl9Bs64+mhXkpH5VionYDg3AEBFZQdoFL6IDIvK5M3P4gRsxRa3/XakkTqJVNQNn7P9hqo+14k5FFl+z9dM4ZgAEUPb0WlsLjMrRuD/cgCAasmKmHpbJ4s9Ypw4rhPMFqvmbmrXe+rG7Fb486JuwKxUrk/lJ6kcm8pIaBQS+RzmJ7hotAPRASpqEmwAjeo/e+LviPDa+Uh1vg3t6roCOImn6dKKBpB4Oj1ddOObUxkUAKDzZTcMEdUZarqNzBNnVNu54TAdgIh/z0vl9lSuwQ05GDdrf3m5F0tlM0zY+TU0yoh9BM3VhGynNjf27wMeiQVUIsP91PC+T4GKFS6pEoPvuxY731VIw+VY82X6xZpQX0ROd7Eo70vlEmjUD/hsicZ7TWjUKDwbk3i68HlisFc1ckUKErKJI+BXPeJEWsQ9/qVKeQZVeEixcf4KPXXyIsbm57zPobuakoHod2tKost1qRzaYTnxK6AZIUJxTxv8LlwWYpYcBI45kijzIMqZfS0AQPkTds6ARuWZmkEd5XjZIyb1l2NzUqebSGj5YypHp7JxhVRPWSDlD4p2QB2QrRCBXCaAaa7qxJEqCrisEQCgfCKKaj5l8G5zNr6PeeBagJSv/g90pu0KoVCmrHi8OzounyYRh9ihsXFCnjFT09CZF0LeSWU8+loCAJSAu389OVHqHqE+HycgJ1NNXltQin+cyoZhwztlA2RjPkfGkGuy2cwzFylLt0YkIL2cyk4BAIory6AXmtbbizRkHl+GmcleNYGKDNFNwzBayFfP5rj9MppI3QbzIAIeNyO2mHEmDUAnwlw5IABA8UR0qnmCbH4TAEQWGz9h2I6xIzVVLJILUvlU2MS5agW/UYDAh2XJIRu5AF2+JxuwfCMAQHFkWCrvWSiiNB6dWMJKJvtdx56jav6b6HQM5a3b20PhYujpiOTiGiSO9OHEcVjQ79cV3sBVnUAlLvuC+D64y3HFnj6A2JEMpP5fLATRS+94NEHCJu0bEXF60XHoXYVfkEUL8DUB6PsPlJ0zUOZ8/SmWEyCxoLor2YdjAsgyVMciGy5syv6RldFD/4EjIsAtaRaBu0IxPQBEPsF2AQD6tub+3YwMMWoCRB48APqeSh1+E0/8UJ66OLIqpvl2KTF8myPQpgFETE0yIX6fkQEA2i9DEXE5seHYQubh5pOrAPAqhqdCLnlxRYRZL0WfkIub0YoJoAOVbrz2CgEA2iMjNCG+VjSAyJEgIr/3dionB9JO6UyDCw18EB8nIEcDoKFfUZh09QAA+YpgzX0I7vp6WZ2AOi+/mNArUlktbKjSyuaYB1LXRIISh53v0iRt0aTZSEoLAJCD7I9psN2GSeSq/xFzUsW/56aybdhAHSNHo+8mYmYeRox1lIC9TPkdZTAHij5xI3Hj22ywLCZAonlfOo9+FjZMR4rQ5GYqZkFiiAL4agCRhWMwu+ggUPTNXwNe+a3YAQARAwBEnbhRYaN0tCyGiVj1DExAV2k4U9n2hzFyFQDAU+3v1iBs5AkAsQMA5OafUibHTZCW5YsKdZzjK0rA3NbdlYMgrvFoUddXUTf/QgcyJx5RAN3ESjrnf8savw2SSyn4X5FsQ1u5MhNARMCrTfA48hUCAFhEZH99pJz+Ols/yagB1Mlr9yO3PGyGasvB6GSOHGHAyOKDShwORskanFs0HknRQn0fgbmKblYNQJ1UMQmi3NO3ApMviCIic/Nq6F2ZyIcH4GIZSiez4AmsGQCgWdbDjRkxHX1ZnIBiAp6BChV8DOIteyssQheblOME1OWciHV4b1EOoKKg7/OErBF58rhtoRuJvKIU1zolXZiiQOghqexVwHsbginZnVL0ZDeFdFZ3rEFuiTLqjBa/e20AAIBlU3nMwcpztehKQF8ySr4m/Al3lThPX9iMLysL54KC2c9yXm7tsCjBq5owtIkHwKkPqStMc2HVAeBmaG5jZVKnIk8noKr6i042ZWkPPQb9E2oX2xPI4pmnUR/bnZIs4tjfSWUcgrZ8/XZlzAXQbqa8JzSWK6HRe7GMILA2moy+TEAuAMQY7Tq8qgDwc4fqngC/SaeumqtYkD8u0YI7X0koeU+JG19Dnq1biV6ISrVzFOfSlm26t/vxGjVkt8nX34XmphpfwdePUUyvGmZxlhEEhNY4yxEh8AWAmDgGBQjsWTUAOMJCqOC24jY1i5De/mNKtNAGIhNRJScdgu9N1jyb3OjHQ3MT0NltuLdBmhCq9KXMh+bOuwcomoFaY//0kvMFfmehk+sqSbkAgB5eIuN0g6oAwM5KYg+3BTU3DCg3yEElW2QraUJQ4/G9SeT5xNhtje9NI4tyfhvMgcGElyGutx/RAOS97Y6v/5OcmD8hv1m2EKyo/XdVRhMgYSQYibl/qj/yBvp6IHdA9p0LKTmluyjdUvx9HQGmDE6mbRXP+Wc0DqLx+P55mqjGevi9O8l4LVDCnOK7h0GjbiK3H4HognMuOhpH4Gs7aZxhwxTTQNUApO/iBaLN/ERRqX+HgPIMrocyaWmnQqP6T8JMBuIUplFBYHZfE4X6cgAHKWpuzNj8piytxAAOwpbasQQLaSpOttgE1yljQxeH1AC2VgCujhx2+VtzSOh0gaJKTsBrCPkAeHUNHlFU3W6kZUuNTTU1hivMTfnedcrvPEFMgFPx9ZOIpnNPCU2C77WgAego6THxl9zZlyHVvszC+hu4mzP4OgHl4ImFv29JPMsRcVSKjbmcspEkH+I4ooYLFfQK5fQfgKE31ZQS47AivvcOMYuOYPAxIqJpTMLrdUFzy64toLlC7xCyaK/E55GLem98/SriT/hvSf0C1xjCepwu05HhNTUl/cxOA4ATLCc4tye8CRy6lROp6LIX0WhquLnFe38hC2Ebxu9dRjSAV5X3FhL1fLzjtzbSgOvviabRjeq9y4bfAL8jNL6J0FM//3qyDt4rKQAsgv4XUyKRSwPQ5bhQzWDLTgGAldA2j0j6JZdNZSvqGJXM4bc/meganp6yoKVQwd9P5RLm722KJ70Ek2OVBTqfhJvOdfzWJhqQvlmx3Segb2A9T7tZ/f+15BpvlDg6IMZ4BsMH4HICmnwDd3YKAFznoPJyQoG65h3dGAYr06IZrgGAXXMg6QxDx6L6ek0BSfHvcxy/s5lmzG/J+fnPg+b2XnM6IKV4jobMxuEB2DJW5XePKDsAjAG/fu4ub6qKmD8q4YL5EvSuUrtem67VRez5sxnaBNWy/tiG6If0DdQZoFSWUmPPgr1DkU3Vt7EM32l3/ko7B2YtJeRnqsHmovOasqmuL+liWRo98vJZ/t7Ga3WTsZvA1ADaCQDyOqcgBbZTuiqtm8prFie3LlyYMGjGAlRuKysA3Gng87uce7Z6AGLzz4RyN2UUYb0HU3kolc+38To1spBcGsDmmgV4R0gRZstWmKdhWuOcdOJIE/4Wa/6osgHAGZpUSo7t79IAZqFTMSw4PgBIJ+AEBgBQs+tPYRy9U6PfAX7FYZcJIF8TWuP2ZQGAHZRQlqnvmg0IdBqA+K0XMfmligtrdXR4HknUZuGd/y2mC4u2VMtoTACuE3BzzYINGoC/DAV9NeuICQIm7eAlkolZSABYAimeNjXeRQDSaQACAEZXYPGIbLqRhLUnNv/zCknkUuU9lVlXQ16AzgnIMQE20SzO28OGzpzpWnfQ2WNNlqGt7ZiYw4uKDgBngbkza9ayXmJQpldg0ZyrUIRfg55a8t8mlFGhDsr6BjeTBfU2AQCVLenSAHRRgAAA2Ss4/VuTRanrQmV6j/q+pD9g66ICwHqEfRYznYA2TrV44H9VQPUXav1HyjPXMYQq2XPq+HRh0o54by5570OFpbeAUIHPYnjn6YK8K2zmzLIHyXuIHMlAJicgPRDvLyoA3AT6cl6JJ82Xqj7bV2CxbESyGsUY/hB66gHQfgYb4XtPk037rsK+W0CYgGcxNACqgs4MG7klOUc5vaMMPADTnhhbNAD4Apg78CSOTL/EMhgndejC2IVkLm6nbG41HZgCgGRAfg7fm01MrhctuQAuH8CWGhMgOAFbTyGeA/py4z4mAN0vL0NOZe7yetCrHCm7nI6sMckhv69DF8X1iq1/uhJDrpNxOA3fu5SMjTABZOGIX5DFdZNynQWeTMAtNCGoAACty/qE/MVpX+dyjou/hxYFADYhpw2nMIKLL/0SlLeEt002JJmA7yOSr6ikzsr3xykbc4FCn51E8gAuRFv9JjJmCwiZ5BwmAAQnYP4yTJk/Uz0AW99BnVn9FORQWSmPh/sruJtwJgbtQEeJFCfjzh26EA7QTOyqRJ2XabeDCNX05FS+6sGCnE+YgC4i0KYaDeDOsHlzkx+BuQK2jxNQfe//+hsAdteEOmIL3TF2RALqmD/eqYvgMM14yY0uCnL8EhoVg4blcK0FxAdwDkOTo/ZpMAHy5cg8RXw2Lh6AK9X4DUL+6nMAeJC50W0AoLIERfx75Q5eBMcQAKiTkz5PWUCYgC4fwGZ9mAswsKIgsCM0l1eLDAxYsDgBgRyY3+8vANg9Q0afyUEo7dRvdvgCOA56NyttFwDMJ0BzFkMDoDbon9vAd5iEPqOnlHBmleQqgy+A4wTURc7+Cy10vWrlQWYT50SU0QSQn3mmApN/HNEABACs3eJvrogU4nUtJgAnCvA5DUst72Sgo0mo84YKAsAncNNGYK4IZCPK6ajFZ/Q1AOxKsv04JkBkAQC1nFUny+EapmMrDSE2RvpvhCzAbTUAwE0G2lQzZ2q/v3UUenJWmUJA5uGKmgIXMjSAxLJf6PtvZfUFZH2AWzXJDhGD7GP69zvQU822k+Vg6N0ldg3l/UGYTbYU8/cuJuzBqcp7H3maABtrnIC3KHkKXWi/XsG8t8Whdyny28g1nqwoAKwHzaXRspgA9HA9pa8AYEdiw5jKdrmcgOrnD6/IxO9P1D5hCy+tqMeyjr9IJFkLehdXpbbe3WS8n7f4AFwawLoayul0dMp2EdByNfQQ/oQX8FnmQk8vwxtJmvgDFY4KjCdJPnXgtR9PDAfrW1kc6Flu/B7gNem0OQFVraFKsealka8v4/0PKe+9Rk7zccp7VyosQLVQ5FwCpO8RDcAnCrAYLiLVQXk+9NR3UOf3cOV5LsasRLUB6NWgbwxygRILT9AkqDJN+HFCEOIyAU0AcXa7AWAT6F3swMcJqIv7f75iEy9i/K8gb3+ospFq5HQcr/hbasp4CXNpSXzvMbI531Ku8yEhAp3FuDeRgTgPf1MkGq0JjUKmdM5PhOYqvzW8L1mt6WGyqC+EnjqRTynPsWOFAUDI3tDTJ9PGBOT20xAHwLLtBIDziRc78TABdOrNbRVfAFLW1rDEZJ7AEdC7pfSu0FMPQN2cswgA+KQDq1qKWql4Gw15RWonc4jJcADSU/9BDoWfayIOq4V5/1gLuE+TLMTlz+j22YntAoDF0eOctYOvTrYLi+BjWVnRAGgy0MmabMC9lbBit7LJVR7Fm8qCqilqeJZIA2UvSqbic+T1w/D1R4nP4MIwx0bZTfGxxBlNAPW1J9oFAEdCc62/xFMDoNGCe8LkN50E/yGq4LeUnHKaK7G38j3hoZ+hcfLNVuar3oKjdRGMW0uAWqhEbF4kGoC8xlToKWMl/n4nzLFV7mM4AROHE1A194a0AwDuz3DKJ4bEhrrPTVZELlI2q9jkstX2DzQawO6M3xuCm7WG0YFWKNZ7obovnFaHKK8/S7QM+d4ueO1uNEU2CPPrTBJTfQGmZCCVCpwYXo98nKvcG/y0JlRhcgK6CAwRqohh4nvb3mchVXYf5fV9yfgKJx23RJqoM/A1aF8p9RkkpfWLJLdAtEJbPcwtSx6F5u5CcUYNQIaXV8oTAM4Ce+8+lwmQkBNsbIkn6gvovBQ02QP7yDy4UQHgiwo0Ftsh41Dc1+Q2/P46mCEpOhR9vcMBYCz0VHLmOgFtPTa+mRcACBvwZQYycSoCxag2lrUl1Epoq6v2+MF9dO3PIvgUkdu+A+RQnILIIEx3VYkywzsYABZFB14E7ma5CQMYnsgLAHYAfaMDHx+A+tq4kttqNZLMc2NQX9siY6B3Qc3LOvyZDyVcEO6e0gGA0Ca2zgMATgFzDbPEkgtAMwUl+WPZEk/QCPJcdaTjhg2bvxyhWU+/6vBnXhKZopwQIMfXdlIeAHArmIsZcpmAEgB+VvIJGqlJ550VNmtb5EhNyuxlFXjun4C5VZ6LB+Dd25Fjl3yUgZesK23UjV7pASXXAGhFnwAA7ZGjKqgBSOJVxMytSRwawPvgqL7kupk9wK9CiekzUYekfo7SmDYBANqnAdTJZri0Is/+gMehq9v8oIzZkFYA4CImP9lVFFRM5A87BAAoLTa0z2qfD6BOAPdXFXn24zScG1voz/S60+x23cgLLfL91RvZsAMmZqTGCRg0gPbFxWmzlKoAwKqGyBt386vyelYA2JLw/mNH+CEGc0+AhzpkYlQnYOIwAb6AefGisu5Ehdob8h4a9v0MdDCfaLBTx2ocYJdVaJxuA7+CIDYtYHAWADgH3HX/OBqAmMAzO2RSdGFAXQNNWlxDfO4lJY+/ynIqGRfhHB4P+gKiND/+8gqN07csuQDgoQHUbcBpu4F7wa88UWwIF9aZyStlcgK6fABfhObqt3KxbxUA4OMWZlSbnKT53DhNNKlKAPAFhh/AlCREowH/8gWAJZUcZY6X38YDEL+zRIeaACYNYHeF1x0rqbE7BwD4mNdP28VNtmgA6hqbWDFT6S0LvT5magEy/2ZjHwDYHfzKftsAopOYcqM02s1s0Jd6opxu8dkdAwA0AYA8OK51AEBcQR+AkCtIhqAPE5ACwPE+AHAS9FSa4fgATMlAQr7bQRMymkkF3kfjwQ4A0JBbNABwjcUJGFcwDKjWj6xlTAaiXbem+wDAjdC77r9L9TD1Pd+iwzQA2j3nboMGQMM44v87BQD4GADomrmOaQJUTQNYSmOK+4o8fN70AYCXDASgxJGeSCfsvZIMtEhl3QtlMYYJoA6srrTZVzTqa/AB9JgA1LdkAgBKBJroSKTZ3xbyKqncZ9hv3ChAoozj2hwAWMGgdnDSE6nde1MJBlhU4rkfkbbuYPaN1vAAdBrAfmhCqaBYd2gAh0Ojlt6vkYNRtoX6DaSwigV7gocPwAQAR5GxtmkAq6CnW9YNmNFBADCBaJO+IKBGoQ7hAMC+wOvuYwtLyIV/dAkG+Dzo3ZxhFwcTMHZoAF/WUIbFNXY1/O4l0NxIQ4DRtiVapIeQcRHP+gMHwcXlBByr0aImMijrcl727BAA2I5hjrtMADk2V3EA4FTI3qmUOr3WLMEAT9EknRzISAaS6HqvwwmodtoxqacLNOBZptyJszWnzhyPKMA1Fg2AwwScqll/B3aQFvBWCxqAugb/yQGASRang0868GslGVwfABjZghOwbtEsapoJG++4b9FYYwyaG4u2aWw+hb+/vuNzP9Zkoj1oAQC6ZlwagIsINF2zNjupfNh0jRbgwwNQNbMlXQDwACP/WOeUiMhpV5a+b1M16rpLA1A/e49BA4g8AYBqWKdZ7llsSLWPwKPou8lzXA6CRnVZaVfbinJeonE6/Q3sBWa4PICIYQJMJwBe7zAN4FiDGcBtH15X+AC72gBgIE461wGoYwJKAPh2SQZ3GlE1bQDAdQLuS5yAclHu7NAA1HG1aQDXE62lDvbGkKIn3y/xXoW6vZFjTARz80Ny7/PA3M7rIs3C+3uLADBW4wS8nGECyHnpJA1gGzA35YmZp7/cl0fZAGAdcPf+c5kAkvY6tEQAwLUfR2mcTXcZTIC6JmS4s0MD4ALA3Zr7mGIJcT4Dzf3n3nWo9dtr7qeG5oDu8xdr1sLDHkQgUxSAywScrtG2OkkDWBQdw75EoFgTiZpoA4D9wF7Xn5MOLJFmqQ7UAKgT0AQA+3oyAWsam85mAswm6nEdn0P32d1AX7D1R5bf30UzvzXo6Qno0gAiSwr4Hzw0AHrPJgC4QfPZTish/pAm8ScmvpfEwc+powZmBICxFu4xBwDkxV4p0cBOzWACqAv9LgMRqJuMifjeDjmZAH8hExvhc5hSmBOiItd1ISFFdjZoAMM9TIC/WQCA4wQ8yoMJWAUAuI5hArhC80LetgHAZR5xfhPS1EpGxNDZjzYAoKf6TEsyELW/BudkAszR3IdJAzhYo0rrWnar8iUDk3E40wlo0wCy+ABcNQFv7HAn4ABM5vF1AtIeg7I47+ImALgZeH3KbeBQw7BQGTUA1+kxRqMBzPTgAZiYgN2eGsBs6F10ZaoDtGgSkw0ABmvmW9zjATmYALd6EoHU+760whrAUA8noK3NeITkIi0APMtwLrhMALFQvlqQQVuVEcOeolk8HB6AywlY0zgBTUzAumZcuQDg0gBGGyI2tgq7O3maABdrAOCRFpmAPk7AGzXz4gIAQVL7LOTf0qxdsrwhRd+nX6Ccx1EmAOhibPCEYQLs1s+DtRguKqkOPoShMJsJEDFCSCM1TMBZDB6AvI/BDCJQwnAC3qsBgKmWe6YORpcGsC3o+87bACBmAsCfNCbANcwwYB4+ALHhr1aiIg+VhLE6AEOztuo/nFCgGNNv6QBgCeA3IlAFNAizXD8P1ClK3LSGWslMDwCwaQCUB2CKAujSgXexaAAU0cd7AEBk0QD2NSwEWxRgK8PJwTUBYgcRiK4lbj0AEwD81oMHcJSS+CVrEv6pJABwb4tMwIRGU6hKFEG25p+0N/nAfh6oyeS0qyGRxUYFVjfHCKYTMAJ7RSBqAgx2AEDCNAFmaSZ1uuGzK6DnV130kUNL28oQBrRFAWImANzG1AB8OgPdqDnlhltIVFRbmV8SU2BGC7kA6rqdqgOAnYjjygUAprTDZwrC76eLbH4OVODRmpNmtsEEqJGxtGkA3ZrxtZkAMzUm2VTL5wW/4w1l87sKa2wIvQtS2ohAOicgVwOIUCXnhAE5AODyAUzRzGGTZ7zAclUOPoAI8zF6AcB+BAC4KgWd+FsL4tmnzRUXeJgAIxhEoNgjGShyAEDNEwCmkPTlGrjbZi2GKbIbM8ZvWQRM9RpCg9jE8PkLPUwAbk1AHxPgRrImbQAwSWPGdUE5SrYfn4MJIP4+rgOA0WBu7WVr/kk1gKkF0wCkSugCAG4ykDo2NU8egIkK3OUJAOvjid6N8lwq6+Y8hkfib8taCTaT5EKNymkDgDrwawJy0oFv0PAAhjPMQ7VoZhmYq6OZxB+XCfCeDgDGgr4rqU9Z8DoUo3TzFA1gfZQDD2A09O4O/GeDCdCtSZAyUYEXegKADHHuhlpFu04vETn5MiN56KceGsAt5PTl+AA46cARUwOYrNEAukuiAQz11ABMZntNBwAToHdJL18egPj+D9o4ACJZaQjGRNuhASQeGoAEgHvBXlWJ4wTs0gDq6SUiqZwPvYtQ2jQAGko1pQPTMOBESxQgJvM9wmEeqvfb5dAAVsO5W7qfx3mDHHwAcoyWoABwuUMDcAGAHPjD2/TwslR5HVWYYY4oANcJOK1FJ+C9BqebLhloV4cGkDCZgEWTczycgH/UHDRcE+ByBwBwIjnTNQBkMgFEFt4VCBDi1BSVefqzy9WyjJwczn6NZWq3+uPXGOx+Xw1gRJtO/nnQXKz0fTAXwZhMwMwVBeDyAEZrGGezGNmArpqAdxFzQXxnXIkA4GCNTT2J6QT0SQa6nOkEtM3hVEMUYBmwFyaVc/hkP47zIsw96soXEP/fggLAlBZNAKkBDGvDgx9A7HRpx+zgmGSOCeBTD4A6YeoWJqCOSDPYkn//usJZEG3ZVykRAAxER+B8hV03yOID4PIAqBZlqwhEta0RlvmmG6gbT1cdZ4Dea1c/j3U3+FcE0jkOd6QAMJVB9EkcpkEdnUbtaMhRI6pbt+VEzcID8NEAXOnA+2pi+7aSYEJWxOseWABbs5XCFa57b0UDmGiJAnA1gGmaOawbNIBJGodldz+P8QcZiEC6zw2lADCNucldJsBObQYAVQPYmekEtPEAfJKBuJ2B9tE4sEJjkNYrArlMAI4pOkXDBOw20NenaBy5/Q0A72RIB9Z95isUAKaDu/S3ywQQ8vkM6uNyDvowDb+5TIApmgWxgMEEzKIBzHJEAaIAAL0AgFKfr2MkA0UWALhBsz5tGoCOB7CchTMQk3z6AQ5NbrM2UotfBf/WYDrezjAOAGQJA27u8TBnQKO6rbCrXsSNY9p4NY39vTMDACIlRyFPAIgtJsA+4FcWvGqtweg6u57JBJyYoxOQAsDyDtIQBwAuwoNGzP2/MXks7/F7oUUmoBEAbmD6AChAALGltvJkNdEkjk+DvhBHpCF77MSYZI4GQNV6k/o4RrOpTZ2BdBzsIQEAtE7ASeCuCMSNAriKgk7TcC5qeHLbOAMuJ+AI4ktK8NDJ25n7HGSvCKTu42G+PgCXdiA38DbMB7laY+N1YbxfV6NeFwXgAkDskQtgaypxkOZ3ZzFyAeTiGRwAAH6vWUuTGCaAiwocM/040zQaQN2gAeh8SSYN4DLNGu1qQ1TseQYdmOMEPMAUBWjFBKh72Lk3GUJll1hMAAoAO+bABJyiASJuOrApDLgn6MuC7xoA4H/jrcpkCxMwYWgA0z2IQFM1fpyaAQB0mmQN7L0aYhKpOjjn8Xvd8/Q3gcRwHQ+AowEkDgDYg/kgNxgAYALYC3FwnYBZwoAcJiD1Q+hMgD0MTMDgA2g0jKlBcw8J3ZyP0zgLObkAHA1AFwVYlmkCdDM02kTRAA7KefzmGTY5eJKBepkA13smGJhMgH2YD3Ia6CvP7sPkAbh8ADRzcT4jtTZLWXCdBrAb0Vjk2GwXAOBj77ikX3fh+C1vAAC6oSbmZALU2wAAJ2vutx1zvjAHHkCMdPUBlPQQQWtFQesens9PYkhDppwKmW0IB442+AB2ZEYBuCaACwDGaNR6HQBsQRJ85En3qQAA/5NlHBl4R3jwAKZD76rHIxiHgysKoAMAkwmwBuYKdClr7u9tGLeoxWQg+Z39TclACZgrAuk0ABoFOMLjYcSGuAAaNdl+asnIGmmwqbdnePa5UQCuCUC1kJkGbsMsaK5LeGfY9F5yhEcuwDTNfI9gmAuuXADdOrKFAbfC9HBRq+FSTNnOm2kZEXU/azLQXhQAxmfMBQCCkKe2YTEcmNEJGDN4AFM0UQCf1mAzLQQn8Tun4GJcImxqL9ExAV25AFwNIGKaADo+Sa0fx2QFzwiAzV+3AwWAozUDbutHbjIB2lEQZJjGqWYLA/pQgXW5ALbGIJzegEFal7Gak9pVEShh8ACma0hDXQYNYIom+7M/qcDbeHj+bfT9WPJtbPYtN55IqcCT2/Dg+0FzfbqYSQTi1ASc4hEFoJ2B6kG1bzsAcKIAPk7A6ZroQpdBA5isCSf3ZzbgMOCn7LtMgOUoAIwAfYca32SgdtRYXx9V+Drh1q8O7oIgeQIAlwcQpHXRaaRXMAHApyJQZAGA88i6qCERp7/GZIzG/s/iAxDjsxgFgD01PgCf/oByo7WrM/A06ClQKa5zJYNsEjN4AD5hwDGa3w0mQN+YANx0YJcTcJrGtKgZ0pjXhkZPhUhR/8/vxzH5bsZMQLpn/3cY0lM2An6RAdN7C9v08CJkdCii8n6ObCtfJ6CPBsCpBxCkbwFgukcykKkvgKmOwSCMVF2HDu7+rB48sUUAkK+9AobWYHXw7wwE5H3xGysVhG7KSeLwKQo6RqM+3h02a9sBgEsFTpgaQKLxASxTgjH5rWbP+VKBxb/n6ABAsow4BUFtSNNdAM67zgToytEECBpA34YBXclA04Ff1m26IR24DFWYHgG/1mCmCMANJgB4y4MDYGsPPrpAABA5wje+yUA0JTk4AdvrBEw8fACcsuCTNSDeVRIAWGjQun3SgZt6LNILzAR3D0BXFEAM/o/6eaCu0ywIrg+gzggDxo5cgCD5RgGytAc3zeEkDbDMR5ZdkcdjQ4vZzQkBqib6WBMATAJ98QAfDUBcYEY/D9ZoEi7stsTrJ0PvRpgcHkAcAKAwGsB0jc/HNIeHE1+XWB93lGA8DsF7baU3YEwT9uhFTrX4ALhhQCH/LMCAfTOVp6DREuxuDOnYNABOCOkg4FUECpKPE7AO/q3B5BzaktLOTuW/qBUKrXfNEozHhY7T3qYBUC7DeiYAGKXJu/dtD160dsuu4oyTPZyABwGvMUjWRI8NoBxtqvvKCUiB+TJHFIDT4VnN1Vi0ROPxO9B37eb661Qf3SImANgZmktZJRlNAHGRL5VkYCdncALmTQUWSU0v4m+Lv5sGAPBKBroBeteWPLDDxuNtpgZgqgosgfFx9XfpRZa2cAE4FYHUjKlvl2Rgp0Dv4h3DPaIAM3O4hzuU3+1GtA8mQG/vtY8JMLyDxmJt6F1uzLczkDycp9kAYACyhCLLho8NDgjaCnt6iQCA2x58lEYtbVUDGIheaBVA3woA4N0ZqJMBYCT0rjjs8gPo+niI75/pAoAbQV8QhGsCyO++UGIAaLU5qI8srUll7QoAAEdCa70BOwkALlDWSJZkoMjE0dFd7AwwVwTiOAHVSdikQwFAfeY/t3j9ZUlosY6RC7XUlKguIxpqTCgJZTXPikCc9uDTOlwDeNDhl+NsfgkA67sA4MsZIwFU1RByUgkG91porjXgqwG0CgDCI/s+iUu/Sby/dcW0OrtCGgA3HXgy9K4VMaJDxmEtaK5f4CsqCLxOf193wRURKSLPdOBYM2G3lGCAjyVpxuLv1h5RgD/ncA8zyeJV/QofQPvrLRTdBHBpAGcrn5Vz2ClNWA42OACz1AOYwQEAIY8ZAMCnVoCkWC5S8AEWhRFuU0DgdrAXZKiTKEAeLLKhCujWFBLLKtBcXbgoJKu+1gBcALByKnOhpwjrlA4ah6sMGjm3epe6dn7EBYBroXczTl8NQCLx0JIMtKgwPMRBDhmlMQHyKgkm8s5Fyactif1Pqcf/Jt8TrK5PViQd+ArHd/aAzuu/+HLG7Fxaq1PrGLWhb7eGi82hAlNv7EUdNBljCBrnpQGYZHVCzKojIUS+f7kSNfhuB4YBaZGPiRXRfqR8HnpXwzYBAFjelwCwBhcANlNUYm5z0NjAPX62gyZklCaR5NY2Xm8pNKNUDUCGVzdV5khGDpbtcB7ArysGACdrNPEsyUBifTypu4bt4m84NnrE0ACkGbB+hwGA6gRst1Pub2Q8b1eiNVQ72L5Dw4BSrqwYAMyxROS4yUAyN+dKXwC4Dnp3ZzWZAboIgLowj+yQCTlQYwL8sQ9OATVC8X9KYlIXiR7sQ6I5ok35SiUd60M0h0qVAGA5Ep3y5QHEJAPwq74AMEJjAviGAXuVICq5bKT4RiSyXtjmawqqsOjicgJuaDUzsUYmWvai3zWVDxVacRm7Em+AZk1d2QTjKgQAY8Ddq5PLAhQHxWq+ALAY9JQg4jQjiCw3LMoQL9khEyNO4HcwPi8KqKzQT/exLwKQCgBDDNlxvynpWB+AXvAuDO0NrBAAXGs5cMGTBjzHdB3XTdzqSAoyZQPS98RJ9fUOmpyBBViMn0YAkCfkQgWMniN+iqklH+9FoFq2/wAM93Io+C4QEPM/PisAjNN4Ym25ALa+gneHBJfc5WdKGHCCwYEr5uUmTXQhtCovrgwmJjUn689WEHT7rACwiiYji2P/67yRNTy1wgTnrwlsQF57icyLCgDfQ5NMvH5uGL9CyjUWp7pvMtAHNm2VczOPGzQAn5qBMhPpvDC5fSL3EvNrosI2VP0Gb4axKpwsAz31IWJwl+l32f/WuhycG7qUkQuQGLz/9Gb+U1F7rq/lh4pvoAudaQOQCloj6uGSYbwKJcdYTn+bBgAG+/+wVgFgFAk3ZfUByAU5Kkxy20UUFv0Oov9xJJuRhnY/EcarUDLXElL30QKk2b18qwAgMq3mtcgDUCMETwUtoE9kYwxZDiPkGlpbfvkwVoVK/Y2YoXWOCeCsV+mTkuhKB7bdbEz4818Pk91WGYp2ZA3Dg0fj6/soySVSRVw0jFehTv/Iklvj4wQUc3tiXgCwGzRXzeFUBIoN2oH4+3CY7LbKJGiuWSCjAMui40/O5ewwVoWRPaGn9gO3ApcLAD6fFwCIMMIzDHWE21YsIrTWIPnKX8lYP6C8tx00Cr8KUNgijFWhIjc1S8TNlwfwHw5ZzecGvwf6UmE+uQKqs/DvYdJblsOh0eLqTfQeqxWdVFAOY11s2QH3lq4ID8fW1732c861fW5yNWguT+XLA9A5Bw8Mk99SvHgBNFd8lQUf7iaOpPvCeBVa7lSyPWNwd+KmApqI21Z5A4CQaWCuTxYD32Mp33+yYgkeecp2ikNPLh5Z8ulqMifTwngVVnZScjoiDxPAZmo/xL2+783uAu4CBTYNgN64WMBHhkWQ2WmklouqYxhJvLcfJxc8SCHkHgLkiUMDAIcJIH7r2HYBgJBHwNw4xKYB6ByEEfLWlwgLwSrrY374UEVj2luJ6UsAGEnSlh/BhKEwhsWUL0FzxSOO6eyy/0UNheXaCQBfAXujQq7KolbV+U1YDEY5DGP5ddzwE5TFQ0uCBZ9KuXw4T0JzwZPIY/ProgDa0t95A8AAjB9HDAAA4NUSiLhOiwrK38kYvqAw/WqKml9DezKMWTnkXEKgiyz8GVfRD/l3gS+zsxX7s86wVxIGAMjTa3JYFFp5h5hX85T35igOpJeCQ7U0shaJ4OgAgKv+q38v9b2XVh7iAeD3DYjBXU5MLOTNK7ogVsVQkAiziirAanOQeWQMP1TeEwU/T0/lMmiUcg+bqzynf42wY1UAAM8woPyNDfsSAIZqAICTC2B7gEcqmij0C2XsaoQqPY+M00dtuP7KBkfsYhatQqdqirn7LH5PfX0J9B2FgjCNsm1vQ+8uWiYTgKtV35Xlflp9mPvBXhXIRVukGoPQAsZXcFE8Dc19FLqVDfkW0ZTyLOIxEDkCNQSascRDLerSvU+ci5+DRn9CcZ9PpLIuvr4i0sW78f1BynfU3ou7VxwALlXmOQJ7LU3ag8PEEhS/NaQ/AGAo6JuBuDoL27SABRXjqA8k6dbSK7wyvv8g5NuOXJXNCZFIBZe/KJtW7Uf4G3I/v8DXvwPNbcx/ha9vRKIVd1V4828O+toaPhqAzjy4P+s95ZXEkLV2mamRyGMVSlMdiLa/esrXlBP0UGUjdiEfIK9r765xxsp7+pBoJUvjezPIwr0RX/81mcM/4OvDCHnstYpu/kWQoVfPCACx5dDctz8BYCPlBOPkLbvajckFN70iC2NR6N0CvK6o1gPQdhabdZOcrz1cAwDC9FhSiS7I11fH79xOwOp3Bs3gLiVhST31XqkoAPxS0e5oYhwnCmAyD2a0cl952jV1B6PJJ1VYboKzK7I4Xofm/P3uPmJHDiNzsABPKhWUZGeZZfA7t5C5moSv/1yxVcXf32s0gKgVdbXEcjTZ5LpCOhwAoHtKzMvaRQCADUlYw5UIZNIMdEDwpQoskN+S039uH133i2T8/0Ick2oZN+oDkGB1krLI1Y1+Cb6+gaIBqK9Xicb9Lpib58YacABwVwQSr/201fvL80Evt4CAyzywlUB6DYkTnbxIPo200G5k+g3uw2tfj/P2GuEf7A+NsmLz8N/y9XVSeR6/82gqn8TXhdlwB55K/8TPye/8BF+/TdEkqmL33+845V1MQJMJIKIzqxQJAFbTxDc5TEDb5pef+6smttyp/oD+Wqim+1nU4Lg09URcPMT6/yc/JRtbpwXEBvPABQCX5XGPeT/w8WCvFxA7Yp2mwiHi9DgtLKggJZL9SJqvaY3rgAEcPgDxd9MiAsBADHV0Q+/y0xHwqgmZCBFCHd0uLKwgJRCpDccadd92+tcdB6eu1VuhAECGBRdokoWSFgEgwhDSemGBBSm4XMXwg8UGH4DLBJif5x5oZw57DXiVgjgxz0ghyLwCoZptkOLK98Fc+yJ2mAAmJ6D6/tfzvN92DsQllvCfbYBcnOgIU2S3DYstSMFkHPRuveZqnsOpCCTNgxvzvud2DsbSGC5yOTNMiBhbCBOys23QBIIUyenXhf4vXeTLtfltJoA89NYuEwAI2YowymKmBhA50FO+9gamn4YFGKS/k3zec8TxIwYI1EHfU7MGPe3dSgUAQr4N7tbhHA3ApD28jYy2sBCD9IcIwtPLYK+TaXIC0s2vW/d1pF8PKCsADEAijynn2UQDThxMQjXxRLRB2jksxiB9LJ9SWJEu/ktk0IRjR56AMHXXKDsAbA/NXWk5GYE+RKIaUiO3D4sySB/J6kh5jgwJb7Z1bfMB0EIfo9r5HH05YD9mcAPoJgdmiFCmWb6GPISwQIO0U1bGPIiageXH9QFEliiA+P817X6Wvi58cSvTDLDFQ3UIW4fmqjbBHAjSzpp+fzNsZlsdDB1QRBYQEIfZip0EALKQ5Ezg9RRIwC+XQFXDRCONMyuWeRak/fIJaJRit0WxXJV7I0YugPj3yL54pv4YxCUw7zzKsMltZZHogHZjHnsIEwbJQ8Q6eg7XlS0qlVh4ABwmoJDz++q5+tOB8iJxoHCZgNyehPK3RT77mLCAg7ToxH7Lks/P7Ydh0wCkH+vP0Iel8fu7UsrrmsgAxwSIGe9RbeDCkKseJIOMgEYvBlf/vsiS6+LKB5C/+xKaGQOqAAADMKf5bYcnNfF8T9eBWKKrSKNcNCzqIEz5ATSXObPV7YsYJoApDCiu8UEqX+jrZyzCIA9GhI0YA8nxD8QW1UsM9MMhVBjEIUtBo9ipTd3nagC05L0uCtDd7nh/kQFArZ7CVfNdGoAOeaUWUEPe9jFhoQfRiKg/OdfAzecAALfUnQoAp/bX8xZp4MdD79LitmQgk3NQBwB1g/p1N/oiwsIPIkRUMH6BYatnMQF0ICAOo6v685mLNPiCKHQ6YVdxw4CulOPIoiWI6kWiwGJoXFldEanrP0Q6ua02f5bOPabDSvz9OfRzM9wiTsYBSOTh9BzkAIAu08rkiLm8L9hXQQol22J8n9Ogg6MB2MKAasivEE1wizopX8GTOc5BA7BxrXXFRp6FajQjqbqIMvMTwNyl12YCmPxPkYOsJmVGUcahyBM0FHqKLHDIFtx6a5zPCQ3kT9BohR02S2cSe+ZC70adtlh+lDEKQOtaivThVQIA8EQU+ngVmpsq2qIAOiIRFwBMoCDadm0SNk1HyHKpXGGgoSceh0TCcBAmGoefSB9es0hjUoZJGwQ9RRe4LEGdE7DO2PA6VK9hnHZyKluHTVRaEfUjnzBs0sQDAEyefZd/SkQX1i7auJSp+MJjBhDg8gC4GkCiAY66AgTTQoJRqURU07kEzbpugyPPpS0mjChAZNE+hV9p3SKOT5kmchCiqAwTQkYASBzMwYQBMOL/d6YyGqrRs7CsefsiJXy+B5M0YpqFru/I367j5l+jqONUtkkVLZdmGxIyIgYAcE0GDtFImgf/hkb322AeFENWSuVkaNSJjMDelNYnYYejAdDfe7poNn/ZAWAAEifEBL/r2NytOgET5smgmgkinnxtKl9NZdWwGftUdkBW3UILmcxVjSryIJTZOAJiLfwMSlCQpswTvi76BepgL84Qe4RwXN2KuJEDCQiPILtxh/5mfHWorI4Ze0+DubtOYkkzp8I1JV1Vf88syxh2AoXzSk0OAaf1kuvU5+Qa2JyH1IEo0p5vSOWEVLYJgNASZXxPzNZbAD0VekyqvcnLb/osp/CMDgDkXF+A9xgAoA/la8jjrnvmAiQep3rM8AybuAi6BSYW7z0IYKLry46pLBs2uFE2xs31MhPUXZ2pYw8egO0wUMljR5ZtXDtpgXwObfA60wmYgB8ngFv7LfHQENSKRfIUEZGOqamcmMouFY8yfAY1prugp/kGx7HH0QZ8eACJgwr8Mmp1AwIA9H8u96MEBGzJQNySYhHwy5D5VjE2dYipKyeLKGJyMTTqJnRyRSPhwT8Qk7JeUCItHB+MT/FYjg9ABx6RZl39tchhvqoBgEzy+LFCGnJleOkonq5ipFz/QWKxJ23/d7VG/1WHkJFEjUbRw+F7qdzu8OX4OmRdoGvzAbiuLe/xirIDcqcnfDzLWFSRh7qeME56zoJ0tUezEVWkKrwA88nXKtm8bJnKWdAoDS9Ddl0e9jyHt5FYnHgJ+BfupMlAglx0RCfsk063IUUPgm+ijdZtcdhFDnU+8rDxk4ybn6MJJAaq8vUFz1wUlXbOTeUfDB9L4jm2HB9NwpwPVxhQrKFZJQTdygKAWuTxPIM96aIJc2nEHJUUGIuUu3CpSlpDzkHR4vSX4glv875zfDKJp83v0q5sYUIdENSQ8dlRPpiqeZX3hkaDh5oj8SPxIBH5nja+GkDsoK4mBARuKEDkQFxfFLr8yOF4izNEUbJoWLaKUqb+ffLf3eiQ3LET90RV2WNXQu+e7pwwITe2zP0eh6XmYxZIEJjaj0SjzUjaLdfpxjm1XQxNjhbF/ZwkcP0CGj0tBwQA6CzZKZUHLad74kEV5vIKXNmHPpsltgBAHR2EfT2mwjE2j3nqu56bqxlwtQsXCYjOt6AXD+70fRAYZgBfh0ZLphrY67f7OKpcC5xjsybAJ7iY7mnLPhzHy8GvkrPLCeijYXEiARyNrIYe/tOhIh2kAgD05BScodCJfW3NmOFsapWpFhuIKzat4vo+Gr9zPEAqcfAmuE6/GPxCrpzW3c+hZliZtR82f7N8MpVrNA7CCPw99D4e6sTzs9xwl3BgrdbmMTuOgGYWrSXJyQTg/Bb9TB1P/dPwIBgQACCI4ODfqziCIiYpxdeRlWXDcOxp9d/tDA2Oc2TXcYtwJMAjWvmy/mzAIQFe1G/4VFXXetjsdtkKvcCvOFhkPmQWjs3rS2CxObtealNE4PsOTz8H/GLwr8oTt6hhCfkvNAp2VL5JbNjk/CpEh0GjwIcpKy3x4J/7aAU+GoCpLt0eOY/H4dC7tHaSQVWPoTWCEDdFW4b13kZ+wlJhTQcAyCqH4qkaGTYBt7gEV2V2Za+5gKcG+Xaf3QidpVnYd1yeRZwRBExjVENVf92wfgMA5CEiRDQSGgU9uPUGs9r7ruo1rg1XR2JQXtV4Hm2Bfpt4mD6u77u0qzomGwkT7jNhzQYAaGelGrHI3iQU49iyYH3CfdwQo41W+1BOz3ommLvq2Oi1XM++Kwc/NoQ+I7LxRTepU1JZOazPAAB9qRWMgUa/gDo0NzExbXgAv4o1PixB9TPv5vB8m+KJWvfUZnzYeglkq9AkQfdxNNFCvcUAAP0qYrNcBI3a9HVDFqJPXJ9LojF9vrvFTSG+O9fg94jBP4Tpk/NvCt+p3ZpugUa1pIFh7QUAKFr0YN9UrlPAwFZgJGHYvKYCF7bqRWKjLNnCc4wHcy0+HyKUTzjTVLmpG5/nPiQhrRjWWQCAsoDBttBoanIbpsq6Ohv70INNmy5qEQDEPS8w8CCyMhU5QEHZmK8gS1PkbgwK6ykAQCcAwh5ISHkcmvsIZKHVxpYU4a4Wklse8WD4ZeFA2BqriHbal+A4BfU+AEBHi2gldjA02pC/aslD4PQeoADwfgs8f1s33bw0ALnpRcHTGakcn8rmYU0EAKiybIb59cJ/8Dz0rmJk4x9QHsCTGa7/Wczt5+Q6cJiA6v3IZ/kwlT+gj2FwOOUDAASxZyoeiKm3N6NTUTrEpDdcV75MbLgbMhB+HvTgHSSGTV5TqNOChvtHaPQ3ODiQcwIABGldRHXaYdBoLSYKcszCWD0lxpzt+bsna/IdODH7eegzEAAleheMhUYdxtApOQBAkD4UUQ59DQSHH6aynafpMR9P7oVIIpqLtGehSVwNjeq4AnQOSmV//M7iYdwDAAQpv6yGSTOLhbEIABAkSJAOlv8HOib1/JuFBpoAAAAASUVORK5CYII=";var na="linear-gradient(135deg,#3aa0ff 0%,#6a6ff6 52%,#8a4ff0 100%)",QA=[58,160,255],By=[106,111,246],eP=[138,79,240];function tP(e){let[t,r]=e<=.5?[QA,By]:[By,eP],o=e<=.5?e/.5:(e-.5)/.5,n=(i,s)=>Math.round(i+(s-i)*o);return`rgb(${n(t[0],r[0])},${n(t[1],r[1])},${n(t[2],r[2])})`}var Cu=Array.from({length:65},(e,t)=>{let r=t/64,o=Math.exp(-(((r-.5)/.16)**2)),n=Math.round((3+o*(.8+.2*Math.abs(Math.sin(t*1.9)))*153)*10)/10,i=(1.5+t%5*.2).toFixed(1),s=(Math.abs(r-.5)*.7).toFixed(2);return`<span style="height:${n}px;background:${tP(r)};opacity:${n<6?.92:1};animation:wave ${i}s ease-in-out ${s}s infinite"></span>`}).join("");function nP(e){let t=e.markUri??Qr,r=t?`<span class="mark" style="-webkit-mask:url("${t}") center/contain no-repeat;mask:url("${t}") center/contain no-repeat"></span>`:'<span class="mono">AC</span>',o=e.compact?"body{overflow:auto;align-items:flex-start}.card{margin:auto;padding:30px 28px 44px}.badge{height:140px;margin-bottom:22px}.orb{width:104px;height:104px}.mark{width:78px;height:78px}.glow{width:114px;height:114px;margin:-57px 0 0 -57px;background:radial-gradient(circle,rgba(34,197,94,0) 35px,rgba(34,197,94,.34) 40px,rgba(34,197,94,.12) 47px,rgba(34,197,94,0) 56px)}.bars{-webkit-mask-image:radial-gradient(circle at 50% 50%,transparent 40px,#000 62px);mask-image:radial-gradient(circle at 50% 50%,transparent 40px,#000 62px)}h1{font-size:32px}p{font-size:15px}":"";return`<!doctype html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>${jt(e.title)}</title>
|
|
13
|
+
`,{mode:384}),QI(o,e)}catch{}};return{add(r){let o=gu(e);o.includes(r)||t([...o,r])},remove(r){let o=gu(e);o.includes(r)&&t(o.filter(n=>n!==r))}}}function Nv(e,t){if(!t)return 0;let r=0;for(let o of gu(e))try{t.delete(o),r++}catch{}return r}var sE=/^[A-Za-z0-9][A-Za-z0-9_.-]{0,79}$/;function mt(e){return sE.test(e)&&!e.includes("..")?e:`h_${oE("sha256").update(e,"utf8").digest("hex").slice(0,24)}`}function zs(e){return ar.join(Y,"users",e)}function Ke(e){try{let t=JSON.parse(Buffer.from(e.split(".")[1]??"","base64url").toString("utf8"));return typeof t.sub=="string"&&t.sub?t.sub:null}catch{return null}}var pi=ar.join(Y,"active-user.json");function Uv(){try{let e=JSON.parse(Lv(pi,"utf8"));return typeof e.sub=="string"&&e.sub?e.sub:null}catch{return null}}var aE="layout-version.json";function sn(){try{let e=JSON.parse(Lv(ar.join(Y,aE),"utf8"));return typeof e.version=="number"&&Number.isFinite(e.version)?e.version:0}catch{return 0}}var an=3;function jv(e){if(!e||e.includes("/")||e.includes("\\")||e.includes("..")||e.includes("\0"))throw new Error(`unsafe credential segment: ${JSON.stringify(e)}`)}function kt(e){jv(e);let t=zs(e);return{accessFile:ar.join(t,"relay-access-token"),refreshFile:ar.join(t,"relay-refresh-token")}}function hu(e,t){jv(e);let r=ar.join(zs(e),"providers"),o=Nv(ar.join(r,".keyring-index"),t??null);return iE(r,{recursive:!0,force:!0}),o}var vu=e=>{try{return uE(e,"utf8").trim()||null}catch{return null}},cr="hub-endpoint.json",pE=24,mE=new Set(["public","default","default user","all users","defaultapppool","administrator"]);function bu(e){if(!e)return null;try{let t=JSON.parse(e);return typeof t?.pid!="number"||typeof t?.port!="number"?null:{pid:t.pid,port:t.port,startedAt:typeof t.startedAt=="number"?t.startedAt:0,...typeof t.sub=="string"&&t.sub?{sub:t.sub}:{}}}catch{return null}}function fE(e){let o=e.readFile("/etc/wsl.conf")?.match(/^\s*root\s*=\s*(\S+)\s*$/m)?.[1]??"/mnt";return o.length>1&&o.endsWith("/")?o.slice(0,-1):o}function yu(e){let t=[],r=n=>{t.length<pE&&!t.includes(n)&&t.push(n)},o=n=>!mE.has(n.toLowerCase());if(e.isWsl){let n=fE(e);for(let i of e.listDir(n).filter(s=>/^[a-zA-Z]$/.test(s))){let s=`${n}/${i}/Users`;o(e.userName)&&r(`${s}/${e.userName}`);for(let a of e.listDir(s))o(a)&&r(`${s}/${a}`)}return t}if(e.platform==="win32")for(let n of["\\\\wsl.localhost","\\\\wsl$"])for(let i of e.listDir(`${n}\\`)){let s=`${n}\\${i}\\home`;r(`${s}\\${e.userName}`);for(let a of e.listDir(s))r(`${s}\\${a}`)}return t}function gE(e){let t=e.isWsl?"/":"\\";return yu(e).map(r=>`${r}${t}.claude-bridge`)}function hE(e){let t=i=>bu(e.readFile(i.endsWith("\\")||i.endsWith("/")?`${i}${cr}`:`${i}${e.platform==="win32"?"\\":"/"}${cr}`)),r=e.env.BRIDGE_SECRET_DIR;if(r)return{dir:r,source:"env",beacon:t(r)};let o=t(e.secretDir);if(o&&e.pidAlive(o.pid))return{dir:e.secretDir,source:"local",beacon:o};let n=null;for(let i of gE(e)){let s=t(i);s&&(!n||s.startedAt>n.beacon.startedAt)&&(n={dir:i,beacon:s})}return n?{dir:n.dir,source:e.isWsl?"peer-wsl":"peer-windows",beacon:n.beacon}:{dir:e.secretDir,source:"local",beacon:null}}function zv(e,t,r){return t!=="linux"?!1:e.WSL_DISTRO_NAME||e.WSL_INTEROP?!0:/microsoft/i.test(r("/proc/version")??"")}function Jr(){return zv(process.env,process.platform,vu)}var Fs=null;function qr(e={}){if(Fs&&!e.fresh)return Fs;let t=n=>vu(n),r=n=>{try{return lE(n)}catch{return[]}},o="";try{o=dE.userInfo().username}catch{o=process.env.USER??process.env.USERNAME??""}return Fs=hE({secretDir:Y,env:process.env,platform:process.platform,userName:o,isWsl:zv(process.env,process.platform,t),pidAlive:n=>{try{return process.kill(n,0),!0}catch(i){return i.code==="EPERM"}},readFile:t,listDir:r}),Fs}function Fv(e){return{hubTokenFile:Vr.join(e,"hub-token"),activeUserFile:Vr.join(e,"active-user.json"),sessionsDir:Vr.join(e,"sessions"),configFile:Vr.join(e,"config.json"),beaconFile:Vr.join(e,cr)}}function vE(e){let t=vu(Fv(e).activeUserFile);if(!t)return null;try{let r=JSON.parse(t);return typeof r.sub=="string"&&r.sub?r.sub:null}catch{return null}}function Mv(e){let t=vE(e);if(t){let r=Vr.join(e,"users",mt(t),"hub-token");if(cE(r))return r}return Fv(e).hubTokenFile}function Ms(e){if(e?.isDevBuild!==!0)return!1;let t=e.env??process.env;return t.BRIDGE_VOICE==="1"||t.BRIDGE_VOICE==="true"}var Bv=e=>{let t=e?.subject?.CN;return typeof t=="string"?t:Array.isArray(t)?t[0]:void 0},Hv=(e,t)=>typeof e=="string"&&e.toLowerCase()===t.toLowerCase();var J4=256*1024;import{readFileSync as bE}from"node:fs";import mi from"node:path";var yE=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(?:\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$/;function xu(e){if(typeof e!="string")return{kind:"invalid"};let t=yE.exec(e);return t?t[1]==="0"&&t[2]==="0"&&t[3]==="0"?{kind:"dev"}:{kind:"release",version:e}:{kind:"invalid"}}function Zv(e){let t=xu(e);return t.kind==="release"?t.version:null}function Ut(e=process.env,t=process.argv){let r=xu(e.BRIDGE_CLIENT_VERSION);if(r.kind==="release")return r.version;if(r.kind==="dev")return null;let o=mi.join(Y,"payload"),n=t[1];if(!n)return null;let i=mi.relative(o,mi.resolve(n));if(i===""||i.startsWith("..")||mi.isAbsolute(i))return null;try{let s=JSON.parse(bE(mi.join(o,"version.json"),"utf8")),a=xu(s.version);return a.kind==="release"?a.version:null}catch{return null}}import{readdirSync as xE}from"node:fs";import kE from"node:path";var lr=class extends Error{constructor(r,o){super(r);this.status=o;this.name="RelayError"}status},wE=e=>e.replace(/\/+$/,"");async function ku(e,t,r,o){return fetch(`${wE(e)}${t}`,{method:"POST",headers:{"content-type":"application/json",...o?{authorization:`Bearer ${o}`}:{}},body:r===void 0?void 0:JSON.stringify(r)})}async function Gv(e,t){let r=await ku(e,"/node/provision",{},t);if(!r.ok)throw new lr(`provision failed (${r.status}): ${(await r.text().catch(()=>"")).slice(0,200)}`,r.status);let o=await r.json().catch(()=>({}));if(typeof o.claim_code!="string")throw new lr("provision returned no claim_code",r.status);return o.claim_code}async function Wv(e,t){let r=await ku(e,"/node/claim",{claim_code:t});if(!r.ok)throw new lr(`pairing failed (${r.status}): ${(await r.text().catch(()=>"")).slice(0,200)}`,r.status);return await r.json()}async function SE(e,t){let r=await ku(e,"/node/token",void 0,t);if(!r.ok)throw new lr(`refresh rejected (${r.status})`,r.status);return await r.json()}function wu(e,t={}){let r=t.log??(l=>console.warn(l)),o=Ke(e.refresh_token),n=Ke(e.access_token),i=o??n;if(o&&n&&o!==n&&r(`credential: access-token sub (${n}) differs from refresh-token sub (${o}) \u2014 trusting the refresh sub (the refresh loop re-mints the access token)`),!i)throw new Error("credential: refusing to persist an unattributable token pair (no decodable sub in refresh or access token)");let s=mt(i),a=kt(s);return we(a.refreshFile,e.refresh_token),we(a.accessFile,e.access_token),{sub:i,segment:s}}var _E="__none__";function Se(){let e=Uv();if(e)return kt(mt(e));let[t,r]=ft();return t&&!r?kt(t.segment):kt(_E)}function Vv(e){let t;try{t=xE(kE.join(Y,"users"),{withFileTypes:!0})}catch{return[]}let r=[];for(let o of t){if(!o.isDirectory())continue;let n;try{n=kt(o.name)}catch{continue}let i=N(n.refreshFile),s=i?Ke(i):null;if(e){if(!s)continue;r.push({sub:s,segment:o.name});continue}let a=s?null:N(n.accessFile),l=s??(a?Ke(a):null);l&&r.push({sub:l,segment:o.name})}return r}function ft(){return Vv(!1)}function Jv(){return Vv(!0)}function $E(e=Se()){return N(e.refreshFile)}function fi(e=Se()){ve(e.accessFile),ve(e.refreshFile)}function IE(e=Se()){let t=N(e.accessFile);if(!t)return null;try{let r=JSON.parse(Buffer.from(t.split(".")[1]??"","base64url").toString());return typeof r.exp=="number"?r.exp-Math.floor(Date.now()/1e3):null}catch{return null}}async function jt(e,t=60,r,o=Se()){let n=IE(o);if(n!==null&&n>t)return!0;let i=$E(o);if(!i)return n!==null&&n>0;try{return wu(await SE(e,i)),!0}catch(s){return r?.(`token refresh failed: ${s instanceof Error?s.message:String(s)}`),s instanceof lr&&(s.status===400||s.status===401)&&fi(o),!1}}function Su(e){return e==="node_superseded"?"This machine was unpaired when AC Bridge was set up on another computer \u2014 only one machine can be paired at a time. Sign in again here (`acbridge login`, or the app) to take the pairing back.":e==="node_revoked"?"This machine's pairing has been revoked. Sign in again (`acbridge login`, or the app) to set it up again.":null}import _u from"node:path";function $u(e){if(!e)return!1;try{return e.available()}catch{return!1}}function Iu(e){return $u(e)?"keyring":"file"}function EE(e){let{file:t,account:r}=e,o=()=>N(t);return{backend(){return Iu(e.keyring)},read(){if($u(e.keyring))try{let n=e.keyring.get(r);if(n!==null)return n;let i=o();if(i===null)return null;try{e.keyring.set(r,i),ve(t),e.index?.add(r)}catch{}return i}catch{}return o()},write(n){if($u(e.keyring))try{e.keyring.set(r,n),ve(t),e.index?.add(r);return}catch{}we(t,n,384)},delete(){if(e.keyring){try{e.keyring.delete(r)}catch{}e.index?.remove(r)}ve(t)}}}function ur(e,t,r){let o=e.providerSecretFile(t,r);return EE({keyring:gi(),file:o,account:`${t}/${r}`,index:Dv(_u.join(_u.dirname(_u.dirname(o)),".keyring-index"))})}var AE="AC Bridge",Ln,CE=new Set(["win32","darwin"]);function gi(e={}){if(Ln!==void 0)return Ln;Ln=null;let t=e.require??null;if(!CE.has(e.platform??process.platform))return Ln;try{let r=t??PE();if(!r)return Ln;let{Entry:o}=r("@napi-rs/keyring"),n=i=>new o(AE,i);Ln={available(){try{return n("__acb_probe__").getPassword(),!0}catch{return!1}},get:i=>n(i).getPassword(),set:(i,s)=>n(i).setPassword(s),delete:i=>{n(i).deletePassword()}}}catch{Ln=null}return Ln}function PE(){try{return typeof ue=="function"?ue:null}catch{return null}}import{spawnSync as TE}from"node:child_process";import{existsSync as RE}from"node:fs";import OE from"node:os";import qv from"node:path";function Bs(e){if(e==="win32"){let r="irm https://claude.ai/install.ps1 | iex";return{file:"powershell",args:["-NoProfile","-ExecutionPolicy","Bypass","-Command",r],manualCommand:r,altCommands:["winget install Anthropic.ClaudeCode"]}}let t="curl -fsSL https://claude.ai/install.sh | bash";return{file:"sh",args:["-c",t],manualCommand:t,altCommands:[]}}function Kv(e,t){if(e==="win32"){let o=qv.win32;return[o.join(t,".local","bin","claude.exe"),o.join(t,".claude","local","claude.exe")]}let r=qv.posix;return[r.join(t,".local","bin","claude"),r.join(t,".claude","local","claude"),"/opt/homebrew/bin/claude","/usr/local/bin/claude"]}var Xv=/\.(cmd|bat)$/i,DE=/^\/mnt\/[a-z]\//i;function Yv(e){let t=e.split(/\r?\n/).map(s=>s.trim()).filter(Boolean);if(t.length===0)return null;let r=t.filter(s=>!DE.test(s)),o=r.length>0?r:t,n=o.find(s=>/\.exe$/i.test(s));if(n)return n;let i=o.find(s=>Xv.test(s));return i||(o[0]??null)}function Hs(e){return Xv.test(e)?{file:"cmd.exe",argsPrefix:["/c",e]}:{file:e,argsPrefix:[]}}function Qv(e){let r=TE(e,e==="which"?["-a","claude"]:["claude"],{encoding:"utf8"});return{status:r.status??1,stdout:r.stdout??""}}function eb(e,t){let r=t.home??OE.homedir(),o=t.fileExists??RE;for(let n of Kv(e,r))if(o(n))return n;return null}function cn(e,t={}){let r=e?.trim();if(r)return Hs(r);let o=t.platform??process.platform,n=t.runFinder??Qv,i=o==="win32"?"where":"which";try{let a=n(i);if(a.status===0){let l=Yv(a.stdout);if(l)return Hs(l)}}catch{}let s=eb(o,t);return Hs(s||"claude")}function Zs(e,t={}){if(e?.trim())return!0;let r=t.platform??process.platform,o=t.runFinder??Qv;try{let n=o(r==="win32"?"where":"which");if(n.status===0&&Yv(n.stdout)!==null)return!0}catch{}return eb(r,t)!==null}import{spawnSync as NE}from"node:child_process";import{existsSync as tb,readdirSync as LE}from"node:fs";import nb from"node:os";import Ws from"node:path";var rb=/\.(cmd|bat)$/i,UE=/^\/mnt\/[a-z]\//i;function jE(e){let t=e.split(/\r?\n/).map(s=>s.trim()).filter(Boolean);if(t.length===0)return null;let r=t.filter(s=>!UE.test(s)),o=r.length>0?r:t,n=o.find(s=>/\.exe$/i.test(s));if(n)return n;let i=o.find(s=>rb.test(s));return i||(o[0]??null)}function Gs(e){return rb.test(e)?{file:"cmd.exe",argsPrefix:["/c",e]}:{file:e,argsPrefix:[]}}function zE(e,t,r=[]){if(e==="win32"){let n=Ws.win32;return[n.join(t,"AppData","Roaming","npm","codex.cmd"),n.join(t,"AppData","Roaming","npm","codex.exe"),n.join(t,".local","bin","codex.exe")]}let o=Ws.posix;return[...[...r].sort().reverse().map(n=>o.join(t,".nvm","versions","node",n,"bin","codex")),"/opt/homebrew/bin/codex","/usr/local/bin/codex",o.join(t,".local","bin","codex")]}function FE(e){try{return LE(Ws.posix.join(e,".nvm","versions","node"))}catch{return[]}}function ME(e,t){let r=t.home??nb.homedir(),o=t.fileExists??tb,n=e==="win32"?[]:(t.nodeVersions??FE)(r);for(let i of zE(e,r,n))if(o(i))return i;return null}function BE(e){let r=NE(e,e==="which"?["-a","codex"]:["codex"],{encoding:"utf8"});return{status:r.status??1,stdout:r.stdout??""}}function Kr(e,t={}){let r=e?.trim();if(r)return Gs(r);let o=t.platform??process.platform,n=t.runFinder??BE,i=o==="win32"?"where":"which";try{let a=n(i);if(a.status===0){let l=jE(a.stdout);if(l)return Gs(l)}}catch{}let s=ME(o,t);return Gs(s||"codex")}function Vs(e){let t=e?.home??nb.homedir();return tb(Ws.join(t,".codex","auth.json"))}import{spawnSync as HE}from"node:child_process";import{readFileSync as ob}from"node:fs";import ib from"node:path";function ZE(e){try{let t=Number(ob(e,"utf8").trim());return Number.isInteger(t)&&t>0?t:null}catch{return null}}function GE(e){HE("pkill",["-f",e])}function WE(){try{return bu(ob(ib.join(Y,cr),"utf8"))?.pid??null}catch{return null}}function sb(e={}){let t=e.platform??process.platform,r=e.pidFile??hi,o=e.readPid??ZE,n=e.readBeaconPid??WE,i=e.kill??(l=>process.kill(l)),s=e.sweep??GE,a=o(r);if(a!==null&&n()===a)try{i(a)}catch{}if(t!=="win32"){for(let l of e.sweepPatterns??[])if(ib.isAbsolute(l))try{s(l)}catch{}}}import{accessSync as VE,constants as JE,mkdtempSync as qE,readFileSync as KE,writeFileSync as ab}from"node:fs";import XE from"node:os";import Js from"node:path";var ze="bridge",Xe="alexa";function dr(e=process.platform){switch(e){case"darwin":return"/Library/Application Support/ClaudeCode/managed-settings.json";case"win32":return"C:\\Program Files\\ClaudeCode\\managed-settings.json";default:return"/etc/claude-code/managed-settings.json"}}function cb(e,t=!1){let r={...e};if(t){r.channelsEnabled=!0;let o={marketplace:ze,plugin:Xe},n=Array.isArray(e.allowedChannelPlugins)?[...e.allowedChannelPlugins]:[];n.some(i=>i.marketplace===o.marketplace&&i.plugin===o.plugin)||n.push(o),r.allowedChannelPlugins=n}return r}function Xr(e){return`'${e.replace(/'/g,"'\\''")}'`}function Yr(e){return`"${e}"`}function YE(e){return`'${e.replace(/'/g,"''")}'`}function QE(e,t,r){return`mkdir -p ${Xr(e)} && install -m 0644 ${Xr(t)} ${Xr(r)}`}function Au(e,t){return(e==="win32"?Js.win32:Js.posix).dirname(t)}function eA(e,t,r){let o=Au(e,r);return e==="win32"?`md ${Yr(o)} 2>nul & copy /y ${Yr(t)} ${Yr(r)}`:QE(o,t,r)}function tA(e,t){return e==="darwin"?[{method:"osascript",file:"osascript",args:["-e",`do shell script "${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}" with administrator privileges`]}]:e==="win32"?[{method:"uac",file:"powershell",args:["-NoProfile","-Command",`Start-Process -Verb RunAs -Wait -FilePath cmd.exe -ArgumentList '/c',${YE(t)}`]}]:[{method:"pkexec",file:"pkexec",args:["sh","-c",t]},{method:"sudo",file:"sudo",args:["sh","-c",t]}]}function lb(e,t,r){return tA(e,eA(e,t,r))}function ub(e,t,r){let o=Au(e,r);return e==="win32"?`md ${Yr(o)} & copy /y ${Yr(t)} ${Yr(r)}`:`sudo mkdir -p ${Xr(o)} && sudo install -m 0644 ${Xr(t)} ${Xr(r)}`}function nA(e){try{return KE(e,"utf8")}catch{return""}}function rA(e){try{return VE(e,JE.W_OK),!0}catch{return!1}}function oA(e,t){ab(e,t,{mode:420})}function iA(e,t,r){let o=t(e),n={};try{n=JSON.parse(o)}catch{}let i=cb(n,r),s=JSON.stringify(i,null,2)+`
|
|
14
|
+
`;return!r&&JSON.stringify(i)===JSON.stringify(n)?{existing:n,json:s,changed:!1}:{existing:n,json:s,changed:o.trim()!==s.trim()}}function db(e){let t=e.platform??process.platform,r=e.settingsPath??dr(t),o=e.readDest??nA,n=e.dirWritable??rA,i=e.writeDirect??oA,s=e.tmpDir??XE.tmpdir(),a=e.stage??(g=>{let h=qE(Js.join(s,"acbridge-")),v=Js.join(h,"managed-settings.json");return ab(v,g,{mode:420}),v}),l=e.voice??!1,{existing:u,json:p,changed:d}=iA(r,o,l),m=l&&u.allowedChannelPlugins===void 0;if(!d)return{path:r,changed:!1,json:p,usedSudo:!1,method:"unchanged",replacedDefaultAllowlist:m};if(n(Au(t,r)))return i(r,p),{path:r,changed:!0,json:p,usedSudo:!1,method:"direct",replacedDefaultAllowlist:m};let f=a(p);for(let g of lb(t,f,r))if(e.runElevated(g),o(r).trim()===p.trim())return{path:r,changed:!0,json:p,usedSudo:g.method==="sudo",method:g.method,replacedDefaultAllowlist:m};throw new Error(`could not write ${r} with elevation (canceled or unavailable). Run it manually:
|
|
15
|
+
${ub(t,f,r)}`)}var Cu={udpDstFixed:[4002,6666,6667],udpDstMulticast:[5353],udpSrcBroadcastReply:[9999,20002,38899,56700,1900,1982]},vi=[...Cu.udpDstFixed,...Cu.udpDstMulticast],bi=Cu.udpSrcBroadcastReply;function pb(e){return e==="app"?"AC Bridge (App)":"AC Bridge (CLI)"}var Pu=["domain","private"],mb="AC Bridge discovery",fb="AC Bridge replies",sA="macOS will still show one 'Local Network' permission prompt on your first scan \u2014 that prompt cannot be pre-granted; click Allow.";function Qr(e){return/you need to be root|need(?:s)? to be root|must be run as root|requires? (?:super\s?user|root)|operation not permitted|permission denied|are you root/i.test(e)}function pr(e,t,r={}){if(e==="win32")return"windows";let o=r.isWsl??Jr();if(e==="linux"&&o)return"wsl-host";if(e==="darwin"){let i=t.alfGlobalStateOut??"";return/firewall is enabled/i.test(i)||Qr(i)?"macos-alf":"none"}let n=t.ufwStatusOut??"";return/status:\s*active/i.test(n)?"ufw":(t.firewallCmdStateOut??"").trim()==="running"?"firewalld":Qr(n)?"ufw":"none"}function qs(e,t){if(e==="win32")return{};if(e==="darwin")return{alfGlobalStateOut:t("/usr/libexec/ApplicationFirewall/socketfilterfw --getglobalstate")};let r=t("ufw status");return/status:\s*active/i.test(r)?{ufwStatusOut:r}:{ufwStatusOut:r,firewallCmdStateOut:t("firewall-cmd --state")}}function aA(e,t){if(e.length===0)return{state:"nothing-to-do"};let r=e.map((s,a)=>e.length>1?`${t} (${a+1})`:t),n=e.map((s,a)=>{let l=r[a];return`netsh advfirewall firewall delete rule name="${l}" >nul 2>&1 & netsh advfirewall firewall add rule name="${l}" dir=in action=allow program="${s}" protocol=udp profile=${Pu.join(",")} remoteip=localsubnet enable=yes`}).join(" & "),i=r.map(s=>`netsh advfirewall firewall show rule name="${s}" verbose`);return{applyScript:n,checkCommands:i,evalCheck:s=>s.every((a,l)=>dA(a,e[l])),manualCommand:n,needsElevation:!0}}function cA(e){if(e.length===0)return{state:"nothing-to-do"};let t=e.flatMap(o=>[`/usr/libexec/ApplicationFirewall/socketfilterfw --add "${o}"`,`/usr/libexec/ApplicationFirewall/socketfilterfw --unblockapp "${o}"`]),r=e.map(o=>`/usr/libexec/ApplicationFirewall/socketfilterfw --getappblocked "${o}"`);return{applyScript:t.join(" && "),checkCommands:r,evalCheck:o=>o.every((n,i)=>mA(n,e[i])),manualCommand:t.map(o=>`sudo ${o}`).join(" && "),needsElevation:!0,userNote:sA}}function lA(){let e=vi.join(","),t=bi.join(","),r=`ufw allow in proto udp to any port ${e} comment '${mb}'`,o=`ufw allow in proto udp from any port ${t} comment '${fb}'`;return{applyScript:`${r} && ${o}`,checkCommands:["ufw status"],evalCheck:n=>fA(n[0]??""),manualCommand:`sudo ${r} && sudo ${o}`,needsElevation:!0}}function uA(){let e=vi.map(o=>`firewall-cmd --permanent --add-port=${o}/udp`),t=bi.map(o=>`firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source-port port="${o}" protocol="udp" accept'`),r=[...e,...t,"firewall-cmd --reload"];return{applyScript:r.join(" && "),checkCommands:["firewall-cmd --list-ports","firewall-cmd --list-rich-rules"],evalCheck:o=>gA(o[0]??"",vi)&&hA(o[1]??"",bi),manualCommand:r.map(o=>`sudo ${o}`).join(" && "),needsElevation:!0}}function Ks(e,t){switch(e){case"windows":return aA(t.programs,t.ruleName);case"macos-alf":return cA(t.programs);case"ufw":return lA();case"firewalld":return uA();case"wsl-host":return{state:"nothing-to-do"};case"none":return{state:"nothing-to-do"}}}var Tu="You're running inside WSL, so LAN device discovery is governed by the WINDOWS firewall on the host, not by ufw/firewalld inside this distro \u2014 changing those here has no effect on scanning. If scanning misses devices, allow the bridge through Windows Defender Firewall on the Windows side (and check that the network is set to Private, not Public).";function dA(e,t){if(/no rules match/i.test(e))return!1;let r=/Enabled:\s*Yes/i.test(e),n=/Program:\s*(.+)/i.exec(e)?.[1]?.trim().toLowerCase();return r&&n===t.trim().toLowerCase()}function gb(e){let t=[],r=/^(Domain|Private|Public) Profile Settings:/gim,o,n=[];for(;(o=r.exec(e))!==null;)n.push({profile:o[1].toLowerCase(),at:o.index});for(let i=0;i<n.length;i++){let s=e.slice(n[i].at,n[i+1]?.at??e.length);t.push({profile:n[i].profile,firewallOn:!/^\s*State\s+OFF/im.test(s)})}return t}function pA(e,t=Pu){let r=new Set(t.map(o=>o.toLowerCase()));return e.filter(o=>o.firewallOn&&!r.has(o.profile)).map(o=>o.profile)}function hb(e,t){let r=t.toLowerCase(),o=new Set;for(let n of e.split(/^Rule Name:/m).slice(1)){let i=s=>new RegExp(`^${s}:\\s*(.*)$`,"m").exec(n)?.[1]?.trim()??"";if(i("Program").toLowerCase()===r&&/^yes$/i.test(i("Enabled"))&&/^in$/i.test(i("Direction"))&&/^allow$/i.test(i("Action")))for(let s of i("Profiles").split(",")){let a=s.trim().toLowerCase();(a==="domain"||a==="private"||a==="public")&&o.add(a)}}return[...o]}function vb(e,t=Pu){if(pA(e,t).length!==0)return"This network is set to Public, and the LAN-discovery rule only covers Domain and Private networks \u2014 so Windows is still dropping the replies device scanning needs. In Settings \u2192 Network & internet, open this network and set its profile to Private, then scan again."}function mA(e,t){return e.includes(t)&&/is not blocked/i.test(e)}function fA(e){return/status:\s*active/i.test(e)&&e.includes(mb)&&e.includes(fb)}function gA(e,t){return t.every(r=>e.includes(`${r}/udp`))}function hA(e,t){return t.every(r=>e.includes(`source-port port="${r}"`))}function bb(e){let{platform:t,programs:r,ruleName:o,runElevated:n,runCheck:i}=e,s=e.isWsl===void 0?{}:{isWsl:e.isWsl};if(pr(t,{},s)==="wsl-host")return{backend:"wsl-host",status:"nothing-to-do",changed:!1,userNote:Tu};let l=pr(t,qs(t,i),s);if(l==="none")return{backend:l,status:"nothing-to-do",changed:!1};let u=Ks(l,{programs:r,ruleName:o});if("state"in u)return{backend:l,status:"nothing-to-do",changed:!1};let p=u.checkCommands.map(i);if(u.evalCheck(p))return{backend:l,status:"unchanged",changed:!1,userNote:u.userNote};let d=p.some(Qr);n(u.applyScript);let m=u.checkCommands.map(i);return u.evalCheck(m)?{backend:l,status:"changed",changed:!0,userNote:u.userNote}:d||m.some(Qr)?{backend:l,status:"changed",changed:!0,userNote:vA(u)}:{backend:l,status:"needs-elevation",changed:!1,manualCommand:u.manualCommand,userNote:u.userNote}}function vA(e){let t=`Added the LAN-discovery firewall rule, but couldn't verify it without root. If device scanning still misses devices, re-run: ${e.manualCommand}`;return e.userNote?`${e.userNote} ${t}`:t}function bA(e,t){switch(e){case"windows":return t.programs.length===0?null:t.programs.map((o,n)=>t.programs.length>1?`${t.ruleName} (${n+1})`:t.ruleName).map(o=>`netsh advfirewall firewall delete rule name="${o}" >nul 2>&1`).join(" & ");case"macos-alf":return t.programs.length===0?null:t.programs.map(r=>`/usr/libexec/ApplicationFirewall/socketfilterfw --remove "${r}"`).join(" && ");case"ufw":return`ufw delete allow in proto udp to any port ${vi.join(",")} && ufw delete allow in proto udp from any port ${bi.join(",")}`;case"firewalld":return[...vi.map(r=>`firewall-cmd --permanent --remove-port=${r}/udp`),...bi.map(r=>`firewall-cmd --permanent --remove-rich-rule='rule family="ipv4" source-port port="${r}" protocol="udp" accept'`),"firewall-cmd --reload"].join(" && ");case"wsl-host":case"none":return null}}function yb(e){let{platform:t,programs:r,ruleName:o,runElevated:n,runCheck:i}=e,s=e.isWsl===void 0?{}:{isWsl:e.isWsl};if(pr(t,{},s)==="wsl-host")return{backend:"wsl-host",status:"nothing-to-do",changed:!1};let a=pr(t,qs(t,i),s);if(a==="none")return{backend:a,status:"nothing-to-do",changed:!1};let l=Ks(a,{programs:r,ruleName:o}),u=bA(a,{programs:r,ruleName:o});if("state"in l||u===null)return{backend:a,status:"nothing-to-do",changed:!1};let p=l.checkCommands.map(i);if(!l.evalCheck(p)&&!p.some(Qr))return{backend:a,status:"unchanged",changed:!1};n(u);let d=l.checkCommands.map(i);if(!l.evalCheck(d)||d.some(Qr))return{backend:a,status:"changed",changed:!0};let m=t==="win32"?u:u.split(" && ").map(f=>`sudo ${f}`).join(" && ");return{backend:a,status:"needs-elevation",changed:!1,manualCommand:m}}import{spawnSync as yA}from"node:child_process";import{existsSync as xA,readFileSync as Xs,readdirSync as kA}from"node:fs";import{homedir as wA}from"node:os";import{join as wt,resolve as SA}from"node:path";var kb=()=>wt(wA(),".claude","plugins"),xb=e=>{let t=SA(e).replace(/[/\\]+$/,"");return process.platform==="win32"||process.platform==="darwin"?t.toLowerCase():t};function wb(){try{let t=JSON.parse(Xs(wt(kb(),"known_marketplaces.json"),"utf8"))?.[ze]?.source;return typeof t?.path=="string"?t.path:null}catch{return null}}function Ou(){try{let t=JSON.parse(Xs(wt(kb(),"installed_plugins.json"),"utf8"))?.plugins?.[`${Xe}@${ze}`]?.[0];return typeof t?.installPath=="string"?t.installPath:null}catch{return null}}var Ru=(e,t)=>{try{return Xs(e,"utf8")===Xs(t,"utf8")}catch{return!1}};function _A(){return["hooks/hooks.json",".mcp.json"]}function $A(e){let t=Ou();if(!t)return!1;let r=wt(e,"plugins",Xe);for(let i of _A())if(!Ru(wt(r,i),wt(t,i)))return!1;let o=wt(r,"dist","channel.mjs");if(xA(o)&&!Ru(o,wt(t,"dist","channel.mjs")))return!1;let n;try{n=kA(wt(r,"scripts"))}catch{return!1}return n.every(i=>Ru(wt(r,"scripts",i),wt(t,"scripts",i)))}function Sb(e){return t=>{let r=yA(e.file,[...e.argsPrefix,...t],{encoding:"utf8"});return{ok:r.status===0,out:`${r.stdout??""}${r.stderr??""}${r.error?r.error.message:""}`}}}function _b(e){let t=Sb(e.claudeCmd),r=(e.installedDir??Ou)(),o=(e.registeredDir??wb)(),n=r!==null&&t(["plugin","uninstall",`${Xe}@${ze}`]).ok,i=o!==null&&t(["plugin","marketplace","remove",ze]).ok;return{pluginUninstalled:n,marketplaceRemoved:i}}function $b(e){let{marketplaceDir:t,claudeCmd:r}=e,o=Sb(r),n=wb(),i=!1;if(n===null||xb(n)!==xb(t)){n!==null&&o(["plugin","marketplace","remove",ze]);let a=o(["plugin","marketplace","add",t]);if(!a.ok)throw new Error(`marketplace add failed:
|
|
16
|
+
${a.out}`);i=!0}let s=!1;if(i||!$A(t)){o(["plugin","marketplace","update",ze]),Ou()!==null&&o(["plugin","uninstall",`${Xe}@${ze}`]);let a=o(["plugin","install",`${Xe}@${ze}`]);if(!a.ok)throw new Error(`plugin install failed:
|
|
17
|
+
${a.out}`);s=!0}return{marketplaceRepointed:i,pluginReinstalled:s}}import{readFileSync as Db,writeFileSync as RA}from"node:fs";import{mkdirSync as IA,readFileSync as Ab,writeFileSync as EA}from"node:fs";import AA from"node:os";import Du from"node:path";function Cb(e,t="node"){return`${t} "${Du.join(e,"plugins","alexa","scripts","statusline.mjs")}"`}function Ys(){return Du.join(AA.homedir(),".claude","settings.json")}var Pb=e=>{let t=e.statusLine,r=t&&typeof t=="object"?t.command:void 0;return typeof r=="string"&&r?r:void 0},CA="plugins/alexa/scripts/statusline.mjs",PA="plugins\\alexa\\scripts\\statusline.mjs";function Nu(e){return e.includes(CA)||e.includes(PA)}function Ib(e){let t=e.statusline,r=t&&typeof t=="object"&&!Array.isArray(t)?t.prev:void 0,o=typeof r=="string"&&r?r:null;return o!==null&&Nu(o)?{prev:null,poisoned:!0}:{prev:o,poisoned:!1}}function TA(e){let t=e.statusline,r=t&&typeof t=="object"&&!Array.isArray(t)?{...t}:{};return delete r.prev,{...e,statusline:r}}function Tb(e,t){let r=Pb(e);return r===t?{settings:e,prev:void 0,changed:!1}:r!==void 0&&Nu(r)?{settings:{...e,statusLine:{type:"command",command:t}},prev:void 0,changed:!0}:{settings:{...e,statusLine:{type:"command",command:t}},prev:r??null,changed:!0}}function Rb(e,t){let r=t?.settingsFile??Ys(),o=t?.configFile??_e,n=t?.env??process.env,i=Eb(o),s=Eb(r),a=i.value,u=!(n.BRIDGE_STATUSLINE==="0"||n.BRIDGE_STATUSLINE==="false")&&a.autoStatusline!==!1;if(s.state==="corrupt"||i.state==="corrupt")return{enabled:u,changed:!1};let p=s.value,d=Cb(e,t?.nodeCommand);if(u){let v=Tb(p,d),{poisoned:k}=Ib(a);return!v.changed&&!k?{enabled:u,changed:!1}:(v.changed&&yi(r,v.settings),v.prev!==void 0?yi(o,{...a,statusline:{prev:v.prev}}):k&&yi(o,TA(a)),{enabled:u,changed:!0})}let m=Pb(p);if(!m||!Nu(m))return{enabled:u,changed:!1};let{prev:f}=Ib(a),g={...p};f?g.statusLine={type:"command",command:f}:delete g.statusLine,yi(r,g);let h={...a};return delete h.statusline,yi(o,h),{enabled:u,changed:!0}}function Eb(e){let t;try{t=Ab(e,"utf8")}catch{return{state:"absent",value:{}}}t.charCodeAt(0)===65279&&(t=t.slice(1));try{let r=JSON.parse(t);return r&&typeof r=="object"&&!Array.isArray(r)?{state:"ok",value:r}:{state:"corrupt",value:{}}}catch{return{state:"corrupt",value:{}}}}function yi(e,t){let r=JSON.stringify(t,null,2)+`
|
|
18
|
+
`;try{if(Ab(e,"utf8")===r)return}catch{}IA(Du.dirname(e),{recursive:!0}),EA(e,r)}var Ob=["mcp__plugin_alexa_alexa__list_devices","mcp__plugin_alexa_alexa__get_device","mcp__plugin_alexa_alexa__set_device","mcp__plugin_alexa_alexa__run_scene","Bash(acbridge devices *)","Bash(acbridge brief *)"];function OA(e){let t=(e?.env??process.env).BRIDGE_AGENT_PERMS;if(t==="0"||t==="false")return!1;try{if(JSON.parse(Db(e?.configFile??_e,"utf8")).autoAgentPermissions===!1)return!1}catch{}return!0}function DA(e,t){let r={};if(e!==null&&e.trim()!=="")try{let l=JSON.parse(e);if(typeof l!="object"||l===null||Array.isArray(l))return{next:null,corrupt:!0};r=l}catch{return{next:null,corrupt:!0}}let o=typeof r.permissions=="object"&&r.permissions!==null&&!Array.isArray(r.permissions)?r.permissions:{},n=Array.isArray(o.allow)?o.allow:[],i=t?[...n,...Ob.filter(l=>!n.includes(l))]:n.filter(l=>!(typeof l=="string"&&Ob.includes(l)));if(i.length===n.length&&i.every((l,u)=>l===n[u]))return{next:null,corrupt:!1};let s={...o};i.length>0?s.allow=i:delete s.allow;let a={...r};return Object.keys(s).length>0?a.permissions=s:delete a.permissions,{next:JSON.stringify(a,null,2)+`
|
|
19
|
+
`,corrupt:!1}}function Qs(e){let t=e?.settingsFile??Ys(),r=OA({configFile:e?.configFile,env:e?.env}),o=null;try{o=Db(t,"utf8")}catch{o=null}if(o===null&&!r)return{enabled:r,changed:!1,corrupt:!1};let n=DA(o,r);return n.corrupt?{enabled:r,changed:!1,corrupt:!0}:n.next===null?{enabled:r,changed:!1,corrupt:!1}:(RA(t,n.next),{enabled:r,changed:!0,corrupt:!1})}import{existsSync as NA,mkdirSync as LA,readFileSync as UA,writeFileSync as jA}from"node:fs";import Lb from"node:os";import ea from"node:path";function eo(e=Lb.homedir()){return ea.join(e,".codex","hooks.json")}function Ub(e,t="node"){return`${t} "${ea.join(e,"plugins","alexa","scripts","codex-signal.mjs")}"`}var jb=["SessionStart","UserPromptSubmit","Stop","PermissionRequest","PreCompact","PostCompact","SubagentStart","SubagentStop","PostToolUse","SessionEnd"],zA="plugins/alexa/scripts/codex-signal.mjs",FA="plugins\\alexa\\scripts\\codex-signal.mjs";function MA(e){return e.includes(zA)||e.includes(FA)}function ta(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;let t=e.hooks;return Array.isArray(t)?t.some(r=>{if(!r||typeof r!="object")return!1;let o=r.command;return typeof o=="string"&&MA(o)}):!1}var BA=e=>({hooks:[{type:"command",command:e,timeout:10}]});function HA(e){let t=[];for(let[r,o]of Object.entries(na(e)))Array.isArray(o)&&o.some(ta)&&t.push(r);return t}function zb(e){if(e===null)return new Map;let t;try{t=JSON.parse(e)}catch{return new Map}let r=new Map;for(let[o,n]of Object.entries(na(t))){if(!Array.isArray(n))continue;let i=n.findIndex(ta);i>=0&&r.set(o,i)}return r}function na(e){let t=e&&typeof e=="object"&&!Array.isArray(e)?e.hooks:void 0;return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}function Fb(e){let t=new Map;for(let[r,o]of Object.entries(na(e))){if(!Array.isArray(o))continue;let n=o.filter(i=>!ta(i));n.length>0&&t.set(r,n)}return t}function ZA(e,t){let r=Fb(e);for(let o of jb){let n=r.get(o)??[];n.push(BA(t)),r.set(o,n)}return{hooks:Object.fromEntries(r)}}function GA(e){return{hooks:Object.fromEntries(Fb(e))}}function WA(e){return Object.values(na(e)).some(t=>Array.isArray(t)&&t.some(r=>ta(r)))}function VA(e){return JSON.stringify(e,null,2)+`
|
|
20
|
+
`}function Lu(e){try{return UA(e,"utf8")}catch{return null}}function JA(e){if(e===null||typeof e!="object"||Array.isArray(e))return!1;let t=e.hooks;return t===void 0||typeof t=="object"&&t!==null&&!Array.isArray(t)}function qA(e){if(e===null)return{value:void 0,corrupt:!1};let t=e.charCodeAt(0)===65279?e.slice(1):e,r;try{r=JSON.parse(t)}catch{return{value:void 0,corrupt:!0}}return JA(r)?{value:r,corrupt:!1}:{value:void 0,corrupt:!0}}function KA(e){return qA(Lu(e))}function XA(e){let t=Lu(e);if(t===null)return{};try{let r=JSON.parse(t);return r&&typeof r=="object"&&!Array.isArray(r)?r:{}}catch{return{}}}function YA(e){let t=XA(e?.configFile??_e),r=e?.env??process.env;return!(r.BRIDGE_CODEX_HOOKS==="0"||r.BRIDGE_CODEX_HOOKS==="false")&&t.autoCodexHooks!==!1}function Mb(e,t){let r=t?.home??Lb.homedir(),o=eo(r),n=t?.configFile??_e,i=t?.env??process.env,s=YA({configFile:n,env:i});if(!NA(ea.dirname(o)))return{enabled:s,skipped:!0,changed:!1,corrupt:!1};let{value:a,corrupt:l}=KA(o);if(l)return{enabled:s,skipped:!1,changed:!1,corrupt:!0};if(!s)return WA(a)?Nb(o,GA(a),s,l):{enabled:s,skipped:!1,changed:!1,corrupt:l};let u=Ub(e,t?.nodeCommand),p=HA(a),d=Nb(o,ZA(a,u),s,l);if(d.changed&&p.length>0){let m=jb.filter(f=>!p.includes(f));if(m.length>0)return{...d,addedEvents:m}}return d}function Nb(e,t,r,o){let n=VA(t);return Lu(e)===n?{enabled:r,skipped:!1,changed:!1,corrupt:o}:(LA(ea.dirname(e),{recursive:!0}),jA(e,n),{enabled:r,skipped:!1,changed:!0,corrupt:o})}import{existsSync as nC,mkdirSync as rC,readFileSync as Hb,writeFileSync as oC}from"node:fs";import iC from"node:os";import ju from"node:path";import QA from"node:os";import eC from"node:path";function ra(e=QA.homedir()){return eC.join(e,".codex","config.toml")}function tC(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1_$2").toLowerCase()}function Uu(e,t){let r=zb(e);if(r.size===0)return{known:!0,untrusted:[]};if(t===null)return{known:!1};let o=new Set;for(let i of t.split(/\r?\n/)){let s=i.trim();if(!s.startsWith('[hooks.state."')||!s.endsWith('"]'))continue;let l=s.slice(s.indexOf('"')+1,s.lastIndexOf('"')).split(":");if(l.length<4)continue;let u=l[l.length-1],p=l[l.length-2],d=l[l.length-3];u==="0"&&o.add(`${d}:${p}`)}let n=[];for(let[i,s]of r)o.has(`${tC(i)}:${s}`)||n.push(i);return{known:!0,untrusted:n}}var zu="# >>> AC Bridge managed (acbridge setup) \u2014 do not edit >>>",xi="# <<< AC Bridge managed <<<";function Bb(e){return`"${(e.length>=2&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e).replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}var sC=["list_devices","get_device","set_device","run_scene"];function aC(e,t="node"){let r=ju.join(e,"plugins","alexa","dist","channel.mjs");return[zu,"[mcp_servers.acbridge]",`command = ${Bb(t)}`,`args = [${Bb(r)}]`,"","[mcp_servers.acbridge.env]",'ACB_AGENT = "codex"',...sC.flatMap(o=>["",`[mcp_servers.acbridge.tools.${o}]`,'approval_mode = "approve"']),xi].join(`
|
|
21
|
+
`)}function oa(e){return e.split(/\r?\n/).some(t=>{let r=t.trim();return r.startsWith("[mcp_servers.acbridge]")||r.startsWith("[mcp_servers.acbridge.")})}function cC(e,t){let r=e??"",o=r.indexOf(zu),n=r.indexOf(xi);if(o>=0!=n>=0||o>=0&&n<o)return{next:null,blocked:"malformed"};if(o>=0){let i=r.slice(0,o),s=r.slice(n+xi.length);if(t===null){let l=(i.endsWith(`
|
|
22
|
+
|
|
23
|
+
`)?i.slice(0,-1):i)+s.replace(/^\n/,"");return{next:e===null?null:l,blocked:null}}return oa(i)||oa(s)?{next:null,blocked:"foreign"}:{next:i+t+s,blocked:null}}return t===null?{next:e,blocked:null}:oa(r)?{next:null,blocked:"foreign"}:e===null||r===""?{next:t+`
|
|
24
|
+
`,blocked:null}:{next:r+(r.endsWith(`
|
|
25
|
+
`)?"":`
|
|
26
|
+
`)+`
|
|
27
|
+
`+t+`
|
|
28
|
+
`,blocked:null}}function Fu(e){let t=(e?.env??process.env).BRIDGE_CODEX_MCP;if(t==="0"||t==="false")return!1;try{if(JSON.parse(Hb(e?.configFile??_e,"utf8")).autoCodexMcp===!1)return!1}catch{}return!0}function Mu(e){let t=e??"",r=t.indexOf(zu),o=t.indexOf(xi);if(r>=0!=o>=0||r>=0&&o<r)return{installed:!1,blocked:"malformed"};let n=r>=0?t.slice(0,r)+t.slice(o+xi.length):t;return oa(n)?{installed:r>=0,blocked:"foreign"}:{installed:r>=0,blocked:null}}function Zb(e,t){let r=t?.home??iC.homedir(),o=ra(r),n=Fu({configFile:t?.configFile,env:t?.env});if(!nC(ju.dirname(o)))return{enabled:n,skipped:!0,changed:!1,blocked:null};let i=null;try{i=Hb(o,"utf8")}catch{i=null}let s=n?aC(e,t?.nodeCommand??"node"):null,{next:a,blocked:l}=cC(i,s);return l?{enabled:n,skipped:!1,changed:!1,blocked:l}:a===null||a===i?{enabled:n,skipped:!1,changed:!1,blocked:null}:(rC(ju.dirname(o),{recursive:!0}),oC(o,a),{enabled:n,skipped:!1,changed:!0,blocked:null})}function Gb(e){let t=/(\d+)\.(\d+)\.(\d+)/.exec(e??""),r=Number(t?.[1]??0),o=Number(t?.[2]??0),n=Number(t?.[3]??0);return{ok:r>2||r===2&&(o>1||o===1&&n>=80),version:t?.[0]??null}}function Wb(e){return{ok:new RegExp(`${Xe}@${ze}`).test(e??"")}}function Vb(e){if(e===null)return{present:!1,allowed:!1};let t;try{t=JSON.parse(e)}catch{return{present:!1,allowed:!1}}return{present:!0,allowed:t.channelsEnabled===!0&&Array.isArray(t.allowedChannelPlugins)&&t.allowedChannelPlugins.some(o=>o.marketplace===ze&&o.plugin===Xe)}}import{existsSync as lC,readdirSync as uC,readFileSync as dC}from"node:fs";import Jb from"node:os";function pC(e,t,r){let o=r.readFile(`${e}${t}plugins${t}installed_plugins.json`);if(!o)return!1;try{return!!JSON.parse(o)?.plugins?.[`${Xe}@${ze}`]}catch{return!1}}function mC(e){return/^\\\\(?:wsl\.localhost|wsl\$)\\([^\\]+)\\/i.exec(e)?.[1]??null}function fC(e){let t=e.platform==="win32"?"\\":"/",r=(s,a,l,u,p)=>{let d=`${s}${t}.claude`;return{id:l,label:u,kind:a,home:s,claudeDir:d,claudePresent:e.exists(d),pluginInstalled:pC(d,t,e),setupHint:p}},o=e.env.WSL_DISTRO_NAME,n=e.isWsl?`this environment (WSL${o?`: ${o}`:""})`:e.platform==="win32"?"this environment (Windows)":"this environment",i=[r(e.homeDir,"current","current",n,"acbridge setup")];for(let s of yu(e)){let a=`${s}${t}.claude`;if(e.exists(a))if(e.isWsl){let l=s.split("/").pop()??e.userName;i.push(r(s,"windows",`windows:${l}`,`Windows (user ${l})`,"run `acbridge setup` in a Windows terminal"))}else{let l=mC(s)??"wsl";i.push(r(s,"wsl",`wsl:${l}`,`WSL: ${l}`,`wsl.exe -d ${l} -- acbridge setup`))}}return i}function qb(){let e=n=>{try{return dC(n,"utf8")}catch{return null}},t=n=>{try{return uC(n)}catch{return[]}},r="";try{r=Jb.userInfo().username}catch{r=process.env.USER??process.env.USERNAME??""}let o=process.platform==="linux"&&!!(process.env.WSL_DISTRO_NAME||process.env.WSL_INTEROP||/microsoft/i.test(e("/proc/version")??""));return fC({homeDir:Jb.homedir(),env:process.env,platform:process.platform,userName:r,isWsl:o,readFile:e,listDir:t,exists:n=>lC(n)})}import{spawnSync as gC}from"node:child_process";import{existsSync as hC,readdirSync as vC,statSync as bC}from"node:fs";import{basename as Kb,join as yC}from"node:path";function Xb(e){try{let t=gC("git",["-C",e,"rev-parse","--abbrev-ref","HEAD"],{encoding:"utf8",timeout:2500}),r=(t.stdout??"").trim();return t.status===0&&r?r:"\u2014"}catch{return"\u2014"}}function xC(e){try{return vC(e,{withFileTypes:!0}).filter(t=>t.isDirectory()&&!t.name.startsWith(".")&&t.name!=="node_modules").map(t=>yC(e,t.name)).sort((t,r)=>t.localeCompare(r))}catch{return[]}}function kC(e){try{return hC(e)&&bC(e).isDirectory()}catch{return!1}}function Yb(e,t,r){let o=r==="root"?xC(t):kC(t)?[t]:[],n=new Set(e.map(s=>s.path)),i=o.filter(s=>!n.has(s)).map(s=>({path:s,name:Kb(s),bridge:Kb(s),branch:Xb(s),fav:!1}));return[...e,...i]}function Bu(e,t,r){return e.map(o=>o.path===t?{...o,...r.bridge!==void 0?{bridge:r.bridge}:{},...r.fav!==void 0?{fav:r.fav}:{}}:o)}function Qb(e){return e.map(t=>({...t,branch:Xb(t.path)}))}import{spawnSync as wC}from"node:child_process";import{existsSync as SC}from"node:fs";import ey from"node:path";function _C(e,t){let r=e==="win32"?ey.win32:ey.posix,o=e==="win32"?"bridge-node.cmd":"bridge-node";return r.join(t,"bin",o)}function ty(e){let t=/(\d+)\.(\d+)\.(\d+)/.exec(e??"");return t?{major:Number(t[1]),full:t[0]}:null}function to(e){if(e.shimExists()&&ty(e.runShimVersion())!==null)return{kind:"shim",command:e.shimPath};let t=ty(e.runNodeVersion());return t!==null&&t.major>=20?{kind:"system",command:"node",version:t.full}:{kind:"none"}}function ia(e){return e.kind==="shim"?`"${e.command}"`:void 0}function no(e,t=process.platform){let r=_C(t,e),o=(n,i)=>{try{let s=wC(n,i,{encoding:"utf8"});return s.status===0?s.stdout??"":null}catch{return null}};return{platform:t,shimPath:r,shimExists:()=>SC(r),runShimVersion:()=>t==="win32"?o("cmd.exe",["/c",r,"--version"]):o(r,["--version"]),runNodeVersion:()=>o("node",["--version"])}}function sa(e={}){let t=e.configFile??_e,r={},o=N(t);if(o)try{r=JSON.parse(o)}catch{r={}}return{claudeBin:typeof r.claudeBin=="string"?r.claudeBin:null,codexBin:typeof r.codexBin=="string"?r.codexBin:null,relayUrl:typeof r.relayUrl=="string"?r.relayUrl:null,hubPort:typeof r.hubPort=="number"?r.hubPort:null,onboardedAt:typeof r.onboardedAt=="number"?r.onboardedAt:null}}function aa(e,t={}){let r=t.configFile??_e,o={},n=N(r);if(n)try{o=JSON.parse(n)}catch{o={}}for(let[i,s]of Object.entries(e))s===null?delete o[i]:s!==void 0&&(o[i]=s);return we(r,JSON.stringify(o,null,2)+`
|
|
29
|
+
`,384),o}import{createHash as $C,randomBytes as ny}from"node:crypto";var Hu=e=>e.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");function ry(){let e=Hu(ny(32)),t=Hu($C("sha256").update(e).digest());return{verifier:e,challenge:t}}function oy(){return Hu(ny(24))}var IC="https://api.workos.com";var EC="client_01KW2CY31D0NZKCDKNHF2XQ7VC",AC="org_01KW0DNZ14H6JMK8RHA0WSKNVZ";function iy(e=t=>process.env[t]){let t=e("WORKOS_CLIENT_ID")??EC,r=Number(e("WORKOS_REDIRECT_PORT")??8765)||8765,o=(e("WORKOS_API_HOST")??IC).replace(/\/+$/,""),n=e("WORKOS_REDIRECT_URI")??`http://127.0.0.1:${r}/callback`;return{clientId:t,apiHost:o,redirectUri:n,port:r,organizationId:e("WORKOS_ORG_ID")??AC,configured:!!t}}var CC={google:"GoogleOAuth",github:"GitHubOAuth",microsoft:"MicrosoftOAuth"},ca=class extends Error{constructor(r,o){super(o);this.kind=r;this.name="AuthError"}kind};function la({cfg:e,opts:t,state:r,codeChallenge:o}){let n=new URL(`${e.apiHost}/user_management/authorize`),i=n.searchParams;return i.set("response_type","code"),i.set("client_id",e.clientId),i.set("redirect_uri",e.redirectUri),i.set("state",r),i.set("code_challenge",o),i.set("code_challenge_method","S256"),t.prompt&&i.set("prompt",t.prompt),t.provider==="google"||t.provider==="github"||t.provider==="microsoft"?i.set("provider",CC[t.provider]):(i.set("provider","authkit"),t.screenHint&&i.set("screen_hint",t.screenHint),t.provider==="sso"&&e.organizationId&&i.set("organization_id",e.organizationId),t.email&&i.set("login_hint",t.email)),n.toString()}function PC(e){return{id:e.id,email:e.email,firstName:e.first_name,lastName:e.last_name,profilePictureUrl:e.profile_picture_url}}async function TC(e,t,r){try{return await r(`${e.apiHost}/user_management/authenticate`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({client_id:e.clientId,...t})})}catch(o){throw new ca("network",o instanceof Error?o.message:"Network error reaching WorkOS.")}}async function RC(e,t,r){let o=await TC(e,t,r),n=await o.text().catch(()=>"");if(!o.ok)throw new ca("rejected",`WorkOS ${o.status}: ${OC(n)}`);let i=JSON.parse(n);return{user:PC(i.user),accessToken:i.access_token,refreshToken:i.refresh_token}}function sy(e,t,r,o=fetch){return RC(e,{grant_type:"authorization_code",code:t,code_verifier:r},o)}function OC(e){try{let t=JSON.parse(e);return t.error_description??t.message??t.error??e.slice(0,200)}catch{return e.slice(0,200)||"request failed"}}import{createServer as zC}from"node:http";var ro="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAD9CAYAAABTCakVAAA+DElEQVR42u1dd7wdVfFP6L0pTUoABZGqIB1CBAICQghpgCACIQgo6E8RUEKNoCDFghCUngoSVARBQoBEaSKELkoHAUFqSPLevbs7vz3cOb5z550yZ+/e93bvnj/m85LbdveU75nynZkBADAgSJAg1ZQwCEGCBAAIUlJZNJV1U9k2leGpHJbK91P5TSrTU7kjlRdTeT+Vhal0p1JHiZR/C+lK5YNUnk/lIfzuTalMTuWXqXwzlRGp7JHKZ1JZPIx/AIAgfSNLp7JbKl9L5XLcmC/ipq7hxu7Cvwvx32KDx7i5Y0US5W+i/D/WfE6CRE25Tg1fE//+MJV/Idj8NJWvprJXKiuGOQsAECSbLJ/KvqmcmcqMVN5UTmwpiWZDS4kMr9PvJBoQcL2u/k5kAA8JHP9J5XepTEhl71SWCHMbACBIb1kfT06htv9TObEj8ld3gseWUzxhfIcrLgDRaRQR0UKEVjI7lXNT2RO1mjD/AQAqJ+IkPCiVSam8ihukptjisWXzuTZjbPl+3hIzNAodeMnnXJDKozgOh6eySlgbAQA6VdZJ5RhUiRcqKr3tpE4YQBAZQCE2gELcwkZPmKaES/OINc8gAHA+mjzjUvlkWDMBAMosn0CPvPCeP6ac8DFRjxOGeh47bHGfU7mV0z7JYErEjN+i5o50OArt4LJUxiCAhnUVAKDQMjCVoRg2W6g5nblqeZzRNk+Ym1+8Dxk3fxatwgVgNr+F6vi8FSMMi4S1FgCgSCLi8Gen8pISMos04TfI4cT0OZld1wNozfbPw88QM8yMmDgTX0nlrFTWCmsvAEB/EnBGp3IXcd6Z4ul5ONVsm76dTr/Y42TP8l2T38IU6pTgKrSs36YyBLWvsC4DAPSJmj8OvfcR8XKbNnTUYijO9p3IQejhnN6tOgFjyO4ETCwbPbGAKvWlCDLSiaksFdZoAIB2yOLoxX9GUfFdaisNg0EG1TpxgEfEDAXqfg8yqvxxBhMlZpgtNm6DbWwjJarybCpHBZpyAIC8ZMlUvqfE613U2azEGd1nIaeTOWaYDe0yEbjhQpcJYHIWRobXXsGciEA2CgCQmazzbdz4NQ0FN3FQbaknuxWnWWRQ9yWpJnFsklY2MUcLyeIHcAFXFqG/LcbmjVROChpBAACurJTKaam8rsmaa3WxZnUAxuDnjc8rxOgr0AIPgKMB+DgQqcPwDeRkfDqs8QAAOhHOo9MxbTYyeJ5jhvoaW2xV7gkaA98J6Lpeqw5An1i+Dgg4Dj+OEzDxAFnbs3dh1uLKYc0HAJByOKbWdms2D01q4XiubTx4zsbgpuq6Tr88Tn3XaZvVqcl9Bs64+mhXkpH5VionYDg3AEBFZQdoFL6IDIvK5M3P4gRsxRa3/XakkTqJVNQNn7P9hqo+14k5FFl+z9dM4ZgAEUPb0WlsLjMrRuD/cgCAasmKmHpbJ4s9Ypw4rhPMFqvmbmrXe+rG7Fb486JuwKxUrk/lJ6kcm8pIaBQS+RzmJ7hotAPRASpqEmwAjeo/e+LviPDa+Uh1vg3t6roCOImn6dKKBpB4Oj1ddOObUxkUAKDzZTcMEdUZarqNzBNnVNu54TAdgIh/z0vl9lSuwQ05GDdrf3m5F0tlM0zY+TU0yoh9BM3VhGynNjf27wMeiQVUIsP91PC+T4GKFS6pEoPvuxY731VIw+VY82X6xZpQX0ROd7Eo70vlEmjUD/hsicZ7TWjUKDwbk3i68HlisFc1ckUKErKJI+BXPeJEWsQ9/qVKeQZVeEixcf4KPXXyIsbm57zPobuakoHod2tKost1qRzaYTnxK6AZIUJxTxv8LlwWYpYcBI45kijzIMqZfS0AQPkTds6ARuWZmkEd5XjZIyb1l2NzUqebSGj5YypHp7JxhVRPWSDlD4p2QB2QrRCBXCaAaa7qxJEqCrisEQCgfCKKaj5l8G5zNr6PeeBagJSv/g90pu0KoVCmrHi8OzounyYRh9ihsXFCnjFT09CZF0LeSWU8+loCAJSAu389OVHqHqE+HycgJ1NNXltQin+cyoZhwztlA2RjPkfGkGuy2cwzFylLt0YkIL2cyk4BAIory6AXmtbbizRkHl+GmcleNYGKDNFNwzBayFfP5rj9MppI3QbzIAIeNyO2mHEmDUAnwlw5IABA8UR0qnmCbH4TAEQWGz9h2I6xIzVVLJILUvlU2MS5agW/UYDAh2XJIRu5AF2+JxuwfCMAQHFkWCrvWSiiNB6dWMJKJvtdx56jav6b6HQM5a3b20PhYujpiOTiGiSO9OHEcVjQ79cV3sBVnUAlLvuC+D64y3HFnj6A2JEMpP5fLATRS+94NEHCJu0bEXF60XHoXYVfkEUL8DUB6PsPlJ0zUOZ8/SmWEyCxoLor2YdjAsgyVMciGy5syv6RldFD/4EjIsAtaRaBu0IxPQBEPsF2AQD6tub+3YwMMWoCRB48APqeSh1+E0/8UJ66OLIqpvl2KTF8myPQpgFETE0yIX6fkQEA2i9DEXE5seHYQubh5pOrAPAqhqdCLnlxRYRZL0WfkIub0YoJoAOVbrz2CgEA2iMjNCG+VjSAyJEgIr/3dionB9JO6UyDCw18EB8nIEcDoKFfUZh09QAA+YpgzX0I7vp6WZ2AOi+/mNArUlktbKjSyuaYB1LXRIISh53v0iRt0aTZSEoLAJCD7I9psN2GSeSq/xFzUsW/56aybdhAHSNHo+8mYmYeRox1lIC9TPkdZTAHij5xI3Hj22ywLCZAonlfOo9+FjZMR4rQ5GYqZkFiiAL4agCRhWMwu+ggUPTNXwNe+a3YAQARAwBEnbhRYaN0tCyGiVj1DExAV2k4U9n2hzFyFQDAU+3v1iBs5AkAsQMA5OafUibHTZCW5YsKdZzjK0rA3NbdlYMgrvFoUddXUTf/QgcyJx5RAN3ESjrnf8savw2SSyn4X5FsQ1u5MhNARMCrTfA48hUCAFhEZH99pJz+Ols/yagB1Mlr9yO3PGyGasvB6GSOHGHAyOKDShwORskanFs0HknRQn0fgbmKblYNQJ1UMQmi3NO3ApMviCIic/Nq6F2ZyIcH4GIZSiez4AmsGQCgWdbDjRkxHX1ZnIBiAp6BChV8DOIteyssQheblOME1OWciHV4b1EOoKKg7/OErBF58rhtoRuJvKIU1zolXZiiQOghqexVwHsbginZnVL0ZDeFdFZ3rEFuiTLqjBa/e20AAIBlU3nMwcpztehKQF8ySr4m/Al3lThPX9iMLysL54KC2c9yXm7tsCjBq5owtIkHwKkPqStMc2HVAeBmaG5jZVKnIk8noKr6i042ZWkPPQb9E2oX2xPI4pmnUR/bnZIs4tjfSWUcgrZ8/XZlzAXQbqa8JzSWK6HRe7GMILA2moy+TEAuAMQY7Tq8qgDwc4fqngC/SaeumqtYkD8u0YI7X0koeU+JG19Dnq1biV6ISrVzFOfSlm26t/vxGjVkt8nX34XmphpfwdePUUyvGmZxlhEEhNY4yxEh8AWAmDgGBQjsWTUAOMJCqOC24jY1i5De/mNKtNAGIhNRJScdgu9N1jyb3OjHQ3MT0NltuLdBmhCq9KXMh+bOuwcomoFaY//0kvMFfmehk+sqSbkAgB5eIuN0g6oAwM5KYg+3BTU3DCg3yEElW2QraUJQ4/G9SeT5xNhtje9NI4tyfhvMgcGElyGutx/RAOS97Y6v/5OcmD8hv1m2EKyo/XdVRhMgYSQYibl/qj/yBvp6IHdA9p0LKTmluyjdUvx9HQGmDE6mbRXP+Wc0DqLx+P55mqjGevi9O8l4LVDCnOK7h0GjbiK3H4HognMuOhpH4Gs7aZxhwxTTQNUApO/iBaLN/ERRqX+HgPIMrocyaWmnQqP6T8JMBuIUplFBYHZfE4X6cgAHKWpuzNj8piytxAAOwpbasQQLaSpOttgE1yljQxeH1AC2VgCujhx2+VtzSOh0gaJKTsBrCPkAeHUNHlFU3W6kZUuNTTU1hivMTfnedcrvPEFMgFPx9ZOIpnNPCU2C77WgAego6THxl9zZlyHVvszC+hu4mzP4OgHl4ImFv29JPMsRcVSKjbmcspEkH+I4ooYLFfQK5fQfgKE31ZQS47AivvcOMYuOYPAxIqJpTMLrdUFzy64toLlC7xCyaK/E55GLem98/SriT/hvSf0C1xjCepwu05HhNTUl/cxOA4ATLCc4tye8CRy6lROp6LIX0WhquLnFe38hC2Ebxu9dRjSAV5X3FhL1fLzjtzbSgOvviabRjeq9y4bfAL8jNL6J0FM//3qyDt4rKQAsgv4XUyKRSwPQ5bhQzWDLTgGAldA2j0j6JZdNZSvqGJXM4bc/meganp6yoKVQwd9P5RLm722KJ70Ek2OVBTqfhJvOdfzWJhqQvlmx3Segb2A9T7tZ/f+15BpvlDg6IMZ4BsMH4HICmnwDd3YKAFznoPJyQoG65h3dGAYr06IZrgGAXXMg6QxDx6L6ek0BSfHvcxy/s5lmzG/J+fnPg+b2XnM6IKV4jobMxuEB2DJW5XePKDsAjAG/fu4ub6qKmD8q4YL5EvSuUrtem67VRez5sxnaBNWy/tiG6If0DdQZoFSWUmPPgr1DkU3Vt7EM32l3/ko7B2YtJeRnqsHmovOasqmuL+liWRo98vJZ/t7Ga3WTsZvA1ADaCQDyOqcgBbZTuiqtm8prFie3LlyYMGjGAlRuKysA3Gng87uce7Z6AGLzz4RyN2UUYb0HU3kolc+38To1spBcGsDmmgV4R0gRZstWmKdhWuOcdOJIE/4Wa/6osgHAGZpUSo7t79IAZqFTMSw4PgBIJ+AEBgBQs+tPYRy9U6PfAX7FYZcJIF8TWuP2ZQGAHZRQlqnvmg0IdBqA+K0XMfmligtrdXR4HknUZuGd/y2mC4u2VMtoTACuE3BzzYINGoC/DAV9NeuICQIm7eAlkolZSABYAimeNjXeRQDSaQACAEZXYPGIbLqRhLUnNv/zCknkUuU9lVlXQ16AzgnIMQE20SzO28OGzpzpWnfQ2WNNlqGt7ZiYw4uKDgBngbkza9ayXmJQpldg0ZyrUIRfg55a8t8mlFGhDsr6BjeTBfU2AQCVLenSAHRRgAAA2Ss4/VuTRanrQmV6j/q+pD9g66ICwHqEfRYznYA2TrV44H9VQPUXav1HyjPXMYQq2XPq+HRh0o54by5570OFpbeAUIHPYnjn6YK8K2zmzLIHyXuIHMlAJicgPRDvLyoA3AT6cl6JJ82Xqj7bV2CxbESyGsUY/hB66gHQfgYb4XtPk037rsK+W0CYgGcxNACqgs4MG7klOUc5vaMMPADTnhhbNAD4Apg78CSOTL/EMhgndejC2IVkLm6nbG41HZgCgGRAfg7fm01MrhctuQAuH8CWGhMgOAFbTyGeA/py4z4mAN0vL0NOZe7yetCrHCm7nI6sMckhv69DF8X1iq1/uhJDrpNxOA3fu5SMjTABZOGIX5DFdZNynQWeTMAtNCGoAACty/qE/MVpX+dyjou/hxYFADYhpw2nMIKLL/0SlLeEt002JJmA7yOSr6ikzsr3xykbc4FCn51E8gAuRFv9JjJmCwiZ5BwmAAQnYP4yTJk/Uz0AW99BnVn9FORQWSmPh/sruJtwJgbtQEeJFCfjzh26EA7QTOyqRJ2XabeDCNX05FS+6sGCnE+YgC4i0KYaDeDOsHlzkx+BuQK2jxNQfe//+hsAdteEOmIL3TF2RALqmD/eqYvgMM14yY0uCnL8EhoVg4blcK0FxAdwDkOTo/ZpMAHy5cg8RXw2Lh6AK9X4DUL+6nMAeJC50W0AoLIERfx75Q5eBMcQAKiTkz5PWUCYgC4fwGZ9mAswsKIgsCM0l1eLDAxYsDgBgRyY3+8vANg9Q0afyUEo7dRvdvgCOA56NyttFwDMJ0BzFkMDoDbon9vAd5iEPqOnlHBmleQqgy+A4wTURc7+Cy10vWrlQWYT50SU0QSQn3mmApN/HNEABACs3eJvrogU4nUtJgAnCvA5DUst72Sgo0mo84YKAsAncNNGYK4IZCPK6ajFZ/Q1AOxKsv04JkBkAQC1nFUny+EapmMrDSE2RvpvhCzAbTUAwE0G2lQzZ2q/v3UUenJWmUJA5uGKmgIXMjSAxLJf6PtvZfUFZH2AWzXJDhGD7GP69zvQU822k+Vg6N0ldg3l/UGYTbYU8/cuJuzBqcp7H3maABtrnIC3KHkKXWi/XsG8t8Whdyny28g1nqwoAKwHzaXRspgA9HA9pa8AYEdiw5jKdrmcgOrnD6/IxO9P1D5hCy+tqMeyjr9IJFkLehdXpbbe3WS8n7f4AFwawLoayul0dMp2EdByNfQQ/oQX8FnmQk8vwxtJmvgDFY4KjCdJPnXgtR9PDAfrW1kc6Flu/B7gNem0OQFVraFKsealka8v4/0PKe+9Rk7zccp7VyosQLVQ5FwCpO8RDcAnCrAYLiLVQXk+9NR3UOf3cOV5LsasRLUB6NWgbwxygRILT9AkqDJN+HFCEOIyAU0AcXa7AWAT6F3swMcJqIv7f75iEy9i/K8gb3+ospFq5HQcr/hbasp4CXNpSXzvMbI531Ku8yEhAp3FuDeRgTgPf1MkGq0JjUKmdM5PhOYqvzW8L1mt6WGyqC+EnjqRTynPsWOFAUDI3tDTJ9PGBOT20xAHwLLtBIDziRc78TABdOrNbRVfAFLW1rDEZJ7AEdC7pfSu0FMPQN2cswgA+KQDq1qKWql4Gw15RWonc4jJcADSU/9BDoWfayIOq4V5/1gLuE+TLMTlz+j22YntAoDF0eOctYOvTrYLi+BjWVnRAGgy0MmabMC9lbBit7LJVR7Fm8qCqilqeJZIA2UvSqbic+T1w/D1R4nP4MIwx0bZTfGxxBlNAPW1J9oFAEdCc62/xFMDoNGCe8LkN50E/yGq4LeUnHKaK7G38j3hoZ+hcfLNVuar3oKjdRGMW0uAWqhEbF4kGoC8xlToKWMl/n4nzLFV7mM4AROHE1A194a0AwDuz3DKJ4bEhrrPTVZELlI2q9jkstX2DzQawO6M3xuCm7WG0YFWKNZ7obovnFaHKK8/S7QM+d4ueO1uNEU2CPPrTBJTfQGmZCCVCpwYXo98nKvcG/y0JlRhcgK6CAwRqohh4nvb3mchVXYf5fV9yfgKJx23RJqoM/A1aF8p9RkkpfWLJLdAtEJbPcwtSx6F5u5CcUYNQIaXV8oTAM4Ce+8+lwmQkBNsbIkn6gvovBQ02QP7yDy4UQHgiwo0Ftsh41Dc1+Q2/P46mCEpOhR9vcMBYCz0VHLmOgFtPTa+mRcACBvwZQYycSoCxag2lrUl1Epoq6v2+MF9dO3PIvgUkdu+A+RQnILIIEx3VYkywzsYABZFB14E7ma5CQMYnsgLAHYAfaMDHx+A+tq4kttqNZLMc2NQX9siY6B3Qc3LOvyZDyVcEO6e0gGA0Ca2zgMATgFzDbPEkgtAMwUl+WPZEk/QCPJcdaTjhg2bvxyhWU+/6vBnXhKZopwQIMfXdlIeAHArmIsZcpmAEgB+VvIJGqlJ550VNmtb5EhNyuxlFXjun4C5VZ6LB+Dd25Fjl3yUgZesK23UjV7pASXXAGhFnwAA7ZGjKqgBSOJVxMytSRwawPvgqL7kupk9wK9CiekzUYekfo7SmDYBANqnAdTJZri0Is/+gMehq9v8oIzZkFYA4CImP9lVFFRM5A87BAAoLTa0z2qfD6BOAPdXFXn24zScG1voz/S60+x23cgLLfL91RvZsAMmZqTGCRg0gPbFxWmzlKoAwKqGyBt386vyelYA2JLw/mNH+CEGc0+AhzpkYlQnYOIwAb6AefGisu5Ehdob8h4a9v0MdDCfaLBTx2ocYJdVaJxuA7+CIDYtYHAWADgH3HX/OBqAmMAzO2RSdGFAXQNNWlxDfO4lJY+/ynIqGRfhHB4P+gKiND/+8gqN07csuQDgoQHUbcBpu4F7wa88UWwIF9aZyStlcgK6fABfhObqt3KxbxUA4OMWZlSbnKT53DhNNKlKAPAFhh/AlCREowH/8gWAJZUcZY6X38YDEL+zRIeaACYNYHeF1x0rqbE7BwD4mNdP28VNtmgA6hqbWDFT6S0LvT5magEy/2ZjHwDYHfzKftsAopOYcqM02s1s0Jd6opxu8dkdAwA0AYA8OK51AEBcQR+AkCtIhqAPE5ACwPE+AHAS9FSa4fgATMlAQr7bQRMymkkF3kfjwQ4A0JBbNABwjcUJGFcwDKjWj6xlTAaiXbem+wDAjdC77r9L9TD1Pd+iwzQA2j3nboMGQMM44v87BQD4GADomrmOaQJUTQNYSmOK+4o8fN70AYCXDASgxJGeSCfsvZIMtEhl3QtlMYYJoA6srrTZVzTqa/AB9JgA1LdkAgBKBJroSKTZ3xbyKqncZ9hv3ChAoozj2hwAWMGgdnDSE6nde1MJBlhU4rkfkbbuYPaN1vAAdBrAfmhCqaBYd2gAh0Ojlt6vkYNRtoX6DaSwigV7gocPwAQAR5GxtmkAq6CnW9YNmNFBADCBaJO+IKBGoQ7hAMC+wOvuYwtLyIV/dAkG+Dzo3ZxhFwcTMHZoAF/WUIbFNXY1/O4l0NxIQ4DRtiVapIeQcRHP+gMHwcXlBByr0aImMijrcl727BAA2I5hjrtMADk2V3EA4FTI3qmUOr3WLMEAT9EknRzISAaS6HqvwwmodtoxqacLNOBZptyJszWnzhyPKMA1Fg2AwwScqll/B3aQFvBWCxqAugb/yQGASRang0868GslGVwfABjZghOwbtEsapoJG++4b9FYYwyaG4u2aWw+hb+/vuNzP9Zkoj1oAQC6ZlwagIsINF2zNjupfNh0jRbgwwNQNbMlXQDwACP/WOeUiMhpV5a+b1M16rpLA1A/e49BA4g8AYBqWKdZ7llsSLWPwKPou8lzXA6CRnVZaVfbinJeonE6/Q3sBWa4PICIYQJMJwBe7zAN4FiDGcBtH15X+AC72gBgIE461wGoYwJKAPh2SQZ3GlE1bQDAdQLuS5yAclHu7NAA1HG1aQDXE62lDvbGkKIn3y/xXoW6vZFjTARz80Ny7/PA3M7rIs3C+3uLADBW4wS8nGECyHnpJA1gGzA35YmZp7/cl0fZAGAdcPf+c5kAkvY6tEQAwLUfR2mcTXcZTIC6JmS4s0MD4ALA3Zr7mGIJcT4Dzf3n3nWo9dtr7qeG5oDu8xdr1sLDHkQgUxSAywScrtG2OkkDWBQdw75EoFgTiZpoA4D9wF7Xn5MOLJFmqQ7UAKgT0AQA+3oyAWsam85mAswm6nEdn0P32d1AX7D1R5bf30UzvzXo6Qno0gAiSwr4Hzw0AHrPJgC4QfPZTish/pAm8ScmvpfEwc+powZmBICxFu4xBwDkxV4p0cBOzWACqAv9LgMRqJuMifjeDjmZAH8hExvhc5hSmBOiItd1ISFFdjZoAMM9TIC/WQCA4wQ8yoMJWAUAuI5hArhC80LetgHAZR5xfhPS1EpGxNDZjzYAoKf6TEsyELW/BudkAszR3IdJAzhYo0rrWnar8iUDk3E40wlo0wCy+ABcNQFv7HAn4ABM5vF1AtIeg7I47+ImALgZeH3KbeBQw7BQGTUA1+kxRqMBzPTgAZiYgN2eGsBs6F10ZaoDtGgSkw0ABmvmW9zjATmYALd6EoHU+760whrAUA8noK3NeITkIi0APMtwLrhMALFQvlqQQVuVEcOeolk8HB6AywlY0zgBTUzAumZcuQDg0gBGGyI2tgq7O3maABdrAOCRFpmAPk7AGzXz4gIAQVL7LOTf0qxdsrwhRd+nX6Ccx1EmAOhibPCEYQLs1s+DtRguKqkOPoShMJsJEDFCSCM1TMBZDB6AvI/BDCJQwnAC3qsBgKmWe6YORpcGsC3o+87bACBmAsCfNCbANcwwYB4+ALHhr1aiIg+VhLE6AEOztuo/nFCgGNNv6QBgCeA3IlAFNAizXD8P1ClK3LSGWslMDwCwaQCUB2CKAujSgXexaAAU0cd7AEBk0QD2NSwEWxRgK8PJwTUBYgcRiK4lbj0AEwD81oMHcJSS+CVrEv6pJABwb4tMwIRGU6hKFEG25p+0N/nAfh6oyeS0qyGRxUYFVjfHCKYTMAJ7RSBqAgx2AEDCNAFmaSZ1uuGzK6DnV130kUNL28oQBrRFAWImANzG1AB8OgPdqDnlhltIVFRbmV8SU2BGC7kA6rqdqgOAnYjjygUAprTDZwrC76eLbH4OVODRmpNmtsEEqJGxtGkA3ZrxtZkAMzUm2VTL5wW/4w1l87sKa2wIvQtS2ohAOicgVwOIUCXnhAE5AODyAUzRzGGTZ7zAclUOPoAI8zF6AcB+BAC4KgWd+FsL4tmnzRUXeJgAIxhEoNgjGShyAEDNEwCmkPTlGrjbZi2GKbIbM8ZvWQRM9RpCg9jE8PkLPUwAbk1AHxPgRrImbQAwSWPGdUE5SrYfn4MJIP4+rgOA0WBu7WVr/kk1gKkF0wCkSugCAG4ykDo2NU8egIkK3OUJAOvjid6N8lwq6+Y8hkfib8taCTaT5EKNymkDgDrwawJy0oFv0PAAhjPMQ7VoZhmYq6OZxB+XCfCeDgDGgr4rqU9Z8DoUo3TzFA1gfZQDD2A09O4O/GeDCdCtSZAyUYEXegKADHHuhlpFu04vETn5MiN56KceGsAt5PTl+AA46cARUwOYrNEAukuiAQz11ABMZntNBwAToHdJL18egPj+D9o4ACJZaQjGRNuhASQeGoAEgHvBXlWJ4wTs0gDq6SUiqZwPvYtQ2jQAGko1pQPTMOBESxQgJvM9wmEeqvfb5dAAVsO5W7qfx3mDHHwAcoyWoABwuUMDcAGAHPjD2/TwslR5HVWYYY4oANcJOK1FJ+C9BqebLhloV4cGkDCZgEWTczycgH/UHDRcE+ByBwBwIjnTNQBkMgFEFt4VCBDi1BSVefqzy9WyjJwczn6NZWq3+uPXGOx+Xw1gRJtO/nnQXKz0fTAXwZhMwMwVBeDyAEZrGGezGNmArpqAdxFzQXxnXIkA4GCNTT2J6QT0SQa6nOkEtM3hVEMUYBmwFyaVc/hkP47zIsw96soXEP/fggLAlBZNAKkBDGvDgx9A7HRpx+zgmGSOCeBTD4A6YeoWJqCOSDPYkn//usJZEG3ZVykRAAxER+B8hV03yOID4PIAqBZlqwhEta0RlvmmG6gbT1cdZ4Dea1c/j3U3+FcE0jkOd6QAMJVB9EkcpkEdnUbtaMhRI6pbt+VEzcID8NEAXOnA+2pi+7aSYEJWxOseWABbs5XCFa57b0UDmGiJAnA1gGmaOawbNIBJGodldz+P8QcZiEC6zw2lADCNucldJsBObQYAVQPYmekEtPEAfJKBuJ2B9tE4sEJjkNYrArlMAI4pOkXDBOw20NenaBy5/Q0A72RIB9Z95isUAKaDu/S3ywQQ8vkM6uNyDvowDb+5TIApmgWxgMEEzKIBzHJEAaIAAL0AgFKfr2MkA0UWALhBsz5tGoCOB7CchTMQk3z6AQ5NbrM2UotfBf/WYDrezjAOAGQJA27u8TBnQKO6rbCrXsSNY9p4NY39vTMDACIlRyFPAIgtJsA+4FcWvGqtweg6u57JBJyYoxOQAsDyDtIQBwAuwoNGzP2/MXks7/F7oUUmoBEAbmD6AChAALGltvJkNdEkjk+DvhBHpCF77MSYZI4GQNV6k/o4RrOpTZ2BdBzsIQEAtE7ASeCuCMSNAriKgk7TcC5qeHLbOAMuJ+AI4ktK8NDJ25n7HGSvCKTu42G+PgCXdiA38DbMB7laY+N1YbxfV6NeFwXgAkDskQtgaypxkOZ3ZzFyAeTiGRwAAH6vWUuTGCaAiwocM/040zQaQN2gAeh8SSYN4DLNGu1qQ1TseQYdmOMEPMAUBWjFBKh72Lk3GUJll1hMAAoAO+bABJyiASJuOrApDLgn6MuC7xoA4H/jrcpkCxMwYWgA0z2IQFM1fpyaAQB0mmQN7L0aYhKpOjjn8Xvd8/Q3gcRwHQ+AowEkDgDYg/kgNxgAYALYC3FwnYBZwoAcJiD1Q+hMgD0MTMDgA2g0jKlBcw8J3ZyP0zgLObkAHA1AFwVYlmkCdDM02kTRAA7KefzmGTY5eJKBepkA13smGJhMgH2YD3Ia6CvP7sPkAbh8ADRzcT4jtTZLWXCdBrAb0Vjk2GwXAOBj77ikX3fh+C1vAAC6oSbmZALU2wAAJ2vutx1zvjAHHkCMdPUBlPQQQWtFQesens9PYkhDppwKmW0IB442+AB2ZEYBuCaACwDGaNR6HQBsQRJ85En3qQAA/5NlHBl4R3jwAKZD76rHIxiHgysKoAMAkwmwBuYKdClr7u9tGLeoxWQg+Z39TclACZgrAuk0ABoFOMLjYcSGuAAaNdl+asnIGmmwqbdnePa5UQCuCUC1kJkGbsMsaK5LeGfY9F5yhEcuwDTNfI9gmAuuXADdOrKFAbfC9HBRq+FSTNnOm2kZEXU/azLQXhQAxmfMBQCCkKe2YTEcmNEJGDN4AFM0UQCf1mAzLQQn8Tun4GJcImxqL9ExAV25AFwNIGKaADo+Sa0fx2QFzwiAzV+3AwWAozUDbutHbjIB2lEQZJjGqWYLA/pQgXW5ALbGIJzegEFal7Gak9pVEShh8ACma0hDXQYNYIom+7M/qcDbeHj+bfT9WPJtbPYtN55IqcCT2/Dg+0FzfbqYSQTi1ASc4hEFoJ2B6kG1bzsAcKIAPk7A6ZroQpdBA5isCSf3ZzbgMOCn7LtMgOUoAIwAfYca32SgdtRYXx9V+Drh1q8O7oIgeQIAlwcQpHXRaaRXMAHApyJQZAGA88i6qCERp7/GZIzG/s/iAxDjsxgFgD01PgCf/oByo7WrM/A06ClQKa5zJYNsEjN4AD5hwDGa3w0mQN+YANx0YJcTcJrGtKgZ0pjXhkZPhUhR/8/vxzH5bsZMQLpn/3cY0lM2An6RAdN7C9v08CJkdCii8n6ObCtfJ6CPBsCpBxCkbwFgukcykKkvgKmOwSCMVF2HDu7+rB48sUUAkK+9AobWYHXw7wwE5H3xGysVhG7KSeLwKQo6RqM+3h02a9sBgEsFTpgaQKLxASxTgjH5rWbP+VKBxb/n6ABAsow4BUFtSNNdAM67zgToytEECBpA34YBXclA04Ff1m26IR24DFWYHgG/1mCmCMANJgB4y4MDYGsPPrpAABA5wje+yUA0JTk4AdvrBEw8fACcsuCTNSDeVRIAWGjQun3SgZt6LNILzAR3D0BXFEAM/o/6eaCu0ywIrg+gzggDxo5cgCD5RgGytAc3zeEkDbDMR5ZdkcdjQ4vZzQkBqib6WBMATAJ98QAfDUBcYEY/D9ZoEi7stsTrJ0PvRpgcHkAcAKAwGsB0jc/HNIeHE1+XWB93lGA8DsF7baU3YEwT9uhFTrX4ALhhQCH/LMCAfTOVp6DREuxuDOnYNABOCOkg4FUECpKPE7AO/q3B5BzaktLOTuW/qBUKrXfNEozHhY7T3qYBUC7DeiYAGKXJu/dtD160dsuu4oyTPZyABwGvMUjWRI8NoBxtqvvKCUiB+TJHFIDT4VnN1Vi0ROPxO9B37eb661Qf3SImANgZmktZJRlNAHGRL5VkYCdncALmTQUWSU0v4m+Lv5sGAPBKBroBeteWPLDDxuNtpgZgqgosgfFx9XfpRZa2cAE4FYHUjKlvl2Rgp0Dv4h3DPaIAM3O4hzuU3+1GtA8mQG/vtY8JMLyDxmJt6F1uzLczkDycp9kAYACyhCLLho8NDgjaCnt6iQCA2x58lEYtbVUDGIheaBVA3woA4N0ZqJMBYCT0rjjs8gPo+niI75/pAoAbQV8QhGsCyO++UGIAaLU5qI8srUll7QoAAEdCa70BOwkALlDWSJZkoMjE0dFd7AwwVwTiOAHVSdikQwFAfeY/t3j9ZUlosY6RC7XUlKguIxpqTCgJZTXPikCc9uDTOlwDeNDhl+NsfgkA67sA4MsZIwFU1RByUgkG91porjXgqwG0CgDCI/s+iUu/Sby/dcW0OrtCGgA3HXgy9K4VMaJDxmEtaK5f4CsqCLxOf193wRURKSLPdOBYM2G3lGCAjyVpxuLv1h5RgD/ncA8zyeJV/QofQPvrLRTdBHBpAGcrn5Vz2ClNWA42OACz1AOYwQEAIY8ZAMCnVoCkWC5S8AEWhRFuU0DgdrAXZKiTKEAeLLKhCujWFBLLKtBcXbgoJKu+1gBcALByKnOhpwjrlA4ah6sMGjm3epe6dn7EBYBroXczTl8NQCLx0JIMtKgwPMRBDhmlMQHyKgkm8s5Fyactif1Pqcf/Jt8TrK5PViQd+ArHd/aAzuu/+HLG7Fxaq1PrGLWhb7eGi82hAlNv7EUdNBljCBrnpQGYZHVCzKojIUS+f7kSNfhuB4YBaZGPiRXRfqR8HnpXwzYBAFjelwCwBhcANlNUYm5z0NjAPX62gyZklCaR5NY2Xm8pNKNUDUCGVzdV5khGDpbtcB7ArysGACdrNPEsyUBifTypu4bt4m84NnrE0ACkGbB+hwGA6gRst1Pub2Q8b1eiNVQ72L5Dw4BSrqwYAMyxROS4yUAyN+dKXwC4Dnp3ZzWZAboIgLowj+yQCTlQYwL8sQ9OATVC8X9KYlIXiR7sQ6I5ok35SiUd60M0h0qVAGA5Ep3y5QHEJAPwq74AMEJjAviGAXuVICq5bKT4RiSyXtjmawqqsOjicgJuaDUzsUYmWvai3zWVDxVacRm7Em+AZk1d2QTjKgQAY8Ddq5PLAhQHxWq+ALAY9JQg4jQjiCw3LMoQL9khEyNO4HcwPi8KqKzQT/exLwKQCgBDDNlxvynpWB+AXvAuDO0NrBAAXGs5cMGTBjzHdB3XTdzqSAoyZQPS98RJ9fUOmpyBBViMn0YAkCfkQgWMniN+iqklH+9FoFq2/wAM93Io+C4QEPM/PisAjNN4Ym25ALa+gneHBJfc5WdKGHCCwYEr5uUmTXQhtCovrgwmJjUn689WEHT7rACwiiYji2P/67yRNTy1wgTnrwlsQF57icyLCgDfQ5NMvH5uGL9CyjUWp7pvMtAHNm2VczOPGzQAn5qBMhPpvDC5fSL3EvNrosI2VP0Gb4axKpwsAz31IWJwl+l32f/WuhycG7qUkQuQGLz/9Gb+U1F7rq/lh4pvoAudaQOQCloj6uGSYbwKJcdYTn+bBgAG+/+wVgFgFAk3ZfUByAU5Kkxy20UUFv0Oov9xJJuRhnY/EcarUDLXElL30QKk2b18qwAgMq3mtcgDUCMETwUtoE9kYwxZDiPkGlpbfvkwVoVK/Y2YoXWOCeCsV+mTkuhKB7bdbEz4818Pk91WGYp2ZA3Dg0fj6/soySVSRVw0jFehTv/Iklvj4wQUc3tiXgCwGzRXzeFUBIoN2oH4+3CY7LbKJGiuWSCjAMui40/O5ewwVoWRPaGn9gO3ApcLAD6fFwCIMMIzDHWE21YsIrTWIPnKX8lYP6C8tx00Cr8KUNgijFWhIjc1S8TNlwfwHw5ZzecGvwf6UmE+uQKqs/DvYdJblsOh0eLqTfQeqxWdVFAOY11s2QH3lq4ID8fW1732c861fW5yNWguT+XLA9A5Bw8Mk99SvHgBNFd8lQUf7iaOpPvCeBVa7lSyPWNwd+KmApqI21Z5A4CQaWCuTxYD32Mp33+yYgkeecp2ikNPLh5Z8ulqMifTwngVVnZScjoiDxPAZmo/xL2+783uAu4CBTYNgN64WMBHhkWQ2WmklouqYxhJvLcfJxc8SCHkHgLkiUMDAIcJIH7r2HYBgJBHwNw4xKYB6ByEEfLWlwgLwSrrY374UEVj2luJ6UsAGEnSlh/BhKEwhsWUL0FzxSOO6eyy/0UNheXaCQBfAXujQq7KolbV+U1YDEY5DGP5ddzwE5TFQ0uCBZ9KuXw4T0JzwZPIY/ProgDa0t95A8AAjB9HDAAA4NUSiLhOiwrK38kYvqAw/WqKml9DezKMWTnkXEKgiyz8GVfRD/l3gS+zsxX7s86wVxIGAMjTa3JYFFp5h5hX85T35igOpJeCQ7U0shaJ4OgAgKv+q38v9b2XVh7iAeD3DYjBXU5MLOTNK7ogVsVQkAiziirAanOQeWQMP1TeEwU/T0/lMmiUcg+bqzynf42wY1UAAM8woPyNDfsSAIZqAICTC2B7gEcqmij0C2XsaoQqPY+M00dtuP7KBkfsYhatQqdqirn7LH5PfX0J9B2FgjCNsm1vQ+8uWiYTgKtV35Xlflp9mPvBXhXIRVukGoPQAsZXcFE8Dc19FLqVDfkW0ZTyLOIxEDkCNQSascRDLerSvU+ci5+DRn9CcZ9PpLIuvr4i0sW78f1BynfU3ou7VxwALlXmOQJ7LU3ag8PEEhS/NaQ/AGAo6JuBuDoL27SABRXjqA8k6dbSK7wyvv8g5NuOXJXNCZFIBZe/KJtW7Uf4G3I/v8DXvwPNbcx/ha9vRKIVd1V4828O+toaPhqAzjy4P+s95ZXEkLV2mamRyGMVSlMdiLa/esrXlBP0UGUjdiEfIK9r765xxsp7+pBoJUvjezPIwr0RX/81mcM/4OvDCHnstYpu/kWQoVfPCACx5dDctz8BYCPlBOPkLbvajckFN70iC2NR6N0CvK6o1gPQdhabdZOcrz1cAwDC9FhSiS7I11fH79xOwOp3Bs3gLiVhST31XqkoAPxS0e5oYhwnCmAyD2a0cl952jV1B6PJJ1VYboKzK7I4Xofm/P3uPmJHDiNzsABPKhWUZGeZZfA7t5C5moSv/1yxVcXf32s0gKgVdbXEcjTZ5LpCOhwAoHtKzMvaRQCADUlYw5UIZNIMdEDwpQoskN+S039uH133i2T8/0Ick2oZN+oDkGB1krLI1Y1+Cb6+gaIBqK9Xicb9Lpib58YacABwVwQSr/201fvL80Evt4CAyzywlUB6DYkTnbxIPo200G5k+g3uw2tfj/P2GuEf7A+NsmLz8N/y9XVSeR6/82gqn8TXhdlwB55K/8TPye/8BF+/TdEkqmL33+845V1MQJMJIKIzqxQJAFbTxDc5TEDb5pef+6smttyp/oD+Wqim+1nU4Lg09URcPMT6/yc/JRtbpwXEBvPABQCX5XGPeT/w8WCvFxA7Yp2mwiHi9DgtLKggJZL9SJqvaY3rgAEcPgDxd9MiAsBADHV0Q+/y0xHwqgmZCBFCHd0uLKwgJRCpDccadd92+tcdB6eu1VuhAECGBRdokoWSFgEgwhDSemGBBSm4XMXwg8UGH4DLBJif5x5oZw57DXiVgjgxz0ghyLwCoZptkOLK98Fc+yJ2mAAmJ6D6/tfzvN92DsQllvCfbYBcnOgIU2S3DYstSMFkHPRuveZqnsOpCCTNgxvzvud2DsbSGC5yOTNMiBhbCBOys23QBIIUyenXhf4vXeTLtfltJoA89NYuEwAI2YowymKmBhA50FO+9gamn4YFGKS/k3zec8TxIwYI1EHfU7MGPe3dSgUAQr4N7tbhHA3ApD28jYy2sBCD9IcIwtPLYK+TaXIC0s2vW/d1pF8PKCsADEAijynn2UQDThxMQjXxRLRB2jksxiB9LJ9SWJEu/ktk0IRjR56AMHXXKDsAbA/NXWk5GYE+RKIaUiO3D4sySB/J6kh5jgwJb7Z1bfMB0EIfo9r5HH05YD9mcAPoJgdmiFCmWb6GPISwQIO0U1bGPIiageXH9QFEliiA+P817X6Wvi58cSvTDLDFQ3UIW4fmqjbBHAjSzpp+fzNsZlsdDB1QRBYQEIfZip0EALKQ5Ezg9RRIwC+XQFXDRCONMyuWeRak/fIJaJRit0WxXJV7I0YugPj3yL54pv4YxCUw7zzKsMltZZHogHZjHnsIEwbJQ8Q6eg7XlS0qlVh4ABwmoJDz++q5+tOB8iJxoHCZgNyehPK3RT77mLCAg7ToxH7Lks/P7Ydh0wCkH+vP0Iel8fu7UsrrmsgAxwSIGe9RbeDCkKseJIOMgEYvBlf/vsiS6+LKB5C/+xKaGQOqAAADMKf5bYcnNfF8T9eBWKKrSKNcNCzqIEz5ATSXObPV7YsYJoApDCiu8UEqX+jrZyzCIA9GhI0YA8nxD8QW1UsM9MMhVBjEIUtBo9ipTd3nagC05L0uCtDd7nh/kQFArZ7CVfNdGoAOeaUWUEPe9jFhoQfRiKg/OdfAzecAALfUnQoAp/bX8xZp4MdD79LitmQgk3NQBwB1g/p1N/oiwsIPIkRUMH6BYatnMQF0ICAOo6v685mLNPiCKHQ6YVdxw4CulOPIoiWI6kWiwGJoXFldEanrP0Q6ua02f5bOPabDSvz9OfRzM9wiTsYBSOTh9BzkAIAu08rkiLm8L9hXQQol22J8n9Ogg6MB2MKAasivEE1wizopX8GTOc5BA7BxrXXFRp6FajQjqbqIMvMTwNyl12YCmPxPkYOsJmVGUcahyBM0FHqKLHDIFtx6a5zPCQ3kT9BohR02S2cSe+ZC70adtlh+lDEKQOtaivThVQIA8EQU+ngVmpsq2qIAOiIRFwBMoCDadm0SNk1HyHKpXGGgoSceh0TCcBAmGoefSB9es0hjUoZJGwQ9RRe4LEGdE7DO2PA6VK9hnHZyKluHTVRaEfUjnzBs0sQDAEyefZd/SkQX1i7auJSp+MJjBhDg8gC4GkCiAY66AgTTQoJRqURU07kEzbpugyPPpS0mjChAZNE+hV9p3SKOT5kmchCiqAwTQkYASBzMwYQBMOL/d6YyGqrRs7CsefsiJXy+B5M0YpqFru/I367j5l+jqONUtkkVLZdmGxIyIgYAcE0GDtFImgf/hkb322AeFENWSuVkaNSJjMDelNYnYYejAdDfe7poNn/ZAWAAEifEBL/r2NytOgET5smgmgkinnxtKl9NZdWwGftUdkBW3UILmcxVjSryIJTZOAJiLfwMSlCQpswTvi76BepgL84Qe4RwXN2KuJEDCQiPILtxh/5mfHWorI4Ze0+DubtOYkkzp8I1JV1Vf88syxh2AoXzSk0OAaf1kuvU5+Qa2JyH1IEo0p5vSOWEVLYJgNASZXxPzNZbAD0VekyqvcnLb/osp/CMDgDkXF+A9xgAoA/la8jjrnvmAiQep3rM8AybuAi6BSYW7z0IYKLry46pLBs2uFE2xs31MhPUXZ2pYw8egO0wUMljR5ZtXDtpgXwObfA60wmYgB8ngFv7LfHQENSKRfIUEZGOqamcmMouFY8yfAY1prugp/kGx7HH0QZ8eACJgwr8Mmp1AwIA9H8u96MEBGzJQNySYhHwy5D5VjE2dYipKyeLKGJyMTTqJnRyRSPhwT8Qk7JeUCItHB+MT/FYjg9ABx6RZl39tchhvqoBgEzy+LFCGnJleOkonq5ipFz/QWKxJ23/d7VG/1WHkJFEjUbRw+F7qdzu8OX4OmRdoGvzAbiuLe/xirIDcqcnfDzLWFSRh7qeME56zoJ0tUezEVWkKrwA88nXKtm8bJnKWdAoDS9Ddl0e9jyHt5FYnHgJ+BfupMlAglx0RCfsk063IUUPgm+ijdZtcdhFDnU+8rDxk4ybn6MJJAaq8vUFz1wUlXbOTeUfDB9L4jm2HB9NwpwPVxhQrKFZJQTdygKAWuTxPIM96aIJc2nEHJUUGIuUu3CpSlpDzkHR4vSX4glv875zfDKJp83v0q5sYUIdENSQ8dlRPpiqeZX3hkaDh5oj8SPxIBH5nja+GkDsoK4mBARuKEDkQFxfFLr8yOF4izNEUbJoWLaKUqb+ffLf3eiQ3LET90RV2WNXQu+e7pwwITe2zP0eh6XmYxZIEJjaj0SjzUjaLdfpxjm1XQxNjhbF/ZwkcP0CGj0tBwQA6CzZKZUHLad74kEV5vIKXNmHPpsltgBAHR2EfT2mwjE2j3nqu56bqxlwtQsXCYjOt6AXD+70fRAYZgBfh0ZLphrY67f7OKpcC5xjsybAJ7iY7mnLPhzHy8GvkrPLCeijYXEiARyNrIYe/tOhIh2kAgD05BScodCJfW3NmOFsapWpFhuIKzat4vo+Gr9zPEAqcfAmuE6/GPxCrpzW3c+hZliZtR82f7N8MpVrNA7CCPw99D4e6sTzs9xwl3BgrdbmMTuOgGYWrSXJyQTg/Bb9TB1P/dPwIBgQACCI4ODfqziCIiYpxdeRlWXDcOxp9d/tDA2Oc2TXcYtwJMAjWvmy/mzAIQFe1G/4VFXXetjsdtkKvcCvOFhkPmQWjs3rS2CxObtealNE4PsOTz8H/GLwr8oTt6hhCfkvNAp2VL5JbNjk/CpEh0GjwIcpKy3x4J/7aAU+GoCpLt0eOY/H4dC7tHaSQVWPoTWCEDdFW4b13kZ+wlJhTQcAyCqH4qkaGTYBt7gEV2V2Za+5gKcG+Xaf3QidpVnYd1yeRZwRBExjVENVf92wfgMA5CEiRDQSGgU9uPUGs9r7ruo1rg1XR2JQXtV4Hm2Bfpt4mD6u77u0qzomGwkT7jNhzQYAaGelGrHI3iQU49iyYH3CfdwQo41W+1BOz3ommLvq2Oi1XM++Kwc/NoQ+I7LxRTepU1JZOazPAAB9qRWMgUa/gDo0NzExbXgAv4o1PixB9TPv5vB8m+KJWvfUZnzYeglkq9AkQfdxNNFCvcUAAP0qYrNcBI3a9HVDFqJPXJ9LojF9vrvFTSG+O9fg94jBP4Tpk/NvCt+p3ZpugUa1pIFh7QUAKFr0YN9UrlPAwFZgJGHYvKYCF7bqRWKjLNnCc4wHcy0+HyKUTzjTVLmpG5/nPiQhrRjWWQCAsoDBttBoanIbpsq6Ohv70INNmy5qEQDEPS8w8CCyMhU5QEHZmK8gS1PkbgwK6ykAQCcAwh5ISHkcmvsIZKHVxpYU4a4Wklse8WD4ZeFA2BqriHbal+A4BfU+AEBHi2gldjA02pC/aslD4PQeoADwfgs8f1s33bw0ALnpRcHTGakcn8rmYU0EAKiybIb59cJ/8Dz0rmJk4x9QHsCTGa7/Wczt5+Q6cJiA6v3IZ/kwlT+gj2FwOOUDAASxZyoeiKm3N6NTUTrEpDdcV75MbLgbMhB+HvTgHSSGTV5TqNOChvtHaPQ3ODiQcwIABGldRHXaYdBoLSYKcszCWD0lxpzt+bsna/IdODH7eegzEAAleheMhUYdxtApOQBAkD4UUQ59DQSHH6aynafpMR9P7oVIIpqLtGehSVwNjeq4AnQOSmV//M7iYdwDAAQpv6yGSTOLhbEIABAkSJAOlv8HOib1/JuFBpoAAAAASUVORK5CYII=";var ua="linear-gradient(135deg,#3aa0ff 0%,#6a6ff6 52%,#8a4ff0 100%)",DC=[58,160,255],ay=[106,111,246],NC=[138,79,240];function LC(e){let[t,r]=e<=.5?[DC,ay]:[ay,NC],o=e<=.5?e/.5:(e-.5)/.5,n=(i,s)=>Math.round(i+(s-i)*o);return`rgb(${n(t[0],r[0])},${n(t[1],r[1])},${n(t[2],r[2])})`}var Zu=Array.from({length:65},(e,t)=>{let r=t/64,o=Math.exp(-(((r-.5)/.16)**2)),n=Math.round((3+o*(.8+.2*Math.abs(Math.sin(t*1.9)))*153)*10)/10,i=(1.5+t%5*.2).toFixed(1),s=(Math.abs(r-.5)*.7).toFixed(2);return`<span style="height:${n}px;background:${LC(r)};opacity:${n<6?.92:1};animation:wave ${i}s ease-in-out ${s}s infinite"></span>`}).join("");function UC(e){let t=e.markUri??ro,r=t?`<span class="mark" style="-webkit-mask:url("${t}") center/contain no-repeat;mask:url("${t}") center/contain no-repeat"></span>`:'<span class="mono">AC</span>',o=e.compact?"body{overflow:auto;align-items:flex-start}.card{margin:auto;padding:30px 28px 44px}.badge{height:140px;margin-bottom:22px}.orb{width:104px;height:104px}.mark{width:78px;height:78px}.glow{width:114px;height:114px;margin:-57px 0 0 -57px;background:radial-gradient(circle,rgba(34,197,94,0) 35px,rgba(34,197,94,.34) 40px,rgba(34,197,94,.12) 47px,rgba(34,197,94,0) 56px)}.bars{-webkit-mask-image:radial-gradient(circle at 50% 50%,transparent 40px,#000 62px);mask-image:radial-gradient(circle at 50% 50%,transparent 40px,#000 62px)}h1{font-size:32px}p{font-size:15px}":"";return`<!doctype html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>${zt(e.title)}</title>
|
|
21
30
|
<style>
|
|
22
31
|
html,body{height:100%;margin:0}
|
|
23
32
|
body{background:#07070f;color:#e9e8f4;font-family:'Sora','Segoe UI',system-ui,sans-serif;display:flex;align-items:center;justify-content:center;overflow:hidden}
|
|
@@ -31,8 +40,8 @@ body{background:#07070f;color:#e9e8f4;font-family:'Sora','Segoe UI',system-ui,sa
|
|
|
31
40
|
.bars span{width:4px;border-radius:4px;flex:0 0 auto;transform-origin:center}
|
|
32
41
|
.orb{position:absolute;left:50%;top:50%;width:140px;height:140px;transform:translate(-50%,-50%);display:flex;align-items:center;justify-content:center}
|
|
33
42
|
.glow{position:absolute;left:50%;top:50%;width:154px;height:154px;margin:-77px 0 0 -77px;border-radius:50%;background:radial-gradient(circle,rgba(34,197,94,0) 49px,rgba(34,197,94,.34) 55px,rgba(34,197,94,.12) 63px,rgba(34,197,94,0) 74px);filter:blur(2px);animation:glow 2.6s ease-in-out infinite}
|
|
34
|
-
.mark{position:relative;width:106px;height:106px;background:${
|
|
35
|
-
.mono{position:relative;font-weight:800;font-size:44px;letter-spacing:-1px;background:${
|
|
43
|
+
.mark{position:relative;width:106px;height:106px;background:${ua};filter:drop-shadow(0 6px 16px rgba(0,0,0,.55))}
|
|
44
|
+
.mono{position:relative;font-weight:800;font-size:44px;letter-spacing:-1px;background:${ua};-webkit-background-clip:text;background-clip:text;color:transparent}
|
|
36
45
|
.eyebrow{font-family:'JetBrains Mono',ui-monospace,monospace;font-weight:700;font-size:13px;letter-spacing:2.6px;text-transform:uppercase;color:#7dd3fc;margin-bottom:14px}
|
|
37
46
|
h1{font-size:40px;font-weight:700;line-height:1.1;letter-spacing:-.02em;margin:0 0 14px}
|
|
38
47
|
p{font-size:17px;color:#9b9ab3;margin:0 auto;max-width:460px;line-height:1.65}
|
|
@@ -44,11 +53,11 @@ ${o}${e.extraCss??""}
|
|
|
44
53
|
</style></head>
|
|
45
54
|
<body><div class="aur a"></div><div class="aur b"></div><div class="dots"></div>
|
|
46
55
|
<div class="card">
|
|
47
|
-
<div class="badge" aria-hidden="true"><div class="bars">${
|
|
56
|
+
<div class="badge" aria-hidden="true"><div class="bars">${Zu}</div><div class="orb"><span class="glow"></span>${r}</div></div>
|
|
48
57
|
<div class="eyebrow">AC Bridge</div>
|
|
49
|
-
<h1>${
|
|
50
|
-
</div>${
|
|
51
|
-
:root{--ac-bg:#07070f;--ac-surface-2:rgba(255,255,255,.03);--ac-border:rgba(148,132,255,.16);--ac-hairline:rgba(255,255,255,.06);--ac-text:#e9e8f4;--ac-dim:#9b9ab3;--ac-mute:#80809d;--ac-accent:#38bdf8;--ac-accent-soft:#7dd3fc;--ac-accent-3:#34d399;--ac-input:rgba(148,132,255,.16);--ac-brand-grad:${
|
|
58
|
+
<h1>${zt(e.headline)}</h1><p>${zt(e.sub)}</p>${e.extraBody??""}
|
|
59
|
+
</div>${jC(e.cleanPath)}</body></html>`}function jC(e){return!e||!/^\/[a-z0-9-]+$/.test(e)?"":`<script>try{history.replaceState(null,"","${e}")}catch(e){}</script>`}function Gu(e,t,r=ro,o){return UC({title:e,headline:e,sub:t,markUri:r,...o?{cleanPath:o}:{}})}function zt(e){return e.replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[t]??t)}var FC=(e,t,r)=>Gu(e,t,void 0,r);function cy(e,t,r,o=3e5,n="/callback",i=FC,s){let a,l,u=new Promise((d,m)=>{a=d,l=m});u.catch(()=>{});let p=new Promise((d,m)=>{let f=e,g=zC((I,_)=>{let C=I.headers.host;if(C!==`127.0.0.1:${f}`&&C!==`localhost:${f}`){_.writeHead(400,{"content-type":"text/plain"}),_.end("bad host");return}let z=new URL(I.url??"/",`http://127.0.0.1:${f}`);if(s!==void 0&&z.pathname==="/"){ki(_,200,s);return}if(z.pathname!==n){_.writeHead(404,{"content-type":"text/plain"}),_.end("not found");return}if(z.searchParams.get("state")!==t){ki(_,400,i("Invalid request","This sign-in link isn\u2019t valid for this session.","/sign-in-failed"));return}let F=z.searchParams.get("code"),K=z.searchParams.get("error_description")??z.searchParams.get("error");K?(ki(_,400,i("Sign-in failed","You can return to AC Bridge and try again.","/sign-in-failed")),k(()=>m(new Error(K)))):F?(ki(_,200,i("Signed in","You're connected. Return to AC Bridge \u2014 you can close this tab.","/signed-in")),k(()=>d({code:F}))):(ki(_,400,i("Sign-in failed","You can return to AC Bridge and try again.","/sign-in-failed")),k(()=>m(new Error("No authorization code returned."))))}),h=setTimeout(()=>k(()=>m(new Error("Sign-in timed out."))),o),v=!1;function k(I){v||(v=!0,clearTimeout(h),r?.removeEventListener("abort",S),g.close(),I())}function S(){k(()=>m(new Error("Sign-in cancelled.")))}if(r?.aborted){k(()=>m(new Error("Sign-in cancelled."))),l(new Error("Sign-in cancelled."));return}r?.addEventListener("abort",S),g.on("error",I=>{l(I instanceof Error?I:new Error(String(I))),k(()=>m(I))}),g.listen(e,"127.0.0.1",()=>{let I=g.address();f=typeof I=="object"&&I!==null?I.port:e,a(f)})});return{port:u,result:p}}function ki(e,t,r){e.writeHead(t,{"content-type":"text/html; charset=utf-8"}),e.end(r)}function ly(e){let t=e;return t?.code==="EADDRINUSE"?"Port 8765 is in use \u2014 a sign-in may already be open in the AC Bridge app. Finish it there, or close it and retry.":t?.code==="EACCES"||t?.code==="EPERM"?"AC Bridge was blocked from opening port 8765 on this machine \u2014 permission was denied. Security software or a group policy is the usual cause; allow it, or sign in on another machine.":t?.message??String(e)}var MC=[{provider:"google",label:"Continue with Google"},{provider:"github",label:"Continue with GitHub"},{provider:"microsoft",label:"Continue with Microsoft"},{provider:"email",label:"Log in"}];function dy({cfg:e,state:t,codeChallenge:r,email:o,screenHint:n}){return MC.map(({provider:i,label:s})=>{let a=i!=="email"&&i!=="sso";return{provider:i,label:s,direct:a,url:la({cfg:e,opts:a?{provider:i}:{provider:i,...o?{email:o}:{},...n?{screenHint:n}:{}},state:t,codeChallenge:r})}})}var BC={google:'<svg width="18" height="18" viewBox="0 0 24 24" fill="none" aria-hidden="true"><path d="M21.6 12.23c0-.68-.06-1.36-.18-2.02H12v3.82h5.4a4.6 4.6 0 0 1-2 3.02v2.5h3.24c1.9-1.75 2.96-4.33 2.96-7.32z" fill="#4285F4"/><path d="M12 22c2.7 0 4.96-.9 6.62-2.43l-3.24-2.5c-.9.6-2.05.96-3.38.96-2.6 0-4.8-1.76-5.58-4.12H3.06v2.58A10 10 0 0 0 12 22z" fill="#34A853"/><path d="M6.42 13.9a6 6 0 0 1 0-3.8V7.52H3.06a10 10 0 0 0 0 8.96z" fill="#FBBC05"/><path d="M12 5.98c1.47 0 2.79.5 3.83 1.5l2.86-2.86A10 10 0 0 0 3.06 7.52L6.42 10.1C7.2 7.74 9.4 5.98 12 5.98z" fill="#EA4335"/></svg>',github:'<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 2a10 10 0 0 0-3.16 19.49c.5.09.68-.22.68-.48v-1.7c-2.78.6-3.37-1.34-3.37-1.34-.45-1.16-1.11-1.47-1.11-1.47-.91-.62.07-.6.07-.6 1 .07 1.53 1.03 1.53 1.03.9 1.53 2.34 1.09 2.91.83.09-.65.35-1.09.63-1.34-2.22-.25-4.55-1.11-4.55-4.94 0-1.09.39-1.98 1.03-2.68-.1-.25-.45-1.27.1-2.65 0 0 .84-.27 2.75 1.02a9.5 9.5 0 0 1 5 0c1.91-1.29 2.75-1.02 2.75-1.02.55 1.38.2 2.4.1 2.65.64.7 1.03 1.59 1.03 2.68 0 3.84-2.34 4.68-4.57 4.93.36.31.68.92.68 1.85v2.74c0 .27.18.58.69.48A10 10 0 0 0 12 2z"/></svg>',microsoft:'<svg width="18" height="18" viewBox="0 0 24 24" fill="none" aria-hidden="true"><path d="M3 3h8.5v8.5H3z" fill="#F25022"/><path d="M12.5 3H21v8.5h-8.5z" fill="#7FBA00"/><path d="M3 12.5h8.5V21H3z" fill="#00A4EF"/><path d="M12.5 12.5H21V21h-8.5z" fill="#FFB900"/></svg>'},HC='<svg class="arw" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14M13 6l6 6-6 6"/></svg>',uy=`-webkit-mask:url("${ro}") center/contain no-repeat;mask:url("${ro}") center/contain no-repeat`,wi="https://ac-bridge.com",ZC=`*{box-sizing:border-box}
|
|
60
|
+
:root{--ac-bg:#07070f;--ac-surface-2:rgba(255,255,255,.03);--ac-border:rgba(148,132,255,.16);--ac-hairline:rgba(255,255,255,.06);--ac-text:#e9e8f4;--ac-dim:#9b9ab3;--ac-mute:#80809d;--ac-accent:#38bdf8;--ac-accent-soft:#7dd3fc;--ac-accent-3:#34d399;--ac-input:rgba(148,132,255,.16);--ac-brand-grad:${ua};--ac-brand-grad-text:linear-gradient(92deg,#67e8f9,#38bdf8 40%,#a78bfa 75%,#c084fc)}
|
|
52
61
|
html{background:var(--ac-bg)}
|
|
53
62
|
body{margin:0;min-height:100vh;background:var(--ac-bg);color:var(--ac-text);font-family:'Sora',ui-sans-serif,system-ui,sans-serif;-webkit-font-smoothing:antialiased}
|
|
54
63
|
.mono{font-family:'Space Mono',ui-monospace,'SFMono-Regular',monospace}
|
|
@@ -65,7 +74,7 @@ body{margin:0;min-height:100vh;background:var(--ac-bg);color:var(--ac-text);font
|
|
|
65
74
|
.mesh .aur.a{left:8%;background:radial-gradient(closest-side,rgba(56,189,248,.16),transparent)}
|
|
66
75
|
.mesh .aur.b{left:24%;background:radial-gradient(closest-side,rgba(139,92,246,.18),transparent);animation-delay:-7s}
|
|
67
76
|
.lockup{position:relative;display:inline-flex;width:fit-content;align-items:center;gap:10px;color:var(--ac-text);text-decoration:none}
|
|
68
|
-
.lockup .mk{display:block;flex-shrink:0;width:30px;height:30px;background:var(--ac-brand-grad);${
|
|
77
|
+
.lockup .mk{display:block;flex-shrink:0;width:30px;height:30px;background:var(--ac-brand-grad);${uy}}
|
|
69
78
|
.lockup .wm{font-weight:700;font-size:15px;letter-spacing:-.01em;line-height:1}
|
|
70
79
|
.mid{position:relative;display:flex;flex:1;flex-direction:column;justify-content:center;padding:40px 0}
|
|
71
80
|
|
|
@@ -75,7 +84,7 @@ body{margin:0;min-height:100vh;background:var(--ac-bg);color:var(--ac-text);font
|
|
|
75
84
|
.bars span{width:4px;border-radius:4px;flex:0 0 auto;transform-origin:center}
|
|
76
85
|
.orb{position:absolute;left:50%;top:50%;display:flex;width:140px;height:140px;transform:translate(-50%,-50%);align-items:center;justify-content:center}
|
|
77
86
|
.orb .glow{position:absolute;width:154px;height:154px;border-radius:50%;background:radial-gradient(circle,rgba(34,197,94,0) 49px,rgba(34,197,94,.34) 55px,rgba(34,197,94,.12) 63px,rgba(34,197,94,0) 74px);filter:blur(2px);animation:glow 2.6s ease-in-out infinite}
|
|
78
|
-
.orb .mk{position:relative;width:106px;height:106px;background:var(--ac-brand-grad);${
|
|
87
|
+
.orb .mk{position:relative;width:106px;height:106px;background:var(--ac-brand-grad);${uy};filter:drop-shadow(0 6px 16px rgba(0,0,0,.55))}
|
|
79
88
|
|
|
80
89
|
.eyebrow{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.16em;color:var(--ac-accent-soft)}
|
|
81
90
|
.aside .eyebrow{margin-bottom:16px}
|
|
@@ -131,15 +140,15 @@ form.email .flt{font-size:10.5px;text-transform:uppercase;letter-spacing:.1em;co
|
|
|
131
140
|
@keyframes glow{0%,100%{opacity:1;transform:scale(1)}50%{opacity:.8;transform:scale(1.04)}}
|
|
132
141
|
@keyframes aur{0%,5%{opacity:0}12%,28%{opacity:1}38%,100%{opacity:0}}
|
|
133
142
|
@keyframes pulse{0%,100%{opacity:1;box-shadow:0 0 0 0 rgba(56,189,248,.6)}50%{opacity:.5;box-shadow:0 0 0 7px rgba(56,189,248,0)}}
|
|
134
|
-
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}`,
|
|
135
|
-
<style>${
|
|
143
|
+
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}`,GC=`<a class="lockup" href="${wi}/" data-testid="nav-brand" aria-label="AC Bridge home"><span class="mk"></span><span class="wm">AC Bridge</span></a>`,WC='<span class="lockup"><span class="mk"></span><span class="wm">AC Bridge</span></span>';function VC(e){return`<a class="sso" data-testid="oauth-${e.provider}" href="${zt(e.url)}">${BC[e.provider]??""}<span>${zt(e.label)}</span>${HC}</a>`}function JC(e){let t=new URL(e.url),r=[...t.searchParams].filter(([o])=>o!=="login_hint").map(([o,n])=>`<input type="hidden" name="${zt(o)}" value="${zt(n)}">`).join("");return`<form class="email" method="get" action="${zt(`${t.origin}${t.pathname}`)}">${r}<label><span class="flt mono">Email</span><input class="inp" data-testid="email-input" name="login_hint" type="email" placeholder="you@email.com" autocomplete="email" required></label><button class="cta" data-testid="continue-email" type="submit">${zt(e.label)}</button></form>`}function py(e){let t=e.filter(o=>o.direct),r=e.find(o=>o.provider==="email");return`<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Log in | AC Bridge</title>
|
|
144
|
+
<style>${ZC}</style></head>
|
|
136
145
|
<body><div class="page" data-testid="login-page"><div class="split">
|
|
137
146
|
|
|
138
147
|
<aside class="aside" data-testid="login-session-panel">
|
|
139
148
|
<div class="mesh" aria-hidden="true"><div class="dots"></div><div class="aur a"></div><div class="aur b"></div></div>
|
|
140
|
-
${
|
|
149
|
+
${GC}
|
|
141
150
|
<div class="mid">
|
|
142
|
-
<div class="badge" aria-hidden="true"><div class="bars">${
|
|
151
|
+
<div class="badge" aria-hidden="true"><div class="bars">${Zu}</div><div class="orb"><span class="glow"></span><span class="mk"></span></div></div>
|
|
143
152
|
<div class="eyebrow mono">CLAUDE CODE + CODEX</div>
|
|
144
153
|
<h1>Welcome back to<br><span class="grad">the bridge.</span></h1>
|
|
145
154
|
<p class="lede">Your sessions are still running. Log in to pick up exactly where you left off, and see at a glance what your agents did while you were away.</p>
|
|
@@ -149,98 +158,98 @@ ${uP}
|
|
|
149
158
|
</aside>
|
|
150
159
|
|
|
151
160
|
<div class="right">
|
|
152
|
-
<div class="topright"><span>New here? <a href="${
|
|
161
|
+
<div class="topright"><span>New here? <a href="${wi}/register" data-testid="nav-register">Sign up free</a></span></div>
|
|
153
162
|
<div class="center"><div class="card">
|
|
154
163
|
<div class="eyebrow mono">WELCOME BACK</div>
|
|
155
164
|
<h2>Log in</h2>
|
|
156
165
|
<p class="sub">Pick up your sessions right where you left them.</p>
|
|
157
|
-
<div class="ssos">${t.map(
|
|
166
|
+
<div class="ssos">${t.map(VC).join("")}</div>
|
|
158
167
|
<div class="rule"><span class="hair"></span><span class="rl mono">or with email</span><span class="hair"></span></div>
|
|
159
|
-
${r?
|
|
160
|
-
<p class="newto">New to AC Bridge? <a href="${
|
|
168
|
+
${r?JC(r):""}
|
|
169
|
+
<p class="newto">New to AC Bridge? <a href="${wi}/register">Create a free account</a></p>
|
|
161
170
|
</div></div>
|
|
162
171
|
</div>
|
|
163
172
|
|
|
164
173
|
</div>
|
|
165
174
|
<footer class="foot" data-testid="site-footer"><div class="inner">
|
|
166
|
-
<div class="row">${
|
|
175
|
+
<div class="row">${WC}<nav aria-label="Footer"><a href="mailto:support@ac-bridge.com">support@ac-bridge.com</a><a href="${wi}/privacy">Privacy</a><a href="${wi}/terms">Terms</a></nav><span class="cr mono">(c) 2026 AC BRIDGE</span></div>
|
|
167
176
|
<span class="disc">Works with Claude Code and Codex. Not affiliated with or endorsed by Anthropic or OpenAI.</span>
|
|
168
177
|
</div></footer>
|
|
169
|
-
</div></body></html>`}import{spawn as
|
|
170
|
-
`)})}function
|
|
171
|
-
`,384)}function
|
|
172
|
-
`,384)}var
|
|
173
|
-
`,384)}function KP(e){try{let t=JSON.parse(Buffer.from(e.split(".")[1]??"","base64url").toString("utf8"));return typeof t.nid=="string"?t.nid:null}catch{return null}}var XP=()=>_t({notSignedIn:{message:"Not signed in. Run `acbridge login` first.",exitCode:3}});async function xb(e,t={}){let r=e[0];if(r!=="on"&&r!=="off"&&r!=="status")return x("usage: acbridge capture on|off|status"),2;let o=(t.requireToken??XP)();if(!o.ok)return x(o.message),o.exitCode;let n=o.token;if(r==="status"){let u=await(t.fetchEntitlement??zt)(n);u?(v(`plan: ${u.plan}`),v(`capture.telemetry: ${u.capture.telemetry}`),v(`capture.transcripts: ${u.capture.transcripts}`)):x("couldn't fetch entitlement from the relay (signed out, or the relay is unreachable)");let p=(t.entitlementFileRaw??YP)();if(!p)return v("local entitlement file: absent (capture fail-closed until the hub next syncs)"),0;try{let m=JSON.parse(p),f=(Date.now()-(m.fetchedAt??0))/36e5;v(`local entitlement file: ${f.toFixed(1)}h old (${f<=24?"fresh":"STALE \u2014 capture fail-closed"})`)}catch{v("local entitlement file: unreadable (capture fail-closed)")}return 0}let i=KP(n);if(!i)return x("Couldn't read this machine's node id from its access token \u2014 sign in again with `acbridge login`."),1;let a=await(t.patchNode??vb)(n,i,{captureEnabled:r==="on"});return a.ok?(v(`Capture ${r==="on"?"enabled":"disabled"} for this machine.`),r==="on"&&v("Note: capture is on by default for every account \u2014 this only re-enables it for THIS machine (still subject to the global capture switch)."),0):(x(`capture ${r} failed${a.status?` (${a.status})`:""}: ${a.error??"unknown"}`),1)}function YP(){let e=Oe();return e?N(e.entitlementFile):null}import{readFileSync as EO}from"node:fs";import{createInterface as AO}from"node:readline";var c={};nn(c,{$brand:()=>zu,$input:()=>sm,$output:()=>im,NEVER:()=>ju,TimePrecision:()=>um,ZodAny:()=>eg,ZodArray:()=>og,ZodBase64:()=>Fc,ZodBase64URL:()=>Mc,ZodBigInt:()=>No,ZodBigIntFormat:()=>Zc,ZodBoolean:()=>Do,ZodCIDRv4:()=>jc,ZodCIDRv6:()=>zc,ZodCUID:()=>Tc,ZodCUID2:()=>Rc,ZodCatch:()=>Ig,ZodCodec:()=>ns,ZodCustom:()=>rs,ZodCustomStringFormat:()=>Ro,ZodDate:()=>Xi,ZodDefault:()=>xg,ZodDiscriminatedUnion:()=>sg,ZodE164:()=>Bc,ZodEmail:()=>Ac,ZodEmoji:()=>Pc,ZodEnum:()=>Co,ZodError:()=>PR,ZodExactOptional:()=>vg,ZodFile:()=>gg,ZodFirstPartyTypeKind:()=>zg,ZodFunction:()=>Lg,ZodGUID:()=>Wi,ZodIPv4:()=>Lc,ZodIPv6:()=>Uc,ZodISODate:()=>wc,ZodISODateTime:()=>kc,ZodISODuration:()=>_c,ZodISOTime:()=>Sc,ZodIntersection:()=>ag,ZodIssueCode:()=>TR,ZodJWT:()=>Hc,ZodKSUID:()=>Nc,ZodLazy:()=>Og,ZodLiteral:()=>fg,ZodMAC:()=>Vf,ZodMap:()=>pg,ZodNaN:()=>Ag,ZodNanoID:()=>Cc,ZodNever:()=>ng,ZodNonOptional:()=>Kc,ZodNull:()=>Yf,ZodNullable:()=>bg,ZodNumber:()=>Oo,ZodNumberFormat:()=>kr,ZodObject:()=>Qi,ZodOptional:()=>Jc,ZodPipe:()=>ts,ZodPrefault:()=>wg,ZodPreprocess:()=>Pg,ZodPromise:()=>Ng,ZodReadonly:()=>Cg,ZodRealError:()=>nt,ZodRecord:()=>Po,ZodSet:()=>mg,ZodString:()=>To,ZodStringFormat:()=>he,ZodSuccess:()=>$g,ZodSymbol:()=>Kf,ZodTemplateLiteral:()=>Rg,ZodTransform:()=>hg,ZodTuple:()=>lg,ZodType:()=>ee,ZodULID:()=>Oc,ZodURL:()=>Ki,ZodUUID:()=>Zt,ZodUndefined:()=>Xf,ZodUnion:()=>es,ZodUnknown:()=>tg,ZodVoid:()=>rg,ZodXID:()=>Dc,ZodXor:()=>ig,_ZodString:()=>Ec,_default:()=>kg,_function:()=>cw,any:()=>zk,array:()=>Yi,base64:()=>wk,base64url:()=>Sk,bigint:()=>Dk,boolean:()=>Jf,catch:()=>Eg,check:()=>lw,cidrv4:()=>xk,cidrv6:()=>kk,clone:()=>Ze,codec:()=>ow,coerce:()=>Fg,config:()=>$e,core:()=>pn,cuid:()=>pk,cuid2:()=>mk,custom:()=>uw,date:()=>Mk,decode:()=>Ff,decodeAsync:()=>Bf,describe:()=>dw,discriminatedUnion:()=>Vk,e164:()=>_k,email:()=>nk,emoji:()=>uk,encode:()=>zf,encodeAsync:()=>Mf,endsWith:()=>bo,enum:()=>Vc,exactOptional:()=>yg,file:()=>ew,flattenError:()=>Ri,float32:()=>Ck,float64:()=>Tk,formatError:()=>Oi,fromJSONSchema:()=>yw,function:()=>cw,getErrorMap:()=>OR,globalRegistry:()=>De,gt:()=>Bt,gte:()=>We,guid:()=>rk,hash:()=>Pk,hex:()=>Ak,hostname:()=>Ek,httpUrl:()=>lk,includes:()=>vo,instanceof:()=>mw,int:()=>$c,int32:()=>Rk,int64:()=>Nk,intersection:()=>cg,invertCodec:()=>iw,ipv4:()=>vk,ipv6:()=>bk,iso:()=>Ao,json:()=>gw,jwt:()=>$k,keyof:()=>Bk,ksuid:()=>hk,lazy:()=>Dg,length:()=>br,literal:()=>Qk,locales:()=>Mi,looseObject:()=>Gk,looseRecord:()=>Jk,lowercase:()=>go,lt:()=>Mt,lte:()=>st,mac:()=>yk,map:()=>Kk,maxLength:()=>yr,maxSize:()=>Zn,meta:()=>pw,mime:()=>xo,minLength:()=>dn,minSize:()=>Ht,multipleOf:()=>Hn,nan:()=>rw,nanoid:()=>dk,nativeEnum:()=>Yk,negative:()=>dc,never:()=>Gc,nonnegative:()=>mc,nonoptional:()=>_g,nonpositive:()=>pc,normalize:()=>ko,null:()=>Qf,nullable:()=>qi,nullish:()=>tw,number:()=>qf,object:()=>Hk,optional:()=>Vi,overwrite:()=>It,parse:()=>Nf,parseAsync:()=>Lf,partialRecord:()=>qk,pipe:()=>Ic,positive:()=>uc,prefault:()=>Sg,preprocess:()=>hw,prettifyError:()=>Yu,promise:()=>aw,property:()=>fc,readonly:()=>Tg,record:()=>dg,refine:()=>Ug,regex:()=>fo,regexes:()=>it,registry:()=>Ha,safeDecode:()=>Zf,safeDecodeAsync:()=>Wf,safeEncode:()=>Hf,safeEncodeAsync:()=>Gf,safeParse:()=>Uf,safeParseAsync:()=>jf,set:()=>Xk,setErrorMap:()=>RR,size:()=>vr,slugify:()=>$o,startsWith:()=>yo,strictObject:()=>Zk,string:()=>Gi,stringFormat:()=>Ik,stringbool:()=>fw,success:()=>nw,superRefine:()=>jg,symbol:()=>Uk,templateLiteral:()=>sw,toJSONSchema:()=>yc,toLowerCase:()=>So,toUpperCase:()=>_o,transform:()=>qc,treeifyError:()=>Xu,trim:()=>wo,tuple:()=>ug,uint32:()=>Ok,uint64:()=>Lk,ulid:()=>fk,undefined:()=>jk,union:()=>Wc,unknown:()=>xr,uppercase:()=>ho,url:()=>ck,util:()=>C,uuid:()=>ok,uuidv4:()=>ik,uuidv6:()=>sk,uuidv7:()=>ak,void:()=>Fk,xid:()=>gk,xor:()=>Wk});var pn={};nn(pn,{$ZodAny:()=>Ep,$ZodArray:()=>Rp,$ZodAsyncError:()=>$t,$ZodBase64:()=>vp,$ZodBase64URL:()=>yp,$ZodBigInt:()=>Na,$ZodBigIntFormat:()=>Sp,$ZodBoolean:()=>Ui,$ZodCIDRv4:()=>fp,$ZodCIDRv6:()=>gp,$ZodCUID:()=>np,$ZodCUID2:()=>rp,$ZodCatch:()=>Kp,$ZodCheck:()=>ye,$ZodCheckBigIntFormat:()=>Rd,$ZodCheckEndsWith:()=>Zd,$ZodCheckGreaterThan:()=>Pa,$ZodCheckIncludes:()=>Bd,$ZodCheckLengthEquals:()=>jd,$ZodCheckLessThan:()=>Aa,$ZodCheckLowerCase:()=>Fd,$ZodCheckMaxLength:()=>Ld,$ZodCheckMaxSize:()=>Od,$ZodCheckMimeType:()=>Wd,$ZodCheckMinLength:()=>Ud,$ZodCheckMinSize:()=>Dd,$ZodCheckMultipleOf:()=>Cd,$ZodCheckNumberFormat:()=>Td,$ZodCheckOverwrite:()=>Vd,$ZodCheckProperty:()=>Gd,$ZodCheckRegex:()=>zd,$ZodCheckSizeEquals:()=>Nd,$ZodCheckStartsWith:()=>Hd,$ZodCheckStringFormat:()=>po,$ZodCheckUpperCase:()=>Md,$ZodCodec:()=>zi,$ZodCustom:()=>om,$ZodCustomStringFormat:()=>kp,$ZodDate:()=>Tp,$ZodDefault:()=>Wp,$ZodDiscriminatedUnion:()=>Np,$ZodE164:()=>bp,$ZodEmail:()=>Yd,$ZodEmoji:()=>ep,$ZodEncodeError:()=>jn,$ZodEnum:()=>Fp,$ZodError:()=>Ti,$ZodExactOptional:()=>Zp,$ZodFile:()=>Bp,$ZodFunction:()=>tm,$ZodGUID:()=>Kd,$ZodIPv4:()=>dp,$ZodIPv6:()=>pp,$ZodISODate:()=>cp,$ZodISODateTime:()=>ap,$ZodISODuration:()=>up,$ZodISOTime:()=>lp,$ZodIntersection:()=>Lp,$ZodJWT:()=>xp,$ZodKSUID:()=>sp,$ZodLazy:()=>rm,$ZodLiteral:()=>Mp,$ZodMAC:()=>mp,$ZodMap:()=>jp,$ZodNaN:()=>Xp,$ZodNanoID:()=>tp,$ZodNever:()=>Pp,$ZodNonOptional:()=>qp,$ZodNull:()=>Ip,$ZodNullable:()=>Gp,$ZodNumber:()=>Da,$ZodNumberFormat:()=>wp,$ZodObject:()=>Xb,$ZodObjectJIT:()=>Op,$ZodOptional:()=>Ua,$ZodPipe:()=>ja,$ZodPrefault:()=>Vp,$ZodPreprocess:()=>Yp,$ZodPromise:()=>nm,$ZodReadonly:()=>Qp,$ZodRealError:()=>tt,$ZodRecord:()=>Up,$ZodRegistry:()=>Ba,$ZodSet:()=>zp,$ZodString:()=>hr,$ZodStringFormat:()=>ge,$ZodSuccess:()=>Jp,$ZodSymbol:()=>_p,$ZodTemplateLiteral:()=>em,$ZodTransform:()=>Hp,$ZodTuple:()=>La,$ZodType:()=>V,$ZodULID:()=>op,$ZodURL:()=>Qd,$ZodUUID:()=>Xd,$ZodUndefined:()=>$p,$ZodUnion:()=>ji,$ZodUnknown:()=>Ap,$ZodVoid:()=>Cp,$ZodXID:()=>ip,$ZodXor:()=>Dp,$brand:()=>zu,$constructor:()=>b,$input:()=>sm,$output:()=>im,Doc:()=>Li,JSONSchema:()=>Qx,JSONSchemaGenerator:()=>bc,NEVER:()=>ju,TimePrecision:()=>um,_any:()=>Tm,_array:()=>jm,_base64:()=>sc,_base64url:()=>ac,_bigint:()=>_m,_boolean:()=>wm,_catch:()=>kR,_check:()=>Yx,_cidrv4:()=>oc,_cidrv6:()=>ic,_coercedBigint:()=>$m,_coercedBoolean:()=>Sm,_coercedDate:()=>Lm,_coercedNumber:()=>hm,_coercedString:()=>cm,_cuid:()=>Xa,_cuid2:()=>Ya,_custom:()=>Fm,_date:()=>Nm,_decode:()=>ba,_decodeAsync:()=>ka,_default:()=>yR,_discriminatedUnion:()=>sR,_e164:()=>cc,_email:()=>Za,_emoji:()=>Ja,_encode:()=>ya,_encodeAsync:()=>xa,_endsWith:()=>bo,_enum:()=>pR,_file:()=>zm,_float32:()=>ym,_float64:()=>bm,_gt:()=>Bt,_gte:()=>We,_guid:()=>Bi,_includes:()=>vo,_int:()=>vm,_int32:()=>xm,_int64:()=>Im,_intersection:()=>aR,_ipv4:()=>nc,_ipv6:()=>rc,_isoDate:()=>pm,_isoDateTime:()=>dm,_isoDuration:()=>fm,_isoTime:()=>mm,_jwt:()=>lc,_ksuid:()=>tc,_lazy:()=>$R,_length:()=>br,_literal:()=>fR,_lowercase:()=>go,_lt:()=>Mt,_lte:()=>st,_mac:()=>lm,_map:()=>uR,_max:()=>st,_maxLength:()=>yr,_maxSize:()=>Zn,_mime:()=>xo,_min:()=>We,_minLength:()=>dn,_minSize:()=>Ht,_multipleOf:()=>Hn,_nan:()=>Um,_nanoid:()=>Ka,_nativeEnum:()=>mR,_negative:()=>dc,_never:()=>Om,_nonnegative:()=>mc,_nonoptional:()=>bR,_nonpositive:()=>pc,_normalize:()=>ko,_null:()=>Cm,_nullable:()=>vR,_number:()=>gm,_optional:()=>hR,_overwrite:()=>It,_parse:()=>ao,_parseAsync:()=>co,_pipe:()=>wR,_positive:()=>uc,_promise:()=>IR,_property:()=>fc,_readonly:()=>SR,_record:()=>lR,_refine:()=>Mm,_regex:()=>fo,_safeDecode:()=>Sa,_safeDecodeAsync:()=>$a,_safeEncode:()=>wa,_safeEncodeAsync:()=>_a,_safeParse:()=>lo,_safeParseAsync:()=>uo,_set:()=>dR,_size:()=>vr,_slugify:()=>$o,_startsWith:()=>yo,_string:()=>am,_stringFormat:()=>Io,_stringbool:()=>Gm,_success:()=>xR,_superRefine:()=>Bm,_symbol:()=>Am,_templateLiteral:()=>_R,_toLowerCase:()=>So,_toUpperCase:()=>_o,_transform:()=>gR,_trim:()=>wo,_tuple:()=>cR,_uint32:()=>km,_uint64:()=>Em,_ulid:()=>Qa,_undefined:()=>Pm,_union:()=>oR,_unknown:()=>Rm,_uppercase:()=>ho,_url:()=>Hi,_uuid:()=>Ga,_uuidv4:()=>Wa,_uuidv6:()=>Va,_uuidv7:()=>qa,_void:()=>Dm,_xid:()=>ec,_xor:()=>iR,clone:()=>Ze,config:()=>$e,createStandardJSONSchemaMethod:()=>Eo,createToJSONSchemaMethod:()=>Wm,decode:()=>IC,decodeAsync:()=>AC,describe:()=>Hm,encode:()=>$C,encodeAsync:()=>EC,extractDefs:()=>Wn,finalize:()=>Vn,flattenError:()=>Ri,formatError:()=>Oi,globalConfig:()=>mr,globalRegistry:()=>De,initializeContext:()=>Gn,isValidBase64:()=>hp,isValidBase64URL:()=>Vb,isValidJWT:()=>qb,locales:()=>Mi,meta:()=>Zm,parse:()=>ha,parseAsync:()=>va,prettifyError:()=>Yu,process:()=>pe,regexes:()=>it,registry:()=>Ha,safeDecode:()=>CC,safeDecodeAsync:()=>RC,safeEncode:()=>PC,safeEncodeAsync:()=>TC,safeParse:()=>Qu,safeParseAsync:()=>ed,toDotPath:()=>Ib,toJSONSchema:()=>yc,treeifyError:()=>Xu,util:()=>C,version:()=>qd});var kb,ju=Object.freeze({status:"aborted"});function b(e,t,r){function o(a,l){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:l,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,l);let u=s.prototype,d=Object.keys(u);for(let p=0;p<d.length;p++){let m=d[p];m in a||(a[m]=u[m].bind(a))}}let n=r?.Parent??Object;class i extends n{}Object.defineProperty(i,"name",{value:e});function s(a){var l;let u=r?.Parent?new i:this;o(u,a),(l=u._zod).deferred??(l.deferred=[]);for(let d of u._zod.deferred)d();return u}return Object.defineProperty(s,"init",{value:o}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}var zu=Symbol("zod_brand"),$t=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},jn=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(kb=globalThis).__zod_globalConfig??(kb.__zod_globalConfig={});var mr=globalThis.__zod_globalConfig;function $e(e){return e&&Object.assign(mr,e),mr}var C={};nn(C,{BIGINT_FORMAT_RANGES:()=>Ju,Class:()=>Mu,NUMBER_FORMAT_RANGES:()=>qu,aborted:()=>Bn,allowsEval:()=>Zu,assert:()=>rC,assertEqual:()=>QP,assertIs:()=>tC,assertNever:()=>nC,assertNotEqual:()=>eC,assignProp:()=>Fn,base64ToUint8Array:()=>Sb,base64urlToUint8Array:()=>xC,cached:()=>io,captureStackTrace:()=>ga,cleanEnum:()=>bC,cleanRegex:()=>Ei,clone:()=>Ze,cloneDef:()=>iC,createTransparentProxy:()=>dC,defineLazy:()=>ne,esc:()=>fa,escapeRegex:()=>ht,explicitlyAborted:()=>Ku,extend:()=>fC,finalizeIssue:()=>Ge,floatSafeRemainder:()=>Bu,getElementAtPath:()=>sC,getEnumValues:()=>Ii,getLengthableOrigin:()=>Ci,getParsedType:()=>uC,getSizableOrigin:()=>Pi,hexToUint8Array:()=>wC,isObject:()=>fr,isPlainObject:()=>Mn,issue:()=>so,joinValues:()=>w,jsonStringifyReplacer:()=>oo,merge:()=>hC,mergeDefs:()=>un,normalizeParams:()=>R,nullish:()=>zn,numKeys:()=>lC,objectClone:()=>oC,omit:()=>mC,optionalKeys:()=>Vu,parsedType:()=>P,partial:()=>vC,pick:()=>pC,prefixIssues:()=>et,primitiveTypes:()=>Wu,promiseAllObject:()=>aC,propertyKeyTypes:()=>Ai,randomString:()=>cC,required:()=>yC,safeExtend:()=>gC,shallowClone:()=>Gu,slugify:()=>Hu,stringifyPrimitive:()=>A,uint8ArrayToBase64:()=>_b,uint8ArrayToBase64url:()=>kC,uint8ArrayToHex:()=>SC,unwrapMessage:()=>$i});function QP(e){return e}function eC(e){return e}function tC(e){}function nC(e){throw new Error("Unexpected value in exhaustive check")}function rC(e){}function Ii(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function w(e,t="|"){return e.map(r=>A(r)).join(t)}function oo(e,t){return typeof t=="bigint"?t.toString():t}function io(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function zn(e){return e==null}function Ei(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Bu(e,t){let r=e/t,o=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-o)<n?0:r-o}var wb=Symbol("evaluating");function ne(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==wb)return o===void 0&&(o=wb,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function oC(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Fn(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function un(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function iC(e){return un(e._zod.def)}function sC(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function aC(e){let t=Object.keys(e),r=t.map(o=>e[o]);return Promise.all(r).then(o=>{let n={};for(let i=0;i<t.length;i++)n[t[i]]=o[i];return n})}function cC(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function fa(e){return JSON.stringify(e)}function Hu(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var ga="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function fr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Zu=io(()=>{if(mr.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Mn(e){if(fr(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(fr(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Gu(e){return Mn(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function lC(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var uC=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Ai=new Set(["string","number","symbol"]),Wu=new Set(["string","number","bigint","boolean","symbol","undefined"]);function ht(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ze(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function R(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function dC(e){let t;return new Proxy({},{get(r,o,n){return t??(t=e()),Reflect.get(t,o,n)},set(r,o,n,i){return t??(t=e()),Reflect.set(t,o,n,i)},has(r,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(r,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(r,o,n){return t??(t=e()),Reflect.defineProperty(t,o,n)}})}function A(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Vu(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var qu={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Ju={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function pC(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i=un(e._zod.def,{get shape(){let s={};for(let a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(s[a]=r.shape[a])}return Fn(this,"shape",s),s},checks:[]});return Ze(e,i)}function mC(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=un(e._zod.def,{get shape(){let s={...e._zod.def.shape};for(let a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete s[a]}return Fn(this,"shape",s),s},checks:[]});return Ze(e,i)}function fC(e,t){if(!Mn(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let i=e._zod.def.shape;for(let s in t)if(Object.getOwnPropertyDescriptor(i,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=un(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return Fn(this,"shape",i),i}});return Ze(e,n)}function gC(e,t){if(!Mn(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=un(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return Fn(this,"shape",o),o}});return Ze(e,r)}function hC(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=un(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return Fn(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Ze(e,r)}function vC(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let s=un(t._zod.def,{get shape(){let a=t._zod.def.shape,l={...a};if(r)for(let u in r){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(l[u]=e?new e({type:"optional",innerType:a[u]}):a[u])}else for(let u in a)l[u]=e?new e({type:"optional",innerType:a[u]}):a[u];return Fn(this,"shape",l),l},checks:[]});return Ze(t,s)}function yC(e,t,r){let o=un(t._zod.def,{get shape(){let n=t._zod.def.shape,i={...n};if(r)for(let s in r){if(!(s in i))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(i[s]=new e({type:"nonoptional",innerType:n[s]}))}else for(let s in n)i[s]=new e({type:"nonoptional",innerType:n[s]});return Fn(this,"shape",i),i}});return Ze(t,o)}function Bn(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function Ku(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function et(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function $i(e){return typeof e=="string"?e:e?.message}function Ge(e,t,r){let o=e.message?e.message:$i(e.inst?._zod.def?.error?.(e))??$i(t?.error?.(e))??$i(r.customError?.(e))??$i(r.localeError?.(e))??"Invalid input",{inst:n,continue:i,input:s,...a}=e;return a.path??(a.path=[]),a.message=o,t?.reportInput&&(a.input=s),a}function Pi(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Ci(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function P(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function so(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function bC(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function Sb(e){let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}function _b(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function xC(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return Sb(t+r)}function kC(e){return _b(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function wC(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)r[o/2]=Number.parseInt(t.slice(o,o+2),16);return r}function SC(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Mu=class{constructor(...t){}};var $b=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,oo,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ti=b("$ZodError",$b),tt=b("$ZodError",$b,{Parent:Error});function Ri(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):o.push(t(n));return{formErrors:o,fieldErrors:r}}function Oi(e,t=r=>r.message){let r={_errors:[]},o=(n,i=[])=>{for(let s of n.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>o({issues:a},[...i,...s.path]));else if(s.code==="invalid_key")o({issues:s.issues},[...i,...s.path]);else if(s.code==="invalid_element")o({issues:s.issues},[...i,...s.path]);else{let a=[...i,...s.path];if(a.length===0)r._errors.push(t(s));else{let l=r,u=0;for(;u<a.length;){let d=a[u];u===a.length-1?(l[d]=l[d]||{_errors:[]},l[d]._errors.push(t(s))):l[d]=l[d]||{_errors:[]},l=l[d],u++}}}};return o(e),r}function Xu(e,t=r=>r.message){let r={errors:[]},o=(n,i=[])=>{var s,a;for(let l of n.issues)if(l.code==="invalid_union"&&l.errors.length)l.errors.map(u=>o({issues:u},[...i,...l.path]));else if(l.code==="invalid_key")o({issues:l.issues},[...i,...l.path]);else if(l.code==="invalid_element")o({issues:l.issues},[...i,...l.path]);else{let u=[...i,...l.path];if(u.length===0){r.errors.push(t(l));continue}let d=r,p=0;for(;p<u.length;){let m=u[p],f=p===u.length-1;typeof m=="string"?(d.properties??(d.properties={}),(s=d.properties)[m]??(s[m]={errors:[]}),d=d.properties[m]):(d.items??(d.items=[]),(a=d.items)[m]??(a[m]={errors:[]}),d=d.items[m]),f&&d.errors.push(t(l)),p++}}};return o(e),r}function Ib(e){let t=[],r=e.map(o=>typeof o=="object"?o.key:o);for(let o of r)typeof o=="number"?t.push(`[${o}]`):typeof o=="symbol"?t.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?t.push(`[${JSON.stringify(o)}]`):(t.length&&t.push("."),t.push(o));return t.join("")}function Yu(e){let t=[],r=[...e.issues].sort((o,n)=>(o.path??[]).length-(n.path??[]).length);for(let o of r)t.push(`\u2716 ${o.message}`),o.path?.length&&t.push(` \u2192 at ${Ib(o.path)}`);return t.join(`
|
|
174
|
-
`)}var ao=e=>(t,r,o,n)=>{let i=o?{...o,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new $t;if(s.issues.length){let a=new(n?.Err??e)(s.issues.map(l=>Ge(l,i,$e())));throw ga(a,n?.callee),a}return s.value},ha=ao(tt),co=e=>async(t,r,o,n)=>{let i=o?{...o,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){let a=new(n?.Err??e)(s.issues.map(l=>Ge(l,i,$e())));throw ga(a,n?.callee),a}return s.value},va=co(tt),lo=e=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},n);if(i instanceof Promise)throw new $t;return i.issues.length?{success:!1,error:new(e??Ti)(i.issues.map(s=>Ge(s,n,$e())))}:{success:!0,data:i.value}},Qu=lo(tt),uo=e=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},n);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(s=>Ge(s,n,$e())))}:{success:!0,data:i.value}},ed=uo(tt),ya=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return ao(e)(t,r,n)},$C=ya(tt),ba=e=>(t,r,o)=>ao(e)(t,r,o),IC=ba(tt),xa=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return co(e)(t,r,n)},EC=xa(tt),ka=e=>async(t,r,o)=>co(e)(t,r,o),AC=ka(tt),wa=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return lo(e)(t,r,n)},PC=wa(tt),Sa=e=>(t,r,o)=>lo(e)(t,r,o),CC=Sa(tt),_a=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return uo(e)(t,r,n)},TC=_a(tt),$a=e=>async(t,r,o)=>uo(e)(t,r,o),RC=$a(tt);var it={};nn(it,{base64:()=>hd,base64url:()=>Ia,bigint:()=>Sd,boolean:()=>$d,browserEmail:()=>FC,cidrv4:()=>fd,cidrv6:()=>gd,cuid:()=>td,cuid2:()=>nd,date:()=>bd,datetime:()=>kd,domain:()=>HC,duration:()=>ad,e164:()=>yd,email:()=>ld,emoji:()=>ud,extendedDuration:()=>OC,guid:()=>cd,hex:()=>ZC,hostname:()=>BC,html5Email:()=>UC,httpProtocol:()=>vd,idnEmail:()=>zC,integer:()=>_d,ipv4:()=>dd,ipv6:()=>pd,ksuid:()=>id,lowercase:()=>Ad,mac:()=>md,md5_base64:()=>WC,md5_base64url:()=>VC,md5_hex:()=>GC,nanoid:()=>sd,null:()=>Id,number:()=>Ea,rfc5322Email:()=>jC,sha1_base64:()=>JC,sha1_base64url:()=>KC,sha1_hex:()=>qC,sha256_base64:()=>YC,sha256_base64url:()=>QC,sha256_hex:()=>XC,sha384_base64:()=>tT,sha384_base64url:()=>nT,sha384_hex:()=>eT,sha512_base64:()=>oT,sha512_base64url:()=>iT,sha512_hex:()=>rT,string:()=>wd,time:()=>xd,ulid:()=>rd,undefined:()=>Ed,unicodeEmail:()=>Eb,uppercase:()=>Pd,uuid:()=>gr,uuid4:()=>DC,uuid6:()=>NC,uuid7:()=>LC,xid:()=>od});var td=/^[cC][0-9a-z]{6,}$/,nd=/^[0-9a-z]+$/,rd=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,od=/^[0-9a-vA-V]{20}$/,id=/^[A-Za-z0-9]{27}$/,sd=/^[a-zA-Z0-9_-]{21}$/,ad=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,OC=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,cd=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,gr=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,DC=gr(4),NC=gr(6),LC=gr(7),ld=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,UC=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,jC=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Eb=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,zC=Eb,FC=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,MC="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function ud(){return new RegExp(MC,"u")}var dd=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,pd=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,md=e=>{let t=ht(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},fd=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,gd=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,hd=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ia=/^[A-Za-z0-9_-]*$/,BC=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,HC=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,vd=/^https?$/,yd=/^\+[1-9]\d{6,14}$/,Ab="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",bd=new RegExp(`^${Ab}$`);function Pb(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function xd(e){return new RegExp(`^${Pb(e)}$`)}function kd(e){let t=Pb({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${t}(?:${r.join("|")})`;return new RegExp(`^${Ab}T(?:${o})$`)}var wd=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Sd=/^-?\d+n?$/,_d=/^-?\d+$/,Ea=/^-?\d+(?:\.\d+)?$/,$d=/^(?:true|false)$/i,Id=/^null$/i;var Ed=/^undefined$/i;var Ad=/^[^A-Z]*$/,Pd=/^[^a-z]*$/,ZC=/^[0-9a-fA-F]*$/;function Di(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Ni(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var GC=/^[0-9a-fA-F]{32}$/,WC=Di(22,"=="),VC=Ni(22),qC=/^[0-9a-fA-F]{40}$/,JC=Di(27,"="),KC=Ni(27),XC=/^[0-9a-fA-F]{64}$/,YC=Di(43,"="),QC=Ni(43),eT=/^[0-9a-fA-F]{96}$/,tT=Di(64,""),nT=Ni(64),rT=/^[0-9a-fA-F]{128}$/,oT=Di(86,"=="),iT=Ni(86);var ye=b("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Tb={number:"number",bigint:"bigint",object:"date"},Aa=b("$ZodCheckLessThan",(e,t)=>{ye.init(e,t);let r=Tb[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,i=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Pa=b("$ZodCheckGreaterThan",(e,t)=>{ye.init(e,t);let r=Tb[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,i=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Cd=b("$ZodCheckMultipleOf",(e,t)=>{ye.init(e,t),e._zod.onattach.push(r=>{var o;(o=r._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):Bu(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Td=b("$ZodCheckNumberFormat",(e,t)=>{ye.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,i]=qu[t.format];e._zod.onattach.push(s=>{let a=s._zod.bag;a.format=t.format,a.minimum=n,a.maximum=i,r&&(a.pattern=_d)}),e._zod.check=s=>{let a=s.value;if(r){if(!Number.isInteger(a)){s.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}a<n&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),a>i&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),Rd=b("$ZodCheckBigIntFormat",(e,t)=>{ye.init(e,t);let[r,o]=Ju[t.format];e._zod.onattach.push(n=>{let i=n._zod.bag;i.format=t.format,i.minimum=r,i.maximum=o}),e._zod.check=n=>{let i=n.value;i<r&&n.issues.push({origin:"bigint",input:i,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),i>o&&n.issues.push({origin:"bigint",input:i,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),Od=b("$ZodCheckMaxSize",(e,t)=>{var r;ye.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!zn(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;n.size<=t.maximum||o.issues.push({origin:Pi(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Dd=b("$ZodCheckMinSize",(e,t)=>{var r;ye.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!zn(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;n.size>=t.minimum||o.issues.push({origin:Pi(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Nd=b("$ZodCheckSizeEquals",(e,t)=>{var r;ye.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!zn(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=o=>{let n=o.value,i=n.size;if(i===t.size)return;let s=i>t.size;o.issues.push({origin:Pi(n),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Ld=b("$ZodCheckMaxLength",(e,t)=>{var r;ye.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!zn(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;if(n.length<=t.maximum)return;let s=Ci(n);o.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Ud=b("$ZodCheckMinLength",(e,t)=>{var r;ye.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!zn(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;if(n.length>=t.minimum)return;let s=Ci(n);o.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),jd=b("$ZodCheckLengthEquals",(e,t)=>{var r;ye.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!zn(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=o=>{let n=o.value,i=n.length;if(i===t.length)return;let s=Ci(n),a=i>t.length;o.issues.push({origin:s,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),po=b("$ZodCheckStringFormat",(e,t)=>{var r,o;ye.init(e,t),e._zod.onattach.push(n=>{let i=n._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),zd=b("$ZodCheckRegex",(e,t)=>{po.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Fd=b("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Ad),po.init(e,t)}),Md=b("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Pd),po.init(e,t)}),Bd=b("$ZodCheckIncludes",(e,t)=>{ye.init(e,t);let r=ht(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=o,e._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Hd=b("$ZodCheckStartsWith",(e,t)=>{ye.init(e,t);let r=new RegExp(`^${ht(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),Zd=b("$ZodCheckEndsWith",(e,t)=>{ye.init(e,t);let r=new RegExp(`.*${ht(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});function Cb(e,t,r){e.issues.length&&t.issues.push(...et(r,e.issues))}var Gd=b("$ZodCheckProperty",(e,t)=>{ye.init(e,t),e._zod.check=r=>{let o=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(o instanceof Promise)return o.then(n=>Cb(n,r,t.property));Cb(o,r,t.property)}}),Wd=b("$ZodCheckMimeType",(e,t)=>{ye.init(e,t);let r=new Set(t.mime);e._zod.onattach.push(o=>{o._zod.bag.mime=t.mime}),e._zod.check=o=>{r.has(o.value.type)||o.issues.push({code:"invalid_value",values:t.mime,input:o.value.type,inst:e,continue:!t.abort})}}),Vd=b("$ZodCheckOverwrite",(e,t)=>{ye.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var Li=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(`
|
|
178
|
+
</div></body></html>`}import{spawn as Wu}from"node:child_process";function qC(e,t=Wu){return new Promise(r=>{let o=!1,n=a=>{o||(o=!0,r(a))},i=t("powershell.exe",["-NoProfile","-NonInteractive","-Command","$u=[Console]::In.ReadLine(); try { Start-Process $u -ErrorAction Stop } catch { exit 1 }"],{stdio:["pipe","ignore","ignore"]}),s=setTimeout(()=>{try{i.kill()}catch{}n(!1)},8e3);s.unref?.(),i.on("error",()=>{clearTimeout(s),n(!1)}),i.on("exit",a=>{clearTimeout(s),n(a===0)}),i.stdin?.on("error",()=>{}),i.stdin?.end(`${e}
|
|
179
|
+
`)})}function KC(e,t=Wu){return new Promise(r=>{let o=t("cmd.exe",["/c","start","",e.replace(/&/g,"^&")],{detached:!0,stdio:"ignore"});o.on("error",()=>r(!1)),o.on("spawn",()=>{o.unref(),r(!0)})})}var XC=1200;function my(e,t,r,o){return new Promise(n=>{let i=!1,s=u=>{i||(i=!0,n(u))},a=r(e,[t],{detached:!0,stdio:"ignore"}),l=setTimeout(()=>s(!0),o);l.unref?.(),a.on("error",()=>{clearTimeout(l),s(!1)}),a.on("exit",u=>{clearTimeout(l),s(u===0)}),a.on("spawn",()=>a.unref())})}async function oo(e,t){let r=t.platform??process.platform,o=t.spawnImpl??Wu;if(r==="win32"||t.isWsl)return await qC(e,o)?!0:KC(e,o);let n=t.graceMs??XC;return my(r==="darwin"?"open":"xdg-open",e,o,n)}function da(){return Jv().length>0}function YC(){fi()}async function fy(e,t,r){let o=(e??"").replace(/\/+$/,""),n=r?.fetchImpl??fetch;if(o&&t)try{await n(`${o}/node/revoke`,{method:"POST",headers:{"content-type":"application/json",authorization:`Bearer ${t}`},body:"{}",signal:AbortSignal.timeout(3e3)})}catch{}(r?.clear??YC)()}var QC=4,eP=1500,tP=e=>new Promise(t=>setTimeout(t,e)),Si=null;function gy(e,t,r={}){if((r.hasCredential??da)())return Promise.resolve(!0);if(Si)return Si;let n=r.attempts??QC,i=r.retryMs??eP,s=r.provision??Gv,a=r.claim??Wv,l=r.store??wu,u=r.log??(p=>console.error(p));return Si=(async()=>{let p="no attempt made";try{for(let d=1;d<=n;d++){d>1&&await tP(i);let m=t();if(!m){p="no sign-in token available yet";continue}try{let f=await s(e,m),g=await a(e,f);if(!g.access_token||!g.refresh_token)throw new Error("claim returned an incomplete pair");return l(g),!0}catch(f){p=f instanceof Error?f.message:String(f)}}return u(`[auth] node-credential provisioning failed after ${n} attempts (hub will fall back to the app-refreshed token): ${p}`),!1}finally{Si=null}})(),Si}async function hy(e){let t=ry(),r=oy(),o=e.chooser?py(dy({cfg:e.cfg,state:r,codeChallenge:t.challenge,...e.opts.email?{email:e.opts.email}:{},...e.opts.screenHint?{screenHint:e.opts.screenHint}:{}})):void 0,i=(e.listen??((p,d,m,f,g)=>cy(p,d,m,f,void 0,void 0,g)))(e.cfg.port,r,e.signal,e.timeoutMs??18e4,o),s=e.openUrl??(p=>oo(p,{isWsl:!1})),a;o?(i.result.catch(()=>{}),a=`http://127.0.0.1:${await i.port}/`):a=la({cfg:e.cfg,opts:e.opts,state:r,codeChallenge:t.challenge}),await s(a)||e.onBrowserFail?.(a);let{code:l}=await i.result;return(e.exchange??((p,d,m)=>sy(p,d,m)))(e.cfg,l,t.verifier)}import Ye from"node:path";function Pe(e={}){let t=N(e.file??pi);if(!t)return null;try{let r=JSON.parse(t);return typeof r.sub!="string"||!r.sub?null:{sub:r.sub,...typeof r.email=="string"?{email:r.email}:{},updatedAt:typeof r.updatedAt=="number"?r.updatedAt:0}}catch{return null}}function mr(e,t={}){let r={sub:e.sub,...e.email?{email:e.email}:{},updatedAt:Date.now()};we(t.file??pi,`${JSON.stringify(r,null,2)}
|
|
180
|
+
`,384)}function vy(e={}){ve(e.file??pi)}function rP(){let e=Pe()?.sub;if(!e)return null;let t=kt(mt(e)),r=N(t.refreshFile),o=r?Ke(r):null;if(o)return o;let n=N(t.accessFile);return n?Ke(n):null}function gt(e={}){let t=e.readActiveUser??(()=>Pe()),r=e.readCredentialSub??rP,o=e.log??(a=>console.warn(a)),n=t()?.sub??null,i=r();if(!n||!i)return null;if(n!==i)return o(`user-scope: active-user pointer sub (${n}) does not match the credential sub (${i}) \u2014 refusing to resolve a scope (stale-pointer guard)`),null;let s=mt(n);return{sub:n,segment:s,dir:zs(s)}}function $i(e){let t=e.dir;return{dir:t,providerSecretFile(r,o){return _i("provider",r),_i("secret name",o),Ye.join(t,"providers",r,`${o}.json`)},providerAccountsFile(r){return _i("provider",r),Ye.join(t,"providers",r,"accounts.json")},localConfigFile:Ye.join(t,"local-config.json"),localDiscoveredFile:Ye.join(t,"local-discovered.json"),entitlementFile:Ye.join(t,"entitlement.json"),revertSessionFile:Ye.join(t,"revert-session.json"),telemetrySpoolDir:Ye.join(t,"telemetry","spool"),userConfigFile:Ye.join(t,"config.json"),relayAccessFile:Ye.join(t,"relay-access-token"),relayRefreshFile:Ye.join(t,"relay-refresh-token"),hubTokenFile:Ye.join(t,"hub-token"),workspaceFile:Ye.join(t,"workspace.json")}}function Vu(e,t){if((t?.layout??sn())>=an){let o=(t?.resolveScope??(()=>gt()))();if(o)return Ye.join(e,"users",o.segment,"hub-token")}return Ye.join(e,"hub-token")}import{existsSync as oP,mkdirSync as yy,renameSync as Ju}from"node:fs";import Be from"node:path";var iP="layout-version.json",xy=3,sP=["providers","local-config.json","local-discovered.json","entitlement.json","revert-session.json","telemetry"];function ky(e={}){let t=e.secretDir??Y,r=e.now??(()=>new Date),o=Be.join(t,iP);if(pP(o))return{archived:[],skipped:!0,credentialRelocated:null,credentialArchived:!1};let n=Be.join(t,`legacy-${dP(r())}`),i=!1,s=()=>(i||(yy(n,{recursive:!0,mode:448}),i=!0),n),a=sP.filter(d=>oP(Be.join(t,d))),l=[];for(let d of a)try{s(),Ju(Be.join(t,d),Be.join(n,d)),l.push(d)}catch(m){if(m.code==="ENOENT")continue;console.warn(`archiveLegacyUserState: failed to archive "${d}": ${m.message}`)}let u=l.length===a.length;ve(Be.join(t,"hub-token"));let p=u?uP(t,s):{relocated:null,archived:!1,ok:!0};return u&&p.ok&&(aa({onboardedAt:null},{configFile:Be.join(t,"config.json")}),mP(o,r)),{archived:l,skipped:!1,credentialRelocated:p.relocated,credentialArchived:p.archived}}function aP(e){return{accessFile:Be.join(e,"relay-access-token"),refreshFile:Be.join(e,"relay-refresh-token")}}function cP(e,t){let r=Be.join(e,"users",t);return{accessFile:Be.join(r,"relay-access-token"),refreshFile:Be.join(r,"relay-refresh-token")}}function by(e,t){try{return yy(Be.dirname(t),{recursive:!0,mode:448}),Ju(e,t),"moved"}catch(r){return r.code==="ENOENT"?"absent":(console.warn(`archiveLegacyUserState: failed to relocate credential to "${t}": ${r.message}`),"failed")}}function pa(e,t,r){try{let o=e();return Ju(t,Be.join(o,r)),"moved"}catch(o){return o.code==="ENOENT"?"absent":(console.warn(`archiveLegacyUserState: failed to archive credential "${r}": ${o.message}`),"failed")}}function lP(e,t){let r=Be.join(e,"active-user.json");if(Pe({file:r})===null)try{mr({sub:t},{file:r})}catch(o){console.warn(`archiveLegacyUserState: failed to heal the active-user pointer to "${t}": ${o.message}`)}}function uP(e,t){let r=aP(e),o=N(r.refreshFile),n=N(r.accessFile);if(!o&&!n)return{relocated:null,archived:!1,ok:!0};let i=o?Ke(o):null,s=n?Ke(n):null,a=i??s;if(!a){let m=o?pa(t,r.refreshFile,"relay-refresh-token"):"absent",f=n?pa(t,r.accessFile,"relay-access-token"):"absent";return{relocated:null,archived:m==="moved"||f==="moved",ok:m!=="failed"&&f!=="failed"}}i&&s&&i!==s&&console.warn(`archiveLegacyUserState: access-token sub (${s}) differs from refresh-token sub (${i}) \u2014 relocating the refresh to its sub and archiving the access (the refresh loop re-mints a matching access)`);let l=mt(a),u=cP(e,l),p=!0,d=!1;if(o){let m=i===a?by(r.refreshFile,u.refreshFile):pa(t,r.refreshFile,"relay-refresh-token");m==="failed"?p=!1:m==="moved"&&i!==a&&(d=!0)}if(n){let m=s===a?by(r.accessFile,u.accessFile):pa(t,r.accessFile,"relay-access-token");m==="failed"?p=!1:m==="moved"&&s!==a&&(d=!0)}return p&&lP(e,a),{relocated:{sub:a,segment:l},archived:d,ok:p}}function dP(e){return e.toISOString().replace(/[:.]/g,"-")}function pP(e){let t=N(e);if(!t)return!1;try{let r=JSON.parse(t);return typeof r.version=="number"&&r.version>=xy}catch{return!1}}function mP(e,t){let r={version:xy,migratedAt:t().toISOString()};we(e,`${JSON.stringify(r,null,2)}
|
|
181
|
+
`,384)}var yP=He.join(Y,"hub-token"),TM=Number(process.env.BRIDGE_HUB_PORT)||8790,_e=He.join(Y,"config.json"),St=He.join(Y,"hub.log"),hi=He.join(Y,"hub.pid"),RM=He.join(Y,cr),Qe=He.join(Y,"daemon.pid"),ma=He.join(Y,"daemon-beacon.json"),Un=He.join(Y,"daemon.log"),Ii=He.join(Y,"hub-stop-reason.json"),nP=He.join(Y,"app-path"),$y=He.join(Y,"hub-relay-status.json"),OM=He.join(Y,"hub-holders.json"),Iy=He.join(Y,"sessions"),qu=e=>He.join(Iy,`${e}.json`);function we(e,t,r=384){let o=He.dirname(e),n=(r&63)===0;if(gP(o,{recursive:!0,...n?{mode:448}:{}}),n)try{wy(o,448)}catch{}let i=`${e}.tmp-${process.pid}-${process.hrtime.bigint()}`;_y(i,t,{mode:r});try{vP(i,e)}catch(s){try{Sy(i,{force:!0})}catch{}throw s}}function N(e){try{return hP(e,"utf8").trim()||null}catch{return null}}function Ey(e,t){let r=t?.write??((n,i)=>we(n,i,384)),o=t?.now??Date.now;try{r(Ii,JSON.stringify({signal:e,ts:o()}))}catch{}}function fa(){let e={};try{let t=N(_e);t&&(e=JSON.parse(t))}catch{}return process.env.BRIDGE_MACHINE||e.machine||bP.hostname().split(".")[0]||"node"}function Ay(){let e=Number(process.env.BRIDGE_HUB_PORT);if(e)return e;try{let t=N(_e);if(t){let r=JSON.parse(t);if(r.hubPort)return Number(r.hubPort)}}catch{}return 8790}function Ku(e){try{_y(e,"",{mode:384}),wy(e,384)}catch{}}function ve(e){try{Sy(e,{force:!0})}catch{}}function ga(e){try{return process.kill(e,0),!0}catch(t){return t.code!=="ESRCH"}}function _i(e,t){if(!t||t.includes("/")||t.includes("\\")||t.includes("..")||t.includes("\0"))throw new Error(`unsafe ${e}: ${JSON.stringify(t)}`)}function ha(e,t){return _i("provider",e),`${e}_${fP("sha256").update(t).digest("hex").slice(0,12)}`}import{readFileSync as SP}from"node:fs";import{existsSync as xP}from"node:fs";import ln from"node:path";import{fileURLToPath as kP}from"node:url";function wP(e){let t=process.env.BRIDGE_PKG_ROOT;if(t&&t.trim())return t.trim();let r=o=>xP(ln.join(o,"plugin",".claude-plugin","marketplace.json"));for(let o of[ln.join(e,".."),ln.join(e,"..","..")])if(r(o))return o;return ln.join(e,"..","..")}var un=wP(ln.dirname(kP(import.meta.url))),jn=ln.join(un,"plugin"),Ei=ln.join(un,"hub","dist","hub.cjs"),Cy=ln.join(un,"hub","src","index.ts"),va=ln.join(un,"node_modules",".bin","tsx");var _P="https://relay.ac-bridge.com",$P=8790;function de(){let e={};try{e=JSON.parse(SP(_e,"utf8"))}catch{}return{relayUrl:process.env.BRIDGE_RELAY_URL||e.relayUrl||_P,hubPort:Number(process.env.BRIDGE_HUB_PORT||e.hubPort||$P),machine:fa()}}async function Py(e,t,r){let{relayUrl:o}=de();return fetch(`${o}${e}`,{method:"POST",headers:{"content-type":"application/json",...r?{authorization:`Bearer ${r}`}:{}},body:t===void 0?void 0:JSON.stringify(t)})}async function Ft(e){let{relayUrl:t}=de();try{let r=await fetch(`${t}/entitlement`,{headers:{authorization:`Bearer ${e}`},signal:AbortSignal.timeout(6e3)});return r.ok?await r.json():null}catch{return null}}async function Ty(e,t=fetch){let{relayUrl:r}=de();try{let o=await t(`${r}/sessions`,{headers:{authorization:`Bearer ${e}`},signal:AbortSignal.timeout(15e3)});return o.ok?(await o.text()).trim()||"(none)":null}catch{return null}}async function Ry(e){let{relayUrl:t}=de();try{let r=await fetch(`${t}/devices`,{headers:{authorization:`Bearer ${e}`},signal:AbortSignal.timeout(1e4)});return r.ok?await r.json():null}catch{return null}}async function Oy(e,t){try{let r=await Py("/device/command",t,e),o=await r.json().catch(()=>({})),n=typeof o.error=="string"?o.error:void 0,i=Su(n)??n;return{ok:r.ok&&o.ok===!0,status:r.status,...i?{error:i}:{},...typeof o.verified=="boolean"?{verified:o.verified}:{},...typeof o.note=="string"?{note:o.note}:{}}}catch(r){return{ok:!1,status:0,error:r instanceof Error?r.message:"command failed"}}}async function io(e){let t=await ba(e);return t?t.config:null}async function ba(e,t=fetch){let{relayUrl:r}=de();try{let o=await t(`${r}/device-config`,{headers:{authorization:`Bearer ${e}`},signal:AbortSignal.timeout(1e4)});if(!o.ok)return null;let n=await o.json();return{version:typeof n.version=="number"?n.version:0,config:n.config&&typeof n.config=="object"?n.config:{}}}catch{return null}}var IP=256*1024;async function Dy(e,t,r,o=fetch){let{relayUrl:n}=de(),i=JSON.stringify({version:t,config:r});if(Buffer.byteLength(i)>IP)return{ok:!1,version:t,config:r,error:"This profile set is too large to sync (over 256 KB). Remove a profile or some device actions."};try{let s=await o(`${n}/device-config`,{method:"PUT",headers:{"content-type":"application/json",authorization:`Bearer ${e}`},body:i,signal:AbortSignal.timeout(1e4)}),a=await s.json().catch(()=>({}));if(s.ok&&a.error===void 0&&typeof a.version=="number")return{ok:!0,version:a.version,config:r};if(a.error==="version_conflict"){let l=await ba(e,o);return l?{ok:!1,version:l.version,config:l.config,error:"version_conflict"}:{ok:!1,version:t,config:r,error:"version_conflict, and the latest document could not be re-read"}}return{ok:!1,version:t,config:r,error:typeof a.error=="string"?a.error:`device-config update failed (${s.status})`}}catch(s){return{ok:!1,version:t,config:r,error:s instanceof Error?s.message:"device-config update failed"}}}async function Ny(e,t,r=fetch){let{relayUrl:o}=de();try{let n=await r(`${o}/connected-accounts/${encodeURIComponent(t)}/revoke`,{method:"POST",headers:{authorization:`Bearer ${e}`},signal:AbortSignal.timeout(1e4)});if(n.ok)return{ok:!0,status:n.status};let i=await n.json().catch(()=>({}));return{ok:!1,status:n.status,error:typeof i.error=="string"?i.error:`revoke failed (${n.status})`}}catch(n){return{ok:!1,status:0,error:n instanceof Error?n.message:"revoke failed"}}}async function so(e){let{relayUrl:t}=de();try{let r=await fetch(`${t}/connected-accounts`,{headers:{authorization:`Bearer ${e}`},signal:AbortSignal.timeout(1e4)});if(!r.ok)return null;let o=await r.json();return Array.isArray(o.accounts)?o.accounts:[]}catch{return null}}async function Ly(e,t,r){let{relayUrl:o}=de();try{let n=await fetch(`${o}/node/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"content-type":"application/json",authorization:`Bearer ${e}`},body:JSON.stringify(r)});if(n.ok)return{ok:!0,status:n.status};let i=await n.json().catch(()=>({})),s=typeof i.error=="string"?i.error:void 0;return{ok:!1,status:n.status,error:Su(s)??s??`patch failed (${n.status})`}}catch(n){return{ok:!1,status:0,error:n instanceof Error?n.message:"patch failed"}}}async function Uy(e){let t=N(Se().accessFile)?.trim();if(!t)return{ok:!1,error:"Not signed in. Run `acbridge login` first."};try{let r=await Py(`/link/${encodeURIComponent(e)}/start`,{},t),o=await r.json().catch(()=>({}));return r.ok&&typeof o.authorize_url=="string"?{ok:!0,authorizeUrl:o.authorize_url}:{ok:!1,error:typeof o.error=="string"?o.error:`link start failed (${r.status})`}}catch(r){return{ok:!1,error:r instanceof Error?r.message:"link start failed"}}}var EP=!!process.stdout.isTTY&&!process.env.NO_COLOR,ya=e=>t=>EP?`\x1B[${e}m${t}\x1B[0m`:t,AP=ya("32"),CP=ya("33"),PP=ya("31"),me=ya("2"),Xu=!1,ye=(e=!0)=>{Xu=e};var xa=e=>{Xu?console.error(e):console.log(e)},q=e=>console.log(JSON.stringify(e)),$=e=>xa(`${AP("\u2714")} ${e}`),j=e=>xa(`${CP("\u26A0")} ${e}`),x=e=>console.error(`${PP("\u2717")} ${e}`),b=e=>xa(e),se=e=>xa(me(`\u2022 ${e}`)),E=(e,t)=>(x(e),Xu&&q({error:e,exit:t}),t);var ot={logoutFirst:(e="sign in")=>`This machine is already signed in as another account. Run \`acbridge logout\` first, then ${e}.`,pointerMismatch:"This machine's signed-in account doesn't match its stored account pointer \u2014 run `acbridge logout` then `acbridge login` to reset it.",unresolved:"Couldn't resolve this machine's signed-in account \u2014 run `acbridge login` again."};function _t(e,t=j){return e.length<2?!1:(t(`found ${e.length} relay credentials on this machine (${e.map(r=>r.sub).join(", ")}) \u2014 a crash during an account switch can leave residue; run \`acbridge logout\` to clear it.`),!0)}function ka(e,t=mt){return e.segment===t(e.sub)}function jy(e){let t=e.layout??sn(),r=e.read??N,o=e.paths??Se(),n=r(o.accessFile)?.trim()||"",i=e.resolveScope??(()=>gt());if(t<an)return n?{state:"ok",token:n,scope:i()}:{state:"signed-out"};let s=i();if(s)return n?{state:"ok",token:n,scope:s}:{state:"signed-out"};let a=(e.scan??ft)();return(e.warnAmbiguous??_t)(a),!!(e.readPointer??(()=>Pe()))()||a.length>0?{state:"mismatch",message:ot.pointerMismatch}:{state:"signed-out"}}function $t(e){let t=jy(e);return t.state==="ok"?{ok:!0,token:t.token,scope:t.scope}:t.state==="mismatch"?{ok:!1,message:t.message,exitCode:3}:{ok:!1,message:e.notSignedIn.message,exitCode:e.notSignedIn.exitCode}}function Mt(e={}){return jy(e)}function De(){let e=gt();return e?$i(e):null}function zn(e,t){let r=N(e.providerAccountsFile(t));if(!r)return[];try{let o=JSON.parse(r);return Array.isArray(o)?o.filter(n=>typeof n=="object"&&n!==null):[]}catch{return[]}}function fr(e,t,r){we(e.providerAccountsFile(t),`${JSON.stringify(r,null,2)}
|
|
182
|
+
`,384)}function TP(e){try{let t=JSON.parse(Buffer.from(e.split(".")[1]??"","base64url").toString("utf8"));return typeof t.nid=="string"?t.nid:null}catch{return null}}var RP=()=>$t({notSignedIn:{message:"Not signed in. Run `acbridge login` first.",exitCode:3}});async function zy(e,t={}){let r=e[0];if(r!=="on"&&r!=="off"&&r!=="status")return x("usage: acbridge capture on|off|status"),2;let o=(t.requireToken??RP)();if(!o.ok)return x(o.message),o.exitCode;let n=o.token;if(r==="status"){let u=await(t.fetchEntitlement??Ft)(n);u?(b(`plan: ${u.plan}`),b(`capture.telemetry: ${u.capture.telemetry}`),b(`capture.transcripts: ${u.capture.transcripts}`)):x("couldn't fetch entitlement from the relay (signed out, or the relay is unreachable)");let d=(t.entitlementFileRaw??OP)();if(!d)return b("local entitlement file: absent (capture fail-closed until the hub next syncs)"),0;try{let m=JSON.parse(d),f=(Date.now()-(m.fetchedAt??0))/36e5;b(`local entitlement file: ${f.toFixed(1)}h old (${f<=24?"fresh":"STALE \u2014 capture fail-closed"})`)}catch{b("local entitlement file: unreadable (capture fail-closed)")}return 0}let i=TP(n);if(!i)return x("Couldn't read this machine's node id from its access token \u2014 sign in again with `acbridge login`."),1;let a=await(t.patchNode??Ly)(n,i,{captureEnabled:r==="on"});return a.ok?(b(`Capture ${r==="on"?"enabled":"disabled"} for this machine.`),r==="on"&&b("Note: capture is on by default for every account \u2014 this only re-enables it for THIS machine (still subject to the global capture switch)."),0):(x(`capture ${r} failed${a.status?` (${a.status})`:""}: ${a.error??"unknown"}`),1)}function OP(){let e=De();return e?N(e.entitlementFile):null}import{readFileSync as cD}from"node:fs";import{createInterface as lD}from"node:readline";var c={};rn(c,{$brand:()=>Qu,$input:()=>xm,$output:()=>ym,NEVER:()=>Yu,TimePrecision:()=>_m,ZodAny:()=>fg,ZodArray:()=>bg,ZodBase64:()=>Jc,ZodBase64URL:()=>qc,ZodBigInt:()=>jo,ZodBigIntFormat:()=>Yc,ZodBoolean:()=>Uo,ZodCIDRv4:()=>Wc,ZodCIDRv6:()=>Vc,ZodCUID:()=>zc,ZodCUID2:()=>Fc,ZodCatch:()=>Fg,ZodCodec:()=>is,ZodCustom:()=>ss,ZodCustomStringFormat:()=>No,ZodDate:()=>es,ZodDefault:()=>Dg,ZodDiscriminatedUnion:()=>xg,ZodE164:()=>Kc,ZodEmail:()=>Lc,ZodEmoji:()=>Uc,ZodEnum:()=>Oo,ZodError:()=>u1,ZodExactOptional:()=>Tg,ZodFile:()=>Cg,ZodFirstPartyTypeKind:()=>Qg,ZodFunction:()=>Kg,ZodGUID:()=>qi,ZodIPv4:()=>Zc,ZodIPv6:()=>Gc,ZodISODate:()=>Pc,ZodISODateTime:()=>Cc,ZodISODuration:()=>Rc,ZodISOTime:()=>Tc,ZodIntersection:()=>kg,ZodIssueCode:()=>p1,ZodJWT:()=>Xc,ZodKSUID:()=>Hc,ZodLazy:()=>Vg,ZodLiteral:()=>Ag,ZodMAC:()=>ag,ZodMap:()=>Ig,ZodNaN:()=>Bg,ZodNanoID:()=>jc,ZodNever:()=>hg,ZodNonOptional:()=>ol,ZodNull:()=>pg,ZodNullable:()=>Og,ZodNumber:()=>Lo,ZodNumberFormat:()=>Sr,ZodObject:()=>ns,ZodOptional:()=>rl,ZodPipe:()=>os,ZodPrefault:()=>Lg,ZodPreprocess:()=>Hg,ZodPromise:()=>qg,ZodReadonly:()=>Zg,ZodRealError:()=>nt,ZodRecord:()=>Ro,ZodSet:()=>Eg,ZodString:()=>Do,ZodStringFormat:()=>ge,ZodSuccess:()=>zg,ZodSymbol:()=>ug,ZodTemplateLiteral:()=>Wg,ZodTransform:()=>Pg,ZodTuple:()=>Sg,ZodType:()=>Q,ZodULID:()=>Mc,ZodURL:()=>Qi,ZodUUID:()=>Gt,ZodUndefined:()=>dg,ZodUnion:()=>rs,ZodUnknown:()=>gg,ZodVoid:()=>vg,ZodXID:()=>Bc,ZodXor:()=>yg,_ZodString:()=>Nc,_default:()=>Ng,_function:()=>Ew,any:()=>ow,array:()=>ts,base64:()=>Mk,base64url:()=>Bk,bigint:()=>Qk,boolean:()=>lg,catch:()=>Mg,check:()=>Aw,cidrv4:()=>zk,cidrv6:()=>Fk,clone:()=>Ze,codec:()=>Sw,coerce:()=>eh,config:()=>Ie,core:()=>mn,cuid:()=>Tk,cuid2:()=>Rk,custom:()=>Cw,date:()=>sw,decode:()=>eg,decodeAsync:()=>ng,describe:()=>Pw,discriminatedUnion:()=>pw,e164:()=>Hk,email:()=>kk,emoji:()=>Ck,encode:()=>Qf,encodeAsync:()=>tg,endsWith:()=>wo,enum:()=>tl,exactOptional:()=>Rg,file:()=>yw,flattenError:()=>Ni,float32:()=>qk,float64:()=>Kk,formatError:()=>Li,fromJSONSchema:()=>Uw,function:()=>Ew,getErrorMap:()=>f1,globalRegistry:()=>Ne,gt:()=>Ht,gte:()=>We,guid:()=>wk,hash:()=>Jk,hex:()=>Vk,hostname:()=>Wk,httpUrl:()=>Ak,includes:()=>xo,instanceof:()=>Rw,int:()=>Oc,int32:()=>Xk,int64:()=>ew,intersection:()=>wg,invertCodec:()=>_w,ipv4:()=>Lk,ipv6:()=>jk,iso:()=>To,json:()=>Dw,jwt:()=>Zk,keyof:()=>aw,ksuid:()=>Nk,lazy:()=>Jg,length:()=>kr,literal:()=>bw,locales:()=>Zi,looseObject:()=>uw,looseRecord:()=>fw,lowercase:()=>bo,lt:()=>Bt,lte:()=>st,mac:()=>Uk,map:()=>gw,maxLength:()=>xr,maxSize:()=>Wn,meta:()=>Tw,mime:()=>So,minLength:()=>pn,minSize:()=>Zt,multipleOf:()=>Gn,nan:()=>ww,nanoid:()=>Pk,nativeEnum:()=>vw,negative:()=>yc,never:()=>Qc,nonnegative:()=>kc,nonoptional:()=>jg,nonpositive:()=>xc,normalize:()=>_o,null:()=>mg,nullable:()=>Xi,nullish:()=>xw,number:()=>cg,object:()=>cw,optional:()=>Ki,overwrite:()=>Et,parse:()=>qf,parseAsync:()=>Kf,partialRecord:()=>mw,pipe:()=>Dc,positive:()=>bc,prefault:()=>Ug,preprocess:()=>Nw,prettifyError:()=>pd,promise:()=>Iw,property:()=>wc,readonly:()=>Gg,record:()=>$g,refine:()=>Xg,regex:()=>vo,regexes:()=>it,registry:()=>Xa,safeDecode:()=>og,safeDecodeAsync:()=>sg,safeEncode:()=>rg,safeEncodeAsync:()=>ig,safeParse:()=>Xf,safeParseAsync:()=>Yf,set:()=>hw,setErrorMap:()=>m1,size:()=>yr,slugify:()=>Ao,startsWith:()=>ko,strictObject:()=>lw,string:()=>Ji,stringFormat:()=>Gk,stringbool:()=>Ow,success:()=>kw,superRefine:()=>Yg,symbol:()=>nw,templateLiteral:()=>$w,toJSONSchema:()=>Ic,toLowerCase:()=>Io,toUpperCase:()=>Eo,transform:()=>nl,treeifyError:()=>dd,trim:()=>$o,tuple:()=>_g,uint32:()=>Yk,uint64:()=>tw,ulid:()=>Ok,undefined:()=>rw,union:()=>el,unknown:()=>wr,uppercase:()=>yo,url:()=>Ek,util:()=>T,uuid:()=>Sk,uuidv4:()=>_k,uuidv6:()=>$k,uuidv7:()=>Ik,void:()=>iw,xid:()=>Dk,xor:()=>dw});var mn={};rn(mn,{$ZodAny:()=>Mp,$ZodArray:()=>Wp,$ZodAsyncError:()=>It,$ZodBase64:()=>Tp,$ZodBase64URL:()=>Rp,$ZodBigInt:()=>Ha,$ZodBigIntFormat:()=>Up,$ZodBoolean:()=>Fi,$ZodCIDRv4:()=>Ap,$ZodCIDRv6:()=>Cp,$ZodCUID:()=>hp,$ZodCUID2:()=>vp,$ZodCatch:()=>um,$ZodCheck:()=>be,$ZodCheckBigIntFormat:()=>Wd,$ZodCheckEndsWith:()=>op,$ZodCheckGreaterThan:()=>Ua,$ZodCheckIncludes:()=>np,$ZodCheckLengthEquals:()=>Yd,$ZodCheckLessThan:()=>La,$ZodCheckLowerCase:()=>ep,$ZodCheckMaxLength:()=>Kd,$ZodCheckMaxSize:()=>Vd,$ZodCheckMimeType:()=>sp,$ZodCheckMinLength:()=>Xd,$ZodCheckMinSize:()=>Jd,$ZodCheckMultipleOf:()=>Zd,$ZodCheckNumberFormat:()=>Gd,$ZodCheckOverwrite:()=>ap,$ZodCheckProperty:()=>ip,$ZodCheckRegex:()=>Qd,$ZodCheckSizeEquals:()=>qd,$ZodCheckStartsWith:()=>rp,$ZodCheckStringFormat:()=>go,$ZodCheckUpperCase:()=>tp,$ZodCodec:()=>Bi,$ZodCustom:()=>bm,$ZodCustomStringFormat:()=>Np,$ZodDate:()=>Gp,$ZodDefault:()=>sm,$ZodDiscriminatedUnion:()=>qp,$ZodE164:()=>Op,$ZodEmail:()=>pp,$ZodEmoji:()=>fp,$ZodEncodeError:()=>Fn,$ZodEnum:()=>em,$ZodError:()=>Di,$ZodExactOptional:()=>om,$ZodFile:()=>nm,$ZodFunction:()=>gm,$ZodGUID:()=>up,$ZodIPv4:()=>$p,$ZodIPv6:()=>Ip,$ZodISODate:()=>wp,$ZodISODateTime:()=>kp,$ZodISODuration:()=>_p,$ZodISOTime:()=>Sp,$ZodIntersection:()=>Kp,$ZodJWT:()=>Dp,$ZodKSUID:()=>xp,$ZodLazy:()=>vm,$ZodLiteral:()=>tm,$ZodMAC:()=>Ep,$ZodMap:()=>Yp,$ZodNaN:()=>dm,$ZodNanoID:()=>gp,$ZodNever:()=>Hp,$ZodNonOptional:()=>cm,$ZodNull:()=>Fp,$ZodNullable:()=>im,$ZodNumber:()=>Ba,$ZodNumberFormat:()=>Lp,$ZodObject:()=>hx,$ZodObjectJIT:()=>Vp,$ZodOptional:()=>Ga,$ZodPipe:()=>Wa,$ZodPrefault:()=>am,$ZodPreprocess:()=>pm,$ZodPromise:()=>hm,$ZodReadonly:()=>mm,$ZodRealError:()=>tt,$ZodRecord:()=>Xp,$ZodRegistry:()=>Ka,$ZodSet:()=>Qp,$ZodString:()=>br,$ZodStringFormat:()=>fe,$ZodSuccess:()=>lm,$ZodSymbol:()=>jp,$ZodTemplateLiteral:()=>fm,$ZodTransform:()=>rm,$ZodTuple:()=>Za,$ZodType:()=>J,$ZodULID:()=>bp,$ZodURL:()=>mp,$ZodUUID:()=>dp,$ZodUndefined:()=>zp,$ZodUnion:()=>Mi,$ZodUnknown:()=>Bp,$ZodVoid:()=>Zp,$ZodXID:()=>yp,$ZodXor:()=>Jp,$brand:()=>Qu,$constructor:()=>y,$input:()=>xm,$output:()=>ym,Doc:()=>zi,JSONSchema:()=>bk,JSONSchemaGenerator:()=>Ec,NEVER:()=>Yu,TimePrecision:()=>_m,_any:()=>Gm,_array:()=>Ym,_base64:()=>fc,_base64url:()=>gc,_bigint:()=>jm,_boolean:()=>Lm,_catch:()=>n1,_check:()=>vk,_cidrv4:()=>pc,_cidrv6:()=>mc,_coercedBigint:()=>zm,_coercedBoolean:()=>Um,_coercedDate:()=>Km,_coercedNumber:()=>Pm,_coercedString:()=>wm,_cuid:()=>ic,_cuid2:()=>sc,_custom:()=>ef,_date:()=>qm,_decode:()=>Ea,_decodeAsync:()=>Ca,_default:()=>QR,_discriminatedUnion:()=>MR,_e164:()=>hc,_email:()=>Ya,_emoji:()=>rc,_encode:()=>Ia,_encodeAsync:()=>Aa,_endsWith:()=>wo,_enum:()=>VR,_file:()=>Qm,_float32:()=>Rm,_float64:()=>Om,_gt:()=>Ht,_gte:()=>We,_guid:()=>Gi,_includes:()=>xo,_int:()=>Tm,_int32:()=>Dm,_int64:()=>Fm,_intersection:()=>BR,_ipv4:()=>uc,_ipv6:()=>dc,_isoDate:()=>Im,_isoDateTime:()=>$m,_isoDuration:()=>Am,_isoTime:()=>Em,_jwt:()=>vc,_ksuid:()=>lc,_lazy:()=>s1,_length:()=>kr,_literal:()=>qR,_lowercase:()=>bo,_lt:()=>Bt,_lte:()=>st,_mac:()=>Sm,_map:()=>GR,_max:()=>st,_maxLength:()=>xr,_maxSize:()=>Wn,_mime:()=>So,_min:()=>We,_minLength:()=>pn,_minSize:()=>Zt,_multipleOf:()=>Gn,_nan:()=>Xm,_nanoid:()=>oc,_nativeEnum:()=>JR,_negative:()=>yc,_never:()=>Vm,_nonnegative:()=>kc,_nonoptional:()=>e1,_nonpositive:()=>xc,_normalize:()=>_o,_null:()=>Zm,_nullable:()=>YR,_number:()=>Cm,_optional:()=>XR,_overwrite:()=>Et,_parse:()=>uo,_parseAsync:()=>po,_pipe:()=>r1,_positive:()=>bc,_promise:()=>a1,_property:()=>wc,_readonly:()=>o1,_record:()=>ZR,_refine:()=>tf,_regex:()=>vo,_safeDecode:()=>Ta,_safeDecodeAsync:()=>Oa,_safeEncode:()=>Pa,_safeEncodeAsync:()=>Ra,_safeParse:()=>mo,_safeParseAsync:()=>fo,_set:()=>WR,_size:()=>yr,_slugify:()=>Ao,_startsWith:()=>ko,_string:()=>km,_stringFormat:()=>Co,_stringbool:()=>sf,_success:()=>t1,_superRefine:()=>nf,_symbol:()=>Bm,_templateLiteral:()=>i1,_toLowerCase:()=>Io,_toUpperCase:()=>Eo,_transform:()=>KR,_trim:()=>$o,_tuple:()=>HR,_uint32:()=>Nm,_uint64:()=>Mm,_ulid:()=>ac,_undefined:()=>Hm,_union:()=>zR,_unknown:()=>Wm,_uppercase:()=>yo,_url:()=>Wi,_uuid:()=>Qa,_uuidv4:()=>ec,_uuidv6:()=>tc,_uuidv7:()=>nc,_void:()=>Jm,_xid:()=>cc,_xor:()=>FR,clone:()=>Ze,config:()=>Ie,createStandardJSONSchemaMethod:()=>Po,createToJSONSchemaMethod:()=>af,decode:()=>aT,decodeAsync:()=>lT,describe:()=>rf,encode:()=>sT,encodeAsync:()=>cT,extractDefs:()=>Jn,finalize:()=>qn,flattenError:()=>Ni,formatError:()=>Li,globalConfig:()=>gr,globalRegistry:()=>Ne,initializeContext:()=>Vn,isValidBase64:()=>Pp,isValidBase64URL:()=>px,isValidJWT:()=>mx,locales:()=>Zi,meta:()=>of,parse:()=>_a,parseAsync:()=>$a,prettifyError:()=>pd,process:()=>pe,regexes:()=>it,registry:()=>Xa,safeDecode:()=>dT,safeDecodeAsync:()=>mT,safeEncode:()=>uT,safeEncodeAsync:()=>pT,safeParse:()=>md,safeParseAsync:()=>fd,toDotPath:()=>Gy,toJSONSchema:()=>Ic,treeifyError:()=>dd,util:()=>T,version:()=>cp});var Fy,Yu=Object.freeze({status:"aborted"});function y(e,t,r){function o(a,l){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:l,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,l);let u=s.prototype,p=Object.keys(u);for(let d=0;d<p.length;d++){let m=p[d];m in a||(a[m]=u[m].bind(a))}}let n=r?.Parent??Object;class i extends n{}Object.defineProperty(i,"name",{value:e});function s(a){var l;let u=r?.Parent?new i:this;o(u,a),(l=u._zod).deferred??(l.deferred=[]);for(let p of u._zod.deferred)p();return u}return Object.defineProperty(s,"init",{value:o}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}var Qu=Symbol("zod_brand"),It=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Fn=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(Fy=globalThis).__zod_globalConfig??(Fy.__zod_globalConfig={});var gr=globalThis.__zod_globalConfig;function Ie(e){return e&&Object.assign(gr,e),gr}var T={};rn(T,{BIGINT_FORMAT_RANGES:()=>ld,Class:()=>td,NUMBER_FORMAT_RANGES:()=>cd,aborted:()=>Zn,allowsEval:()=>od,assert:()=>jP,assertEqual:()=>DP,assertIs:()=>LP,assertNever:()=>UP,assertNotEqual:()=>NP,assignProp:()=>Bn,base64ToUint8Array:()=>By,base64urlToUint8Array:()=>tT,cached:()=>co,captureStackTrace:()=>Sa,cleanEnum:()=>eT,cleanRegex:()=>Pi,clone:()=>Ze,cloneDef:()=>FP,createTransparentProxy:()=>WP,defineLazy:()=>te,esc:()=>wa,escapeRegex:()=>ht,explicitlyAborted:()=>ud,extend:()=>qP,finalizeIssue:()=>Ge,floatSafeRemainder:()=>nd,getElementAtPath:()=>MP,getEnumValues:()=>Ci,getLengthableOrigin:()=>Oi,getParsedType:()=>GP,getSizableOrigin:()=>Ri,hexToUint8Array:()=>rT,isObject:()=>hr,isPlainObject:()=>Hn,issue:()=>lo,joinValues:()=>w,jsonStringifyReplacer:()=>ao,merge:()=>XP,mergeDefs:()=>dn,normalizeParams:()=>R,nullish:()=>Mn,numKeys:()=>ZP,objectClone:()=>zP,omit:()=>JP,optionalKeys:()=>ad,parsedType:()=>P,partial:()=>YP,pick:()=>VP,prefixIssues:()=>et,primitiveTypes:()=>sd,promiseAllObject:()=>BP,propertyKeyTypes:()=>Ti,randomString:()=>HP,required:()=>QP,safeExtend:()=>KP,shallowClone:()=>id,slugify:()=>rd,stringifyPrimitive:()=>A,uint8ArrayToBase64:()=>Hy,uint8ArrayToBase64url:()=>nT,uint8ArrayToHex:()=>oT,unwrapMessage:()=>Ai});function DP(e){return e}function NP(e){return e}function LP(e){}function UP(e){throw new Error("Unexpected value in exhaustive check")}function jP(e){}function Ci(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function w(e,t="|"){return e.map(r=>A(r)).join(t)}function ao(e,t){return typeof t=="bigint"?t.toString():t}function co(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function Mn(e){return e==null}function Pi(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function nd(e,t){let r=e/t,o=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-o)<n?0:r-o}var My=Symbol("evaluating");function te(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==My)return o===void 0&&(o=My,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function zP(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Bn(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function dn(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function FP(e){return dn(e._zod.def)}function MP(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function BP(e){let t=Object.keys(e),r=t.map(o=>e[o]);return Promise.all(r).then(o=>{let n={};for(let i=0;i<t.length;i++)n[t[i]]=o[i];return n})}function HP(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function wa(e){return JSON.stringify(e)}function rd(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Sa="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function hr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var od=co(()=>{if(gr.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Hn(e){if(hr(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(hr(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function id(e){return Hn(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function ZP(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var GP=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Ti=new Set(["string","number","symbol"]),sd=new Set(["string","number","bigint","boolean","symbol","undefined"]);function ht(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ze(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function R(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function WP(e){let t;return new Proxy({},{get(r,o,n){return t??(t=e()),Reflect.get(t,o,n)},set(r,o,n,i){return t??(t=e()),Reflect.set(t,o,n,i)},has(r,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(r,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(r,o,n){return t??(t=e()),Reflect.defineProperty(t,o,n)}})}function A(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function ad(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var cd={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},ld={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function VP(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i=dn(e._zod.def,{get shape(){let s={};for(let a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(s[a]=r.shape[a])}return Bn(this,"shape",s),s},checks:[]});return Ze(e,i)}function JP(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=dn(e._zod.def,{get shape(){let s={...e._zod.def.shape};for(let a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete s[a]}return Bn(this,"shape",s),s},checks:[]});return Ze(e,i)}function qP(e,t){if(!Hn(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let i=e._zod.def.shape;for(let s in t)if(Object.getOwnPropertyDescriptor(i,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=dn(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return Bn(this,"shape",i),i}});return Ze(e,n)}function KP(e,t){if(!Hn(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=dn(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return Bn(this,"shape",o),o}});return Ze(e,r)}function XP(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=dn(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return Bn(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Ze(e,r)}function YP(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let s=dn(t._zod.def,{get shape(){let a=t._zod.def.shape,l={...a};if(r)for(let u in r){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(l[u]=e?new e({type:"optional",innerType:a[u]}):a[u])}else for(let u in a)l[u]=e?new e({type:"optional",innerType:a[u]}):a[u];return Bn(this,"shape",l),l},checks:[]});return Ze(t,s)}function QP(e,t,r){let o=dn(t._zod.def,{get shape(){let n=t._zod.def.shape,i={...n};if(r)for(let s in r){if(!(s in i))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(i[s]=new e({type:"nonoptional",innerType:n[s]}))}else for(let s in n)i[s]=new e({type:"nonoptional",innerType:n[s]});return Bn(this,"shape",i),i}});return Ze(t,o)}function Zn(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function ud(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function et(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function Ai(e){return typeof e=="string"?e:e?.message}function Ge(e,t,r){let o=e.message?e.message:Ai(e.inst?._zod.def?.error?.(e))??Ai(t?.error?.(e))??Ai(r.customError?.(e))??Ai(r.localeError?.(e))??"Invalid input",{inst:n,continue:i,input:s,...a}=e;return a.path??(a.path=[]),a.message=o,t?.reportInput&&(a.input=s),a}function Ri(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Oi(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function P(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function lo(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function eT(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function By(e){let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}function Hy(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function tT(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return By(t+r)}function nT(e){return Hy(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function rT(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)r[o/2]=Number.parseInt(t.slice(o,o+2),16);return r}function oT(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var td=class{constructor(...t){}};var Zy=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,ao,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Di=y("$ZodError",Zy),tt=y("$ZodError",Zy,{Parent:Error});function Ni(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):o.push(t(n));return{formErrors:o,fieldErrors:r}}function Li(e,t=r=>r.message){let r={_errors:[]},o=(n,i=[])=>{for(let s of n.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>o({issues:a},[...i,...s.path]));else if(s.code==="invalid_key")o({issues:s.issues},[...i,...s.path]);else if(s.code==="invalid_element")o({issues:s.issues},[...i,...s.path]);else{let a=[...i,...s.path];if(a.length===0)r._errors.push(t(s));else{let l=r,u=0;for(;u<a.length;){let p=a[u];u===a.length-1?(l[p]=l[p]||{_errors:[]},l[p]._errors.push(t(s))):l[p]=l[p]||{_errors:[]},l=l[p],u++}}}};return o(e),r}function dd(e,t=r=>r.message){let r={errors:[]},o=(n,i=[])=>{var s,a;for(let l of n.issues)if(l.code==="invalid_union"&&l.errors.length)l.errors.map(u=>o({issues:u},[...i,...l.path]));else if(l.code==="invalid_key")o({issues:l.issues},[...i,...l.path]);else if(l.code==="invalid_element")o({issues:l.issues},[...i,...l.path]);else{let u=[...i,...l.path];if(u.length===0){r.errors.push(t(l));continue}let p=r,d=0;for(;d<u.length;){let m=u[d],f=d===u.length-1;typeof m=="string"?(p.properties??(p.properties={}),(s=p.properties)[m]??(s[m]={errors:[]}),p=p.properties[m]):(p.items??(p.items=[]),(a=p.items)[m]??(a[m]={errors:[]}),p=p.items[m]),f&&p.errors.push(t(l)),d++}}};return o(e),r}function Gy(e){let t=[],r=e.map(o=>typeof o=="object"?o.key:o);for(let o of r)typeof o=="number"?t.push(`[${o}]`):typeof o=="symbol"?t.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?t.push(`[${JSON.stringify(o)}]`):(t.length&&t.push("."),t.push(o));return t.join("")}function pd(e){let t=[],r=[...e.issues].sort((o,n)=>(o.path??[]).length-(n.path??[]).length);for(let o of r)t.push(`\u2716 ${o.message}`),o.path?.length&&t.push(` \u2192 at ${Gy(o.path)}`);return t.join(`
|
|
183
|
+
`)}var uo=e=>(t,r,o,n)=>{let i=o?{...o,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new It;if(s.issues.length){let a=new(n?.Err??e)(s.issues.map(l=>Ge(l,i,Ie())));throw Sa(a,n?.callee),a}return s.value},_a=uo(tt),po=e=>async(t,r,o,n)=>{let i=o?{...o,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){let a=new(n?.Err??e)(s.issues.map(l=>Ge(l,i,Ie())));throw Sa(a,n?.callee),a}return s.value},$a=po(tt),mo=e=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},n);if(i instanceof Promise)throw new It;return i.issues.length?{success:!1,error:new(e??Di)(i.issues.map(s=>Ge(s,n,Ie())))}:{success:!0,data:i.value}},md=mo(tt),fo=e=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},n);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(s=>Ge(s,n,Ie())))}:{success:!0,data:i.value}},fd=fo(tt),Ia=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return uo(e)(t,r,n)},sT=Ia(tt),Ea=e=>(t,r,o)=>uo(e)(t,r,o),aT=Ea(tt),Aa=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return po(e)(t,r,n)},cT=Aa(tt),Ca=e=>async(t,r,o)=>po(e)(t,r,o),lT=Ca(tt),Pa=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return mo(e)(t,r,n)},uT=Pa(tt),Ta=e=>(t,r,o)=>mo(e)(t,r,o),dT=Ta(tt),Ra=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return fo(e)(t,r,n)},pT=Ra(tt),Oa=e=>async(t,r,o)=>fo(e)(t,r,o),mT=Oa(tt);var it={};rn(it,{base64:()=>Pd,base64url:()=>Da,bigint:()=>Ud,boolean:()=>zd,browserEmail:()=>kT,cidrv4:()=>Ad,cidrv6:()=>Cd,cuid:()=>gd,cuid2:()=>hd,date:()=>Od,datetime:()=>Nd,domain:()=>_T,duration:()=>kd,e164:()=>Rd,email:()=>Sd,emoji:()=>_d,extendedDuration:()=>fT,guid:()=>wd,hex:()=>$T,hostname:()=>ST,html5Email:()=>bT,httpProtocol:()=>Td,idnEmail:()=>xT,integer:()=>jd,ipv4:()=>$d,ipv6:()=>Id,ksuid:()=>yd,lowercase:()=>Bd,mac:()=>Ed,md5_base64:()=>ET,md5_base64url:()=>AT,md5_hex:()=>IT,nanoid:()=>xd,null:()=>Fd,number:()=>Na,rfc5322Email:()=>yT,sha1_base64:()=>PT,sha1_base64url:()=>TT,sha1_hex:()=>CT,sha256_base64:()=>OT,sha256_base64url:()=>DT,sha256_hex:()=>RT,sha384_base64:()=>LT,sha384_base64url:()=>UT,sha384_hex:()=>NT,sha512_base64:()=>zT,sha512_base64url:()=>FT,sha512_hex:()=>jT,string:()=>Ld,time:()=>Dd,ulid:()=>vd,undefined:()=>Md,unicodeEmail:()=>Wy,uppercase:()=>Hd,uuid:()=>vr,uuid4:()=>gT,uuid6:()=>hT,uuid7:()=>vT,xid:()=>bd});var gd=/^[cC][0-9a-z]{6,}$/,hd=/^[0-9a-z]+$/,vd=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,bd=/^[0-9a-vA-V]{20}$/,yd=/^[A-Za-z0-9]{27}$/,xd=/^[a-zA-Z0-9_-]{21}$/,kd=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,fT=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,wd=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,vr=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,gT=vr(4),hT=vr(6),vT=vr(7),Sd=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,bT=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,yT=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Wy=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,xT=Wy,kT=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,wT="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function _d(){return new RegExp(wT,"u")}var $d=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Id=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Ed=e=>{let t=ht(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Ad=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Cd=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Pd=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Da=/^[A-Za-z0-9_-]*$/,ST=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,_T=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Td=/^https?$/,Rd=/^\+[1-9]\d{6,14}$/,Vy="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Od=new RegExp(`^${Vy}$`);function Jy(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Dd(e){return new RegExp(`^${Jy(e)}$`)}function Nd(e){let t=Jy({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${t}(?:${r.join("|")})`;return new RegExp(`^${Vy}T(?:${o})$`)}var Ld=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Ud=/^-?\d+n?$/,jd=/^-?\d+$/,Na=/^-?\d+(?:\.\d+)?$/,zd=/^(?:true|false)$/i,Fd=/^null$/i;var Md=/^undefined$/i;var Bd=/^[^A-Z]*$/,Hd=/^[^a-z]*$/,$T=/^[0-9a-fA-F]*$/;function Ui(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function ji(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var IT=/^[0-9a-fA-F]{32}$/,ET=Ui(22,"=="),AT=ji(22),CT=/^[0-9a-fA-F]{40}$/,PT=Ui(27,"="),TT=ji(27),RT=/^[0-9a-fA-F]{64}$/,OT=Ui(43,"="),DT=ji(43),NT=/^[0-9a-fA-F]{96}$/,LT=Ui(64,""),UT=ji(64),jT=/^[0-9a-fA-F]{128}$/,zT=Ui(86,"=="),FT=ji(86);var be=y("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Ky={number:"number",bigint:"bigint",object:"date"},La=y("$ZodCheckLessThan",(e,t)=>{be.init(e,t);let r=Ky[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,i=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ua=y("$ZodCheckGreaterThan",(e,t)=>{be.init(e,t);let r=Ky[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,i=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Zd=y("$ZodCheckMultipleOf",(e,t)=>{be.init(e,t),e._zod.onattach.push(r=>{var o;(o=r._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):nd(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Gd=y("$ZodCheckNumberFormat",(e,t)=>{be.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,i]=cd[t.format];e._zod.onattach.push(s=>{let a=s._zod.bag;a.format=t.format,a.minimum=n,a.maximum=i,r&&(a.pattern=jd)}),e._zod.check=s=>{let a=s.value;if(r){if(!Number.isInteger(a)){s.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}a<n&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),a>i&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),Wd=y("$ZodCheckBigIntFormat",(e,t)=>{be.init(e,t);let[r,o]=ld[t.format];e._zod.onattach.push(n=>{let i=n._zod.bag;i.format=t.format,i.minimum=r,i.maximum=o}),e._zod.check=n=>{let i=n.value;i<r&&n.issues.push({origin:"bigint",input:i,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),i>o&&n.issues.push({origin:"bigint",input:i,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),Vd=y("$ZodCheckMaxSize",(e,t)=>{var r;be.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Mn(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;n.size<=t.maximum||o.issues.push({origin:Ri(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Jd=y("$ZodCheckMinSize",(e,t)=>{var r;be.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Mn(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;n.size>=t.minimum||o.issues.push({origin:Ri(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),qd=y("$ZodCheckSizeEquals",(e,t)=>{var r;be.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Mn(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=o=>{let n=o.value,i=n.size;if(i===t.size)return;let s=i>t.size;o.issues.push({origin:Ri(n),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Kd=y("$ZodCheckMaxLength",(e,t)=>{var r;be.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Mn(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;if(n.length<=t.maximum)return;let s=Oi(n);o.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Xd=y("$ZodCheckMinLength",(e,t)=>{var r;be.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Mn(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;if(n.length>=t.minimum)return;let s=Oi(n);o.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Yd=y("$ZodCheckLengthEquals",(e,t)=>{var r;be.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Mn(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=o=>{let n=o.value,i=n.length;if(i===t.length)return;let s=Oi(n),a=i>t.length;o.issues.push({origin:s,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),go=y("$ZodCheckStringFormat",(e,t)=>{var r,o;be.init(e,t),e._zod.onattach.push(n=>{let i=n._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),Qd=y("$ZodCheckRegex",(e,t)=>{go.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),ep=y("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Bd),go.init(e,t)}),tp=y("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Hd),go.init(e,t)}),np=y("$ZodCheckIncludes",(e,t)=>{be.init(e,t);let r=ht(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=o,e._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),rp=y("$ZodCheckStartsWith",(e,t)=>{be.init(e,t);let r=new RegExp(`^${ht(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),op=y("$ZodCheckEndsWith",(e,t)=>{be.init(e,t);let r=new RegExp(`.*${ht(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});function qy(e,t,r){e.issues.length&&t.issues.push(...et(r,e.issues))}var ip=y("$ZodCheckProperty",(e,t)=>{be.init(e,t),e._zod.check=r=>{let o=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(o instanceof Promise)return o.then(n=>qy(n,r,t.property));qy(o,r,t.property)}}),sp=y("$ZodCheckMimeType",(e,t)=>{be.init(e,t);let r=new Set(t.mime);e._zod.onattach.push(o=>{o._zod.bag.mime=t.mime}),e._zod.check=o=>{r.has(o.value.type)||o.issues.push({code:"invalid_value",values:t.mime,input:o.value.type,inst:e,continue:!t.abort})}}),ap=y("$ZodCheckOverwrite",(e,t)=>{be.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var zi=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(`
|
|
175
184
|
`).filter(s=>s),n=Math.min(...o.map(s=>s.length-s.trimStart().length)),i=o.map(s=>s.slice(n)).map(s=>" ".repeat(this.indent*2)+s);for(let s of i)this.content.push(s)}compile(){let t=Function,r=this?.args,n=[...(this?.content??[""]).map(i=>` ${i}`)];return new t(...r,n.join(`
|
|
176
|
-
`))}};var qd={major:4,minor:4,patch:3};var V=b("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=qd;let o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(let n of o)for(let i of n._zod.onattach)i(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let n=(s,a,l)=>{let u=Bn(s),d;for(let p of a){if(p._zod.def.when){if(Ku(s)||!p._zod.def.when(s))continue}else if(u)continue;let m=s.issues.length,f=p._zod.check(s);if(f instanceof Promise&&l?.async===!1)throw new $t;if(d||f instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await f,s.issues.length!==m&&(u||(u=Bn(s,m)))});else{if(s.issues.length===m)continue;u||(u=Bn(s,m))}}return d?d.then(()=>s):s},i=(s,a,l)=>{if(Bn(s))return s.aborted=!0,s;let u=n(a,o,l);if(u instanceof Promise){if(l.async===!1)throw new $t;return u.then(d=>e._zod.parse(d,l))}return e._zod.parse(u,l)};e._zod.run=(s,a)=>{if(a.skipChecks)return e._zod.parse(s,a);if(a.direction==="backward"){let u=e._zod.parse({value:s.value,issues:[]},{...a,skipChecks:!0});return u instanceof Promise?u.then(d=>i(d,s,a)):i(u,s,a)}let l=e._zod.parse(s,a);if(l instanceof Promise){if(a.async===!1)throw new $t;return l.then(u=>n(u,o,a))}return n(l,o,a)}}ne(e,"~standard",()=>({validate:n=>{try{let i=Qu(e,n);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return ed(e,n).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),hr=b("$ZodString",(e,t)=>{V.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??wd(e._zod.bag),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),ge=b("$ZodStringFormat",(e,t)=>{po.init(e,t),hr.init(e,t)}),Kd=b("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=cd),ge.init(e,t)}),Xd=b("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=gr(o))}else t.pattern??(t.pattern=gr());ge.init(e,t)}),Yd=b("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=ld),ge.init(e,t)}),Qd=b("$ZodURL",(e,t)=>{ge.init(e,t),e._zod.check=r=>{try{let o=r.value.trim();if(!t.normalize&&t.protocol?.source===vd.source&&!/^https?:\/\//i.test(o)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}let n=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=n.href:r.value=o;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),ep=b("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=ud()),ge.init(e,t)}),tp=b("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=sd),ge.init(e,t)}),np=b("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=td),ge.init(e,t)}),rp=b("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=nd),ge.init(e,t)}),op=b("$ZodULID",(e,t)=>{t.pattern??(t.pattern=rd),ge.init(e,t)}),ip=b("$ZodXID",(e,t)=>{t.pattern??(t.pattern=od),ge.init(e,t)}),sp=b("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=id),ge.init(e,t)}),ap=b("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=kd(t)),ge.init(e,t)}),cp=b("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=bd),ge.init(e,t)}),lp=b("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=xd(t)),ge.init(e,t)}),up=b("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=ad),ge.init(e,t)}),dp=b("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=dd),ge.init(e,t),e._zod.bag.format="ipv4"}),pp=b("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=pd),ge.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),mp=b("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=md(t.delimiter)),ge.init(e,t),e._zod.bag.format="mac"}),fp=b("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=fd),ge.init(e,t)}),gp=b("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=gd),ge.init(e,t),e._zod.check=r=>{let o=r.value.split("/");try{if(o.length!==2)throw new Error;let[n,i]=o;if(!i)throw new Error;let s=Number(i);if(`${s}`!==i)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function hp(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var vp=b("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=hd),ge.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{hp(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function Vb(e){if(!Ia.test(e))return!1;let t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return hp(r)}var yp=b("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Ia),ge.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{Vb(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),bp=b("$ZodE164",(e,t)=>{t.pattern??(t.pattern=yd),ge.init(e,t)});function qb(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[o]=r;if(!o)return!1;let n=JSON.parse(atob(o));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}var xp=b("$ZodJWT",(e,t)=>{ge.init(e,t),e._zod.check=r=>{qb(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),kp=b("$ZodCustomStringFormat",(e,t)=>{ge.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),Da=b("$ZodNumber",(e,t)=>{V.init(e,t),e._zod.pattern=e._zod.bag.pattern??Ea,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let i=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...i?{received:i}:{}}),r}}),wp=b("$ZodNumberFormat",(e,t)=>{Td.init(e,t),Da.init(e,t)}),Ui=b("$ZodBoolean",(e,t)=>{V.init(e,t),e._zod.pattern=$d,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=!!r.value}catch{}let n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),Na=b("$ZodBigInt",(e,t)=>{V.init(e,t),e._zod.pattern=Sd,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),Sp=b("$ZodBigIntFormat",(e,t)=>{Rd.init(e,t),Na.init(e,t)}),_p=b("$ZodSymbol",(e,t)=>{V.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return typeof n=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:e}),r}}),$p=b("$ZodUndefined",(e,t)=>{V.init(e,t),e._zod.pattern=Ed,e._zod.values=new Set([void 0]),e._zod.parse=(r,o)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),r}}),Ip=b("$ZodNull",(e,t)=>{V.init(e,t),e._zod.pattern=Id,e._zod.values=new Set([null]),e._zod.parse=(r,o)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),Ep=b("$ZodAny",(e,t)=>{V.init(e,t),e._zod.parse=r=>r}),Ap=b("$ZodUnknown",(e,t)=>{V.init(e,t),e._zod.parse=r=>r}),Pp=b("$ZodNever",(e,t)=>{V.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),Cp=b("$ZodVoid",(e,t)=>{V.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),r}}),Tp=b("$ZodDate",(e,t)=>{V.init(e,t),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let n=r.value,i=n instanceof Date;return i&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...i?{received:"Invalid Date"}:{},inst:e}),r}});function Ob(e,t,r){e.issues.length&&t.issues.push(...et(r,e.issues)),t.value[r]=e.value}var Rp=b("$ZodArray",(e,t)=>{V.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),r;r.value=Array(n.length);let i=[];for(let s=0;s<n.length;s++){let a=n[s],l=t.element._zod.run({value:a,issues:[]},o);l instanceof Promise?i.push(l.then(u=>Ob(u,r,s))):Ob(l,r,s)}return i.length?Promise.all(i).then(()=>r):r}});function Oa(e,t,r,o,n,i){let s=r in o;if(e.issues.length){if(n&&i&&!s)return;t.issues.push(...et(r,e.issues))}if(!s&&!n){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?s&&(t.value[r]=void 0):t.value[r]=e.value}function Jb(e){let t=Object.keys(e.shape);for(let o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);let r=Vu(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function Kb(e,t,r,o,n,i){let s=[],a=n.keySet,l=n.catchall._zod,u=l.def.type,d=l.optin==="optional",p=l.optout==="optional";for(let m in t){if(m==="__proto__"||a.has(m))continue;if(u==="never"){s.push(m);continue}let f=l.run({value:t[m],issues:[]},o);f instanceof Promise?e.push(f.then(g=>Oa(g,r,m,t,d,p))):Oa(f,r,m,t,d,p)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i}),e.length?Promise.all(e).then(()=>r):r}var Xb=b("$ZodObject",(e,t)=>{if(V.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let a=t.shape;Object.defineProperty(t,"shape",{get:()=>{let l={...a};return Object.defineProperty(t,"shape",{value:l}),l}})}let o=io(()=>Jb(t));ne(e._zod,"propValues",()=>{let a=t.shape,l={};for(let u in a){let d=a[u]._zod;if(d.values){l[u]??(l[u]=new Set);for(let p of d.values)l[u].add(p)}}return l});let n=fr,i=t.catchall,s;e._zod.parse=(a,l)=>{s??(s=o.value);let u=a.value;if(!n(u))return a.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),a;a.value={};let d=[],p=s.shape;for(let m of s.keys){let f=p[m],g=f._zod.optin==="optional",h=f._zod.optout==="optional",y=f._zod.run({value:u[m],issues:[]},l);y instanceof Promise?d.push(y.then(k=>Oa(k,a,m,u,g,h))):Oa(y,a,m,u,g,h)}return i?Kb(d,u,a,l,o.value,e):d.length?Promise.all(d).then(()=>a):a}}),Op=b("$ZodObjectJIT",(e,t)=>{Xb.init(e,t);let r=e._zod.parse,o=io(()=>Jb(t)),n=m=>{let f=new Li(["shape","payload","ctx"]),g=o.value,h=I=>{let S=fa(I);return`shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`};f.write("const input = payload.value;");let y=Object.create(null),k=0;for(let I of g.keys)y[I]=`key_${k++}`;f.write("const newResult = {};");for(let I of g.keys){let S=y[I],T=fa(I),j=m[I],F=j?._zod?.optin==="optional",J=j?._zod?.optout==="optional";f.write(`const ${S} = ${h(I)};`),F&&J?f.write(`
|
|
177
|
-
if (${
|
|
178
|
-
if (${
|
|
179
|
-
payload.issues = payload.issues.concat(${
|
|
185
|
+
`))}};var cp={major:4,minor:4,patch:3};var J=y("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=cp;let o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(let n of o)for(let i of n._zod.onattach)i(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let n=(s,a,l)=>{let u=Zn(s),p;for(let d of a){if(d._zod.def.when){if(ud(s)||!d._zod.def.when(s))continue}else if(u)continue;let m=s.issues.length,f=d._zod.check(s);if(f instanceof Promise&&l?.async===!1)throw new It;if(p||f instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await f,s.issues.length!==m&&(u||(u=Zn(s,m)))});else{if(s.issues.length===m)continue;u||(u=Zn(s,m))}}return p?p.then(()=>s):s},i=(s,a,l)=>{if(Zn(s))return s.aborted=!0,s;let u=n(a,o,l);if(u instanceof Promise){if(l.async===!1)throw new It;return u.then(p=>e._zod.parse(p,l))}return e._zod.parse(u,l)};e._zod.run=(s,a)=>{if(a.skipChecks)return e._zod.parse(s,a);if(a.direction==="backward"){let u=e._zod.parse({value:s.value,issues:[]},{...a,skipChecks:!0});return u instanceof Promise?u.then(p=>i(p,s,a)):i(u,s,a)}let l=e._zod.parse(s,a);if(l instanceof Promise){if(a.async===!1)throw new It;return l.then(u=>n(u,o,a))}return n(l,o,a)}}te(e,"~standard",()=>({validate:n=>{try{let i=md(e,n);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return fd(e,n).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),br=y("$ZodString",(e,t)=>{J.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Ld(e._zod.bag),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),fe=y("$ZodStringFormat",(e,t)=>{go.init(e,t),br.init(e,t)}),up=y("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=wd),fe.init(e,t)}),dp=y("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=vr(o))}else t.pattern??(t.pattern=vr());fe.init(e,t)}),pp=y("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Sd),fe.init(e,t)}),mp=y("$ZodURL",(e,t)=>{fe.init(e,t),e._zod.check=r=>{try{let o=r.value.trim();if(!t.normalize&&t.protocol?.source===Td.source&&!/^https?:\/\//i.test(o)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}let n=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=n.href:r.value=o;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),fp=y("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=_d()),fe.init(e,t)}),gp=y("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=xd),fe.init(e,t)}),hp=y("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=gd),fe.init(e,t)}),vp=y("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=hd),fe.init(e,t)}),bp=y("$ZodULID",(e,t)=>{t.pattern??(t.pattern=vd),fe.init(e,t)}),yp=y("$ZodXID",(e,t)=>{t.pattern??(t.pattern=bd),fe.init(e,t)}),xp=y("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=yd),fe.init(e,t)}),kp=y("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Nd(t)),fe.init(e,t)}),wp=y("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Od),fe.init(e,t)}),Sp=y("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Dd(t)),fe.init(e,t)}),_p=y("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=kd),fe.init(e,t)}),$p=y("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=$d),fe.init(e,t),e._zod.bag.format="ipv4"}),Ip=y("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Id),fe.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),Ep=y("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Ed(t.delimiter)),fe.init(e,t),e._zod.bag.format="mac"}),Ap=y("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Ad),fe.init(e,t)}),Cp=y("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Cd),fe.init(e,t),e._zod.check=r=>{let o=r.value.split("/");try{if(o.length!==2)throw new Error;let[n,i]=o;if(!i)throw new Error;let s=Number(i);if(`${s}`!==i)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function Pp(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var Tp=y("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Pd),fe.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{Pp(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function px(e){if(!Da.test(e))return!1;let t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Pp(r)}var Rp=y("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Da),fe.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{px(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Op=y("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Rd),fe.init(e,t)});function mx(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[o]=r;if(!o)return!1;let n=JSON.parse(atob(o));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}var Dp=y("$ZodJWT",(e,t)=>{fe.init(e,t),e._zod.check=r=>{mx(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),Np=y("$ZodCustomStringFormat",(e,t)=>{fe.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),Ba=y("$ZodNumber",(e,t)=>{J.init(e,t),e._zod.pattern=e._zod.bag.pattern??Na,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let i=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...i?{received:i}:{}}),r}}),Lp=y("$ZodNumberFormat",(e,t)=>{Gd.init(e,t),Ba.init(e,t)}),Fi=y("$ZodBoolean",(e,t)=>{J.init(e,t),e._zod.pattern=zd,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=!!r.value}catch{}let n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),Ha=y("$ZodBigInt",(e,t)=>{J.init(e,t),e._zod.pattern=Ud,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),Up=y("$ZodBigIntFormat",(e,t)=>{Wd.init(e,t),Ha.init(e,t)}),jp=y("$ZodSymbol",(e,t)=>{J.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return typeof n=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:e}),r}}),zp=y("$ZodUndefined",(e,t)=>{J.init(e,t),e._zod.pattern=Md,e._zod.values=new Set([void 0]),e._zod.parse=(r,o)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),r}}),Fp=y("$ZodNull",(e,t)=>{J.init(e,t),e._zod.pattern=Fd,e._zod.values=new Set([null]),e._zod.parse=(r,o)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),Mp=y("$ZodAny",(e,t)=>{J.init(e,t),e._zod.parse=r=>r}),Bp=y("$ZodUnknown",(e,t)=>{J.init(e,t),e._zod.parse=r=>r}),Hp=y("$ZodNever",(e,t)=>{J.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),Zp=y("$ZodVoid",(e,t)=>{J.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),r}}),Gp=y("$ZodDate",(e,t)=>{J.init(e,t),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let n=r.value,i=n instanceof Date;return i&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...i?{received:"Invalid Date"}:{},inst:e}),r}});function Yy(e,t,r){e.issues.length&&t.issues.push(...et(r,e.issues)),t.value[r]=e.value}var Wp=y("$ZodArray",(e,t)=>{J.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),r;r.value=Array(n.length);let i=[];for(let s=0;s<n.length;s++){let a=n[s],l=t.element._zod.run({value:a,issues:[]},o);l instanceof Promise?i.push(l.then(u=>Yy(u,r,s))):Yy(l,r,s)}return i.length?Promise.all(i).then(()=>r):r}});function Ma(e,t,r,o,n,i){let s=r in o;if(e.issues.length){if(n&&i&&!s)return;t.issues.push(...et(r,e.issues))}if(!s&&!n){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?s&&(t.value[r]=void 0):t.value[r]=e.value}function fx(e){let t=Object.keys(e.shape);for(let o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);let r=ad(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function gx(e,t,r,o,n,i){let s=[],a=n.keySet,l=n.catchall._zod,u=l.def.type,p=l.optin==="optional",d=l.optout==="optional";for(let m in t){if(m==="__proto__"||a.has(m))continue;if(u==="never"){s.push(m);continue}let f=l.run({value:t[m],issues:[]},o);f instanceof Promise?e.push(f.then(g=>Ma(g,r,m,t,p,d))):Ma(f,r,m,t,p,d)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i}),e.length?Promise.all(e).then(()=>r):r}var hx=y("$ZodObject",(e,t)=>{if(J.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let a=t.shape;Object.defineProperty(t,"shape",{get:()=>{let l={...a};return Object.defineProperty(t,"shape",{value:l}),l}})}let o=co(()=>fx(t));te(e._zod,"propValues",()=>{let a=t.shape,l={};for(let u in a){let p=a[u]._zod;if(p.values){l[u]??(l[u]=new Set);for(let d of p.values)l[u].add(d)}}return l});let n=hr,i=t.catchall,s;e._zod.parse=(a,l)=>{s??(s=o.value);let u=a.value;if(!n(u))return a.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),a;a.value={};let p=[],d=s.shape;for(let m of s.keys){let f=d[m],g=f._zod.optin==="optional",h=f._zod.optout==="optional",v=f._zod.run({value:u[m],issues:[]},l);v instanceof Promise?p.push(v.then(k=>Ma(k,a,m,u,g,h))):Ma(v,a,m,u,g,h)}return i?gx(p,u,a,l,o.value,e):p.length?Promise.all(p).then(()=>a):a}}),Vp=y("$ZodObjectJIT",(e,t)=>{hx.init(e,t);let r=e._zod.parse,o=co(()=>fx(t)),n=m=>{let f=new zi(["shape","payload","ctx"]),g=o.value,h=I=>{let _=wa(I);return`shape[${_}]._zod.run({ value: input[${_}], issues: [] }, ctx)`};f.write("const input = payload.value;");let v=Object.create(null),k=0;for(let I of g.keys)v[I]=`key_${k++}`;f.write("const newResult = {};");for(let I of g.keys){let _=v[I],C=wa(I),z=m[I],F=z?._zod?.optin==="optional",K=z?._zod?.optout==="optional";f.write(`const ${_} = ${h(I)};`),F&&K?f.write(`
|
|
186
|
+
if (${_}.issues.length) {
|
|
187
|
+
if (${C} in input) {
|
|
188
|
+
payload.issues = payload.issues.concat(${_}.issues.map(iss => ({
|
|
180
189
|
...iss,
|
|
181
|
-
path: iss.path ? [${
|
|
190
|
+
path: iss.path ? [${C}, ...iss.path] : [${C}]
|
|
182
191
|
})));
|
|
183
192
|
}
|
|
184
193
|
}
|
|
185
194
|
|
|
186
|
-
if (${
|
|
187
|
-
if (${
|
|
188
|
-
newResult[${
|
|
195
|
+
if (${_}.value === undefined) {
|
|
196
|
+
if (${C} in input) {
|
|
197
|
+
newResult[${C}] = undefined;
|
|
189
198
|
}
|
|
190
199
|
} else {
|
|
191
|
-
newResult[${
|
|
200
|
+
newResult[${C}] = ${_}.value;
|
|
192
201
|
}
|
|
193
202
|
|
|
194
203
|
`):F?f.write(`
|
|
195
|
-
if (${
|
|
196
|
-
payload.issues = payload.issues.concat(${
|
|
204
|
+
if (${_}.issues.length) {
|
|
205
|
+
payload.issues = payload.issues.concat(${_}.issues.map(iss => ({
|
|
197
206
|
...iss,
|
|
198
|
-
path: iss.path ? [${
|
|
207
|
+
path: iss.path ? [${C}, ...iss.path] : [${C}]
|
|
199
208
|
})));
|
|
200
209
|
}
|
|
201
210
|
|
|
202
|
-
if (${
|
|
203
|
-
if (${
|
|
204
|
-
newResult[${
|
|
211
|
+
if (${_}.value === undefined) {
|
|
212
|
+
if (${C} in input) {
|
|
213
|
+
newResult[${C}] = undefined;
|
|
205
214
|
}
|
|
206
215
|
} else {
|
|
207
|
-
newResult[${
|
|
216
|
+
newResult[${C}] = ${_}.value;
|
|
208
217
|
}
|
|
209
218
|
|
|
210
219
|
`):f.write(`
|
|
211
|
-
const ${
|
|
212
|
-
if (${
|
|
213
|
-
payload.issues = payload.issues.concat(${
|
|
220
|
+
const ${_}_present = ${C} in input;
|
|
221
|
+
if (${_}.issues.length) {
|
|
222
|
+
payload.issues = payload.issues.concat(${_}.issues.map(iss => ({
|
|
214
223
|
...iss,
|
|
215
|
-
path: iss.path ? [${
|
|
224
|
+
path: iss.path ? [${C}, ...iss.path] : [${C}]
|
|
216
225
|
})));
|
|
217
226
|
}
|
|
218
|
-
if (!${
|
|
227
|
+
if (!${_}_present && !${_}.issues.length) {
|
|
219
228
|
payload.issues.push({
|
|
220
229
|
code: "invalid_type",
|
|
221
230
|
expected: "nonoptional",
|
|
222
231
|
input: undefined,
|
|
223
|
-
path: [${
|
|
232
|
+
path: [${C}]
|
|
224
233
|
});
|
|
225
234
|
}
|
|
226
235
|
|
|
227
|
-
if (${
|
|
228
|
-
if (${
|
|
229
|
-
newResult[${
|
|
236
|
+
if (${_}_present) {
|
|
237
|
+
if (${_}.value === undefined) {
|
|
238
|
+
newResult[${C}] = undefined;
|
|
230
239
|
} else {
|
|
231
|
-
newResult[${
|
|
240
|
+
newResult[${C}] = ${_}.value;
|
|
232
241
|
}
|
|
233
242
|
}
|
|
234
243
|
|
|
235
|
-
`)}f.write("payload.value = newResult;"),f.write("return payload;");let _=f.compile();return(I,S)=>_(m,I,S)},i,s=fr,a=!mr.jitless,u=a&&Zu.value,d=t.catchall,p;e._zod.parse=(m,f)=>{p??(p=o.value);let g=m.value;return s(g)?a&&u&&f?.async===!1&&f.jitless!==!0?(i||(i=n(t.shape)),m=i(m,f),d?Kb([],g,m,f,p,e):m):r(m,f):(m.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),m)}});function Db(e,t,r,o){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let n=e.filter(i=>!Bn(i));return n.length===1?(t.value=n[0].value,n[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(s=>Ge(s,o,$e())))}),t)}var ji=b("$ZodUnion",(e,t)=>{V.init(e,t),ne(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),ne(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),ne(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),ne(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){let o=t.options.map(n=>n._zod.pattern);return new RegExp(`^(${o.map(n=>Ei(n.source)).join("|")})$`)}});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let i=!1,s=[];for(let a of t.options){let l=a._zod.run({value:o.value,issues:[]},n);if(l instanceof Promise)s.push(l),i=!0;else{if(l.issues.length===0)return l;s.push(l)}}return i?Promise.all(s).then(a=>Db(a,o,e,n)):Db(s,o,e,n)}});function Nb(e,t,r,o){let n=e.filter(i=>i.issues.length===0);return n.length===1?(t.value=n[0].value,t):(n.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(s=>Ge(s,o,$e())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t)}var Dp=b("$ZodXor",(e,t)=>{ji.init(e,t),t.inclusive=!1;let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let i=!1,s=[];for(let a of t.options){let l=a._zod.run({value:o.value,issues:[]},n);l instanceof Promise?(s.push(l),i=!0):s.push(l)}return i?Promise.all(s).then(a=>Nb(a,o,e,n)):Nb(s,o,e,n)}}),Np=b("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,ji.init(e,t);let r=e._zod.parse;ne(e._zod,"propValues",()=>{let n={};for(let i of t.options){let s=i._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[a,l]of Object.entries(s)){n[a]||(n[a]=new Set);for(let u of l)n[a].add(u)}}return n});let o=io(()=>{let n=t.options,i=new Map;for(let s of n){let a=s._zod.propValues?.[t.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let l of a){if(i.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);i.set(l,s)}}return i});e._zod.parse=(n,i)=>{let s=n.value;if(!fr(s))return n.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),n;let a=o.value.get(s?.[t.discriminator]);return a?a._zod.run(n,i):t.unionFallback||i.direction==="backward"?r(n,i):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(o.value.keys()),input:s,path:[t.discriminator],inst:e}),n)}}),Lp=b("$ZodIntersection",(e,t)=>{V.init(e,t),e._zod.parse=(r,o)=>{let n=r.value,i=t.left._zod.run({value:n,issues:[]},o),s=t.right._zod.run({value:n,issues:[]},o);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([l,u])=>Lb(r,l,u)):Lb(r,i,s)}});function Jd(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Mn(e)&&Mn(t)){let r=Object.keys(t),o=Object.keys(e).filter(i=>r.indexOf(i)!==-1),n={...e,...t};for(let i of o){let s=Jd(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};n[i]=s.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let o=0;o<e.length;o++){let n=e[o],i=t[o],s=Jd(n,i);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Lb(e,t,r){let o=new Map,n;for(let a of t.issues)if(a.code==="unrecognized_keys"){n??(n=a);for(let l of a.keys)o.has(l)||o.set(l,{}),o.get(l).l=!0}else e.issues.push(a);for(let a of r.issues)if(a.code==="unrecognized_keys")for(let l of a.keys)o.has(l)||o.set(l,{}),o.get(l).r=!0;else e.issues.push(a);let i=[...o].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(i.length&&n&&e.issues.push({...n,keys:i}),Bn(e))return e;let s=Jd(t.value,r.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}var La=b("$ZodTuple",(e,t)=>{V.init(e,t);let r=t.items;e._zod.parse=(o,n)=>{let i=o.value;if(!Array.isArray(i))return o.issues.push({input:i,inst:e,expected:"tuple",code:"invalid_type"}),o;o.value=[];let s=[],a=Ub(r,"optin"),l=Ub(r,"optout");if(!t.rest){if(i.length<a)return o.issues.push({code:"too_small",minimum:a,inclusive:!0,input:i,inst:e,origin:"array"}),o;i.length>r.length&&o.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:i,inst:e,origin:"array"})}let u=new Array(r.length);for(let d=0;d<r.length;d++){let p=r[d]._zod.run({value:i[d],issues:[]},n);p instanceof Promise?s.push(p.then(m=>{u[d]=m})):u[d]=p}if(t.rest){let d=r.length-1,p=i.slice(r.length);for(let m of p){d++;let f=t.rest._zod.run({value:m,issues:[]},n);f instanceof Promise?s.push(f.then(g=>jb(g,o,d))):jb(f,o,d)}}return s.length?Promise.all(s).then(()=>zb(u,o,r,i,l)):zb(u,o,r,i,l)}});function Ub(e,t){for(let r=e.length-1;r>=0;r--)if(e[r]._zod[t]!=="optional")return r+1;return 0}function jb(e,t,r){e.issues.length&&t.issues.push(...et(r,e.issues)),t.value[r]=e.value}function zb(e,t,r,o,n){for(let i=0;i<r.length;i++){let s=e[i],a=i<o.length;if(s.issues.length){if(!a&&i>=n){t.value.length=i;break}t.issues.push(...et(i,s.issues))}t.value[i]=s.value}for(let i=t.value.length-1;i>=o.length&&(r[i]._zod.optout==="optional"&&t.value[i]===void 0);i--)t.value.length=i;return t}var Up=b("$ZodRecord",(e,t)=>{V.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!Mn(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),r;let i=[],s=t.keyType._zod.values;if(s){r.value={};let a=new Set;for(let u of s)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){a.add(typeof u=="number"?u.toString():u);let d=t.keyType._zod.run({value:u,issues:[]},o);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(d.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(f=>Ge(f,o,$e())),input:u,path:[u],inst:e});continue}let p=d.value,m=t.valueType._zod.run({value:n[u],issues:[]},o);m instanceof Promise?i.push(m.then(f=>{f.issues.length&&r.issues.push(...et(u,f.issues)),r.value[p]=f.value})):(m.issues.length&&r.issues.push(...et(u,m.issues)),r.value[p]=m.value)}let l;for(let u in n)a.has(u)||(l=l??[],l.push(u));l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:l})}else{r.value={};for(let a of Reflect.ownKeys(n)){if(a==="__proto__"||!Object.prototype.propertyIsEnumerable.call(n,a))continue;let l=t.keyType._zod.run({value:a,issues:[]},o);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&Ea.test(a)&&l.issues.length){let p=t.keyType._zod.run({value:Number(a),issues:[]},o);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(l=p)}if(l.issues.length){t.mode==="loose"?r.value[a]=n[a]:r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(p=>Ge(p,o,$e())),input:a,path:[a],inst:e});continue}let d=t.valueType._zod.run({value:n[a],issues:[]},o);d instanceof Promise?i.push(d.then(p=>{p.issues.length&&r.issues.push(...et(a,p.issues)),r.value[l.value]=p.value})):(d.issues.length&&r.issues.push(...et(a,d.issues)),r.value[l.value]=d.value)}}return i.length?Promise.all(i).then(()=>r):r}}),jp=b("$ZodMap",(e,t)=>{V.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!(n instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:n,inst:e}),r;let i=[];r.value=new Map;for(let[s,a]of n){let l=t.keyType._zod.run({value:s,issues:[]},o),u=t.valueType._zod.run({value:a,issues:[]},o);l instanceof Promise||u instanceof Promise?i.push(Promise.all([l,u]).then(([d,p])=>{Fb(d,p,r,s,n,e,o)})):Fb(l,u,r,s,n,e,o)}return i.length?Promise.all(i).then(()=>r):r}});function Fb(e,t,r,o,n,i,s){e.issues.length&&(Ai.has(typeof o)?r.issues.push(...et(o,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:n,inst:i,issues:e.issues.map(a=>Ge(a,s,$e()))})),t.issues.length&&(Ai.has(typeof o)?r.issues.push(...et(o,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:i,key:o,issues:t.issues.map(a=>Ge(a,s,$e()))})),r.value.set(e.value,t.value)}var zp=b("$ZodSet",(e,t)=>{V.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!(n instanceof Set))return r.issues.push({input:n,inst:e,expected:"set",code:"invalid_type"}),r;let i=[];r.value=new Set;for(let s of n){let a=t.valueType._zod.run({value:s,issues:[]},o);a instanceof Promise?i.push(a.then(l=>Mb(l,r))):Mb(a,r)}return i.length?Promise.all(i).then(()=>r):r}});function Mb(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}var Fp=b("$ZodEnum",(e,t)=>{V.init(e,t);let r=Ii(t.entries),o=new Set(r);e._zod.values=o,e._zod.pattern=new RegExp(`^(${r.filter(n=>Ai.has(typeof n)).map(n=>typeof n=="string"?ht(n):n.toString()).join("|")})$`),e._zod.parse=(n,i)=>{let s=n.value;return o.has(s)||n.issues.push({code:"invalid_value",values:r,input:s,inst:e}),n}}),Mp=b("$ZodLiteral",(e,t)=>{if(V.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(o=>typeof o=="string"?ht(o):o?ht(o.toString()):String(o)).join("|")})$`),e._zod.parse=(o,n)=>{let i=o.value;return r.has(i)||o.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),o}}),Bp=b("$ZodFile",(e,t)=>{V.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return n instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:n,inst:e}),r}}),Hp=b("$ZodTransform",(e,t)=>{V.init(e,t),e._zod.optin="optional",e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new jn(e.constructor.name);let n=t.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then(s=>(r.value=s,r.fallback=!0,r));if(n instanceof Promise)throw new $t;return r.value=n,r.fallback=!0,r}});function Bb(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var Ua=b("$ZodOptional",(e,t)=>{V.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ne(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ne(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Ei(r.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(t.innerType._zod.optin==="optional"){let n=r.value,i=t.innerType._zod.run(r,o);return i instanceof Promise?i.then(s=>Bb(s,n)):Bb(i,n)}return r.value===void 0?r:t.innerType._zod.run(r,o)}}),Zp=b("$ZodExactOptional",(e,t)=>{Ua.init(e,t),ne(e._zod,"values",()=>t.innerType._zod.values),ne(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),Gp=b("$ZodNullable",(e,t)=>{V.init(e,t),ne(e._zod,"optin",()=>t.innerType._zod.optin),ne(e._zod,"optout",()=>t.innerType._zod.optout),ne(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Ei(r.source)}|null)$`):void 0}),ne(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>r.value===null?r:t.innerType._zod.run(r,o)}),Wp=b("$ZodDefault",(e,t)=>{V.init(e,t),e._zod.optin="optional",ne(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)return r.value=t.defaultValue,r;let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>Hb(i,t)):Hb(n,t)}});function Hb(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Vp=b("$ZodPrefault",(e,t)=>{V.init(e,t),e._zod.optin="optional",ne(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>(o.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,o))}),qp=b("$ZodNonOptional",(e,t)=>{V.init(e,t),ne(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,o)=>{let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>Zb(i,e)):Zb(n,e)}});function Zb(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var Jp=b("$ZodSuccess",(e,t)=>{V.init(e,t),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new jn("ZodSuccess");let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>(r.value=i.issues.length===0,r)):(r.value=n.issues.length===0,r)}}),Kp=b("$ZodCatch",(e,t)=>{V.init(e,t),e._zod.optin="optional",ne(e._zod,"optout",()=>t.innerType._zod.optout),ne(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>(r.value=i.value,i.issues.length&&(r.value=t.catchValue({...r,error:{issues:i.issues.map(s=>Ge(s,o,$e()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=n.value,n.issues.length&&(r.value=t.catchValue({...r,error:{issues:n.issues.map(i=>Ge(i,o,$e()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),Xp=b("$ZodNaN",(e,t)=>{V.init(e,t),e._zod.parse=(r,o)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r)}),ja=b("$ZodPipe",(e,t)=>{V.init(e,t),ne(e._zod,"values",()=>t.in._zod.values),ne(e._zod,"optin",()=>t.in._zod.optin),ne(e._zod,"optout",()=>t.out._zod.optout),ne(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){let i=t.out._zod.run(r,o);return i instanceof Promise?i.then(s=>Ca(s,t.in,o)):Ca(i,t.in,o)}let n=t.in._zod.run(r,o);return n instanceof Promise?n.then(i=>Ca(i,t.out,o)):Ca(n,t.out,o)}});function Ca(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}var zi=b("$ZodCodec",(e,t)=>{V.init(e,t),ne(e._zod,"values",()=>t.in._zod.values),ne(e._zod,"optin",()=>t.in._zod.optin),ne(e._zod,"optout",()=>t.out._zod.optout),ne(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if((o.direction||"forward")==="forward"){let i=t.in._zod.run(r,o);return i instanceof Promise?i.then(s=>Ta(s,t,o)):Ta(i,t,o)}else{let i=t.out._zod.run(r,o);return i instanceof Promise?i.then(s=>Ta(s,t,o)):Ta(i,t,o)}}});function Ta(e,t,r){if(e.issues.length)return e.aborted=!0,e;if((r.direction||"forward")==="forward"){let n=t.transform(e.value,e);return n instanceof Promise?n.then(i=>Ra(e,i,t.out,r)):Ra(e,n,t.out,r)}else{let n=t.reverseTransform(e.value,e);return n instanceof Promise?n.then(i=>Ra(e,i,t.in,r)):Ra(e,n,t.in,r)}}function Ra(e,t,r,o){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},o)}var Yp=b("$ZodPreprocess",(e,t)=>{ja.init(e,t)}),Qp=b("$ZodReadonly",(e,t)=>{V.init(e,t),ne(e._zod,"propValues",()=>t.innerType._zod.propValues),ne(e._zod,"values",()=>t.innerType._zod.values),ne(e._zod,"optin",()=>t.innerType?._zod?.optin),ne(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(Gb):Gb(n)}});function Gb(e){return e.value=Object.freeze(e.value),e}var em=b("$ZodTemplateLiteral",(e,t)=>{V.init(e,t);let r=[];for(let o of t.parts)if(typeof o=="object"&&o!==null){if(!o._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...o._zod.traits].shift()}`);let n=o._zod.pattern instanceof RegExp?o._zod.pattern.source:o._zod.pattern;if(!n)throw new Error(`Invalid template literal part: ${o._zod.traits}`);let i=n.startsWith("^")?1:0,s=n.endsWith("$")?n.length-1:n.length;r.push(n.slice(i,s))}else if(o===null||Wu.has(typeof o))r.push(ht(`${o}`));else throw new Error(`Invalid template literal part: ${o}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(o,n)=>typeof o.value!="string"?(o.issues.push({input:o.value,inst:e,expected:"string",code:"invalid_type"}),o):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(o.value)||o.issues.push({input:o.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),o)}),tm=b("$ZodFunction",(e,t)=>(V.init(e,t),e._def=t,e._zod.def=t,e.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...o){let n=e._def.input?ha(e._def.input,o):o,i=Reflect.apply(r,this,n);return e._def.output?ha(e._def.output,i):i}},e.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...o){let n=e._def.input?await va(e._def.input,o):o,i=await Reflect.apply(r,this,n);return e._def.output?await va(e._def.output,i):i}},e._zod.parse=(r,o)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:e}),r):(e._def.output&&e._def.output._zod.def.type==="promise"?r.value=e.implementAsync(r.value):r.value=e.implement(r.value),r),e.input=(...r)=>{let o=e.constructor;return Array.isArray(r[0])?new o({type:"function",input:new La({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output}):new o({type:"function",input:r[0],output:e._def.output})},e.output=r=>{let o=e.constructor;return new o({type:"function",input:e._def.input,output:r})},e)),nm=b("$ZodPromise",(e,t)=>{V.init(e,t),e._zod.parse=(r,o)=>Promise.resolve(r.value).then(n=>t.innerType._zod.run({value:n,issues:[]},o))}),rm=b("$ZodLazy",(e,t)=>{V.init(e,t),ne(e._zod,"innerType",()=>{let r=t;return r._cachedInner||(r._cachedInner=t.getter()),r._cachedInner}),ne(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),ne(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),ne(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),ne(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,o)=>e._zod.innerType._zod.run(r,o)}),om=b("$ZodCustom",(e,t)=>{ye.init(e,t),V.init(e,t),e._zod.parse=(r,o)=>r,e._zod.check=r=>{let o=r.value,n=t.fn(o);if(n instanceof Promise)return n.then(i=>Wb(i,r,o,e));Wb(n,r,o,e)}});function Wb(e,t,r,o){if(!e){let n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(n.params=o._zod.def.params),t.issues.push(so(n))}}var Mi={};nn(Mi,{ar:()=>Yb,az:()=>Qb,be:()=>tx,bg:()=>nx,ca:()=>rx,cs:()=>ox,da:()=>ix,de:()=>sx,el:()=>ax,en:()=>za,eo:()=>cx,es:()=>lx,fa:()=>ux,fi:()=>dx,fr:()=>px,frCA:()=>mx,he:()=>fx,hr:()=>gx,hu:()=>hx,hy:()=>yx,id:()=>bx,is:()=>xx,it:()=>kx,ja:()=>wx,ka:()=>Sx,kh:()=>_x,km:()=>Fa,ko:()=>$x,lt:()=>Ex,mk:()=>Ax,ms:()=>Px,nl:()=>Cx,no:()=>Tx,ota:()=>Rx,pl:()=>Dx,ps:()=>Ox,pt:()=>Nx,ro:()=>Lx,ru:()=>jx,sl:()=>zx,sv:()=>Fx,ta:()=>Mx,th:()=>Bx,tr:()=>Hx,ua:()=>Zx,uk:()=>Ma,ur:()=>Gx,uz:()=>Wx,vi:()=>Vx,yo:()=>Kx,zhCN:()=>qx,zhTW:()=>Jx});var aT=()=>{let e={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function t(n){return e[n]??null}let r={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${n.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${i}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`}case"invalid_value":return n.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${A(n.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${n.minimum.toString()} ${s.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${n.prefix}"`:i.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${i.suffix}"`:i.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${i.includes}"`:i.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${i.pattern}`:`${r[i.format]??n.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${n.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${n.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${n.keys.length>1?"\u0629":""}: ${w(n.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function Yb(){return{localeError:aT()}}var cT=()=>{let e={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function t(n){return e[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${n.expected}, daxil olan ${a}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${i}, daxil olan ${a}`}case"invalid_value":return n.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${A(n.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${i}${n.maximum.toString()} ${s.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${i}${n.minimum.toString()} ${s.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${i.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:i.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${i.suffix}" il\u0259 bitm\u0259lidir`:i.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${i.includes}" daxil olmal\u0131d\u0131r`:i.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${i.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[i.format]??n.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${n.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${n.keys.length>1?"lar":""}: ${w(n.keys,", ")}`;case"invalid_key":return`${n.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${n.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};function Qb(){return{localeError:cT()}}function ex(e,t,r,o){let n=Math.abs(e),i=n%10,s=n%100;return s>=11&&s<=19?o:i===1?t:i>=2&&i<=4?r:o}var lT=()=>{let e={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function t(n){return e[n]??null}let r={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},o={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${n.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${i}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`}case"invalid_value":return n.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${A(n.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s){let a=Number(n.maximum),l=ex(a,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${i}${n.maximum.toString()} ${l}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s){let a=Number(n.minimum),l=ex(a,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${i}${n.minimum.toString()} ${l}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${n.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${w(n.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${n.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function tx(){return{localeError:lT()}}var uT=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${A(n.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${n.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${n.minimum.toString()} ${s.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${i.prefix}"`;if(i.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${i.suffix}"`;if(i.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${i.includes}"`;if(i.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${i.pattern}`;let s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return i.format==="emoji"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="datetime"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="date"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),i.format==="time"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="duration"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${s} ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${n.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u043E\u0432\u0435":""}: ${w(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}};function nx(){return{localeError:uT()}}var dT=()=>{let e={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(n){return e[n]??null}let r={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${n.expected}, s'ha rebut ${a}`:`Tipus inv\xE0lid: s'esperava ${i}, s'ha rebut ${a}`}case"invalid_value":return n.values.length===1?`Valor inv\xE0lid: s'esperava ${A(n.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${w(n.values," o ")}`;case"too_big":{let i=n.inclusive?"com a m\xE0xim":"menys de",s=t(n.origin);return s?`Massa gran: s'esperava que ${n.origin??"el valor"} contingu\xE9s ${i} ${n.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"com a m\xEDnim":"m\xE9s de",s=t(n.origin);return s?`Massa petit: s'esperava que ${n.origin} contingu\xE9s ${i} ${n.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${i.prefix}"`:i.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${i.suffix}"`:i.format==="includes"?`Format inv\xE0lid: ha d'incloure "${i.includes}"`:i.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${i.pattern}`:`Format inv\xE0lid per a ${r[i.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${w(n.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${n.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${n.origin}`;default:return"Entrada inv\xE0lida"}}};function rx(){return{localeError:dT()}}var pT=()=>{let e={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function t(n){return e[n]??null}let r={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},o={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${n.expected}, obdr\u017Eeno ${a}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${i}, obdr\u017Eeno ${a}`}case"invalid_value":return n.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${A(n.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${i}${n.maximum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${i}${n.minimum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${i.prefix}"`:i.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${i.suffix}"`:i.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${i.includes}"`:i.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${i.pattern}`:`Neplatn\xFD form\xE1t ${r[i.format]??n.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${n.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${w(n.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${n.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${n.origin}`;default:return"Neplatn\xFD vstup"}}};function ox(){return{localeError:pT()}}var mT=()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function t(n){return e[n]??null}let r={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},o={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Ugyldigt input: forventede instanceof ${n.expected}, fik ${a}`:`Ugyldigt input: forventede ${i}, fik ${a}`}case"invalid_value":return n.values.length===1?`Ugyldig v\xE6rdi: forventede ${A(n.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin),a=o[n.origin]??n.origin;return s?`For stor: forventede ${a??"value"} ${s.verb} ${i} ${n.maximum.toString()} ${s.unit??"elementer"}`:`For stor: forventede ${a??"value"} havde ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin),a=o[n.origin]??n.origin;return s?`For lille: forventede ${a} ${s.verb} ${i} ${n.minimum.toString()} ${s.unit}`:`For lille: forventede ${a} havde ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ugyldig streng: skal starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: skal ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: skal indeholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${r[i.format]??n.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${w(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${n.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${n.origin}`;default:return"Ugyldigt input"}}};function ix(){return{localeError:mT()}}var fT=()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(n){return e[n]??null}let r={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},o={nan:"NaN",number:"Zahl",array:"Array"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${n.expected}, erhalten ${a}`:`Ung\xFCltige Eingabe: erwartet ${i}, erhalten ${a}`}case"invalid_value":return n.values.length===1?`Ung\xFCltige Eingabe: erwartet ${A(n.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${i}${n.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${i}${n.maximum.toString()} ist`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Zu klein: erwartet, dass ${n.origin} ${i}${n.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${i}${n.minimum.toString()} ist`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ung\xFCltiger String: muss mit "${i.prefix}" beginnen`:i.format==="ends_with"?`Ung\xFCltiger String: muss mit "${i.suffix}" enden`:i.format==="includes"?`Ung\xFCltiger String: muss "${i.includes}" enthalten`:i.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${i.pattern} entsprechen`:`Ung\xFCltig: ${r[i.format]??n.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${w(n.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${n.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${n.origin}`;default:return"Ung\xFCltige Eingabe"}}};function sx(){return{localeError:fT()}}var gT=()=>{let e={string:{unit:"\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},file:{unit:"bytes",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},array:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},set:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},map:{unit:"\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"}};function t(n){return e[n]??null}let r={regex:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",email:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",date:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",time:"ISO \u03CE\u03C1\u03B1",duration:"ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",ipv4:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",ipv6:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",mac:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",cidrv4:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",cidrv6:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",base64:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",base64url:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",json_string:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",e164:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return typeof n.expected=="string"&&/^[A-Z]/.test(n.expected)?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${n.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${a}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${i}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${a}`}case"invalid_value":return n.values.length===1?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${A(n.values[0])}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${i}${n.maximum.toString()} ${s.unit??"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${i}${n.minimum.toString()} ${s.unit}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${i.prefix}"`:i.format==="ends_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${i.suffix}"`:i.format==="includes"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${i.includes}"`:i.format==="regex"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${i.pattern}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${r[i.format]??n.format}`}case"not_multiple_of":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${n.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${n.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${n.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${w(n.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${n.origin}`;case"invalid_union":return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";case"invalid_element":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${n.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}};function ax(){return{localeError:gT()}}var hT=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(n){return e[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return`Invalid input: expected ${i}, received ${a}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${A(n.values[0])}`:`Invalid option: expected one of ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Too big: expected ${n.origin??"value"} to have ${i}${n.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Too small: expected ${n.origin} to have ${i}${n.minimum.toString()} ${s.unit}`:`Too small: expected ${n.origin} to be ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Invalid string: must start with "${i.prefix}"`:i.format==="ends_with"?`Invalid string: must end with "${i.suffix}"`:i.format==="includes"?`Invalid string: must include "${i.includes}"`:i.format==="regex"?`Invalid string: must match pattern ${i.pattern}`:`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${w(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`Invalid discriminator value. Expected ${n.options.map(s=>`'${s}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}};function za(){return{localeError:hT()}}var vT=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(n){return e[n]??null}let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},o={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${n.expected}, ricevi\u011Dis ${a}`:`Nevalida enigo: atendi\u011Dis ${i}, ricevi\u011Dis ${a}`}case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${A(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${i}${n.minimum.toString()} ${s.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${i.prefix}"`:i.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${i.suffix}"`:i.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${i.includes}"`:i.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${i.pattern}`:`Nevalida ${r[i.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} \u015Dlosilo${n.keys.length>1?"j":""}: ${w(n.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}};function cx(){return{localeError:vT()}}var yT=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(n){return e[n]??null}let r={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${n.expected}, recibido ${a}`:`Entrada inv\xE1lida: se esperaba ${i}, recibido ${a}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: se esperaba ${A(n.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin),a=o[n.origin]??n.origin;return s?`Demasiado grande: se esperaba que ${a??"valor"} tuviera ${i}${n.maximum.toString()} ${s.unit??"elementos"}`:`Demasiado grande: se esperaba que ${a??"valor"} fuera ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin),a=o[n.origin]??n.origin;return s?`Demasiado peque\xF1o: se esperaba que ${a} tuviera ${i}${n.minimum.toString()} ${s.unit}`:`Demasiado peque\xF1o: se esperaba que ${a} fuera ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${i.prefix}"`:i.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${i.suffix}"`:i.format==="includes"?`Cadena inv\xE1lida: debe incluir "${i.includes}"`:i.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${i.pattern}`:`Inv\xE1lido ${r[i.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${w(n.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${o[n.origin]??n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${o[n.origin]??n.origin}`;default:return"Entrada inv\xE1lida"}}};function lx(){return{localeError:yT()}}var bT=()=>{let e={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function t(n){return e[n]??null}let r={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${n.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${i} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return n.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${A(n.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${w(n.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} ${s.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:i.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:i.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${i.includes}" \u0628\u0627\u0634\u062F`:i.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${i.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[i.format]??n.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${n.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${n.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${w(n.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${n.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${n.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function ux(){return{localeError:bT()}}var xT=()=>{let e={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function t(n){return e[n]??null}let r={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${a}`:`Virheellinen tyyppi: odotettiin ${i}, oli ${a}`}case"invalid_value":return n.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${A(n.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Liian suuri: ${s.subject} t\xE4ytyy olla ${i}${n.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Liian pieni: ${s.subject} t\xE4ytyy olla ${i}${n.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${i.prefix}"`:i.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${i.suffix}"`:i.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${i.includes}"`:i.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${i.pattern}`:`Virheellinen ${r[i.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${w(n.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}};function dx(){return{localeError:xT()}}var kT=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(n){return e[n]??null}let r={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},o={string:"cha\xEEne",number:"nombre",int:"entier",boolean:"bool\xE9en",bigint:"grand entier",symbol:"symbole",undefined:"ind\xE9fini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : instanceof ${n.expected} attendu, ${a} re\xE7u`:`Entr\xE9e invalide : ${i} attendu, ${a} re\xE7u`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : ${A(n.values[0])} attendu`:`Option invalide : une valeur parmi ${w(n.values,"|")} attendue`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Trop grand : ${o[n.origin]??"valeur"} doit ${s.verb} ${i}${n.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${o[n.origin]??"valeur"} doit \xEAtre ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Trop petit : ${o[n.origin]??"valeur"} doit ${s.verb} ${i}${n.minimum.toString()} ${s.unit}`:`Trop petit : ${o[n.origin]??"valeur"} doit \xEAtre ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${i.pattern}`:`${r[i.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${w(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}};function px(){return{localeError:kT()}}var wT=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(n){return e[n]??null}let r={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : attendu instanceof ${n.expected}, re\xE7u ${a}`:`Entr\xE9e invalide : attendu ${i}, re\xE7u ${a}`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : attendu ${A(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"\u2264":"<",s=t(n.origin);return s?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${i}${n.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"\u2265":">",s=t(n.origin);return s?`Trop petit : attendu que ${n.origin} ait ${i}${n.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${n.origin} soit ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${i.pattern}`:`${r[i.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${w(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}};function mx(){return{localeError:wT()}}var ST=()=>{let e={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},t={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},r=u=>u?e[u]:void 0,o=u=>{let d=r(u);return d?d.label:u??e.unknown.label},n=u=>`\u05D4${o(u)}`,i=u=>(r(u)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",s=u=>u?t[u]??null:null,a={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},l={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let d=u.expected,p=l[d??""]??o(d),m=P(u.input),f=l[m]??e[m]?.label??m;return/^[A-Z]/.test(u.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${u.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${p}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`}case"invalid_value":{if(u.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${A(u.values[0])}`;let d=u.values.map(f=>A(f));if(u.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${d[0]} \u05D0\u05D5 ${d[1]}`;let p=d[d.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${d.slice(0,-1).join(", ")} \u05D0\u05D5 ${p}`}case"too_big":{let d=s(u.origin),p=n(u.origin??"value");if(u.origin==="string")return`${d?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${u.maximum.toString()} ${d?.unit??""} ${u.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(u.origin==="number"){let g=u.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${u.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${u.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${g}`}if(u.origin==="array"||u.origin==="set"){let g=u.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",h=u.inclusive?`${u.maximum} ${d?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${u.maximum} ${d?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${h}`.trim()}let m=u.inclusive?"<=":"<",f=i(u.origin??"value");return d?.unit?`${d.longLabel} \u05DE\u05D3\u05D9: ${p} ${f} ${m}${u.maximum.toString()} ${d.unit}`:`${d?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${p} ${f} ${m}${u.maximum.toString()}`}case"too_small":{let d=s(u.origin),p=n(u.origin??"value");if(u.origin==="string")return`${d?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${u.minimum.toString()} ${d?.unit??""} ${u.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(u.origin==="number"){let g=u.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${u.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${u.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${g}`}if(u.origin==="array"||u.origin==="set"){let g=u.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(u.minimum===1&&u.inclusive){let y=(u.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`}let h=u.inclusive?`${u.minimum} ${d?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${u.minimum} ${d?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${h}`.trim()}let m=u.inclusive?">=":">",f=i(u.origin??"value");return d?.unit?`${d.shortLabel} \u05DE\u05D3\u05D9: ${p} ${f} ${m}${u.minimum.toString()} ${d.unit}`:`${d?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${p} ${f} ${m}${u.minimum.toString()}`}case"invalid_format":{let d=u;if(d.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${d.prefix}"`;if(d.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${d.suffix}"`;if(d.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${d.includes}"`;if(d.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${d.pattern}`;let p=a[d.format],m=p?.label??d.format,g=(p?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${m} \u05DC\u05D0 ${g}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${u.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${u.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${u.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${w(u.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${n(u.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function fx(){return{localeError:ST()}}var _T=()=>{let e={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function t(n){return e[n]??null}let r={regex:"unos",email:"email adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},o={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${n.expected}, a primljeno je ${a}`:`Neispravan unos: o\u010Dekuje se ${i}, a primljeno je ${a}`}case"invalid_value":return n.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${A(n.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin),a=o[n.origin]??n.origin;return s?`Preveliko: o\u010Dekivano da ${a??"vrijednost"} ima ${i}${n.maximum.toString()} ${s.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${a??"vrijednost"} bude ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin),a=o[n.origin]??n.origin;return s?`Premalo: o\u010Dekivano da ${a} ima ${i}${n.minimum.toString()} ${s.unit}`:`Premalo: o\u010Dekivano da ${a} bude ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neispravan tekst: mora zapo\u010Dinjati s "${i.prefix}"`:i.format==="ends_with"?`Neispravan tekst: mora zavr\u0161avati s "${i.suffix}"`:i.format==="includes"?`Neispravan tekst: mora sadr\u017Eavati "${i.includes}"`:i.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${i.pattern}`:`Neispravna ${r[i.format]??n.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${n.divisor}`;case"unrecognized_keys":return`Neprepoznat${n.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${w(n.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${o[n.origin]??n.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${o[n.origin]??n.origin}`;default:return"Neispravan unos"}}};function gx(){return{localeError:_T()}}var $T=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(n){return e[n]??null}let r={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},o={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${n.expected}, a kapott \xE9rt\xE9k ${a}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${i}, a kapott \xE9rt\xE9k ${a}`}case"invalid_value":return n.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${A(n.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`T\xFAl nagy: ${n.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${i}${n.maximum.toString()} ${s.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${n.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} m\xE9rete t\xFAl kicsi ${i}${n.minimum.toString()} ${s.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} t\xFAl kicsi ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\xC9rv\xE9nytelen string: "${i.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:i.format==="ends_with"?`\xC9rv\xE9nytelen string: "${i.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:i.format==="includes"?`\xC9rv\xE9nytelen string: "${i.includes}" \xE9rt\xE9ket kell tartalmaznia`:i.format==="regex"?`\xC9rv\xE9nytelen string: ${i.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[i.format]??n.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${n.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${w(n.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${n.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${n.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};function hx(){return{localeError:$T()}}function vx(e,t,r){return Math.abs(e)===1?t:r}function mo(e){if(!e)return"";let t=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=e[e.length-1];return e+(t.includes(r)?"\u0576":"\u0568")}var IT=()=>{let e={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function t(n){return e[n]??null}let r={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},o={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${n.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${i}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`}case"invalid_value":return n.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${A(n.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s){let a=Number(n.maximum),l=vx(a,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${mo(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${n.maximum.toString()} ${l}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${mo(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s){let a=Number(n.minimum),l=vx(a,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${mo(n.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${n.minimum.toString()} ${l}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${mo(n.origin)} \u056C\u056B\u0576\u056B ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${i.prefix}"-\u0578\u057E`:i.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${i.suffix}"-\u0578\u057E`:i.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${i.includes}"`:i.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${i.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[i.format]??n.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${n.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${n.keys.length>1?"\u0576\u0565\u0580":""}. ${w(n.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${mo(n.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${mo(n.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};function yx(){return{localeError:IT()}}var ET=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(n){return e[n]??null}let r={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${a}`:`Input tidak valid: diharapkan ${i}, diterima ${a}`}case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${A(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${i}${n.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Terlalu kecil: diharapkan ${n.origin} memiliki ${i}${n.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`String tidak valid: harus dimulai dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak valid: harus berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak valid: harus menyertakan "${i.includes}"`:i.format==="regex"?`String tidak valid: harus sesuai pola ${i.pattern}`:`${r[i.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${w(n.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${n.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${n.origin}`;default:return"Input tidak valid"}}};function bx(){return{localeError:ET()}}var AT=()=>{let e={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function t(n){return e[n]??null}let r={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},o={nan:"NaN",number:"n\xFAmer",array:"fylki"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera instanceof ${n.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera ${i}`}case"invalid_value":return n.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${A(n.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} hafi ${i}${n.maximum.toString()} ${s.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} s\xE9 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} hafi ${i}${n.minimum.toString()} ${s.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} s\xE9 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${i.prefix}"`:i.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${i.suffix}"`:i.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${i.includes}"`:i.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${i.pattern}`:`Rangt ${r[i.format]??n.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${n.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${n.keys.length>1?"ir lyklar":"ur lykill"}: ${w(n.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${n.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${n.origin}`;default:return"Rangt gildi"}}};function xx(){return{localeError:AT()}}var PT=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(n){return e[n]??null}let r={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"numero",array:"vettore"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Input non valido: atteso instanceof ${n.expected}, ricevuto ${a}`:`Input non valido: atteso ${i}, ricevuto ${a}`}case"invalid_value":return n.values.length===1?`Input non valido: atteso ${A(n.values[0])}`:`Opzione non valida: atteso uno tra ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Troppo grande: ${n.origin??"valore"} deve avere ${i}${n.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Troppo piccolo: ${n.origin} deve avere ${i}${n.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${n.origin} deve essere ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Stringa non valida: deve iniziare con "${i.prefix}"`:i.format==="ends_with"?`Stringa non valida: deve terminare con "${i.suffix}"`:i.format==="includes"?`Stringa non valida: deve includere "${i.includes}"`:i.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${i.pattern}`:`Input non valido: ${r[i.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${w(n.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${n.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${n.origin}`;default:return"Input non valido"}}};function kx(){return{localeError:PT()}}var CT=()=>{let e={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function t(n){return e[n]??null}let r={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},o={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${n.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${i}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return n.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${A(n.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${w(n.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let i=n.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",s=t(n.origin);return s?`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${s.unit??"\u8981\u7D20"}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let i=n.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",s=t(n.origin);return s?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${s.unit}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${i.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[i.format]??n.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${n.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${n.keys.length>1?"\u7FA4":""}: ${w(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};function wx(){return{localeError:CT()}}var TT=()=>{let e={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function t(n){return e[n]??null}let r={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",json_string:"JSON \u10D5\u10D4\u10DA\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},o={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10D5\u10D4\u10DA\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${n.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`}case"invalid_value":return n.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${A(n.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${w(n.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${s.verb} ${i}${n.maximum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} ${s.verb} ${i}${n.minimum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} \u10D8\u10E7\u10DD\u10E1 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.prefix}"-\u10D8\u10D7`:i.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.suffix}"-\u10D8\u10D7`:i.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${i.includes}"-\u10E1`:i.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${i.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${n.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${n.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${w(n.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${n.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${n.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};function Sx(){return{localeError:TT()}}var RT=()=>{let e={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function t(n){return e[n]??null}let r={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},o={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${n.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`}case"invalid_value":return n.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${A(n.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${n.maximum.toString()} ${s.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${i} ${n.minimum.toString()} ${s.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${i.prefix}"`:i.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${i.suffix}"`:i.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${i.includes}"`:i.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${i.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${n.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${w(n.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};function Fa(){return{localeError:RT()}}function _x(){return Fa()}var OT=()=>{let e={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function t(n){return e[n]??null}let r={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${n.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${i}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`}case"invalid_value":return n.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${A(n.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${w(n.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let i=n.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",s=i==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=t(n.origin),l=a?.unit??"\uC694\uC18C";return a?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()}${l} ${i}${s}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()} ${i}${s}`}case"too_small":{let i=n.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",s=i==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=t(n.origin),l=a?.unit??"\uC694\uC18C";return a?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()}${l} ${i}${s}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()} ${i}${s}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:i.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${i.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[i.format]??n.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${n.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${w(n.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${n.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${n.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};function $x(){return{localeError:OT()}}var Fi=e=>e.charAt(0).toUpperCase()+e.slice(1);function Ix(e){let t=Math.abs(e),r=t%10,o=t%100;return o>=11&&o<=19||r===0?"many":r===1?"one":"few"}var DT=()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function t(n,i,s,a){let l=e[n]??null;return l===null?l:{unit:l.unit[i],verb:l.verb[a][s?"inclusive":"notInclusive"]}}let r={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},o={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Gautas tipas ${a}, o tik\u0117tasi - instanceof ${n.expected}`:`Gautas tipas ${a}, o tik\u0117tasi - ${i}`}case"invalid_value":return n.values.length===1?`Privalo b\u016Bti ${A(n.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${w(n.values,"|")} pasirinkim\u0173`;case"too_big":{let i=o[n.origin]??n.origin,s=t(n.origin,Ix(Number(n.maximum)),n.inclusive??!1,"smaller");if(s?.verb)return`${Fi(i??n.origin??"reik\u0161m\u0117")} ${s.verb} ${n.maximum.toString()} ${s.unit??"element\u0173"}`;let a=n.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${Fi(i??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${n.maximum.toString()} ${s?.unit}`}case"too_small":{let i=o[n.origin]??n.origin,s=t(n.origin,Ix(Number(n.minimum)),n.inclusive??!1,"bigger");if(s?.verb)return`${Fi(i??n.origin??"reik\u0161m\u0117")} ${s.verb} ${n.minimum.toString()} ${s.unit??"element\u0173"}`;let a=n.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${Fi(i??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${n.minimum.toString()} ${s?.unit}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${i.prefix}"`:i.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${i.suffix}"`:i.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${i.includes}"`:i.format==="regex"?`Eilut\u0117 privalo atitikti ${i.pattern}`:`Neteisingas ${r[i.format]??n.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${n.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${n.keys.length>1?"i":"as"} rakt${n.keys.length>1?"ai":"as"}: ${w(n.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let i=o[n.origin]??n.origin;return`${Fi(i??n.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function Ex(){return{localeError:DT()}}var NT=()=>{let e={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function t(n){return e[n]??null}let r={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},o={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${n.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${A(n.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${i}${n.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0438\u043C\u0430 ${i}${n.minimum.toString()} ${s.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${i.pattern}`:`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${w(n.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${n.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${n.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function Ax(){return{localeError:NT()}}var LT=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(n){return e[n]??null}let r={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"nombor"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${a}`:`Input tidak sah: dijangka ${i}, diterima ${a}`}case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${A(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Terlalu besar: dijangka ${n.origin??"nilai"} ${s.verb} ${i}${n.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Terlalu kecil: dijangka ${n.origin} ${s.verb} ${i}${n.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`String tidak sah: mesti bermula dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak sah: mesti mengandungi "${i.includes}"`:i.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${i.pattern}`:`${r[i.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${w(n.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${n.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${n.origin}`;default:return"Input tidak sah"}}};function Px(){return{localeError:LT()}}var UT=()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function t(n){return e[n]??null}let r={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},o={nan:"NaN",number:"getal"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${a}`:`Ongeldige invoer: verwacht ${i}, ontving ${a}`}case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${A(n.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin),a=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";return s?`Te ${a}: verwacht dat ${n.origin??"waarde"} ${i}${n.maximum.toString()} ${s.unit??"elementen"} ${s.verb}`:`Te ${a}: verwacht dat ${n.origin??"waarde"} ${i}${n.maximum.toString()} is`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin),a=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";return s?`Te ${a}: verwacht dat ${n.origin} ${i}${n.minimum.toString()} ${s.unit} ${s.verb}`:`Te ${a}: verwacht dat ${n.origin} ${i}${n.minimum.toString()} is`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ongeldige tekst: moet met "${i.prefix}" beginnen`:i.format==="ends_with"?`Ongeldige tekst: moet op "${i.suffix}" eindigen`:i.format==="includes"?`Ongeldige tekst: moet "${i.includes}" bevatten`:i.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`:`Ongeldig: ${r[i.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${w(n.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${n.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${n.origin}`;default:return"Ongeldige invoer"}}};function Cx(){return{localeError:UT()}}var jT=()=>{let e={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function t(n){return e[n]??null}let r={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"tall",array:"liste"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Ugyldig input: forventet instanceof ${n.expected}, fikk ${a}`:`Ugyldig input: forventet ${i}, fikk ${a}`}case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${A(n.values[0])}`:`Ugyldig valg: forventet en av ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${i}${n.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`For lite(n): forventet ${n.origin} til \xE5 ha ${i}${n.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${n.origin} til \xE5 ha ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${r[i.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${w(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}};function Tx(){return{localeError:jT()}}var zT=()=>{let e={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function t(n){return e[n]??null}let r={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},o={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`F\xE2sit giren: umulan instanceof ${n.expected}, al\u0131nan ${a}`:`F\xE2sit giren: umulan ${i}, al\u0131nan ${a}`}case"invalid_value":return n.values.length===1?`F\xE2sit giren: umulan ${A(n.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${i}${n.maximum.toString()} ${s.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${i}${n.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${i}${n.minimum.toString()} ${s.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${i}${n.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let i=n;return i.format==="starts_with"?`F\xE2sit metin: "${i.prefix}" ile ba\u015Flamal\u0131.`:i.format==="ends_with"?`F\xE2sit metin: "${i.suffix}" ile bitmeli.`:i.format==="includes"?`F\xE2sit metin: "${i.includes}" ihtiv\xE2 etmeli.`:i.format==="regex"?`F\xE2sit metin: ${i.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[i.format]??n.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${n.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${n.keys.length>1?"s":""}: ${w(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${n.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};function Rx(){return{localeError:zT()}}var FT=()=>{let e={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function t(n){return e[n]??null}let r={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${n.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${i} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return n.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${A(n.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${w(n.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} \u0648\u064A`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} ${s.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} \u0648\u064A`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:i.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:i.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${i.includes}" \u0648\u0644\u0631\u064A`:i.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${i.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[i.format]??n.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${n.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${n.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${w(n.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${n.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${n.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function Ox(){return{localeError:FT()}}var MT=()=>{let e={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function t(n){return e[n]??null}let r={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},o={nan:"NaN",number:"liczba",array:"tablica"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${n.expected}, otrzymano ${a}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${i}, otrzymano ${a}`}case"invalid_value":return n.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${A(n.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${n.maximum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${n.minimum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${i.prefix}"`:i.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${i.suffix}"`:i.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${i.includes}"`:i.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${i.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[i.format]??n.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${w(n.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${n.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${n.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};function Dx(){return{localeError:MT()}}var BT=()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(n){return e[n]??null}let r={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",number:"n\xFAmero",null:"nulo"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Tipo inv\xE1lido: esperado instanceof ${n.expected}, recebido ${a}`:`Tipo inv\xE1lido: esperado ${i}, recebido ${a}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: esperado ${A(n.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${i}${n.maximum.toString()} ${s.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Muito pequeno: esperado que ${n.origin} tivesse ${i}${n.minimum.toString()} ${s.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${i.prefix}"`:i.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${i.suffix}"`:i.format==="includes"?`Texto inv\xE1lido: deve incluir "${i.includes}"`:i.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${i.pattern}`:`${r[i.format]??n.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${w(n.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${n.origin}`;default:return"Campo inv\xE1lido"}}};function Nx(){return{localeError:BT()}}var HT=()=>{let e={string:{unit:"caractere",verb:"s\u0103 aib\u0103"},file:{unit:"octe\u021Bi",verb:"s\u0103 aib\u0103"},array:{unit:"elemente",verb:"s\u0103 aib\u0103"},set:{unit:"elemente",verb:"s\u0103 aib\u0103"},map:{unit:"intr\u0103ri",verb:"s\u0103 aib\u0103"}};function t(n){return e[n]??null}let r={regex:"intrare",email:"adres\u0103 de email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"dat\u0103 \u0219i or\u0103 ISO",date:"dat\u0103 ISO",time:"or\u0103 ISO",duration:"durat\u0103 ISO",ipv4:"adres\u0103 IPv4",ipv6:"adres\u0103 IPv6",mac:"adres\u0103 MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"\u0219ir codat base64",base64url:"\u0219ir codat base64url",json_string:"\u0219ir JSON",e164:"num\u0103r E.164",jwt:"JWT",template_literal:"intrare"},o={nan:"NaN",string:"\u0219ir",number:"num\u0103r",boolean:"boolean",function:"func\u021Bie",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"num\u0103r mare",void:"void",never:"never",map:"hart\u0103",set:"set"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return`Intrare invalid\u0103: a\u0219teptat ${i}, primit ${a}`}case"invalid_value":return n.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${A(n.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} ${s.verb} ${i}${n.maximum.toString()} ${s.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} s\u0103 fie ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Prea mic: a\u0219teptat ca ${n.origin} ${s.verb} ${i}${n.minimum.toString()} ${s.unit}`:`Prea mic: a\u0219teptat ca ${n.origin} s\u0103 fie ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${i.prefix}"`:i.format==="ends_with"?`\u0218ir invalid: trebuie s\u0103 se termine cu "${i.suffix}"`:i.format==="includes"?`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${i.includes}"`:i.format==="regex"?`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${i.pattern}`:`Format invalid: ${r[i.format]??n.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${n.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${w(n.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${n.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${n.origin}`;default:return"Intrare invalid\u0103"}}};function Lx(){return{localeError:HT()}}function Ux(e,t,r,o){let n=Math.abs(e),i=n%10,s=n%100;return s>=11&&s<=19?o:i===1?t:i>=2&&i<=4?r:o}var ZT=()=>{let e={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${A(n.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s){let a=Number(n.maximum),l=Ux(a,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${n.maximum.toString()} ${l}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s){let a=Number(n.minimum),l=Ux(a,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${n.minimum.toString()} ${l}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${n.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0438":""}: ${w(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};function jx(){return{localeError:ZT()}}var GT=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(n){return e[n]??null}let r={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},o={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${n.expected}, prejeto ${a}`:`Neveljaven vnos: pri\u010Dakovano ${i}, prejeto ${a}`}case"invalid_value":return n.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${A(n.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} imelo ${i}${n.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Premajhno: pri\u010Dakovano, da bo ${n.origin} imelo ${i}${n.minimum.toString()} ${s.unit}`:`Premajhno: pri\u010Dakovano, da bo ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${i.prefix}"`:i.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${i.suffix}"`:i.format==="includes"?`Neveljaven niz: mora vsebovati "${i.includes}"`:i.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`:`Neveljaven ${r[i.format]??n.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${w(n.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${n.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${n.origin}`;default:return"Neveljaven vnos"}}};function zx(){return{localeError:GT()}}var WT=()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function t(n){return e[n]??null}let r={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},o={nan:"NaN",number:"antal",array:"lista"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${n.expected}, fick ${a}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${i}, fick ${a}`}case"invalid_value":return n.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${A(n.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`F\xF6r stor(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.maximum.toString()} ${s.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${n.origin??"v\xE4rdet"} att ha ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.minimum.toString()} ${s.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${i.prefix}"`:i.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${i.suffix}"`:i.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${i.includes}"`:i.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${i.pattern}"`:`Ogiltig(t) ${r[i.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${w(n.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${n.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${n.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};function Fx(){return{localeError:WT()}}var VT=()=>{let e={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function t(n){return e[n]??null}let r={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${n.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`}case"invalid_value":return n.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${A(n.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${w(n.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${n.maximum.toString()} ${s.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${n.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${i}${n.minimum.toString()} ${s.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${i}${n.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${i.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${n.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${n.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${w(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}};function Mx(){return{localeError:VT()}}var qT=()=>{let e={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function t(n){return e[n]??null}let r={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},o={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${n.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${i} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`}case"invalid_value":return n.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${A(n.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",s=t(n.origin);return s?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.maximum.toString()} ${s.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",s=t(n.origin);return s?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.minimum.toString()} ${s.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${i.prefix}"`:i.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${i.suffix}"`:i.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${i.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:i.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${i.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${n.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${w(n.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function Bx(){return{localeError:qT()}}var JT=()=>{let e={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function t(n){return e[n]??null}let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${n.expected}, al\u0131nan ${a}`:`Ge\xE7ersiz de\u011Fer: beklenen ${i}, al\u0131nan ${a}`}case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${A(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()} ${s.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()} ${s.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ge\xE7ersiz metin: "${i.prefix}" ile ba\u015Flamal\u0131`:i.format==="ends_with"?`Ge\xE7ersiz metin: "${i.suffix}" ile bitmeli`:i.format==="includes"?`Ge\xE7ersiz metin: "${i.includes}" i\xE7ermeli`:i.format==="regex"?`Ge\xE7ersiz metin: ${i.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[i.format]??n.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${n.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${n.keys.length>1?"lar":""}: ${w(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${n.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};function Hx(){return{localeError:JT()}}var KT=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${n.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${i}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${A(n.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${s.verb} ${i}${n.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} ${s.verb} ${i}${n.minimum.toString()} ${s.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} \u0431\u0443\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0456":""}: ${w(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${n.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};function Ma(){return{localeError:KT()}}function Zx(){return Ma()}var XT=()=>{let e={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function t(n){return e[n]??null}let r={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},o={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${n.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${i} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return n.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${A(n.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${w(n.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${i}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${i}${n.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u06D2 ${i}${n.minimum.toString()} ${s.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u0627 ${i}${n.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${i.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${n.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${n.keys.length>1?"\u0632":""}: ${w(n.keys,"\u060C ")}`;case"invalid_key":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function Gx(){return{localeError:XT()}}var YT=()=>{let e={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"},map:{unit:"yozuv",verb:"bo\u2018lishi kerak"}};function t(n){return e[n]??null}let r={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},o={nan:"NaN",number:"raqam",array:"massiv"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${a}`:`Noto\u2018g\u2018ri kirish: kutilgan ${i}, qabul qilingan ${a}`}case"invalid_value":return n.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${A(n.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Juda katta: kutilgan ${n.origin??"qiymat"} ${i}${n.maximum.toString()} ${s.unit} ${s.verb}`:`Juda katta: kutilgan ${n.origin??"qiymat"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Juda kichik: kutilgan ${n.origin} ${i}${n.minimum.toString()} ${s.unit} ${s.verb}`:`Juda kichik: kutilgan ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${i.prefix}" bilan boshlanishi kerak`:i.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${i.suffix}" bilan tugashi kerak`:i.format==="includes"?`Noto\u2018g\u2018ri satr: "${i.includes}" ni o\u2018z ichiga olishi kerak`:i.format==="regex"?`Noto\u2018g\u2018ri satr: ${i.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[i.format]??n.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${n.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${n.keys.length>1?"lar":""}: ${w(n.keys,", ")}`;case"invalid_key":return`${n.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${n.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}};function Wx(){return{localeError:YT()}}var QT=()=>{let e={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function t(n){return e[n]??null}let r={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},o={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${n.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${i}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`}case"invalid_value":return n.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${A(n.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${s.verb} ${i}${n.maximum.toString()} ${s.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${s.verb} ${i}${n.minimum.toString()} ${s.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${i.prefix}"`:i.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${i.suffix}"`:i.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${i.includes}"`:i.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${i.pattern}`:`${r[i.format]??n.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${n.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${w(n.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function Vx(){return{localeError:QT()}}var eR=()=>{let e={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function t(n){return e[n]??null}let r={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},o={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${n.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${i}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`}case"invalid_value":return n.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${A(n.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${i}${n.maximum.toString()} ${s.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${i}${n.minimum.toString()} ${s.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.prefix}" \u5F00\u5934`:i.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.suffix}" \u7ED3\u5C3E`:i.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${i.pattern}`:`\u65E0\u6548${r[i.format]??n.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${n.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${w(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${n.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};function qx(){return{localeError:eR()}}var tR=()=>{let e={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function t(n){return e[n]??null}let r={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${n.expected}\uFF0C\u4F46\u6536\u5230 ${a}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${i}\uFF0C\u4F46\u6536\u5230 ${a}`}case"invalid_value":return n.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${A(n.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${i}${n.maximum.toString()} ${s.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${i}${n.minimum.toString()} ${s.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.prefix}" \u958B\u982D`:i.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.suffix}" \u7D50\u5C3E`:i.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${i.pattern}`:`\u7121\u6548\u7684 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${n.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${n.keys.length>1?"\u5011":""}\uFF1A${w(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function Jx(){return{localeError:tR()}}var nR=()=>{let e={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function t(n){return e[n]??null}let r={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},o={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${n.expected}, \xE0m\u1ECD\u0300 a r\xED ${a}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${i}, \xE0m\u1ECD\u0300 a r\xED ${a}`}case"invalid_value":return n.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${A(n.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin??"iye"} ${s.verb} ${i}${n.maximum} ${s.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${n.maximum}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin} ${s.verb} ${i}${n.minimum} ${s.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${n.minimum}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${i.prefix}"`:i.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${i.suffix}"`:i.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${i.includes}"`:i.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${i.pattern}`:`A\u1E63\xEC\u1E63e: ${r[i.format]??n.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${n.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${w(n.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};function Kx(){return{localeError:nR()}}var Xx,im=Symbol("ZodOutput"),sm=Symbol("ZodInput"),Ba=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let o=r[0];return this._map.set(t,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let o={...this.get(r)??{}};delete o.id;let n={...o,...this._map.get(t)};return Object.keys(n).length?n:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function Ha(){return new Ba}(Xx=globalThis).__zod_globalRegistry??(Xx.__zod_globalRegistry=Ha());var De=globalThis.__zod_globalRegistry;function am(e,t){return new e({type:"string",...R(t)})}function cm(e,t){return new e({type:"string",coerce:!0,...R(t)})}function Za(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...R(t)})}function Bi(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...R(t)})}function Ga(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...R(t)})}function Wa(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...R(t)})}function Va(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...R(t)})}function qa(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...R(t)})}function Hi(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...R(t)})}function Ja(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...R(t)})}function Ka(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...R(t)})}function Xa(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...R(t)})}function Ya(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...R(t)})}function Qa(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...R(t)})}function ec(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...R(t)})}function tc(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...R(t)})}function nc(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...R(t)})}function rc(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...R(t)})}function lm(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...R(t)})}function oc(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...R(t)})}function ic(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...R(t)})}function sc(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...R(t)})}function ac(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...R(t)})}function cc(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...R(t)})}function lc(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...R(t)})}var um={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function dm(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...R(t)})}function pm(e,t){return new e({type:"string",format:"date",check:"string_format",...R(t)})}function mm(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...R(t)})}function fm(e,t){return new e({type:"string",format:"duration",check:"string_format",...R(t)})}function gm(e,t){return new e({type:"number",checks:[],...R(t)})}function hm(e,t){return new e({type:"number",coerce:!0,checks:[],...R(t)})}function vm(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...R(t)})}function ym(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...R(t)})}function bm(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...R(t)})}function xm(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...R(t)})}function km(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...R(t)})}function wm(e,t){return new e({type:"boolean",...R(t)})}function Sm(e,t){return new e({type:"boolean",coerce:!0,...R(t)})}function _m(e,t){return new e({type:"bigint",...R(t)})}function $m(e,t){return new e({type:"bigint",coerce:!0,...R(t)})}function Im(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...R(t)})}function Em(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...R(t)})}function Am(e,t){return new e({type:"symbol",...R(t)})}function Pm(e,t){return new e({type:"undefined",...R(t)})}function Cm(e,t){return new e({type:"null",...R(t)})}function Tm(e){return new e({type:"any"})}function Rm(e){return new e({type:"unknown"})}function Om(e,t){return new e({type:"never",...R(t)})}function Dm(e,t){return new e({type:"void",...R(t)})}function Nm(e,t){return new e({type:"date",...R(t)})}function Lm(e,t){return new e({type:"date",coerce:!0,...R(t)})}function Um(e,t){return new e({type:"nan",...R(t)})}function Mt(e,t){return new Aa({check:"less_than",...R(t),value:e,inclusive:!1})}function st(e,t){return new Aa({check:"less_than",...R(t),value:e,inclusive:!0})}function Bt(e,t){return new Pa({check:"greater_than",...R(t),value:e,inclusive:!1})}function We(e,t){return new Pa({check:"greater_than",...R(t),value:e,inclusive:!0})}function uc(e){return Bt(0,e)}function dc(e){return Mt(0,e)}function pc(e){return st(0,e)}function mc(e){return We(0,e)}function Hn(e,t){return new Cd({check:"multiple_of",...R(t),value:e})}function Zn(e,t){return new Od({check:"max_size",...R(t),maximum:e})}function Ht(e,t){return new Dd({check:"min_size",...R(t),minimum:e})}function vr(e,t){return new Nd({check:"size_equals",...R(t),size:e})}function yr(e,t){return new Ld({check:"max_length",...R(t),maximum:e})}function dn(e,t){return new Ud({check:"min_length",...R(t),minimum:e})}function br(e,t){return new jd({check:"length_equals",...R(t),length:e})}function fo(e,t){return new zd({check:"string_format",format:"regex",...R(t),pattern:e})}function go(e){return new Fd({check:"string_format",format:"lowercase",...R(e)})}function ho(e){return new Md({check:"string_format",format:"uppercase",...R(e)})}function vo(e,t){return new Bd({check:"string_format",format:"includes",...R(t),includes:e})}function yo(e,t){return new Hd({check:"string_format",format:"starts_with",...R(t),prefix:e})}function bo(e,t){return new Zd({check:"string_format",format:"ends_with",...R(t),suffix:e})}function fc(e,t,r){return new Gd({check:"property",property:e,schema:t,...R(r)})}function xo(e,t){return new Wd({check:"mime_type",mime:e,...R(t)})}function It(e){return new Vd({check:"overwrite",tx:e})}function ko(e){return It(t=>t.normalize(e))}function wo(){return It(e=>e.trim())}function So(){return It(e=>e.toLowerCase())}function _o(){return It(e=>e.toUpperCase())}function $o(){return It(e=>Hu(e))}function jm(e,t,r){return new e({type:"array",element:t,...R(r)})}function oR(e,t,r){return new e({type:"union",options:t,...R(r)})}function iR(e,t,r){return new e({type:"union",options:t,inclusive:!1,...R(r)})}function sR(e,t,r,o){return new e({type:"union",options:r,discriminator:t,...R(o)})}function aR(e,t,r){return new e({type:"intersection",left:t,right:r})}function cR(e,t,r,o){let n=r instanceof V,i=n?o:r,s=n?r:null;return new e({type:"tuple",items:t,rest:s,...R(i)})}function lR(e,t,r,o){return new e({type:"record",keyType:t,valueType:r,...R(o)})}function uR(e,t,r,o){return new e({type:"map",keyType:t,valueType:r,...R(o)})}function dR(e,t,r){return new e({type:"set",valueType:t,...R(r)})}function pR(e,t,r){let o=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new e({type:"enum",entries:o,...R(r)})}function mR(e,t,r){return new e({type:"enum",entries:t,...R(r)})}function fR(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...R(r)})}function zm(e,t){return new e({type:"file",...R(t)})}function gR(e,t){return new e({type:"transform",transform:t})}function hR(e,t){return new e({type:"optional",innerType:t})}function vR(e,t){return new e({type:"nullable",innerType:t})}function yR(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():Gu(r)}})}function bR(e,t,r){return new e({type:"nonoptional",innerType:t,...R(r)})}function xR(e,t){return new e({type:"success",innerType:t})}function kR(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:()=>r})}function wR(e,t,r){return new e({type:"pipe",in:t,out:r})}function SR(e,t){return new e({type:"readonly",innerType:t})}function _R(e,t,r){return new e({type:"template_literal",parts:t,...R(r)})}function $R(e,t){return new e({type:"lazy",getter:t})}function IR(e,t){return new e({type:"promise",innerType:t})}function Fm(e,t,r){let o=R(r);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:t,...o})}function Mm(e,t,r){return new e({type:"custom",check:"custom",fn:t,...R(r)})}function Bm(e,t){let r=Yx(o=>(o.addIssue=n=>{if(typeof n=="string")o.issues.push(so(n,o.value,r._zod.def));else{let i=n;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=o.value),i.inst??(i.inst=r),i.continue??(i.continue=!r._zod.def.abort),o.issues.push(so(i))}},e(o.value,o)),t);return r}function Yx(e,t){let r=new ye({check:"custom",...R(t)});return r._zod.check=e,r}function Hm(e){let t=new ye({check:"describe"});return t._zod.onattach=[r=>{let o=De.get(r)??{};De.add(r,{...o,description:e})}],t._zod.check=()=>{},t}function Zm(e){let t=new ye({check:"meta"});return t._zod.onattach=[r=>{let o=De.get(r)??{};De.add(r,{...o,...e})}],t._zod.check=()=>{},t}function Gm(e,t){let r=R(t),o=r.truthy??["true","1","yes","on","y","enabled"],n=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(o=o.map(f=>typeof f=="string"?f.toLowerCase():f),n=n.map(f=>typeof f=="string"?f.toLowerCase():f));let i=new Set(o),s=new Set(n),a=e.Codec??zi,l=e.Boolean??Ui,u=e.String??hr,d=new u({type:"string",error:r.error}),p=new l({type:"boolean",error:r.error}),m=new a({type:"pipe",in:d,out:p,transform:((f,g)=>{let h=f;return r.case!=="sensitive"&&(h=h.toLowerCase()),i.has(h)?!0:s.has(h)?!1:(g.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...s],input:g.value,inst:m,continue:!1}),{})}),reverseTransform:((f,g)=>f===!0?o[0]||"true":n[0]||"false"),error:r.error});return m}function Io(e,t,r,o={}){let n=R(o),i={...R(o),check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:a=>r.test(a),...n};return r instanceof RegExp&&(i.pattern=r),new e(i)}function Gn(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??De,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function pe(e,t,r={path:[],schemaPath:[]}){var o;let n=e._zod.def,i=t.seen.get(e);if(i)return i.count++,r.schemaPath.includes(e)&&(i.cycle=r.path),i.schema;let s={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,s);let a=e._zod.toJSONSchema?.();if(a)s.schema=a;else{let d={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,d);else{let m=s.schema,f=t.processors[n.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);f(e,t,m,d)}let p=e._zod.parent;p&&(s.ref||(s.ref=p),pe(p,t,d),t.seen.get(p).isParent=!0)}let l=t.metadataRegistry.get(e);return l&&Object.assign(s.schema,l),t.io==="input"&&Ve(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&"_prefault"in s.schema&&((o=s.schema).default??(o.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function Wn(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=new Map;for(let s of e.seen.entries()){let a=e.metadataRegistry.get(s[0])?.id;if(a){let l=o.get(a);if(l&&l!==s[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(a,s[0])}}let n=s=>{let a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let p=e.external.registry.get(s[0])?.id,m=e.external.uri??(g=>g);if(p)return{ref:m(p)};let f=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=f,{defId:f,ref:`${m("__shared")}#/${a}/${f}`}}if(s[1]===r)return{ref:"#"};let u=`#/${a}/`,d=s[1].schema.id??`__schema${e.counter++}`;return{defId:d,ref:u+d}},i=s=>{if(s[1].schema.$ref)return;let a=s[1],{ref:l,defId:u}=n(s);a.def={...a.schema},u&&(a.defId=u);let d=a.schema;for(let p in d)delete d[p];d.$ref=l};if(e.cycles==="throw")for(let s of e.seen.entries()){let a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
244
|
+
`)}f.write("payload.value = newResult;"),f.write("return payload;");let S=f.compile();return(I,_)=>S(m,I,_)},i,s=hr,a=!gr.jitless,u=a&&od.value,p=t.catchall,d;e._zod.parse=(m,f)=>{d??(d=o.value);let g=m.value;return s(g)?a&&u&&f?.async===!1&&f.jitless!==!0?(i||(i=n(t.shape)),m=i(m,f),p?gx([],g,m,f,d,e):m):r(m,f):(m.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),m)}});function Qy(e,t,r,o){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let n=e.filter(i=>!Zn(i));return n.length===1?(t.value=n[0].value,n[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(s=>Ge(s,o,Ie())))}),t)}var Mi=y("$ZodUnion",(e,t)=>{J.init(e,t),te(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),te(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),te(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),te(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){let o=t.options.map(n=>n._zod.pattern);return new RegExp(`^(${o.map(n=>Pi(n.source)).join("|")})$`)}});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let i=!1,s=[];for(let a of t.options){let l=a._zod.run({value:o.value,issues:[]},n);if(l instanceof Promise)s.push(l),i=!0;else{if(l.issues.length===0)return l;s.push(l)}}return i?Promise.all(s).then(a=>Qy(a,o,e,n)):Qy(s,o,e,n)}});function ex(e,t,r,o){let n=e.filter(i=>i.issues.length===0);return n.length===1?(t.value=n[0].value,t):(n.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(s=>Ge(s,o,Ie())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t)}var Jp=y("$ZodXor",(e,t)=>{Mi.init(e,t),t.inclusive=!1;let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let i=!1,s=[];for(let a of t.options){let l=a._zod.run({value:o.value,issues:[]},n);l instanceof Promise?(s.push(l),i=!0):s.push(l)}return i?Promise.all(s).then(a=>ex(a,o,e,n)):ex(s,o,e,n)}}),qp=y("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Mi.init(e,t);let r=e._zod.parse;te(e._zod,"propValues",()=>{let n={};for(let i of t.options){let s=i._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[a,l]of Object.entries(s)){n[a]||(n[a]=new Set);for(let u of l)n[a].add(u)}}return n});let o=co(()=>{let n=t.options,i=new Map;for(let s of n){let a=s._zod.propValues?.[t.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let l of a){if(i.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);i.set(l,s)}}return i});e._zod.parse=(n,i)=>{let s=n.value;if(!hr(s))return n.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),n;let a=o.value.get(s?.[t.discriminator]);return a?a._zod.run(n,i):t.unionFallback||i.direction==="backward"?r(n,i):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(o.value.keys()),input:s,path:[t.discriminator],inst:e}),n)}}),Kp=y("$ZodIntersection",(e,t)=>{J.init(e,t),e._zod.parse=(r,o)=>{let n=r.value,i=t.left._zod.run({value:n,issues:[]},o),s=t.right._zod.run({value:n,issues:[]},o);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([l,u])=>tx(r,l,u)):tx(r,i,s)}});function lp(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Hn(e)&&Hn(t)){let r=Object.keys(t),o=Object.keys(e).filter(i=>r.indexOf(i)!==-1),n={...e,...t};for(let i of o){let s=lp(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};n[i]=s.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let o=0;o<e.length;o++){let n=e[o],i=t[o],s=lp(n,i);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function tx(e,t,r){let o=new Map,n;for(let a of t.issues)if(a.code==="unrecognized_keys"){n??(n=a);for(let l of a.keys)o.has(l)||o.set(l,{}),o.get(l).l=!0}else e.issues.push(a);for(let a of r.issues)if(a.code==="unrecognized_keys")for(let l of a.keys)o.has(l)||o.set(l,{}),o.get(l).r=!0;else e.issues.push(a);let i=[...o].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(i.length&&n&&e.issues.push({...n,keys:i}),Zn(e))return e;let s=lp(t.value,r.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}var Za=y("$ZodTuple",(e,t)=>{J.init(e,t);let r=t.items;e._zod.parse=(o,n)=>{let i=o.value;if(!Array.isArray(i))return o.issues.push({input:i,inst:e,expected:"tuple",code:"invalid_type"}),o;o.value=[];let s=[],a=nx(r,"optin"),l=nx(r,"optout");if(!t.rest){if(i.length<a)return o.issues.push({code:"too_small",minimum:a,inclusive:!0,input:i,inst:e,origin:"array"}),o;i.length>r.length&&o.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:i,inst:e,origin:"array"})}let u=new Array(r.length);for(let p=0;p<r.length;p++){let d=r[p]._zod.run({value:i[p],issues:[]},n);d instanceof Promise?s.push(d.then(m=>{u[p]=m})):u[p]=d}if(t.rest){let p=r.length-1,d=i.slice(r.length);for(let m of d){p++;let f=t.rest._zod.run({value:m,issues:[]},n);f instanceof Promise?s.push(f.then(g=>rx(g,o,p))):rx(f,o,p)}}return s.length?Promise.all(s).then(()=>ox(u,o,r,i,l)):ox(u,o,r,i,l)}});function nx(e,t){for(let r=e.length-1;r>=0;r--)if(e[r]._zod[t]!=="optional")return r+1;return 0}function rx(e,t,r){e.issues.length&&t.issues.push(...et(r,e.issues)),t.value[r]=e.value}function ox(e,t,r,o,n){for(let i=0;i<r.length;i++){let s=e[i],a=i<o.length;if(s.issues.length){if(!a&&i>=n){t.value.length=i;break}t.issues.push(...et(i,s.issues))}t.value[i]=s.value}for(let i=t.value.length-1;i>=o.length&&(r[i]._zod.optout==="optional"&&t.value[i]===void 0);i--)t.value.length=i;return t}var Xp=y("$ZodRecord",(e,t)=>{J.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!Hn(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),r;let i=[],s=t.keyType._zod.values;if(s){r.value={};let a=new Set;for(let u of s)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){a.add(typeof u=="number"?u.toString():u);let p=t.keyType._zod.run({value:u,issues:[]},o);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(p.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:p.issues.map(f=>Ge(f,o,Ie())),input:u,path:[u],inst:e});continue}let d=p.value,m=t.valueType._zod.run({value:n[u],issues:[]},o);m instanceof Promise?i.push(m.then(f=>{f.issues.length&&r.issues.push(...et(u,f.issues)),r.value[d]=f.value})):(m.issues.length&&r.issues.push(...et(u,m.issues)),r.value[d]=m.value)}let l;for(let u in n)a.has(u)||(l=l??[],l.push(u));l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:l})}else{r.value={};for(let a of Reflect.ownKeys(n)){if(a==="__proto__"||!Object.prototype.propertyIsEnumerable.call(n,a))continue;let l=t.keyType._zod.run({value:a,issues:[]},o);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&Na.test(a)&&l.issues.length){let d=t.keyType._zod.run({value:Number(a),issues:[]},o);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(l=d)}if(l.issues.length){t.mode==="loose"?r.value[a]=n[a]:r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(d=>Ge(d,o,Ie())),input:a,path:[a],inst:e});continue}let p=t.valueType._zod.run({value:n[a],issues:[]},o);p instanceof Promise?i.push(p.then(d=>{d.issues.length&&r.issues.push(...et(a,d.issues)),r.value[l.value]=d.value})):(p.issues.length&&r.issues.push(...et(a,p.issues)),r.value[l.value]=p.value)}}return i.length?Promise.all(i).then(()=>r):r}}),Yp=y("$ZodMap",(e,t)=>{J.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!(n instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:n,inst:e}),r;let i=[];r.value=new Map;for(let[s,a]of n){let l=t.keyType._zod.run({value:s,issues:[]},o),u=t.valueType._zod.run({value:a,issues:[]},o);l instanceof Promise||u instanceof Promise?i.push(Promise.all([l,u]).then(([p,d])=>{ix(p,d,r,s,n,e,o)})):ix(l,u,r,s,n,e,o)}return i.length?Promise.all(i).then(()=>r):r}});function ix(e,t,r,o,n,i,s){e.issues.length&&(Ti.has(typeof o)?r.issues.push(...et(o,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:n,inst:i,issues:e.issues.map(a=>Ge(a,s,Ie()))})),t.issues.length&&(Ti.has(typeof o)?r.issues.push(...et(o,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:i,key:o,issues:t.issues.map(a=>Ge(a,s,Ie()))})),r.value.set(e.value,t.value)}var Qp=y("$ZodSet",(e,t)=>{J.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!(n instanceof Set))return r.issues.push({input:n,inst:e,expected:"set",code:"invalid_type"}),r;let i=[];r.value=new Set;for(let s of n){let a=t.valueType._zod.run({value:s,issues:[]},o);a instanceof Promise?i.push(a.then(l=>sx(l,r))):sx(a,r)}return i.length?Promise.all(i).then(()=>r):r}});function sx(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}var em=y("$ZodEnum",(e,t)=>{J.init(e,t);let r=Ci(t.entries),o=new Set(r);e._zod.values=o,e._zod.pattern=new RegExp(`^(${r.filter(n=>Ti.has(typeof n)).map(n=>typeof n=="string"?ht(n):n.toString()).join("|")})$`),e._zod.parse=(n,i)=>{let s=n.value;return o.has(s)||n.issues.push({code:"invalid_value",values:r,input:s,inst:e}),n}}),tm=y("$ZodLiteral",(e,t)=>{if(J.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(o=>typeof o=="string"?ht(o):o?ht(o.toString()):String(o)).join("|")})$`),e._zod.parse=(o,n)=>{let i=o.value;return r.has(i)||o.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),o}}),nm=y("$ZodFile",(e,t)=>{J.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return n instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:n,inst:e}),r}}),rm=y("$ZodTransform",(e,t)=>{J.init(e,t),e._zod.optin="optional",e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Fn(e.constructor.name);let n=t.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then(s=>(r.value=s,r.fallback=!0,r));if(n instanceof Promise)throw new It;return r.value=n,r.fallback=!0,r}});function ax(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var Ga=y("$ZodOptional",(e,t)=>{J.init(e,t),e._zod.optin="optional",e._zod.optout="optional",te(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),te(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Pi(r.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(t.innerType._zod.optin==="optional"){let n=r.value,i=t.innerType._zod.run(r,o);return i instanceof Promise?i.then(s=>ax(s,n)):ax(i,n)}return r.value===void 0?r:t.innerType._zod.run(r,o)}}),om=y("$ZodExactOptional",(e,t)=>{Ga.init(e,t),te(e._zod,"values",()=>t.innerType._zod.values),te(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),im=y("$ZodNullable",(e,t)=>{J.init(e,t),te(e._zod,"optin",()=>t.innerType._zod.optin),te(e._zod,"optout",()=>t.innerType._zod.optout),te(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Pi(r.source)}|null)$`):void 0}),te(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>r.value===null?r:t.innerType._zod.run(r,o)}),sm=y("$ZodDefault",(e,t)=>{J.init(e,t),e._zod.optin="optional",te(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)return r.value=t.defaultValue,r;let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>cx(i,t)):cx(n,t)}});function cx(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var am=y("$ZodPrefault",(e,t)=>{J.init(e,t),e._zod.optin="optional",te(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>(o.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,o))}),cm=y("$ZodNonOptional",(e,t)=>{J.init(e,t),te(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,o)=>{let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>lx(i,e)):lx(n,e)}});function lx(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var lm=y("$ZodSuccess",(e,t)=>{J.init(e,t),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Fn("ZodSuccess");let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>(r.value=i.issues.length===0,r)):(r.value=n.issues.length===0,r)}}),um=y("$ZodCatch",(e,t)=>{J.init(e,t),e._zod.optin="optional",te(e._zod,"optout",()=>t.innerType._zod.optout),te(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>(r.value=i.value,i.issues.length&&(r.value=t.catchValue({...r,error:{issues:i.issues.map(s=>Ge(s,o,Ie()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=n.value,n.issues.length&&(r.value=t.catchValue({...r,error:{issues:n.issues.map(i=>Ge(i,o,Ie()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),dm=y("$ZodNaN",(e,t)=>{J.init(e,t),e._zod.parse=(r,o)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r)}),Wa=y("$ZodPipe",(e,t)=>{J.init(e,t),te(e._zod,"values",()=>t.in._zod.values),te(e._zod,"optin",()=>t.in._zod.optin),te(e._zod,"optout",()=>t.out._zod.optout),te(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){let i=t.out._zod.run(r,o);return i instanceof Promise?i.then(s=>ja(s,t.in,o)):ja(i,t.in,o)}let n=t.in._zod.run(r,o);return n instanceof Promise?n.then(i=>ja(i,t.out,o)):ja(n,t.out,o)}});function ja(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}var Bi=y("$ZodCodec",(e,t)=>{J.init(e,t),te(e._zod,"values",()=>t.in._zod.values),te(e._zod,"optin",()=>t.in._zod.optin),te(e._zod,"optout",()=>t.out._zod.optout),te(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if((o.direction||"forward")==="forward"){let i=t.in._zod.run(r,o);return i instanceof Promise?i.then(s=>za(s,t,o)):za(i,t,o)}else{let i=t.out._zod.run(r,o);return i instanceof Promise?i.then(s=>za(s,t,o)):za(i,t,o)}}});function za(e,t,r){if(e.issues.length)return e.aborted=!0,e;if((r.direction||"forward")==="forward"){let n=t.transform(e.value,e);return n instanceof Promise?n.then(i=>Fa(e,i,t.out,r)):Fa(e,n,t.out,r)}else{let n=t.reverseTransform(e.value,e);return n instanceof Promise?n.then(i=>Fa(e,i,t.in,r)):Fa(e,n,t.in,r)}}function Fa(e,t,r,o){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},o)}var pm=y("$ZodPreprocess",(e,t)=>{Wa.init(e,t)}),mm=y("$ZodReadonly",(e,t)=>{J.init(e,t),te(e._zod,"propValues",()=>t.innerType._zod.propValues),te(e._zod,"values",()=>t.innerType._zod.values),te(e._zod,"optin",()=>t.innerType?._zod?.optin),te(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(ux):ux(n)}});function ux(e){return e.value=Object.freeze(e.value),e}var fm=y("$ZodTemplateLiteral",(e,t)=>{J.init(e,t);let r=[];for(let o of t.parts)if(typeof o=="object"&&o!==null){if(!o._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...o._zod.traits].shift()}`);let n=o._zod.pattern instanceof RegExp?o._zod.pattern.source:o._zod.pattern;if(!n)throw new Error(`Invalid template literal part: ${o._zod.traits}`);let i=n.startsWith("^")?1:0,s=n.endsWith("$")?n.length-1:n.length;r.push(n.slice(i,s))}else if(o===null||sd.has(typeof o))r.push(ht(`${o}`));else throw new Error(`Invalid template literal part: ${o}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(o,n)=>typeof o.value!="string"?(o.issues.push({input:o.value,inst:e,expected:"string",code:"invalid_type"}),o):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(o.value)||o.issues.push({input:o.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),o)}),gm=y("$ZodFunction",(e,t)=>(J.init(e,t),e._def=t,e._zod.def=t,e.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...o){let n=e._def.input?_a(e._def.input,o):o,i=Reflect.apply(r,this,n);return e._def.output?_a(e._def.output,i):i}},e.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...o){let n=e._def.input?await $a(e._def.input,o):o,i=await Reflect.apply(r,this,n);return e._def.output?await $a(e._def.output,i):i}},e._zod.parse=(r,o)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:e}),r):(e._def.output&&e._def.output._zod.def.type==="promise"?r.value=e.implementAsync(r.value):r.value=e.implement(r.value),r),e.input=(...r)=>{let o=e.constructor;return Array.isArray(r[0])?new o({type:"function",input:new Za({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output}):new o({type:"function",input:r[0],output:e._def.output})},e.output=r=>{let o=e.constructor;return new o({type:"function",input:e._def.input,output:r})},e)),hm=y("$ZodPromise",(e,t)=>{J.init(e,t),e._zod.parse=(r,o)=>Promise.resolve(r.value).then(n=>t.innerType._zod.run({value:n,issues:[]},o))}),vm=y("$ZodLazy",(e,t)=>{J.init(e,t),te(e._zod,"innerType",()=>{let r=t;return r._cachedInner||(r._cachedInner=t.getter()),r._cachedInner}),te(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),te(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),te(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),te(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,o)=>e._zod.innerType._zod.run(r,o)}),bm=y("$ZodCustom",(e,t)=>{be.init(e,t),J.init(e,t),e._zod.parse=(r,o)=>r,e._zod.check=r=>{let o=r.value,n=t.fn(o);if(n instanceof Promise)return n.then(i=>dx(i,r,o,e));dx(n,r,o,e)}});function dx(e,t,r,o){if(!e){let n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(n.params=o._zod.def.params),t.issues.push(lo(n))}}var Zi={};rn(Zi,{ar:()=>vx,az:()=>bx,be:()=>xx,bg:()=>kx,ca:()=>wx,cs:()=>Sx,da:()=>_x,de:()=>$x,el:()=>Ix,en:()=>Va,eo:()=>Ex,es:()=>Ax,fa:()=>Cx,fi:()=>Px,fr:()=>Tx,frCA:()=>Rx,he:()=>Ox,hr:()=>Dx,hu:()=>Nx,hy:()=>Ux,id:()=>jx,is:()=>zx,it:()=>Fx,ja:()=>Mx,ka:()=>Bx,kh:()=>Hx,km:()=>Ja,ko:()=>Zx,lt:()=>Wx,mk:()=>Vx,ms:()=>Jx,nl:()=>qx,no:()=>Kx,ota:()=>Xx,pl:()=>Qx,ps:()=>Yx,pt:()=>ek,ro:()=>tk,ru:()=>rk,sl:()=>ok,sv:()=>ik,ta:()=>sk,th:()=>ak,tr:()=>ck,ua:()=>lk,uk:()=>qa,ur:()=>uk,uz:()=>dk,vi:()=>pk,yo:()=>gk,zhCN:()=>mk,zhTW:()=>fk});var BT=()=>{let e={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function t(n){return e[n]??null}let r={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${n.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${i}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`}case"invalid_value":return n.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${A(n.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${n.minimum.toString()} ${s.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${n.prefix}"`:i.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${i.suffix}"`:i.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${i.includes}"`:i.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${i.pattern}`:`${r[i.format]??n.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${n.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${n.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${n.keys.length>1?"\u0629":""}: ${w(n.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function vx(){return{localeError:BT()}}var HT=()=>{let e={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function t(n){return e[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${n.expected}, daxil olan ${a}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${i}, daxil olan ${a}`}case"invalid_value":return n.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${A(n.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${i}${n.maximum.toString()} ${s.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${i}${n.minimum.toString()} ${s.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${i.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:i.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${i.suffix}" il\u0259 bitm\u0259lidir`:i.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${i.includes}" daxil olmal\u0131d\u0131r`:i.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${i.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[i.format]??n.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${n.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${n.keys.length>1?"lar":""}: ${w(n.keys,", ")}`;case"invalid_key":return`${n.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${n.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};function bx(){return{localeError:HT()}}function yx(e,t,r,o){let n=Math.abs(e),i=n%10,s=n%100;return s>=11&&s<=19?o:i===1?t:i>=2&&i<=4?r:o}var ZT=()=>{let e={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function t(n){return e[n]??null}let r={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},o={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${n.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${i}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`}case"invalid_value":return n.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${A(n.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s){let a=Number(n.maximum),l=yx(a,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${i}${n.maximum.toString()} ${l}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s){let a=Number(n.minimum),l=yx(a,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${i}${n.minimum.toString()} ${l}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${n.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${w(n.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${n.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function xx(){return{localeError:ZT()}}var GT=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${A(n.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${n.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${n.minimum.toString()} ${s.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${i.prefix}"`;if(i.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${i.suffix}"`;if(i.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${i.includes}"`;if(i.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${i.pattern}`;let s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return i.format==="emoji"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="datetime"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="date"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),i.format==="time"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="duration"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${s} ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${n.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u043E\u0432\u0435":""}: ${w(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}};function kx(){return{localeError:GT()}}var WT=()=>{let e={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(n){return e[n]??null}let r={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${n.expected}, s'ha rebut ${a}`:`Tipus inv\xE0lid: s'esperava ${i}, s'ha rebut ${a}`}case"invalid_value":return n.values.length===1?`Valor inv\xE0lid: s'esperava ${A(n.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${w(n.values," o ")}`;case"too_big":{let i=n.inclusive?"com a m\xE0xim":"menys de",s=t(n.origin);return s?`Massa gran: s'esperava que ${n.origin??"el valor"} contingu\xE9s ${i} ${n.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"com a m\xEDnim":"m\xE9s de",s=t(n.origin);return s?`Massa petit: s'esperava que ${n.origin} contingu\xE9s ${i} ${n.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${i.prefix}"`:i.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${i.suffix}"`:i.format==="includes"?`Format inv\xE0lid: ha d'incloure "${i.includes}"`:i.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${i.pattern}`:`Format inv\xE0lid per a ${r[i.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${w(n.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${n.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${n.origin}`;default:return"Entrada inv\xE0lida"}}};function wx(){return{localeError:WT()}}var VT=()=>{let e={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function t(n){return e[n]??null}let r={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},o={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${n.expected}, obdr\u017Eeno ${a}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${i}, obdr\u017Eeno ${a}`}case"invalid_value":return n.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${A(n.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${i}${n.maximum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${i}${n.minimum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${i.prefix}"`:i.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${i.suffix}"`:i.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${i.includes}"`:i.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${i.pattern}`:`Neplatn\xFD form\xE1t ${r[i.format]??n.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${n.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${w(n.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${n.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${n.origin}`;default:return"Neplatn\xFD vstup"}}};function Sx(){return{localeError:VT()}}var JT=()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function t(n){return e[n]??null}let r={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},o={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Ugyldigt input: forventede instanceof ${n.expected}, fik ${a}`:`Ugyldigt input: forventede ${i}, fik ${a}`}case"invalid_value":return n.values.length===1?`Ugyldig v\xE6rdi: forventede ${A(n.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin),a=o[n.origin]??n.origin;return s?`For stor: forventede ${a??"value"} ${s.verb} ${i} ${n.maximum.toString()} ${s.unit??"elementer"}`:`For stor: forventede ${a??"value"} havde ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin),a=o[n.origin]??n.origin;return s?`For lille: forventede ${a} ${s.verb} ${i} ${n.minimum.toString()} ${s.unit}`:`For lille: forventede ${a} havde ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ugyldig streng: skal starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: skal ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: skal indeholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${r[i.format]??n.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${w(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${n.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${n.origin}`;default:return"Ugyldigt input"}}};function _x(){return{localeError:JT()}}var qT=()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(n){return e[n]??null}let r={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},o={nan:"NaN",number:"Zahl",array:"Array"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${n.expected}, erhalten ${a}`:`Ung\xFCltige Eingabe: erwartet ${i}, erhalten ${a}`}case"invalid_value":return n.values.length===1?`Ung\xFCltige Eingabe: erwartet ${A(n.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${i}${n.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${i}${n.maximum.toString()} ist`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Zu klein: erwartet, dass ${n.origin} ${i}${n.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${i}${n.minimum.toString()} ist`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ung\xFCltiger String: muss mit "${i.prefix}" beginnen`:i.format==="ends_with"?`Ung\xFCltiger String: muss mit "${i.suffix}" enden`:i.format==="includes"?`Ung\xFCltiger String: muss "${i.includes}" enthalten`:i.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${i.pattern} entsprechen`:`Ung\xFCltig: ${r[i.format]??n.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${w(n.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${n.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${n.origin}`;default:return"Ung\xFCltige Eingabe"}}};function $x(){return{localeError:qT()}}var KT=()=>{let e={string:{unit:"\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},file:{unit:"bytes",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},array:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},set:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},map:{unit:"\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"}};function t(n){return e[n]??null}let r={regex:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",email:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",date:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",time:"ISO \u03CE\u03C1\u03B1",duration:"ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",ipv4:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",ipv6:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",mac:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",cidrv4:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",cidrv6:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",base64:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",base64url:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",json_string:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",e164:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return typeof n.expected=="string"&&/^[A-Z]/.test(n.expected)?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${n.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${a}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${i}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${a}`}case"invalid_value":return n.values.length===1?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${A(n.values[0])}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${i}${n.maximum.toString()} ${s.unit??"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${i}${n.minimum.toString()} ${s.unit}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${i.prefix}"`:i.format==="ends_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${i.suffix}"`:i.format==="includes"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${i.includes}"`:i.format==="regex"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${i.pattern}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${r[i.format]??n.format}`}case"not_multiple_of":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${n.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${n.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${n.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${w(n.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${n.origin}`;case"invalid_union":return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";case"invalid_element":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${n.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}};function Ix(){return{localeError:KT()}}var XT=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(n){return e[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return`Invalid input: expected ${i}, received ${a}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${A(n.values[0])}`:`Invalid option: expected one of ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Too big: expected ${n.origin??"value"} to have ${i}${n.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Too small: expected ${n.origin} to have ${i}${n.minimum.toString()} ${s.unit}`:`Too small: expected ${n.origin} to be ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Invalid string: must start with "${i.prefix}"`:i.format==="ends_with"?`Invalid string: must end with "${i.suffix}"`:i.format==="includes"?`Invalid string: must include "${i.includes}"`:i.format==="regex"?`Invalid string: must match pattern ${i.pattern}`:`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${w(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`Invalid discriminator value. Expected ${n.options.map(s=>`'${s}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}};function Va(){return{localeError:XT()}}var YT=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(n){return e[n]??null}let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},o={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${n.expected}, ricevi\u011Dis ${a}`:`Nevalida enigo: atendi\u011Dis ${i}, ricevi\u011Dis ${a}`}case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${A(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${i}${n.minimum.toString()} ${s.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${i.prefix}"`:i.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${i.suffix}"`:i.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${i.includes}"`:i.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${i.pattern}`:`Nevalida ${r[i.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} \u015Dlosilo${n.keys.length>1?"j":""}: ${w(n.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}};function Ex(){return{localeError:YT()}}var QT=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(n){return e[n]??null}let r={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${n.expected}, recibido ${a}`:`Entrada inv\xE1lida: se esperaba ${i}, recibido ${a}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: se esperaba ${A(n.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin),a=o[n.origin]??n.origin;return s?`Demasiado grande: se esperaba que ${a??"valor"} tuviera ${i}${n.maximum.toString()} ${s.unit??"elementos"}`:`Demasiado grande: se esperaba que ${a??"valor"} fuera ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin),a=o[n.origin]??n.origin;return s?`Demasiado peque\xF1o: se esperaba que ${a} tuviera ${i}${n.minimum.toString()} ${s.unit}`:`Demasiado peque\xF1o: se esperaba que ${a} fuera ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${i.prefix}"`:i.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${i.suffix}"`:i.format==="includes"?`Cadena inv\xE1lida: debe incluir "${i.includes}"`:i.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${i.pattern}`:`Inv\xE1lido ${r[i.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${w(n.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${o[n.origin]??n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${o[n.origin]??n.origin}`;default:return"Entrada inv\xE1lida"}}};function Ax(){return{localeError:QT()}}var eR=()=>{let e={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function t(n){return e[n]??null}let r={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${n.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${i} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return n.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${A(n.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${w(n.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} ${s.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:i.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:i.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${i.includes}" \u0628\u0627\u0634\u062F`:i.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${i.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[i.format]??n.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${n.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${n.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${w(n.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${n.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${n.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function Cx(){return{localeError:eR()}}var tR=()=>{let e={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function t(n){return e[n]??null}let r={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${a}`:`Virheellinen tyyppi: odotettiin ${i}, oli ${a}`}case"invalid_value":return n.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${A(n.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Liian suuri: ${s.subject} t\xE4ytyy olla ${i}${n.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Liian pieni: ${s.subject} t\xE4ytyy olla ${i}${n.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${i.prefix}"`:i.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${i.suffix}"`:i.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${i.includes}"`:i.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${i.pattern}`:`Virheellinen ${r[i.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${w(n.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}};function Px(){return{localeError:tR()}}var nR=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(n){return e[n]??null}let r={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},o={string:"cha\xEEne",number:"nombre",int:"entier",boolean:"bool\xE9en",bigint:"grand entier",symbol:"symbole",undefined:"ind\xE9fini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : instanceof ${n.expected} attendu, ${a} re\xE7u`:`Entr\xE9e invalide : ${i} attendu, ${a} re\xE7u`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : ${A(n.values[0])} attendu`:`Option invalide : une valeur parmi ${w(n.values,"|")} attendue`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Trop grand : ${o[n.origin]??"valeur"} doit ${s.verb} ${i}${n.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${o[n.origin]??"valeur"} doit \xEAtre ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Trop petit : ${o[n.origin]??"valeur"} doit ${s.verb} ${i}${n.minimum.toString()} ${s.unit}`:`Trop petit : ${o[n.origin]??"valeur"} doit \xEAtre ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${i.pattern}`:`${r[i.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${w(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}};function Tx(){return{localeError:nR()}}var rR=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(n){return e[n]??null}let r={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : attendu instanceof ${n.expected}, re\xE7u ${a}`:`Entr\xE9e invalide : attendu ${i}, re\xE7u ${a}`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : attendu ${A(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"\u2264":"<",s=t(n.origin);return s?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${i}${n.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"\u2265":">",s=t(n.origin);return s?`Trop petit : attendu que ${n.origin} ait ${i}${n.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${n.origin} soit ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${i.pattern}`:`${r[i.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${w(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}};function Rx(){return{localeError:rR()}}var oR=()=>{let e={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},t={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},r=u=>u?e[u]:void 0,o=u=>{let p=r(u);return p?p.label:u??e.unknown.label},n=u=>`\u05D4${o(u)}`,i=u=>(r(u)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",s=u=>u?t[u]??null:null,a={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},l={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let p=u.expected,d=l[p??""]??o(p),m=P(u.input),f=l[m]??e[m]?.label??m;return/^[A-Z]/.test(u.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${u.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${d}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`}case"invalid_value":{if(u.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${A(u.values[0])}`;let p=u.values.map(f=>A(f));if(u.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${p[0]} \u05D0\u05D5 ${p[1]}`;let d=p[p.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${p.slice(0,-1).join(", ")} \u05D0\u05D5 ${d}`}case"too_big":{let p=s(u.origin),d=n(u.origin??"value");if(u.origin==="string")return`${p?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${u.maximum.toString()} ${p?.unit??""} ${u.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(u.origin==="number"){let g=u.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${u.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${u.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${g}`}if(u.origin==="array"||u.origin==="set"){let g=u.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",h=u.inclusive?`${u.maximum} ${p?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${u.maximum} ${p?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${h}`.trim()}let m=u.inclusive?"<=":"<",f=i(u.origin??"value");return p?.unit?`${p.longLabel} \u05DE\u05D3\u05D9: ${d} ${f} ${m}${u.maximum.toString()} ${p.unit}`:`${p?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${d} ${f} ${m}${u.maximum.toString()}`}case"too_small":{let p=s(u.origin),d=n(u.origin??"value");if(u.origin==="string")return`${p?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${u.minimum.toString()} ${p?.unit??""} ${u.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(u.origin==="number"){let g=u.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${u.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${u.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${g}`}if(u.origin==="array"||u.origin==="set"){let g=u.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(u.minimum===1&&u.inclusive){let v=(u.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${v}`}let h=u.inclusive?`${u.minimum} ${p?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${u.minimum} ${p?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${h}`.trim()}let m=u.inclusive?">=":">",f=i(u.origin??"value");return p?.unit?`${p.shortLabel} \u05DE\u05D3\u05D9: ${d} ${f} ${m}${u.minimum.toString()} ${p.unit}`:`${p?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${d} ${f} ${m}${u.minimum.toString()}`}case"invalid_format":{let p=u;if(p.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${p.prefix}"`;if(p.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${p.suffix}"`;if(p.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${p.includes}"`;if(p.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${p.pattern}`;let d=a[p.format],m=d?.label??p.format,g=(d?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${m} \u05DC\u05D0 ${g}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${u.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${u.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${u.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${w(u.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${n(u.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function Ox(){return{localeError:oR()}}var iR=()=>{let e={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function t(n){return e[n]??null}let r={regex:"unos",email:"email adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},o={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${n.expected}, a primljeno je ${a}`:`Neispravan unos: o\u010Dekuje se ${i}, a primljeno je ${a}`}case"invalid_value":return n.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${A(n.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin),a=o[n.origin]??n.origin;return s?`Preveliko: o\u010Dekivano da ${a??"vrijednost"} ima ${i}${n.maximum.toString()} ${s.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${a??"vrijednost"} bude ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin),a=o[n.origin]??n.origin;return s?`Premalo: o\u010Dekivano da ${a} ima ${i}${n.minimum.toString()} ${s.unit}`:`Premalo: o\u010Dekivano da ${a} bude ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neispravan tekst: mora zapo\u010Dinjati s "${i.prefix}"`:i.format==="ends_with"?`Neispravan tekst: mora zavr\u0161avati s "${i.suffix}"`:i.format==="includes"?`Neispravan tekst: mora sadr\u017Eavati "${i.includes}"`:i.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${i.pattern}`:`Neispravna ${r[i.format]??n.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${n.divisor}`;case"unrecognized_keys":return`Neprepoznat${n.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${w(n.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${o[n.origin]??n.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${o[n.origin]??n.origin}`;default:return"Neispravan unos"}}};function Dx(){return{localeError:iR()}}var sR=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(n){return e[n]??null}let r={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},o={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${n.expected}, a kapott \xE9rt\xE9k ${a}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${i}, a kapott \xE9rt\xE9k ${a}`}case"invalid_value":return n.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${A(n.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`T\xFAl nagy: ${n.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${i}${n.maximum.toString()} ${s.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${n.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} m\xE9rete t\xFAl kicsi ${i}${n.minimum.toString()} ${s.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} t\xFAl kicsi ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\xC9rv\xE9nytelen string: "${i.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:i.format==="ends_with"?`\xC9rv\xE9nytelen string: "${i.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:i.format==="includes"?`\xC9rv\xE9nytelen string: "${i.includes}" \xE9rt\xE9ket kell tartalmaznia`:i.format==="regex"?`\xC9rv\xE9nytelen string: ${i.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[i.format]??n.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${n.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${w(n.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${n.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${n.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};function Nx(){return{localeError:sR()}}function Lx(e,t,r){return Math.abs(e)===1?t:r}function ho(e){if(!e)return"";let t=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=e[e.length-1];return e+(t.includes(r)?"\u0576":"\u0568")}var aR=()=>{let e={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function t(n){return e[n]??null}let r={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},o={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${n.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${i}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`}case"invalid_value":return n.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${A(n.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s){let a=Number(n.maximum),l=Lx(a,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${ho(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${n.maximum.toString()} ${l}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${ho(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s){let a=Number(n.minimum),l=Lx(a,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${ho(n.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${n.minimum.toString()} ${l}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${ho(n.origin)} \u056C\u056B\u0576\u056B ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${i.prefix}"-\u0578\u057E`:i.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${i.suffix}"-\u0578\u057E`:i.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${i.includes}"`:i.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${i.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[i.format]??n.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${n.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${n.keys.length>1?"\u0576\u0565\u0580":""}. ${w(n.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${ho(n.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${ho(n.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};function Ux(){return{localeError:aR()}}var cR=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(n){return e[n]??null}let r={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${a}`:`Input tidak valid: diharapkan ${i}, diterima ${a}`}case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${A(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${i}${n.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Terlalu kecil: diharapkan ${n.origin} memiliki ${i}${n.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`String tidak valid: harus dimulai dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak valid: harus berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak valid: harus menyertakan "${i.includes}"`:i.format==="regex"?`String tidak valid: harus sesuai pola ${i.pattern}`:`${r[i.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${w(n.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${n.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${n.origin}`;default:return"Input tidak valid"}}};function jx(){return{localeError:cR()}}var lR=()=>{let e={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function t(n){return e[n]??null}let r={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},o={nan:"NaN",number:"n\xFAmer",array:"fylki"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera instanceof ${n.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera ${i}`}case"invalid_value":return n.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${A(n.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} hafi ${i}${n.maximum.toString()} ${s.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} s\xE9 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} hafi ${i}${n.minimum.toString()} ${s.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} s\xE9 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${i.prefix}"`:i.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${i.suffix}"`:i.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${i.includes}"`:i.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${i.pattern}`:`Rangt ${r[i.format]??n.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${n.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${n.keys.length>1?"ir lyklar":"ur lykill"}: ${w(n.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${n.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${n.origin}`;default:return"Rangt gildi"}}};function zx(){return{localeError:lR()}}var uR=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(n){return e[n]??null}let r={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"numero",array:"vettore"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Input non valido: atteso instanceof ${n.expected}, ricevuto ${a}`:`Input non valido: atteso ${i}, ricevuto ${a}`}case"invalid_value":return n.values.length===1?`Input non valido: atteso ${A(n.values[0])}`:`Opzione non valida: atteso uno tra ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Troppo grande: ${n.origin??"valore"} deve avere ${i}${n.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Troppo piccolo: ${n.origin} deve avere ${i}${n.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${n.origin} deve essere ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Stringa non valida: deve iniziare con "${i.prefix}"`:i.format==="ends_with"?`Stringa non valida: deve terminare con "${i.suffix}"`:i.format==="includes"?`Stringa non valida: deve includere "${i.includes}"`:i.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${i.pattern}`:`Input non valido: ${r[i.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${w(n.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${n.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${n.origin}`;default:return"Input non valido"}}};function Fx(){return{localeError:uR()}}var dR=()=>{let e={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function t(n){return e[n]??null}let r={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},o={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${n.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${i}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return n.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${A(n.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${w(n.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let i=n.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",s=t(n.origin);return s?`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${s.unit??"\u8981\u7D20"}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let i=n.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",s=t(n.origin);return s?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${s.unit}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${i.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[i.format]??n.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${n.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${n.keys.length>1?"\u7FA4":""}: ${w(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};function Mx(){return{localeError:dR()}}var pR=()=>{let e={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function t(n){return e[n]??null}let r={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",json_string:"JSON \u10D5\u10D4\u10DA\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},o={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10D5\u10D4\u10DA\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${n.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`}case"invalid_value":return n.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${A(n.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${w(n.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${s.verb} ${i}${n.maximum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} ${s.verb} ${i}${n.minimum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} \u10D8\u10E7\u10DD\u10E1 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.prefix}"-\u10D8\u10D7`:i.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.suffix}"-\u10D8\u10D7`:i.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${i.includes}"-\u10E1`:i.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${i.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${n.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${n.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${w(n.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${n.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${n.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};function Bx(){return{localeError:pR()}}var mR=()=>{let e={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function t(n){return e[n]??null}let r={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},o={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${n.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`}case"invalid_value":return n.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${A(n.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${n.maximum.toString()} ${s.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${i} ${n.minimum.toString()} ${s.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${i.prefix}"`:i.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${i.suffix}"`:i.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${i.includes}"`:i.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${i.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${n.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${w(n.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};function Ja(){return{localeError:mR()}}function Hx(){return Ja()}var fR=()=>{let e={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function t(n){return e[n]??null}let r={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${n.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${i}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`}case"invalid_value":return n.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${A(n.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${w(n.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let i=n.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",s=i==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=t(n.origin),l=a?.unit??"\uC694\uC18C";return a?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()}${l} ${i}${s}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()} ${i}${s}`}case"too_small":{let i=n.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",s=i==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=t(n.origin),l=a?.unit??"\uC694\uC18C";return a?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()}${l} ${i}${s}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()} ${i}${s}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:i.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${i.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[i.format]??n.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${n.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${w(n.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${n.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${n.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};function Zx(){return{localeError:fR()}}var Hi=e=>e.charAt(0).toUpperCase()+e.slice(1);function Gx(e){let t=Math.abs(e),r=t%10,o=t%100;return o>=11&&o<=19||r===0?"many":r===1?"one":"few"}var gR=()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function t(n,i,s,a){let l=e[n]??null;return l===null?l:{unit:l.unit[i],verb:l.verb[a][s?"inclusive":"notInclusive"]}}let r={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},o={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Gautas tipas ${a}, o tik\u0117tasi - instanceof ${n.expected}`:`Gautas tipas ${a}, o tik\u0117tasi - ${i}`}case"invalid_value":return n.values.length===1?`Privalo b\u016Bti ${A(n.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${w(n.values,"|")} pasirinkim\u0173`;case"too_big":{let i=o[n.origin]??n.origin,s=t(n.origin,Gx(Number(n.maximum)),n.inclusive??!1,"smaller");if(s?.verb)return`${Hi(i??n.origin??"reik\u0161m\u0117")} ${s.verb} ${n.maximum.toString()} ${s.unit??"element\u0173"}`;let a=n.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${Hi(i??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${n.maximum.toString()} ${s?.unit}`}case"too_small":{let i=o[n.origin]??n.origin,s=t(n.origin,Gx(Number(n.minimum)),n.inclusive??!1,"bigger");if(s?.verb)return`${Hi(i??n.origin??"reik\u0161m\u0117")} ${s.verb} ${n.minimum.toString()} ${s.unit??"element\u0173"}`;let a=n.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${Hi(i??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${n.minimum.toString()} ${s?.unit}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${i.prefix}"`:i.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${i.suffix}"`:i.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${i.includes}"`:i.format==="regex"?`Eilut\u0117 privalo atitikti ${i.pattern}`:`Neteisingas ${r[i.format]??n.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${n.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${n.keys.length>1?"i":"as"} rakt${n.keys.length>1?"ai":"as"}: ${w(n.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let i=o[n.origin]??n.origin;return`${Hi(i??n.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function Wx(){return{localeError:gR()}}var hR=()=>{let e={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function t(n){return e[n]??null}let r={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},o={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${n.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${A(n.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${i}${n.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0438\u043C\u0430 ${i}${n.minimum.toString()} ${s.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${i.pattern}`:`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${w(n.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${n.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${n.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function Vx(){return{localeError:hR()}}var vR=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(n){return e[n]??null}let r={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"nombor"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${a}`:`Input tidak sah: dijangka ${i}, diterima ${a}`}case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${A(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Terlalu besar: dijangka ${n.origin??"nilai"} ${s.verb} ${i}${n.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Terlalu kecil: dijangka ${n.origin} ${s.verb} ${i}${n.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`String tidak sah: mesti bermula dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak sah: mesti mengandungi "${i.includes}"`:i.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${i.pattern}`:`${r[i.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${w(n.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${n.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${n.origin}`;default:return"Input tidak sah"}}};function Jx(){return{localeError:vR()}}var bR=()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function t(n){return e[n]??null}let r={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},o={nan:"NaN",number:"getal"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${a}`:`Ongeldige invoer: verwacht ${i}, ontving ${a}`}case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${A(n.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin),a=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";return s?`Te ${a}: verwacht dat ${n.origin??"waarde"} ${i}${n.maximum.toString()} ${s.unit??"elementen"} ${s.verb}`:`Te ${a}: verwacht dat ${n.origin??"waarde"} ${i}${n.maximum.toString()} is`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin),a=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";return s?`Te ${a}: verwacht dat ${n.origin} ${i}${n.minimum.toString()} ${s.unit} ${s.verb}`:`Te ${a}: verwacht dat ${n.origin} ${i}${n.minimum.toString()} is`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ongeldige tekst: moet met "${i.prefix}" beginnen`:i.format==="ends_with"?`Ongeldige tekst: moet op "${i.suffix}" eindigen`:i.format==="includes"?`Ongeldige tekst: moet "${i.includes}" bevatten`:i.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`:`Ongeldig: ${r[i.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${w(n.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${n.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${n.origin}`;default:return"Ongeldige invoer"}}};function qx(){return{localeError:bR()}}var yR=()=>{let e={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function t(n){return e[n]??null}let r={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"tall",array:"liste"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Ugyldig input: forventet instanceof ${n.expected}, fikk ${a}`:`Ugyldig input: forventet ${i}, fikk ${a}`}case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${A(n.values[0])}`:`Ugyldig valg: forventet en av ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${i}${n.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`For lite(n): forventet ${n.origin} til \xE5 ha ${i}${n.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${n.origin} til \xE5 ha ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${r[i.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${w(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}};function Kx(){return{localeError:yR()}}var xR=()=>{let e={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function t(n){return e[n]??null}let r={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},o={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`F\xE2sit giren: umulan instanceof ${n.expected}, al\u0131nan ${a}`:`F\xE2sit giren: umulan ${i}, al\u0131nan ${a}`}case"invalid_value":return n.values.length===1?`F\xE2sit giren: umulan ${A(n.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${i}${n.maximum.toString()} ${s.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${i}${n.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${i}${n.minimum.toString()} ${s.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${i}${n.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let i=n;return i.format==="starts_with"?`F\xE2sit metin: "${i.prefix}" ile ba\u015Flamal\u0131.`:i.format==="ends_with"?`F\xE2sit metin: "${i.suffix}" ile bitmeli.`:i.format==="includes"?`F\xE2sit metin: "${i.includes}" ihtiv\xE2 etmeli.`:i.format==="regex"?`F\xE2sit metin: ${i.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[i.format]??n.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${n.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${n.keys.length>1?"s":""}: ${w(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${n.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};function Xx(){return{localeError:xR()}}var kR=()=>{let e={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function t(n){return e[n]??null}let r={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${n.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${i} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return n.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${A(n.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${w(n.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} \u0648\u064A`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} ${s.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} \u0648\u064A`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:i.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:i.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${i.includes}" \u0648\u0644\u0631\u064A`:i.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${i.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[i.format]??n.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${n.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${n.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${w(n.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${n.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${n.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function Yx(){return{localeError:kR()}}var wR=()=>{let e={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function t(n){return e[n]??null}let r={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},o={nan:"NaN",number:"liczba",array:"tablica"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${n.expected}, otrzymano ${a}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${i}, otrzymano ${a}`}case"invalid_value":return n.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${A(n.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${n.maximum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${n.minimum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${i.prefix}"`:i.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${i.suffix}"`:i.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${i.includes}"`:i.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${i.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[i.format]??n.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${w(n.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${n.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${n.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};function Qx(){return{localeError:wR()}}var SR=()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(n){return e[n]??null}let r={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",number:"n\xFAmero",null:"nulo"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Tipo inv\xE1lido: esperado instanceof ${n.expected}, recebido ${a}`:`Tipo inv\xE1lido: esperado ${i}, recebido ${a}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: esperado ${A(n.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${i}${n.maximum.toString()} ${s.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Muito pequeno: esperado que ${n.origin} tivesse ${i}${n.minimum.toString()} ${s.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${i.prefix}"`:i.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${i.suffix}"`:i.format==="includes"?`Texto inv\xE1lido: deve incluir "${i.includes}"`:i.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${i.pattern}`:`${r[i.format]??n.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${w(n.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${n.origin}`;default:return"Campo inv\xE1lido"}}};function ek(){return{localeError:SR()}}var _R=()=>{let e={string:{unit:"caractere",verb:"s\u0103 aib\u0103"},file:{unit:"octe\u021Bi",verb:"s\u0103 aib\u0103"},array:{unit:"elemente",verb:"s\u0103 aib\u0103"},set:{unit:"elemente",verb:"s\u0103 aib\u0103"},map:{unit:"intr\u0103ri",verb:"s\u0103 aib\u0103"}};function t(n){return e[n]??null}let r={regex:"intrare",email:"adres\u0103 de email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"dat\u0103 \u0219i or\u0103 ISO",date:"dat\u0103 ISO",time:"or\u0103 ISO",duration:"durat\u0103 ISO",ipv4:"adres\u0103 IPv4",ipv6:"adres\u0103 IPv6",mac:"adres\u0103 MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"\u0219ir codat base64",base64url:"\u0219ir codat base64url",json_string:"\u0219ir JSON",e164:"num\u0103r E.164",jwt:"JWT",template_literal:"intrare"},o={nan:"NaN",string:"\u0219ir",number:"num\u0103r",boolean:"boolean",function:"func\u021Bie",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"num\u0103r mare",void:"void",never:"never",map:"hart\u0103",set:"set"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return`Intrare invalid\u0103: a\u0219teptat ${i}, primit ${a}`}case"invalid_value":return n.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${A(n.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} ${s.verb} ${i}${n.maximum.toString()} ${s.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} s\u0103 fie ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Prea mic: a\u0219teptat ca ${n.origin} ${s.verb} ${i}${n.minimum.toString()} ${s.unit}`:`Prea mic: a\u0219teptat ca ${n.origin} s\u0103 fie ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${i.prefix}"`:i.format==="ends_with"?`\u0218ir invalid: trebuie s\u0103 se termine cu "${i.suffix}"`:i.format==="includes"?`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${i.includes}"`:i.format==="regex"?`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${i.pattern}`:`Format invalid: ${r[i.format]??n.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${n.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${w(n.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${n.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${n.origin}`;default:return"Intrare invalid\u0103"}}};function tk(){return{localeError:_R()}}function nk(e,t,r,o){let n=Math.abs(e),i=n%10,s=n%100;return s>=11&&s<=19?o:i===1?t:i>=2&&i<=4?r:o}var $R=()=>{let e={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${A(n.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s){let a=Number(n.maximum),l=nk(a,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${n.maximum.toString()} ${l}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s){let a=Number(n.minimum),l=nk(a,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${n.minimum.toString()} ${l}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${n.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0438":""}: ${w(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};function rk(){return{localeError:$R()}}var IR=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(n){return e[n]??null}let r={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},o={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${n.expected}, prejeto ${a}`:`Neveljaven vnos: pri\u010Dakovano ${i}, prejeto ${a}`}case"invalid_value":return n.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${A(n.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} imelo ${i}${n.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Premajhno: pri\u010Dakovano, da bo ${n.origin} imelo ${i}${n.minimum.toString()} ${s.unit}`:`Premajhno: pri\u010Dakovano, da bo ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${i.prefix}"`:i.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${i.suffix}"`:i.format==="includes"?`Neveljaven niz: mora vsebovati "${i.includes}"`:i.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`:`Neveljaven ${r[i.format]??n.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${w(n.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${n.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${n.origin}`;default:return"Neveljaven vnos"}}};function ok(){return{localeError:IR()}}var ER=()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function t(n){return e[n]??null}let r={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},o={nan:"NaN",number:"antal",array:"lista"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${n.expected}, fick ${a}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${i}, fick ${a}`}case"invalid_value":return n.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${A(n.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`F\xF6r stor(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.maximum.toString()} ${s.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${n.origin??"v\xE4rdet"} att ha ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.minimum.toString()} ${s.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${i.prefix}"`:i.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${i.suffix}"`:i.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${i.includes}"`:i.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${i.pattern}"`:`Ogiltig(t) ${r[i.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${w(n.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${n.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${n.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};function ik(){return{localeError:ER()}}var AR=()=>{let e={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function t(n){return e[n]??null}let r={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${n.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`}case"invalid_value":return n.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${A(n.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${w(n.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${n.maximum.toString()} ${s.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${n.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${i}${n.minimum.toString()} ${s.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${i}${n.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${i.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${n.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${n.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${w(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}};function sk(){return{localeError:AR()}}var CR=()=>{let e={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function t(n){return e[n]??null}let r={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},o={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${n.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${i} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`}case"invalid_value":return n.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${A(n.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",s=t(n.origin);return s?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.maximum.toString()} ${s.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",s=t(n.origin);return s?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.minimum.toString()} ${s.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${i.prefix}"`:i.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${i.suffix}"`:i.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${i.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:i.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${i.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${n.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${w(n.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function ak(){return{localeError:CR()}}var PR=()=>{let e={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function t(n){return e[n]??null}let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${n.expected}, al\u0131nan ${a}`:`Ge\xE7ersiz de\u011Fer: beklenen ${i}, al\u0131nan ${a}`}case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${A(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()} ${s.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()} ${s.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ge\xE7ersiz metin: "${i.prefix}" ile ba\u015Flamal\u0131`:i.format==="ends_with"?`Ge\xE7ersiz metin: "${i.suffix}" ile bitmeli`:i.format==="includes"?`Ge\xE7ersiz metin: "${i.includes}" i\xE7ermeli`:i.format==="regex"?`Ge\xE7ersiz metin: ${i.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[i.format]??n.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${n.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${n.keys.length>1?"lar":""}: ${w(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${n.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};function ck(){return{localeError:PR()}}var TR=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${n.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${i}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${A(n.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${s.verb} ${i}${n.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} ${s.verb} ${i}${n.minimum.toString()} ${s.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} \u0431\u0443\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0456":""}: ${w(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${n.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};function qa(){return{localeError:TR()}}function lk(){return qa()}var RR=()=>{let e={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function t(n){return e[n]??null}let r={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},o={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${n.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${i} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return n.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${A(n.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${w(n.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${i}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${i}${n.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u06D2 ${i}${n.minimum.toString()} ${s.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u0627 ${i}${n.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${i.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${n.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${n.keys.length>1?"\u0632":""}: ${w(n.keys,"\u060C ")}`;case"invalid_key":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function uk(){return{localeError:RR()}}var OR=()=>{let e={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"},map:{unit:"yozuv",verb:"bo\u2018lishi kerak"}};function t(n){return e[n]??null}let r={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},o={nan:"NaN",number:"raqam",array:"massiv"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${a}`:`Noto\u2018g\u2018ri kirish: kutilgan ${i}, qabul qilingan ${a}`}case"invalid_value":return n.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${A(n.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Juda katta: kutilgan ${n.origin??"qiymat"} ${i}${n.maximum.toString()} ${s.unit} ${s.verb}`:`Juda katta: kutilgan ${n.origin??"qiymat"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Juda kichik: kutilgan ${n.origin} ${i}${n.minimum.toString()} ${s.unit} ${s.verb}`:`Juda kichik: kutilgan ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${i.prefix}" bilan boshlanishi kerak`:i.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${i.suffix}" bilan tugashi kerak`:i.format==="includes"?`Noto\u2018g\u2018ri satr: "${i.includes}" ni o\u2018z ichiga olishi kerak`:i.format==="regex"?`Noto\u2018g\u2018ri satr: ${i.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[i.format]??n.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${n.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${n.keys.length>1?"lar":""}: ${w(n.keys,", ")}`;case"invalid_key":return`${n.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${n.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}};function dk(){return{localeError:OR()}}var DR=()=>{let e={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function t(n){return e[n]??null}let r={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},o={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${n.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${i}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`}case"invalid_value":return n.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${A(n.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${s.verb} ${i}${n.maximum.toString()} ${s.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${s.verb} ${i}${n.minimum.toString()} ${s.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${i.prefix}"`:i.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${i.suffix}"`:i.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${i.includes}"`:i.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${i.pattern}`:`${r[i.format]??n.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${n.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${w(n.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function pk(){return{localeError:DR()}}var NR=()=>{let e={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function t(n){return e[n]??null}let r={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},o={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${n.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${i}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`}case"invalid_value":return n.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${A(n.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${i}${n.maximum.toString()} ${s.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${i}${n.minimum.toString()} ${s.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.prefix}" \u5F00\u5934`:i.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.suffix}" \u7ED3\u5C3E`:i.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${i.pattern}`:`\u65E0\u6548${r[i.format]??n.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${n.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${w(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${n.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};function mk(){return{localeError:NR()}}var LR=()=>{let e={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function t(n){return e[n]??null}let r={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${n.expected}\uFF0C\u4F46\u6536\u5230 ${a}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${i}\uFF0C\u4F46\u6536\u5230 ${a}`}case"invalid_value":return n.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${A(n.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${i}${n.maximum.toString()} ${s.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${i}${n.minimum.toString()} ${s.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.prefix}" \u958B\u982D`:i.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.suffix}" \u7D50\u5C3E`:i.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${i.pattern}`:`\u7121\u6548\u7684 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${n.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${n.keys.length>1?"\u5011":""}\uFF1A${w(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function fk(){return{localeError:LR()}}var UR=()=>{let e={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function t(n){return e[n]??null}let r={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},o={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=P(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${n.expected}, \xE0m\u1ECD\u0300 a r\xED ${a}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${i}, \xE0m\u1ECD\u0300 a r\xED ${a}`}case"invalid_value":return n.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${A(n.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${w(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin??"iye"} ${s.verb} ${i}${n.maximum} ${s.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${n.maximum}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin} ${s.verb} ${i}${n.minimum} ${s.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${n.minimum}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${i.prefix}"`:i.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${i.suffix}"`:i.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${i.includes}"`:i.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${i.pattern}`:`A\u1E63\xEC\u1E63e: ${r[i.format]??n.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${n.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${w(n.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};function gk(){return{localeError:UR()}}var hk,ym=Symbol("ZodOutput"),xm=Symbol("ZodInput"),Ka=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let o=r[0];return this._map.set(t,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let o={...this.get(r)??{}};delete o.id;let n={...o,...this._map.get(t)};return Object.keys(n).length?n:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function Xa(){return new Ka}(hk=globalThis).__zod_globalRegistry??(hk.__zod_globalRegistry=Xa());var Ne=globalThis.__zod_globalRegistry;function km(e,t){return new e({type:"string",...R(t)})}function wm(e,t){return new e({type:"string",coerce:!0,...R(t)})}function Ya(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...R(t)})}function Gi(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...R(t)})}function Qa(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...R(t)})}function ec(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...R(t)})}function tc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...R(t)})}function nc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...R(t)})}function Wi(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...R(t)})}function rc(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...R(t)})}function oc(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...R(t)})}function ic(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...R(t)})}function sc(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...R(t)})}function ac(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...R(t)})}function cc(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...R(t)})}function lc(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...R(t)})}function uc(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...R(t)})}function dc(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...R(t)})}function Sm(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...R(t)})}function pc(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...R(t)})}function mc(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...R(t)})}function fc(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...R(t)})}function gc(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...R(t)})}function hc(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...R(t)})}function vc(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...R(t)})}var _m={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function $m(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...R(t)})}function Im(e,t){return new e({type:"string",format:"date",check:"string_format",...R(t)})}function Em(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...R(t)})}function Am(e,t){return new e({type:"string",format:"duration",check:"string_format",...R(t)})}function Cm(e,t){return new e({type:"number",checks:[],...R(t)})}function Pm(e,t){return new e({type:"number",coerce:!0,checks:[],...R(t)})}function Tm(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...R(t)})}function Rm(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...R(t)})}function Om(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...R(t)})}function Dm(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...R(t)})}function Nm(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...R(t)})}function Lm(e,t){return new e({type:"boolean",...R(t)})}function Um(e,t){return new e({type:"boolean",coerce:!0,...R(t)})}function jm(e,t){return new e({type:"bigint",...R(t)})}function zm(e,t){return new e({type:"bigint",coerce:!0,...R(t)})}function Fm(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...R(t)})}function Mm(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...R(t)})}function Bm(e,t){return new e({type:"symbol",...R(t)})}function Hm(e,t){return new e({type:"undefined",...R(t)})}function Zm(e,t){return new e({type:"null",...R(t)})}function Gm(e){return new e({type:"any"})}function Wm(e){return new e({type:"unknown"})}function Vm(e,t){return new e({type:"never",...R(t)})}function Jm(e,t){return new e({type:"void",...R(t)})}function qm(e,t){return new e({type:"date",...R(t)})}function Km(e,t){return new e({type:"date",coerce:!0,...R(t)})}function Xm(e,t){return new e({type:"nan",...R(t)})}function Bt(e,t){return new La({check:"less_than",...R(t),value:e,inclusive:!1})}function st(e,t){return new La({check:"less_than",...R(t),value:e,inclusive:!0})}function Ht(e,t){return new Ua({check:"greater_than",...R(t),value:e,inclusive:!1})}function We(e,t){return new Ua({check:"greater_than",...R(t),value:e,inclusive:!0})}function bc(e){return Ht(0,e)}function yc(e){return Bt(0,e)}function xc(e){return st(0,e)}function kc(e){return We(0,e)}function Gn(e,t){return new Zd({check:"multiple_of",...R(t),value:e})}function Wn(e,t){return new Vd({check:"max_size",...R(t),maximum:e})}function Zt(e,t){return new Jd({check:"min_size",...R(t),minimum:e})}function yr(e,t){return new qd({check:"size_equals",...R(t),size:e})}function xr(e,t){return new Kd({check:"max_length",...R(t),maximum:e})}function pn(e,t){return new Xd({check:"min_length",...R(t),minimum:e})}function kr(e,t){return new Yd({check:"length_equals",...R(t),length:e})}function vo(e,t){return new Qd({check:"string_format",format:"regex",...R(t),pattern:e})}function bo(e){return new ep({check:"string_format",format:"lowercase",...R(e)})}function yo(e){return new tp({check:"string_format",format:"uppercase",...R(e)})}function xo(e,t){return new np({check:"string_format",format:"includes",...R(t),includes:e})}function ko(e,t){return new rp({check:"string_format",format:"starts_with",...R(t),prefix:e})}function wo(e,t){return new op({check:"string_format",format:"ends_with",...R(t),suffix:e})}function wc(e,t,r){return new ip({check:"property",property:e,schema:t,...R(r)})}function So(e,t){return new sp({check:"mime_type",mime:e,...R(t)})}function Et(e){return new ap({check:"overwrite",tx:e})}function _o(e){return Et(t=>t.normalize(e))}function $o(){return Et(e=>e.trim())}function Io(){return Et(e=>e.toLowerCase())}function Eo(){return Et(e=>e.toUpperCase())}function Ao(){return Et(e=>rd(e))}function Ym(e,t,r){return new e({type:"array",element:t,...R(r)})}function zR(e,t,r){return new e({type:"union",options:t,...R(r)})}function FR(e,t,r){return new e({type:"union",options:t,inclusive:!1,...R(r)})}function MR(e,t,r,o){return new e({type:"union",options:r,discriminator:t,...R(o)})}function BR(e,t,r){return new e({type:"intersection",left:t,right:r})}function HR(e,t,r,o){let n=r instanceof J,i=n?o:r,s=n?r:null;return new e({type:"tuple",items:t,rest:s,...R(i)})}function ZR(e,t,r,o){return new e({type:"record",keyType:t,valueType:r,...R(o)})}function GR(e,t,r,o){return new e({type:"map",keyType:t,valueType:r,...R(o)})}function WR(e,t,r){return new e({type:"set",valueType:t,...R(r)})}function VR(e,t,r){let o=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new e({type:"enum",entries:o,...R(r)})}function JR(e,t,r){return new e({type:"enum",entries:t,...R(r)})}function qR(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...R(r)})}function Qm(e,t){return new e({type:"file",...R(t)})}function KR(e,t){return new e({type:"transform",transform:t})}function XR(e,t){return new e({type:"optional",innerType:t})}function YR(e,t){return new e({type:"nullable",innerType:t})}function QR(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():id(r)}})}function e1(e,t,r){return new e({type:"nonoptional",innerType:t,...R(r)})}function t1(e,t){return new e({type:"success",innerType:t})}function n1(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:()=>r})}function r1(e,t,r){return new e({type:"pipe",in:t,out:r})}function o1(e,t){return new e({type:"readonly",innerType:t})}function i1(e,t,r){return new e({type:"template_literal",parts:t,...R(r)})}function s1(e,t){return new e({type:"lazy",getter:t})}function a1(e,t){return new e({type:"promise",innerType:t})}function ef(e,t,r){let o=R(r);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:t,...o})}function tf(e,t,r){return new e({type:"custom",check:"custom",fn:t,...R(r)})}function nf(e,t){let r=vk(o=>(o.addIssue=n=>{if(typeof n=="string")o.issues.push(lo(n,o.value,r._zod.def));else{let i=n;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=o.value),i.inst??(i.inst=r),i.continue??(i.continue=!r._zod.def.abort),o.issues.push(lo(i))}},e(o.value,o)),t);return r}function vk(e,t){let r=new be({check:"custom",...R(t)});return r._zod.check=e,r}function rf(e){let t=new be({check:"describe"});return t._zod.onattach=[r=>{let o=Ne.get(r)??{};Ne.add(r,{...o,description:e})}],t._zod.check=()=>{},t}function of(e){let t=new be({check:"meta"});return t._zod.onattach=[r=>{let o=Ne.get(r)??{};Ne.add(r,{...o,...e})}],t._zod.check=()=>{},t}function sf(e,t){let r=R(t),o=r.truthy??["true","1","yes","on","y","enabled"],n=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(o=o.map(f=>typeof f=="string"?f.toLowerCase():f),n=n.map(f=>typeof f=="string"?f.toLowerCase():f));let i=new Set(o),s=new Set(n),a=e.Codec??Bi,l=e.Boolean??Fi,u=e.String??br,p=new u({type:"string",error:r.error}),d=new l({type:"boolean",error:r.error}),m=new a({type:"pipe",in:p,out:d,transform:((f,g)=>{let h=f;return r.case!=="sensitive"&&(h=h.toLowerCase()),i.has(h)?!0:s.has(h)?!1:(g.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...s],input:g.value,inst:m,continue:!1}),{})}),reverseTransform:((f,g)=>f===!0?o[0]||"true":n[0]||"false"),error:r.error});return m}function Co(e,t,r,o={}){let n=R(o),i={...R(o),check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:a=>r.test(a),...n};return r instanceof RegExp&&(i.pattern=r),new e(i)}function Vn(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Ne,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function pe(e,t,r={path:[],schemaPath:[]}){var o;let n=e._zod.def,i=t.seen.get(e);if(i)return i.count++,r.schemaPath.includes(e)&&(i.cycle=r.path),i.schema;let s={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,s);let a=e._zod.toJSONSchema?.();if(a)s.schema=a;else{let p={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,p);else{let m=s.schema,f=t.processors[n.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);f(e,t,m,p)}let d=e._zod.parent;d&&(s.ref||(s.ref=d),pe(d,t,p),t.seen.get(d).isParent=!0)}let l=t.metadataRegistry.get(e);return l&&Object.assign(s.schema,l),t.io==="input"&&Ve(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&"_prefault"in s.schema&&((o=s.schema).default??(o.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function Jn(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=new Map;for(let s of e.seen.entries()){let a=e.metadataRegistry.get(s[0])?.id;if(a){let l=o.get(a);if(l&&l!==s[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(a,s[0])}}let n=s=>{let a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let d=e.external.registry.get(s[0])?.id,m=e.external.uri??(g=>g);if(d)return{ref:m(d)};let f=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=f,{defId:f,ref:`${m("__shared")}#/${a}/${f}`}}if(s[1]===r)return{ref:"#"};let u=`#/${a}/`,p=s[1].schema.id??`__schema${e.counter++}`;return{defId:p,ref:u+p}},i=s=>{if(s[1].schema.$ref)return;let a=s[1],{ref:l,defId:u}=n(s);a.def={...a.schema},u&&(a.defId=u);let p=a.schema;for(let d in p)delete p[d];p.$ref=l};if(e.cycles==="throw")for(let s of e.seen.entries()){let a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
236
245
|
|
|
237
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let a=s[1];if(t===s[0]){i(s);continue}if(e.external){let u=e.external.registry.get(s[0])?.id;if(t!==s[0]&&u){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(a.cycle){i(s);continue}if(a.count>1&&e.reused==="ref"){i(s);continue}}}function Vn(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=a=>{let l=e.seen.get(a);if(l.ref===null)return;let u=l.def??l.schema,d={...u},p=l.ref;if(l.ref=null,p){o(p);let f=e.seen.get(p),g=f.schema;if(g.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(g)):Object.assign(u,g),Object.assign(u,d),a._zod.parent===p)for(let y in u)y==="$ref"||y==="allOf"||y in d||delete u[y];if(g.$ref&&f.def)for(let y in u)y==="$ref"||y==="allOf"||y in f.def&&JSON.stringify(u[y])===JSON.stringify(f.def[y])&&delete u[y]}let m=a._zod.parent;if(m&&m!==p){o(m);let f=e.seen.get(m);if(f?.schema.$ref&&(u.$ref=f.schema.$ref,f.def))for(let g in u)g==="$ref"||g==="allOf"||g in f.def&&JSON.stringify(u[g])===JSON.stringify(f.def[g])&&delete u[g]}e.override({zodSchema:a,jsonSchema:u,path:l.path??[]})};for(let a of[...e.seen.entries()].reverse())o(a[0]);let n={};if(e.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");n.$id=e.external.uri(a)}Object.assign(n,r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;i!==void 0&&n.id===i&&delete n.id;let s=e.external?.defs??{};for(let a of e.seen.entries()){let l=a[1];l.def&&l.defId&&(l.def.id===l.defId&&delete l.def.id,s[l.defId]=l.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?n.$defs=s:n.definitions=s);try{let a=JSON.parse(JSON.stringify(n));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:Eo(t,"input",e.processors),output:Eo(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function Ve(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return Ve(o.element,r);if(o.type==="set")return Ve(o.valueType,r);if(o.type==="lazy")return Ve(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return Ve(o.innerType,r);if(o.type==="intersection")return Ve(o.left,r)||Ve(o.right,r);if(o.type==="record"||o.type==="map")return Ve(o.keyType,r)||Ve(o.valueType,r);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Ve(o.in,r)||Ve(o.out,r);if(o.type==="object"){for(let n in o.shape)if(Ve(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(Ve(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(Ve(n,r))return!0;return!!(o.rest&&Ve(o.rest,r))}return!1}var Wm=(e,t={})=>r=>{let o=Gn({...r,processors:t});return pe(e,o),Wn(o,e),Vn(o,e)},Eo=(e,t,r={})=>o=>{let{libraryOptions:n,target:i}=o??{},s=Gn({...n??{},target:i,io:t,processors:r});return pe(e,s),Wn(s,e),Vn(s,e)};var ER={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Vm=(e,t,r,o)=>{let n=r;n.type="string";let{minimum:i,maximum:s,format:a,patterns:l,contentEncoding:u}=e._zod.bag;if(typeof i=="number"&&(n.minLength=i),typeof s=="number"&&(n.maxLength=s),a&&(n.format=ER[a]??a,n.format===""&&delete n.format,a==="time"&&delete n.format),u&&(n.contentEncoding=u),l&&l.size>0){let d=[...l];d.length===1?n.pattern=d[0].source:d.length>1&&(n.allOf=[...d.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},qm=(e,t,r,o)=>{let n=r,{minimum:i,maximum:s,format:a,multipleOf:l,exclusiveMaximum:u,exclusiveMinimum:d}=e._zod.bag;typeof a=="string"&&a.includes("int")?n.type="integer":n.type="number";let p=typeof d=="number"&&d>=(i??Number.NEGATIVE_INFINITY),m=typeof u=="number"&&u<=(s??Number.POSITIVE_INFINITY),f=t.target==="draft-04"||t.target==="openapi-3.0";p?f?(n.minimum=d,n.exclusiveMinimum=!0):n.exclusiveMinimum=d:typeof i=="number"&&(n.minimum=i),m?f?(n.maximum=u,n.exclusiveMaximum=!0):n.exclusiveMaximum=u:typeof s=="number"&&(n.maximum=s),typeof l=="number"&&(n.multipleOf=l)},Jm=(e,t,r,o)=>{r.type="boolean"},Km=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},Xm=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},Ym=(e,t,r,o)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},Qm=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},ef=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},tf=(e,t,r,o)=>{r.not={}},nf=(e,t,r,o)=>{},rf=(e,t,r,o)=>{},of=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},sf=(e,t,r,o)=>{let n=e._zod.def,i=Ii(n.entries);i.every(s=>typeof s=="number")&&(r.type="number"),i.every(s=>typeof s=="string")&&(r.type="string"),r.enum=i},af=(e,t,r,o)=>{let n=e._zod.def,i=[];for(let s of n.values)if(s===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(s))}else i.push(s);if(i.length!==0)if(i.length===1){let s=i[0];r.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[s]:r.const=s}else i.every(s=>typeof s=="number")&&(r.type="number"),i.every(s=>typeof s=="string")&&(r.type="string"),i.every(s=>typeof s=="boolean")&&(r.type="boolean"),i.every(s=>s===null)&&(r.type="null"),r.enum=i},cf=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},lf=(e,t,r,o)=>{let n=r,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=i.source},uf=(e,t,r,o)=>{let n=r,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:a,mime:l}=e._zod.bag;s!==void 0&&(i.minLength=s),a!==void 0&&(i.maxLength=a),l?l.length===1?(i.contentMediaType=l[0],Object.assign(n,i)):(Object.assign(n,i),n.anyOf=l.map(u=>({contentMediaType:u}))):Object.assign(n,i)},df=(e,t,r,o)=>{r.type="boolean"},pf=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},mf=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},ff=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},gf=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},hf=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},vf=(e,t,r,o)=>{let n=r,i=e._zod.def,{minimum:s,maximum:a}=e._zod.bag;typeof s=="number"&&(n.minItems=s),typeof a=="number"&&(n.maxItems=a),n.type="array",n.items=pe(i.element,t,{...o,path:[...o.path,"items"]})},yf=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="object",n.properties={};let s=i.shape;for(let u in s)n.properties[u]=pe(s[u],t,{...o,path:[...o.path,"properties",u]});let a=new Set(Object.keys(s)),l=new Set([...a].filter(u=>{let d=i.shape[u]._zod;return t.io==="input"?d.optin===void 0:d.optout===void 0}));l.size>0&&(n.required=Array.from(l)),i.catchall?._zod.def.type==="never"?n.additionalProperties=!1:i.catchall?i.catchall&&(n.additionalProperties=pe(i.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},hc=(e,t,r,o)=>{let n=e._zod.def,i=n.inclusive===!1,s=n.options.map((a,l)=>pe(a,t,{...o,path:[...o.path,i?"oneOf":"anyOf",l]}));i?r.oneOf=s:r.anyOf=s},bf=(e,t,r,o)=>{let n=e._zod.def,i=pe(n.left,t,{...o,path:[...o.path,"allOf",0]}),s=pe(n.right,t,{...o,path:[...o.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,l=[...a(i)?i.allOf:[i],...a(s)?s.allOf:[s]];r.allOf=l},xf=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="array";let s=t.target==="draft-2020-12"?"prefixItems":"items",a=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",l=i.items.map((m,f)=>pe(m,t,{...o,path:[...o.path,s,f]})),u=i.rest?pe(i.rest,t,{...o,path:[...o.path,a,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null;t.target==="draft-2020-12"?(n.prefixItems=l,u&&(n.items=u)):t.target==="openapi-3.0"?(n.items={anyOf:l},u&&n.items.anyOf.push(u),n.minItems=l.length,u||(n.maxItems=l.length)):(n.items=l,u&&(n.additionalItems=u));let{minimum:d,maximum:p}=e._zod.bag;typeof d=="number"&&(n.minItems=d),typeof p=="number"&&(n.maxItems=p)},kf=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="object";let s=i.keyType,l=s._zod.bag?.patterns;if(i.mode==="loose"&&l&&l.size>0){let d=pe(i.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(let p of l)n.patternProperties[p.source]=d}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(n.propertyNames=pe(i.keyType,t,{...o,path:[...o.path,"propertyNames"]})),n.additionalProperties=pe(i.valueType,t,{...o,path:[...o.path,"additionalProperties"]});let u=s._zod.values;if(u){let d=[...u].filter(p=>typeof p=="string"||typeof p=="number");d.length>0&&(n.required=d)}},wf=(e,t,r,o)=>{let n=e._zod.def,i=pe(n.innerType,t,o),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=n.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}]},Sf=(e,t,r,o)=>{let n=e._zod.def;pe(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},_f=(e,t,r,o)=>{let n=e._zod.def;pe(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},$f=(e,t,r,o)=>{let n=e._zod.def;pe(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},If=(e,t,r,o)=>{let n=e._zod.def;pe(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType;let s;try{s=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=s},Ef=(e,t,r,o)=>{let n=e._zod.def,i=n.in._zod.traits.has("$ZodTransform"),s=t.io==="input"?i?n.out:n.in:n.out;pe(s,t,o);let a=t.seen.get(e);a.ref=s},Af=(e,t,r,o)=>{let n=e._zod.def;pe(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.readOnly=!0},Pf=(e,t,r,o)=>{let n=e._zod.def;pe(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},vc=(e,t,r,o)=>{let n=e._zod.def;pe(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},Cf=(e,t,r,o)=>{let n=e._zod.innerType;pe(n,t,o);let i=t.seen.get(e);i.ref=n},gc={string:Vm,number:qm,boolean:Jm,bigint:Km,symbol:Xm,null:Ym,undefined:Qm,void:ef,never:tf,any:nf,unknown:rf,date:of,enum:sf,literal:af,nan:cf,template_literal:lf,file:uf,success:df,custom:pf,function:mf,transform:ff,map:gf,set:hf,array:vf,object:yf,union:hc,intersection:bf,tuple:xf,record:kf,nullable:wf,nonoptional:Sf,default:_f,prefault:$f,catch:If,pipe:Ef,readonly:Af,promise:Pf,optional:vc,lazy:Cf};function yc(e,t){if("_idmap"in e){let o=e,n=Gn({...t,processors:gc}),i={};for(let l of o._idmap.entries()){let[u,d]=l;pe(d,n)}let s={},a={registry:o,uri:t?.uri,defs:i};n.external=a;for(let l of o._idmap.entries()){let[u,d]=l;Wn(n,d),s[u]=Vn(n,d)}if(Object.keys(i).length>0){let l=n.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[l]:i}}return{schemas:s}}let r=Gn({...t,processors:gc});return pe(e,r),Wn(r,e),Vn(r,e)}var bc=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let r=t?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=Gn({processors:gc,target:r,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,r={path:[],schemaPath:[]}){return pe(t,this.ctx,r)}emit(t,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),Wn(this.ctx,t);let o=Vn(this.ctx,t),{"~standard":n,...i}=o;return i}};var Qx={};var Zi={};nn(Zi,{ZodAny:()=>eg,ZodArray:()=>og,ZodBase64:()=>Fc,ZodBase64URL:()=>Mc,ZodBigInt:()=>No,ZodBigIntFormat:()=>Zc,ZodBoolean:()=>Do,ZodCIDRv4:()=>jc,ZodCIDRv6:()=>zc,ZodCUID:()=>Tc,ZodCUID2:()=>Rc,ZodCatch:()=>Ig,ZodCodec:()=>ns,ZodCustom:()=>rs,ZodCustomStringFormat:()=>Ro,ZodDate:()=>Xi,ZodDefault:()=>xg,ZodDiscriminatedUnion:()=>sg,ZodE164:()=>Bc,ZodEmail:()=>Ac,ZodEmoji:()=>Pc,ZodEnum:()=>Co,ZodExactOptional:()=>vg,ZodFile:()=>gg,ZodFunction:()=>Lg,ZodGUID:()=>Wi,ZodIPv4:()=>Lc,ZodIPv6:()=>Uc,ZodIntersection:()=>ag,ZodJWT:()=>Hc,ZodKSUID:()=>Nc,ZodLazy:()=>Og,ZodLiteral:()=>fg,ZodMAC:()=>Vf,ZodMap:()=>pg,ZodNaN:()=>Ag,ZodNanoID:()=>Cc,ZodNever:()=>ng,ZodNonOptional:()=>Kc,ZodNull:()=>Yf,ZodNullable:()=>bg,ZodNumber:()=>Oo,ZodNumberFormat:()=>kr,ZodObject:()=>Qi,ZodOptional:()=>Jc,ZodPipe:()=>ts,ZodPrefault:()=>wg,ZodPreprocess:()=>Pg,ZodPromise:()=>Ng,ZodReadonly:()=>Cg,ZodRecord:()=>Po,ZodSet:()=>mg,ZodString:()=>To,ZodStringFormat:()=>he,ZodSuccess:()=>$g,ZodSymbol:()=>Kf,ZodTemplateLiteral:()=>Rg,ZodTransform:()=>hg,ZodTuple:()=>lg,ZodType:()=>ee,ZodULID:()=>Oc,ZodURL:()=>Ki,ZodUUID:()=>Zt,ZodUndefined:()=>Xf,ZodUnion:()=>es,ZodUnknown:()=>tg,ZodVoid:()=>rg,ZodXID:()=>Dc,ZodXor:()=>ig,_ZodString:()=>Ec,_default:()=>kg,_function:()=>cw,any:()=>zk,array:()=>Yi,base64:()=>wk,base64url:()=>Sk,bigint:()=>Dk,boolean:()=>Jf,catch:()=>Eg,check:()=>lw,cidrv4:()=>xk,cidrv6:()=>kk,codec:()=>ow,cuid:()=>pk,cuid2:()=>mk,custom:()=>uw,date:()=>Mk,describe:()=>dw,discriminatedUnion:()=>Vk,e164:()=>_k,email:()=>nk,emoji:()=>uk,enum:()=>Vc,exactOptional:()=>yg,file:()=>ew,float32:()=>Ck,float64:()=>Tk,function:()=>cw,guid:()=>rk,hash:()=>Pk,hex:()=>Ak,hostname:()=>Ek,httpUrl:()=>lk,instanceof:()=>mw,int:()=>$c,int32:()=>Rk,int64:()=>Nk,intersection:()=>cg,invertCodec:()=>iw,ipv4:()=>vk,ipv6:()=>bk,json:()=>gw,jwt:()=>$k,keyof:()=>Bk,ksuid:()=>hk,lazy:()=>Dg,literal:()=>Qk,looseObject:()=>Gk,looseRecord:()=>Jk,mac:()=>yk,map:()=>Kk,meta:()=>pw,nan:()=>rw,nanoid:()=>dk,nativeEnum:()=>Yk,never:()=>Gc,nonoptional:()=>_g,null:()=>Qf,nullable:()=>qi,nullish:()=>tw,number:()=>qf,object:()=>Hk,optional:()=>Vi,partialRecord:()=>qk,pipe:()=>Ic,prefault:()=>Sg,preprocess:()=>hw,promise:()=>aw,readonly:()=>Tg,record:()=>dg,refine:()=>Ug,set:()=>Xk,strictObject:()=>Zk,string:()=>Gi,stringFormat:()=>Ik,stringbool:()=>fw,success:()=>nw,superRefine:()=>jg,symbol:()=>Uk,templateLiteral:()=>sw,transform:()=>qc,tuple:()=>ug,uint32:()=>Ok,uint64:()=>Lk,ulid:()=>fk,undefined:()=>jk,union:()=>Wc,unknown:()=>xr,url:()=>ck,uuid:()=>ok,uuidv4:()=>ik,uuidv6:()=>sk,uuidv7:()=>ak,void:()=>Fk,xid:()=>gk,xor:()=>Wk});var xc={};nn(xc,{endsWith:()=>bo,gt:()=>Bt,gte:()=>We,includes:()=>vo,length:()=>br,lowercase:()=>go,lt:()=>Mt,lte:()=>st,maxLength:()=>yr,maxSize:()=>Zn,mime:()=>xo,minLength:()=>dn,minSize:()=>Ht,multipleOf:()=>Hn,negative:()=>dc,nonnegative:()=>mc,nonpositive:()=>pc,normalize:()=>ko,overwrite:()=>It,positive:()=>uc,property:()=>fc,regex:()=>fo,size:()=>vr,slugify:()=>$o,startsWith:()=>yo,toLowerCase:()=>So,toUpperCase:()=>_o,trim:()=>wo,uppercase:()=>ho});var Ao={};nn(Ao,{ZodISODate:()=>wc,ZodISODateTime:()=>kc,ZodISODuration:()=>_c,ZodISOTime:()=>Sc,date:()=>Rf,datetime:()=>Tf,duration:()=>Df,time:()=>Of});var kc=b("ZodISODateTime",(e,t)=>{ap.init(e,t),he.init(e,t)});function Tf(e){return dm(kc,e)}var wc=b("ZodISODate",(e,t)=>{cp.init(e,t),he.init(e,t)});function Rf(e){return pm(wc,e)}var Sc=b("ZodISOTime",(e,t)=>{lp.init(e,t),he.init(e,t)});function Of(e){return mm(Sc,e)}var _c=b("ZodISODuration",(e,t)=>{up.init(e,t),he.init(e,t)});function Df(e){return fm(_c,e)}var ek=(e,t)=>{Ti.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>Oi(e,r)},flatten:{value:r=>Ri(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,oo,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,oo,2)}},isEmpty:{get(){return e.issues.length===0}}})},PR=b("ZodError",ek),nt=b("ZodError",ek,{Parent:Error});var Nf=ao(nt),Lf=co(nt),Uf=lo(nt),jf=uo(nt),zf=ya(nt),Ff=ba(nt),Mf=xa(nt),Bf=ka(nt),Hf=wa(nt),Zf=Sa(nt),Gf=_a(nt),Wf=$a(nt);var tk=new WeakMap;function Ji(e,t,r){let o=Object.getPrototypeOf(e),n=tk.get(o);if(n||(n=new Set,tk.set(o,n)),!n.has(t)){n.add(t);for(let i in r){let s=r[i];Object.defineProperty(o,i,{configurable:!0,enumerable:!1,get(){let a=s.bind(this);return Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:a}),a},set(a){Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:a})}})}}}var ee=b("ZodType",(e,t)=>(V.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Eo(e,"input"),output:Eo(e,"output")}}),e.toJSONSchema=Wm(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(r,o)=>Nf(e,r,o,{callee:e.parse}),e.safeParse=(r,o)=>Uf(e,r,o),e.parseAsync=async(r,o)=>Lf(e,r,o,{callee:e.parseAsync}),e.safeParseAsync=async(r,o)=>jf(e,r,o),e.spa=e.safeParseAsync,e.encode=(r,o)=>zf(e,r,o),e.decode=(r,o)=>Ff(e,r,o),e.encodeAsync=async(r,o)=>Mf(e,r,o),e.decodeAsync=async(r,o)=>Bf(e,r,o),e.safeEncode=(r,o)=>Hf(e,r,o),e.safeDecode=(r,o)=>Zf(e,r,o),e.safeEncodeAsync=async(r,o)=>Gf(e,r,o),e.safeDecodeAsync=async(r,o)=>Wf(e,r,o),Ji(e,"ZodType",{check(...r){let o=this.def;return this.clone(C.mergeDefs(o,{checks:[...o.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,o){return Ze(this,r,o)},brand(){return this},register(r,o){return r.add(this,o),this},refine(r,o){return this.check(Ug(r,o))},superRefine(r,o){return this.check(jg(r,o))},overwrite(r){return this.check(It(r))},optional(){return Vi(this)},exactOptional(){return yg(this)},nullable(){return qi(this)},nullish(){return Vi(qi(this))},nonoptional(r){return _g(this,r)},array(){return Yi(this)},or(r){return Wc([this,r])},and(r){return cg(this,r)},transform(r){return Ic(this,qc(r))},default(r){return kg(this,r)},prefault(r){return Sg(this,r)},catch(r){return Eg(this,r)},pipe(r){return Ic(this,r)},readonly(){return Tg(this)},describe(r){let o=this.clone();return De.add(o,{description:r}),o},meta(...r){if(r.length===0)return De.get(this);let o=this.clone();return De.add(o,r[0]),o},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(e,"description",{get(){return De.get(e)?.description},configurable:!0}),e)),Ec=b("_ZodString",(e,t)=>{hr.init(e,t),ee.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Vm(e,o,n,i);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,Ji(e,"_ZodString",{regex(...o){return this.check(fo(...o))},includes(...o){return this.check(vo(...o))},startsWith(...o){return this.check(yo(...o))},endsWith(...o){return this.check(bo(...o))},min(...o){return this.check(dn(...o))},max(...o){return this.check(yr(...o))},length(...o){return this.check(br(...o))},nonempty(...o){return this.check(dn(1,...o))},lowercase(o){return this.check(go(o))},uppercase(o){return this.check(ho(o))},trim(){return this.check(wo())},normalize(...o){return this.check(ko(...o))},toLowerCase(){return this.check(So())},toUpperCase(){return this.check(_o())},slugify(){return this.check($o())}})}),To=b("ZodString",(e,t)=>{hr.init(e,t),Ec.init(e,t),e.email=r=>e.check(Za(Ac,r)),e.url=r=>e.check(Hi(Ki,r)),e.jwt=r=>e.check(lc(Hc,r)),e.emoji=r=>e.check(Ja(Pc,r)),e.guid=r=>e.check(Bi(Wi,r)),e.uuid=r=>e.check(Ga(Zt,r)),e.uuidv4=r=>e.check(Wa(Zt,r)),e.uuidv6=r=>e.check(Va(Zt,r)),e.uuidv7=r=>e.check(qa(Zt,r)),e.nanoid=r=>e.check(Ka(Cc,r)),e.guid=r=>e.check(Bi(Wi,r)),e.cuid=r=>e.check(Xa(Tc,r)),e.cuid2=r=>e.check(Ya(Rc,r)),e.ulid=r=>e.check(Qa(Oc,r)),e.base64=r=>e.check(sc(Fc,r)),e.base64url=r=>e.check(ac(Mc,r)),e.xid=r=>e.check(ec(Dc,r)),e.ksuid=r=>e.check(tc(Nc,r)),e.ipv4=r=>e.check(nc(Lc,r)),e.ipv6=r=>e.check(rc(Uc,r)),e.cidrv4=r=>e.check(oc(jc,r)),e.cidrv6=r=>e.check(ic(zc,r)),e.e164=r=>e.check(cc(Bc,r)),e.datetime=r=>e.check(Tf(r)),e.date=r=>e.check(Rf(r)),e.time=r=>e.check(Of(r)),e.duration=r=>e.check(Df(r))});function Gi(e){return am(To,e)}var he=b("ZodStringFormat",(e,t)=>{ge.init(e,t),Ec.init(e,t)}),Ac=b("ZodEmail",(e,t)=>{Yd.init(e,t),he.init(e,t)});function nk(e){return Za(Ac,e)}var Wi=b("ZodGUID",(e,t)=>{Kd.init(e,t),he.init(e,t)});function rk(e){return Bi(Wi,e)}var Zt=b("ZodUUID",(e,t)=>{Xd.init(e,t),he.init(e,t)});function ok(e){return Ga(Zt,e)}function ik(e){return Wa(Zt,e)}function sk(e){return Va(Zt,e)}function ak(e){return qa(Zt,e)}var Ki=b("ZodURL",(e,t)=>{Qd.init(e,t),he.init(e,t)});function ck(e){return Hi(Ki,e)}function lk(e){return Hi(Ki,{protocol:it.httpProtocol,hostname:it.domain,...C.normalizeParams(e)})}var Pc=b("ZodEmoji",(e,t)=>{ep.init(e,t),he.init(e,t)});function uk(e){return Ja(Pc,e)}var Cc=b("ZodNanoID",(e,t)=>{tp.init(e,t),he.init(e,t)});function dk(e){return Ka(Cc,e)}var Tc=b("ZodCUID",(e,t)=>{np.init(e,t),he.init(e,t)});function pk(e){return Xa(Tc,e)}var Rc=b("ZodCUID2",(e,t)=>{rp.init(e,t),he.init(e,t)});function mk(e){return Ya(Rc,e)}var Oc=b("ZodULID",(e,t)=>{op.init(e,t),he.init(e,t)});function fk(e){return Qa(Oc,e)}var Dc=b("ZodXID",(e,t)=>{ip.init(e,t),he.init(e,t)});function gk(e){return ec(Dc,e)}var Nc=b("ZodKSUID",(e,t)=>{sp.init(e,t),he.init(e,t)});function hk(e){return tc(Nc,e)}var Lc=b("ZodIPv4",(e,t)=>{dp.init(e,t),he.init(e,t)});function vk(e){return nc(Lc,e)}var Vf=b("ZodMAC",(e,t)=>{mp.init(e,t),he.init(e,t)});function yk(e){return lm(Vf,e)}var Uc=b("ZodIPv6",(e,t)=>{pp.init(e,t),he.init(e,t)});function bk(e){return rc(Uc,e)}var jc=b("ZodCIDRv4",(e,t)=>{fp.init(e,t),he.init(e,t)});function xk(e){return oc(jc,e)}var zc=b("ZodCIDRv6",(e,t)=>{gp.init(e,t),he.init(e,t)});function kk(e){return ic(zc,e)}var Fc=b("ZodBase64",(e,t)=>{vp.init(e,t),he.init(e,t)});function wk(e){return sc(Fc,e)}var Mc=b("ZodBase64URL",(e,t)=>{yp.init(e,t),he.init(e,t)});function Sk(e){return ac(Mc,e)}var Bc=b("ZodE164",(e,t)=>{bp.init(e,t),he.init(e,t)});function _k(e){return cc(Bc,e)}var Hc=b("ZodJWT",(e,t)=>{xp.init(e,t),he.init(e,t)});function $k(e){return lc(Hc,e)}var Ro=b("ZodCustomStringFormat",(e,t)=>{kp.init(e,t),he.init(e,t)});function Ik(e,t,r={}){return Io(Ro,e,t,r)}function Ek(e){return Io(Ro,"hostname",it.hostname,e)}function Ak(e){return Io(Ro,"hex",it.hex,e)}function Pk(e,t){let r=t?.enc??"hex",o=`${e}_${r}`,n=it[o];if(!n)throw new Error(`Unrecognized hash format: ${o}`);return Io(Ro,o,n,t)}var Oo=b("ZodNumber",(e,t)=>{Da.init(e,t),ee.init(e,t),e._zod.processJSONSchema=(o,n,i)=>qm(e,o,n,i),Ji(e,"ZodNumber",{gt(o,n){return this.check(Bt(o,n))},gte(o,n){return this.check(We(o,n))},min(o,n){return this.check(We(o,n))},lt(o,n){return this.check(Mt(o,n))},lte(o,n){return this.check(st(o,n))},max(o,n){return this.check(st(o,n))},int(o){return this.check($c(o))},safe(o){return this.check($c(o))},positive(o){return this.check(Bt(0,o))},nonnegative(o){return this.check(We(0,o))},negative(o){return this.check(Mt(0,o))},nonpositive(o){return this.check(st(0,o))},multipleOf(o,n){return this.check(Hn(o,n))},step(o,n){return this.check(Hn(o,n))},finite(){return this}});let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function qf(e){return gm(Oo,e)}var kr=b("ZodNumberFormat",(e,t)=>{wp.init(e,t),Oo.init(e,t)});function $c(e){return vm(kr,e)}function Ck(e){return ym(kr,e)}function Tk(e){return bm(kr,e)}function Rk(e){return xm(kr,e)}function Ok(e){return km(kr,e)}var Do=b("ZodBoolean",(e,t)=>{Ui.init(e,t),ee.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Jm(e,r,o,n)});function Jf(e){return wm(Do,e)}var No=b("ZodBigInt",(e,t)=>{Na.init(e,t),ee.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Km(e,o,n,i),e.gte=(o,n)=>e.check(We(o,n)),e.min=(o,n)=>e.check(We(o,n)),e.gt=(o,n)=>e.check(Bt(o,n)),e.gte=(o,n)=>e.check(We(o,n)),e.min=(o,n)=>e.check(We(o,n)),e.lt=(o,n)=>e.check(Mt(o,n)),e.lte=(o,n)=>e.check(st(o,n)),e.max=(o,n)=>e.check(st(o,n)),e.positive=o=>e.check(Bt(BigInt(0),o)),e.negative=o=>e.check(Mt(BigInt(0),o)),e.nonpositive=o=>e.check(st(BigInt(0),o)),e.nonnegative=o=>e.check(We(BigInt(0),o)),e.multipleOf=(o,n)=>e.check(Hn(o,n));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});function Dk(e){return _m(No,e)}var Zc=b("ZodBigIntFormat",(e,t)=>{Sp.init(e,t),No.init(e,t)});function Nk(e){return Im(Zc,e)}function Lk(e){return Em(Zc,e)}var Kf=b("ZodSymbol",(e,t)=>{_p.init(e,t),ee.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Xm(e,r,o,n)});function Uk(e){return Am(Kf,e)}var Xf=b("ZodUndefined",(e,t)=>{$p.init(e,t),ee.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Qm(e,r,o,n)});function jk(e){return Pm(Xf,e)}var Yf=b("ZodNull",(e,t)=>{Ip.init(e,t),ee.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ym(e,r,o,n)});function Qf(e){return Cm(Yf,e)}var eg=b("ZodAny",(e,t)=>{Ep.init(e,t),ee.init(e,t),e._zod.processJSONSchema=(r,o,n)=>nf(e,r,o,n)});function zk(){return Tm(eg)}var tg=b("ZodUnknown",(e,t)=>{Ap.init(e,t),ee.init(e,t),e._zod.processJSONSchema=(r,o,n)=>rf(e,r,o,n)});function xr(){return Rm(tg)}var ng=b("ZodNever",(e,t)=>{Pp.init(e,t),ee.init(e,t),e._zod.processJSONSchema=(r,o,n)=>tf(e,r,o,n)});function Gc(e){return Om(ng,e)}var rg=b("ZodVoid",(e,t)=>{Cp.init(e,t),ee.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ef(e,r,o,n)});function Fk(e){return Dm(rg,e)}var Xi=b("ZodDate",(e,t)=>{Tp.init(e,t),ee.init(e,t),e._zod.processJSONSchema=(o,n,i)=>of(e,o,n,i),e.min=(o,n)=>e.check(We(o,n)),e.max=(o,n)=>e.check(st(o,n));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});function Mk(e){return Nm(Xi,e)}var og=b("ZodArray",(e,t)=>{Rp.init(e,t),ee.init(e,t),e._zod.processJSONSchema=(r,o,n)=>vf(e,r,o,n),e.element=t.element,Ji(e,"ZodArray",{min(r,o){return this.check(dn(r,o))},nonempty(r){return this.check(dn(1,r))},max(r,o){return this.check(yr(r,o))},length(r,o){return this.check(br(r,o))},unwrap(){return this.element}})});function Yi(e,t){return jm(og,e,t)}function Bk(e){let t=e._zod.def.shape;return Vc(Object.keys(t))}var Qi=b("ZodObject",(e,t)=>{Op.init(e,t),ee.init(e,t),e._zod.processJSONSchema=(r,o,n)=>yf(e,r,o,n),C.defineLazy(e,"shape",()=>t.shape),Ji(e,"ZodObject",{keyof(){return Vc(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:xr()})},loose(){return this.clone({...this._zod.def,catchall:xr()})},strict(){return this.clone({...this._zod.def,catchall:Gc()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return C.extend(this,r)},safeExtend(r){return C.safeExtend(this,r)},merge(r){return C.merge(this,r)},pick(r){return C.pick(this,r)},omit(r){return C.omit(this,r)},partial(...r){return C.partial(Jc,this,r[0])},required(...r){return C.required(Kc,this,r[0])}})});function Hk(e,t){let r={type:"object",shape:e??{},...C.normalizeParams(t)};return new Qi(r)}function Zk(e,t){return new Qi({type:"object",shape:e,catchall:Gc(),...C.normalizeParams(t)})}function Gk(e,t){return new Qi({type:"object",shape:e,catchall:xr(),...C.normalizeParams(t)})}var es=b("ZodUnion",(e,t)=>{ji.init(e,t),ee.init(e,t),e._zod.processJSONSchema=(r,o,n)=>hc(e,r,o,n),e.options=t.options});function Wc(e,t){return new es({type:"union",options:e,...C.normalizeParams(t)})}var ig=b("ZodXor",(e,t)=>{es.init(e,t),Dp.init(e,t),e._zod.processJSONSchema=(r,o,n)=>hc(e,r,o,n),e.options=t.options});function Wk(e,t){return new ig({type:"union",options:e,inclusive:!1,...C.normalizeParams(t)})}var sg=b("ZodDiscriminatedUnion",(e,t)=>{es.init(e,t),Np.init(e,t)});function Vk(e,t,r){return new sg({type:"union",options:t,discriminator:e,...C.normalizeParams(r)})}var ag=b("ZodIntersection",(e,t)=>{Lp.init(e,t),ee.init(e,t),e._zod.processJSONSchema=(r,o,n)=>bf(e,r,o,n)});function cg(e,t){return new ag({type:"intersection",left:e,right:t})}var lg=b("ZodTuple",(e,t)=>{La.init(e,t),ee.init(e,t),e._zod.processJSONSchema=(r,o,n)=>xf(e,r,o,n),e.rest=r=>e.clone({...e._zod.def,rest:r})});function ug(e,t,r){let o=t instanceof V,n=o?r:t,i=o?t:null;return new lg({type:"tuple",items:e,rest:i,...C.normalizeParams(n)})}var Po=b("ZodRecord",(e,t)=>{Up.init(e,t),ee.init(e,t),e._zod.processJSONSchema=(r,o,n)=>kf(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});function dg(e,t,r){return!t||!t._zod?new Po({type:"record",keyType:Gi(),valueType:e,...C.normalizeParams(t)}):new Po({type:"record",keyType:e,valueType:t,...C.normalizeParams(r)})}function qk(e,t,r){let o=Ze(e);return o._zod.values=void 0,new Po({type:"record",keyType:o,valueType:t,...C.normalizeParams(r)})}function Jk(e,t,r){return new Po({type:"record",keyType:e,valueType:t,mode:"loose",...C.normalizeParams(r)})}var pg=b("ZodMap",(e,t)=>{jp.init(e,t),ee.init(e,t),e._zod.processJSONSchema=(r,o,n)=>gf(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(Ht(...r)),e.nonempty=r=>e.check(Ht(1,r)),e.max=(...r)=>e.check(Zn(...r)),e.size=(...r)=>e.check(vr(...r))});function Kk(e,t,r){return new pg({type:"map",keyType:e,valueType:t,...C.normalizeParams(r)})}var mg=b("ZodSet",(e,t)=>{zp.init(e,t),ee.init(e,t),e._zod.processJSONSchema=(r,o,n)=>hf(e,r,o,n),e.min=(...r)=>e.check(Ht(...r)),e.nonempty=r=>e.check(Ht(1,r)),e.max=(...r)=>e.check(Zn(...r)),e.size=(...r)=>e.check(vr(...r))});function Xk(e,t){return new mg({type:"set",valueType:e,...C.normalizeParams(t)})}var Co=b("ZodEnum",(e,t)=>{Fp.init(e,t),ee.init(e,t),e._zod.processJSONSchema=(o,n,i)=>sf(e,o,n,i),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(o,n)=>{let i={};for(let s of o)if(r.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new Co({...t,checks:[],...C.normalizeParams(n),entries:i})},e.exclude=(o,n)=>{let i={...t.entries};for(let s of o)if(r.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new Co({...t,checks:[],...C.normalizeParams(n),entries:i})}});function Vc(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new Co({type:"enum",entries:r,...C.normalizeParams(t)})}function Yk(e,t){return new Co({type:"enum",entries:e,...C.normalizeParams(t)})}var fg=b("ZodLiteral",(e,t)=>{Mp.init(e,t),ee.init(e,t),e._zod.processJSONSchema=(r,o,n)=>af(e,r,o,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Qk(e,t){return new fg({type:"literal",values:Array.isArray(e)?e:[e],...C.normalizeParams(t)})}var gg=b("ZodFile",(e,t)=>{Bp.init(e,t),ee.init(e,t),e._zod.processJSONSchema=(r,o,n)=>uf(e,r,o,n),e.min=(r,o)=>e.check(Ht(r,o)),e.max=(r,o)=>e.check(Zn(r,o)),e.mime=(r,o)=>e.check(xo(Array.isArray(r)?r:[r],o))});function ew(e){return zm(gg,e)}var hg=b("ZodTransform",(e,t)=>{Hp.init(e,t),ee.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ff(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new jn(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(C.issue(i,r.value,t));else{let s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=e),r.issues.push(C.issue(s))}};let n=t.transform(r.value,r);return n instanceof Promise?n.then(i=>(r.value=i,r.fallback=!0,r)):(r.value=n,r.fallback=!0,r)}});function qc(e){return new hg({type:"transform",transform:e})}var Jc=b("ZodOptional",(e,t)=>{Ua.init(e,t),ee.init(e,t),e._zod.processJSONSchema=(r,o,n)=>vc(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Vi(e){return new Jc({type:"optional",innerType:e})}var vg=b("ZodExactOptional",(e,t)=>{Zp.init(e,t),ee.init(e,t),e._zod.processJSONSchema=(r,o,n)=>vc(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function yg(e){return new vg({type:"optional",innerType:e})}var bg=b("ZodNullable",(e,t)=>{Gp.init(e,t),ee.init(e,t),e._zod.processJSONSchema=(r,o,n)=>wf(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function qi(e){return new bg({type:"nullable",innerType:e})}function tw(e){return Vi(qi(e))}var xg=b("ZodDefault",(e,t)=>{Wp.init(e,t),ee.init(e,t),e._zod.processJSONSchema=(r,o,n)=>_f(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function kg(e,t){return new xg({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():C.shallowClone(t)}})}var wg=b("ZodPrefault",(e,t)=>{Vp.init(e,t),ee.init(e,t),e._zod.processJSONSchema=(r,o,n)=>$f(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Sg(e,t){return new wg({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():C.shallowClone(t)}})}var Kc=b("ZodNonOptional",(e,t)=>{qp.init(e,t),ee.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Sf(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function _g(e,t){return new Kc({type:"nonoptional",innerType:e,...C.normalizeParams(t)})}var $g=b("ZodSuccess",(e,t)=>{Jp.init(e,t),ee.init(e,t),e._zod.processJSONSchema=(r,o,n)=>df(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function nw(e){return new $g({type:"success",innerType:e})}var Ig=b("ZodCatch",(e,t)=>{Kp.init(e,t),ee.init(e,t),e._zod.processJSONSchema=(r,o,n)=>If(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Eg(e,t){return new Ig({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var Ag=b("ZodNaN",(e,t)=>{Xp.init(e,t),ee.init(e,t),e._zod.processJSONSchema=(r,o,n)=>cf(e,r,o,n)});function rw(e){return Um(Ag,e)}var ts=b("ZodPipe",(e,t)=>{ja.init(e,t),ee.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ef(e,r,o,n),e.in=t.in,e.out=t.out});function Ic(e,t){return new ts({type:"pipe",in:e,out:t})}var ns=b("ZodCodec",(e,t)=>{ts.init(e,t),zi.init(e,t)});function ow(e,t,r){return new ns({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}function iw(e){let t=e._zod.def;return new ns({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var Pg=b("ZodPreprocess",(e,t)=>{ts.init(e,t),Yp.init(e,t)}),Cg=b("ZodReadonly",(e,t)=>{Qp.init(e,t),ee.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Af(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Tg(e){return new Cg({type:"readonly",innerType:e})}var Rg=b("ZodTemplateLiteral",(e,t)=>{em.init(e,t),ee.init(e,t),e._zod.processJSONSchema=(r,o,n)=>lf(e,r,o,n)});function sw(e,t){return new Rg({type:"template_literal",parts:e,...C.normalizeParams(t)})}var Og=b("ZodLazy",(e,t)=>{rm.init(e,t),ee.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Cf(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});function Dg(e){return new Og({type:"lazy",getter:e})}var Ng=b("ZodPromise",(e,t)=>{nm.init(e,t),ee.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Pf(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function aw(e){return new Ng({type:"promise",innerType:e})}var Lg=b("ZodFunction",(e,t)=>{tm.init(e,t),ee.init(e,t),e._zod.processJSONSchema=(r,o,n)=>mf(e,r,o,n)});function cw(e){return new Lg({type:"function",input:Array.isArray(e?.input)?ug(e?.input):e?.input??Yi(xr()),output:e?.output??xr()})}var rs=b("ZodCustom",(e,t)=>{om.init(e,t),ee.init(e,t),e._zod.processJSONSchema=(r,o,n)=>pf(e,r,o,n)});function lw(e){let t=new ye({check:"custom"});return t._zod.check=e,t}function uw(e,t){return Fm(rs,e??(()=>!0),t)}function Ug(e,t={}){return Mm(rs,e,t)}function jg(e,t){return Bm(e,t)}var dw=Hm,pw=Zm;function mw(e,t={}){let r=new rs({type:"custom",check:"custom",fn:o=>o instanceof e,abort:!0,...C.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=o=>{o.value instanceof e||o.issues.push({code:"invalid_type",expected:e.name,input:o.value,inst:r,path:[...r._zod.def.path??[]]})},r}var fw=(...e)=>Gm({Codec:ns,Boolean:Do,String:To},...e);function gw(e){let t=Dg(()=>Wc([Gi(e),qf(),Jf(),Qf(),Yi(t),dg(Gi(),t)]));return t}function hw(e,t){return new Pg({type:"pipe",in:qc(e),out:t})}var TR={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function RR(e){$e({customError:e})}function OR(){return $e().customError}var zg;zg||(zg={});var L={...Zi,...xc,iso:Ao},DR=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function NR(e,t){let r=e.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function LR(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;let o=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===o){let n=r[1];if(!n||!t.defs[n])throw new Error(`Reference not found: ${e}`);return t.defs[n]}throw new Error(`Reference not found: ${e}`)}function vw(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return L.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let n=e.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return L.lazy(()=>{if(!t.refs.has(n))throw new Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let i=LR(n,t),s=ze(i,t);return t.refs.set(n,s),t.processing.delete(n),s}if(e.enum!==void 0){let n=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&n.length===1&&n[0]===null)return L.null();if(n.length===0)return L.never();if(n.length===1)return L.literal(n[0]);if(n.every(s=>typeof s=="string"))return L.enum(n);let i=n.map(s=>L.literal(s));return i.length<2?i[0]:L.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return L.literal(e.const);let r=e.type;if(Array.isArray(r)){let n=r.map(i=>{let s={...e,type:i};return vw(s,t)});return n.length===0?L.never():n.length===1?n[0]:L.union(n)}if(!r)return L.any();let o;switch(r){case"string":{let n=L.string();if(e.format){let i=e.format;i==="email"?n=n.check(L.email()):i==="uri"||i==="uri-reference"?n=n.check(L.url()):i==="uuid"||i==="guid"?n=n.check(L.uuid()):i==="date-time"?n=n.check(L.iso.datetime()):i==="date"?n=n.check(L.iso.date()):i==="time"?n=n.check(L.iso.time()):i==="duration"?n=n.check(L.iso.duration()):i==="ipv4"?n=n.check(L.ipv4()):i==="ipv6"?n=n.check(L.ipv6()):i==="mac"?n=n.check(L.mac()):i==="cidr"?n=n.check(L.cidrv4()):i==="cidr-v6"?n=n.check(L.cidrv6()):i==="base64"?n=n.check(L.base64()):i==="base64url"?n=n.check(L.base64url()):i==="e164"?n=n.check(L.e164()):i==="jwt"?n=n.check(L.jwt()):i==="emoji"?n=n.check(L.emoji()):i==="nanoid"?n=n.check(L.nanoid()):i==="cuid"?n=n.check(L.cuid()):i==="cuid2"?n=n.check(L.cuid2()):i==="ulid"?n=n.check(L.ulid()):i==="xid"?n=n.check(L.xid()):i==="ksuid"&&(n=n.check(L.ksuid()))}typeof e.minLength=="number"&&(n=n.min(e.minLength)),typeof e.maxLength=="number"&&(n=n.max(e.maxLength)),e.pattern&&(n=n.regex(new RegExp(e.pattern))),o=n;break}case"number":case"integer":{let n=r==="integer"?L.number().int():L.number();typeof e.minimum=="number"&&(n=n.min(e.minimum)),typeof e.maximum=="number"&&(n=n.max(e.maximum)),typeof e.exclusiveMinimum=="number"?n=n.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(n=n.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?n=n.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(n=n.lt(e.maximum)),typeof e.multipleOf=="number"&&(n=n.multipleOf(e.multipleOf)),o=n;break}case"boolean":{o=L.boolean();break}case"null":{o=L.null();break}case"object":{let n={},i=e.properties||{},s=new Set(e.required||[]);for(let[l,u]of Object.entries(i)){let d=ze(u,t);n[l]=s.has(l)?d:d.optional()}if(e.propertyNames){let l=ze(e.propertyNames,t),u=e.additionalProperties&&typeof e.additionalProperties=="object"?ze(e.additionalProperties,t):L.any();if(Object.keys(n).length===0){o=L.record(l,u);break}let d=L.object(n).passthrough(),p=L.looseRecord(l,u);o=L.intersection(d,p);break}if(e.patternProperties){let l=e.patternProperties,u=Object.keys(l),d=[];for(let m of u){let f=ze(l[m],t),g=L.string().regex(new RegExp(m));d.push(L.looseRecord(g,f))}let p=[];if(Object.keys(n).length>0&&p.push(L.object(n).passthrough()),p.push(...d),p.length===0)o=L.object({}).passthrough();else if(p.length===1)o=p[0];else{let m=L.intersection(p[0],p[1]);for(let f=2;f<p.length;f++)m=L.intersection(m,p[f]);o=m}break}let a=L.object(n);e.additionalProperties===!1?o=a.strict():typeof e.additionalProperties=="object"?o=a.catchall(ze(e.additionalProperties,t)):o=a.passthrough();break}case"array":{let n=e.prefixItems,i=e.items;if(n&&Array.isArray(n)){let s=n.map(l=>ze(l,t)),a=i&&typeof i=="object"&&!Array.isArray(i)?ze(i,t):void 0;a?o=L.tuple(s).rest(a):o=L.tuple(s),typeof e.minItems=="number"&&(o=o.check(L.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(L.maxLength(e.maxItems)))}else if(Array.isArray(i)){let s=i.map(l=>ze(l,t)),a=e.additionalItems&&typeof e.additionalItems=="object"?ze(e.additionalItems,t):void 0;a?o=L.tuple(s).rest(a):o=L.tuple(s),typeof e.minItems=="number"&&(o=o.check(L.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(L.maxLength(e.maxItems)))}else if(i!==void 0){let s=ze(i,t),a=L.array(s);typeof e.minItems=="number"&&(a=a.min(e.minItems)),typeof e.maxItems=="number"&&(a=a.max(e.maxItems)),o=a}else o=L.array(L.any());break}default:throw new Error(`Unsupported type: ${r}`)}return o}function ze(e,t){if(typeof e=="boolean")return e?L.any():L.never();let r=vw(e,t),o=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let a=e.anyOf.map(u=>ze(u,t)),l=L.union(a);r=o?L.intersection(r,l):l}if(e.oneOf&&Array.isArray(e.oneOf)){let a=e.oneOf.map(u=>ze(u,t)),l=L.xor(a);r=o?L.intersection(r,l):l}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=o?r:L.any();else{let a=o?r:ze(e.allOf[0],t),l=o?0:1;for(let u=l;u<e.allOf.length;u++)a=L.intersection(a,ze(e.allOf[u],t));r=a}e.nullable===!0&&t.version==="openapi-3.0"&&(r=L.nullable(r)),e.readOnly===!0&&(r=L.readonly(r)),e.default!==void 0&&(r=r.default(e.default));let n={},i=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let a of i)a in e&&(n[a]=e[a]);let s=["contentEncoding","contentMediaType","contentSchema"];for(let a of s)a in e&&(n[a]=e[a]);for(let a of Object.keys(e))DR.has(a)||(n[a]=e[a]);return Object.keys(n).length>0&&t.registry.add(r,n),e.description&&(r=r.describe(e.description)),r}function yw(e,t){if(typeof e=="boolean")return e?L.any():L.never();let r;try{r=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let o=NR(r,t?.defaultTarget),n=r.$defs||r.definitions||{},i={version:o,defs:n,refs:new Map,processing:new Set,rootSchema:r,registry:t?.registry??De};return ze(r,i)}var Fg={};nn(Fg,{bigint:()=>FR,boolean:()=>zR,date:()=>MR,number:()=>jR,string:()=>UR});function UR(e){return cm(To,e)}function jR(e){return hm(Oo,e)}function zR(e){return Sm(Do,e)}function FR(e){return $m(No,e)}function MR(e){return Lm(Xi,e)}$e(za());var ae=c.number().min(0).max(100),gn=c.number().int().min(1e3).max(12e3),fn=c.number(),te=c.number().int().nonnegative(),Et=c.enum(["hue","matter","smartthings","homeassistant","nest","alexa","google","kasa","wiz","lifx","shelly","govee","tapo","tuya","yeelight","nanoleaf","meross","ewelink","wled","elgato","roku","mqtt","esphome","mock","other"]),BR=c.enum(["local","cloud","offline","unknown"]),os=c.enum(["light","plug","switch","dimmer","thermostat","lock","cover","garageDoor","valve","fan","sensor","binarySensor","camera","doorbell","speaker","tv","mediaPlayer","vacuum","appliance","airPurifier","humidifier","waterHeater","evCharger","sceneController","remote","scene","group","bridge","other"]),HR=c.enum(["temperature","humidity","illuminance","pressure","co2","pm25","pm10","voc","airQuality","noise","uvIndex","windSpeed","distance","generic"]),ZR=c.enum(["motion","occupancy","presence","contact","leak","smoke","co","gas","tamper","vibration","glassBreak","button","person","sound","moisture","generic"]);var xe=(e,t)=>c.object({type:c.literal(e),instance:c.string().optional(),...t}),GR=xe("power",{state:c.object({on:c.boolean().nullable()})}),WR=xe("brightness",{state:c.object({level:ae.nullable()})}),VR=xe("colorTemperature",{config:c.object({minKelvin:gn,maxKelvin:gn}),state:c.object({kelvin:gn.nullable()})}),qR=xe("color",{config:c.object({modes:c.array(c.enum(["hs","rgb","xy"])).default(["hs"])}),state:c.object({hue:c.number().min(0).max(360).nullable(),saturation:ae.nullable()})}),JR=xe("segmentColor",{config:c.object({segments:c.number().int().min(1)}),state:c.object({colors:c.array(c.object({hue:c.number().min(0).max(360).nullable(),saturation:ae.nullable()})).nullable()})}),Hg=c.enum(["off","heat","cool","auto","eco","fanOnly","dry"]),KR=xe("thermostat",{config:c.object({modes:c.array(Hg),minC:fn,maxC:fn,supportsRange:c.boolean().default(!1)}),state:c.object({mode:Hg.nullable(),currentC:fn.nullable(),setpointC:fn.nullable().optional(),heatC:fn.nullable().optional(),coolC:fn.nullable().optional(),action:c.enum(["idle","heating","cooling","fan"]).nullable().optional()})}),XR=xe("humidity",{config:c.object({settable:c.boolean().default(!1),minPct:ae.default(0),maxPct:ae.default(100)}),state:c.object({currentPct:ae.nullable().optional(),targetPct:ae.nullable().optional()})}),YR=xe("lock",{state:c.object({state:c.enum(["locked","unlocked","jammed","unknown"])})}),QR=xe("cover",{config:c.object({kind:c.enum(["blind","shade","curtain","awning","garage","door","window","valve","generic"]),supportsPosition:c.boolean().default(!1),supportsTilt:c.boolean().default(!1)}),state:c.object({position:ae.nullable().optional(),tilt:ae.nullable().optional(),state:c.enum(["open","closed","opening","closing","stopped","partial","unknown"])})}),e1=xe("fan",{config:c.object({presets:c.array(c.string()).default([]),supportsOscillate:c.boolean().default(!1)}),state:c.object({on:c.boolean().nullable(),level:ae.nullable().optional(),preset:c.string().nullable().optional(),oscillating:c.boolean().nullable().optional()})}),t1=xe("mode",{config:c.object({options:c.array(c.string())}),state:c.object({value:c.string().nullable()})}),n1=xe("toggle",{state:c.object({on:c.boolean().nullable()})}),r1=xe("range",{config:c.object({min:c.number(),max:c.number(),step:c.number().optional(),unit:c.string().optional()}),state:c.object({value:c.number().nullable()})}),o1=xe("mediaTransport",{state:c.object({state:c.enum(["playing","paused","stopped","buffering","idle"]).nullable(),metadata:c.object({title:c.string().optional(),artist:c.string().optional(),album:c.string().optional(),artworkUrl:c.string().optional()}).nullable().optional(),positionSec:c.number().nonnegative().nullable().optional(),durationSec:c.number().nonnegative().nullable().optional(),shuffle:c.boolean().nullable().optional(),repeat:c.enum(["off","one","all"]).nullable().optional()})}),i1=xe("volume",{state:c.object({level:ae.nullable(),muted:c.boolean().nullable()})}),s1=xe("inputSource",{config:c.object({sources:c.array(c.string())}),state:c.object({source:c.string().nullable()})}),a1=xe("startStop",{config:c.object({supportsPause:c.boolean().default(!1)}),state:c.object({state:c.enum(["running","paused","stopped","unknown"])})}),c1=xe("scene",{state:c.object({lastActivated:te.nullable().optional()})}),l1=xe("camera",{config:c.object({protocols:c.array(c.enum(["rtsp","webrtc","hls","snapshot"]))}),state:c.object({streaming:c.boolean().nullable().optional()})}),u1=xe("sensor",{config:c.object({measurement:HR,unit:c.string()}),state:c.object({value:c.number().nullable(),ts:te.nullable().optional()})}),d1=xe("binarySensor",{config:c.object({sensorType:ZR}),state:c.object({active:c.boolean().nullable(),lastChanged:te.nullable().optional()})}),p1=xe("battery",{state:c.object({level:ae.nullable(),charging:c.boolean().nullable().optional(),low:c.boolean().nullable().optional()})}),m1=xe("energyMeter",{state:c.object({power:c.number().nullable().optional(),energy:c.number().nullable().optional(),voltage:c.number().nullable().optional(),current:c.number().nullable().optional()})}),f1=xe("doorbell",{state:c.object({lastPress:te.nullable().optional()})}),g1=xe("connectivity",{config:c.object({transport:c.enum(["wifi","thread","zigbee","zwave","ethernet","ble","cloud","matter","unknown"])}),state:c.object({online:c.boolean().nullable(),signal:c.number().nullable().optional()})}),bw=c.enum(["flash","strobe","pulse","colorFade","colorLoop","candle","rainbow","siren","meter"]),at=c.object({hue:c.number().min(0).max(360),saturation:ae}),mn=c.number().int().min(20).max(6e5),Mg=c.number().int().min(1).max(1e3).nullable().default(null),wr=c.discriminatedUnion("kind",[c.object({kind:c.literal("flash"),count:c.number().int().min(1).max(100).default(3),onMs:mn.default(300),offMs:mn.default(300),color:at.nullable().default(null),brightness:ae.nullable().default(null)}),c.object({kind:c.literal("strobe"),hz:c.number().min(.5).max(25).default(8),durationMs:mn.default(3e3),color:at.nullable().default(null)}),c.object({kind:c.literal("pulse"),periodMs:mn.default(2e3),minPct:ae.default(5),maxPct:ae.default(100),color:at.nullable().default(null),cycles:Mg}),c.object({kind:c.literal("colorFade"),from:at.nullable().default(null),to:at,durationMs:mn.default(2e3),easing:c.enum(["linear","ease"]).default("ease")}),c.object({kind:c.literal("colorLoop"),colors:c.array(at).min(2).max(16),holdMs:mn.default(1e3),fadeMs:c.number().int().min(0).max(6e5).default(800),loops:Mg,direction:c.enum(["forward","pingpong"]).default("forward")}),c.object({kind:c.literal("candle"),intensity:ae.default(50),warmthKelvin:gn.nullable().default(null),durationMs:mn.nullable().default(null)}),c.object({kind:c.literal("rainbow"),cycleMs:mn.default(4e3),saturation:ae.default(100),brightness:ae.default(100),loops:Mg}),c.object({kind:c.literal("siren"),colorA:at.default({hue:0,saturation:100}),colorB:at.default({hue:240,saturation:100}),hz:c.number().min(.5).max(10).default(4),durationMs:mn.nullable().default(null)}),c.object({kind:c.literal("meter"),source:c.enum(["context","usage","cost"]),stops:c.array(c.object({at:c.number().min(0),color:at})).min(2).max(6).default([{at:0,color:{hue:120,saturation:90}},{at:75,color:{hue:40,saturation:95}},{at:95,color:{hue:0,saturation:95}}])})]),h1=xe("effect",{config:c.object({kinds:c.array(bw).default(["flash"]),supportsColor:c.boolean().default(!1)}),state:c.object({active:bw.nullable()})}),v1=c.discriminatedUnion("type",[GR,WR,VR,qR,JR,KR,XR,YR,QR,e1,t1,n1,r1,o1,i1,s1,a1,c1,l1,u1,d1,p1,m1,f1,g1,h1]),At=c.enum(["power","brightness","colorTemperature","color","segmentColor","thermostat","humidity","lock","cover","fan","mode","toggle","range","mediaTransport","volume","inputSource","startStop","scene","camera","sensor","binarySensor","battery","energyMeter","doorbell","connectivity","effect"]),ww=c.enum(["needs-password"]),y1=c.object({sourceId:c.string(),provider:Et,providerAccountId:c.string(),nativeId:c.string(),nativeType:c.string().optional(),reachability:c.enum(["local","cloud"]),online:c.boolean(),attention:ww.nullable().optional(),credentialRef:c.string().nullable().optional(),lastSeen:te.nullable().optional()}),b1=c.object({id:c.string(),name:c.string(),providerRefs:c.array(c.object({provider:Et,nativeId:c.string()})).default([])}),x1=c.object({accountId:c.string(),provider:Et,displayName:c.string(),reachability:c.enum(["local","cloud"]),status:c.enum(["linked","needs_reauth","revoked"]),expiresAt:te.nullable().optional()}),k1=c.object({id:c.string(),type:os,name:c.string(),areaId:c.string().nullable(),manufacturer:c.string().nullable().optional(),model:c.string().nullable().optional(),firmwareVersion:c.string().nullable().optional(),online:c.boolean(),reachability:BR,attention:ww.nullable().optional(),parentId:c.string().nullable().optional(),members:c.array(c.string()).optional(),sources:c.array(y1).min(1),preferredSourceId:c.string(),capabilities:c.array(v1),updatedAt:te,raw:c.unknown().optional()}),Sw=c.object({version:c.literal(1),nodeId:c.string(),updatedAt:te,areas:c.array(b1),accounts:c.array(x1),devices:c.array(k1)}),w1=c.enum(["relay-do-sealed","hub-local"]),WH=c.object({accountId:c.string(),provider:Et,providerAccountId:c.string(),nodeId:c.string(),credentialLocation:w1,scopes:c.array(c.string()).default([]),status:c.enum(["linked","needs_reauth","revoked"]),displayName:c.string(),expiresAt:te.nullable().optional(),linkedAt:te}),xw=c.enum(["open","guarded","locked"]),Bg=c.enum(["allow","confirm","deny"]),S1=c.enum(["voice","claude","app","rules"]),VH=c.object({tier:xw.default("open"),perConsumer:c.partialRecord(S1,xw).default({}),perClass:c.partialRecord(At,Bg).default({}),perDeviceType:c.partialRecord(os,Bg).default({}),perDevice:c.record(c.string(),Bg).default({}),confirmWindowSec:c.number().default(60)}),Ie=c.object({}),kw=e=>e.type==="cover"&&(e.config.kind==="garage"||e.config.kind==="door"),is={power:[{command:"turnOn",params:Ie},{command:"turnOff",params:Ie},{command:"toggle",params:Ie}],brightness:[{command:"setBrightness",params:c.object({level:ae})},{command:"adjustBrightness",params:c.object({delta:c.number().min(-100).max(100)})}],colorTemperature:[{command:"setColorTemperature",params:c.object({kelvin:gn})}],color:[{command:"setColor",params:c.object({hue:c.number().min(0).max(360),saturation:ae})}],segmentColor:[{command:"setSegmentColors",voice:!1,params:c.object({segments:c.array(c.object({index:c.number().int().nonnegative(),hue:c.number().min(0).max(360),saturation:ae})).min(1).max(512)})}],thermostat:[{command:"setThermostatMode",params:c.object({mode:Hg})},{command:"setSetpoint",params:c.object({celsius:fn})},{command:"setRange",params:c.object({heatCelsius:fn,coolCelsius:fn}),gate:e=>e.type==="thermostat"&&e.config.supportsRange}],humidity:[{command:"setHumidity",params:c.object({percent:ae}),gate:e=>e.type==="humidity"&&e.config.settable}],lock:[{command:"lock",params:Ie},{command:"unlock",params:Ie,confirm:!0}],cover:[{command:"open",params:Ie,confirm:kw},{command:"close",params:Ie},{command:"stop",params:Ie},{command:"setPosition",params:c.object({position:ae}),confirm:kw,gate:e=>e.type==="cover"&&e.config.supportsPosition},{command:"setTilt",params:c.object({tilt:ae}),gate:e=>e.type==="cover"&&e.config.supportsTilt}],fan:[{command:"turnOn",params:Ie},{command:"turnOff",params:Ie},{command:"setFanSpeed",params:c.object({level:ae})},{command:"setFanPreset",params:c.object({preset:c.string()}),gate:e=>e.type==="fan"&&e.config.presets.length>0},{command:"setOscillate",params:c.object({oscillating:c.boolean()}),gate:e=>e.type==="fan"&&e.config.supportsOscillate}],mode:[{command:"setMode",params:c.object({value:c.string()})}],toggle:[{command:"setToggle",params:c.object({on:c.boolean()})}],range:[{command:"setRange",params:c.object({value:c.number()})},{command:"adjustRange",params:c.object({delta:c.number()})}],mediaTransport:[{command:"play",params:Ie},{command:"pause",params:Ie},{command:"stop",params:Ie},{command:"next",params:Ie},{command:"previous",params:Ie},{command:"seek",params:c.object({positionSec:c.number().nonnegative()})},{command:"setShuffle",params:c.object({on:c.boolean()})},{command:"setRepeat",params:c.object({mode:c.enum(["off","one","all"])})}],volume:[{command:"setVolume",params:c.object({level:ae})},{command:"adjustVolume",params:c.object({delta:c.number().min(-100).max(100)})},{command:"setMute",params:c.object({muted:c.boolean()})}],inputSource:[{command:"selectInput",params:c.object({source:c.string()})}],startStop:[{command:"start",params:Ie},{command:"stop",params:Ie},{command:"pause",params:Ie,gate:e=>e.type==="startStop"&&e.config.supportsPause},{command:"resume",params:Ie,gate:e=>e.type==="startStop"&&e.config.supportsPause}],scene:[{command:"activate",params:Ie}],effect:[{command:"startEffect",params:c.object({spec:wr})},{command:"stopEffect",params:Ie}],camera:[{command:"getStream",params:c.object({protocol:c.enum(["rtsp","webrtc","hls"])}),voice:!1,returns:c.object({url:c.string(),token:c.string().optional(),expiresAt:te.optional()})},{command:"getSnapshot",params:Ie,voice:!1,returns:c.object({url:c.string(),expiresAt:te.optional()})}],sensor:[],binarySensor:[],battery:[],energyMeter:[],doorbell:[],connectivity:[]};var _1=c.discriminatedUnion("kind",[c.object({kind:c.literal("literal"),hue:c.number().min(0).max(360),saturation:ae}),c.object({kind:c.literal("token"),token:c.enum(["main","session"])})]),Xc=c.enum(["main","session","hold","off"]),Yc=c.object({color:_1.optional(),brightnessPct:ae.nullable().optional(),brightnessScale:c.number().min(0).max(2).optional(),kelvin:gn.nullable().optional(),power:c.boolean().optional()});var ss=c.enum(["added","removed","permission_request","started","ended","working","finished","error","idle","needs_permission","promptSubmitted","toolStart","toolEnd","subagentStart","subagentFinished","compacting","resumed","aborted","contextLow","contextCritical","needsInput","planReady","rateLimited","compactDone","permissionDenied","taskCompleted","usageHigh","modePlan","modeAuto","modeBypass","modeNormal","modelChanged","workflowStarted","sandboxEscalation","reviewChanged","costHigh","longRunning"]),hn=c.enum(["claude","codex"]);var $1=c.discriminatedUnion("kind",[c.object({kind:c.literal("deviceState"),deviceId:c.string(),capability:c.string(),instance:c.string().optional(),op:c.enum(["eq","neq","gt","lt","gte","lte","changed"]).default("changed"),path:c.string().optional(),value:c.unknown().optional()}),c.object({kind:c.literal("edge"),deviceId:c.string(),event:c.string()}),c.object({kind:c.literal("session"),event:ss,repo:c.string().optional(),sessionId:c.string().optional(),agent:hn.optional()}),c.object({kind:c.literal("schedule"),cron:c.string()})]),I1=c.object({deviceId:c.string(),capability:c.string(),instance:c.string().optional(),op:c.enum(["eq","neq","gt","lt","gte","lte"]),path:c.string().optional(),value:c.unknown()}),E1=c.discriminatedUnion("kind",[c.object({kind:c.literal("device"),deviceId:c.string(),capability:c.string(),instance:c.string().optional(),command:c.string(),params:c.unknown().optional()}),c.object({kind:c.literal("session"),sessionId:c.string(),text:c.string()}),c.object({kind:c.literal("notify"),title:c.string(),body:c.string()}),c.object({kind:c.literal("intent"),deviceId:c.string(),instance:c.string().optional(),look:Yc.optional(),effect:wr.optional(),returnTo:Xc.optional(),hold:c.boolean().default(!1)})]),_w=c.object({id:c.string(),name:c.string().default(""),enabled:c.boolean().default(!0),trigger:$1,conditions:c.array(I1).default([]),actions:c.array(E1).min(1),allowSecurity:c.boolean().default(!1)});var Lo=c.enum(["started","ended","working","finished","error","idle","needs_permission","subagentFinished","compacting","resumed","contextLow","contextCritical","needsInput","planReady","rateLimited","subagentStart","compactDone","permissionDenied","taskCompleted","usageHigh","modePlan","modeAuto","modeBypass","modeNormal","modelChanged","workflowStarted","sandboxEscalation","reviewChanged","costHigh","longRunning"]),$w=c.object({id:c.string(),name:c.string(),cwd:c.string(),online:c.boolean().default(!0),state:Lo.optional(),bridgeId:c.string().optional(),bridgeName:c.string().optional(),agent:hn.optional()}),Iw=c.enum(["allow","deny"]),iZ=c.object({sessionId:c.string().nullable(),text:c.string(),ts:te.optional()}),Qc=c.object({latestReply:c.string().nullable(),ts:c.number().nullable(),cursor:c.number().int().nonnegative(),hasMore:c.boolean()}),sZ=c.object({requestId:c.string(),behavior:Iw,ts:te.optional()}),aZ=c.object({id:c.string(),sessionId:c.string().nullable(),args:c.unknown(),ts:te.optional()}),A1=c.object({type:c.literal("register"),userToken:c.string().optional(),sessions:c.array($w),claudeSessionId:c.string().optional()}),P1=c.object({type:c.literal("sessions.update"),sessions:c.array($w)}),C1=c.object({type:c.literal("prompt"),sessionId:c.string(),requestId:c.string(),text:c.string(),ts:te.optional()});var T1=c.object({type:c.literal("reply"),sessionId:c.string(),requestId:c.string(),text:c.string(),seq:c.number().int().nonnegative().optional(),final:c.boolean().optional(),ts:te.optional()}),R1=c.object({type:c.literal("permission_request"),sessionId:c.string(),requestId:c.string(),tool:c.string(),description:c.string(),preview:c.string(),ts:te.optional()}),O1=c.object({type:c.literal("permission_verdict"),sessionId:c.string(),requestId:c.string(),behavior:Iw,ts:te.optional()}),D1=c.object({type:c.literal("command"),id:c.string(),requestId:c.string(),sessionId:c.string().nullable(),args:c.unknown(),ts:te.optional()}),N1=c.object({type:c.literal("command_result"),requestId:c.string(),id:c.string(),sessionId:c.string().nullable().optional(),result:c.unknown().optional(),error:c.string().optional(),ts:te.optional()}),L1=c.object({type:c.literal("devices.update"),doc:Sw}),U1=c.object({type:c.literal("device_command"),requestId:c.string(),deviceId:c.string(),sourceId:c.string().nullable().optional(),ruleId:c.string().optional(),capability:At,instance:c.string().optional(),command:c.string(),params:c.unknown(),consumer:c.enum(["voice","claude","app","rules"]),sessionId:c.string().optional(),confirm:c.boolean().optional()}),j1=c.object({type:c.literal("device_query"),requestId:c.string(),kind:c.enum(["list","get"]),deviceId:c.string().optional()}),z1=c.object({type:c.literal("device_result"),requestId:c.string(),deviceId:c.string().optional(),ok:c.boolean(),verified:c.boolean().optional(),state:c.unknown().optional(),result:c.unknown().optional(),error:c.string().optional()}),F1=c.object({type:c.literal("device_event"),deviceId:c.string(),capability:At,instance:c.string().optional(),event:c.string(),payload:c.unknown().optional(),ts:te}),M1=c.object({type:c.literal("device_source_event"),provider:Et,providerAccountId:c.string(),nativeId:c.string(),patch:c.array(c.object({type:At,instance:c.string().optional(),state:c.unknown()})).optional(),edge:c.object({capability:At,instance:c.string().optional(),event:c.string(),payload:c.unknown().optional()}).optional(),online:c.boolean().optional(),ts:te}),B1=c.object({type:c.literal("entitlement"),plan:c.enum(["free","paid"]),planStatus:c.enum(["active","past_due","canceled"]).optional(),serviceOk:c.boolean().optional(),capture:c.object({telemetry:c.boolean(),transcripts:c.boolean()}),policyVersion:c.string(),ts:te}),H1=c.object({type:c.literal("device_config"),version:c.number().int().nonnegative(),config:c.record(c.string(),c.unknown()),ts:te}),Z1=c.object({type:c.literal("disconnect"),code:c.union([c.literal(1012),c.literal(4402),c.literal(4426),c.number().int().min(1e3).max(4999)]),reason:c.string().max(120),ts:te}),G1=c.object({type:c.literal("device_audit"),requestId:c.string(),consumer:c.enum(["voice","claude","app","rules"]),deviceId:c.string(),ruleId:c.string().optional(),capability:At,command:c.string(),params:c.unknown(),ok:c.boolean(),confirmRequired:c.boolean(),confirmedBy:c.string().optional(),error:c.string().optional(),ts:te}),W1=64,V1=c.object({type:c.literal("session_state"),sessionId:c.string(),state:Lo,event:c.string(),ts:te,transitions:c.array(c.object({state:Lo,event:c.string(),ts:te})).max(W1).optional()}),q1=c.object({type:c.literal("notification"),sessionId:c.string(),event:Lo,repo:c.string().optional(),title:c.string().optional(),body:c.string().optional()}),J1=c.discriminatedUnion("type",[A1,P1,C1,T1,R1,O1,D1,N1,L1,U1,j1,z1,F1,M1,G1,B1,Z1,H1,V1,q1]),Ew=e=>J1.parse(typeof e=="string"?JSON.parse(e):e);var K1=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Gt=(e,t)=>e>>>t|e<<32-t;function X1(e){let t=[];for(let r of e){let o=r.codePointAt(0);o<128?t.push(o):o<2048?t.push(192|o>>6,128|o&63):o<65536?t.push(224|o>>12,128|o>>6&63,128|o&63):t.push(240|o>>18,128|o>>12&63,128|o>>6&63,128|o&63)}return Uint8Array.from(t)}function Y1(e){let t=X1(e),r=new Uint8Array((t.length+8>>6)+1<<6);r.set(t),r[t.length]=128;let o=new DataView(r.buffer),n=t.length*8;o.setUint32(r.length-8,Math.floor(n/4294967296)),o.setUint32(r.length-4,n>>>0);let i=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),s=new Uint32Array(64);for(let u=0;u<r.length;u+=64){for(let _=0;_<16;_++)s[_]=o.getUint32(u+_*4);for(let _=16;_<64;_++){let I=s[_-15],S=s[_-2],T=Gt(I,7)^Gt(I,18)^I>>>3,j=Gt(S,17)^Gt(S,19)^S>>>10;s[_]=s[_-16]+T+s[_-7]+j>>>0}let d=i[0],p=i[1],m=i[2],f=i[3],g=i[4],h=i[5],y=i[6],k=i[7];for(let _=0;_<64;_++){let I=Gt(g,6)^Gt(g,11)^Gt(g,25),S=g&h^~g&y,T=k+I+S+K1[_]+s[_],j=Gt(d,2)^Gt(d,13)^Gt(d,22),F=d&p^d&m^p&m,J=j+F;k=y,y=h,h=g,g=f+T>>>0,f=m,m=p,p=d,d=T+J>>>0}i[0]=i[0]+d>>>0,i[1]=i[1]+p>>>0,i[2]=i[2]+m>>>0,i[3]=i[3]+f>>>0,i[4]=i[4]+g>>>0,i[5]=i[5]+h>>>0,i[6]=i[6]+y>>>0,i[7]=i[7]+k>>>0}let a=new Uint8Array(32),l=new DataView(a.buffer);for(let u=0;u<8;u++)l.setUint32(u*4,i[u]);return a}var Aw="abcdefghijklmnopqrstuvwxyz234567";function Q1(e){let t=0,r=0,o="";for(let n of e)for(r=r<<8|n,t+=8;t>=5;)o+=Aw[r>>>t-5&31],t-=5;return t>0&&(o+=Aw[r<<5-t&31]),o}function Cw(e){return Q1(Y1(e))}var eO=c.enum(["mdns","ssdp","kasa-udp","wiz-udp","lifx-lan","yeelight","govee-udp","tuya-beacon","arp","http","meethue"]),tO=c.object({protocol:eO,detail:c.string(),at:te}),nO=c.enum(["connect-now","link-ecosystem","identified-only"]),el=c.enum(["kasa","kasa-klap","wiz","lifx","shelly","govee","tapo","tuya","yeelight","nanoleaf","meross","ewelink","wled","elgato","roku","esphome"]),rO=c.enum(["high","medium","low"]),oO=c.object({ip:c.string(),mac:c.string().optional(),hostname:c.string().optional(),port:c.number().int().positive().optional()}),Tw=c.object({discoveredId:c.string(),addresses:oO,evidence:c.array(tO).min(1),identity:c.object({name:c.string().optional(),manufacturer:c.string().optional(),model:c.string().optional(),hint:c.string().optional(),vendorId:c.string().optional()}).default({}),bucket:nO,kind:c.string().optional(),suggestedProvider:Et.optional(),localProtocol:el.optional(),expectedType:os.optional(),expectedCapabilities:c.array(At).default([]),alreadyLinked:c.object({provider:Et,deviceId:c.string().optional(),accountId:c.string().optional()}).nullable().optional(),confidence:rO,firstSeen:te,lastSeen:te});function Pt(e){return e.trim().toLowerCase().replace(/[^0-9a-f]/g,"").replace(/(..)(?=.)/g,"$1:")}var Rw=c.object({key:c.string(),provider:Et,accountId:c.string().optional(),name:c.string(),mac:c.string().optional(),nativeType:c.string().optional(),expectedType:os.optional(),state:c.enum(["cloud","not-seen"]),deviceId:c.string().optional()}),Ow=c.object({wsl:c.boolean(),multicastOk:c.boolean().nullable(),broadcastOk:c.boolean().nullable(),interop:c.enum(["windows-arp"]).optional(),interfaces:c.array(c.string()).optional(),primaryInterface:c.string().optional()});function Dw(e){return e!==void 0&&(e.wsl||e.multicastOk===!1)}function Nw(e,t){return t>0||e===void 0||e.wsl?!1:e.multicastOk===!0}var Lw="Your computer's network stack is fine, so if you expected devices here the likely cause is the network itself: guest WiFi, VLANs, or an access point with client isolation all block the discovery messages between devices. Try the same scan on your main WiFi, or add a device by IP.",iO=c.enum(["running","done","failed"]),mZ=c.object({id:c.string(),status:iO,startedAt:te,finishedAt:te.optional(),error:c.string().optional(),devices:c.array(Tw),accountDevices:c.array(Rw).optional(),env:Ow,probeStatus:c.record(c.string(),c.string()).optional()}),sO=c.enum(["mdns","ssdp","kasa","wiz","lifx","yeelight","govee","tuya","arp","sweep"]),fZ=c.object({autoConnect:c.enum(["unset","off","open-protocols"]).default("unset"),passive:c.boolean().default(!0),protocols:c.partialRecord(sO,c.boolean()).default({}),unidentified:c.boolean().default(!0)}),gZ=c.object({scanId:c.string()}),hZ=c.object({devices:c.array(Tw),accountDevices:c.array(Rw).optional(),env:Ow,updatedAt:te}),vZ=c.object({discoveredId:c.string().optional(),ip:c.string().optional(),protocol:el,name:c.string().optional(),credentials:c.record(c.string(),c.string()).optional()}).refine(e=>e.discoveredId!==void 0||e.ip!==void 0,{message:"either discoveredId or ip is required"}),Zg={tapo:[{key:"username",label:"TP-Link email",secret:!1,helpText:"the TP-Link ID the device was set up with"},{key:"password",label:"Password",secret:!0}],"kasa-klap":[{key:"username",label:"TP-Link email",secret:!1,helpText:"the TP-Link/Kasa ID the device was set up with (leave blank if never linked to the cloud)"},{key:"password",label:"Password",secret:!0}],shelly:[{key:"password",label:"Device password",secret:!0,helpText:'the password set on this Shelly (its username is always "admin")'}],esphome:[{key:"encryptionKey",label:"Encryption key",secret:!0,helpText:"the `api: encryption: key` from this device's ESPHome config (base64) \u2014 leave blank if it has no encryption"}]},aO=new Set(["shelly","esphome"]);function cO(e){return aO.has(e)}var yZ=c.object({ok:c.boolean(),deviceId:c.string().optional(),accountId:c.string().optional(),error:c.string().optional(),note:c.string().optional(),linkVia:Et.optional()}),bZ=c.object({deviceId:c.string(),purge:c.boolean().default(!1),discoveredId:c.string().optional()}),xZ=c.object({deviceId:c.string(),name:c.string()}),kZ=c.object({clientId:c.string().min(1),clientSecret:c.string().min(1),region:c.string().min(1)}),wZ=c.object({ok:c.boolean(),deviceCount:c.number().int().nonnegative().optional(),sleepyCount:c.number().int().nonnegative().optional(),error:c.string().optional()}),SZ=c.object({email:c.string().min(1),password:c.string().min(1),region:c.string().min(1),mfaCode:c.string().optional()}),_Z=c.object({ok:c.boolean(),deviceCount:c.number().int().nonnegative().optional(),error:c.string().optional()}),$Z=c.object({email:c.string().min(1),password:c.string().min(1),region:c.string().min(1)}),IZ=c.object({ok:c.boolean(),deviceCount:c.number().int().nonnegative().optional(),error:c.string().optional()}),EZ=c.object({apiKey:c.string().min(1)}),AZ=c.object({ok:c.boolean(),deviceCount:c.number().int().nonnegative().optional(),error:c.string().optional()}),PZ=c.object({ok:c.boolean(),note:c.string().optional(),error:c.string().optional()}),CZ=c.object({sessionId:c.string().optional(),revertOnStop:c.boolean().default(!0)}),TZ=c.object({sessionId:c.string().optional()}),Uw=c.object({pct:c.number().min(0).max(100),usedTokens:c.number().int().nonnegative().optional(),windowTokens:c.number().int().positive().optional()}),Pw=c.object({usedPct:c.number().min(0).max(100),resetsAt:te.optional()}),RZ=c.object({sessionId:c.string().optional(),claudeSessionId:c.string().optional(),state:Lo,event:c.string(),ts:te.optional(),cwd:c.string().optional(),extra:c.record(c.string(),c.unknown()).optional(),context:Uw.optional(),mode:c.string().optional(),model:c.string().optional(),agent:hn.optional()}),OZ=c.object({sessionId:c.string().optional(),claudeSessionId:c.string().optional(),cwd:c.string().optional(),ts:te.optional(),context:Uw.optional(),rateLimits:c.object({fiveHour:Pw.optional(),sevenDay:Pw.optional()}).optional(),mode:c.string().optional(),model:c.string().optional(),modelName:c.string().optional(),review:c.string().optional(),cost:c.number().nonnegative().optional(),agent:hn.optional()}),DZ=c.object({sessionId:c.string().optional(),claudeSessionId:c.string().optional(),codexThreadId:c.string().min(1),cwd:c.string().optional(),gitBranch:c.string().optional(),ts:te.optional(),inputTokens:c.number().int().nonnegative(),cachedInputTokens:c.number().int().nonnegative().default(0),outputTokens:c.number().int().nonnegative(),agent:hn.optional()}),lO=c.object({reverted:c.number().int().nonnegative(),failed:c.number().int().nonnegative(),skipped:c.number().int().nonnegative()}),NZ=c.object({active:c.boolean(),sessionId:c.string().optional(),generation:c.number().int().nonnegative().optional(),touched:c.number().int().nonnegative().default(0),revertOnStop:c.boolean().default(!0),owner:c.enum(["app","hook"]).optional(),summary:lO.optional()});function Uo(e){return e.kind==="gateway"?"infrastructure":e.bucket==="connect-now"?"ready":e.bucket==="link-ecosystem"?"ecosystems":e.kind==="unidentified"||e.kind==="mdns-service"?"unidentified":e.bucket==="identified-only"?"needs-setup":"unidentified"}var tl=["govee","wiz","yeelight","kasa","esphome"],uO=new Set(["lock","cover","garageDoor","valve","camera","doorbell"]),dO=new Set(["lock","cover","camera","doorbell"]),pO=new Set(["tuya","meross","ewelink","nanoleaf","esphome"]);function jw(e,t=Zg){return e.bucket==="connect-now"&&e.localProtocol!==void 0&&((t[e.localProtocol]?.length??0)===0||cO(e.localProtocol))&&!pO.has(e.localProtocol)&&e.confidence==="high"&&e.addresses.mac!==void 0&&!e.alreadyLinked&&!(e.expectedType!==void 0&&uO.has(e.expectedType))&&!e.expectedCapabilities.some(r=>dO.has(r))}function zw(e){let t=e.trim(),r,o=/^(mqtts?|tcp|ssl|tls|wss?):\/\//i.exec(t);if(o){let a=o[1].toLowerCase();(a==="mqtts"||a==="ssl"||a==="tls"||a==="wss")&&(r=!0),t=t.slice(o[0].length)}t=t.replace(/\/.*$/,"");let n=/^(.+):(\d{1,5})$/.exec(t),i=(n?n[1]:t).trim(),s=n?Number(n[2]):void 0;return{host:i,...s!==void 0&&s>=1&&s<=65535?{port:s}:{},...r!==void 0?{tls:r}:{}}}import{spawn as gO}from"node:child_process";import{chmodSync as hO,existsSync as Wg,openSync as vO,readFileSync as yO,realpathSync as bO,writeFileSync as Gw}from"node:fs";import{request as xO}from"node:http";import kO from"node:net";import wO from"node:path";function as(){return!0}function Fw(){return"1.1.3"}var Mw=3e3,mO=15e3;function fO(e){if(!e)return null;try{let t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return null;let{pid:r,startedAt:o,lastBeat:n}=t;return!Number.isInteger(r)||r<=0||typeof o!="number"||typeof n!="number"?null:{pid:r,startedAt:o,lastBeat:n}}catch{return null}}function Bw(e){let t=e?.read??N;return fO(t(e?.file??ia))}function Gg(e,t){let r=t?.write??((n,i)=>ke(n,i,384)),o=t?.now??Date.now;try{r(t?.file??ia,JSON.stringify({pid:t?.pid??process.pid,startedAt:e,lastBeat:o()}))}catch{}}function Hw(e){try{(e?.remove??ve)(e?.file??ia)}catch{}}function Zw(e){let{beacon:t,pid:r}=e;return!Number.isInteger(r)||r<=0||!t||t.pid!==r||!(e.isAlive??aa)(r)?!1:(e.now??Date.now())-t.lastBeat<=(e.staleAfterMs??mO)}function SO(e){return new Promise(t=>{let r=kO.connect({host:"127.0.0.1",port:e},()=>{r.destroy(),t(!0)});r.on("error",()=>t(!1)),r.setTimeout(500,()=>{r.destroy(),t(!1)})})}function rl(e={}){let t=Wr(e);return{dir:t.dir,source:t.source,port:t.beacon?.port??de().hubPort,tokenFile:Ou(t.dir),advertised:t.beacon!==null}}async function Ne(){return SO(rl().port)}function _O(e=process.env,t=r=>Lt(r)){if(e.BRIDGE_CLIENT_VERSION!==void 0)return{};let r=t(e);return r===null?{}:{BRIDGE_CLIENT_VERSION:r}}function $O(e=process.env,t={}){let r=t.bundled??as(),o={...e};return r&&delete o.BRIDGE_VOICE,o}async function ct(e={kind:"run"}){if(await Ne())return se("hub already running \u2014 reusing it"),{spawned:!1,holderId:await Ww(e.kind)??await ol(e.kind)};let t=de(),r=Wg(_i)?{file:process.env.APPIMAGE||process.execPath,args:[_i]}:{file:Wg(la)?la:"tsx",args:[ub]};Gw(wt,"",{mode:384}),hO(wt,384);let o=vO(wt,"a"),n=gO(r.file,r.args,{cwd:ln,detached:!0,stdio:["ignore",o,o],env:{...$O(),BRIDGE_RELAY_URL:t.relayUrl,BRIDGE_HUB_PORT:String(t.hubPort),BRIDGE_HUB_HOLDER:e.kind,BRIDGE_HUB_HOLDER_PID:String(process.pid),..._O()}});n.unref(),n.pid&&Gw(fi,String(n.pid));for(let i=0;i<30;i++){let s=il(wt);if(/relay connected/i.test(s))return $("hub connected to relay"),{spawned:!0,holderId:await Ww(e.kind)??await ol(e.kind)};if(/relay ws error|FATAL/i.test(s))throw new Error(`hub failed to connect:
|
|
238
|
-
${me(
|
|
239
|
-
${me(
|
|
240
|
-
`)[0]??"").holderId??null)}catch{s(null)}}),l.once("close",()=>s(null))});a.on("error",()=>s(null)),a.setTimeout(5e3,()=>s(null)),a.end(o)}catch{s(null)}})}async function
|
|
246
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let a=s[1];if(t===s[0]){i(s);continue}if(e.external){let u=e.external.registry.get(s[0])?.id;if(t!==s[0]&&u){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(a.cycle){i(s);continue}if(a.count>1&&e.reused==="ref"){i(s);continue}}}function qn(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=a=>{let l=e.seen.get(a);if(l.ref===null)return;let u=l.def??l.schema,p={...u},d=l.ref;if(l.ref=null,d){o(d);let f=e.seen.get(d),g=f.schema;if(g.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(g)):Object.assign(u,g),Object.assign(u,p),a._zod.parent===d)for(let v in u)v==="$ref"||v==="allOf"||v in p||delete u[v];if(g.$ref&&f.def)for(let v in u)v==="$ref"||v==="allOf"||v in f.def&&JSON.stringify(u[v])===JSON.stringify(f.def[v])&&delete u[v]}let m=a._zod.parent;if(m&&m!==d){o(m);let f=e.seen.get(m);if(f?.schema.$ref&&(u.$ref=f.schema.$ref,f.def))for(let g in u)g==="$ref"||g==="allOf"||g in f.def&&JSON.stringify(u[g])===JSON.stringify(f.def[g])&&delete u[g]}e.override({zodSchema:a,jsonSchema:u,path:l.path??[]})};for(let a of[...e.seen.entries()].reverse())o(a[0]);let n={};if(e.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");n.$id=e.external.uri(a)}Object.assign(n,r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;i!==void 0&&n.id===i&&delete n.id;let s=e.external?.defs??{};for(let a of e.seen.entries()){let l=a[1];l.def&&l.defId&&(l.def.id===l.defId&&delete l.def.id,s[l.defId]=l.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?n.$defs=s:n.definitions=s);try{let a=JSON.parse(JSON.stringify(n));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:Po(t,"input",e.processors),output:Po(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function Ve(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return Ve(o.element,r);if(o.type==="set")return Ve(o.valueType,r);if(o.type==="lazy")return Ve(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return Ve(o.innerType,r);if(o.type==="intersection")return Ve(o.left,r)||Ve(o.right,r);if(o.type==="record"||o.type==="map")return Ve(o.keyType,r)||Ve(o.valueType,r);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Ve(o.in,r)||Ve(o.out,r);if(o.type==="object"){for(let n in o.shape)if(Ve(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(Ve(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(Ve(n,r))return!0;return!!(o.rest&&Ve(o.rest,r))}return!1}var af=(e,t={})=>r=>{let o=Vn({...r,processors:t});return pe(e,o),Jn(o,e),qn(o,e)},Po=(e,t,r={})=>o=>{let{libraryOptions:n,target:i}=o??{},s=Vn({...n??{},target:i,io:t,processors:r});return pe(e,s),Jn(s,e),qn(s,e)};var c1={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},cf=(e,t,r,o)=>{let n=r;n.type="string";let{minimum:i,maximum:s,format:a,patterns:l,contentEncoding:u}=e._zod.bag;if(typeof i=="number"&&(n.minLength=i),typeof s=="number"&&(n.maxLength=s),a&&(n.format=c1[a]??a,n.format===""&&delete n.format,a==="time"&&delete n.format),u&&(n.contentEncoding=u),l&&l.size>0){let p=[...l];p.length===1?n.pattern=p[0].source:p.length>1&&(n.allOf=[...p.map(d=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},lf=(e,t,r,o)=>{let n=r,{minimum:i,maximum:s,format:a,multipleOf:l,exclusiveMaximum:u,exclusiveMinimum:p}=e._zod.bag;typeof a=="string"&&a.includes("int")?n.type="integer":n.type="number";let d=typeof p=="number"&&p>=(i??Number.NEGATIVE_INFINITY),m=typeof u=="number"&&u<=(s??Number.POSITIVE_INFINITY),f=t.target==="draft-04"||t.target==="openapi-3.0";d?f?(n.minimum=p,n.exclusiveMinimum=!0):n.exclusiveMinimum=p:typeof i=="number"&&(n.minimum=i),m?f?(n.maximum=u,n.exclusiveMaximum=!0):n.exclusiveMaximum=u:typeof s=="number"&&(n.maximum=s),typeof l=="number"&&(n.multipleOf=l)},uf=(e,t,r,o)=>{r.type="boolean"},df=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},pf=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},mf=(e,t,r,o)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},ff=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},gf=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},hf=(e,t,r,o)=>{r.not={}},vf=(e,t,r,o)=>{},bf=(e,t,r,o)=>{},yf=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},xf=(e,t,r,o)=>{let n=e._zod.def,i=Ci(n.entries);i.every(s=>typeof s=="number")&&(r.type="number"),i.every(s=>typeof s=="string")&&(r.type="string"),r.enum=i},kf=(e,t,r,o)=>{let n=e._zod.def,i=[];for(let s of n.values)if(s===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(s))}else i.push(s);if(i.length!==0)if(i.length===1){let s=i[0];r.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[s]:r.const=s}else i.every(s=>typeof s=="number")&&(r.type="number"),i.every(s=>typeof s=="string")&&(r.type="string"),i.every(s=>typeof s=="boolean")&&(r.type="boolean"),i.every(s=>s===null)&&(r.type="null"),r.enum=i},wf=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},Sf=(e,t,r,o)=>{let n=r,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=i.source},_f=(e,t,r,o)=>{let n=r,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:a,mime:l}=e._zod.bag;s!==void 0&&(i.minLength=s),a!==void 0&&(i.maxLength=a),l?l.length===1?(i.contentMediaType=l[0],Object.assign(n,i)):(Object.assign(n,i),n.anyOf=l.map(u=>({contentMediaType:u}))):Object.assign(n,i)},$f=(e,t,r,o)=>{r.type="boolean"},If=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Ef=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},Af=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Cf=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Pf=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Tf=(e,t,r,o)=>{let n=r,i=e._zod.def,{minimum:s,maximum:a}=e._zod.bag;typeof s=="number"&&(n.minItems=s),typeof a=="number"&&(n.maxItems=a),n.type="array",n.items=pe(i.element,t,{...o,path:[...o.path,"items"]})},Rf=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="object",n.properties={};let s=i.shape;for(let u in s)n.properties[u]=pe(s[u],t,{...o,path:[...o.path,"properties",u]});let a=new Set(Object.keys(s)),l=new Set([...a].filter(u=>{let p=i.shape[u]._zod;return t.io==="input"?p.optin===void 0:p.optout===void 0}));l.size>0&&(n.required=Array.from(l)),i.catchall?._zod.def.type==="never"?n.additionalProperties=!1:i.catchall?i.catchall&&(n.additionalProperties=pe(i.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},_c=(e,t,r,o)=>{let n=e._zod.def,i=n.inclusive===!1,s=n.options.map((a,l)=>pe(a,t,{...o,path:[...o.path,i?"oneOf":"anyOf",l]}));i?r.oneOf=s:r.anyOf=s},Of=(e,t,r,o)=>{let n=e._zod.def,i=pe(n.left,t,{...o,path:[...o.path,"allOf",0]}),s=pe(n.right,t,{...o,path:[...o.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,l=[...a(i)?i.allOf:[i],...a(s)?s.allOf:[s]];r.allOf=l},Df=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="array";let s=t.target==="draft-2020-12"?"prefixItems":"items",a=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",l=i.items.map((m,f)=>pe(m,t,{...o,path:[...o.path,s,f]})),u=i.rest?pe(i.rest,t,{...o,path:[...o.path,a,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null;t.target==="draft-2020-12"?(n.prefixItems=l,u&&(n.items=u)):t.target==="openapi-3.0"?(n.items={anyOf:l},u&&n.items.anyOf.push(u),n.minItems=l.length,u||(n.maxItems=l.length)):(n.items=l,u&&(n.additionalItems=u));let{minimum:p,maximum:d}=e._zod.bag;typeof p=="number"&&(n.minItems=p),typeof d=="number"&&(n.maxItems=d)},Nf=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="object";let s=i.keyType,l=s._zod.bag?.patterns;if(i.mode==="loose"&&l&&l.size>0){let p=pe(i.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(let d of l)n.patternProperties[d.source]=p}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(n.propertyNames=pe(i.keyType,t,{...o,path:[...o.path,"propertyNames"]})),n.additionalProperties=pe(i.valueType,t,{...o,path:[...o.path,"additionalProperties"]});let u=s._zod.values;if(u){let p=[...u].filter(d=>typeof d=="string"||typeof d=="number");p.length>0&&(n.required=p)}},Lf=(e,t,r,o)=>{let n=e._zod.def,i=pe(n.innerType,t,o),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=n.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}]},Uf=(e,t,r,o)=>{let n=e._zod.def;pe(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},jf=(e,t,r,o)=>{let n=e._zod.def;pe(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},zf=(e,t,r,o)=>{let n=e._zod.def;pe(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},Ff=(e,t,r,o)=>{let n=e._zod.def;pe(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType;let s;try{s=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=s},Mf=(e,t,r,o)=>{let n=e._zod.def,i=n.in._zod.traits.has("$ZodTransform"),s=t.io==="input"?i?n.out:n.in:n.out;pe(s,t,o);let a=t.seen.get(e);a.ref=s},Bf=(e,t,r,o)=>{let n=e._zod.def;pe(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.readOnly=!0},Hf=(e,t,r,o)=>{let n=e._zod.def;pe(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},$c=(e,t,r,o)=>{let n=e._zod.def;pe(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},Zf=(e,t,r,o)=>{let n=e._zod.innerType;pe(n,t,o);let i=t.seen.get(e);i.ref=n},Sc={string:cf,number:lf,boolean:uf,bigint:df,symbol:pf,null:mf,undefined:ff,void:gf,never:hf,any:vf,unknown:bf,date:yf,enum:xf,literal:kf,nan:wf,template_literal:Sf,file:_f,success:$f,custom:If,function:Ef,transform:Af,map:Cf,set:Pf,array:Tf,object:Rf,union:_c,intersection:Of,tuple:Df,record:Nf,nullable:Lf,nonoptional:Uf,default:jf,prefault:zf,catch:Ff,pipe:Mf,readonly:Bf,promise:Hf,optional:$c,lazy:Zf};function Ic(e,t){if("_idmap"in e){let o=e,n=Vn({...t,processors:Sc}),i={};for(let l of o._idmap.entries()){let[u,p]=l;pe(p,n)}let s={},a={registry:o,uri:t?.uri,defs:i};n.external=a;for(let l of o._idmap.entries()){let[u,p]=l;Jn(n,p),s[u]=qn(n,p)}if(Object.keys(i).length>0){let l=n.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[l]:i}}return{schemas:s}}let r=Vn({...t,processors:Sc});return pe(e,r),Jn(r,e),qn(r,e)}var Ec=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let r=t?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=Vn({processors:Sc,target:r,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,r={path:[],schemaPath:[]}){return pe(t,this.ctx,r)}emit(t,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),Jn(this.ctx,t);let o=qn(this.ctx,t),{"~standard":n,...i}=o;return i}};var bk={};var Vi={};rn(Vi,{ZodAny:()=>fg,ZodArray:()=>bg,ZodBase64:()=>Jc,ZodBase64URL:()=>qc,ZodBigInt:()=>jo,ZodBigIntFormat:()=>Yc,ZodBoolean:()=>Uo,ZodCIDRv4:()=>Wc,ZodCIDRv6:()=>Vc,ZodCUID:()=>zc,ZodCUID2:()=>Fc,ZodCatch:()=>Fg,ZodCodec:()=>is,ZodCustom:()=>ss,ZodCustomStringFormat:()=>No,ZodDate:()=>es,ZodDefault:()=>Dg,ZodDiscriminatedUnion:()=>xg,ZodE164:()=>Kc,ZodEmail:()=>Lc,ZodEmoji:()=>Uc,ZodEnum:()=>Oo,ZodExactOptional:()=>Tg,ZodFile:()=>Cg,ZodFunction:()=>Kg,ZodGUID:()=>qi,ZodIPv4:()=>Zc,ZodIPv6:()=>Gc,ZodIntersection:()=>kg,ZodJWT:()=>Xc,ZodKSUID:()=>Hc,ZodLazy:()=>Vg,ZodLiteral:()=>Ag,ZodMAC:()=>ag,ZodMap:()=>Ig,ZodNaN:()=>Bg,ZodNanoID:()=>jc,ZodNever:()=>hg,ZodNonOptional:()=>ol,ZodNull:()=>pg,ZodNullable:()=>Og,ZodNumber:()=>Lo,ZodNumberFormat:()=>Sr,ZodObject:()=>ns,ZodOptional:()=>rl,ZodPipe:()=>os,ZodPrefault:()=>Lg,ZodPreprocess:()=>Hg,ZodPromise:()=>qg,ZodReadonly:()=>Zg,ZodRecord:()=>Ro,ZodSet:()=>Eg,ZodString:()=>Do,ZodStringFormat:()=>ge,ZodSuccess:()=>zg,ZodSymbol:()=>ug,ZodTemplateLiteral:()=>Wg,ZodTransform:()=>Pg,ZodTuple:()=>Sg,ZodType:()=>Q,ZodULID:()=>Mc,ZodURL:()=>Qi,ZodUUID:()=>Gt,ZodUndefined:()=>dg,ZodUnion:()=>rs,ZodUnknown:()=>gg,ZodVoid:()=>vg,ZodXID:()=>Bc,ZodXor:()=>yg,_ZodString:()=>Nc,_default:()=>Ng,_function:()=>Ew,any:()=>ow,array:()=>ts,base64:()=>Mk,base64url:()=>Bk,bigint:()=>Qk,boolean:()=>lg,catch:()=>Mg,check:()=>Aw,cidrv4:()=>zk,cidrv6:()=>Fk,codec:()=>Sw,cuid:()=>Tk,cuid2:()=>Rk,custom:()=>Cw,date:()=>sw,describe:()=>Pw,discriminatedUnion:()=>pw,e164:()=>Hk,email:()=>kk,emoji:()=>Ck,enum:()=>tl,exactOptional:()=>Rg,file:()=>yw,float32:()=>qk,float64:()=>Kk,function:()=>Ew,guid:()=>wk,hash:()=>Jk,hex:()=>Vk,hostname:()=>Wk,httpUrl:()=>Ak,instanceof:()=>Rw,int:()=>Oc,int32:()=>Xk,int64:()=>ew,intersection:()=>wg,invertCodec:()=>_w,ipv4:()=>Lk,ipv6:()=>jk,json:()=>Dw,jwt:()=>Zk,keyof:()=>aw,ksuid:()=>Nk,lazy:()=>Jg,literal:()=>bw,looseObject:()=>uw,looseRecord:()=>fw,mac:()=>Uk,map:()=>gw,meta:()=>Tw,nan:()=>ww,nanoid:()=>Pk,nativeEnum:()=>vw,never:()=>Qc,nonoptional:()=>jg,null:()=>mg,nullable:()=>Xi,nullish:()=>xw,number:()=>cg,object:()=>cw,optional:()=>Ki,partialRecord:()=>mw,pipe:()=>Dc,prefault:()=>Ug,preprocess:()=>Nw,promise:()=>Iw,readonly:()=>Gg,record:()=>$g,refine:()=>Xg,set:()=>hw,strictObject:()=>lw,string:()=>Ji,stringFormat:()=>Gk,stringbool:()=>Ow,success:()=>kw,superRefine:()=>Yg,symbol:()=>nw,templateLiteral:()=>$w,transform:()=>nl,tuple:()=>_g,uint32:()=>Yk,uint64:()=>tw,ulid:()=>Ok,undefined:()=>rw,union:()=>el,unknown:()=>wr,url:()=>Ek,uuid:()=>Sk,uuidv4:()=>_k,uuidv6:()=>$k,uuidv7:()=>Ik,void:()=>iw,xid:()=>Dk,xor:()=>dw});var Ac={};rn(Ac,{endsWith:()=>wo,gt:()=>Ht,gte:()=>We,includes:()=>xo,length:()=>kr,lowercase:()=>bo,lt:()=>Bt,lte:()=>st,maxLength:()=>xr,maxSize:()=>Wn,mime:()=>So,minLength:()=>pn,minSize:()=>Zt,multipleOf:()=>Gn,negative:()=>yc,nonnegative:()=>kc,nonpositive:()=>xc,normalize:()=>_o,overwrite:()=>Et,positive:()=>bc,property:()=>wc,regex:()=>vo,size:()=>yr,slugify:()=>Ao,startsWith:()=>ko,toLowerCase:()=>Io,toUpperCase:()=>Eo,trim:()=>$o,uppercase:()=>yo});var To={};rn(To,{ZodISODate:()=>Pc,ZodISODateTime:()=>Cc,ZodISODuration:()=>Rc,ZodISOTime:()=>Tc,date:()=>Wf,datetime:()=>Gf,duration:()=>Jf,time:()=>Vf});var Cc=y("ZodISODateTime",(e,t)=>{kp.init(e,t),ge.init(e,t)});function Gf(e){return $m(Cc,e)}var Pc=y("ZodISODate",(e,t)=>{wp.init(e,t),ge.init(e,t)});function Wf(e){return Im(Pc,e)}var Tc=y("ZodISOTime",(e,t)=>{Sp.init(e,t),ge.init(e,t)});function Vf(e){return Em(Tc,e)}var Rc=y("ZodISODuration",(e,t)=>{_p.init(e,t),ge.init(e,t)});function Jf(e){return Am(Rc,e)}var yk=(e,t)=>{Di.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>Li(e,r)},flatten:{value:r=>Ni(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,ao,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,ao,2)}},isEmpty:{get(){return e.issues.length===0}}})},u1=y("ZodError",yk),nt=y("ZodError",yk,{Parent:Error});var qf=uo(nt),Kf=po(nt),Xf=mo(nt),Yf=fo(nt),Qf=Ia(nt),eg=Ea(nt),tg=Aa(nt),ng=Ca(nt),rg=Pa(nt),og=Ta(nt),ig=Ra(nt),sg=Oa(nt);var xk=new WeakMap;function Yi(e,t,r){let o=Object.getPrototypeOf(e),n=xk.get(o);if(n||(n=new Set,xk.set(o,n)),!n.has(t)){n.add(t);for(let i in r){let s=r[i];Object.defineProperty(o,i,{configurable:!0,enumerable:!1,get(){let a=s.bind(this);return Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:a}),a},set(a){Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:a})}})}}}var Q=y("ZodType",(e,t)=>(J.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Po(e,"input"),output:Po(e,"output")}}),e.toJSONSchema=af(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(r,o)=>qf(e,r,o,{callee:e.parse}),e.safeParse=(r,o)=>Xf(e,r,o),e.parseAsync=async(r,o)=>Kf(e,r,o,{callee:e.parseAsync}),e.safeParseAsync=async(r,o)=>Yf(e,r,o),e.spa=e.safeParseAsync,e.encode=(r,o)=>Qf(e,r,o),e.decode=(r,o)=>eg(e,r,o),e.encodeAsync=async(r,o)=>tg(e,r,o),e.decodeAsync=async(r,o)=>ng(e,r,o),e.safeEncode=(r,o)=>rg(e,r,o),e.safeDecode=(r,o)=>og(e,r,o),e.safeEncodeAsync=async(r,o)=>ig(e,r,o),e.safeDecodeAsync=async(r,o)=>sg(e,r,o),Yi(e,"ZodType",{check(...r){let o=this.def;return this.clone(T.mergeDefs(o,{checks:[...o.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,o){return Ze(this,r,o)},brand(){return this},register(r,o){return r.add(this,o),this},refine(r,o){return this.check(Xg(r,o))},superRefine(r,o){return this.check(Yg(r,o))},overwrite(r){return this.check(Et(r))},optional(){return Ki(this)},exactOptional(){return Rg(this)},nullable(){return Xi(this)},nullish(){return Ki(Xi(this))},nonoptional(r){return jg(this,r)},array(){return ts(this)},or(r){return el([this,r])},and(r){return wg(this,r)},transform(r){return Dc(this,nl(r))},default(r){return Ng(this,r)},prefault(r){return Ug(this,r)},catch(r){return Mg(this,r)},pipe(r){return Dc(this,r)},readonly(){return Gg(this)},describe(r){let o=this.clone();return Ne.add(o,{description:r}),o},meta(...r){if(r.length===0)return Ne.get(this);let o=this.clone();return Ne.add(o,r[0]),o},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(e,"description",{get(){return Ne.get(e)?.description},configurable:!0}),e)),Nc=y("_ZodString",(e,t)=>{br.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(o,n,i)=>cf(e,o,n,i);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,Yi(e,"_ZodString",{regex(...o){return this.check(vo(...o))},includes(...o){return this.check(xo(...o))},startsWith(...o){return this.check(ko(...o))},endsWith(...o){return this.check(wo(...o))},min(...o){return this.check(pn(...o))},max(...o){return this.check(xr(...o))},length(...o){return this.check(kr(...o))},nonempty(...o){return this.check(pn(1,...o))},lowercase(o){return this.check(bo(o))},uppercase(o){return this.check(yo(o))},trim(){return this.check($o())},normalize(...o){return this.check(_o(...o))},toLowerCase(){return this.check(Io())},toUpperCase(){return this.check(Eo())},slugify(){return this.check(Ao())}})}),Do=y("ZodString",(e,t)=>{br.init(e,t),Nc.init(e,t),e.email=r=>e.check(Ya(Lc,r)),e.url=r=>e.check(Wi(Qi,r)),e.jwt=r=>e.check(vc(Xc,r)),e.emoji=r=>e.check(rc(Uc,r)),e.guid=r=>e.check(Gi(qi,r)),e.uuid=r=>e.check(Qa(Gt,r)),e.uuidv4=r=>e.check(ec(Gt,r)),e.uuidv6=r=>e.check(tc(Gt,r)),e.uuidv7=r=>e.check(nc(Gt,r)),e.nanoid=r=>e.check(oc(jc,r)),e.guid=r=>e.check(Gi(qi,r)),e.cuid=r=>e.check(ic(zc,r)),e.cuid2=r=>e.check(sc(Fc,r)),e.ulid=r=>e.check(ac(Mc,r)),e.base64=r=>e.check(fc(Jc,r)),e.base64url=r=>e.check(gc(qc,r)),e.xid=r=>e.check(cc(Bc,r)),e.ksuid=r=>e.check(lc(Hc,r)),e.ipv4=r=>e.check(uc(Zc,r)),e.ipv6=r=>e.check(dc(Gc,r)),e.cidrv4=r=>e.check(pc(Wc,r)),e.cidrv6=r=>e.check(mc(Vc,r)),e.e164=r=>e.check(hc(Kc,r)),e.datetime=r=>e.check(Gf(r)),e.date=r=>e.check(Wf(r)),e.time=r=>e.check(Vf(r)),e.duration=r=>e.check(Jf(r))});function Ji(e){return km(Do,e)}var ge=y("ZodStringFormat",(e,t)=>{fe.init(e,t),Nc.init(e,t)}),Lc=y("ZodEmail",(e,t)=>{pp.init(e,t),ge.init(e,t)});function kk(e){return Ya(Lc,e)}var qi=y("ZodGUID",(e,t)=>{up.init(e,t),ge.init(e,t)});function wk(e){return Gi(qi,e)}var Gt=y("ZodUUID",(e,t)=>{dp.init(e,t),ge.init(e,t)});function Sk(e){return Qa(Gt,e)}function _k(e){return ec(Gt,e)}function $k(e){return tc(Gt,e)}function Ik(e){return nc(Gt,e)}var Qi=y("ZodURL",(e,t)=>{mp.init(e,t),ge.init(e,t)});function Ek(e){return Wi(Qi,e)}function Ak(e){return Wi(Qi,{protocol:it.httpProtocol,hostname:it.domain,...T.normalizeParams(e)})}var Uc=y("ZodEmoji",(e,t)=>{fp.init(e,t),ge.init(e,t)});function Ck(e){return rc(Uc,e)}var jc=y("ZodNanoID",(e,t)=>{gp.init(e,t),ge.init(e,t)});function Pk(e){return oc(jc,e)}var zc=y("ZodCUID",(e,t)=>{hp.init(e,t),ge.init(e,t)});function Tk(e){return ic(zc,e)}var Fc=y("ZodCUID2",(e,t)=>{vp.init(e,t),ge.init(e,t)});function Rk(e){return sc(Fc,e)}var Mc=y("ZodULID",(e,t)=>{bp.init(e,t),ge.init(e,t)});function Ok(e){return ac(Mc,e)}var Bc=y("ZodXID",(e,t)=>{yp.init(e,t),ge.init(e,t)});function Dk(e){return cc(Bc,e)}var Hc=y("ZodKSUID",(e,t)=>{xp.init(e,t),ge.init(e,t)});function Nk(e){return lc(Hc,e)}var Zc=y("ZodIPv4",(e,t)=>{$p.init(e,t),ge.init(e,t)});function Lk(e){return uc(Zc,e)}var ag=y("ZodMAC",(e,t)=>{Ep.init(e,t),ge.init(e,t)});function Uk(e){return Sm(ag,e)}var Gc=y("ZodIPv6",(e,t)=>{Ip.init(e,t),ge.init(e,t)});function jk(e){return dc(Gc,e)}var Wc=y("ZodCIDRv4",(e,t)=>{Ap.init(e,t),ge.init(e,t)});function zk(e){return pc(Wc,e)}var Vc=y("ZodCIDRv6",(e,t)=>{Cp.init(e,t),ge.init(e,t)});function Fk(e){return mc(Vc,e)}var Jc=y("ZodBase64",(e,t)=>{Tp.init(e,t),ge.init(e,t)});function Mk(e){return fc(Jc,e)}var qc=y("ZodBase64URL",(e,t)=>{Rp.init(e,t),ge.init(e,t)});function Bk(e){return gc(qc,e)}var Kc=y("ZodE164",(e,t)=>{Op.init(e,t),ge.init(e,t)});function Hk(e){return hc(Kc,e)}var Xc=y("ZodJWT",(e,t)=>{Dp.init(e,t),ge.init(e,t)});function Zk(e){return vc(Xc,e)}var No=y("ZodCustomStringFormat",(e,t)=>{Np.init(e,t),ge.init(e,t)});function Gk(e,t,r={}){return Co(No,e,t,r)}function Wk(e){return Co(No,"hostname",it.hostname,e)}function Vk(e){return Co(No,"hex",it.hex,e)}function Jk(e,t){let r=t?.enc??"hex",o=`${e}_${r}`,n=it[o];if(!n)throw new Error(`Unrecognized hash format: ${o}`);return Co(No,o,n,t)}var Lo=y("ZodNumber",(e,t)=>{Ba.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(o,n,i)=>lf(e,o,n,i),Yi(e,"ZodNumber",{gt(o,n){return this.check(Ht(o,n))},gte(o,n){return this.check(We(o,n))},min(o,n){return this.check(We(o,n))},lt(o,n){return this.check(Bt(o,n))},lte(o,n){return this.check(st(o,n))},max(o,n){return this.check(st(o,n))},int(o){return this.check(Oc(o))},safe(o){return this.check(Oc(o))},positive(o){return this.check(Ht(0,o))},nonnegative(o){return this.check(We(0,o))},negative(o){return this.check(Bt(0,o))},nonpositive(o){return this.check(st(0,o))},multipleOf(o,n){return this.check(Gn(o,n))},step(o,n){return this.check(Gn(o,n))},finite(){return this}});let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function cg(e){return Cm(Lo,e)}var Sr=y("ZodNumberFormat",(e,t)=>{Lp.init(e,t),Lo.init(e,t)});function Oc(e){return Tm(Sr,e)}function qk(e){return Rm(Sr,e)}function Kk(e){return Om(Sr,e)}function Xk(e){return Dm(Sr,e)}function Yk(e){return Nm(Sr,e)}var Uo=y("ZodBoolean",(e,t)=>{Fi.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,o,n)=>uf(e,r,o,n)});function lg(e){return Lm(Uo,e)}var jo=y("ZodBigInt",(e,t)=>{Ha.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(o,n,i)=>df(e,o,n,i),e.gte=(o,n)=>e.check(We(o,n)),e.min=(o,n)=>e.check(We(o,n)),e.gt=(o,n)=>e.check(Ht(o,n)),e.gte=(o,n)=>e.check(We(o,n)),e.min=(o,n)=>e.check(We(o,n)),e.lt=(o,n)=>e.check(Bt(o,n)),e.lte=(o,n)=>e.check(st(o,n)),e.max=(o,n)=>e.check(st(o,n)),e.positive=o=>e.check(Ht(BigInt(0),o)),e.negative=o=>e.check(Bt(BigInt(0),o)),e.nonpositive=o=>e.check(st(BigInt(0),o)),e.nonnegative=o=>e.check(We(BigInt(0),o)),e.multipleOf=(o,n)=>e.check(Gn(o,n));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});function Qk(e){return jm(jo,e)}var Yc=y("ZodBigIntFormat",(e,t)=>{Up.init(e,t),jo.init(e,t)});function ew(e){return Fm(Yc,e)}function tw(e){return Mm(Yc,e)}var ug=y("ZodSymbol",(e,t)=>{jp.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,o,n)=>pf(e,r,o,n)});function nw(e){return Bm(ug,e)}var dg=y("ZodUndefined",(e,t)=>{zp.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ff(e,r,o,n)});function rw(e){return Hm(dg,e)}var pg=y("ZodNull",(e,t)=>{Fp.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,o,n)=>mf(e,r,o,n)});function mg(e){return Zm(pg,e)}var fg=y("ZodAny",(e,t)=>{Mp.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,o,n)=>vf(e,r,o,n)});function ow(){return Gm(fg)}var gg=y("ZodUnknown",(e,t)=>{Bp.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,o,n)=>bf(e,r,o,n)});function wr(){return Wm(gg)}var hg=y("ZodNever",(e,t)=>{Hp.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,o,n)=>hf(e,r,o,n)});function Qc(e){return Vm(hg,e)}var vg=y("ZodVoid",(e,t)=>{Zp.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,o,n)=>gf(e,r,o,n)});function iw(e){return Jm(vg,e)}var es=y("ZodDate",(e,t)=>{Gp.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(o,n,i)=>yf(e,o,n,i),e.min=(o,n)=>e.check(We(o,n)),e.max=(o,n)=>e.check(st(o,n));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});function sw(e){return qm(es,e)}var bg=y("ZodArray",(e,t)=>{Wp.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Tf(e,r,o,n),e.element=t.element,Yi(e,"ZodArray",{min(r,o){return this.check(pn(r,o))},nonempty(r){return this.check(pn(1,r))},max(r,o){return this.check(xr(r,o))},length(r,o){return this.check(kr(r,o))},unwrap(){return this.element}})});function ts(e,t){return Ym(bg,e,t)}function aw(e){let t=e._zod.def.shape;return tl(Object.keys(t))}var ns=y("ZodObject",(e,t)=>{Vp.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Rf(e,r,o,n),T.defineLazy(e,"shape",()=>t.shape),Yi(e,"ZodObject",{keyof(){return tl(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:wr()})},loose(){return this.clone({...this._zod.def,catchall:wr()})},strict(){return this.clone({...this._zod.def,catchall:Qc()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return T.extend(this,r)},safeExtend(r){return T.safeExtend(this,r)},merge(r){return T.merge(this,r)},pick(r){return T.pick(this,r)},omit(r){return T.omit(this,r)},partial(...r){return T.partial(rl,this,r[0])},required(...r){return T.required(ol,this,r[0])}})});function cw(e,t){let r={type:"object",shape:e??{},...T.normalizeParams(t)};return new ns(r)}function lw(e,t){return new ns({type:"object",shape:e,catchall:Qc(),...T.normalizeParams(t)})}function uw(e,t){return new ns({type:"object",shape:e,catchall:wr(),...T.normalizeParams(t)})}var rs=y("ZodUnion",(e,t)=>{Mi.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,o,n)=>_c(e,r,o,n),e.options=t.options});function el(e,t){return new rs({type:"union",options:e,...T.normalizeParams(t)})}var yg=y("ZodXor",(e,t)=>{rs.init(e,t),Jp.init(e,t),e._zod.processJSONSchema=(r,o,n)=>_c(e,r,o,n),e.options=t.options});function dw(e,t){return new yg({type:"union",options:e,inclusive:!1,...T.normalizeParams(t)})}var xg=y("ZodDiscriminatedUnion",(e,t)=>{rs.init(e,t),qp.init(e,t)});function pw(e,t,r){return new xg({type:"union",options:t,discriminator:e,...T.normalizeParams(r)})}var kg=y("ZodIntersection",(e,t)=>{Kp.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Of(e,r,o,n)});function wg(e,t){return new kg({type:"intersection",left:e,right:t})}var Sg=y("ZodTuple",(e,t)=>{Za.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Df(e,r,o,n),e.rest=r=>e.clone({...e._zod.def,rest:r})});function _g(e,t,r){let o=t instanceof J,n=o?r:t,i=o?t:null;return new Sg({type:"tuple",items:e,rest:i,...T.normalizeParams(n)})}var Ro=y("ZodRecord",(e,t)=>{Xp.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Nf(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});function $g(e,t,r){return!t||!t._zod?new Ro({type:"record",keyType:Ji(),valueType:e,...T.normalizeParams(t)}):new Ro({type:"record",keyType:e,valueType:t,...T.normalizeParams(r)})}function mw(e,t,r){let o=Ze(e);return o._zod.values=void 0,new Ro({type:"record",keyType:o,valueType:t,...T.normalizeParams(r)})}function fw(e,t,r){return new Ro({type:"record",keyType:e,valueType:t,mode:"loose",...T.normalizeParams(r)})}var Ig=y("ZodMap",(e,t)=>{Yp.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Cf(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(Zt(...r)),e.nonempty=r=>e.check(Zt(1,r)),e.max=(...r)=>e.check(Wn(...r)),e.size=(...r)=>e.check(yr(...r))});function gw(e,t,r){return new Ig({type:"map",keyType:e,valueType:t,...T.normalizeParams(r)})}var Eg=y("ZodSet",(e,t)=>{Qp.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Pf(e,r,o,n),e.min=(...r)=>e.check(Zt(...r)),e.nonempty=r=>e.check(Zt(1,r)),e.max=(...r)=>e.check(Wn(...r)),e.size=(...r)=>e.check(yr(...r))});function hw(e,t){return new Eg({type:"set",valueType:e,...T.normalizeParams(t)})}var Oo=y("ZodEnum",(e,t)=>{em.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(o,n,i)=>xf(e,o,n,i),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(o,n)=>{let i={};for(let s of o)if(r.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new Oo({...t,checks:[],...T.normalizeParams(n),entries:i})},e.exclude=(o,n)=>{let i={...t.entries};for(let s of o)if(r.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new Oo({...t,checks:[],...T.normalizeParams(n),entries:i})}});function tl(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new Oo({type:"enum",entries:r,...T.normalizeParams(t)})}function vw(e,t){return new Oo({type:"enum",entries:e,...T.normalizeParams(t)})}var Ag=y("ZodLiteral",(e,t)=>{tm.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,o,n)=>kf(e,r,o,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function bw(e,t){return new Ag({type:"literal",values:Array.isArray(e)?e:[e],...T.normalizeParams(t)})}var Cg=y("ZodFile",(e,t)=>{nm.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,o,n)=>_f(e,r,o,n),e.min=(r,o)=>e.check(Zt(r,o)),e.max=(r,o)=>e.check(Wn(r,o)),e.mime=(r,o)=>e.check(So(Array.isArray(r)?r:[r],o))});function yw(e){return Qm(Cg,e)}var Pg=y("ZodTransform",(e,t)=>{rm.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Af(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Fn(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(T.issue(i,r.value,t));else{let s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=e),r.issues.push(T.issue(s))}};let n=t.transform(r.value,r);return n instanceof Promise?n.then(i=>(r.value=i,r.fallback=!0,r)):(r.value=n,r.fallback=!0,r)}});function nl(e){return new Pg({type:"transform",transform:e})}var rl=y("ZodOptional",(e,t)=>{Ga.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,o,n)=>$c(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Ki(e){return new rl({type:"optional",innerType:e})}var Tg=y("ZodExactOptional",(e,t)=>{om.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,o,n)=>$c(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Rg(e){return new Tg({type:"optional",innerType:e})}var Og=y("ZodNullable",(e,t)=>{im.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Lf(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Xi(e){return new Og({type:"nullable",innerType:e})}function xw(e){return Ki(Xi(e))}var Dg=y("ZodDefault",(e,t)=>{sm.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,o,n)=>jf(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Ng(e,t){return new Dg({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():T.shallowClone(t)}})}var Lg=y("ZodPrefault",(e,t)=>{am.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,o,n)=>zf(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Ug(e,t){return new Lg({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():T.shallowClone(t)}})}var ol=y("ZodNonOptional",(e,t)=>{cm.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Uf(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function jg(e,t){return new ol({type:"nonoptional",innerType:e,...T.normalizeParams(t)})}var zg=y("ZodSuccess",(e,t)=>{lm.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,o,n)=>$f(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function kw(e){return new zg({type:"success",innerType:e})}var Fg=y("ZodCatch",(e,t)=>{um.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ff(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Mg(e,t){return new Fg({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var Bg=y("ZodNaN",(e,t)=>{dm.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,o,n)=>wf(e,r,o,n)});function ww(e){return Xm(Bg,e)}var os=y("ZodPipe",(e,t)=>{Wa.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Mf(e,r,o,n),e.in=t.in,e.out=t.out});function Dc(e,t){return new os({type:"pipe",in:e,out:t})}var is=y("ZodCodec",(e,t)=>{os.init(e,t),Bi.init(e,t)});function Sw(e,t,r){return new is({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}function _w(e){let t=e._zod.def;return new is({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var Hg=y("ZodPreprocess",(e,t)=>{os.init(e,t),pm.init(e,t)}),Zg=y("ZodReadonly",(e,t)=>{mm.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Bf(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Gg(e){return new Zg({type:"readonly",innerType:e})}var Wg=y("ZodTemplateLiteral",(e,t)=>{fm.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Sf(e,r,o,n)});function $w(e,t){return new Wg({type:"template_literal",parts:e,...T.normalizeParams(t)})}var Vg=y("ZodLazy",(e,t)=>{vm.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Zf(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});function Jg(e){return new Vg({type:"lazy",getter:e})}var qg=y("ZodPromise",(e,t)=>{hm.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Hf(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Iw(e){return new qg({type:"promise",innerType:e})}var Kg=y("ZodFunction",(e,t)=>{gm.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ef(e,r,o,n)});function Ew(e){return new Kg({type:"function",input:Array.isArray(e?.input)?_g(e?.input):e?.input??ts(wr()),output:e?.output??wr()})}var ss=y("ZodCustom",(e,t)=>{bm.init(e,t),Q.init(e,t),e._zod.processJSONSchema=(r,o,n)=>If(e,r,o,n)});function Aw(e){let t=new be({check:"custom"});return t._zod.check=e,t}function Cw(e,t){return ef(ss,e??(()=>!0),t)}function Xg(e,t={}){return tf(ss,e,t)}function Yg(e,t){return nf(e,t)}var Pw=rf,Tw=of;function Rw(e,t={}){let r=new ss({type:"custom",check:"custom",fn:o=>o instanceof e,abort:!0,...T.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=o=>{o.value instanceof e||o.issues.push({code:"invalid_type",expected:e.name,input:o.value,inst:r,path:[...r._zod.def.path??[]]})},r}var Ow=(...e)=>sf({Codec:is,Boolean:Uo,String:Do},...e);function Dw(e){let t=Jg(()=>el([Ji(e),cg(),lg(),mg(),ts(t),$g(Ji(),t)]));return t}function Nw(e,t){return new Hg({type:"pipe",in:nl(e),out:t})}var p1={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function m1(e){Ie({customError:e})}function f1(){return Ie().customError}var Qg;Qg||(Qg={});var L={...Vi,...Ac,iso:To},g1=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function h1(e,t){let r=e.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function v1(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;let o=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===o){let n=r[1];if(!n||!t.defs[n])throw new Error(`Reference not found: ${e}`);return t.defs[n]}throw new Error(`Reference not found: ${e}`)}function Lw(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return L.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let n=e.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return L.lazy(()=>{if(!t.refs.has(n))throw new Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let i=v1(n,t),s=Fe(i,t);return t.refs.set(n,s),t.processing.delete(n),s}if(e.enum!==void 0){let n=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&n.length===1&&n[0]===null)return L.null();if(n.length===0)return L.never();if(n.length===1)return L.literal(n[0]);if(n.every(s=>typeof s=="string"))return L.enum(n);let i=n.map(s=>L.literal(s));return i.length<2?i[0]:L.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return L.literal(e.const);let r=e.type;if(Array.isArray(r)){let n=r.map(i=>{let s={...e,type:i};return Lw(s,t)});return n.length===0?L.never():n.length===1?n[0]:L.union(n)}if(!r)return L.any();let o;switch(r){case"string":{let n=L.string();if(e.format){let i=e.format;i==="email"?n=n.check(L.email()):i==="uri"||i==="uri-reference"?n=n.check(L.url()):i==="uuid"||i==="guid"?n=n.check(L.uuid()):i==="date-time"?n=n.check(L.iso.datetime()):i==="date"?n=n.check(L.iso.date()):i==="time"?n=n.check(L.iso.time()):i==="duration"?n=n.check(L.iso.duration()):i==="ipv4"?n=n.check(L.ipv4()):i==="ipv6"?n=n.check(L.ipv6()):i==="mac"?n=n.check(L.mac()):i==="cidr"?n=n.check(L.cidrv4()):i==="cidr-v6"?n=n.check(L.cidrv6()):i==="base64"?n=n.check(L.base64()):i==="base64url"?n=n.check(L.base64url()):i==="e164"?n=n.check(L.e164()):i==="jwt"?n=n.check(L.jwt()):i==="emoji"?n=n.check(L.emoji()):i==="nanoid"?n=n.check(L.nanoid()):i==="cuid"?n=n.check(L.cuid()):i==="cuid2"?n=n.check(L.cuid2()):i==="ulid"?n=n.check(L.ulid()):i==="xid"?n=n.check(L.xid()):i==="ksuid"&&(n=n.check(L.ksuid()))}typeof e.minLength=="number"&&(n=n.min(e.minLength)),typeof e.maxLength=="number"&&(n=n.max(e.maxLength)),e.pattern&&(n=n.regex(new RegExp(e.pattern))),o=n;break}case"number":case"integer":{let n=r==="integer"?L.number().int():L.number();typeof e.minimum=="number"&&(n=n.min(e.minimum)),typeof e.maximum=="number"&&(n=n.max(e.maximum)),typeof e.exclusiveMinimum=="number"?n=n.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(n=n.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?n=n.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(n=n.lt(e.maximum)),typeof e.multipleOf=="number"&&(n=n.multipleOf(e.multipleOf)),o=n;break}case"boolean":{o=L.boolean();break}case"null":{o=L.null();break}case"object":{let n={},i=e.properties||{},s=new Set(e.required||[]);for(let[l,u]of Object.entries(i)){let p=Fe(u,t);n[l]=s.has(l)?p:p.optional()}if(e.propertyNames){let l=Fe(e.propertyNames,t),u=e.additionalProperties&&typeof e.additionalProperties=="object"?Fe(e.additionalProperties,t):L.any();if(Object.keys(n).length===0){o=L.record(l,u);break}let p=L.object(n).passthrough(),d=L.looseRecord(l,u);o=L.intersection(p,d);break}if(e.patternProperties){let l=e.patternProperties,u=Object.keys(l),p=[];for(let m of u){let f=Fe(l[m],t),g=L.string().regex(new RegExp(m));p.push(L.looseRecord(g,f))}let d=[];if(Object.keys(n).length>0&&d.push(L.object(n).passthrough()),d.push(...p),d.length===0)o=L.object({}).passthrough();else if(d.length===1)o=d[0];else{let m=L.intersection(d[0],d[1]);for(let f=2;f<d.length;f++)m=L.intersection(m,d[f]);o=m}break}let a=L.object(n);e.additionalProperties===!1?o=a.strict():typeof e.additionalProperties=="object"?o=a.catchall(Fe(e.additionalProperties,t)):o=a.passthrough();break}case"array":{let n=e.prefixItems,i=e.items;if(n&&Array.isArray(n)){let s=n.map(l=>Fe(l,t)),a=i&&typeof i=="object"&&!Array.isArray(i)?Fe(i,t):void 0;a?o=L.tuple(s).rest(a):o=L.tuple(s),typeof e.minItems=="number"&&(o=o.check(L.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(L.maxLength(e.maxItems)))}else if(Array.isArray(i)){let s=i.map(l=>Fe(l,t)),a=e.additionalItems&&typeof e.additionalItems=="object"?Fe(e.additionalItems,t):void 0;a?o=L.tuple(s).rest(a):o=L.tuple(s),typeof e.minItems=="number"&&(o=o.check(L.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(L.maxLength(e.maxItems)))}else if(i!==void 0){let s=Fe(i,t),a=L.array(s);typeof e.minItems=="number"&&(a=a.min(e.minItems)),typeof e.maxItems=="number"&&(a=a.max(e.maxItems)),o=a}else o=L.array(L.any());break}default:throw new Error(`Unsupported type: ${r}`)}return o}function Fe(e,t){if(typeof e=="boolean")return e?L.any():L.never();let r=Lw(e,t),o=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let a=e.anyOf.map(u=>Fe(u,t)),l=L.union(a);r=o?L.intersection(r,l):l}if(e.oneOf&&Array.isArray(e.oneOf)){let a=e.oneOf.map(u=>Fe(u,t)),l=L.xor(a);r=o?L.intersection(r,l):l}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=o?r:L.any();else{let a=o?r:Fe(e.allOf[0],t),l=o?0:1;for(let u=l;u<e.allOf.length;u++)a=L.intersection(a,Fe(e.allOf[u],t));r=a}e.nullable===!0&&t.version==="openapi-3.0"&&(r=L.nullable(r)),e.readOnly===!0&&(r=L.readonly(r)),e.default!==void 0&&(r=r.default(e.default));let n={},i=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let a of i)a in e&&(n[a]=e[a]);let s=["contentEncoding","contentMediaType","contentSchema"];for(let a of s)a in e&&(n[a]=e[a]);for(let a of Object.keys(e))g1.has(a)||(n[a]=e[a]);return Object.keys(n).length>0&&t.registry.add(r,n),e.description&&(r=r.describe(e.description)),r}function Uw(e,t){if(typeof e=="boolean")return e?L.any():L.never();let r;try{r=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let o=h1(r,t?.defaultTarget),n=r.$defs||r.definitions||{},i={version:o,defs:n,refs:new Map,processing:new Set,rootSchema:r,registry:t?.registry??Ne};return Fe(r,i)}var eh={};rn(eh,{bigint:()=>k1,boolean:()=>x1,date:()=>w1,number:()=>y1,string:()=>b1});function b1(e){return wm(Do,e)}function y1(e){return Pm(Lo,e)}function x1(e){return Um(Uo,e)}function k1(e){return zm(jo,e)}function w1(e){return Km(es,e)}Ie(Va());var ae=c.number().min(0).max(100),hn=c.number().int().min(1e3).max(12e3),gn=c.number(),ee=c.number().int().nonnegative(),At=c.enum(["hue","matter","smartthings","homeassistant","nest","alexa","google","kasa","wiz","lifx","shelly","govee","tapo","tuya","yeelight","nanoleaf","meross","ewelink","wled","elgato","roku","mqtt","esphome","mock","other"]),S1=c.enum(["local","cloud","offline","unknown"]),as=c.enum(["light","plug","switch","dimmer","thermostat","lock","cover","garageDoor","valve","fan","sensor","binarySensor","camera","doorbell","speaker","tv","mediaPlayer","vacuum","appliance","airPurifier","humidifier","waterHeater","evCharger","sceneController","remote","scene","group","bridge","other"]),_1=c.enum(["temperature","humidity","illuminance","pressure","co2","pm25","pm10","voc","airQuality","noise","uvIndex","windSpeed","distance","generic"]),$1=c.enum(["motion","occupancy","presence","contact","leak","smoke","co","gas","tamper","vibration","glassBreak","button","person","sound","moisture","generic"]);var xe=(e,t)=>c.object({type:c.literal(e),instance:c.string().optional(),...t}),I1=xe("power",{state:c.object({on:c.boolean().nullable()})}),E1=xe("brightness",{state:c.object({level:ae.nullable()})}),A1=xe("colorTemperature",{config:c.object({minKelvin:hn,maxKelvin:hn}),state:c.object({kelvin:hn.nullable()})}),C1=xe("color",{config:c.object({modes:c.array(c.enum(["hs","rgb","xy"])).default(["hs"])}),state:c.object({hue:c.number().min(0).max(360).nullable(),saturation:ae.nullable()})}),P1=xe("segmentColor",{config:c.object({segments:c.number().int().min(1)}),state:c.object({colors:c.array(c.object({hue:c.number().min(0).max(360).nullable(),saturation:ae.nullable()})).nullable()})}),rh=c.enum(["off","heat","cool","auto","eco","fanOnly","dry"]),T1=xe("thermostat",{config:c.object({modes:c.array(rh),minC:gn,maxC:gn,supportsRange:c.boolean().default(!1)}),state:c.object({mode:rh.nullable(),currentC:gn.nullable(),setpointC:gn.nullable().optional(),heatC:gn.nullable().optional(),coolC:gn.nullable().optional(),action:c.enum(["idle","heating","cooling","fan"]).nullable().optional()})}),R1=xe("humidity",{config:c.object({settable:c.boolean().default(!1),minPct:ae.default(0),maxPct:ae.default(100)}),state:c.object({currentPct:ae.nullable().optional(),targetPct:ae.nullable().optional()})}),O1=xe("lock",{state:c.object({state:c.enum(["locked","unlocked","jammed","unknown"])})}),D1=xe("cover",{config:c.object({kind:c.enum(["blind","shade","curtain","awning","garage","door","window","valve","generic"]),supportsPosition:c.boolean().default(!1),supportsTilt:c.boolean().default(!1)}),state:c.object({position:ae.nullable().optional(),tilt:ae.nullable().optional(),state:c.enum(["open","closed","opening","closing","stopped","partial","unknown"])})}),N1=xe("fan",{config:c.object({presets:c.array(c.string()).default([]),supportsOscillate:c.boolean().default(!1)}),state:c.object({on:c.boolean().nullable(),level:ae.nullable().optional(),preset:c.string().nullable().optional(),oscillating:c.boolean().nullable().optional()})}),L1=xe("mode",{config:c.object({options:c.array(c.string())}),state:c.object({value:c.string().nullable()})}),U1=xe("toggle",{state:c.object({on:c.boolean().nullable()})}),j1=xe("range",{config:c.object({min:c.number(),max:c.number(),step:c.number().optional(),unit:c.string().optional()}),state:c.object({value:c.number().nullable()})}),z1=xe("mediaTransport",{state:c.object({state:c.enum(["playing","paused","stopped","buffering","idle"]).nullable(),metadata:c.object({title:c.string().optional(),artist:c.string().optional(),album:c.string().optional(),artworkUrl:c.string().optional()}).nullable().optional(),positionSec:c.number().nonnegative().nullable().optional(),durationSec:c.number().nonnegative().nullable().optional(),shuffle:c.boolean().nullable().optional(),repeat:c.enum(["off","one","all"]).nullable().optional()})}),F1=xe("volume",{state:c.object({level:ae.nullable(),muted:c.boolean().nullable()})}),M1=xe("inputSource",{config:c.object({sources:c.array(c.string())}),state:c.object({source:c.string().nullable()})}),B1=xe("startStop",{config:c.object({supportsPause:c.boolean().default(!1)}),state:c.object({state:c.enum(["running","paused","stopped","unknown"])})}),H1=xe("scene",{state:c.object({lastActivated:ee.nullable().optional()})}),Z1=xe("camera",{config:c.object({protocols:c.array(c.enum(["rtsp","webrtc","hls","snapshot"]))}),state:c.object({streaming:c.boolean().nullable().optional()})}),G1=xe("sensor",{config:c.object({measurement:_1,unit:c.string()}),state:c.object({value:c.number().nullable(),ts:ee.nullable().optional()})}),W1=xe("binarySensor",{config:c.object({sensorType:$1}),state:c.object({active:c.boolean().nullable(),lastChanged:ee.nullable().optional()})}),V1=xe("battery",{state:c.object({level:ae.nullable(),charging:c.boolean().nullable().optional(),low:c.boolean().nullable().optional()})}),J1=xe("energyMeter",{state:c.object({power:c.number().nullable().optional(),energy:c.number().nullable().optional(),voltage:c.number().nullable().optional(),current:c.number().nullable().optional()})}),q1=xe("doorbell",{state:c.object({lastPress:ee.nullable().optional()})}),K1=xe("connectivity",{config:c.object({transport:c.enum(["wifi","thread","zigbee","zwave","ethernet","ble","cloud","matter","unknown"])}),state:c.object({online:c.boolean().nullable(),signal:c.number().nullable().optional()})}),jw=c.enum(["flash","strobe","pulse","colorFade","colorLoop","candle","rainbow","siren","meter"]),at=c.object({hue:c.number().min(0).max(360),saturation:ae}),fn=c.number().int().min(20).max(6e5),th=c.number().int().min(1).max(1e3).nullable().default(null),_r=c.discriminatedUnion("kind",[c.object({kind:c.literal("flash"),count:c.number().int().min(1).max(100).default(3),onMs:fn.default(300),offMs:fn.default(300),color:at.nullable().default(null),brightness:ae.nullable().default(null)}),c.object({kind:c.literal("strobe"),hz:c.number().min(.5).max(25).default(8),durationMs:fn.default(3e3),color:at.nullable().default(null)}),c.object({kind:c.literal("pulse"),periodMs:fn.default(2e3),minPct:ae.default(5),maxPct:ae.default(100),color:at.nullable().default(null),cycles:th}),c.object({kind:c.literal("colorFade"),from:at.nullable().default(null),to:at,durationMs:fn.default(2e3),easing:c.enum(["linear","ease"]).default("ease")}),c.object({kind:c.literal("colorLoop"),colors:c.array(at).min(2).max(16),holdMs:fn.default(1e3),fadeMs:c.number().int().min(0).max(6e5).default(800),loops:th,direction:c.enum(["forward","pingpong"]).default("forward")}),c.object({kind:c.literal("candle"),intensity:ae.default(50),warmthKelvin:hn.nullable().default(null),durationMs:fn.nullable().default(null)}),c.object({kind:c.literal("rainbow"),cycleMs:fn.default(4e3),saturation:ae.default(100),brightness:ae.default(100),loops:th}),c.object({kind:c.literal("siren"),colorA:at.default({hue:0,saturation:100}),colorB:at.default({hue:240,saturation:100}),hz:c.number().min(.5).max(10).default(4),durationMs:fn.nullable().default(null)}),c.object({kind:c.literal("meter"),source:c.enum(["context","usage","cost"]),stops:c.array(c.object({at:c.number().min(0),color:at})).min(2).max(6).default([{at:0,color:{hue:120,saturation:90}},{at:75,color:{hue:40,saturation:95}},{at:95,color:{hue:0,saturation:95}}])})]),X1=xe("effect",{config:c.object({kinds:c.array(jw).default(["flash"]),supportsColor:c.boolean().default(!1)}),state:c.object({active:jw.nullable()})}),Y1=c.discriminatedUnion("type",[I1,E1,A1,C1,P1,T1,R1,O1,D1,N1,L1,U1,j1,z1,F1,M1,B1,H1,Z1,G1,W1,V1,J1,q1,K1,X1]),Ct=c.enum(["power","brightness","colorTemperature","color","segmentColor","thermostat","humidity","lock","cover","fan","mode","toggle","range","mediaTransport","volume","inputSource","startStop","scene","camera","sensor","binarySensor","battery","energyMeter","doorbell","connectivity","effect"]),Mw=c.enum(["needs-password"]),Q1=c.object({sourceId:c.string(),provider:At,providerAccountId:c.string(),nativeId:c.string(),nativeType:c.string().optional(),reachability:c.enum(["local","cloud"]),online:c.boolean(),attention:Mw.nullable().optional(),credentialRef:c.string().nullable().optional(),lastSeen:ee.nullable().optional()}),eO=c.object({id:c.string(),name:c.string(),providerRefs:c.array(c.object({provider:At,nativeId:c.string()})).default([])}),tO=c.object({accountId:c.string(),provider:At,displayName:c.string(),reachability:c.enum(["local","cloud"]),status:c.enum(["linked","needs_reauth","revoked"]),expiresAt:ee.nullable().optional()}),nO=c.object({id:c.string(),type:as,name:c.string(),areaId:c.string().nullable(),manufacturer:c.string().nullable().optional(),model:c.string().nullable().optional(),firmwareVersion:c.string().nullable().optional(),online:c.boolean(),reachability:S1,attention:Mw.nullable().optional(),parentId:c.string().nullable().optional(),members:c.array(c.string()).optional(),sources:c.array(Q1).min(1),preferredSourceId:c.string(),capabilities:c.array(Y1),updatedAt:ee,raw:c.unknown().optional()}),Bw=c.object({version:c.literal(1),nodeId:c.string(),updatedAt:ee,areas:c.array(eO),accounts:c.array(tO),devices:c.array(nO)}),rO=c.enum(["relay-do-sealed","hub-local"]),WZ=c.object({accountId:c.string(),provider:At,providerAccountId:c.string(),nodeId:c.string(),credentialLocation:rO,scopes:c.array(c.string()).default([]),status:c.enum(["linked","needs_reauth","revoked"]),displayName:c.string(),expiresAt:ee.nullable().optional(),linkedAt:ee}),zw=c.enum(["open","guarded","locked"]),nh=c.enum(["allow","confirm","deny"]),oO=c.enum(["voice","claude","app","rules"]),VZ=c.object({tier:zw.default("open"),perConsumer:c.partialRecord(oO,zw).default({}),perClass:c.partialRecord(Ct,nh).default({}),perDeviceType:c.partialRecord(as,nh).default({}),perDevice:c.record(c.string(),nh).default({}),confirmWindowSec:c.number().default(60)}),Ee=c.object({}),Fw=e=>e.type==="cover"&&(e.config.kind==="garage"||e.config.kind==="door"),cs={power:[{command:"turnOn",params:Ee},{command:"turnOff",params:Ee},{command:"toggle",params:Ee}],brightness:[{command:"setBrightness",params:c.object({level:ae})},{command:"adjustBrightness",params:c.object({delta:c.number().min(-100).max(100)})}],colorTemperature:[{command:"setColorTemperature",params:c.object({kelvin:hn})}],color:[{command:"setColor",params:c.object({hue:c.number().min(0).max(360),saturation:ae})}],segmentColor:[{command:"setSegmentColors",voice:!1,params:c.object({segments:c.array(c.object({index:c.number().int().nonnegative(),hue:c.number().min(0).max(360),saturation:ae})).min(1).max(512)})}],thermostat:[{command:"setThermostatMode",params:c.object({mode:rh})},{command:"setSetpoint",params:c.object({celsius:gn})},{command:"setRange",params:c.object({heatCelsius:gn,coolCelsius:gn}),gate:e=>e.type==="thermostat"&&e.config.supportsRange}],humidity:[{command:"setHumidity",params:c.object({percent:ae}),gate:e=>e.type==="humidity"&&e.config.settable}],lock:[{command:"lock",params:Ee},{command:"unlock",params:Ee,confirm:!0}],cover:[{command:"open",params:Ee,confirm:Fw},{command:"close",params:Ee},{command:"stop",params:Ee},{command:"setPosition",params:c.object({position:ae}),confirm:Fw,gate:e=>e.type==="cover"&&e.config.supportsPosition},{command:"setTilt",params:c.object({tilt:ae}),gate:e=>e.type==="cover"&&e.config.supportsTilt}],fan:[{command:"turnOn",params:Ee},{command:"turnOff",params:Ee},{command:"setFanSpeed",params:c.object({level:ae})},{command:"setFanPreset",params:c.object({preset:c.string()}),gate:e=>e.type==="fan"&&e.config.presets.length>0},{command:"setOscillate",params:c.object({oscillating:c.boolean()}),gate:e=>e.type==="fan"&&e.config.supportsOscillate}],mode:[{command:"setMode",params:c.object({value:c.string()})}],toggle:[{command:"setToggle",params:c.object({on:c.boolean()})}],range:[{command:"setRange",params:c.object({value:c.number()})},{command:"adjustRange",params:c.object({delta:c.number()})}],mediaTransport:[{command:"play",params:Ee},{command:"pause",params:Ee},{command:"stop",params:Ee},{command:"next",params:Ee},{command:"previous",params:Ee},{command:"seek",params:c.object({positionSec:c.number().nonnegative()})},{command:"setShuffle",params:c.object({on:c.boolean()})},{command:"setRepeat",params:c.object({mode:c.enum(["off","one","all"])})}],volume:[{command:"setVolume",params:c.object({level:ae})},{command:"adjustVolume",params:c.object({delta:c.number().min(-100).max(100)})},{command:"setMute",params:c.object({muted:c.boolean()})}],inputSource:[{command:"selectInput",params:c.object({source:c.string()})}],startStop:[{command:"start",params:Ee},{command:"stop",params:Ee},{command:"pause",params:Ee,gate:e=>e.type==="startStop"&&e.config.supportsPause},{command:"resume",params:Ee,gate:e=>e.type==="startStop"&&e.config.supportsPause}],scene:[{command:"activate",params:Ee}],effect:[{command:"startEffect",params:c.object({spec:_r})},{command:"stopEffect",params:Ee}],camera:[{command:"getStream",params:c.object({protocol:c.enum(["rtsp","webrtc","hls"])}),voice:!1,returns:c.object({url:c.string(),token:c.string().optional(),expiresAt:ee.optional()})},{command:"getSnapshot",params:Ee,voice:!1,returns:c.object({url:c.string(),expiresAt:ee.optional()})}],sensor:[],binarySensor:[],battery:[],energyMeter:[],doorbell:[],connectivity:[]};var iO=c.discriminatedUnion("kind",[c.object({kind:c.literal("literal"),hue:c.number().min(0).max(360),saturation:ae}),c.object({kind:c.literal("token"),token:c.enum(["main","session"])})]),il=c.enum(["main","session","hold","off"]),sl=c.object({color:iO.optional(),brightnessPct:ae.nullable().optional(),brightnessScale:c.number().min(0).max(2).optional(),kelvin:hn.nullable().optional(),power:c.boolean().optional()});var ls=c.enum(["added","removed","permission_request","started","ended","working","finished","error","idle","needs_permission","promptSubmitted","toolStart","toolEnd","subagentStart","subagentFinished","compacting","resumed","aborted","contextLow","contextCritical","needsInput","planReady","rateLimited","compactDone","permissionDenied","taskCompleted","usageHigh","modePlan","modeAuto","modeBypass","modeNormal","modelChanged","workflowStarted","sandboxEscalation","reviewChanged","costHigh","longRunning"]),Hw=new Set(["added","removed","permission_request","promptSubmitted","toolStart","toolEnd","aborted"]),vn=c.enum(["claude","codex"]);var sO=c.discriminatedUnion("kind",[c.object({kind:c.literal("deviceState"),deviceId:c.string(),capability:c.string(),instance:c.string().optional(),op:c.enum(["eq","neq","gt","lt","gte","lte","changed"]).default("changed"),path:c.string().optional(),value:c.unknown().optional()}),c.object({kind:c.literal("edge"),deviceId:c.string(),event:c.string()}),c.object({kind:c.literal("session"),event:ls,repo:c.string().optional(),sessionId:c.string().optional(),agent:vn.optional()}),c.object({kind:c.literal("schedule"),cron:c.string()})]),aO=c.object({deviceId:c.string(),capability:c.string(),instance:c.string().optional(),op:c.enum(["eq","neq","gt","lt","gte","lte"]),path:c.string().optional(),value:c.unknown()}),cO=c.discriminatedUnion("kind",[c.object({kind:c.literal("device"),deviceId:c.string(),capability:c.string(),instance:c.string().optional(),command:c.string(),params:c.unknown().optional()}),c.object({kind:c.literal("session"),sessionId:c.string(),text:c.string()}),c.object({kind:c.literal("notify"),title:c.string(),body:c.string()}),c.object({kind:c.literal("intent"),deviceId:c.string(),instance:c.string().optional(),look:sl.optional(),effect:_r.optional(),returnTo:il.optional(),hold:c.boolean().default(!1)})]),Zw=c.object({id:c.string(),name:c.string().default(""),enabled:c.boolean().default(!0),trigger:sO,conditions:c.array(aO).default([]),actions:c.array(cO).min(1),allowSecurity:c.boolean().default(!1)});var zo=c.enum(["started","ended","working","finished","error","idle","needs_permission","subagentFinished","compacting","resumed","contextLow","contextCritical","needsInput","planReady","rateLimited","subagentStart","compactDone","permissionDenied","taskCompleted","usageHigh","modePlan","modeAuto","modeBypass","modeNormal","modelChanged","workflowStarted","sandboxEscalation","reviewChanged","costHigh","longRunning"]),Gw=c.object({id:c.string(),name:c.string(),cwd:c.string(),online:c.boolean().default(!0),state:zo.optional(),bridgeId:c.string().optional(),bridgeName:c.string().optional(),agent:vn.optional()}),Ww=c.enum(["allow","deny"]),i3=c.object({sessionId:c.string().nullable(),text:c.string(),ts:ee.optional()}),al=c.object({latestReply:c.string().nullable(),ts:c.number().nullable(),cursor:c.number().int().nonnegative(),hasMore:c.boolean()}),s3=c.object({requestId:c.string(),behavior:Ww,ts:ee.optional()}),a3=c.object({id:c.string(),sessionId:c.string().nullable(),args:c.unknown(),ts:ee.optional()}),lO=c.object({type:c.literal("register"),userToken:c.string().optional(),sessions:c.array(Gw),claudeSessionId:c.string().optional()}),uO=c.object({type:c.literal("sessions.update"),sessions:c.array(Gw)}),dO=c.object({type:c.literal("prompt"),sessionId:c.string(),requestId:c.string(),text:c.string(),ts:ee.optional()});var pO=c.object({type:c.literal("reply"),sessionId:c.string(),requestId:c.string(),text:c.string(),seq:c.number().int().nonnegative().optional(),final:c.boolean().optional(),ts:ee.optional()}),mO=c.object({type:c.literal("permission_request"),sessionId:c.string(),requestId:c.string(),tool:c.string(),description:c.string(),preview:c.string(),ts:ee.optional()}),fO=c.object({type:c.literal("permission_verdict"),sessionId:c.string(),requestId:c.string(),behavior:Ww,ts:ee.optional()}),gO=c.object({type:c.literal("command"),id:c.string(),requestId:c.string(),sessionId:c.string().nullable(),args:c.unknown(),ts:ee.optional()}),hO=c.object({type:c.literal("command_result"),requestId:c.string(),id:c.string(),sessionId:c.string().nullable().optional(),result:c.unknown().optional(),error:c.string().optional(),ts:ee.optional()}),vO=c.object({type:c.literal("devices.update"),doc:Bw}),bO=c.object({type:c.literal("device_command"),requestId:c.string(),deviceId:c.string(),sourceId:c.string().nullable().optional(),ruleId:c.string().optional(),capability:Ct,instance:c.string().optional(),command:c.string(),params:c.unknown(),consumer:c.enum(["voice","claude","app","rules"]),sessionId:c.string().optional(),confirm:c.boolean().optional()}),yO=c.object({type:c.literal("device_query"),requestId:c.string(),kind:c.enum(["list","get"]),deviceId:c.string().optional()}),xO=c.object({type:c.literal("device_result"),requestId:c.string(),deviceId:c.string().optional(),ok:c.boolean(),verified:c.boolean().optional(),state:c.unknown().optional(),result:c.unknown().optional(),error:c.string().optional()}),kO=c.object({type:c.literal("device_event"),deviceId:c.string(),capability:Ct,instance:c.string().optional(),event:c.string(),payload:c.unknown().optional(),ts:ee}),wO=c.object({type:c.literal("device_source_event"),provider:At,providerAccountId:c.string(),nativeId:c.string(),patch:c.array(c.object({type:Ct,instance:c.string().optional(),state:c.unknown()})).optional(),edge:c.object({capability:Ct,instance:c.string().optional(),event:c.string(),payload:c.unknown().optional()}).optional(),online:c.boolean().optional(),ts:ee}),SO=c.object({type:c.literal("entitlement"),plan:c.enum(["free","paid"]),planStatus:c.enum(["active","past_due","canceled"]).optional(),serviceOk:c.boolean().optional(),capture:c.object({telemetry:c.boolean(),transcripts:c.boolean()}),policyVersion:c.string(),ts:ee}),_O=c.object({type:c.literal("device_config"),version:c.number().int().nonnegative(),config:c.record(c.string(),c.unknown()),ts:ee}),$O=c.object({type:c.literal("disconnect"),code:c.union([c.literal(1012),c.literal(4402),c.literal(4426),c.number().int().min(1e3).max(4999)]),reason:c.string().max(120),ts:ee}),IO=c.object({type:c.literal("device_audit"),requestId:c.string(),consumer:c.enum(["voice","claude","app","rules"]),deviceId:c.string(),ruleId:c.string().optional(),capability:Ct,command:c.string(),params:c.unknown(),ok:c.boolean(),confirmRequired:c.boolean(),confirmedBy:c.string().optional(),error:c.string().optional(),ts:ee}),EO=64,AO=c.object({type:c.literal("session_state"),sessionId:c.string(),state:zo,event:c.string(),ts:ee,transitions:c.array(c.object({state:zo,event:c.string(),ts:ee})).max(EO).optional()}),CO=c.object({type:c.literal("notification"),sessionId:c.string(),event:zo,repo:c.string().optional(),title:c.string().optional(),body:c.string().optional()}),PO=c.discriminatedUnion("type",[lO,uO,dO,pO,mO,fO,gO,hO,vO,bO,yO,xO,kO,wO,IO,SO,$O,_O,AO,CO]),Vw=e=>PO.parse(typeof e=="string"?JSON.parse(e):e);var TO=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Wt=(e,t)=>e>>>t|e<<32-t;function RO(e){let t=[];for(let r of e){let o=r.codePointAt(0);o<128?t.push(o):o<2048?t.push(192|o>>6,128|o&63):o<65536?t.push(224|o>>12,128|o>>6&63,128|o&63):t.push(240|o>>18,128|o>>12&63,128|o>>6&63,128|o&63)}return Uint8Array.from(t)}function OO(e){let t=RO(e),r=new Uint8Array((t.length+8>>6)+1<<6);r.set(t),r[t.length]=128;let o=new DataView(r.buffer),n=t.length*8;o.setUint32(r.length-8,Math.floor(n/4294967296)),o.setUint32(r.length-4,n>>>0);let i=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),s=new Uint32Array(64);for(let u=0;u<r.length;u+=64){for(let S=0;S<16;S++)s[S]=o.getUint32(u+S*4);for(let S=16;S<64;S++){let I=s[S-15],_=s[S-2],C=Wt(I,7)^Wt(I,18)^I>>>3,z=Wt(_,17)^Wt(_,19)^_>>>10;s[S]=s[S-16]+C+s[S-7]+z>>>0}let p=i[0],d=i[1],m=i[2],f=i[3],g=i[4],h=i[5],v=i[6],k=i[7];for(let S=0;S<64;S++){let I=Wt(g,6)^Wt(g,11)^Wt(g,25),_=g&h^~g&v,C=k+I+_+TO[S]+s[S],z=Wt(p,2)^Wt(p,13)^Wt(p,22),F=p&d^p&m^d&m,K=z+F;k=v,v=h,h=g,g=f+C>>>0,f=m,m=d,d=p,p=C+K>>>0}i[0]=i[0]+p>>>0,i[1]=i[1]+d>>>0,i[2]=i[2]+m>>>0,i[3]=i[3]+f>>>0,i[4]=i[4]+g>>>0,i[5]=i[5]+h>>>0,i[6]=i[6]+v>>>0,i[7]=i[7]+k>>>0}let a=new Uint8Array(32),l=new DataView(a.buffer);for(let u=0;u<8;u++)l.setUint32(u*4,i[u]);return a}var Jw="abcdefghijklmnopqrstuvwxyz234567";function DO(e){let t=0,r=0,o="";for(let n of e)for(r=r<<8|n,t+=8;t>=5;)o+=Jw[r>>>t-5&31],t-=5;return t>0&&(o+=Jw[r<<5-t&31]),o}function Kw(e){return DO(OO(e))}var NO=c.enum(["mdns","ssdp","kasa-udp","wiz-udp","lifx-lan","yeelight","govee-udp","tuya-beacon","arp","http","meethue"]),LO=c.object({protocol:NO,detail:c.string(),at:ee}),UO=c.enum(["connect-now","link-ecosystem","identified-only"]),cl=c.enum(["kasa","kasa-klap","wiz","lifx","shelly","govee","tapo","tuya","yeelight","nanoleaf","meross","ewelink","wled","elgato","roku","esphome"]),jO=c.enum(["high","medium","low"]),zO=c.object({ip:c.string(),mac:c.string().optional(),hostname:c.string().optional(),port:c.number().int().positive().optional()}),Xw=c.object({discoveredId:c.string(),addresses:zO,evidence:c.array(LO).min(1),identity:c.object({name:c.string().optional(),manufacturer:c.string().optional(),model:c.string().optional(),hint:c.string().optional(),vendorId:c.string().optional()}).default({}),bucket:UO,kind:c.string().optional(),suggestedProvider:At.optional(),localProtocol:cl.optional(),expectedType:as.optional(),expectedCapabilities:c.array(Ct).default([]),alreadyLinked:c.object({provider:At,deviceId:c.string().optional(),accountId:c.string().optional()}).nullable().optional(),confidence:jO,firstSeen:ee,lastSeen:ee});function Pt(e){return e.trim().toLowerCase().replace(/[^0-9a-f]/g,"").replace(/(..)(?=.)/g,"$1:")}var Yw=c.object({key:c.string(),provider:At,accountId:c.string().optional(),name:c.string(),mac:c.string().optional(),nativeType:c.string().optional(),expectedType:as.optional(),state:c.enum(["cloud","not-seen"]),deviceId:c.string().optional()}),Qw=c.object({wsl:c.boolean(),multicastOk:c.boolean().nullable(),broadcastOk:c.boolean().nullable(),interop:c.enum(["windows-arp"]).optional(),interfaces:c.array(c.string()).optional(),primaryInterface:c.string().optional()});function e0(e){return e!==void 0&&(e.wsl||e.multicastOk===!1)}function t0(e,t){return t>0||e===void 0||e.wsl?!1:e.multicastOk===!0}var n0="Your computer's network stack is fine, so if you expected devices here the likely cause is the network itself: guest WiFi, VLANs, or an access point with client isolation all block the discovery messages between devices. Try the same scan on your main WiFi, or add a device by IP.",FO=c.enum(["running","done","failed"]),m3=c.object({id:c.string(),status:FO,startedAt:ee,finishedAt:ee.optional(),error:c.string().optional(),devices:c.array(Xw),accountDevices:c.array(Yw).optional(),env:Qw,probeStatus:c.record(c.string(),c.string()).optional()}),MO=c.enum(["mdns","ssdp","kasa","wiz","lifx","yeelight","govee","tuya","arp","sweep"]),f3=c.object({autoConnect:c.enum(["unset","off","open-protocols"]).default("unset"),passive:c.boolean().default(!0),protocols:c.partialRecord(MO,c.boolean()).default({}),unidentified:c.boolean().default(!0)}),g3=c.object({scanId:c.string()}),h3=c.object({devices:c.array(Xw),accountDevices:c.array(Yw).optional(),env:Qw,updatedAt:ee}),v3=c.object({discoveredId:c.string().optional(),ip:c.string().optional(),protocol:cl,name:c.string().optional(),credentials:c.record(c.string(),c.string()).optional()}).refine(e=>e.discoveredId!==void 0||e.ip!==void 0,{message:"either discoveredId or ip is required"}),oh={tapo:[{key:"username",label:"TP-Link email",secret:!1,helpText:"the TP-Link ID the device was set up with"},{key:"password",label:"Password",secret:!0}],"kasa-klap":[{key:"username",label:"TP-Link email",secret:!1,helpText:"the TP-Link/Kasa ID the device was set up with (leave blank if never linked to the cloud)"},{key:"password",label:"Password",secret:!0}],shelly:[{key:"password",label:"Device password",secret:!0,helpText:'the password set on this Shelly (its username is always "admin")'}],esphome:[{key:"encryptionKey",label:"Encryption key",secret:!0,helpText:"the `api: encryption: key` from this device's ESPHome config (base64) \u2014 leave blank if it has no encryption"}]},BO=new Set(["shelly","esphome"]);function HO(e){return BO.has(e)}var b3=c.object({ok:c.boolean(),deviceId:c.string().optional(),accountId:c.string().optional(),error:c.string().optional(),note:c.string().optional(),linkVia:At.optional()}),y3=c.object({deviceId:c.string(),purge:c.boolean().default(!1),discoveredId:c.string().optional()}),x3=c.object({deviceId:c.string(),name:c.string()}),k3=c.object({clientId:c.string().min(1),clientSecret:c.string().min(1),region:c.string().min(1)}),w3=c.object({ok:c.boolean(),deviceCount:c.number().int().nonnegative().optional(),sleepyCount:c.number().int().nonnegative().optional(),error:c.string().optional()}),S3=c.object({email:c.string().min(1),password:c.string().min(1),region:c.string().min(1),mfaCode:c.string().optional()}),_3=c.object({ok:c.boolean(),deviceCount:c.number().int().nonnegative().optional(),error:c.string().optional()}),$3=c.object({email:c.string().min(1),password:c.string().min(1),region:c.string().min(1)}),I3=c.object({ok:c.boolean(),deviceCount:c.number().int().nonnegative().optional(),error:c.string().optional()}),E3=c.object({apiKey:c.string().min(1)}),A3=c.object({ok:c.boolean(),deviceCount:c.number().int().nonnegative().optional(),error:c.string().optional()}),C3=c.object({ok:c.boolean(),note:c.string().optional(),error:c.string().optional()}),P3=c.object({sessionId:c.string().optional(),revertOnStop:c.boolean().default(!0)}),T3=c.object({sessionId:c.string().optional()}),r0=c.object({pct:c.number().min(0).max(100),usedTokens:c.number().int().nonnegative().optional(),windowTokens:c.number().int().positive().optional()}),qw=c.object({usedPct:c.number().min(0).max(100),resetsAt:ee.optional()}),R3=c.object({sessionId:c.string().optional(),claudeSessionId:c.string().optional(),state:zo,event:c.string(),ts:ee.optional(),cwd:c.string().optional(),extra:c.record(c.string(),c.unknown()).optional(),context:r0.optional(),mode:c.string().optional(),model:c.string().optional(),agent:vn.optional()}),O3=c.object({sessionId:c.string().optional(),claudeSessionId:c.string().optional(),cwd:c.string().optional(),ts:ee.optional(),context:r0.optional(),rateLimits:c.object({fiveHour:qw.optional(),sevenDay:qw.optional()}).optional(),mode:c.string().optional(),model:c.string().optional(),modelName:c.string().optional(),review:c.string().optional(),cost:c.number().nonnegative().optional(),agent:vn.optional()}),D3=c.object({sessionId:c.string().optional(),claudeSessionId:c.string().optional(),codexThreadId:c.string().min(1),cwd:c.string().optional(),gitBranch:c.string().optional(),ts:ee.optional(),inputTokens:c.number().int().nonnegative(),cachedInputTokens:c.number().int().nonnegative().default(0),outputTokens:c.number().int().nonnegative(),agent:vn.optional()}),ZO=c.object({reverted:c.number().int().nonnegative(),failed:c.number().int().nonnegative(),skipped:c.number().int().nonnegative()}),N3=c.object({active:c.boolean(),sessionId:c.string().optional(),generation:c.number().int().nonnegative().optional(),touched:c.number().int().nonnegative().default(0),revertOnStop:c.boolean().default(!0),owner:c.enum(["app","hook"]).optional(),summary:ZO.optional()});function Fo(e){return e.kind==="gateway"?"infrastructure":e.bucket==="connect-now"?"ready":e.bucket==="link-ecosystem"?"ecosystems":e.kind==="unidentified"||e.kind==="mdns-service"?"unidentified":e.bucket==="identified-only"?"needs-setup":"unidentified"}var ll=["govee","wiz","yeelight","kasa","esphome"],GO=new Set(["lock","cover","garageDoor","valve","camera","doorbell"]),WO=new Set(["lock","cover","camera","doorbell"]),VO=new Set(["tuya","meross","ewelink","nanoleaf","esphome"]);function o0(e,t=oh){return e.bucket==="connect-now"&&e.localProtocol!==void 0&&((t[e.localProtocol]?.length??0)===0||HO(e.localProtocol))&&!VO.has(e.localProtocol)&&e.confidence==="high"&&e.addresses.mac!==void 0&&!e.alreadyLinked&&!(e.expectedType!==void 0&&GO.has(e.expectedType))&&!e.expectedCapabilities.some(r=>WO.has(r))}function i0(e){let t=e.trim(),r,o=/^(mqtts?|tcp|ssl|tls|wss?):\/\//i.exec(t);if(o){let a=o[1].toLowerCase();(a==="mqtts"||a==="ssl"||a==="tls"||a==="wss")&&(r=!0),t=t.slice(o[0].length)}t=t.replace(/\/.*$/,"");let n=/^(.+):(\d{1,5})$/.exec(t),i=(n?n[1]:t).trim(),s=n?Number(n[2]):void 0;return{host:i,...s!==void 0&&s>=1&&s<=65535?{port:s}:{},...r!==void 0?{tls:r}:{}}}import{spawn as KO}from"node:child_process";import{chmodSync as XO,existsSync as sh,openSync as YO,readFileSync as QO,realpathSync as eD,writeFileSync as d0}from"node:fs";import{request as tD}from"node:http";import nD from"node:net";import rD from"node:path";function us(){return!0}function s0(){return"1.2.0"}var a0=3e3,JO=15e3;function qO(e){if(!e)return null;try{let t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return null;let{pid:r,startedAt:o,lastBeat:n}=t;return!Number.isInteger(r)||r<=0||typeof o!="number"||typeof n!="number"?null:{pid:r,startedAt:o,lastBeat:n}}catch{return null}}function c0(e){let t=e?.read??N;return qO(t(e?.file??ma))}function ih(e,t){let r=t?.write??((n,i)=>we(n,i,384)),o=t?.now??Date.now;try{r(t?.file??ma,JSON.stringify({pid:t?.pid??process.pid,startedAt:e,lastBeat:o()}))}catch{}}function l0(e){try{(e?.remove??ve)(e?.file??ma)}catch{}}function u0(e){let{beacon:t,pid:r}=e;return!Number.isInteger(r)||r<=0||!t||t.pid!==r||!(e.isAlive??ga)(r)?!1:(e.now??Date.now())-t.lastBeat<=(e.staleAfterMs??JO)}function oD(e){return new Promise(t=>{let r=nD.connect({host:"127.0.0.1",port:e},()=>{r.destroy(),t(!0)});r.on("error",()=>t(!1)),r.setTimeout(500,()=>{r.destroy(),t(!1)})})}function dl(e={}){let t=qr(e);return{dir:t.dir,source:t.source,port:t.beacon?.port??de().hubPort,tokenFile:Vu(t.dir),advertised:t.beacon!==null}}async function Le(){return oD(dl().port)}function iD(e=process.env,t=r=>Ut(r)){if(e.BRIDGE_CLIENT_VERSION!==void 0)return{};let r=t(e);return r===null?{}:{BRIDGE_CLIENT_VERSION:r}}function sD(e=process.env,t={}){let r=t.bundled??us(),o={...e};return r&&delete o.BRIDGE_VOICE,o}async function ct(e={kind:"run"}){if(await Le())return se("hub already running \u2014 reusing it"),{spawned:!1,holderId:await p0(e.kind)??await pl(e.kind)};let t=de(),r=sh(Ei)?{file:process.env.APPIMAGE||process.execPath,args:[Ei]}:{file:sh(va)?va:"tsx",args:[Cy]};d0(St,"",{mode:384}),XO(St,384);let o=YO(St,"a"),n=KO(r.file,r.args,{cwd:un,detached:!0,stdio:["ignore",o,o],env:{...sD(),BRIDGE_RELAY_URL:t.relayUrl,BRIDGE_HUB_PORT:String(t.hubPort),BRIDGE_HUB_HOLDER:e.kind,BRIDGE_HUB_HOLDER_PID:String(process.pid),...iD()}});n.unref(),n.pid&&d0(hi,String(n.pid));for(let i=0;i<30;i++){let s=ml(St);if(/relay connected/i.test(s))return $("hub connected to relay"),{spawned:!0,holderId:await p0(e.kind)??await pl(e.kind)};if(/relay ws error|FATAL/i.test(s))throw new Error(`hub failed to connect:
|
|
247
|
+
${me(f0(s,6))}`);await aD(1e3)}throw new Error(`hub timed out connecting to the relay. Last log:
|
|
248
|
+
${me(f0(ml(St),8))}`)}function g0(){sb()}function h0(e,t){let r=t?.argv1??process.argv[1]??"",o=t?.exists??sh,n=t?.tsxBin??va,i=(t?.env??process.env).APPIMAGE||process.execPath;if(t?.bundled??us()){let l=r;try{l=(t?.realpath??eD)(r)}catch{}return{file:i,args:[l,"daemon",...e]}}if(/\.(mjs|cjs|js)$/.test(r))return{file:i,args:[r,"daemon",...e]};let a=r||rD.join(un,"cli","src","index.ts");return{file:o(n)?n:"tsx",args:[a,"daemon",...e]}}async function pl(e){return(await W("/local/hub/hold",{method:"POST",body:{kind:e,pid:process.pid}})).body?.holderId??null}function p0(e){let t=dl(),r=ml(t.tokenFile).trim();if(!r)return Promise.resolve(null);let o=JSON.stringify({kind:e,pid:process.pid,stream:!0});return new Promise(n=>{let i=!1,s=a=>{i||(i=!0,n(a))};try{let a=tD({host:"127.0.0.1",port:t.port,path:"/local/hub/hold",method:"POST",headers:{"x-bridge-hub-token":r,"content-type":"application/json","content-length":Buffer.byteLength(o)}},l=>{if(l.statusCode!==200)return l.resume(),s(null);l.socket?.unref(),l.once("data",u=>{try{s(JSON.parse(u.toString("utf8").split(`
|
|
249
|
+
`)[0]??"").holderId??null)}catch{s(null)}}),l.once("close",()=>s(null))});a.on("error",()=>s(null)),a.setTimeout(5e3,()=>s(null)),a.end(o)}catch{s(null)}})}async function v0(e){let t=await W("/local/hub/beat",{method:"POST",body:{holderId:e},timeoutMs:4e3});return t.hubOffline?"offline":t.status===200?"ok":"unknown"}async function fl(e){await W("/local/hub/release",{method:"POST",body:{holderId:e},timeoutMs:4e3})}async function b0(){let e=await W("/local/hub/shutdown",{method:"POST",body:{},timeoutMs:8e3});return!e.hubOffline&&e.status===200}async function y0(){await W("/local/reload",{method:"POST",body:{},timeoutMs:8e3})}function Mo(e){return u0({beacon:(e.readBeacon??c0)(),pid:e.pid,...e.now!==void 0?{now:e.now}:{},...e.isAlive?{isAlive:e.isAlive}:{}})}var ul=null;function Te(){let e=ul;if(!e||e.reason==="offline")return"hub offline \u2014 run `acbridge start`";let r=e.target.source==="peer-wsl"||e.target.source==="peer-windows"?` (it runs ${e.target.source==="peer-wsl"?"on Windows":"inside WSL"}, state in ${e.target.dir})`:"";return e.reason==="absent"?`a hub is running on port ${e.target.port}${r}, but this account has no hub-token to present. Sign in with \`acbridge login\`, or restart the bridge from the side that owns it.`:`the hub on port ${e.target.port}${r} REJECTED this credential (401) \u2014 it belongs to another account or another run. Restart the bridge (\`acbridge stop\` then \`acbridge start\`) to re-mint it.`}function ah(e){return Vu(Y,e)}async function m0(e,t,r){let o=ml(e.tokenFile).trim();if(!o)return ul={reason:e.advertised?"absent":"offline",target:e},e.advertised?{hubOffline:!0,hubUnauthorized:"absent"}:{hubOffline:!0};let n=r?.body!==void 0;try{let i=await fetch(`http://127.0.0.1:${e.port}${t}`,{method:r?.method??"GET",headers:{"x-bridge-hub-token":o,...n?{"content-type":"application/json"}:{}},...n?{body:JSON.stringify(r?.body)}:{},signal:AbortSignal.timeout(r?.timeoutMs??1e4)}),s;try{s=await i.json()}catch{s=void 0}return i.status===401&&(ul={reason:"rejected",target:e}),{status:i.status,body:s,...i.status===401?{hubUnauthorized:"rejected"}:{}}}catch{return ul={reason:"offline",target:e},{hubOffline:!0}}}async function W(e,t){let r=dl(),o=await m0(r,e,t);if(!o.hubOffline&&!o.hubUnauthorized)return o;let n=dl({fresh:!0});return n.port===r.port&&n.tokenFile===r.tokenFile?o:m0(n,e,t)}function ml(e){try{return QO(e,"utf8")}catch{return""}}function f0(e,t){return e.trimEnd().split(`
|
|
241
250
|
`).slice(-t).join(`
|
|
242
|
-
`)}function
|
|
243
|
-
acbridge connect <ip> --as ${
|
|
251
|
+
`)}function aD(e){return new Promise(t=>setTimeout(t,e))}var Kn=`Usage: acbridge connect <mac|ip|discoveredId> [--name <display-name>] [--credentials-file <json>]
|
|
252
|
+
acbridge connect <ip> --as ${ll.join("|")} [--name <display-name>]
|
|
244
253
|
acbridge connect --forget <deviceId|mac|ip|discoveredId> [--purge]
|
|
245
254
|
acbridge connect --auto on|off
|
|
246
255
|
|
|
@@ -249,60 +258,60 @@ Targets come from \`acbridge scan\` (the ldev_\u2026 id, or the device's MAC/IP)
|
|
|
249
258
|
LAN-Control toggle flipped after the scan, or multicast is filtered) \u2014 it persists ONLY after the
|
|
250
259
|
protocol's live probe replies at that IP; a dead IP or wrong protocol simply gets no reply.
|
|
251
260
|
A protocol that needs an account credential (e.g. Tapo) prompts on a TTY, or reads
|
|
252
|
-
--credentials-file <json> / $ACBRIDGE_CREDENTIALS_FILE (a {"field":"value"} object) when headless.`;function
|
|
261
|
+
--credentials-file <json> / $ACBRIDGE_CREDENTIALS_FILE (a {"field":"value"} object) when headless.`;function uD(e){let t={purge:!1},r=(o,n,i,s)=>o===`--${n}`?(t[n]=s[++i],i):o.startsWith(`--${n}=`)?(t[n]=o.slice(`--${n}=`.length),i):null;for(let o=0;o<e.length;o++){let n=e[o];if(!n)continue;if(n==="--purge"){t.purge=!0;continue}if(n==="--credentials-file"){t.credentialsFile=e[++o];continue}if(n.startsWith("--credentials-file=")){t.credentialsFile=n.slice(19);continue}let i=!1;for(let s of["forget","auto","name","as"]){let a=r(n,s,o,e);if(a!==null){o=a,i=!0;break}}i||(n.startsWith("--")?t.bad=`unknown option: ${n}`:t.target?t.bad=`unexpected argument: ${n}`:t.target=n)}return t}var w0=e=>/^([0-9a-f]{2}:){5}[0-9a-f]{2}$/.test(Pt(e)),ch=e=>/^(\d{1,3}\.){3}\d{1,3}$/.test(e),x0=e=>`dev_${Kw(`mac:${Pt(e)}`).slice(0,8)}`,k0=e=>e==="homeassistant"?"home-assistant":e;async function S0(e){let t=uD(e);if(t.bad)return x(t.bad),b(Kn),2;if(t.as!==void 0)return t.forget!==void 0||t.auto!==void 0?(x("--as can't combine with --forget or --auto"),b(Kn),2):t.target?dD(t.target,t.as,t.name):(x("connect --as <protocol> needs an IP address as the target"),b(Kn),2);let r=[t.target,t.forget,t.auto].filter(o=>o!==void 0).length;return r!==1?(r>1&&x("pick one of: a connect target, --forget, --auto"),b(Kn),2):t.auto!==void 0?bD(t.auto):t.forget!==void 0?vD(t.forget,t.purge):pD(t.target,t.name,t.credentialsFile)}async function dD(e,t,r){if(!ll.includes(t))return x(`--as takes one of: ${ll.join(", ")} (got ${t||"(none)"})`),2;if(!ch(e))return x(`connect --as needs an IP address as the target, got: ${e}`),b(Kn),2;b(me(`probing ${e} as ${t}\u2026`));let o={ip:e,protocol:t,...r?{name:r}:{}},n=await W("/local/connect",{method:"POST",body:o,timeoutMs:15e3});if(n.hubOffline)return x(Te()),1;let i=n.body;return n.status===200&&i?.ok?($(`connected \u2014 ${i.deviceId??e}${i.accountId?` (account ${i.accountId})`:""}`),i.note&&b(i.note),b("It now appears in `acbridge status`, the app dashboard, and to Claude."),0):(x(i?.error??`hub answered HTTP ${n.status}`),i?.note&&b(i.note),(n.status===502||n.status===422)&&b(`\u2192 no ${t} answered at ${e} \u2014 check the IP, that LAN Control is enabled, and that this machine shares the device's network/VLAN`),1)}async function pD(e,t,r){let o=await _0(e);if(typeof o=="number")return o;let n=o;if(n.bucket==="link-ecosystem"){let l=n.suggestedProvider;return x("this device is managed by an ecosystem"),b(`\u2192 link the ecosystem instead: ${l?`\`acbridge link ${k0(l)}\``:"see `acbridge link --help`"}`),1}if(n.bucket==="identified-only")return x("no direct local adapter for this device"),b(n.identity.hint?`\u2192 ${n.identity.hint}`:"\u2192 control it via a linked Home Assistant (`acbridge link home-assistant`), or wait for a future adapter"),1;if(!n.localProtocol)return x(`no local protocol resolved for ${n.discoveredId} \u2014 rescan and try again`),1;b(me(`connecting ${lh(n)} via ${n.localProtocol}\u2026`));let i={discoveredId:n.discoveredId,protocol:n.localProtocol,...t?{name:t}:{}},s=await W("/local/connect",{method:"POST",body:i,timeoutMs:15e3});if(s.hubOffline)return x(Te()),1;let a=s.body;return s.status===200&&a?.ok?($(`connected \u2014 ${a.deviceId??n.discoveredId}${a.accountId?` (account ${a.accountId})`:""}`),a.note&&b(a.note),b("It now appears in `acbridge status`, the app dashboard, and to Claude."),0):s.status===428&&a?.error==="pairing-required"?(x(a.note??"put the device in pairing mode (hold its button until it flashes), then connect again"),b(`\u2192 hold the button, then rerun: \`acbridge connect ${n.discoveredId}\``),1):s.status===428?mD(n,n.localProtocol,t,a?.note??null,r):(x(a?.error??`hub answered HTTP ${s.status}`),a?.note&&b(a.note),s.status===404&&b("\u2192 run `acbridge scan`, then retry with a fresh id"),a?.linkVia&&b(`\u2192 \`acbridge link ${k0(a.linkVia)}\``),1)}async function mD(e,t,r,o,n){let i=oh[t]??[],s=n??process.env.ACBRIDGE_CREDENTIALS_FILE,a;if(s){if(a=fD(s),!a)return 1}else if(process.stdin.isTTY&&process.stdout.isTTY&&i.length>0)a=await gD(i,o);else{x(o??"this protocol needs an account credential \u2014 supply it and retry");let d=i.length>0?` with fields: ${i.map(m=>m.key).join(", ")}`:"";return b(`\u2192 pass --credentials-file <json> (or set ACBRIDGE_CREDENTIALS_FILE)${d}`),1}b(me(`connecting ${lh(e)} via ${t} with credentials\u2026`));let l={discoveredId:e.discoveredId,protocol:t,...r?{name:r}:{},credentials:a},u=await W("/local/connect",{method:"POST",body:l,timeoutMs:15e3});if(u.hubOffline)return x(Te()),1;let p=u.body;return u.status===200&&p?.ok?($(`connected \u2014 ${p.deviceId??e.discoveredId}${p.accountId?` (account ${p.accountId})`:""}`),p.note&&b(p.note),b("It now appears in `acbridge status`, the app dashboard, and to Claude."),0):(x(p?.error??`hub answered HTTP ${u.status}`),p?.note&&b(p.note),1)}function fD(e){let t;try{t=cD(e,"utf8")}catch{x(`cannot read credentials file: ${e}`);return}let r;try{r=JSON.parse(t)}catch{x(`credentials file is not valid JSON: ${e}`);return}if(!r||typeof r!="object"||Array.isArray(r)){x("credentials file must be a JSON object of field \u2192 value");return}let o={};for(let[n,i]of Object.entries(r))i!=null&&(o[n]=String(i));return o}async function gD(e,t){t&&b(t);let r={};for(let o of e)o.helpText&&b(me(o.helpText)),r[o.key]=await hD(`${o.label}: `,o.secret);return r}function hD(e,t){return new Promise(r=>{let o=lD({input:process.stdin,output:process.stdout,terminal:!0});if(t){let n=!1,i=o;i._writeToOutput=s=>{n?(s.includes(`
|
|
253
262
|
`)||s.includes("\r"))&&process.stdout.write(`
|
|
254
|
-
`):(process.stdout.write(e),n=!0)}}o.question(e,n=>{o.close(),r(n.trim())})})}async function
|
|
255
|
-
`)}catch{}}function
|
|
256
|
-
`),
|
|
257
|
-
`);function Kn(e,t){let r=e.find(s=>s.id===t);if(r)return{ok:!0,device:r};let o=t.toLowerCase(),n=e.filter(s=>s.name.toLowerCase()===o);if(n.length===1)return{ok:!0,device:n[0]};let i=n.length>1?n:e.filter(s=>s.name.toLowerCase().includes(o));return i.length===1?{ok:!0,device:i[0]}:i.length>1?{ok:!1,kind:"ambiguous",candidates:i.map(s=>({id:s.id,name:s.name}))}:{ok:!1,kind:"not-found",candidates:[]}}function Xg(e){let t={};for(let r of e){let o=r.indexOf("=");if(o<=0)return{ok:!1,message:`--param needs k=v, got: ${r}`};let n=r.slice(0,o),i=r.slice(o+1);if(i==="true"||i==="false")t[n]=i==="true";else if(i!==""&&Number.isFinite(Number(i)))t[n]=Number(i);else if(i.startsWith("[")||i.startsWith("{"))try{t[n]=JSON.parse(i)}catch{return{ok:!1,message:`--param ${n} isn't valid JSON`}}else t[n]=i}return{ok:!0,params:t}}function vl(e,t,r){let o=t.indexOf("."),n=o>0?t.slice(0,o):null,i=o>0?t.slice(o+1):t,s=[];for(let d of e.capabilities)if(!(n&&d.type!==n))for(let p of is[d.type]??[])p.command===i&&(p.gate&&!p.gate(d)||s.push({cap:d,entry:p}));if(s.length===0)return n&&!e.capabilities.some(d=>d.type===n)?{ok:!1,message:`${e.name} doesn't have the "${n}" capability`}:{ok:!1,message:`no command "${i}" on ${e.name}${n?` (${n})`:""}`};if(s.length>1)return{ok:!1,message:`"${i}" is ambiguous on ${e.name} \u2014 qualify it: ${s.map(d=>`${d.cap.type}.${i}`).join(" | ")}`};let{cap:a,entry:l}=s[0],u=l.params.safeParse(r);if(!u.success){let d=u.error.issues[0];return{ok:!1,message:`bad params for ${a.type}.${i}: ${d?`${d.path.join(".")} ${d.message}`:"invalid"}`}}return{ok:!0,capability:a.type,command:i,params:u.data}}function lD(e,t){return{deviceId:e,capability:t.capability,command:t.command,params:t.params,consumer:"app"}}function uD(e,t){let r=new Map(e.areas.map(n=>[n.id,n.name])),o=[];if(t?.note&&o.push(`(${t.note})`),e.devices.length===0)return o.push("no devices connected \u2014 run `acbridge scan` to find some, or link an account: `acbridge link <provider>`"),o;for(let n of[...e.devices].sort((i,s)=>i.name.localeCompare(s.name))){let i=n.areaId&&r.get(n.areaId)||"\u2014";o.push(`${n.name.padEnd(26)} ${n.type.padEnd(12)} ${i.padEnd(14)} ${n.reachability.padEnd(9)} ${n.id}`)}return o}async function Ir(){let e=await q("/local/devices",{method:"GET",timeoutMs:5e3});if(!e.hubOffline&&e.status===200&&e.body)return{doc:e.body};let t=Ft();if(t.state==="mismatch")return{refusal:{message:t.message,exitCode:3}};if(t.state!=="ok")return null;let r=await mb(t.token);return r?{doc:r,note:"relay cache \u2014 bridge not running; state may be stale"}:null}async function x0(e=[]){let t=e.includes("--json");t&&be(!0);let r=e.filter(d=>!d.startsWith("--")),o=r[0]??"list";if(o==="list"){let d=await Ir();if(d&&"refusal"in d)return E(d.refusal.message,d.refusal.exitCode);if(!d)return E("no device graph available \u2014 start the bridge (`acbridge start`) or sign in",1);if(t)K(d.doc);else for(let p of uD(d.doc,d.note?{note:d.note}:void 0))v(p);return 0}if(o==="set-main")return mD(e,t);if(o!=="on"&&o!=="off"&&o!=="set")return v(hl),E(`unknown devices subcommand: ${o}`,2);let n=r[1];if(!n)return v(hl),E("which device? give an id (dev_\u2026) or a name",2);let i=await Ir();if(i&&"refusal"in i)return E(i.refusal.message,i.refusal.exitCode);if(!i)return E("no device graph available \u2014 start the bridge (`acbridge start`) or sign in",1);let s=Kn(i.doc.devices,n);if(!s.ok){if(s.kind==="ambiguous"){for(let d of s.candidates)v(` ${d.name} (${d.id})`);return E(`"${n}" matches several devices \u2014 name one of the ids above`,2)}return E(`no device matches "${n}" \u2014 try \`acbridge devices\``,2)}let a;if(o==="on"||o==="off")a=vl(s.device,o==="on"?"power.turnOn":"power.turnOff",{});else{let d=r[2];if(!d)return v(hl),E("set needs a command \u2014 e.g. `acbridge devices set lamp brightness.setBrightness --param level=40`",2);let p=[];for(let f=0;f<e.length;f++)e[f]==="--param"&&e[f+1]&&p.push(e[++f]);let m=Xg(p);if(!m.ok)return E(m.message,2);a=vl(s.device,d,m.params)}if(!a.ok)return E(a.message,2);let l=_t({notSignedIn:{message:"Not signed in. Run `acbridge login` first.",exitCode:3}});if(!l.ok)return E(l.message,l.exitCode);let u=await fb(l.token,lD(s.device.id,a));return u.ok?($(`${s.device.name}: ${a.capability}.${a.command}${u.verified===!0?" (verified)":""}`),u.note&&v(me(u.note)),t&&K({ok:!0,deviceId:s.device.id,capability:a.capability,command:a.command}),0):u.status===503?E("bridge not running \u2014 run `acbridge start` (device control routes through your PC)",1):(x(u.error??`command failed (${u.status||"network"})`),t&&K({ok:!1,error:u.error??null,status:u.status,exit:1}),1)}function dD(e){let t={},r=!1,o=e.indexOf("--color");if(o!==-1){let s=e[o+1];if(s==="none")t.hs=null;else{let a=(s??"").split(",").map(l=>Number(l.trim()));if(a.length!==2||!a.every(Number.isFinite)||a[0]<0||a[0]>360||a[1]<0||a[1]>100)return{patch:t,touched:r,bad:`--color takes <hue 0-360>,<sat 0-100> or none, got: ${s??"(none)"}`};t.hs={hue:a[0],saturation:a[1]}}r=!0}let n=e.indexOf("--brightness");if(n!==-1){let s=e[n+1];if(s==="none")t.brightness=null;else{let a=Number(s);if(!Number.isFinite(a)||a<0||a>100)return{patch:t,touched:r,bad:`--brightness takes 0-100 or none, got: ${s??"(none)"}`};t.brightness=a}r=!0}let i=e.indexOf("--kelvin");if(i!==-1){let s=e[i+1];if(s==="none")t.kelvin=null;else{let a=Number(s);if(!Number.isInteger(a)||a<1e3||a>12e3)return{patch:t,touched:r,bad:`--kelvin takes a whole colour temperature 1000-12000 (or none), got: ${s??"(none)"}`};t.kelvin=a}r=!0}return{patch:t,touched:r}}function pD(e,t,r){let o=$r.safeParse(e.deviceSettings);if(e.deviceSettings!==void 0&&!o.success)return{error:"this machine's device settings are unreadable by this CLI version \u2014 update acbridge (nothing was written)"};let n=o.success?o.data:{},i=n[t]??Mo.parse({}),s=Mo.safeParse({...i,main:{...i.main??{},...r}});return s.success?{config:{...e,deviceSettings:{...n,[t]:s.data}}}:{error:`that main look doesn't validate: ${s.error.issues[0]?.message??"invalid"}`}}async function mD(e,t){let o=e.filter((m,f)=>!m.startsWith("--")&&!["--color","--brightness","--kelvin"].includes(e[f-1]??""))[1];if(!o)return v(hl),E("which device? give an id (dev_\u2026) or a name",2);let{patch:n,touched:i,bad:s}=dD(e);if(s)return E(s,2);if(!i)return E("nothing to change \u2014 give at least one of --color / --brightness / --kelvin",2);let a=await Ir();if(a&&"refusal"in a)return E(a.refusal.message,a.refusal.exitCode);if(!a)return E("no device graph available \u2014 start the bridge (`acbridge start`) or sign in",1);let l=Kn(a.doc.devices,o);if(!l.ok){if(l.kind==="ambiguous"){for(let m of l.candidates)v(` ${m.name} (${m.id})`);return E(`"${o}" matches several devices \u2014 name one of the ids above`,2)}return E(`no device matches "${o}" \u2014 try \`acbridge devices\``,2)}let u=_t({notSignedIn:{message:"Not signed in. Run `acbridge login` first.",exitCode:3}});if(!u.ok)return E(u.message,u.exitCode);let d=null,p=await Bo(u.token,m=>{let f=pD(m,l.device.id,n);if("error"in f)throw new Error(f.error);return f.config}).catch(m=>(d=m instanceof Error?m.message:String(m),{outcome:"error",error:d}));if(p.outcome!=="committed"){let m=p.outcome==="unavailable"?"couldn't read the device settings from the relay \u2014 check your connection":p.outcome==="conflict-exhausted"?"device settings changed elsewhere \u2014 try again":p.error??"couldn't save the main look";return E(m,1)}return $(`${l.device.name}: main look updated`),t&&K({ok:!0,deviceId:l.device.id,main:n}),0}import{spawnSync as Pl}from"node:child_process";import{existsSync as sL}from"node:fs";import SS from"node:path";import{createSocket as bD}from"node:dgram";import{readFile as xD}from"node:fs/promises";import{networkInterfaces as w0}from"node:os";import{execFile as gD}from"node:child_process";import{existsSync as hD}from"node:fs";import{join as vD}from"node:path";import{promisify as yD}from"node:util";var C8=new TextEncoder;var U8=yD(gD);function Yg(e={}){let t=e.env??process.env,r=e.exists??(o=>hD(o));for(let o of(t.PATH??"").split(":"))if(o!=="")try{if(r(vD(o,"powershell.exe")))return!0}catch{}return!1}var Qg="239.255.90.90",eh=35090,S0=35091;function _0(e){return!e.internal&&(e.family==="IPv4"||e.family===4)}var vt={createSocket:(e,t)=>bD({type:e,reuseAddr:t?.reuseAddr??!0}),interfaceAddresses:()=>Object.values(w0()).flatMap(e=>e??[]).filter(_0).map(e=>e.address)};async function yl(e={}){let t=e.timeoutMs??2e3,r=e.sockets??vt,o=await kD(e.readProcVersion??(()=>xD("/proc/version","utf8")),e.env??process.env),[n,i]=await Promise.all([wD(r,t).catch(()=>null),SD(r,t).catch(()=>null)]),s;try{s=(e.interfaces??_D)()}catch{s=void 0}let a={wsl:o,multicastOk:n,broadcastOk:i};s!==void 0&&(a.interfaces=s);try{let l=e.windowsInterop??(()=>Yg({env:e.env??process.env}));o&&l()&&(a.interop="windows-arp")}catch{}return a}async function kD(e,t){if(t.WSL_DISTRO_NAME||t.WSL_INTEROP)return!0;try{return/microsoft/i.test(await e())}catch{return!1}}function wD(e,t){return new Promise(r=>{let o=[],n=[],i=!1,s=a=>{if(!i){i=!0;for(let l of n)clearTimeout(l);for(let l of o)try{l.close()}catch{}r(a)}};try{let a=`acbridge-mc-${Math.random().toString(36).slice(2)}`,l=new TextEncoder().encode(a),u=e.createSocket("udp4",{reuseAddr:!0});o.push(u),u.on("error",()=>s(null)),u.on("message",d=>{new TextDecoder().decode(d)===a&&s(!0)}),u.bind(eh,()=>{try{u.addMembership(Qg)}catch{s(null);return}let d=e.createSocket("udp4",{reuseAddr:!0});o.push(d),d.on("error",()=>s(null)),d.bind(0,()=>{let p=()=>{try{d.setMulticastLoopback(!0),d.send(l,eh,Qg,m=>{m&&s(null)})}catch{s(null)}};p(),n.push(setTimeout(p,Math.max(1,Math.floor(t/2))))}),n.push(setTimeout(()=>s(!1),t))})}catch{s(null)}})}function SD(e,t){return new Promise(r=>{let o,n,i=!1,s=a=>{if(!i){i=!0,n&&clearTimeout(n);try{o?.close()}catch{}r(a)}};try{o=e.createSocket("udp4",{reuseAddr:!0});let a=o;a.on("error",()=>s(null)),a.bind(0,()=>{try{a.setBroadcast(!0),a.send(new TextEncoder().encode("acbridge-env-probe"),S0,"255.255.255.255",l=>{if(!l)return s(!0);let u=l.code;s(u==="EACCES"||u==="ENETUNREACH"||u==="EHOSTUNREACH"?!1:null)})}catch{s(null)}}),n=setTimeout(()=>s(null),t)}catch{s(null)}})}function _D(){return Object.entries(w0()).filter(([,e])=>e?.some(_0)).map(([e])=>e)}var bN=rn(sS(),1);var vG=new TextDecoder;import{createDecipheriv as xG,createHash as xN}from"node:crypto";var SG=xN("md5").update("yGAdlopoPVldABfn").digest(),_G=new TextDecoder;var CG=30*6e4;var wN=new Set(["00:33:7a","10:5a:17","10:d5:61","18:69:d8","18:de:50","1c:90:ff","20:f1:b2","2c:b4:71","30:48:7d","38:1f:8d","38:2c:e5","38:a5:c9","3c:0b:59","4c:a9:19","50:8a:06","50:8b:b9","68:57:2d","70:89:76","7c:f6:66","80:64:7c","84:e3:42","a0:92:08","a8:80:55","b8:06:0d","bc:35:1e","c0:f8:53","c4:82:e1","cc:8c:bf","d0:32:e7","d0:82:e8","d0:82:eb","d4:a6:51","d8:1f:12","d8:c8:0c","d8:d6:68","d8:fc:92","e4:ae:e4","f8:17:2d","fc:3c:d7","fc:67:1f"]),SN={"00:17:88":"Signify (Philips Hue)","c4:29:96":"Signify","fc:26:8c":"Signify","d0:73:d5":"LIFX","50:c7:bf":"TP-Link","1c:3b:f3":"TP-Link","d8:0d:17":"TP-Link","5c:e9:31":"TP-Link","3c:52:a1":"TP-Link","24:0a:c4":"Espressif","24:6f:28":"Espressif","30:ae:a4":"Espressif","5c:cf:7f":"Espressif","ec:fa:bc":"Espressif","a4:cf:12":"Espressif","48:3f:da":"Espressif","70:87:9e":"Beken","80:6d:de":"Beken","c8:47:8c":"Beken",...Object.fromEntries([...wN].map(e=>[e,"Tuya"])),"a8:bb:50":"WiZ","d8:a0:11":"WiZ","44:4f:8e":"WiZ","6c:29:90":"WiZ","94:9f:3e":"Sonos","5c:aa:fd":"Sonos","00:0e:58":"Sonos","fc:65:de":"Amazon","74:c2:46":"Amazon","44:65:0d":"Amazon","0c:47:c9":"Amazon","b8:5f:98":"Amazon","f4:f5:d8":"Google","54:60:09":"Google","1c:f2:9a":"Google","d8:eb:46":"Google","18:b4:30":"Nest Labs","64:16:66":"Nest Labs","d0:52:a8":"SmartThings","24:fd:5b":"SmartThings","28:6d:97":"SAMJIN (SmartThings)","50:14:79":"iRobot","24:9e:7d":"Roborock","b0:4a:39":"Roborock","78:0f:77":"Broadlink","34:ea:34":"Broadlink","2c:aa:8e":"Wyze","44:61:32":"Ecobee","94:10:3e":"Belkin (Wemo)","5c:e7:53":"Govee","d4:13:68":"Govee","e0:2a:25":"Govee","80:8a:f7":"Nanoleaf","f8:24:41":"Yeelight","54:ef:44":"Aqara (Lumi)","18:c2:3c":"Aqara (Lumi)","b0:e9:fe":"SwitchBot","00:1c:2b":"Hive (Centrica)","ec:e5:12":"tado\xB0"};var FG=new TextDecoder;var dS=Buffer.from("020000010000000000000000463cb5d3","hex"),ZG=new TextEncoder,GG=new TextDecoder;var o9=new TextDecoder;var fS="239.255.255.250",$h=1982,gS=["M-SEARCH * HTTP/1.1",`HOST: ${fS}:${$h}`,'MAN: "ssdp:discover"',"ST: wifi_bulb","",""].join(`\r
|
|
258
|
-
`);var l9=new TextDecoder;var w9=new TextDecoder;var
|
|
259
|
-
`),A9=new TextDecoder;var L9=new Uint8Array([0]);import{spawnSync as Ih}from"node:child_process";var Al=Xv("cli");function yS(e){try{let t=Ih(e,{shell:!0,encoding:"utf8",timeout:5e3});return`${t.stdout??""}${t.stderr??""}`}catch{return""}}function bS(e=process.platform){return ry({platform:e,programs:[process.execPath],ruleName:Al,runCheck:yS,runElevated:t=>{e!=="win32"&&Ih("sudo",["sh","-c",t],{stdio:"inherit"})}})}function xS(e=process.platform){return oy({platform:e,programs:[process.execPath],ruleName:Al,runCheck:yS,runElevated:t=>{e!=="win32"&&Ih("sudo",["sh","-c",t],{stdio:"inherit"})}})}function kS(e){let t=[],{home:r,credential:o}=e,n=r.source==="peer-wsl"||r.source==="peer-windows";if(r.source==="env")t.push({grade:"info",line:`hub state home: ${r.dir} (BRIDGE_SECRET_DIR override)`});else if(n){let s=r.source==="peer-wsl"?"on Windows":"inside WSL";t.push({grade:"ok",line:`hub state home: ${r.dir} \u2014 the hub runs ${s}, this environment reads its home across the boundary`})}else r.beacon?t.push({grade:"ok",line:`hub state home: ${r.dir} (hub live on port ${r.beacon.port})`}):t.push({grade:"info",line:`hub state home: ${r.dir} \u2014 no hub advertising itself here yet`});o==="rejected"?t.push({grade:"bad",line:"the hub REJECTED this machine's hub-token (401) \u2014 it is stale or belongs to another home. Profiles signals from every session here are being dropped. Restart the bridge (`acbridge stop` then `acbridge start`, or Stop \u2192 Start in the app) to re-mint it."}):o==="absent"&&r.beacon?t.push({grade:"warn",line:`a hub is running (port ${r.beacon.port}) but no readable hub-token was found in ${r.dir} \u2014 sessions here cannot authenticate to it`}):o==="ok"&&t.push({grade:"ok",line:"hub credential accepted (Profiles signals from this environment are authorized)"});let i=e.lastHookError;if(i&&e.nowMs-i.ts<=864e5&&o!=="ok"){let s=Math.max(0,Math.round((e.nowMs-i.ts)/6e4));t.push({grade:"warn",line:`a Profiles signal from this machine was refused ${s}m ago (HTTP ${i.status})${i.hint?` \u2014 ${i.hint}`:""}`})}return t}import{spawnSync as iL}from"node:child_process";function Ue(e={}){let t=e.env??process.env,r=e.clientVersion!==void 0?e.clientVersion:Lt(t),o=e.bundled??as();return js({isDevBuild:r===null&&!o,env:t})}function wS(){return Kv({voice:Ue(),runElevated:e=>{e.method==="sudo"&&iL(e.file,e.args,{stdio:"inherit"})}})}function aL(e,t){let r=`codex: ${e??"not found"} \xB7 ${t?"logged in":"not logged in"}`;return{grade:e!==null&&t?"ok":"warn",line:r}}async function cL(){let e=await yl();e.wsl?z("WSL detected \u2014 LAN scan degraded (mDNS/broadcast limited)"):$("host is not WSL \u2014 LAN discovery unrestricted"),e.multicastOk===!0?e.wsl?z("multicast self-test passed locally, but under WSL that only exercises the loopback stack \u2014 LAN mDNS delivery is still limited (rely on the Windows neighbor table below)"):$("multicast self-test passed (this computer's stack \u2014 it does not prove your NETWORK forwards multicast)"):e.multicastOk===!1?z("multicast self-test failed \u2014 mDNS discovery unavailable"):z("multicast self-test could not run (inconclusive)"),e.wsl&&(e.interop==="windows-arp"?$("WSL interop scanning available (powershell.exe \u2014 Windows neighbor table)"):z("WSL interop unavailable (powershell.exe not on PATH) \u2014 ARP discovery sees only the WSL subnet"));let t=await q("/local/discovered");t.hubOffline?z("hub control API unreachable \u2014 scan/connect unavailable (start it: `acbridge start`)"):t.status===200?$(`hub control API reachable (127.0.0.1:${de().hubPort})`):z(`hub control API answered HTTP ${t.status} \u2014 token mismatch? restart the hub`);try{let r=s=>{let a=Pl(s,{shell:!0,encoding:"utf8",timeout:4e3});return`${a.stdout??""}${a.stderr??""}`};if(ur(process.platform,{})==="wsl-host"){v(`firewall: ${wu}`);return}let o=Ws(process.platform,r),n=ur(process.platform,o),i=`${o.ufwStatusOut??""}${o.firewallCmdStateOut??""}${o.alfGlobalStateOut??""}`;if(n==="none")/permission denied|must be root|need to be root/i.test(i)?v("firewall state undetectable without sudo"):$("firewall: no active firewall detected \u2014 scanning unrestricted");else{let s=Vs(n,{programs:[process.execPath],ruleName:Al});if("state"in s?$("firewall: no active firewall detected \u2014 scanning unrestricted"):s.evalCheck(s.checkCommands.map(r))?$(`firewall: rule present (${n})`):z(`firewall rule missing \u2014 allow it with: ${s.manualCommand} (or use the app's Scan panel to cover the desktop app)`),n==="windows"){let a=ty(r("netsh advfirewall firewall show rule name=all dir=in verbose"),process.execPath),l=ny(ey(r("netsh advfirewall show currentprofile")),a);l&&z(l)}}vu(mi())==="keyring"?$("integration secrets: OS keyring (encrypted at rest, as this CLI resolves it)"):v("integration secrets: 0600 FILES, not the OS keyring (as this CLI resolves it) \u2014 no session keyring here, which is normal on WSL/headless Linux. The app or hub can resolve differently if it runs in a different session.")}catch{v("firewall state undetectable without sudo")}}async function lL(){let e=Wr({fresh:!0}),t=Q,r="unknown",o=e.beacon?.port??lb(),n=N(Iv(e.dir));if(!n)r="absent";else try{r=(await fetch(`http://127.0.0.1:${o}/local/devices`,{headers:{"x-bridge-hub-token":n},signal:AbortSignal.timeout(3e3)})).status===401?"rejected":"ok"}catch{r="unknown"}let i=null;try{let s=N(SS.join(t,"launch-last.json"));if(s)try{let l=JSON.parse(s);l.error?v(`last launch: REFUSED (${l.terminalId}, ${l.cwd}) \u2014 ${l.error}`):v(`last launch: ${l.terminalId} \u2192 ${l.file} ${JSON.stringify(l.args??[])}`)}catch{}let a=N(SS.join(t,"hooks-last-error.json"));if(a){let l=JSON.parse(a);typeof l.ts=="number"&&typeof l.status=="number"&&(i={ts:l.ts,status:l.status,...typeof l.hint=="string"?{hint:l.hint}:{}})}}catch{}return{home:e,localDir:t,credential:r,lastHookError:i,nowMs:Date.now()}}async function _S(e={}){let t=0,r=D=>{t++,x(D)},o=null,n=()=>o??=an(),i=(e.build??Jn)(),s=e.clientVersion?e.clientVersion():i.version,a=e.fetchManifest??ul,l=f0(s,s===null?null:await a(),process.platform,i.channel??"app");l.grade==="ok"?$(l.line):l.grade==="warn"?z(l.line):l.grade==="bad"?r(l.line):v(l.line);let u=e.voice??Ue({clientVersion:s}),d=(e.claudeVersion??(()=>uL(n())))(),p=zs(process.platform).manualCommand;if(d===null)r(`claude CLI not found on PATH \u2014 install it: ${p}`);else{let D=Iy(d);D.ok?$(`claude ${D.version}`):r(`claude ${D.version??"?"} \u2014 channels need \u2265 2.1.80 \u2014 reinstall: ${p}`)}let m=(e.codexVersion??dL)(),f=e.codexLoggedIn??Zs,g=aL(m,f());g.grade==="ok"?$(g.line):z(g.line);let h=(e.nodeRuntime??(()=>Xr(Yr(Q))))();h.kind==="shim"?$(`node runtime: bundled shim (${h.command})`):h.kind==="system"?$(`node v${h.version}`):r("node not found \u2014 install Node \u2265 20 or the AC Bridge app"),(e.pluginInstalled??(()=>pL(n())))()?$(u?"alexa@bridge plugin installed":"alexa@bridge plugin installed (agent state \u2192 device profiles)"):r("alexa@bridge plugin not installed \u2014 run `acbridge setup`");let k=lr(),_=(e.managedSettingsRaw??(()=>N(k)))(),I=Ay(_);u?I.allowed?$("channel allowlisted in managed settings"):I.present?r(`channel not allowlisted in ${k} \u2014 run \`acbridge setup\``):r(`managed settings missing at ${k} \u2014 run \`acbridge setup\``):$("managed settings not used (voice off \u2014 no channel allowlist needed)"),(e.hubBundlePresent??(()=>sL(_i)))()?$("hub bundle present"):z("hub bundle not built \u2014 run `npm run build` (dev uses tsx)");let T=(e.signedIn??Ft)(),j=T.state==="ok"?T.token:"";T.state==="ok"?$("signed in (relay token present)"):T.state==="mismatch"?r(ot.pointerMismatch):z("not signed in \u2014 run `acbridge login`");let F=(e.onboardingVerified??mL)();if(F!==null?$(`account setup verified (${new Date(F).toISOString().slice(0,10)})`):v("account setup not yet verified here \u2014 start/run check the relay on first use"),j){let Z=await(e.fetchEntitlement??zt)(j);Z?v(`plan ${Z.plan}; capture telemetry=${Z.capture.telemetry} transcripts=${Z.capture.transcripts}`):v("entitlement: couldn't read from the relay (offline?)");let Ee=(e.entitlementFileAgeH??fL)();Ee==="absent"?v("entitlement file absent \u2014 capture off until the hub next syncs"):Ee==="unreadable"?z("entitlement file unreadable \u2014 capture off, fail-closed"):Ee<=24?$(`entitlement file fresh (${Ee.toFixed(1)}h)`):z(`entitlement file STALE (${Ee.toFixed(1)}h) \u2014 capture off, fail-closed`)}await(e.hubRunning??Ne)()?$("hub running"):v(u?"hub not running (starts automatically on `acbridge run`)":"hub not running (start it: `acbridge start`)");for(let D of kS(await(e.homeFacts??lL)()))D.grade==="ok"?$(D.line):D.grade==="warn"?z(D.line):D.grade==="bad"?r(D.line):v(D.line);let fe=(e.claudeEnvironments??Cy)();for(let D of fe)D.claudePresent&&(D.pluginInstalled?$(`Claude Code wired for Profiles \u2014 ${D.label}`):z(`Claude Code is installed in ${D.label} WITHOUT the bridge plugin \u2014 sessions there drive no devices. Fix: ${D.setupHint}`));return await(e.discoveryPreflight??cL)(),v(""),t?x(`${t} problem(s) found`):$("all checks passed"),t?1:0}function uL(e){let t=e??an(),r=Pl(t.file,[...t.argsPrefix,"--version"],{encoding:"utf8"});return r.status===0?r.stdout??"":null}function dL(){let e=Vr(),t=Pl(e.file,[...e.argsPrefix,"--version"],{encoding:"utf8",timeout:5e3});return t.status===0?(t.stdout||t.stderr||"").trim()||"unknown":null}function pL(e){let t=e??an(),r=Pl(t.file,[...t.argsPrefix,"plugin","list"],{encoding:"utf8"});return Ey(`${r.stdout??""}${r.stderr??""}`).ok}function mL(){let e=Oe();return e?Ys({configFile:e.userConfigFile}).onboardedAt:null}function fL(){let e=Oe(),t=e?N(e.entitlementFile):null;if(!t)return"absent";try{let r=JSON.parse(t);return(Date.now()-(r.fetchedAt??0))/36e5}catch{return"unreadable"}}import*as $S from"node:https";import{createInterface as IS}from"node:readline/promises";function Vo(){let e=Wr({fresh:!0});if(e.source==="peer-wsl"||e.source==="peer-windows"){let o=e.source==="peer-wsl"?"on Windows":"inside WSL";return x(`the bridge is running ${o} (state in ${e.dir}), so an account linked here would be saved where that hub cannot read it. Run \`acbridge link\` from ${o}, or stop that bridge and start one on this side first.`),null}let t=Oe();if(t)return t;let r=Sr();return r.ok?(x(Ce()?"This machine's signed-in account doesn't match its stored account pointer \u2014 run `acbridge logout` then `acbridge login` to reset it.":"Couldn't resolve this machine's signed-in account \u2014 run `acbridge login` again."),null):(x(r.message),null)}var gL=e=>`${e} on the command line is world-readable via \`ps\` and saved in shell history \u2014 prefer \`${e}-file <path>\`, the interactive prompt, or its env var.`;function Or(e){if(e.file!==void 0){let t=(e.read??N)(e.file);if(t===null)return{ok:!1,message:`Couldn't read ${e.flag}-file ${e.file} \u2014 check the path and its permissions.`};let r=t.trim();return r?{ok:!0,value:r}:{ok:!1,message:`${e.flag}-file ${e.file} is empty \u2014 write the secret into it first.`}}return e.argv!==void 0?((e.warn??z)(gL(e.flag)),{ok:!0,value:e.argv.trim()}):{ok:!0,value:(e.env??"").trim()}}function hL(e){let t={},r=(o,n,i,s)=>o===`--${Eh(n)}`?(t[n]=s[++i],i):(o.startsWith(`--${Eh(n)}=`)&&(t[n]=o.slice(`--${Eh(n)}=`.length)),i);for(let o=0;o<e.length;o++){let n=e[o];if(n)for(let i of["tokenFile","keyFile","secretFile","passwordFile","url","token","units","host","bridgeId","key","clientId","secret","region","email","password","mfa","username","prefix"])o=r(n,i,o,e)}return t}var Eh=e=>e==="bridgeId"?"bridge-id":e==="clientId"?"client-id":e.endsWith("File")?`${e.slice(0,-4)}-file`:e,vL=e=>/^(https?|wss?):\/\/[^\s]+$/i.test(e),ES="Usage: acbridge link home-assistant --url http://homeassistant.local:8123 --token <long-lived-access-token> | --token-file <path> [--units metric|imperial]",AS="Usage: acbridge link hue --host <bridge-ip> [--bridge-id <id>] [--key <existing-app-key> | --key-file <path>]",PS="Usage: acbridge link smartthings (opens a browser sign-in via the relay; tokens seal at the relay)",CS="Usage: acbridge link tuya [--client-id <id>] [--secret <access-secret> | --secret-file <path>] [--region eu|eu-w|us|us-e|cn|in] (eu-w/us-e = the Azure DCs)",TS="Usage: acbridge link meross [--email <you@example.com>] [--password <pw> | --password-file <path>] [--region eu|us|ap] [--mfa <6-digit-2fa-code>]",RS="Usage: acbridge link ewelink [--email <you@example.com>] [--password <pw> | --password-file <path>] [--region eu|us|as|cn]",OS="Usage: acbridge link govee [--key <govee-api-key> | --key-file <path>] (Govee Home app \u2192 profile \u2192 Settings \u2192 Apply for API Key)",DS="Usage: acbridge link mqtt --host <broker-host[:port]> [--username <u>] [--password <p> | --password-file <path>] [--prefix homeassistant]",yL="nanoleaf pairs per-device, not per-account: run `acbridge scan`, then `acbridge connect <device>` and hold the panel's power button.";async function NS(e){let t=e[0],r=hL(e.slice(1));if(t==="smartthings")return _L(e.slice(1));if(t==="tuya")return $L(r);if(t==="meross")return IL(r);if(t==="ewelink")return EL(r);if(t==="govee")return AL(r);let o;if(t==="home-assistant"||t==="homeassistant")o=bL(r);else if(t==="hue")o=await kL(r);else if(t==="mqtt")o=xL(r);else return x(`unsupported provider: ${t??"(none)"}. Supported: home-assistant, hue, smartthings, tuya, meross, ewelink, govee, mqtt`),v(ES),v(AS),v(PS),v(CS),v(TS),v(RS),v(OS),v(DS),v(yL),2;if(!o)return 1;se("Bringing up the integration\u2026");try{let{spawned:n}=await ct({kind:"cli"});n||await Qw(),$(`Linked \u2014 your ${o.label} devices should now appear in \`acbridge devices\` and to Claude.`)}catch(n){v(`Recorded. Start the node when ready (\`acbridge daemon\`) to bring it up. (${n.message})`)}return 0}function bL(e){let t=Vo();if(!t)return null;let r=(e.url??"").trim().replace(/\/+$/,""),o=Or({flag:"--token",argv:e.token,file:e.tokenFile,env:process.env.BRIDGE_HA_TOKEN});if(!o.ok)return x(o.message),null;let n=o.value;if(!vL(r))return x("Missing/invalid --url. Give your Home Assistant base URL, e.g. http://homeassistant.local:8123"),v(ES),null;if(!n)return x("Missing --token (or BRIDGE_HA_TOKEN). Create a Long-Lived Access Token in HA \u2192 your profile \u2192 Security."),null;let i=e.units==="imperial"||e.units==="metric"?e.units:void 0,s=ca("homeassistant",r);cr(t,"homeassistant",s).write(n);let a=Un(t,"homeassistant").filter(l=>l.accountId!==s);return pr(t,"homeassistant",[...a,{accountId:s,baseUrl:r,...i?{unitSystem:i}:{}}]),$(`Linked Home Assistant (${r}). Token stored locally; account ${s}.`),{label:"Home Assistant"}}function xL(e){let t=Vo();if(!t)return null;let r=(e.host??e.url??"").trim(),{host:o,port:n,tls:i}=zw(r);if(!o)return x("Missing --host. Give your broker's address, e.g. --host 192.168.1.5 (or mqtts://broker.lan:8883)."),v(DS),null;let s=(e.username??"").trim(),a=Or({flag:"--password",argv:e.password,file:e.passwordFile,env:process.env.BRIDGE_MQTT_PASSWORD});if(!a.ok)return x(a.message),null;let l=a.value;if(l&&!s)return x("A password needs a --username too \u2014 MQTT forbids a password with no user, and brokers refuse the connection."),null;let u=(e.prefix??"").trim(),d=`${o}:${n??(i?8883:1883)}`,p=ca("mqtt",d);cr(t,"mqtt",p).write(l);let m=Un(t,"mqtt").filter(f=>f.accountId!==p);return pr(t,"mqtt",[...m,{accountId:p,host:o,...n!==void 0?{port:n}:{},...i?{tls:i}:{},...s?{username:s}:{},...u?{discoveryPrefix:u}:{}}]),$(`Linked MQTT broker ${d}${s?` as ${s}`:" (anonymous)"}. Account ${p}.`),v(`Watching \`${u||"homeassistant"}/#\` for Home Assistant Discovery configs \u2014 Zigbee2MQTT, Tasmota and anything else that publishes them.`),{label:"MQTT"}}async function kL(e){let t=Vo();if(!t)return null;let r=(e.host??"").trim();if(!r)return x("Missing --host. Give your Hue Bridge IP, e.g. --host 192.168.1.42"),v(AS),null;let o=(e.bridgeId??"").trim().toLowerCase(),n=o||void 0,i;if(!o){let p=await PL(r);n=p.bridgeId,o=p.bridgeId??r.toLowerCase(),i=p.name}let s=Or({flag:"--key",argv:e.key,file:e.keyFile,env:process.env.BRIDGE_HUE_KEY});if(!s.ok)return x(s.message),null;let a=s.value||void 0,l;if(a)l=JSON.stringify({appkey:a.trim()}),v("Using the provided app key (skipping link-button pairing).");else{se("Press the link button on top of your Hue Bridge now \u2014 pairing completes within 30s\u2026"),n||z(`couldn't read this bridge's id from ${r}, so its certificate can't be verified \u2014 pass --bridge-id <id> to pin it.`);try{let p=await CL(r,n);l=JSON.stringify({appkey:p.appkey,...p.clientkey?{clientkey:p.clientkey}:{}})}catch(p){return x(`Hue pairing failed: ${p.message}`),null}}let u=ca("hue",o);cr(t,"hue",u).write(l);let d=Un(t,"hue").filter(p=>p.accountId!==u);return pr(t,"hue",[...d,{accountId:u,host:r,bridgeId:o,...i?{name:i}:{}}]),$(`Linked Philips Hue (${r}, bridge ${o}). Keys stored locally; account ${u}.`),{label:"Philips Hue"}}function wL(e,t,r){if(!r)return!1;let o=n=>n.provider===e&&n.status!=="revoked"&&n.status!=="needs_reauth";return r.some(n=>{if(!o(n))return!1;let i=t?.find(s=>s.provider===e&&(s.accountId===void 0||n.accountId===void 0||s.accountId===n.accountId));return i?i.status!==n.status||i.linkedAt!==n.linkedAt:!0})}async function SL(e,t,r){let o=r.intervalMs??3e3,n=r.sleep??(s=>new Promise(a=>setTimeout(a,s))),i=Date.now()+r.timeoutMs;for(;;){let s=await t();if(wL(e,r.before??null,s))return!0;if(Date.now()+o>i)return!1;await n(o)}}async function _L(e){let t=Sr();if(!t.ok)return x(t.message),3;let r=e.includes("--no-browser"),o=e.includes("--no-wait"),n=e.indexOf("--timeout"),i=n!==-1?Number(e[n+1]):180;if(!Number.isFinite(i)||i<=0)return x("--timeout takes a positive number of seconds"),2;se("Starting SmartThings sign-in\u2026");let s=N(we().accessFile)?.trim(),a=s?await ro(s):null,l=await yb("smartthings");if(!l.ok||!l.authorizeUrl)return x(l.error??"Couldn't start SmartThings linking."),v(PS),1;let u=!1;return r||(u=await eo(l.authorizeUrl,{isWsl:Gr()}).catch(()=>!1)),u?$("Browser opened \u2014 sign in to Samsung and approve access."):($("Open this URL in a browser, sign in to Samsung, and approve access:"),v(l.authorizeUrl)),o?(v("The account links at the relay; the hub picks it up automatically on its next connect (or restart the hub)."),0):(se(`Waiting for the link to complete (up to ${i}s)\u2026`),await SL("smartthings",async()=>{let p=N(we().accessFile)?.trim();return p?ro(p):null},{timeoutMs:i*1e3,before:a})?($("SmartThings linked \u2014 devices appear after the bridge's next relay connect (or restart the bridge)."),0):(x(`SmartThings didn't finish linking within ${i}s \u2014 the URL stays valid, approve it and check \`acbridge integrations\`:`),v(l.authorizeUrl),1))}async function $L(e){let t=await _r();if(!t.ok)return x(t.message),3;v("Tuya key wizard \u2014 one-time setup to control Smart Life / Tuya devices locally:"),v(" 1. Create a free account + Cloud Project at iot.tuya.com (data-center region MUST match your Smart Life app \u2014 UK/EU \u2192 Central Europe)."),v(" 2. Subscribe IoT Core (+ Authorization) to the project, then 'Link Tuya App Account' by scanning the QR from the Smart Life app."),v(" 3. Copy the project's Access ID (client id) + Access Secret below."),v(" Note: the IoT Core trial runs ~1 month (console \u2192 Cloud \u2192 My Services \u2192 'Extend Trial Period'). After it expires your"),v(" already-connected lamps keep working locally \u2014 only fetching NEW keys stops. Re-pairing a device rotates its key \u2192 re-run this.");let r=(e.clientId??process.env.BRIDGE_TUYA_CLIENT_ID??await Wo("Access ID (client id): ")).trim(),o=Or({flag:"--secret",argv:e.secret,file:e.secretFile,env:process.env.BRIDGE_TUYA_SECRET});if(!o.ok)return x(o.message),2;let n=(o.value||await Cl("Access Secret: ")).trim(),i=((e.region??process.env.BRIDGE_TUYA_REGION??await Wo("Region [eu]: "))||"eu").trim().toLowerCase();if(!r||!n)return x("Both the Access ID and Access Secret are required."),v(CS),1;if(!["eu","eu-w","us","us-e","cn","in"].includes(i))return x(`Unknown region "${i}" \u2014 use eu, eu-w, us, us-e, cn, or in.`),1;se("Making sure the hub is running\u2026");try{await ct({kind:"cli"})}catch(a){return x(`The hub isn't running and couldn't be started: ${a.message}. Start it with \`acbridge daemon\` and retry.`),1}se("Fetching your device keys from Tuya (this can take a few seconds)\u2026");let s=await q("/local/tuya/link",{method:"POST",body:{clientId:r,clientSecret:n,region:i},timeoutMs:9e4});if(s.hubOffline)return x("The hub went offline. Start it with `acbridge daemon` and retry."),1;if(s.status===200&&s.body?.ok){let a=s.body.deviceCount??0,l=s.body.sleepyCount??0;return $(`Imported keys for ${a} Tuya device${a===1?"":"s"}. Keys are stored only on this PC (never on your network or the cloud).`),l>0&&v(`${l} battery/sensor device${l===1?"":"s"} (e.g. a PIR) won't control locally yet \u2014 those come in a later update.`),v('Now run `acbridge scan` \u2014 your lamps should appear under "Ready to connect". Connect each, then control them by voice or `acbridge devices`.'),0}return x(s.body?.error??`The hub couldn't complete the wizard (HTTP ${s.status??"?"}).`),1}async function IL(e){let t=await _r();if(!t.ok)return x(t.message),3;v("Meross account wizard \u2014 a one-time sign-in so the hub can control your Meross devices locally:"),v(" Your Meross email + password are sent ONCE to Meross to fetch the account key that signs local"),v(" requests. The key is stored only on this PC \u2014 never on your network, the cloud, or our relay.");let r=Or({flag:"--password",argv:e.password,file:e.passwordFile,env:process.env.BRIDGE_MEROSS_PASSWORD});if(!r.ok)return x(r.message),2;let o=(e.email??process.env.BRIDGE_MEROSS_EMAIL??await Wo("Meross email: ")).trim(),n=r.value||await Cl("Password: "),i=((e.region??process.env.BRIDGE_MEROSS_REGION??await Wo("Region [eu]: "))||"eu").trim().toLowerCase();if(!o||!n)return x("Both the email and password are required."),v(TS),1;if(!["eu","us","ap"].includes(i))return x(`Unknown region "${i}" \u2014 use eu, us, or ap.`),1;let s=(e.mfa??process.env.BRIDGE_MEROSS_MFA)?.trim()||void 0;se("Making sure the hub is running\u2026");try{await ct({kind:"cli"})}catch(l){return x(`The hub isn't running and couldn't be started: ${l.message}. Start it with \`acbridge daemon\` and retry.`),1}se("Signing in to Meross\u2026");let a=await q("/local/meross/link",{method:"POST",body:{email:o,password:n,region:i,...s?{mfaCode:s}:{}},timeoutMs:6e4});if(a.hubOffline)return x("The hub went offline. Start it with `acbridge daemon` and retry."),1;if(a.status===200&&a.body?.ok){let l=a.body.deviceCount??0;return $(`Signed in. The account key is stored only on this PC.${l?` (${l} device${l===1?"":"s"} on the account.)`:""}`),v('Now run `acbridge scan` \u2014 your Meross plugs/bulbs should appear under "Ready to connect". Connect each, then control them by voice or `acbridge devices`.'),0}return x(a.body?.error??`The hub couldn't complete the sign-in (HTTP ${a.status??"?"}).`),1}async function EL(e){let t=await _r();if(!t.ok)return x(t.message),3;v("SONOFF / eWeLink account wizard \u2014 a one-time sign-in so the hub can control your SONOFF devices locally:"),v(" Your eWeLink email + password are sent ONCE to eWeLink to fetch each device's LAN key. The keys"),v(" are stored only on this PC \u2014 never on your network, the cloud, or our relay.");let r=Or({flag:"--password",argv:e.password,file:e.passwordFile,env:process.env.BRIDGE_EWELINK_PASSWORD});if(!r.ok)return x(r.message),2;let o=(e.email??process.env.BRIDGE_EWELINK_EMAIL??await Wo("eWeLink email: ")).trim(),n=r.value||await Cl("Password: "),i=((e.region??process.env.BRIDGE_EWELINK_REGION??await Wo("Region [eu]: "))||"eu").trim().toLowerCase();if(!o||!n)return x("Both the email and password are required."),v(RS),1;if(!["eu","us","as","cn"].includes(i))return x(`Unknown region "${i}" \u2014 use eu, us, as, or cn.`),1;se("Making sure the hub is running\u2026");try{await ct({kind:"cli"})}catch(a){return x(`The hub isn't running and couldn't be started: ${a.message}. Start it with \`acbridge daemon\` and retry.`),1}se("Signing in to eWeLink\u2026");let s=await q("/local/ewelink/link",{method:"POST",body:{email:o,password:n,region:i},timeoutMs:6e4});if(s.hubOffline)return x("The hub went offline. Start it with `acbridge daemon` and retry."),1;if(s.status===200&&s.body?.ok){let a=s.body.deviceCount??0;return $(`Signed in. ${a} device key${a===1?"":"s"} stored \u2014 only on this PC.`),v('Now run `acbridge scan` \u2014 your SONOFF switches/plugs should appear under "Ready to connect". Connect each, then control them by voice or `acbridge devices`.'),0}return x(s.body?.error??`The hub couldn't complete the sign-in (HTTP ${s.status??"?"}).`),1}async function AL(e){let t=await _r();if(!t.ok)return x(t.message),3;v("Govee key wizard \u2014 one self-service API key imports your Govee devices:"),v(" Govee Home app \u2192 profile \u2192 Settings \u2192 Apply for API Key (it arrives by email within minutes).");let r=Or({flag:"--key",argv:e.key,file:e.keyFile,env:process.env.BRIDGE_GOVEE_KEY});if(!r.ok)return x(r.message),2;let o=(r.value||await Cl("Govee API key: ")).trim();if(!o)return x("An API key is required."),v(OS),2;se("Making sure the hub is running\u2026");try{await ct({kind:"cli"})}catch(i){return x(`The hub isn't running and couldn't be started: ${i.message}. Start it with \`acbridge daemon\` and retry.`),1}se("Importing your Govee devices\u2026");let n=await q("/local/govee/link",{method:"POST",body:{apiKey:o},timeoutMs:6e4});if(n.hubOffline)return x("The hub went offline. Start it with `acbridge daemon` and retry."),1;if(n.status===200&&n.body?.ok){let i=n.body.deviceCount??0;return $(`Imported ${i} Govee device${i===1?"":"s"}. The key is stored only on this PC.`),v('Now run `acbridge scan` \u2014 your Govee lights should appear under "Ready to connect". Connect each, then control them by voice or `acbridge devices`.'),0}return x(n.body?.error??`The hub couldn't complete the wizard (HTTP ${n.status??"?"}).`),1}async function Wo(e){let t=IS({input:process.stdin,output:process.stdout});try{return await t.question(e)}finally{t.close()}}async function Cl(e){let t=process.stdout,r=IS({input:process.stdin,output:t}),o=r,n=o._writeToOutput?.bind(r);o._writeToOutput=i=>{(i.includes(e)||i===`\r
|
|
263
|
+
`):(process.stdout.write(e),n=!0)}}o.question(e,n=>{o.close(),r(n.trim())})})}async function _0(e){let t=await W("/local/discovered");if(t.hubOffline)return x(Te()),1;if(t.status!==200||!t.body)return x(`hub answered HTTP ${t.status} reading /local/discovered`),1;let r=t.body.devices;if(e.startsWith("ldev_")){let o=r.find(n=>n.discoveredId===e);return o||(x(`unknown discoveredId ${e} \u2014 run \`acbridge scan\` and use an id from its results`),1)}if(w0(e)){let o=Pt(e),n=r.find(i=>i.addresses.mac===o);return n||(x(`no discovered device with MAC ${o} \u2014 run \`acbridge scan\` first`),1)}if(ch(e)){let o=r.filter(n=>n.addresses.ip===e);if(o.length===1)return o[0];if(o.length===0)return x(`no discovered device at ${e} \u2014 run \`acbridge scan\` first`),1;x(`${o.length} devices share ${e} \u2014 pick one by id:`);for(let n of o)b(` ${n.discoveredId} ${lh(n)}`);return 1}return x(`not a MAC, IP, or ldev_\u2026 id: ${e}`),b(Kn),2}var lh=e=>{let t=[e.identity.manufacturer,e.identity.model].filter(Boolean).join(" ");return`${e.identity.name??(t||(e.identity.hint??"unknown device"))} (${e.addresses.ip}${e.addresses.mac?`, ${e.addresses.mac}`:""})`};async function vD(e,t){let r;if(e.startsWith("dev_"))r=e;else if(w0(e))r=x0(e);else if(e.startsWith("ldev_")||ch(e)){let n=await _0(e);if(typeof n=="number")return n;if(!n.addresses.mac)return x(`${e} has no stable identity (no MAC) \u2014 it was never connected, so there is nothing to forget`),1;r=x0(n.addresses.mac)}else return x(`not a deviceId, MAC, IP, or ldev_\u2026 id: ${e}`),b(Kn),2;let o=await W("/local/forget",{method:"POST",body:{deviceId:r,purge:t}});return o.hubOffline?(x(Te()),1):o.status===200&&o.body?.ok?($(`forgot ${r}${t?" (purged)":""} \u2014 it will not be auto-reconnected`),o.body.note&&b(o.body.note),0):(x(o.body?.error??`hub answered HTTP ${o.status}`),1)}async function bD(e){if(e!=="on"&&e!=="off")return x(`--auto takes on|off, got: ${e||"(none)"}`),b(Kn),2;let t=await W("/local/config");if(t.hubOffline)return x(Te()),1;if(t.status!==200||!t.body)return x(`hub answered HTTP ${t.status} reading /local/config`),1;let r={...t.body,autoConnect:e==="on"?"open-protocols":"off"},o=await W("/local/config",{method:"POST",body:r});return o.hubOffline?(x(Te()),1):o.status!==200||!o.body?(x(`hub answered HTTP ${o.status} writing /local/config`),1):(o.body.autoConnect==="open-protocols"?($("auto-connect ON (open protocols)"),b("New lights/plugs on open local protocols connect automatically. Never locks, covers, garage doors, valves, cameras, or doorbells.")):$("auto-connect OFF"),0)}import{writeFileSync as LD}from"node:fs";function gl(){return $b({marketplaceDir:jn,claudeCmd:cn()})}function $0(){return _b({claudeCmd:cn()})}function yD(e=Y){return ia(to(no(e)))}function Bo(e){return Rb(jn,{settingsFile:e?.settingsFile,configFile:e?.configFile,env:e?.env,nodeCommand:e?.nodeCommand??yD(e?.bridgeDir)})}function hl(e={}){let t=[],r=e.ensurePluginInstalled??gl;try{let n=r();n.marketplaceRepointed?t.push({level:"info",message:"Re-pointed the alexa plugin marketplace to this install."}):n.pluginReinstalled&&t.push({level:"info",message:"Refreshed the alexa plugin from this install."})}catch(n){t.push({level:"warn",message:`plugin refresh skipped: ${n.message}`})}let o=e.ensureStatusline??Bo;try{let n=o();n.changed&&t.push({level:"info",message:n.enabled?"Installed the AC Bridge statusline tee (chains any existing statusline).":"Removed the AC Bridge statusline tee (original restored)."})}catch(n){t.push({level:"warn",message:`statusline tee skipped: ${n.message}`})}return t}function I0(e){if(!e)return null;try{let t=JSON.parse(e);return typeof t.signal!="string"||typeof t.ts!="number"?null:{signal:t.signal,ts:t.ts}}catch{return null}}function E0(e){if(e.reason!==null&&e.now-e.reason.ts<(e.reasonFreshMs??6e4)&&e.reason.signal!=="account-switched")return{action:"exit-clean"};let r=e.windowMs??3e5;return e.respawnTimes.filter(n=>e.now-n<r).length>=(e.maxRespawns??3)?{action:"exit-fail",why:"the hub keeps dying \u2014 respawn cap reached (see ~/.claude-bridge/hub.log)"}:{action:"respawn"}}function A0(e,t,r){return t==="offline"?"handle-offline":t==="unknown"||e.holderId===null?"rehold":e.wantRevert&&r&&r.active===!1?"rearm":"none"}function Xn(e={}){let t=(e.payloadVersion??(()=>Ut()))();if(t!==null)return{version:t,channel:"app"};let r=(e.bundledVersion??s0)(),o=Zv(r);return o!==null?{version:o,channel:"npm"}:{version:null,channel:null}}function vl(e=N){let t=Se(),r=e(t.refreshFile)?.trim(),o=r?Ke(r):null;if(o)return o;let n=e(t.accessFile)?.trim();return n?Ke(n):null}var C0="https://www.ac-bridge.com/home";function P0(e,t){return!t||typeof t.plan!="string"?{allowed:!0}:t.plan==="paid"&&t.serviceOk===!1?{allowed:!1,message:`Your subscription has ended \u2014 manage your plan at ${C0}, then retry.`}:t.plan==="free"?{allowed:!1,message:`No active subscription \u2014 start the 3-day free trial at ${C0}, then retry.`}:{allowed:!0}}var xD=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$/;function T0(e){let t=xD.exec(e);if(!t)return null;let r=t[4]?t[4].split(".").map(o=>/^\d+$/.test(o)?Number(o):o):[];return{major:Number(t[1]),minor:Number(t[2]),patch:Number(t[3]),prerelease:r}}function kD(e,t){let r=typeof e=="number",o=typeof t=="number";return r&&!o?-1:!r&&o?1:e<t?-1:e>t?1:0}function ds(e,t){let r=T0(e),o=T0(t);if(!r||!o)return null;for(let i of["major","minor","patch"])if(r[i]!==o[i])return r[i]<o[i]?-1:1;if(r.prerelease.length===0&&o.prerelease.length===0)return 0;if(r.prerelease.length===0)return 1;if(o.prerelease.length===0)return-1;let n=Math.min(r.prerelease.length,o.prerelease.length);for(let i=0;i<n;i++){let s=kD(r.prerelease[i],o.prerelease[i]);if(s!==0)return s}return r.prerelease.length!==o.prerelease.length?r.prerelease.length<o.prerelease.length?-1:1:0}var R0="npm i -g acbridge@latest",wD="https://www.ac-bridge.com/api/releases/manifest",uh=6*36e5,SD="https://www.ac-bridge.com";function _D(e=process.platform){return e==="win32"?"windows":e==="darwin"?"macos":e==="linux"?"linux":null}function O0(e){if(typeof e!="object"||e===null)return null;let t=e;if(t.schemaVersion!==1)return null;let r={},o=typeof t.platforms=="object"&&t.platforms!==null?t.platforms:{};for(let i of["windows","macos","linux"]){let s=o[i];typeof s=="object"&&s!==null&&typeof s.version=="string"&&(r[i]={version:s.version})}let n=typeof t.cli=="object"&&t.cli!==null?t.cli:null;return{schemaVersion:1,minimumVersion:typeof t.minimumVersion=="string"?t.minimumVersion:null,downloadPage:typeof t.downloadPage=="string"&&t.downloadPage?t.downloadPage:SD,platforms:r,cli:n?{version:typeof n.version=="string"?n.version:null,minimumVersion:typeof n.minimumVersion=="string"?n.minimumVersion:null}:null}}async function bl(e={}){let t=process.env.BRIDGE_UPDATE_MANIFEST_URL||wD;try{let r=await(e.fetchImpl??fetch)(t,{signal:AbortSignal.timeout(e.timeoutMs??6e3)});if(!r.ok)return null;let o=O0(await r.json());return o&&$D(o,e.now),o}catch{return null}}function $D(e,t=Date.now()){try{let r={};try{let o=JSON.parse(N(_e)??"{}");typeof o=="object"&&o!==null&&!Array.isArray(o)&&(r=o)}catch{r={}}r.updateCheck={manifest:e,fetchedAt:t},we(_e,`${JSON.stringify(r,null,2)}
|
|
264
|
+
`)}catch{}}function yl(e=uh,t=Date.now()){try{let r=N(_e);if(!r)return null;let n=JSON.parse(r).updateCheck;return!n||typeof n!="object"||typeof n.fetchedAt!="number"||t-n.fetchedAt>e?null:O0(n.manifest)}catch{return null}}function ps(e,t,r=process.platform,o="app"){if(e===null)return{state:"dev"};if(!t)return{state:"unknown"};if(o==="npm"){let s=t.cli;return s?s.minimumVersion&&ds(e,s.minimumVersion)===-1?{state:"blocked",current:e,minimum:s.minimumVersion,upgrade:R0}:s.version&&ds(e,s.version)===-1?{state:"update",current:e,latest:s.version,upgrade:R0}:{state:"current",current:e}:{state:"unpublished",current:e}}if(t.minimumVersion&&ds(e,t.minimumVersion)===-1)return{state:"blocked",current:e,minimum:t.minimumVersion,upgrade:t.downloadPage};let n=_D(r),i=n?t.platforms[n]?.version:void 0;return i&&ds(e,i)===-1?{state:"update",current:e,latest:i,upgrade:t.downloadPage}:{state:"current",current:e}}function D0(e,t,r=process.platform,o="app"){let n=ps(e,t,r,o),i=o==="npm"?"acbridge":"app";switch(n.state){case"dev":return{grade:"info",line:"dev build \u2014 update checks skipped"};case"unknown":return{grade:"warn",line:"update check unreachable"};case"unpublished":return{grade:"info",line:`${i} ${n.current} \u2014 no update channel published yet`};case"blocked":return{grade:"bad",line:`${i} ${n.current} is below the minimum supported version ${n.minimum} \u2014 update required: ${n.upgrade}`};case"update":return{grade:"warn",line:`update available: ${n.latest} (you have ${n.current})`};case"current":return{grade:"ok",line:`${i} ${n.current} is current`}}}var AD="Not signed in on this machine. Run `acbridge login`.";function $r(e=N,t={}){let r=t.paths??Se(),o=e(r.accessFile)?.trim(),n=e(r.refreshFile)?.trim();if(o||n)return(t.resolveScope??(()=>gt()))()?{ok:!0,paired:!!n}:(t.readPointer??(()=>Pe()))()?{ok:!1,message:ot.pointerMismatch}:{ok:!0,paired:!!n};let i=(t.scan??ft)();return i.length===0?{ok:!1,message:AD}:(_t(i),{ok:!1,message:ot.pointerMismatch})}async function Ir(e){if(await(e?.hubHealthy??Le)())return{ok:!0};let r=$r(e?.read??N);return r.ok?{ok:!0}:{ok:!1,message:r.message}}function N0(e={}){let t=e.resolveScope??(()=>gt()),o=(e.layout??sn())>=an,n=o?(e.scan??ft)():[];(e.warnAmbiguous??(u=>_t(u)))(n);let i=t();if(i)return i;if((e.readPointer??(()=>Pe()))())return null;let a=u=>((e.writePointer??(p=>mr({sub:p})))(u),t());if(o){if(n.length!==1)return null;let u=n[0];return ka(u,e.segmentOf)?a(u.sub):null}let l=(e.readCredentialSub??vl)();return l?a(l):null}function CD(){let e=N0();return e?sa({configFile:$i(e).userConfigFile}).onboardedAt:null}function PD(e){let t=N0();t&&aa({onboardedAt:e},{configFile:$i(t).userConfigFile})}async function TD(e={}){let t=(e.build??Xn)(),r=e.clientVersion?e.clientVersion():t.version;if(r===null)return{ok:!0};let o=await(e.fetchManifest??bl)()??(e.cachedManifest??yl)(uh);if(!o)return(e.warnLine??j)("update check unreachable \u2014 continuing (it will retry next run)"),{ok:!0};let n=ps(r,o,e.platform??process.platform,t.channel??"app");return n.state==="blocked"?{ok:!1,exitCode:4,message:`This AC Bridge build (${n.current}) is below the minimum supported version (${n.minimum}). Update it: ${n.upgrade}`}:(n.state==="update"&&(e.infoLine??b)(`update available: ${n.latest} (you have ${n.current}) \u2014 ${n.upgrade}`),{ok:!0})}var RD="This machine's sign-in is no longer valid (the relay rejected its stored credential). Run `acbridge login` to sign in again.";function OD(){return!!N(Se().refreshFile)?.trim()}var DD="This account hasn't completed setup yet. Run `acbridge login --if-needed` on this machine to complete it.";async function Ho(e={}){let t=e.read??N,r=$r(t);if(!r.ok)return{ok:!1,exitCode:3,message:r.message};let o=e.relayUrl??de().relayUrl,n=e.fetchImpl??fetch;if(!await(e.refreshToken??(d=>jt(d)))(o)&&!(e.hasRefreshCredential??OD)())return{ok:!1,exitCode:3,message:RD};let s=t(Se().accessFile)?.trim()??"",a={reachable:!1,completedAt:null};try{let d=await n(`${o.replace(/\/+$/,"")}/settings`,{headers:{authorization:`Bearer ${s}`},signal:AbortSignal.timeout(6e3)});if(d.ok){let f=(await d.json()).config?.onboarding?.completedAt;a={reachable:!0,completedAt:typeof f=="number"?f:null}}}catch{}if(a.reachable){if(a.completedAt===null)return{ok:!1,exitCode:3,message:DD};(e.cacheOnboardedAt??PD)(a.completedAt)}else if((e.cachedOnboardedAt??CD)()===null)return{ok:!1,exitCode:1,message:"Couldn't verify this account's setup with the relay \u2014 check your connection and retry."};let l=await TD(e.updateGate);if(!l.ok)return l;let u=await(e.fetchEntitlement??Ft)(s),p=P0("preflight",u);return p.allowed?{ok:!0}:{ok:!1,exitCode:5,message:p.message}}var ND=["relayUrl","hubPort","machine"];async function xl(e,t,r=fetch){let o=await r(`${e.replace(/\/+$/,"")}/settings`,{headers:{authorization:`Bearer ${t}`}});if(!o.ok)throw new Error(`relay ${o.status}`);let n=await o.json().catch(()=>null);return{version:typeof n?.version=="number"?n.version:null,config:typeof n?.config=="object"&&n?.config!==null?n.config:{}}}async function kl(e,t,r=fetch){if(!t)return null;let o;try{o=await xl(e,t,r)}catch(n){return b(`Cloud settings sync skipped (${n instanceof Error?n.message:String(n)}).`),null}try{let n=typeof o.config.cli=="object"&&o.config.cli!==null?o.config.cli:null;if(!n)return o;let i={};for(let l of ND){let u=n[l];(l==="hubPort"?typeof u=="number"&&Number.isFinite(u):typeof u=="string"&&u)&&(i[l]=u)}if(Object.keys(i).length===0)return o;let s={};try{s=JSON.parse(N(_e)??"{}"),(typeof s!="object"||s===null||Array.isArray(s))&&(s={})}catch{s={}}let a={...s,...i};if(JSON.stringify(a)===JSON.stringify(s))return o;we(_e,`${JSON.stringify(a,null,2)}
|
|
265
|
+
`),b(`Synced cloud settings into config.json (${Object.keys(i).join(", ")}).`)}catch(n){b(`Cloud settings sync skipped (${n instanceof Error?n.message:String(n)}).`)}return o}var UD=3e3;async function wl(e=[]){let t=!e.includes("--no-revert"),{relayUrl:r}=de(),o=await Ho();if(!o.ok)return x(o.message),o.exitCode;if(!await jt(r))return x("No valid credential. Run `acbridge login` first."),3;await kl(r,N(Se().accessFile)??"");for(let h of hl())(h.level==="info"?b:j)(h.message);let n=(await ct({kind:"daemon"})).holderId;try{LD(Qe,String(process.pid))}catch{}let i=Date.now();ih(i),setInterval(()=>ih(i),a0).unref();let s,a=!1,l=async()=>{let h=await W("/local/session/activate",{method:"POST",body:{revertOnStop:t},timeoutMs:8e3});a=!h.hubOffline&&h.status===200&&h.body?.active===!0,s=h.body?.active?h.body.sessionId:void 0};await l();let u=!1,p=async(h=0)=>{u||(u=!0,n&&await fl(n).catch(()=>{}),ve(Qe),l0(),process.exit(h))};process.once("SIGINT",()=>{p()}),process.once("SIGTERM",()=>{p()}),$(`Bridge running \u2014 hub connected, revert-on-stop ${t?"armed":"off"}. Ctrl-C to stop.`);let d=[],m=async()=>{let h=E0({reason:I0(N(Ii)),now:Date.now(),respawnTimes:d});if(h.action==="exit-clean"){$("hub stopped \u2014 daemon exiting."),await p();return}if(h.action==="exit-fail"){x(h.why),await p(1);return}d.push(Date.now()),j("hub went down without a stop \u2014 respawning it\u2026");try{n=(await ct({kind:"daemon"})).holderId,await l(),$("hub respawned")}catch(v){j(`respawn failed: ${v.message} \u2014 retrying on the next beat`),n=null}},f=!1,g=async()=>{if(!(f||u)){f=!0;try{let h=n?await v0(n):await Le()?"unknown":"offline",v=null;if(h==="ok"&&t){let S=await W("/local/session/heartbeat",{method:"POST",body:{...s?{sessionId:s}:{}},timeoutMs:4e3});!S.hubOffline&&S.status===200&&S.body&&(v={active:S.body.active})}let k=A0({holderId:n,wantRevert:t,sessionArmed:a},h,v);k==="handle-offline"?await m():k==="rehold"?(n=await pl("daemon"),t&&await l()):k==="rearm"&&await l()}finally{f=!1}}};return setInterval(()=>{g()},UD),await new Promise(()=>{}),0}var jD=c.object({hs:at.nullable().default(null),brightness:ae.nullable().default(null),kelvin:hn.nullable().default(null)}),zD=c.enum(["shared","dedicated"]),FD=c.enum(["focused","priority","mostRecent"]),MD=c.enum(["profile","repo","session"]),BD=c.object({mode:zD.default("shared"),subMode:FD.default("mostRecent"),priorityBy:MD.default("session"),priority:c.array(c.string()).default([]),dedicatedTo:c.string().nullable().default(null)}),Zo=c.object({name:c.string().nullable().default(null),instanceNames:c.record(c.string(),c.string()).default({}),favouriteScenes:c.array(c.string()).default([]),groups:c.array(c.string()).default([]),main:jD.default({hs:null,brightness:null,kelvin:null}),arbitration:BD.default({mode:"shared",subMode:"mostRecent",priorityBy:"session",priority:[],dedicatedTo:null}),participate:c.boolean().default(!0),wakeIfOff:c.boolean().default(!0),allowSecurity:c.boolean().default(!1)}),Er=c.record(c.string(),Zo).default({});var HD=c.object({id:c.string(),name:c.string()}),Sl=c.array(HD).default([]);async function L0(e,t,r,o=3){let n=t;for(let i=0;i<o;i+=1){let s=r(n.config),a=await e(n.version,s);if(a.ok)return{outcome:"committed",version:a.version,config:s};if(a.error==="version_conflict"){n={version:a.version,config:a.config};continue}return{outcome:"error",...a.error!==void 0?{error:a.error}:{}}}return{outcome:"conflict-exhausted"}}function ms(e){let t=Sl.safeParse(e.deviceGroups);return t.success?t.data:[]}function U0(e,t,r){let o=r.trim();return o?{...e,deviceGroups:[...ms(e),{id:t,name:o}]}:null}function j0(e,t,r){let o=r.trim();return o?{...e,deviceGroups:ms(e).map(n=>n.id===t?{...n,name:o}:n)}:null}function z0(e,t){let r={...e,deviceGroups:ms(e).filter(n=>n.id!==t)},o=Er.safeParse(e.deviceSettings);if(o.success){let n=o.data,i=!1,s={};for(let[a,l]of Object.entries(n))l.groups.includes(t)?(s[a]={...l,groups:l.groups.filter(u=>u!==t)},i=!0):s[a]=l;i&&(r.deviceSettings=s)}return r}async function Go(e,t,r={},o=3){let n=await(r.fetchSnapshot??ba)(e);if(!n)return{outcome:"unavailable"};let i=r.put??Dy,s=await L0((a,l)=>i(e,a,l),n,t,o);if(s.outcome==="committed"){let a=r.refresh??(()=>W("/local/rules/refresh",{method:"POST",body:{}}));try{await a()}catch{}}return s}var _l=["Usage: acbridge devices [list] [--json]"," acbridge devices on|off <device>"," acbridge devices set <device> <capability.command|command> [--param k=v ...]"," acbridge devices set-main <device> [--color <hue>,<sat>|none] [--brightness <0-100>|none] [--kelvin <k>|none]"].join(`
|
|
266
|
+
`);function Yn(e,t){let r=e.find(s=>s.id===t);if(r)return{ok:!0,device:r};let o=t.toLowerCase(),n=e.filter(s=>s.name.toLowerCase()===o);if(n.length===1)return{ok:!0,device:n[0]};let i=n.length>1?n:e.filter(s=>s.name.toLowerCase().includes(o));return i.length===1?{ok:!0,device:i[0]}:i.length>1?{ok:!1,kind:"ambiguous",candidates:i.map(s=>({id:s.id,name:s.name}))}:{ok:!1,kind:"not-found",candidates:[]}}function dh(e){let t={};for(let r of e){let o=r.indexOf("=");if(o<=0)return{ok:!1,message:`--param needs k=v, got: ${r}`};let n=r.slice(0,o),i=r.slice(o+1);if(i==="true"||i==="false")t[n]=i==="true";else if(i!==""&&Number.isFinite(Number(i)))t[n]=Number(i);else if(i.startsWith("[")||i.startsWith("{"))try{t[n]=JSON.parse(i)}catch{return{ok:!1,message:`--param ${n} isn't valid JSON`}}else t[n]=i}return{ok:!0,params:t}}function $l(e,t,r){let o=t.indexOf("."),n=o>0?t.slice(0,o):null,i=o>0?t.slice(o+1):t,s=[];for(let p of e.capabilities)if(!(n&&p.type!==n))for(let d of cs[p.type]??[])d.command===i&&(d.gate&&!d.gate(p)||s.push({cap:p,entry:d}));if(s.length===0)return n&&!e.capabilities.some(p=>p.type===n)?{ok:!1,message:`${e.name} doesn't have the "${n}" capability`}:{ok:!1,message:`no command "${i}" on ${e.name}${n?` (${n})`:""}`};if(s.length>1)return{ok:!1,message:`"${i}" is ambiguous on ${e.name} \u2014 qualify it: ${s.map(p=>`${p.cap.type}.${i}`).join(" | ")}`};let{cap:a,entry:l}=s[0],u=l.params.safeParse(r);if(!u.success){let p=u.error.issues[0];return{ok:!1,message:`bad params for ${a.type}.${i}: ${p?`${p.path.join(".")} ${p.message}`:"invalid"}`}}return{ok:!0,capability:a.type,command:i,params:u.data}}function ZD(e,t){return{deviceId:e,capability:t.capability,command:t.command,params:t.params,consumer:"app"}}function GD(e,t){let r=new Map(e.areas.map(n=>[n.id,n.name])),o=[];if(t?.note&&o.push(`(${t.note})`),e.devices.length===0)return o.push("no devices connected \u2014 run `acbridge scan` to find some, or link an account: `acbridge link <provider>`"),o;for(let n of[...e.devices].sort((i,s)=>i.name.localeCompare(s.name))){let i=n.areaId&&r.get(n.areaId)||"\u2014";o.push(`${n.name.padEnd(26)} ${n.type.padEnd(12)} ${i.padEnd(14)} ${n.reachability.padEnd(9)} ${n.id}`)}return o}async function Ar(){let e=await W("/local/devices",{method:"GET",timeoutMs:5e3});if(!e.hubOffline&&e.status===200&&e.body)return{doc:e.body};let t=Mt();if(t.state==="mismatch")return{refusal:{message:t.message,exitCode:3}};if(t.state!=="ok")return null;let r=await Ry(t.token);return r?{doc:r,note:"relay cache \u2014 bridge not running; state may be stale"}:null}async function F0(e=[]){let t=e.includes("--json");t&&ye(!0);let r=e.filter(p=>!p.startsWith("--")),o=r[0]??"list";if(o==="list"){let p=await Ar();if(p&&"refusal"in p)return E(p.refusal.message,p.refusal.exitCode);if(!p)return E("no device graph available \u2014 start the bridge (`acbridge start`) or sign in",1);if(t)q(p.doc);else for(let d of GD(p.doc,p.note?{note:p.note}:void 0))b(d);return 0}if(o==="set-main")return JD(e,t);if(o!=="on"&&o!=="off"&&o!=="set")return b(_l),E(`unknown devices subcommand: ${o}`,2);let n=r[1];if(!n)return b(_l),E("which device? give an id (dev_\u2026) or a name",2);let i=await Ar();if(i&&"refusal"in i)return E(i.refusal.message,i.refusal.exitCode);if(!i)return E("no device graph available \u2014 start the bridge (`acbridge start`) or sign in",1);let s=Yn(i.doc.devices,n);if(!s.ok){if(s.kind==="ambiguous"){for(let p of s.candidates)b(` ${p.name} (${p.id})`);return E(`"${n}" matches several devices \u2014 name one of the ids above`,2)}return E(`no device matches "${n}" \u2014 try \`acbridge devices\``,2)}let a;if(o==="on"||o==="off")a=$l(s.device,o==="on"?"power.turnOn":"power.turnOff",{});else{let p=r[2];if(!p)return b(_l),E("set needs a command \u2014 e.g. `acbridge devices set lamp brightness.setBrightness --param level=40`",2);let d=[];for(let f=0;f<e.length;f++)e[f]==="--param"&&e[f+1]&&d.push(e[++f]);let m=dh(d);if(!m.ok)return E(m.message,2);a=$l(s.device,p,m.params)}if(!a.ok)return E(a.message,2);let l=$t({notSignedIn:{message:"Not signed in. Run `acbridge login` first.",exitCode:3}});if(!l.ok)return E(l.message,l.exitCode);let u=await Oy(l.token,ZD(s.device.id,a));return u.ok?($(`${s.device.name}: ${a.capability}.${a.command}${u.verified===!0?" (verified)":""}`),u.note&&b(me(u.note)),t&&q({ok:!0,deviceId:s.device.id,capability:a.capability,command:a.command}),0):u.status===503?E("bridge not running \u2014 run `acbridge start` (device control routes through your PC)",1):(x(u.error??`command failed (${u.status||"network"})`),t&&q({ok:!1,error:u.error??null,status:u.status,exit:1}),1)}function WD(e){let t={},r=!1,o=e.indexOf("--color");if(o!==-1){let s=e[o+1];if(s==="none")t.hs=null;else{let a=(s??"").split(",").map(l=>Number(l.trim()));if(a.length!==2||!a.every(Number.isFinite)||a[0]<0||a[0]>360||a[1]<0||a[1]>100)return{patch:t,touched:r,bad:`--color takes <hue 0-360>,<sat 0-100> or none, got: ${s??"(none)"}`};t.hs={hue:a[0],saturation:a[1]}}r=!0}let n=e.indexOf("--brightness");if(n!==-1){let s=e[n+1];if(s==="none")t.brightness=null;else{let a=Number(s);if(!Number.isFinite(a)||a<0||a>100)return{patch:t,touched:r,bad:`--brightness takes 0-100 or none, got: ${s??"(none)"}`};t.brightness=a}r=!0}let i=e.indexOf("--kelvin");if(i!==-1){let s=e[i+1];if(s==="none")t.kelvin=null;else{let a=Number(s);if(!Number.isInteger(a)||a<1e3||a>12e3)return{patch:t,touched:r,bad:`--kelvin takes a whole colour temperature 1000-12000 (or none), got: ${s??"(none)"}`};t.kelvin=a}r=!0}return{patch:t,touched:r}}function VD(e,t,r){let o=Er.safeParse(e.deviceSettings);if(e.deviceSettings!==void 0&&!o.success)return{error:"this machine's device settings are unreadable by this CLI version \u2014 update acbridge (nothing was written)"};let n=o.success?o.data:{},i=n[t]??Zo.parse({}),s=Zo.safeParse({...i,main:{...i.main??{},...r}});return s.success?{config:{...e,deviceSettings:{...n,[t]:s.data}}}:{error:`that main look doesn't validate: ${s.error.issues[0]?.message??"invalid"}`}}async function JD(e,t){let o=e.filter((m,f)=>!m.startsWith("--")&&!["--color","--brightness","--kelvin"].includes(e[f-1]??""))[1];if(!o)return b(_l),E("which device? give an id (dev_\u2026) or a name",2);let{patch:n,touched:i,bad:s}=WD(e);if(s)return E(s,2);if(!i)return E("nothing to change \u2014 give at least one of --color / --brightness / --kelvin",2);let a=await Ar();if(a&&"refusal"in a)return E(a.refusal.message,a.refusal.exitCode);if(!a)return E("no device graph available \u2014 start the bridge (`acbridge start`) or sign in",1);let l=Yn(a.doc.devices,o);if(!l.ok){if(l.kind==="ambiguous"){for(let m of l.candidates)b(` ${m.name} (${m.id})`);return E(`"${o}" matches several devices \u2014 name one of the ids above`,2)}return E(`no device matches "${o}" \u2014 try \`acbridge devices\``,2)}let u=$t({notSignedIn:{message:"Not signed in. Run `acbridge login` first.",exitCode:3}});if(!u.ok)return E(u.message,u.exitCode);let p=null,d=await Go(u.token,m=>{let f=VD(m,l.device.id,n);if("error"in f)throw new Error(f.error);return f.config}).catch(m=>(p=m instanceof Error?m.message:String(m),{outcome:"error",error:p}));if(d.outcome!=="committed"){let m=d.outcome==="unavailable"?"couldn't read the device settings from the relay \u2014 check your connection":d.outcome==="conflict-exhausted"?"device settings changed elsewhere \u2014 try again":d.error??"couldn't save the main look";return E(m,1)}return $(`${l.device.name}: main look updated`),t&&q({ok:!0,deviceId:l.device.id,main:n}),0}import{spawnSync as Ul}from"node:child_process";import{existsSync as ML}from"node:fs";import HS from"node:path";import{createSocket as eN}from"node:dgram";import{readFile as tN}from"node:fs/promises";import{networkInterfaces as B0}from"node:os";import{execFile as KD}from"node:child_process";import{existsSync as XD}from"node:fs";import{join as YD}from"node:path";import{promisify as QD}from"node:util";var PG=new TextEncoder;var UG=QD(KD);function ph(e={}){let t=e.env??process.env,r=e.exists??(o=>XD(o));for(let o of(t.PATH??"").split(":"))if(o!=="")try{if(r(YD(o,"powershell.exe")))return!0}catch{}return!1}var mh="239.255.90.90",fh=35090,H0=35091;function Z0(e){return!e.internal&&(e.family==="IPv4"||e.family===4)}var vt={createSocket:(e,t)=>eN({type:e,reuseAddr:t?.reuseAddr??!0}),interfaceAddresses:()=>Object.values(B0()).flatMap(e=>e??[]).filter(Z0).map(e=>e.address)};async function Il(e={}){let t=e.timeoutMs??2e3,r=e.sockets??vt,o=await nN(e.readProcVersion??(()=>tN("/proc/version","utf8")),e.env??process.env),[n,i]=await Promise.all([rN(r,t).catch(()=>null),oN(r,t).catch(()=>null)]),s;try{s=(e.interfaces??iN)()}catch{s=void 0}let a={wsl:o,multicastOk:n,broadcastOk:i};s!==void 0&&(a.interfaces=s);try{let l=e.windowsInterop??(()=>ph({env:e.env??process.env}));o&&l()&&(a.interop="windows-arp")}catch{}return a}async function nN(e,t){if(t.WSL_DISTRO_NAME||t.WSL_INTEROP)return!0;try{return/microsoft/i.test(await e())}catch{return!1}}function rN(e,t){return new Promise(r=>{let o=[],n=[],i=!1,s=a=>{if(!i){i=!0;for(let l of n)clearTimeout(l);for(let l of o)try{l.close()}catch{}r(a)}};try{let a=`acbridge-mc-${Math.random().toString(36).slice(2)}`,l=new TextEncoder().encode(a),u=e.createSocket("udp4",{reuseAddr:!0});o.push(u),u.on("error",()=>s(null)),u.on("message",p=>{new TextDecoder().decode(p)===a&&s(!0)}),u.bind(fh,()=>{try{u.addMembership(mh)}catch{s(null);return}let p=e.createSocket("udp4",{reuseAddr:!0});o.push(p),p.on("error",()=>s(null)),p.bind(0,()=>{let d=()=>{try{p.setMulticastLoopback(!0),p.send(l,fh,mh,m=>{m&&s(null)})}catch{s(null)}};d(),n.push(setTimeout(d,Math.max(1,Math.floor(t/2))))}),n.push(setTimeout(()=>s(!1),t))})}catch{s(null)}})}function oN(e,t){return new Promise(r=>{let o,n,i=!1,s=a=>{if(!i){i=!0,n&&clearTimeout(n);try{o?.close()}catch{}r(a)}};try{o=e.createSocket("udp4",{reuseAddr:!0});let a=o;a.on("error",()=>s(null)),a.bind(0,()=>{try{a.setBroadcast(!0),a.send(new TextEncoder().encode("acbridge-env-probe"),H0,"255.255.255.255",l=>{if(!l)return s(!0);let u=l.code;s(u==="EACCES"||u==="ENETUNREACH"||u==="EHOSTUNREACH"?!1:null)})}catch{s(null)}}),n=setTimeout(()=>s(null),t)}catch{s(null)}})}function iN(){return Object.entries(B0()).filter(([,e])=>e?.some(Z0)).map(([e])=>e)}var eL=on(IS(),1);var vW=new TextDecoder;import{createDecipheriv as xW,createHash as tL}from"node:crypto";var SW=tL("md5").update("yGAdlopoPVldABfn").digest(),_W=new TextDecoder;var PW=30*6e4;var rL=new Set(["00:33:7a","10:5a:17","10:d5:61","18:69:d8","18:de:50","1c:90:ff","20:f1:b2","2c:b4:71","30:48:7d","38:1f:8d","38:2c:e5","38:a5:c9","3c:0b:59","4c:a9:19","50:8a:06","50:8b:b9","68:57:2d","70:89:76","7c:f6:66","80:64:7c","84:e3:42","a0:92:08","a8:80:55","b8:06:0d","bc:35:1e","c0:f8:53","c4:82:e1","cc:8c:bf","d0:32:e7","d0:82:e8","d0:82:eb","d4:a6:51","d8:1f:12","d8:c8:0c","d8:d6:68","d8:fc:92","e4:ae:e4","f8:17:2d","fc:3c:d7","fc:67:1f"]),oL={"00:17:88":"Signify (Philips Hue)","c4:29:96":"Signify","fc:26:8c":"Signify","d0:73:d5":"LIFX","50:c7:bf":"TP-Link","1c:3b:f3":"TP-Link","d8:0d:17":"TP-Link","5c:e9:31":"TP-Link","3c:52:a1":"TP-Link","24:0a:c4":"Espressif","24:6f:28":"Espressif","30:ae:a4":"Espressif","5c:cf:7f":"Espressif","ec:fa:bc":"Espressif","a4:cf:12":"Espressif","48:3f:da":"Espressif","70:87:9e":"Beken","80:6d:de":"Beken","c8:47:8c":"Beken",...Object.fromEntries([...rL].map(e=>[e,"Tuya"])),"a8:bb:50":"WiZ","d8:a0:11":"WiZ","44:4f:8e":"WiZ","6c:29:90":"WiZ","94:9f:3e":"Sonos","5c:aa:fd":"Sonos","00:0e:58":"Sonos","fc:65:de":"Amazon","74:c2:46":"Amazon","44:65:0d":"Amazon","0c:47:c9":"Amazon","b8:5f:98":"Amazon","f4:f5:d8":"Google","54:60:09":"Google","1c:f2:9a":"Google","d8:eb:46":"Google","18:b4:30":"Nest Labs","64:16:66":"Nest Labs","d0:52:a8":"SmartThings","24:fd:5b":"SmartThings","28:6d:97":"SAMJIN (SmartThings)","50:14:79":"iRobot","24:9e:7d":"Roborock","b0:4a:39":"Roborock","78:0f:77":"Broadlink","34:ea:34":"Broadlink","2c:aa:8e":"Wyze","44:61:32":"Ecobee","94:10:3e":"Belkin (Wemo)","5c:e7:53":"Govee","d4:13:68":"Govee","e0:2a:25":"Govee","80:8a:f7":"Nanoleaf","f8:24:41":"Yeelight","54:ef:44":"Aqara (Lumi)","18:c2:3c":"Aqara (Lumi)","b0:e9:fe":"SwitchBot","00:1c:2b":"Hive (Centrica)","ec:e5:12":"tado\xB0"};var FW=new TextDecoder;var TS=Buffer.from("020000010000000000000000463cb5d3","hex"),ZW=new TextEncoder,GW=new TextDecoder;var o9=new TextDecoder;var DS="239.255.255.250",zh=1982,NS=["M-SEARCH * HTTP/1.1",`HOST: ${DS}:${zh}`,'MAN: "ssdp:discover"',"ST: wifi_bulb","",""].join(`\r
|
|
267
|
+
`);var l9=new TextDecoder;var w9=new TextDecoder;var LS="239.255.255.250",US=1900,AL=["M-SEARCH * HTTP/1.1",`HOST: ${LS}:${US}`,'MAN: "ssdp:discover"',"MX: 3","ST: ssdp:all","",""].join(`\r
|
|
268
|
+
`),A9=new TextDecoder;var L9=new Uint8Array([0]);import{spawnSync as Fh}from"node:child_process";var Ll=pb("cli");function jS(e){try{let t=Fh(e,{shell:!0,encoding:"utf8",timeout:5e3});return`${t.stdout??""}${t.stderr??""}`}catch{return""}}function zS(e=process.platform){return bb({platform:e,programs:[process.execPath],ruleName:Ll,runCheck:jS,runElevated:t=>{e!=="win32"&&Fh("sudo",["sh","-c",t],{stdio:"inherit"})}})}function FS(e=process.platform){return yb({platform:e,programs:[process.execPath],ruleName:Ll,runCheck:jS,runElevated:t=>{e!=="win32"&&Fh("sudo",["sh","-c",t],{stdio:"inherit"})}})}function MS(e){let t=[],{home:r,credential:o}=e,n=r.source==="peer-wsl"||r.source==="peer-windows";if(r.source==="env")t.push({grade:"info",line:`hub state home: ${r.dir} (BRIDGE_SECRET_DIR override)`});else if(n){let s=r.source==="peer-wsl"?"on Windows":"inside WSL";t.push({grade:"ok",line:`hub state home: ${r.dir} \u2014 the hub runs ${s}, this environment reads its home across the boundary`})}else r.beacon?t.push({grade:"ok",line:`hub state home: ${r.dir} (hub live on port ${r.beacon.port})`}):t.push({grade:"info",line:`hub state home: ${r.dir} \u2014 no hub advertising itself here yet`});o==="rejected"?t.push({grade:"bad",line:"the hub REJECTED this machine's hub-token (401) \u2014 it is stale or belongs to another home. Profiles signals from every session here are being dropped. Restart the bridge (`acbridge stop` then `acbridge start`, or Stop \u2192 Start in the app) to re-mint it."}):o==="absent"&&r.beacon?t.push({grade:"warn",line:`a hub is running (port ${r.beacon.port}) but no readable hub-token was found in ${r.dir} \u2014 sessions here cannot authenticate to it`}):o==="ok"&&t.push({grade:"ok",line:"hub credential accepted (Profiles signals from this environment are authorized)"});let i=e.lastHookError;if(i&&e.nowMs-i.ts<=864e5&&o!=="ok"){let s=Math.max(0,Math.round((e.nowMs-i.ts)/6e4));t.push({grade:"warn",line:`a Profiles signal from this machine was refused ${s}m ago (HTTP ${i.status})${i.hint?` \u2014 ${i.hint}`:""}`})}return t}import{spawnSync as FL}from"node:child_process";function je(e={}){let t=e.env??process.env,r=e.clientVersion!==void 0?e.clientVersion:Ut(t),o=e.bundled??us();return Ms({isDevBuild:r===null&&!o,env:t})}function BS(){return db({voice:je(),runElevated:e=>{e.method==="sudo"&&FL(e.file,e.args,{stdio:"inherit"})}})}function BL(e,t){let r=`codex: ${e??"not found"} \xB7 ${t?"logged in":"not logged in"}`;return{grade:e!==null&&t?"ok":"warn",line:r}}async function HL(){let e=await Il();e.wsl?j("WSL detected \u2014 LAN scan degraded (mDNS/broadcast limited)"):$("host is not WSL \u2014 LAN discovery unrestricted"),e.multicastOk===!0?e.wsl?j("multicast self-test passed locally, but under WSL that only exercises the loopback stack \u2014 LAN mDNS delivery is still limited (rely on the Windows neighbor table below)"):$("multicast self-test passed (this computer's stack \u2014 it does not prove your NETWORK forwards multicast)"):e.multicastOk===!1?j("multicast self-test failed \u2014 mDNS discovery unavailable"):j("multicast self-test could not run (inconclusive)"),e.wsl&&(e.interop==="windows-arp"?$("WSL interop scanning available (powershell.exe \u2014 Windows neighbor table)"):j("WSL interop unavailable (powershell.exe not on PATH) \u2014 ARP discovery sees only the WSL subnet"));let t=await W("/local/discovered");t.hubOffline?j("hub control API unreachable \u2014 scan/connect unavailable (start it: `acbridge start`)"):t.status===200?$(`hub control API reachable (127.0.0.1:${de().hubPort})`):j(`hub control API answered HTTP ${t.status} \u2014 token mismatch? restart the hub`);try{let r=s=>{let a=Ul(s,{shell:!0,encoding:"utf8",timeout:4e3});return`${a.stdout??""}${a.stderr??""}`};if(pr(process.platform,{})==="wsl-host"){b(`firewall: ${Tu}`);return}let o=qs(process.platform,r),n=pr(process.platform,o),i=`${o.ufwStatusOut??""}${o.firewallCmdStateOut??""}${o.alfGlobalStateOut??""}`;if(n==="none")/permission denied|must be root|need to be root/i.test(i)?b("firewall state undetectable without sudo"):$("firewall: no active firewall detected \u2014 scanning unrestricted");else{let s=Ks(n,{programs:[process.execPath],ruleName:Ll});if("state"in s?$("firewall: no active firewall detected \u2014 scanning unrestricted"):s.evalCheck(s.checkCommands.map(r))?$(`firewall: rule present (${n})`):j(`firewall rule missing \u2014 allow it with: ${s.manualCommand} (or use the app's Scan panel to cover the desktop app)`),n==="windows"){let a=hb(r("netsh advfirewall firewall show rule name=all dir=in verbose"),process.execPath),l=vb(gb(r("netsh advfirewall show currentprofile")),a);l&&j(l)}}Iu(gi())==="keyring"?$("integration secrets: OS keyring (encrypted at rest, as this CLI resolves it)"):b("integration secrets: 0600 FILES, not the OS keyring (as this CLI resolves it) \u2014 no session keyring here, which is normal on WSL/headless Linux. The app or hub can resolve differently if it runs in a different session.")}catch{b("firewall state undetectable without sudo")}}async function ZL(){let e=qr({fresh:!0}),t=Y,r="unknown",o=e.beacon?.port??Ay(),n=N(Mv(e.dir));if(!n)r="absent";else try{r=(await fetch(`http://127.0.0.1:${o}/local/devices`,{headers:{"x-bridge-hub-token":n},signal:AbortSignal.timeout(3e3)})).status===401?"rejected":"ok"}catch{r="unknown"}let i=null;try{let s=N(HS.join(t,"launch-last.json"));if(s)try{let l=JSON.parse(s);l.error?b(`last launch: REFUSED (${l.terminalId}, ${l.cwd}) \u2014 ${l.error}`):b(`last launch: ${l.terminalId} \u2192 ${l.file} ${JSON.stringify(l.args??[])}`)}catch{}let a=N(HS.join(t,"hooks-last-error.json"));if(a){let l=JSON.parse(a);typeof l.ts=="number"&&typeof l.status=="number"&&(i={ts:l.ts,status:l.status,...typeof l.hint=="string"?{hint:l.hint}:{}})}}catch{}return{home:e,localDir:t,credential:r,lastHookError:i,nowMs:Date.now()}}async function ZS(e={}){let t=0,r=D=>{t++,x(D)},o=null,n=()=>o??=cn(),i=(e.build??Xn)(),s=e.clientVersion?e.clientVersion():i.version,a=e.fetchManifest??bl,l=D0(s,s===null?null:await a(),process.platform,i.channel??"app");l.grade==="ok"?$(l.line):l.grade==="warn"?j(l.line):l.grade==="bad"?r(l.line):b(l.line);let u=e.voice??je({clientVersion:s}),p=(e.claudeVersion??(()=>GL(n())))(),d=Bs(process.platform).manualCommand;if(p===null)r(`claude CLI not found on PATH \u2014 install it: ${d}`);else{let D=Gb(p);D.ok?$(`claude ${D.version}`):r(`claude ${D.version??"?"} \u2014 channels need \u2265 2.1.80 \u2014 reinstall: ${d}`)}let m=(e.codexVersion??WL)(),f=e.codexLoggedIn??Vs,g=BL(m,f());if(g.grade==="ok"?$(g.line):j(g.line),m!==null){let D=e.readCodexConfig??(()=>N(ra())),B=Uu((e.readCodexHooks??(()=>N(eo())))(),D());B.known&&B.untrusted.length>0&&j(`codex hooks awaiting /hooks approval inside Codex: ${B.untrusted.join(", ")}`);let ke=Mu(D());ke.blocked==="foreign"?j("~/.codex/config.toml defines [mcp_servers.acbridge] outside the AC Bridge block \u2014 remove it, then run `acbridge setup`"):ke.blocked==="malformed"?j("~/.codex/config.toml has a damaged AC Bridge block \u2014 fix or remove the markers, then run `acbridge setup`"):ke.installed?$("codex device tools registered (MCP)"):Fu()&&j("codex device tools not registered \u2014 run `acbridge setup`")}let h=(e.nodeRuntime??(()=>to(no(Y))))();h.kind==="shim"?$(`node runtime: bundled shim (${h.command})`):h.kind==="system"?$(`node v${h.version}`):r("node not found \u2014 install Node \u2265 20 or the AC Bridge app"),(e.pluginInstalled??(()=>VL(n())))()?$(u?"alexa@bridge plugin installed":"alexa@bridge plugin installed (agent state \u2192 device profiles)"):r("alexa@bridge plugin not installed \u2014 run `acbridge setup`");let k=dr(),S=(e.managedSettingsRaw??(()=>N(k)))(),I=Vb(S);u?I.allowed?$("channel allowlisted in managed settings"):I.present?r(`channel not allowlisted in ${k} \u2014 run \`acbridge setup\``):r(`managed settings missing at ${k} \u2014 run \`acbridge setup\``):$("managed settings not used (voice off \u2014 no channel allowlist needed)"),(e.hubBundlePresent??(()=>ML(Ei)))()?$("hub bundle present"):j("hub bundle not built \u2014 run `npm run build` (dev uses tsx)");let C=(e.signedIn??Mt)(),z=C.state==="ok"?C.token:"";C.state==="ok"?$("signed in (relay token present)"):C.state==="mismatch"?r(ot.pointerMismatch):j("not signed in \u2014 run `acbridge login`");let F=(e.onboardingVerified??JL)();if(F!==null?$(`account setup verified (${new Date(F).toISOString().slice(0,10)})`):b("account setup not yet verified here \u2014 start/run check the relay on first use"),z){let B=await(e.fetchEntitlement??Ft)(z);B?b(`plan ${B.plan}; capture telemetry=${B.capture.telemetry} transcripts=${B.capture.transcripts}`):b("entitlement: couldn't read from the relay (offline?)");let ke=(e.entitlementFileAgeH??qL)();ke==="absent"?b("entitlement file absent \u2014 capture off until the hub next syncs"):ke==="unreadable"?j("entitlement file unreadable \u2014 capture off, fail-closed"):ke<=24?$(`entitlement file fresh (${ke.toFixed(1)}h)`):j(`entitlement file STALE (${ke.toFixed(1)}h) \u2014 capture off, fail-closed`)}await(e.hubRunning??Le)()?$("hub running"):b(u?"hub not running (starts automatically on `acbridge run`)":"hub not running (start it: `acbridge start`)");for(let D of MS(await(e.homeFacts??ZL)()))D.grade==="ok"?$(D.line):D.grade==="warn"?j(D.line):D.grade==="bad"?r(D.line):b(D.line);let he=(e.claudeEnvironments??qb)();for(let D of he)D.claudePresent&&(D.pluginInstalled?$(`Claude Code wired for Profiles \u2014 ${D.label}`):j(`Claude Code is installed in ${D.label} WITHOUT the bridge plugin \u2014 sessions there drive no devices. Fix: ${D.setupHint}`));return await(e.discoveryPreflight??HL)(),b(""),t?x(`${t} problem(s) found`):$("all checks passed"),t?1:0}function GL(e){let t=e??cn(),r=Ul(t.file,[...t.argsPrefix,"--version"],{encoding:"utf8"});return r.status===0?r.stdout??"":null}function WL(){let e=Kr(),t=Ul(e.file,[...e.argsPrefix,"--version"],{encoding:"utf8",timeout:5e3});return t.status===0?(t.stdout||t.stderr||"").trim()||"unknown":null}function VL(e){let t=e??cn(),r=Ul(t.file,[...t.argsPrefix,"plugin","list"],{encoding:"utf8"});return Wb(`${r.stdout??""}${r.stderr??""}`).ok}function JL(){let e=De();return e?sa({configFile:e.userConfigFile}).onboardedAt:null}function qL(){let e=De(),t=e?N(e.entitlementFile):null;if(!t)return"absent";try{let r=JSON.parse(t);return(Date.now()-(r.fetchedAt??0))/36e5}catch{return"unreadable"}}import*as GS from"node:https";import{createInterface as WS}from"node:readline/promises";function Ko(){let e=qr({fresh:!0});if(e.source==="peer-wsl"||e.source==="peer-windows"){let o=e.source==="peer-wsl"?"on Windows":"inside WSL";return x(`the bridge is running ${o} (state in ${e.dir}), so an account linked here would be saved where that hub cannot read it. Run \`acbridge link\` from ${o}, or stop that bridge and start one on this side first.`),null}let t=De();if(t)return t;let r=$r();return r.ok?(x(Pe()?"This machine's signed-in account doesn't match its stored account pointer \u2014 run `acbridge logout` then `acbridge login` to reset it.":"Couldn't resolve this machine's signed-in account \u2014 run `acbridge login` again."),null):(x(r.message),null)}var KL=e=>`${e} on the command line is world-readable via \`ps\` and saved in shell history \u2014 prefer \`${e}-file <path>\`, the interactive prompt, or its env var.`;function Nr(e){if(e.file!==void 0){let t=(e.read??N)(e.file);if(t===null)return{ok:!1,message:`Couldn't read ${e.flag}-file ${e.file} \u2014 check the path and its permissions.`};let r=t.trim();return r?{ok:!0,value:r}:{ok:!1,message:`${e.flag}-file ${e.file} is empty \u2014 write the secret into it first.`}}return e.argv!==void 0?((e.warn??j)(KL(e.flag)),{ok:!0,value:e.argv.trim()}):{ok:!0,value:(e.env??"").trim()}}function XL(e){let t={},r=(o,n,i,s)=>o===`--${Mh(n)}`?(t[n]=s[++i],i):(o.startsWith(`--${Mh(n)}=`)&&(t[n]=o.slice(`--${Mh(n)}=`.length)),i);for(let o=0;o<e.length;o++){let n=e[o];if(n)for(let i of["tokenFile","keyFile","secretFile","passwordFile","url","token","units","host","bridgeId","key","clientId","secret","region","email","password","mfa","username","prefix"])o=r(n,i,o,e)}return t}var Mh=e=>e==="bridgeId"?"bridge-id":e==="clientId"?"client-id":e.endsWith("File")?`${e.slice(0,-4)}-file`:e,YL=e=>/^(https?|wss?):\/\/[^\s]+$/i.test(e),VS="Usage: acbridge link home-assistant --url http://homeassistant.local:8123 --token <long-lived-access-token> | --token-file <path> [--units metric|imperial]",JS="Usage: acbridge link hue --host <bridge-ip> [--bridge-id <id>] [--key <existing-app-key> | --key-file <path>]",qS="Usage: acbridge link smartthings (opens a browser sign-in via the relay; tokens seal at the relay)",KS="Usage: acbridge link tuya [--client-id <id>] [--secret <access-secret> | --secret-file <path>] [--region eu|eu-w|us|us-e|cn|in] (eu-w/us-e = the Azure DCs)",XS="Usage: acbridge link meross [--email <you@example.com>] [--password <pw> | --password-file <path>] [--region eu|us|ap] [--mfa <6-digit-2fa-code>]",YS="Usage: acbridge link ewelink [--email <you@example.com>] [--password <pw> | --password-file <path>] [--region eu|us|as|cn]",QS="Usage: acbridge link govee [--key <govee-api-key> | --key-file <path>] (Govee Home app \u2192 profile \u2192 Settings \u2192 Apply for API Key)",e_="Usage: acbridge link mqtt --host <broker-host[:port]> [--username <u>] [--password <p> | --password-file <path>] [--prefix homeassistant]",QL="nanoleaf pairs per-device, not per-account: run `acbridge scan`, then `acbridge connect <device>` and hold the panel's power button.";async function t_(e){let t=e[0],r=XL(e.slice(1));if(t==="smartthings")return iU(e.slice(1));if(t==="tuya")return sU(r);if(t==="meross")return aU(r);if(t==="ewelink")return cU(r);if(t==="govee")return lU(r);let o;if(t==="home-assistant"||t==="homeassistant")o=eU(r);else if(t==="hue")o=await nU(r);else if(t==="mqtt")o=tU(r);else return x(`unsupported provider: ${t??"(none)"}. Supported: home-assistant, hue, smartthings, tuya, meross, ewelink, govee, mqtt`),b(VS),b(JS),b(qS),b(KS),b(XS),b(YS),b(QS),b(e_),b(QL),2;if(!o)return 1;se("Bringing up the integration\u2026");try{let{spawned:n}=await ct({kind:"cli"});n||await y0(),$(`Linked \u2014 your ${o.label} devices should now appear in \`acbridge devices\` and to Claude.`)}catch(n){b(`Recorded. Start the node when ready (\`acbridge daemon\`) to bring it up. (${n.message})`)}return 0}function eU(e){let t=Ko();if(!t)return null;let r=(e.url??"").trim().replace(/\/+$/,""),o=Nr({flag:"--token",argv:e.token,file:e.tokenFile,env:process.env.BRIDGE_HA_TOKEN});if(!o.ok)return x(o.message),null;let n=o.value;if(!YL(r))return x("Missing/invalid --url. Give your Home Assistant base URL, e.g. http://homeassistant.local:8123"),b(VS),null;if(!n)return x("Missing --token (or BRIDGE_HA_TOKEN). Create a Long-Lived Access Token in HA \u2192 your profile \u2192 Security."),null;let i=e.units==="imperial"||e.units==="metric"?e.units:void 0,s=ha("homeassistant",r);ur(t,"homeassistant",s).write(n);let a=zn(t,"homeassistant").filter(l=>l.accountId!==s);return fr(t,"homeassistant",[...a,{accountId:s,baseUrl:r,...i?{unitSystem:i}:{}}]),$(`Linked Home Assistant (${r}). Token stored locally; account ${s}.`),{label:"Home Assistant"}}function tU(e){let t=Ko();if(!t)return null;let r=(e.host??e.url??"").trim(),{host:o,port:n,tls:i}=i0(r);if(!o)return x("Missing --host. Give your broker's address, e.g. --host 192.168.1.5 (or mqtts://broker.lan:8883)."),b(e_),null;let s=(e.username??"").trim(),a=Nr({flag:"--password",argv:e.password,file:e.passwordFile,env:process.env.BRIDGE_MQTT_PASSWORD});if(!a.ok)return x(a.message),null;let l=a.value;if(l&&!s)return x("A password needs a --username too \u2014 MQTT forbids a password with no user, and brokers refuse the connection."),null;let u=(e.prefix??"").trim(),p=`${o}:${n??(i?8883:1883)}`,d=ha("mqtt",p);ur(t,"mqtt",d).write(l);let m=zn(t,"mqtt").filter(f=>f.accountId!==d);return fr(t,"mqtt",[...m,{accountId:d,host:o,...n!==void 0?{port:n}:{},...i?{tls:i}:{},...s?{username:s}:{},...u?{discoveryPrefix:u}:{}}]),$(`Linked MQTT broker ${p}${s?` as ${s}`:" (anonymous)"}. Account ${d}.`),b(`Watching \`${u||"homeassistant"}/#\` for Home Assistant Discovery configs \u2014 Zigbee2MQTT, Tasmota and anything else that publishes them.`),{label:"MQTT"}}async function nU(e){let t=Ko();if(!t)return null;let r=(e.host??"").trim();if(!r)return x("Missing --host. Give your Hue Bridge IP, e.g. --host 192.168.1.42"),b(JS),null;let o=(e.bridgeId??"").trim().toLowerCase(),n=o||void 0,i;if(!o){let d=await uU(r);n=d.bridgeId,o=d.bridgeId??r.toLowerCase(),i=d.name}let s=Nr({flag:"--key",argv:e.key,file:e.keyFile,env:process.env.BRIDGE_HUE_KEY});if(!s.ok)return x(s.message),null;let a=s.value||void 0,l;if(a)l=JSON.stringify({appkey:a.trim()}),b("Using the provided app key (skipping link-button pairing).");else{se("Press the link button on top of your Hue Bridge now \u2014 pairing completes within 30s\u2026"),n||j(`couldn't read this bridge's id from ${r}, so its certificate can't be verified \u2014 pass --bridge-id <id> to pin it.`);try{let d=await dU(r,n);l=JSON.stringify({appkey:d.appkey,...d.clientkey?{clientkey:d.clientkey}:{}})}catch(d){return x(`Hue pairing failed: ${d.message}`),null}}let u=ha("hue",o);ur(t,"hue",u).write(l);let p=zn(t,"hue").filter(d=>d.accountId!==u);return fr(t,"hue",[...p,{accountId:u,host:r,bridgeId:o,...i?{name:i}:{}}]),$(`Linked Philips Hue (${r}, bridge ${o}). Keys stored locally; account ${u}.`),{label:"Philips Hue"}}function rU(e,t,r){if(!r)return!1;let o=n=>n.provider===e&&n.status!=="revoked"&&n.status!=="needs_reauth";return r.some(n=>{if(!o(n))return!1;let i=t?.find(s=>s.provider===e&&(s.accountId===void 0||n.accountId===void 0||s.accountId===n.accountId));return i?i.status!==n.status||i.linkedAt!==n.linkedAt:!0})}async function oU(e,t,r){let o=r.intervalMs??3e3,n=r.sleep??(s=>new Promise(a=>setTimeout(a,s))),i=Date.now()+r.timeoutMs;for(;;){let s=await t();if(rU(e,r.before??null,s))return!0;if(Date.now()+o>i)return!1;await n(o)}}async function iU(e){let t=$r();if(!t.ok)return x(t.message),3;let r=e.includes("--no-browser"),o=e.includes("--no-wait"),n=e.indexOf("--timeout"),i=n!==-1?Number(e[n+1]):180;if(!Number.isFinite(i)||i<=0)return x("--timeout takes a positive number of seconds"),2;se("Starting SmartThings sign-in\u2026");let s=N(Se().accessFile)?.trim(),a=s?await so(s):null,l=await Uy("smartthings");if(!l.ok||!l.authorizeUrl)return x(l.error??"Couldn't start SmartThings linking."),b(qS),1;let u=!1;return r||(u=await oo(l.authorizeUrl,{isWsl:Jr()}).catch(()=>!1)),u?$("Browser opened \u2014 sign in to Samsung and approve access."):($("Open this URL in a browser, sign in to Samsung, and approve access:"),b(l.authorizeUrl)),o?(b("The account links at the relay; the hub picks it up automatically on its next connect (or restart the hub)."),0):(se(`Waiting for the link to complete (up to ${i}s)\u2026`),await oU("smartthings",async()=>{let d=N(Se().accessFile)?.trim();return d?so(d):null},{timeoutMs:i*1e3,before:a})?($("SmartThings linked \u2014 devices appear after the bridge's next relay connect (or restart the bridge)."),0):(x(`SmartThings didn't finish linking within ${i}s \u2014 the URL stays valid, approve it and check \`acbridge integrations\`:`),b(l.authorizeUrl),1))}async function sU(e){let t=await Ir();if(!t.ok)return x(t.message),3;b("Tuya key wizard \u2014 one-time setup to control Smart Life / Tuya devices locally:"),b(" 1. Create a free account + Cloud Project at iot.tuya.com (data-center region MUST match your Smart Life app \u2014 UK/EU \u2192 Central Europe)."),b(" 2. Subscribe IoT Core (+ Authorization) to the project, then 'Link Tuya App Account' by scanning the QR from the Smart Life app."),b(" 3. Copy the project's Access ID (client id) + Access Secret below."),b(" Note: the IoT Core trial runs ~1 month (console \u2192 Cloud \u2192 My Services \u2192 'Extend Trial Period'). After it expires your"),b(" already-connected lamps keep working locally \u2014 only fetching NEW keys stops. Re-pairing a device rotates its key \u2192 re-run this.");let r=(e.clientId??process.env.BRIDGE_TUYA_CLIENT_ID??await qo("Access ID (client id): ")).trim(),o=Nr({flag:"--secret",argv:e.secret,file:e.secretFile,env:process.env.BRIDGE_TUYA_SECRET});if(!o.ok)return x(o.message),2;let n=(o.value||await jl("Access Secret: ")).trim(),i=((e.region??process.env.BRIDGE_TUYA_REGION??await qo("Region [eu]: "))||"eu").trim().toLowerCase();if(!r||!n)return x("Both the Access ID and Access Secret are required."),b(KS),1;if(!["eu","eu-w","us","us-e","cn","in"].includes(i))return x(`Unknown region "${i}" \u2014 use eu, eu-w, us, us-e, cn, or in.`),1;se("Making sure the hub is running\u2026");try{await ct({kind:"cli"})}catch(a){return x(`The hub isn't running and couldn't be started: ${a.message}. Start it with \`acbridge daemon\` and retry.`),1}se("Fetching your device keys from Tuya (this can take a few seconds)\u2026");let s=await W("/local/tuya/link",{method:"POST",body:{clientId:r,clientSecret:n,region:i},timeoutMs:9e4});if(s.hubOffline)return x("The hub went offline. Start it with `acbridge daemon` and retry."),1;if(s.status===200&&s.body?.ok){let a=s.body.deviceCount??0,l=s.body.sleepyCount??0;return $(`Imported keys for ${a} Tuya device${a===1?"":"s"}. Keys are stored only on this PC (never on your network or the cloud).`),l>0&&b(`${l} battery/sensor device${l===1?"":"s"} (e.g. a PIR) won't control locally yet \u2014 those come in a later update.`),b('Now run `acbridge scan` \u2014 your lamps should appear under "Ready to connect". Connect each, then control them by voice or `acbridge devices`.'),0}return x(s.body?.error??`The hub couldn't complete the wizard (HTTP ${s.status??"?"}).`),1}async function aU(e){let t=await Ir();if(!t.ok)return x(t.message),3;b("Meross account wizard \u2014 a one-time sign-in so the hub can control your Meross devices locally:"),b(" Your Meross email + password are sent ONCE to Meross to fetch the account key that signs local"),b(" requests. The key is stored only on this PC \u2014 never on your network, the cloud, or our relay.");let r=Nr({flag:"--password",argv:e.password,file:e.passwordFile,env:process.env.BRIDGE_MEROSS_PASSWORD});if(!r.ok)return x(r.message),2;let o=(e.email??process.env.BRIDGE_MEROSS_EMAIL??await qo("Meross email: ")).trim(),n=r.value||await jl("Password: "),i=((e.region??process.env.BRIDGE_MEROSS_REGION??await qo("Region [eu]: "))||"eu").trim().toLowerCase();if(!o||!n)return x("Both the email and password are required."),b(XS),1;if(!["eu","us","ap"].includes(i))return x(`Unknown region "${i}" \u2014 use eu, us, or ap.`),1;let s=(e.mfa??process.env.BRIDGE_MEROSS_MFA)?.trim()||void 0;se("Making sure the hub is running\u2026");try{await ct({kind:"cli"})}catch(l){return x(`The hub isn't running and couldn't be started: ${l.message}. Start it with \`acbridge daemon\` and retry.`),1}se("Signing in to Meross\u2026");let a=await W("/local/meross/link",{method:"POST",body:{email:o,password:n,region:i,...s?{mfaCode:s}:{}},timeoutMs:6e4});if(a.hubOffline)return x("The hub went offline. Start it with `acbridge daemon` and retry."),1;if(a.status===200&&a.body?.ok){let l=a.body.deviceCount??0;return $(`Signed in. The account key is stored only on this PC.${l?` (${l} device${l===1?"":"s"} on the account.)`:""}`),b('Now run `acbridge scan` \u2014 your Meross plugs/bulbs should appear under "Ready to connect". Connect each, then control them by voice or `acbridge devices`.'),0}return x(a.body?.error??`The hub couldn't complete the sign-in (HTTP ${a.status??"?"}).`),1}async function cU(e){let t=await Ir();if(!t.ok)return x(t.message),3;b("SONOFF / eWeLink account wizard \u2014 a one-time sign-in so the hub can control your SONOFF devices locally:"),b(" Your eWeLink email + password are sent ONCE to eWeLink to fetch each device's LAN key. The keys"),b(" are stored only on this PC \u2014 never on your network, the cloud, or our relay.");let r=Nr({flag:"--password",argv:e.password,file:e.passwordFile,env:process.env.BRIDGE_EWELINK_PASSWORD});if(!r.ok)return x(r.message),2;let o=(e.email??process.env.BRIDGE_EWELINK_EMAIL??await qo("eWeLink email: ")).trim(),n=r.value||await jl("Password: "),i=((e.region??process.env.BRIDGE_EWELINK_REGION??await qo("Region [eu]: "))||"eu").trim().toLowerCase();if(!o||!n)return x("Both the email and password are required."),b(YS),1;if(!["eu","us","as","cn"].includes(i))return x(`Unknown region "${i}" \u2014 use eu, us, as, or cn.`),1;se("Making sure the hub is running\u2026");try{await ct({kind:"cli"})}catch(a){return x(`The hub isn't running and couldn't be started: ${a.message}. Start it with \`acbridge daemon\` and retry.`),1}se("Signing in to eWeLink\u2026");let s=await W("/local/ewelink/link",{method:"POST",body:{email:o,password:n,region:i},timeoutMs:6e4});if(s.hubOffline)return x("The hub went offline. Start it with `acbridge daemon` and retry."),1;if(s.status===200&&s.body?.ok){let a=s.body.deviceCount??0;return $(`Signed in. ${a} device key${a===1?"":"s"} stored \u2014 only on this PC.`),b('Now run `acbridge scan` \u2014 your SONOFF switches/plugs should appear under "Ready to connect". Connect each, then control them by voice or `acbridge devices`.'),0}return x(s.body?.error??`The hub couldn't complete the sign-in (HTTP ${s.status??"?"}).`),1}async function lU(e){let t=await Ir();if(!t.ok)return x(t.message),3;b("Govee key wizard \u2014 one self-service API key imports your Govee devices:"),b(" Govee Home app \u2192 profile \u2192 Settings \u2192 Apply for API Key (it arrives by email within minutes).");let r=Nr({flag:"--key",argv:e.key,file:e.keyFile,env:process.env.BRIDGE_GOVEE_KEY});if(!r.ok)return x(r.message),2;let o=(r.value||await jl("Govee API key: ")).trim();if(!o)return x("An API key is required."),b(QS),2;se("Making sure the hub is running\u2026");try{await ct({kind:"cli"})}catch(i){return x(`The hub isn't running and couldn't be started: ${i.message}. Start it with \`acbridge daemon\` and retry.`),1}se("Importing your Govee devices\u2026");let n=await W("/local/govee/link",{method:"POST",body:{apiKey:o},timeoutMs:6e4});if(n.hubOffline)return x("The hub went offline. Start it with `acbridge daemon` and retry."),1;if(n.status===200&&n.body?.ok){let i=n.body.deviceCount??0;return $(`Imported ${i} Govee device${i===1?"":"s"}. The key is stored only on this PC.`),b('Now run `acbridge scan` \u2014 your Govee lights should appear under "Ready to connect". Connect each, then control them by voice or `acbridge devices`.'),0}return x(n.body?.error??`The hub couldn't complete the wizard (HTTP ${n.status??"?"}).`),1}async function qo(e){let t=WS({input:process.stdin,output:process.stdout});try{return await t.question(e)}finally{t.close()}}async function jl(e){let t=process.stdout,r=WS({input:process.stdin,output:t}),o=r,n=o._writeToOutput?.bind(r);o._writeToOutput=i=>{(i.includes(e)||i===`\r
|
|
260
269
|
`||i===`
|
|
261
270
|
`)&&n?.(i)};try{let i=await r.question(e);return t.write(`
|
|
262
|
-
`),i}finally{r.close()}}function
|
|
263
|
-
`);async function
|
|
264
|
-
--if-needed skip the sign-in when this machine already holds a usable credential (default: always sign in)`,HS=["google","github","microsoft","email","sso"];function ZL(e){let t={provider:"email",noBrowser:!1,timeoutMs:18e4,json:!1,ifNeeded:!1,chooser:!0};for(let r=0;r<e.length;r++){let o=e[r];if(o==="--if-needed")t.ifNeeded=!0;else if(o==="--no-browser")t.noBrowser=!0;else if(o==="--json")t.json=!0;else if(o==="--provider"){let n=e[++r];HS.includes(n)?(t.provider=n,t.chooser=!1):t.bad=`invalid --provider: ${n??"(none)"} (use ${HS.join(" | ")})`}else if(o==="--email")t.email=e[++r],t.chooser=!1;else if(o==="--timeout"){let n=Number(e[++r]);Number.isFinite(n)?t.timeoutMs=Math.min(600,Math.max(30,Math.round(n)))*1e3:t.bad=`invalid --timeout: ${e[r]??"(none)"}`}else t.bad=`unknown option: ${o??""}`}return t}function GS(e={}){let t=e.readCredentialSub??ll,r=e.writePointer??(n=>dr({sub:n})),o=e.log??z;try{let n=t();n&&r(n)}catch(n){o(`couldn't update the active-user pointer (non-fatal): ${n instanceof Error?n.message:String(n)}`)}}function GL(e={}){(e.readActiveUser??(()=>Ce()))()||(e.heal??GS)()}function WL(e={}){let t=(e.scan??ft)();return(e.warnAmbiguous??(o=>St(o)))(t),(e.resolveScope??(()=>gt()))()?{kind:"signed-in"}:(e.readPointer??(()=>Ce()))()?{kind:"refuse",message:ot.pointerMismatch}:t.length===1&&ma(t[0],e.segmentOf)?{kind:"heal",sub:t[0].sub}:{kind:"refuse",message:ot.logoutFirst("log in")}}function VL(e){return e.hasCredential?e.refreshed?{kind:"already"}:{kind:"stale-sign-in"}:{kind:"sign-in"}}async function ZS(e,t,r={}){let o=(r.readToken??(()=>N(we().accessFile)?.trim()??""))();if(o){let n=await(r.sync??ml)(e,o);await(r.claim??BS)(e,o,{current:n})==="claimed"&&v("Account setup completed from this machine \u2014 `acbridge start` will run here now.")}return $(t.successLine),(r.report??(n=>Tl(n?["--json"]:[])))(t.json)}async function WS(e=[]){let t=ZL(e);if(t.bad)return x(t.bad),v(HL),2;t.json&&be(!0);let r=de().relayUrl;if(t.ifNeeded&&ra()){if(on()>=sn){let n=WL();if(n.kind==="refuse")return x(n.message),3;n.kind==="heal"&&dr({sub:n.sub})}else GL();if(VL({hasCredential:!0,refreshed:await Ut(r)}).kind==="already")return ZS(r,{json:t.json,successLine:"already signed in on this machine"});z("this machine's stored sign-in is no longer valid \u2014 signing in again")}{let o=Fy(),n=Gr();try{t.noBrowser||se("opening your browser to sign in\u2026");let i=await Xy({cfg:o,opts:{provider:t.provider,...t.email?{email:t.email}:{}},chooser:t.chooser,timeoutMs:t.timeoutMs,openUrl:t.noBrowser?async()=>!1:a=>eo(a,{isWsl:n}),onBrowserFail:a=>{v(t.noBrowser?"Open this URL to sign in:":"Couldn't open a browser \u2014 open this URL to sign in:"),v(a)}});if(se("pairing this machine\u2026"),!await Ky(r,()=>i.accessToken))return x("Signed in, but couldn't pair this machine with the relay \u2014 check your connection and retry."),1}catch(i){return x(Zy(i)),3}}return GS(),ZS(r,{json:t.json,successLine:"Signed in. This machine now holds its own relay credential and refreshes itself."})}function qL(e){let t=e.reverted+e.failed+e.skipped;if(t===0)return"no devices needed reverting";let r=[`reverted ${e.reverted} of ${t} device${t===1?"":"s"}`];return e.failed&&r.push(`${e.failed} failed`),e.skipped&&r.push(`${e.skipped} skipped`),r.join(", ")}async function Qn(e=[]){let t=e.includes("--json");t&&be(!0);let r,o=d=>{t&&K({stopped:d,...r?{revert:r}:{}})},n=await q("/local/session/stop",{method:"POST",body:{},timeoutMs:2e4});!n.hubOffline&&n.status===200&&n.body?.summary&&(r=n.body.summary,$(`lights: ${qL(r)}`));let i=await Yw(),s=N(Qe);if(i)return s&&ve(Qe),$("hub stopping \u2014 devices reverting, holders releasing"),o(!0),0;cb("stop-requested");let a=s?Number(s):0,l=a>0&&jo({pid:a}),u=await Ne();if(!l&&!u)return s&&ve(Qe),$("bridge already stopped"),o(!1),0;if(l)try{process.kill(a)}catch{}return s&&ve(Qe),Jw(),await Ne()?(x("the hub is still running and didn't answer the shutdown \u2014 check ~/.claude-bridge/hub.log"),1):($("hub stopped"),o(!0),0)}var JL="Usage: acbridge logout [--json]",KL=new Set(["--json"]);async function Rl(e=[],t={}){let r=e.filter(h=>!KL.has(h));if(r.length>0)return x(`unknown option: ${r[0]}`),v(JL),2;let o=e.includes("--json");o&&be(!0);let n=t.read??N,i=t.stopBridge??Qn,s=t.revoke??((h,y,k)=>Jy(h,y,{clear:k})),a=t.clearTokens??pi,l=t.keyring??mi(),u=h=>(t.clearDeviceCredentials??au)(h,l),d=t.clearLogs??(()=>{Lu(wt),Lu(Ln)}),p=t.clearPointer??Yy,m=t.relayUrl??de().relayUrl,f=[],g=(t.scan??ft)();g.length>=2&&(t.warnAmbiguous??(h=>St(h)))(g);for(let{segment:h}of g){let y=xt(h),k=n(y.accessFile)?.trim()??n(y.refreshFile)?.trim()??null;f.push({segment:h,paths:y,bearer:k})}if(f.length===0)return $("already signed out"),o&&K({signedOut:!0,alreadySignedOut:!0}),0;se("stopping the bridge\u2026"),await i([]);for(let{segment:h,paths:y,bearer:k}of f)se("revoking this machine's credential\u2026"),await s(m,k,()=>a(y)),u(h);return d(),p(),$("signed out \u2014 this machine no longer holds a credential."),o&&K({signedOut:!0,alreadySignedOut:!1}),0}var XL=c.object({deviceId:c.string(),capability:At,instance:c.string().optional(),command:c.string(),params:c.unknown().optional()}),YL=c.object({deviceId:c.string(),instance:c.string().optional(),look:Yc.optional(),effect:wr.optional(),returnTo:Xc.optional(),hold:c.boolean().default(!1)}),QL=c.object({enabled:c.boolean().default(!0),actions:c.array(XL).default([]),looks:c.array(YL).default([]),allowSecurity:c.boolean().default(!1),threshold:c.number().min(0).max(100).optional(),modelMatch:c.object({models:c.array(c.string()).min(1),direction:c.enum(["becomes","leaves"]).default("becomes")}).optional()}),er={contextLow:{kind:"percent",default:75,min:50,max:95,step:1,hysteresis:10,unitLabel:"% context"},contextCritical:{kind:"percent",default:90,min:60,max:99,step:1,hysteresis:10,unitLabel:"% context"},usageHigh:{kind:"percent",default:80,min:50,max:95,step:1,hysteresis:10,unitLabel:"% usage"},costHigh:{kind:"dollars",default:5,min:.5,max:50,step:.5,hysteresis:0,unitLabel:"$ spent"},longRunning:{kind:"minutes",default:10,min:1,max:60,step:1,hysteresis:0,unitLabel:"min working"}},VS=Object.fromEntries(Object.entries(er).map(([e,t])=>[e,t.default])),eU=c.object({proactive:c.boolean().default(!0),doNotDisturb:c.boolean().default(!1),announce:c.record(c.string(),c.boolean()).default({})}),tU=c.object({enabled:c.boolean().default(!1),start:c.string().regex(/^\d{2}:\d{2}$/).default("22:00"),end:c.string().regex(/^\d{2}:\d{2}$/).default("07:00"),tz:c.string().optional()}),Qt=c.object({id:c.string(),name:c.string().default(""),icon:c.string().default("spark"),gradient:c.tuple([c.string(),c.string(),c.string()]).optional(),deviceScope:c.array(c.string()).default([]),palette:c.array(at).default([]),states:c.record(c.string(),QL).default({}),notifications:eU.default({proactive:!0,doNotDisturb:!1,announce:{}}),quietHours:tU.default({enabled:!1,start:"22:00",end:"07:00"}),updatedAt:c.number().optional(),agent:hn.optional()}),Ol=c.object({profiles:c.array(Qt).default([]),bindings:c.record(c.string(),c.string()).default({}),codexBindings:c.record(c.string(),c.string()).default({})});var nU={started:"Claude started a session",working:"Claude is working",needs_permission:"Claude needs permission",needsInput:"Claude has a question for you",planReady:"Claude's plan is ready for approval",idle:"Claude is waiting for you",finished:"Claude finished",contextLow:"Claude is at {pct} percent context",contextCritical:"Claude's context is nearly full \u2014 {pct} percent",rateLimited:"You've hit your Claude usage limit",error:"Claude hit an error",ended:"Claude session ended",resumed:"Claude session resumed",subagentStart:"Claude started a subagent",subagentFinished:"A Claude subagent finished",compacting:"Claude is compacting its context",compactDone:"Claude finished compacting",permissionDenied:"A Claude tool call was blocked",taskCompleted:"A background Claude task finished",usageHigh:"Claude usage is at {pct} percent of the {window} window",modePlan:"Claude entered plan mode",modeAuto:"Claude is auto accepting edits",modeBypass:"Claude is bypassing permission checks",modeNormal:"Claude is back to normal permission checks",modelChanged:"Claude switched to {model}",workflowStarted:"Claude launched a workflow",reviewChanged:"The pull request review changed to {review}",costHigh:"This session has cost {cost} dollars",longRunning:"Claude has been working {mins} minutes"},Th=["started","resumed","working","finished","needs_permission","compacting","compactDone","subagentStart","subagentFinished","contextLow","contextCritical","modePlan","modeAuto","modeBypass","modeNormal","modelChanged","error","idle","ended","permissionDenied","planReady","rateLimited","sandboxEscalation","longRunning"],rU=["sandboxEscalation"];function Dl(e,t){return e==="codex"?Th.includes(t):!rU.includes(t)}var oU={started:"Codex started a session",resumed:"Codex session resumed",working:"Codex is working",finished:"Codex finished",needs_permission:"Codex needs permission",compacting:"Codex is compacting its context",compactDone:"Codex finished compacting",subagentStart:"Codex started a subagent",subagentFinished:"A Codex subagent finished",contextLow:"Codex is at {pct} percent context",contextCritical:"Codex's context is nearly full \u2014 {pct} percent",modePlan:"Codex entered plan mode",modeAuto:"Codex is auto accepting edits",modeBypass:"Codex is bypassing permission checks",modeNormal:"Codex is back to normal permission checks",modelChanged:"Codex switched to {model}",error:"Codex hit an error",idle:"Codex is waiting",ended:"Codex session ended",permissionDenied:"A Codex action was declined",planReady:"Codex has a plan ready for approval",rateLimited:"Codex hit its usage limit",sandboxEscalation:"Codex wants to leave its sandbox",longRunning:"Codex has been working {mins} minutes"};function iU(e,t){return e==="codex"?oU[t]:nU[t]}var sU="codex::";function aU(e,t){return e==="codex"?`${sU}${t}`:t}function Rh(e){return typeof e?.id=="string"&&e.id.startsWith("prof:")}function cU(e,t){return!(!is[e.capability]?.some(o=>o.command===e.command)||t&&!t.devices.some(o=>o.id===e.deviceId))}var lU=new Set(["color","colorTemperature","brightness"]);function qS(e,t,r){let o=r?.voice??!1,n=Ol.safeParse({profiles:e?.profiles,bindings:e?.bindings,codexBindings:e?.codexBindings}),i=[],s={},a={},l={};if(Array.isArray(e?.rules))for(let u of e.rules){let d=_w.safeParse(u);d.success&&!Rh(d.data)&&i.push(d.data)}if(n.success){let u=new Map(n.data.profiles.map(p=>[p.id,p])),d=[["claude",n.data.bindings],["codex",n.data.codexBindings]];for(let[p,m]of d)for(let[f,g]of Object.entries(m)){let h=u.get(g);if(!h)continue;let y=aU(p,f);s[y]={proactive:h.notifications.proactive,doNotDisturb:h.notifications.doNotDisturb,quietHours:h.quietHours};for(let[k,_]of Object.entries(h.states)){if(!_.enabled)continue;let I=ss.safeParse(k);if(!I.success)continue;let S=I.data;S in VS&&((a[y]??={})[S]=_.threshold??VS[S]),S==="modelChanged"&&_.modelMatch&&(l[y]={models:_.modelMatch.models,direction:_.modelMatch.direction});let T=_.actions.filter(X=>h.deviceScope.includes(X.deviceId)&&cU(X,t)),j=new Set(T.filter(X=>X.capability==="power").map(X=>X.deviceId)),fe=[...[...new Set(T.filter(X=>lU.has(X.capability)&&!j.has(X.deviceId)).map(X=>X.deviceId))].map(X=>({kind:"device",deviceId:X,capability:"power",command:"turnOn",params:{}})),...T.map(X=>({kind:"device",deviceId:X.deviceId,capability:X.capability,...X.instance?{instance:X.instance}:{},command:X.command,params:X.params}))],D=iU(p,S),Z=o&&h.notifications.announce[S]&&D?[{kind:"notify",title:h.name||"AC Bridge",body:D}]:[],Ee=_.looks.filter(X=>h.deviceScope.includes(X.deviceId)).map(X=>({kind:"intent",deviceId:X.deviceId,...X.instance?{instance:X.instance}:{},...X.look?{look:X.look}:{},...X.effect?{effect:X.effect}:{},...X.returnTo?{returnTo:X.returnTo}:{},hold:X.hold})),_e=[...fe,...Ee,...Z];if(_e.length===0)continue;let Nt=p==="codex"?`prof:codex:${h.id}:${f}:${S}`:`prof:${h.id}:${f}:${S}`;i.push({id:Nt,name:h.name?`${h.name} \xB7 ${S}`:S,enabled:!0,trigger:{kind:"session",event:S,repo:f,agent:p},conditions:[],actions:_e,allowSecurity:_.allowSecurity})}}}return{rules:i,notifyPolicy:s,thresholds:a,modelMatch:l}}var Oh="this account's profiles document is unreadable by this version \u2014 update AC Bridge (nothing was written)";function Dh(e){return e.profiles!==void 0||e.bindings!==void 0||e.codexBindings!==void 0?Ol.safeParse({profiles:e.profiles,bindings:e.bindings,codexBindings:e.codexBindings}).success?"ok":"malformed":"empty"}function Ot(e){let t=Ol.safeParse({profiles:e.profiles,bindings:e.bindings,codexBindings:e.codexBindings});return t.success?t.data:{profiles:[],bindings:{},codexBindings:{}}}function Nh(){return`prof_${Date.now().toString(36)}${Math.random().toString(36).slice(2,6)}`}function JS(e="New profile",t){return Qt.parse({id:Nh(),name:e,...t==="codex"?{agent:"codex"}:{}})}function Lh(e){return e==="codex"?"codexBindings":"bindings"}function Uh(e,t,r,o){let n=Lh(o),i={...e[n]};return r?i[t]=r:delete i[t],{...e,[n]:i}}function KS(e,t,r){if(Dh(e)==="malformed")throw new Error(Oh);let o=Array.isArray(e.rules)?e.rules.filter(i=>!Rh(i)):[],{rules:n}=qS({profiles:t.profiles,bindings:t.bindings,codexBindings:t.codexBindings,rules:o},void 0,{voice:r});return{...e,profiles:t.profiles,bindings:t.bindings,codexBindings:t.codexBindings,rules:n}}function hs(e){let t=er[e];return{defaultPct:t.default,min:t.min,max:t.max,unitLabel:t.unitLabel,step:t.step}}var XS=[{event:"started",label:"Started",hint:"A Claude session opens in this repo (SessionStart) \u2014 cold start or /clear, not a resume.",tooltip:"Fires the moment a Claude session starts in a repo bound to this profile \u2014 a cold start or after /clear. A resume fires Resumed instead, and an auto-compaction restart fires neither."},{event:"working",label:"Working",hint:"You send a prompt and Claude starts working (UserPromptSubmit) \u2014 also fires when it resumes after a question or plan approval.",tooltip:"Fires when you send Claude a prompt and it starts working \u2014 and again the moment it resumes after you answer a question or approve a plan."},{event:"needs_permission",label:"Needs permission",hint:"Claude paused to ask permission for a tool (permission notification) \u2014 waiting on your yes/no.",tooltip:"Claude paused mid-task to ask permission to run a tool and is waiting on your yes or no."},{event:"needsInput",label:"Needs input",hint:"Claude asked you a question (AskUserQuestion) and is waiting on your answer.",tooltip:"Claude asked you a question and is waiting on your answer (also fires when a background agent needs input)."},{event:"planReady",label:"Plan ready",hint:"Claude presented a plan for approval (ExitPlanMode) \u2014 nothing runs until you decide.",tooltip:"Claude finished planning and is waiting for you to review and approve the plan before it touches anything."},{event:"idle",label:"Idle",hint:"Claude has been left waiting on you for about a minute (idle notification) \u2014 the 'your turn' nudge.",tooltip:"Claude has been left waiting on you with nothing to do for about a minute \u2014 the 'your turn' nudge."},{event:"finished",label:"Finished",hint:"Claude ends a turn (Stop hook) \u2014 fires every time it stops replying. The common one.",tooltip:"Claude ends a turn \u2014 the instant it stops replying. Fires at the end of every response; the everyday 'done' signal."},{event:"contextLow",label:"Context low",hint:"Context use crossed your threshold below (default 75%) \u2014 read from the live session.",tooltip:"Claude's context window filled past your chosen percentage \u2014 set the slider below. Your early warning to wrap up, hand off, or /compact.",threshold:hs("contextLow")},{event:"contextCritical",label:"Context critical",hint:"Context nearly full \u2014 your second, higher threshold (default 90%). Auto-compact is imminent.",tooltip:"Context is nearly full \u2014 past your higher threshold. Auto-compact typically kicks in around 85\u201390%, so this is last-call.",threshold:hs("contextCritical")},{event:"rateLimited",label:"Rate limited",hint:"Claude hit a usage limit (rate-limit warning, or a turn died on one).",tooltip:"You hit \u2014 or are about to hit \u2014 your Claude plan's usage limit (the 5-hour or weekly window) and Claude may stop replying."},{event:"error",label:"Error",hint:"A turn or tool failed (StopFailure, a tool failure, or an MCP server error).",tooltip:"Something failed \u2014 an API error ended the turn, a tool call failed, or an MCP server dropped. Rate-limit failures fire Rate limited instead."},{event:"ended",label:"Ended",hint:"The session closed (SessionEnd) \u2014 Claude is no longer running in this repo.",tooltip:"The session closed \u2014 Claude is no longer running in this repo. Profile scenes revert."}],YS=[{event:"resumed",label:"Resumed",hint:"A previous session picks up where it left off (SessionStart on resume).",tooltip:"A previous session picks up where it left off (--resume / reopening a conversation)."},{event:"subagentStart",label:"Subagent started",hint:"Claude spawned a subagent for a subtask (SubagentStart).",tooltip:"Claude spawned a subagent to work on a subtask in the background."},{event:"subagentFinished",label:"Subagent finished",hint:"A spawned subagent finished (SubagentStop).",tooltip:"A spawned subagent finished its subtask and reported back."},{event:"compacting",label:"Compacting",hint:"Claude is about to compact its context (PreCompact) \u2014 manual /compact or automatic when nearly full.",tooltip:"Claude is about to compact its context to free room \u2014 manual /compact or automatic when nearly full."},{event:"compactDone",label:"Compaction done",hint:"Compaction finished (PostCompact) \u2014 context freed.",tooltip:"Compaction finished \u2014 context freed. The context meters (and Context low/critical) re-arm."},{event:"permissionDenied",label:"Permission denied",hint:"A tool call was auto-blocked by permission rules (PermissionDenied) \u2014 without asking you.",tooltip:"A tool call was auto-blocked by permission rules without asking you \u2014 worth a glance at what was refused."},{event:"taskCompleted",label:"Task completed",hint:"A background task or agent finished (TaskCompleted) while the session kept going.",tooltip:"A background task or agent finished while the main session kept going."},{event:"usageHigh",label:"Usage high",hint:"Plan usage crossed your threshold below (default 80%) \u2014 fed by the statusline feed (5-hour/7-day window).",tooltip:"Your Claude plan usage crossed your chosen percentage of the 5-hour or weekly window \u2014 pace yourself before the hard limit. Needs the AC Bridge statusline tee (installed by acbridge).",threshold:hs("usageHigh")},{event:"modePlan",label:"Plan mode",hint:"The session switched INTO plan mode (shift+tab) \u2014 read from the session transcript.",tooltip:"You switched the session into plan mode \u2014 Claude researches and proposes before touching anything. Fires on the switch itself; Plan ready fires later, when a finished plan awaits your approval. A session that OPENS in plan mode stays quiet until the mode actually moves."},{event:"modeAuto",label:"Auto-accept mode",hint:"The session switched into auto-accept \u2014 edits apply without per-action confirmation.",tooltip:"You switched into auto-accept mode \u2014 edits and tool calls apply without per-action confirmation. Fires once on the switch, not per edit."},{event:"modeBypass",label:"Bypass permissions",hint:"The session entered bypass-permissions mode \u2014 ALL permission checks are skipped.",tooltip:"The session entered bypass-permissions mode: every permission check is skipped until you leave it. The riskiest mode \u2014 a bright warning scene is a good fit."},{event:"modeNormal",label:"Normal mode",hint:"The session returned to default permission checks (from plan, auto-accept, or bypass).",tooltip:"The session returned to normal permission checks \u2014 the exit edge of the other mode states, handy for restoring your regular working scene."},{event:"modelChanged",label:"Model changed",hint:"The session's model switched mid-run (/model, fast mode) \u2014 the announcement names the new model.",tooltip:`The session's model changed mid-run \u2014 /model, a fast-mode toggle, or an opusplan hand-off. The spoken announcement names the new model ("Claude switched to Opus 4.8").`,modelMatch:!0},{event:"workflowStarted",label:"Workflow started",hint:"Claude kicked off a multi-agent workflow (Workflow tool) \u2014 expect a subagent burst.",tooltip:"Claude launched a multi-agent workflow. Expect a burst of Subagent started/finished signals until it completes \u2014 the completion itself lands as Task completed."},{event:"reviewChanged",label:"Review changed",hint:"Your PR's review state changed (approved / changes requested) \u2014 read from the statusline's pr.review_state field.",tooltip:"The statusline tee reports your pull request's review state, and this fires the moment it changes \u2014 approved, changes requested, or back to pending \u2014 so a CI-review scene can react the instant someone reviews your PR. Needs the AC Bridge statusline tee and an open PR with review data (installed by acbridge). Claude's own exclusive state \u2014 Codex has no equivalent."},{event:"costHigh",label:"Cost alarm",hint:"This session's estimated spend crossed your dollar threshold (default $5) \u2014 from the statusline cost feed.",tooltip:"Fires once when Claude's estimated session cost passes the dollar amount you set below. Needs the AC Bridge statusline tee (installed by acbridge); Codex sessions have no dollar cost, so this is Claude-only.",threshold:hs("costHigh")},{event:"longRunning",label:"Long run",hint:"The session has been working non-stop past your minutes threshold (default 10) \u2014 a hub timer.",tooltip:"Fires when a session stays in 'working' longer than the minutes you set below without pausing for you \u2014 a 'did it get stuck / long task still going' watchdog. Re-arms on the next turn. Works for Claude and Codex.",threshold:hs("longRunning")}],QS={started:{hint:"Codex opens a fresh rollout in this repo \u2014 a true cold start, not reopening an earlier conversation.",tooltip:"A new Codex session spins up against a repo bound to this profile, beginning an empty rollout. Reopening a prior conversation routes to Resumed instead, so this card only marks genuine first starts."},resumed:{hint:"A previous Codex conversation picks up where it left off.",tooltip:"A previous Codex conversation resumes \u2014 Codex reloads its prior rollout and continues from where it stopped."},working:{hint:"A turn begins on Codex's UserPromptSubmit hook \u2014 your prompt is in and work has started.",tooltip:"Codex's UserPromptSubmit hook trips as each turn opens: the moment your prompt is submitted. This is the 'now busy' edge."},finished:{hint:"Codex's Stop hook lands at the end of every reply \u2014 turn done, not the session closing.",tooltip:"Codex fires its Stop hook when a turn wraps, once per reply. It marks end-of-turn rather than a closed session, so expect it after every answer \u2014 the routine 'ready for you' beat."},needs_permission:{hint:"Codex paused to ask approval for a command \u2014 waiting on your yes/no.",tooltip:"Codex paused mid-task to ask for your approval to run a command and is waiting on your decision. Sandbox and network escalation requests fire the separate 'Sandbox escalation' state instead \u2014 bind that too if you want one scene for every approval."},compacting:{hint:"Codex is about to compact its context to free room.",tooltip:"Codex is about to compact its context \u2014 manual or automatic once its context window is nearly full."},compactDone:{hint:"Codex's PostCompact hook lands once the squeeze is done \u2014 room reclaimed.",tooltip:"The compaction Codex flagged with Compacting has just completed via its PostCompact hook, so the freed headroom resets what the context thresholds watch. A natural cue to swap back from any 'compacting' scene."},subagentStart:{hint:"Codex delegated a subtask \u2014 its SubagentStart hook signals a child agent spinning up.",tooltip:"Codex handed part of the work to a child agent; the SubagentStart lifecycle hook fires as that delegate begins. Pair it with Subagent finished to bracket the detour."},subagentFinished:{hint:"A delegated child agent wrapped up \u2014 Codex's SubagentStop hook fires as it returns.",tooltip:"The child agent Codex delegated to has completed and folded its result back into the main run; the SubagentStop lifecycle hook marks the hand-back."},contextLow:{hint:"Context use crossed your threshold below (default 75%) \u2014 tallied from Codex's rollout token counts.",tooltip:"Codex's context window filled past your chosen percentage, tallied from its rollout file's token counts \u2014 your early warning to wrap up or compact."},contextCritical:{hint:"Codex's context is nearly full \u2014 your second, higher threshold (default 90%).",tooltip:"Codex's context is nearly full, past your higher threshold, tallied from its rollout token counts \u2014 last call before it has to compact."},modePlan:{hint:"Codex's permission_mode flipped to plan \u2014 it will propose a course before acting.",tooltip:"The permission_mode field in Codex's hook payloads changed to plan, usually from a /approvals switch in the TUI. In this mode Codex maps out its approach for you rather than editing straightaway; the card marks the switch, not any later approval."},modeAuto:{hint:"Codex's permission_mode moved to acceptEdits \u2014 file edits auto-approve from here.",tooltip:"Codex reported an acceptEdits (dontAsk) permission_mode in its hook payload, so it stops prompting before each edit and applies them on its own. One signal on the mode change, never one per edit."},modeBypass:{hint:"permission_mode hit bypassPermissions \u2014 Codex now runs commands with no approval gate at all.",tooltip:"Codex's hook payload shows a bypassPermissions permission_mode: it executes edits and commands with every approval prompt turned off until the mode changes back. This is the most dangerous state to sit in, so a loud, unmistakable scene earns its place here."},modeNormal:{hint:"permission_mode fell back to default \u2014 Codex is asking before each action again.",tooltip:"Codex's permission_mode returned to default, so it resumes prompting for approval on every edit and command. Treat this as leaving plan, auto-accept, or full-access \u2014 the cue to restore your everyday working scene."},modelChanged:{hint:"The model slug in Codex's hook payload changed \u2014 the model was swapped mid-session.",tooltip:"Codex emitted a different model slug between hook payloads, usually after a /model pick in its TUI. The state carries whichever model is now in charge, so the read-back can name it."},error:{hint:"A Codex turn fails or the app-server crashes mid-turn (voice sessions) \u2014 or any codex session's tool result comes back error-shaped.",tooltip:"In a voice session, Codex's turn/completed event reports a failure it can't classify as a usage limit or a full context window, or the app-server itself dies while a turn is in flight. In any codex session running the plugin's hooks, a tool result flagged as an error (is_error, isError, or a non-empty error field) raises it too \u2014 the one card codex can fire outside a voice session."},idle:{hint:"Voice sessions only: your turn was interrupted and Codex is left waiting on you.",tooltip:"Voice-session only \u2014 Codex's turn/completed event reports status interrupted (you cut it off, or it landed mid-turn) and Codex now sits idle waiting for your next prompt. Codex has no separate idle-after-a-minute hook, so this fires on the interruption itself, not a timer."},ended:{hint:"Voice sessions only: the adapter session closes \u2014 the same signal a codex profile relies on to revert its devices.",tooltip:"Voice-session only \u2014 when the Codex adapter tears down, this fires as its last act, before any still-pending approvals are auto-declined and the process exits. It's the state a codex profile needs to revert its devices, since Codex has no SessionEnd hook of its own outside the adapter."},permissionDenied:{hint:"Voice sessions only: you decline a Codex approval request \u2014 by voice or the local keyboard shortcut.",tooltip:"Voice-session only \u2014 fires when a pending Codex approval (a command or file-change request) is declined, whether you say no over Alexa or press the deny key locally. An approved request instead just returns Codex to working."},planReady:{hint:"Voice sessions only: Codex shares its plan for the turn \u2014 the first plan update, not every step after.",tooltip:"Voice-session only \u2014 the first plan/updated notification after a turn starts fires this once; later step-status updates within the same turn stay silent so it isn't a play-by-play. The latch resets on the next turn, so a fresh turn's first plan fires again."},rateLimited:{hint:"Voice sessions only: a Codex turn fails because you've hit your usage limit.",tooltip:"Voice-session only \u2014 Codex's turn/completed event reports a failure it specifically recognizes as a usage-limit hit, distinct from the generic Error card for anything it can't classify that precisely."},sandboxEscalation:{hint:"Voice sessions only, codex-exclusive: Codex asks to leave its sandbox for network or full access \u2014 its loudest approval request.",tooltip:"Voice-session only, and a state only Codex can raise \u2014 when its app-server sends an item/permissions/requestApproval (rather than a routine command or file-change approval), it's asking to escalate out of its sandbox for network or unrestricted access. This is codex's own exclusive approval type, so give it the loudest scene you've got."},longRunning:{hint:"Codex has been mid-turn past your minutes threshold (default 10) \u2014 a hub timer watching its turns.",tooltip:"Fires when Codex stays mid-turn longer than the minutes you set below without pausing for your input \u2014 a 'still going, might be stuck' watchdog fed by the hub's own timer, not a Codex hook. The latch resets the moment a new turn begins."}},uU=[{event:"sandboxEscalation",label:"Sandbox escalation",...QS.sandboxEscalation}],dU=new Set(["idle","ended","permissionDenied","planReady","rateLimited","sandboxEscalation"]);function Nl(e,t=!1){if(e!=="codex")return{curated:XS,advanced:YS};let r=n=>Dl(e,n)&&(t||!dU.has(n)),o=n=>n.filter(i=>r(i.event)).map(i=>{let s=QS[i.event];return s?{...i,hint:s.hint,tooltip:s.tooltip}:i});return{curated:o(XS),advanced:[...o(YS),...uU.filter(n=>r(n.event))]}}import{resolve as IU}from"node:path";var pU=new Set(["--device","--color","--brightness","--scale","--kelvin","--power","--return","--effect-json","--action","--param","--instance","--threshold","--models","--direction","--announce","--clear-device"]),mU=new Set(["--hold","--allow-security","--clear","--enable","--disable","--json"]);function vs(e){let t={devices:[],hold:!1,allowSecurity:!1,params:[],clear:!1,clearDevices:[],json:!1},r=o=>({...t,bad:o});for(let o=0;o<e.length;o+=1){let n=e[o];if(mU.has(n)){if(n==="--hold")t.hold=!0;else if(n==="--allow-security")t.allowSecurity=!0;else if(n==="--clear")t.clear=!0;else if(n==="--json")t.json=!0;else if(n==="--enable"||n==="--disable"){let s=n==="--enable";if(t.enable!==void 0&&t.enable!==s)return r("--enable and --disable are opposites \u2014 pick one");t.enable=s}continue}if(!pU.has(n))return r(`unknown flag: ${n}`);let i=e[o+1];if(i===void 0||i.startsWith("--")&&!/^-?\d/.test(i.slice(2)))return r(`${n} needs a value`);switch(o+=1,n){case"--device":t.devices.push(i);break;case"--clear-device":t.clearDevices.push(i);break;case"--param":t.params.push(i);break;case"--instance":t.instance=i;break;case"--action":t.action=i;break;case"--effect-json":t.effectJson=i;break;case"--color":{if(i==="main"||i==="session"||i==="none")t.color=i;else{let s=i.split(",").map(a=>Number(a.trim()));if(s.length!==2||!s.every(Number.isFinite)||s[0]<0||s[0]>360||s[1]<0||s[1]>100)return r(`--color takes main | session | none | <hue 0-360>,<sat 0-100>, got: ${i}`);t.color={hue:s[0],saturation:s[1]}}break}case"--brightness":{if(i==="none")t.brightness="none";else{let s=Number(i);if(!Number.isFinite(s)||s<0||s>100)return r(`--brightness takes 0-100 or none, got: ${i}`);t.brightness=s}break}case"--scale":{let s=Number(i);if(!Number.isFinite(s)||s<0||s>2)return r(`--scale takes 0-2 (relative to main), got: ${i}`);t.scale=s;break}case"--kelvin":{if(i==="none")t.kelvin="none";else{let s=Number(i);if(!Number.isFinite(s))return r(`--kelvin takes a colour temperature or none, got: ${i}`);t.kelvin=s}break}case"--power":{if(i!=="on"&&i!=="off"&&i!=="auto")return r(`--power takes on | off | auto, got: ${i}`);t.power=i;break}case"--return":{if(i!=="main"&&i!=="session"&&i!=="hold"&&i!=="off")return r(`--return takes main | session | hold | off, got: ${i}`);t.ret=i;break}case"--threshold":{let s=Number(i);if(!Number.isFinite(s))return r(`--threshold takes a number, got: ${i}`);t.threshold=s;break}case"--models":t.models=i.split(",").map(s=>s.trim().toLowerCase()).filter(Boolean);break;case"--direction":{if(i!=="becomes"&&i!=="leaves")return r(`--direction takes becomes | leaves, got: ${i}`);t.direction=i;break}case"--announce":{if(i!=="on"&&i!=="off")return r(`--announce takes on | off, got: ${i}`);t.announce=i;break}}}return t.brightness!==void 0&&t.scale!==void 0?r("--brightness (absolute) and --scale (relative to main) are exclusive \u2014 pick one"):t}var fU=e=>e.capabilities.some(t=>t.type==="color");function gU(){return{enabled:!0,actions:[],looks:[],allowSecurity:!1}}function hU(e){return e.color!==void 0||e.brightness!==void 0||e.scale!==void 0||e.kelvin!==void 0||e.power!==void 0||e.ret!==void 0||e.hold||e.effectJson!==void 0}function vU(e,t,r){let o={...e?.look??{}};r.color==="none"?delete o.color:r.color==="main"||r.color==="session"?o.color={kind:"token",token:r.color}:r.color!==void 0&&(o.color={kind:"literal",hue:r.color.hue,saturation:r.color.saturation}),r.brightness==="none"?delete o.brightnessPct:r.brightness!==void 0&&(o.brightnessPct=r.brightness,delete o.brightnessScale),r.scale!==void 0&&(o.brightnessScale=r.scale,delete o.brightnessPct),r.kelvin==="none"?delete o.kelvin:r.kelvin!==void 0&&(o.kelvin=r.kelvin),r.power==="auto"?delete o.power:r.power!==void 0&&(o.power=r.power==="on");let n=e?.effect;if(r.effectJson!==void 0){let l;try{l=JSON.parse(r.effectJson)}catch{return{error:"--effect-json isn't valid JSON"}}let u=wr.safeParse(l);if(!u.success)return{error:`--effect-json isn't a valid effect: ${u.error.issues[0]?.message??"invalid"}`};n=u.data}let i=r.ret??e?.returnTo,s=r.ret==="hold"||r.hold?!0:r.ret!==void 0?!1:e?.hold??!1,a=Object.keys(o).length>0;return!a&&!n?null:{deviceId:t,...r.instance!==void 0?{instance:r.instance}:e?.instance!==void 0?{instance:e.instance}:{},...a?{look:o}:{},...n?{effect:n}:{},...i!==void 0?{returnTo:i}:{},hold:s}}function ys(e,t,r,o,n){let i=[],s={...e.states},a=e.notifications,l=[...e.deviceScope];if(r.clear)delete s[t];else{let d=s[t]?{...s[t],actions:[...s[t].actions],looks:[...s[t].looks]}:gU();for(let g of n)d.looks=d.looks.filter(h=>h.deviceId!==g.id),d.actions=d.actions.filter(h=>h.deviceId!==g.id);let p=hU(r),m=r.action!==void 0;if((p||m)&&o.length===0)return{ok:!1,message:"that edit targets devices \u2014 name at least one with --device <id|name>"};for(let g of o)l.includes(g.id)||(l=[...l,g.id],i.push(`added ${g.name} to the profile's device scope`));if(p){let g=r.color!==void 0&&r.color!=="none";for(let h of o){if(g&&!fU(h))return{ok:!1,message:`${h.name} has no color capability \u2014 drop --color for it (brightness/power/kelvin still work)`};let y=d.looks.findIndex(_=>_.deviceId===h.id&&_.instance===r.instance),k=vU(y>=0?d.looks[y]:void 0,h.id,r);if(k&&typeof k=="object"&&"error"in k)return{ok:!1,message:k.error};k===null?y>=0&&(d.looks=d.looks.filter((_,I)=>I!==y)):y>=0?d.looks=d.looks.map((_,I)=>I===y?k:_):d.looks=[...d.looks,k]}}if(r.action!==void 0){let g=Xg(r.params);if(!g.ok)return{ok:!1,message:g.message};for(let h of o){let y=vl(h,r.action,g.params);if(!y.ok)return{ok:!1,message:y.message};let k={deviceId:h.id,capability:y.capability,...r.instance!==void 0?{instance:r.instance}:{},command:y.command,params:y.params};d.actions=[...d.actions.filter(_=>!(_.deviceId===h.id&&_.capability===k.capability&&_.instance===k.instance)),k]}}if(r.threshold!==void 0){let g=er[t];if(!g)return{ok:!1,message:`"${t}" has no threshold \u2014 the threshold states are: ${Object.keys(er).join(", ")}`};if(r.threshold<g.min||r.threshold>g.max)return{ok:!1,message:`--threshold for ${t} takes ${g.min}-${g.max} (${g.unitLabel})`};d={...d,threshold:r.threshold}}if(r.models!==void 0||r.direction!==void 0){if(t!=="modelChanged")return{ok:!1,message:"--models/--direction filter the modelChanged state only"};if(!r.models||r.models.length===0)return{ok:!1,message:"--models needs at least one model family"};d={...d,modelMatch:{models:r.models,direction:r.direction??"becomes"}}}r.allowSecurity&&(d={...d,allowSecurity:!0}),r.enable!==void 0&&(d={...d,enabled:r.enable}),(p||m||n.length>0||r.threshold!==void 0||r.models!==void 0||r.allowSecurity||r.enable!==void 0||r.announce!==void 0||s[t])&&(s[t]=d)}r.announce!==void 0&&(a={...a,announce:{...a.announce,[t]:r.announce==="on"}});let u=Qt.safeParse({...e,states:s,notifications:a,deviceScope:l});return u.success?{ok:!0,result:{profile:u.data,notes:i}}:{ok:!1,message:`that edit doesn't parse as a valid profile: ${u.error.issues[0]?.message??"invalid"}`}}function e_(e,t){let r=e.find(s=>s.id===t);if(r)return{ok:!0,profile:r};let o=t.toLowerCase(),n=e.filter(s=>s.name.toLowerCase()===o);if(n.length===1)return{ok:!0,profile:n[0]};let i=n.length>1?n:e.filter(s=>s.name.toLowerCase().includes(o));return i.length===1?{ok:!0,profile:i[0]}:i.length>1?{ok:!1,kind:"ambiguous",candidates:i.map(s=>({id:s.id,name:s.name}))}:{ok:!1,kind:"not-found",candidates:[]}}var yU=e=>({enabled:!0,actions:[],looks:e,allowSecurity:!1}),qo=(e,t)=>({deviceId:e,look:t,hold:!1}),bU=[{event:"working",color:e=>e.hasColor?qo(e.id,{color:{kind:"token",token:"session"}}):null},{event:"needs_permission",color:e=>qo(e.id,e.hasColor?{color:{kind:"literal",hue:45,saturation:100},brightnessPct:100}:{brightnessPct:100})},{event:"planReady",color:e=>qo(e.id,e.hasColor?{color:{kind:"literal",hue:190,saturation:90},brightnessPct:100}:{brightnessPct:100})},{event:"error",color:e=>qo(e.id,e.hasColor?{color:{kind:"literal",hue:0,saturation:100},brightnessPct:100}:{brightnessPct:100})},{event:"finished",color:e=>e.hasColor?qo(e.id,{color:{kind:"literal",hue:120,saturation:80}}):null},{event:"idle",color:e=>qo(e.id,e.hasColor?{color:{kind:"token",token:"main"},brightnessScale:.3}:{brightnessScale:.3})}];function xU(e,t){return e!=="codex"?!0:Th.includes(t)}function t_(e,t){if(t.length===0)return{};let r={};for(let o of bU){if(!xU(e,o.event))continue;let n=t.map(i=>o.color(i)).filter(i=>i!==null);n.length>0&&(r[o.event]=yU(n))}return r}import{createInterface as n_}from"node:readline/promises";function kU(e){let t=n_({input:process.stdin,output:process.stdout});return t.question(e).finally(()=>t.close())}function wU(e){return new Promise(t=>{let r=n_({input:process.stdin,output:process.stdout,terminal:!0}),o=!1,n=r;n._writeToOutput=i=>{o?(i.includes(`
|
|
271
|
+
`),i}finally{r.close()}}function n_(e,t,r,o,n){return new Promise((i,s)=>{let a=o===void 0?void 0:JSON.stringify(o),l=GS.request({host:e,port:443,method:t,path:r,rejectUnauthorized:!1,headers:{"content-type":"application/json"}},u=>{if(n){let d=Bv(u.socket.getPeerCertificate?.());if(!Hv(d,n)){u.destroy(),l.destroy(),s(new Error(`this device is not Hue bridge ${n} (certificate says ${d??"nothing"}) \u2014 refusing to send the pairing request`));return}}let p="";u.setEncoding("utf8"),u.on("data",d=>p+=d),u.on("end",()=>{try{i(p?JSON.parse(p):{})}catch(d){s(d instanceof Error?d:new Error(String(d)))}})});l.on("error",s),a&&l.write(a),l.end()})}async function uU(e){try{let t=await n_(e,"GET","/api/0/config");return{bridgeId:t.bridgeid?.toLowerCase(),name:t.name}}catch{return{}}}async function dU(e,t){let r=Date.now()+3e4;for(;;){let o=await n_(e,"POST","/api",{devicetype:"acbridge#cli",generateclientkey:!0},t),n=Array.isArray(o)?o.find(s=>s.success)?.success:void 0;if(n)return{appkey:n.username,clientkey:n.clientkey};let i=Array.isArray(o)?o.find(s=>s.error)?.error:void 0;if(i&&i.type!==101)throw new Error(i.description??`Hue error ${i.type}`);if(Date.now()>r)throw new Error("timed out waiting for the link button (30s)");await new Promise(s=>setTimeout(s,1500))}}var Bh=["tuya","meross","ewelink","nanoleaf","govee","esphome"];async function r_(e){let t=e[0];if(t===void 0||!cl.safeParse(t).success)return x(`usage: acbridge unlink <${Bh.join(" | ")}>`),2;let r=await W(`/local/${t}/unlink`,{method:"POST"});return r.hubOffline?(x(Te()),1):r.status===200&&r.body?.ok?($(`removed the ${t} account \u2014 its keys and devices are gone from this machine`),r.body.note&&b(r.body.note),0):(x(r.body?.error??`hub answered HTTP ${r.status}`),1)}var pU=["tuya","meross","ewelink","govee"],mU=["homeassistant","mqtt","hue"],fU=["smartthings"];function i_(e){for(let t of mU)if(e.startsWith(`${t}_`))return{provider:t,class:"local"};for(let t of fU)if(e===t||e.startsWith(`${t}_`))return{provider:t,class:"cloud"};for(let t of Bh)if(e===t||e.startsWith(`${t}_`))return{provider:t,class:"keyed"};return null}var gU=e=>e.enabled!==!1;function Hh(e,t){return e.filter(r=>typeof r.accountId=="string").map(r=>({accountId:String(r.accountId),enabled:gU(r),detail:t(r)}))}function hU(e){let t=[],r=e.accounts("homeassistant");t.push({provider:"home-assistant",kind:"local",status:r.length>0?"linked":"not linked",...r.length>0?{detail:r.map(s=>String(s.baseUrl??s.accountId??"")).join(", "),accounts:Hh(r,s=>String(s.baseUrl??""))}:{hint:"acbridge link home-assistant"}});let o=e.accounts("mqtt");t.push({provider:"mqtt",kind:"local",status:o.length>0?"linked":"not linked",...o.length>0?{detail:o.map(s=>`${String(s.host??s.accountId??"")}${s.port?`:${String(s.port)}`:""}`).join(", "),accounts:Hh(o,s=>`${String(s.host??"")}${s.port?`:${String(s.port)}`:""}`)}:{hint:"acbridge link mqtt --host <broker>"}});let n=e.accounts("hue");t.push({provider:"hue",kind:"local",status:n.length>0?"linked":"not linked",...n.length>0?{detail:n.map(s=>String(s.host??s.bridgeId??"")).join(", "),accounts:Hh(n,s=>String(s.host??""))}:{hint:"acbridge link hue"}});for(let s of pU){let a=e.hasKeystore(s);t.push({provider:s,kind:"keyed",status:a?"linked":"not linked",...a?{}:{hint:`acbridge link ${s}`}})}t.push({provider:"nanoleaf",kind:"device-paired",status:"pairs per device",hint:"acbridge connect <device> (hold the power button)"});let i=e.cloudAccounts===null?null:e.cloudAccounts.find(s=>s.provider==="smartthings");return t.push({provider:"smartthings",kind:"cloud",status:e.cloudAccounts===null?"unknown (sign in)":i?i.status??"linked":"not linked",...e.cloudAccounts!==null&&!i?{hint:"acbridge link smartthings"}:{}}),t}function vU(e){let t=[];for(let r of e){t.push(`${r.provider.padEnd(16)} ${r.status.padEnd(18)} ${r.detail??r.hint??""}`.trimEnd());for(let o of r.accounts??[])t.push(me(` ${o.accountId.padEnd(28)} ${o.enabled?"":"(paused) "}${o.detail??""}`.trimEnd()))}return t}var o_=["Usage: acbridge integrations [list] [--json]"," acbridge integrations enable|disable <accountId> (local accounts \u2014 ids from `list`)"," acbridge integrations remove <accountId|smartthings>"].join(`
|
|
272
|
+
`);async function s_(e){(await W("/local/reload",{method:"POST",body:{}})).hubOffline?b(me("bridge not running \u2014 the change applies when it next starts")):e==="down"&&b(me("saved \u2014 a currently-running adapter lets go fully at the next bridge restart"))}async function bU(e,t,r){let o=i_(e);if(!o)return E(`no integration matches "${e}" \u2014 ids are in \`acbridge integrations\``,1);if(o.class==="cloud")return E("Cloud integrations can't be paused \u2014 remove it to disconnect.",2);if(o.class==="keyed")return E(`Pause or remove individual devices from the network scan (\`acbridge scan\`), or remove the whole account: \`acbridge unlink ${o.provider}\`.`,2);let n=Ko();if(!n)return 3;let i=zn(n,o.provider);return i.some(s=>s.accountId===e)?(fr(n,o.provider,i.map(s=>s.accountId===e?{...s,enabled:t}:s)),await s_(t?"up":"down"),$(`${e} ${t?"resumed":"paused"}`),r&&q({ok:!0,accountId:e,enabled:t}),0):E(`no ${o.provider} account "${e}" on this machine`,1)}async function yU(e,t){let r=i_(e);if(!r)return E(`no integration matches "${e}" \u2014 ids are in \`acbridge integrations\``,1);if(r.class==="keyed")return E(`keyed providers remove whole accounts: \`acbridge unlink ${r.provider}\``,2);if(r.class==="cloud"){let i=$t({notSignedIn:{message:"Not signed in. Run `acbridge login` first.",exitCode:3}});if(!i.ok)return E(i.message,i.exitCode);let a=(await so(i.token))?.find(p=>p.provider===r.provider),l=e.includes("_")?e:a?.accountId;if(!l)return E(`no linked ${r.provider} account to disconnect`,1);let u=await Ny(i.token,l);return u.ok?($(`${r.provider} disconnected at the relay`),t&&q({ok:!0,removed:l}),0):E(u.error??"couldn't disconnect the account",1)}let o=Ko();if(!o)return 3;let n=zn(o,r.provider);if(!n.some(i=>i.accountId===e))return E(`no ${r.provider} account "${e}" on this machine`,1);fr(o,r.provider,n.filter(i=>i.accountId!==e));for(let i of[e,"keystore","cloud"])try{ur(o,r.provider,i).delete()}catch{}return await s_("down"),$(`removed ${e} \u2014 its credentials are gone from this machine`),t&&q({ok:!0,removed:e}),0}async function a_(e=[]){let t=e.includes("--json");t&&ye(!0);let r=e.filter(l=>l!=="--json"),o=r[0]??"list";if(o==="enable"||o==="disable"||o==="remove"){let l=r[1];return!l||r.length>2?E(o_,2):o==="remove"?yU(l,t):bU(l,o==="enable",t)}if(o!=="list")return E(o_,2);let n=Mt(),i=n.state==="ok"?await so(n.token):null,s=De(),a=hU({accounts:l=>s?zn(s,l):[],hasKeystore:l=>s?ur(s,l,"keystore").read()!==null:!1,cloudAccounts:i});if(t)q(a);else for(let l of vU(a))b(l);return 0}function xU(e){let t=e?.onboarding;return typeof t=="object"&&t!==null&&typeof t.completedAt=="number"}function kU(e){return{onboarding:{completedAt:e,completedBy:"cli"}}}async function c_(e,t,r={}){if(!t)return"skipped";let o=r.http??fetch,n=r.now??Date.now,i=e.replace(/\/+$/,""),s=2;try{let a=r.current??await xl(e,t,o);for(let l=0;l<s;l+=1){if(xU(a.config))return"already";if(a.version===null)return"skipped";let u=await o(`${i}/settings`,{method:"PUT",headers:{authorization:`Bearer ${t}`,"content-type":"application/json"},body:JSON.stringify({version:a.version,config:{...a.config,...kU(n())}}),signal:AbortSignal.timeout(6e3)});if(u.ok)return"claimed";if(u.status!==409)return"skipped";l+1<s&&(a=await xl(e,t,o))}return"skipped"}catch{return"skipped"}}function wU(e){try{let t=JSON.parse(Buffer.from(e.split(".")[1]??"","base64url").toString("utf8"));return{...typeof t.sub=="string"?{sub:t.sub}:{},...typeof t.nid=="string"?{nid:t.nid}:{},...typeof t.exp=="number"?{exp:t.exp}:{}}}catch{return null}}function SU(e){let t=[`account: ${e.claims.sub??"(unknown)"}`,...e.claims.nid?[`node: ${e.claims.nid}`]:[],`machine: ${e.machine}`,`relay: ${e.relayUrl}`,...e.plan?[`plan: ${e.plan}`]:[]],r={account:e.claims.sub??null,...e.claims.nid?{node:e.claims.nid}:{},machine:e.machine,relayUrl:e.relayUrl,...e.plan?{plan:e.plan}:{}};if(e.scope){let{pointerSub:o,resolvedSub:n}=e.scope,i=!!n&&o===n;t.push(`pointer: ${o??"(none)"}`),t.push(n?`resolved: ${n}${i?" (pointer and credential agree)":""}`:o?`resolved: MISMATCH \u2014 pointer and credential name different accounts (${ot.pointerMismatch})`:"resolved: not signed in"),r.pointer=o,r.resolved=n,r.agree=i}return{lines:t,json:r}}async function zl(e=[]){let t=e.includes("--json");t&&ye(!0);let r=N(Se().accessFile)?.trim(),o=Pe()?.sub??null,n=gt()?.sub??null;if(!r){let l=ft();return l.length>0&&o&&!n?(_t(l),E(ot.pointerMismatch,3)):E("Not signed in. Run `acbridge login` first.",3)}let i=wU(r)??{},s=await Ft(r),a=SU({claims:i,machine:fa(),relayUrl:de().relayUrl,plan:s?.plan??null,scope:{pointerSub:o,resolvedSub:n}});if(t)q(a.json);else for(let l of a.lines)b(l);return 0}var _U=`Usage: acbridge login [--if-needed] [--provider google|github|microsoft|sso] [--email <you@example.com>] [--no-browser] [--timeout <s>] [--json]
|
|
273
|
+
--if-needed skip the sign-in when this machine already holds a usable credential (default: always sign in)`,l_=["google","github","microsoft","email","sso"];function $U(e){let t={provider:"email",noBrowser:!1,timeoutMs:18e4,json:!1,ifNeeded:!1,chooser:!0};for(let r=0;r<e.length;r++){let o=e[r];if(o==="--if-needed")t.ifNeeded=!0;else if(o==="--no-browser")t.noBrowser=!0;else if(o==="--json")t.json=!0;else if(o==="--provider"){let n=e[++r];l_.includes(n)?(t.provider=n,t.chooser=!1):t.bad=`invalid --provider: ${n??"(none)"} (use ${l_.join(" | ")})`}else if(o==="--email")t.email=e[++r],t.chooser=!1;else if(o==="--timeout"){let n=Number(e[++r]);Number.isFinite(n)?t.timeoutMs=Math.min(600,Math.max(30,Math.round(n)))*1e3:t.bad=`invalid --timeout: ${e[r]??"(none)"}`}else t.bad=`unknown option: ${o??""}`}return t}function d_(e={}){let t=e.readCredentialSub??vl,r=e.writePointer??(n=>mr({sub:n})),o=e.log??j;try{let n=t();n&&r(n)}catch(n){o(`couldn't update the active-user pointer (non-fatal): ${n instanceof Error?n.message:String(n)}`)}}function IU(e={}){(e.readActiveUser??(()=>Pe()))()||(e.heal??d_)()}function EU(e={}){let t=(e.scan??ft)();return(e.warnAmbiguous??(o=>_t(o)))(t),(e.resolveScope??(()=>gt()))()?{kind:"signed-in"}:(e.readPointer??(()=>Pe()))()?{kind:"refuse",message:ot.pointerMismatch}:t.length===1&&ka(t[0],e.segmentOf)?{kind:"heal",sub:t[0].sub}:{kind:"refuse",message:ot.logoutFirst("log in")}}function AU(e){return e.hasCredential?e.refreshed?{kind:"already"}:{kind:"stale-sign-in"}:{kind:"sign-in"}}async function u_(e,t,r={}){let o=(r.readToken??(()=>N(Se().accessFile)?.trim()??""))();if(o){let n=await(r.sync??kl)(e,o);await(r.claim??c_)(e,o,{current:n})==="claimed"&&b("Account setup completed from this machine \u2014 `acbridge start` will run here now.")}return $(t.successLine),(r.report??(n=>zl(n?["--json"]:[])))(t.json)}async function p_(e=[]){let t=$U(e);if(t.bad)return x(t.bad),b(_U),2;t.json&&ye(!0);let r=de().relayUrl;if(t.ifNeeded&&da()){if(sn()>=an){let n=EU();if(n.kind==="refuse")return x(n.message),3;n.kind==="heal"&&mr({sub:n.sub})}else IU();if(AU({hasCredential:!0,refreshed:await jt(r)}).kind==="already")return u_(r,{json:t.json,successLine:"already signed in on this machine"});j("this machine's stored sign-in is no longer valid \u2014 signing in again")}{let o=iy(),n=Jr();try{t.noBrowser||se("opening your browser to sign in\u2026");let i=await hy({cfg:o,opts:{provider:t.provider,...t.email?{email:t.email}:{}},chooser:t.chooser,timeoutMs:t.timeoutMs,openUrl:t.noBrowser?async()=>!1:a=>oo(a,{isWsl:n}),onBrowserFail:a=>{b(t.noBrowser?"Open this URL to sign in:":"Couldn't open a browser \u2014 open this URL to sign in:"),b(a)}});if(se("pairing this machine\u2026"),!await gy(r,()=>i.accessToken))return x("Signed in, but couldn't pair this machine with the relay \u2014 check your connection and retry."),1}catch(i){return x(ly(i)),3}}return d_(),u_(r,{json:t.json,successLine:"Signed in. This machine now holds its own relay credential and refreshes itself."})}function CU(e){let t=e.reverted+e.failed+e.skipped;if(t===0)return"no devices needed reverting";let r=[`reverted ${e.reverted} of ${t} device${t===1?"":"s"}`];return e.failed&&r.push(`${e.failed} failed`),e.skipped&&r.push(`${e.skipped} skipped`),r.join(", ")}async function tr(e=[]){let t=e.includes("--json");t&&ye(!0);let r,o=p=>{t&&q({stopped:p,...r?{revert:r}:{}})},n=await W("/local/session/stop",{method:"POST",body:{},timeoutMs:2e4});!n.hubOffline&&n.status===200&&n.body?.summary&&(r=n.body.summary,$(`lights: ${CU(r)}`));let i=await b0(),s=N(Qe);if(i)return s&&ve(Qe),$("hub stopping \u2014 devices reverting, holders releasing"),o(!0),0;Ey("stop-requested");let a=s?Number(s):0,l=a>0&&Mo({pid:a}),u=await Le();if(!l&&!u)return s&&ve(Qe),$("bridge already stopped"),o(!1),0;if(l)try{process.kill(a)}catch{}return s&&ve(Qe),g0(),await Le()?(x("the hub is still running and didn't answer the shutdown \u2014 check ~/.claude-bridge/hub.log"),1):($("hub stopped"),o(!0),0)}var PU="Usage: acbridge logout [--json]",TU=new Set(["--json"]);async function Fl(e=[],t={}){let r=e.filter(h=>!TU.has(h));if(r.length>0)return x(`unknown option: ${r[0]}`),b(PU),2;let o=e.includes("--json");o&&ye(!0);let n=t.read??N,i=t.stopBridge??tr,s=t.revoke??((h,v,k)=>fy(h,v,{clear:k})),a=t.clearTokens??fi,l=t.keyring??gi(),u=h=>(t.clearDeviceCredentials??hu)(h,l),p=t.clearLogs??(()=>{Ku(St),Ku(Un)}),d=t.clearPointer??vy,m=t.relayUrl??de().relayUrl,f=[],g=(t.scan??ft)();g.length>=2&&(t.warnAmbiguous??(h=>_t(h)))(g);for(let{segment:h}of g){let v=kt(h),k=n(v.accessFile)?.trim()??n(v.refreshFile)?.trim()??null;f.push({segment:h,paths:v,bearer:k})}if(f.length===0)return $("already signed out"),o&&q({signedOut:!0,alreadySignedOut:!0}),0;se("stopping the bridge\u2026"),await i([]);for(let{segment:h,paths:v,bearer:k}of f)se("revoking this machine's credential\u2026"),await s(m,k,()=>a(v)),u(h);return p(),d(),$("signed out \u2014 this machine no longer holds a credential."),o&&q({signedOut:!0,alreadySignedOut:!1}),0}var m_="Usage: acbridge brief [--cwd <path>] [--agent claude|codex] [--json]";async function f_(e){let t=process.cwd(),r="claude",o=!1;for(let s=0;s<e.length;s++){let a=e[s];if(a==="--json")o=!0;else if(a==="--cwd"&&e[s+1])t=e[++s];else if(a==="--agent"&&e[s+1])r=e[++s];else return x(m_),2}if(r!=="claude"&&r!=="codex")return x(m_),2;let n=await W(`/local/agent/brief?cwd=${encodeURIComponent(t)}&agent=${r}`);if(n.hubOffline||n.hubUnauthorized)return x(Te()),1;if(n.status===404)return x("this hub predates the brief route \u2014 update AC Bridge on this machine, then restart the bridge"),1;if(n.status!==200||!n.body)return x(`hub answered ${n.status??"nothing"} \u2014 try \`acbridge status\``),1;if(o)return q(n.body),0;let i=n.body;return i.enabled?(b(i.brief),0):(i.reason==="disabled"?b(`the device brief is OFF for profile "${i.profileName??"?"}" \u2014 tick "Make agent aware of devices in chat" in the app's Profiles editor (profile ${i.profileId??"?"}).`):b(`no ${r} profile is bound to ${t} \u2014 bind one with \`acbridge profiles bind <profile>${r==="codex"?" --agent codex":""}\`.`),0)}var RU=c.object({deviceId:c.string(),capability:Ct,instance:c.string().optional(),command:c.string(),params:c.unknown().optional()}),OU=c.object({deviceId:c.string(),instance:c.string().optional(),look:sl.optional(),effect:_r.optional(),returnTo:il.optional(),hold:c.boolean().default(!1)}),DU=c.object({enabled:c.boolean().default(!0),actions:c.array(RU).default([]),looks:c.array(OU).default([]),allowSecurity:c.boolean().default(!1),threshold:c.number().min(0).max(100).optional(),modelMatch:c.object({models:c.array(c.string()).min(1),direction:c.enum(["becomes","leaves"]).default("becomes")}).optional()}),nr={contextLow:{kind:"percent",default:75,min:50,max:95,step:1,hysteresis:10,unitLabel:"% context"},contextCritical:{kind:"percent",default:90,min:60,max:99,step:1,hysteresis:10,unitLabel:"% context"},usageHigh:{kind:"percent",default:80,min:50,max:95,step:1,hysteresis:10,unitLabel:"% usage"},costHigh:{kind:"dollars",default:5,min:.5,max:50,step:.5,hysteresis:0,unitLabel:"$ spent"},longRunning:{kind:"minutes",default:10,min:1,max:60,step:1,hysteresis:0,unitLabel:"min working"}},g_=Object.fromEntries(Object.entries(nr).map(([e,t])=>[e,t.default])),NU=c.object({proactive:c.boolean().default(!0),doNotDisturb:c.boolean().default(!1),announce:c.record(c.string(),c.boolean()).default({})}),LU=c.object({enabled:c.boolean().default(!1),start:c.string().regex(/^\d{2}:\d{2}$/).default("22:00"),end:c.string().regex(/^\d{2}:\d{2}$/).default("07:00"),tz:c.string().optional()}),en=c.object({id:c.string(),name:c.string().default(""),icon:c.string().default("spark"),gradient:c.tuple([c.string(),c.string(),c.string()]).optional(),deviceScope:c.array(c.string()).default([]),palette:c.array(at).default([]),states:c.record(c.string(),DU).default({}),notifications:NU.default({proactive:!0,doNotDisturb:!1,announce:{}}),quietHours:LU.default({enabled:!1,start:"22:00",end:"07:00"}),agentDeviceAwareness:c.boolean().default(!1),updatedAt:c.number().optional(),agent:vn.optional()}),Ml=c.object({profiles:c.array(en).default([]),bindings:c.record(c.string(),c.string()).default({}),codexBindings:c.record(c.string(),c.string()).default({})});var UU={started:"Claude started a session",working:"Claude is working",needs_permission:"Claude needs permission",needsInput:"Claude has a question for you",planReady:"Claude's plan is ready for approval",idle:"Claude is waiting for you",finished:"Claude finished",contextLow:"Claude is at {pct} percent context",contextCritical:"Claude's context is nearly full \u2014 {pct} percent",rateLimited:"You've hit your Claude usage limit",error:"Claude hit an error",ended:"Claude session ended",resumed:"Claude session resumed",subagentStart:"Claude started a subagent",subagentFinished:"A Claude subagent finished",compacting:"Claude is compacting its context",compactDone:"Claude finished compacting",permissionDenied:"A Claude tool call was blocked",taskCompleted:"A background Claude task finished",usageHigh:"Claude usage is at {pct} percent of the {window} window",modePlan:"Claude entered plan mode",modeAuto:"Claude is auto accepting edits",modeBypass:"Claude is bypassing permission checks",modeNormal:"Claude is back to normal permission checks",modelChanged:"Claude switched to {model}",workflowStarted:"Claude launched a workflow",reviewChanged:"The pull request review changed to {review}",costHigh:"This session has cost {cost} dollars",longRunning:"Claude has been working {mins} minutes"},Wh=["started","resumed","working","finished","needs_permission","compacting","compactDone","subagentStart","subagentFinished","contextLow","contextCritical","modePlan","modeAuto","modeBypass","modeNormal","modelChanged","error","idle","ended","permissionDenied","planReady","rateLimited","sandboxEscalation","longRunning"],jU=["sandboxEscalation"];function Bl(e,t){return e==="codex"?Wh.includes(t):!jU.includes(t)}var zU={started:"Codex started a session",resumed:"Codex session resumed",working:"Codex is working",finished:"Codex finished",needs_permission:"Codex needs permission",compacting:"Codex is compacting its context",compactDone:"Codex finished compacting",subagentStart:"Codex started a subagent",subagentFinished:"A Codex subagent finished",contextLow:"Codex is at {pct} percent context",contextCritical:"Codex's context is nearly full \u2014 {pct} percent",modePlan:"Codex entered plan mode",modeAuto:"Codex is auto accepting edits",modeBypass:"Codex is bypassing permission checks",modeNormal:"Codex is back to normal permission checks",modelChanged:"Codex switched to {model}",error:"Codex hit an error",idle:"Codex is waiting",ended:"Codex session ended",permissionDenied:"A Codex action was declined",planReady:"Codex has a plan ready for approval",rateLimited:"Codex hit its usage limit",sandboxEscalation:"Codex wants to leave its sandbox",longRunning:"Codex has been working {mins} minutes"};function FU(e,t){return e==="codex"?zU[t]:UU[t]}var MU="codex::";function BU(e,t){return e==="codex"?`${MU}${t}`:t}function Vh(e){return typeof e?.id=="string"&&e.id.startsWith("prof:")}function HU(e,t){return!(!cs[e.capability]?.some(o=>o.command===e.command)||t&&!t.devices.some(o=>o.id===e.deviceId))}function Zh(e){if(Array.isArray(e))return`[${e.map(Zh).join(",")}]`;if(e&&typeof e=="object"){let t=e;return`{${Object.keys(t).sort().map(r=>`${JSON.stringify(r)}:${Zh(t[r])}`).join(",")}}`}return JSON.stringify(e)??"null"}function ZU(e){let t=new Set,r=[];for(let o of e){let n=`${o.deviceId} ${o.capability} ${o.instance??""} ${o.command} ${Zh(o.params??{})}`;t.has(n)||(t.add(n),r.push(o))}return r}var GU=new Set(["color","colorTemperature","brightness"]);function h_(e,t,r){let o=r?.voice??!1,n=Ml.safeParse({profiles:e?.profiles,bindings:e?.bindings,codexBindings:e?.codexBindings}),i=[],s={},a={},l={},u={};if(Array.isArray(e?.rules))for(let p of e.rules){let d=Zw.safeParse(p);d.success&&!Vh(d.data)&&i.push(d.data)}if(n.success){let p=new Map(n.data.profiles.map(m=>[m.id,m])),d=[["claude",n.data.bindings],["codex",n.data.codexBindings]];for(let[m,f]of d)for(let[g,h]of Object.entries(f)){let v=p.get(h);if(!v)continue;let k=BU(m,g);s[k]={proactive:v.notifications.proactive,doNotDisturb:v.notifications.doNotDisturb,quietHours:v.quietHours},u[k]={profileId:v.id,profileName:v.name,aware:v.agentDeviceAwareness,deviceScope:[...v.deviceScope]};for(let[S,I]of Object.entries(v.states)){if(!I.enabled)continue;let _=ls.safeParse(S);if(!_.success)continue;let C=_.data;C in g_&&((a[k]??={})[C]=I.threshold??g_[C]),C==="modelChanged"&&I.modelMatch&&(l[k]={models:I.modelMatch.models,direction:I.modelMatch.direction});let z=ZU(I.actions.filter(re=>v.deviceScope.includes(re.deviceId)&&HU(re,t))),F=new Set(z.filter(re=>re.capability==="power").map(re=>re.deviceId)),D=[...[...new Set(z.filter(re=>GU.has(re.capability)&&!F.has(re.deviceId)).map(re=>re.deviceId))].map(re=>({kind:"device",deviceId:re,capability:"power",command:"turnOn",params:{}})),...z.map(re=>({kind:"device",deviceId:re.deviceId,capability:re.capability,...re.instance?{instance:re.instance}:{},command:re.command,params:re.params}))],B=FU(m,C),ke=o&&v.notifications.announce[C]&&B?[{kind:"notify",title:v.name||"AC Bridge",body:B}]:[],Ae=I.looks.filter(re=>v.deviceScope.includes(re.deviceId)).map(re=>({kind:"intent",deviceId:re.deviceId,...re.instance?{instance:re.instance}:{},...re.look?{look:re.look}:{},...re.effect?{effect:re.effect}:{},...re.returnTo?{returnTo:re.returnTo}:{},hold:re.hold})),xt=[...D,...Ae,...ke];if(xt.length===0)continue;let Lt=m==="codex"?`prof:codex:${v.id}:${g}:${C}`:`prof:${v.id}:${g}:${C}`;i.push({id:Lt,name:v.name?`${v.name} \xB7 ${C}`:C,enabled:!0,trigger:{kind:"session",event:C,repo:g,agent:m},conditions:[],actions:xt,allowSecurity:I.allowSecurity})}}}return{rules:i,notifyPolicy:s,thresholds:a,modelMatch:l,agentAwareness:u}}var Jh="this account's profiles document is unreadable by this version \u2014 update AC Bridge (nothing was written)";function qh(e){return e.profiles!==void 0||e.bindings!==void 0||e.codexBindings!==void 0?Ml.safeParse({profiles:e.profiles,bindings:e.bindings,codexBindings:e.codexBindings}).success?"ok":"malformed":"empty"}function Dt(e){let t=Ml.safeParse({profiles:e.profiles,bindings:e.bindings,codexBindings:e.codexBindings});return t.success?t.data:{profiles:[],bindings:{},codexBindings:{}}}function Kh(){return`prof_${Date.now().toString(36)}${Math.random().toString(36).slice(2,6)}`}function v_(e="New profile",t){return en.parse({id:Kh(),name:e,...t==="codex"?{agent:"codex"}:{}})}function Xh(e){return e==="codex"?"codexBindings":"bindings"}function Yh(e,t,r,o){let n=Xh(o),i={...e[n]};return r?i[t]=r:delete i[t],{...e,[n]:i}}function b_(e,t,r){if(qh(e)==="malformed")throw new Error(Jh);let o=Array.isArray(e.rules)?e.rules.filter(i=>!Vh(i)):[],{rules:n}=h_({profiles:t.profiles,bindings:t.bindings,codexBindings:t.codexBindings,rules:o},void 0,{voice:r});return{...e,profiles:t.profiles,bindings:t.bindings,codexBindings:t.codexBindings,rules:n}}function ys(e){let t=nr[e];return{defaultPct:t.default,min:t.min,max:t.max,unitLabel:t.unitLabel,step:t.step}}var y_=[{event:"started",label:"Started",hint:"A Claude session opens in this repo (SessionStart) \u2014 cold start or /clear, not a resume.",tooltip:"Fires the moment a Claude session starts in a repo bound to this profile \u2014 a cold start or after /clear. A resume fires Resumed instead, and an auto-compaction restart fires neither."},{event:"working",label:"Working",hint:"You send a prompt and Claude starts working (UserPromptSubmit) \u2014 also fires when it resumes after a question or plan approval.",tooltip:"Fires when you send Claude a prompt and it starts working \u2014 and again the moment it resumes after you answer a question or approve a plan."},{event:"needs_permission",label:"Needs permission",hint:"Claude paused to ask permission for a tool (permission notification) \u2014 waiting on your yes/no.",tooltip:"Claude paused mid-task to ask permission to run a tool and is waiting on your yes or no."},{event:"needsInput",label:"Needs input",hint:"Claude asked you a question (AskUserQuestion) and is waiting on your answer.",tooltip:"Claude asked you a question and is waiting on your answer (also fires when a background agent needs input)."},{event:"planReady",label:"Plan ready",hint:"Claude presented a plan for approval (ExitPlanMode) \u2014 nothing runs until you decide.",tooltip:"Claude finished planning and is waiting for you to review and approve the plan before it touches anything."},{event:"idle",label:"Idle",hint:"Claude has been left waiting on you for about a minute (idle notification) \u2014 the 'your turn' nudge.",tooltip:"Claude has been left waiting on you with nothing to do for about a minute \u2014 the 'your turn' nudge."},{event:"finished",label:"Finished",hint:"Claude ends a turn (Stop hook) \u2014 fires every time it stops replying. The common one.",tooltip:"Claude ends a turn \u2014 the instant it stops replying. Fires at the end of every response; the everyday 'done' signal."},{event:"contextLow",label:"Context low",hint:"Context use crossed your threshold below (default 75%) \u2014 read from the live session.",tooltip:"Claude's context window filled past your chosen percentage \u2014 set the slider below. Your early warning to wrap up, hand off, or /compact.",threshold:ys("contextLow")},{event:"contextCritical",label:"Context critical",hint:"Context nearly full \u2014 your second, higher threshold (default 90%). Auto-compact is imminent.",tooltip:"Context is nearly full \u2014 past your higher threshold. Auto-compact typically kicks in around 85\u201390%, so this is last-call.",threshold:ys("contextCritical")},{event:"rateLimited",label:"Rate limited",hint:"Claude hit a usage limit (rate-limit warning, or a turn died on one).",tooltip:"You hit \u2014 or are about to hit \u2014 your Claude plan's usage limit (the 5-hour or weekly window) and Claude may stop replying."},{event:"error",label:"Error",hint:"A turn or tool failed (StopFailure, a tool failure, or an MCP server error).",tooltip:"Something failed \u2014 an API error ended the turn, a tool call failed, or an MCP server dropped. Rate-limit failures fire Rate limited instead."},{event:"ended",label:"Ended",hint:"The session closed (SessionEnd) \u2014 Claude is no longer running in this repo.",tooltip:"The session closed \u2014 Claude is no longer running in this repo. Profile scenes revert."}],x_=[{event:"resumed",label:"Resumed",hint:"A previous session picks up where it left off (SessionStart on resume).",tooltip:"A previous session picks up where it left off (--resume / reopening a conversation)."},{event:"subagentStart",label:"Subagent started",hint:"Claude spawned a subagent for a subtask (SubagentStart).",tooltip:"Claude spawned a subagent to work on a subtask in the background."},{event:"subagentFinished",label:"Subagent finished",hint:"A spawned subagent finished (SubagentStop).",tooltip:"A spawned subagent finished its subtask and reported back."},{event:"compacting",label:"Compacting",hint:"Claude is about to compact its context (PreCompact) \u2014 manual /compact or automatic when nearly full.",tooltip:"Claude is about to compact its context to free room \u2014 manual /compact or automatic when nearly full."},{event:"compactDone",label:"Compaction done",hint:"Compaction finished (PostCompact) \u2014 context freed.",tooltip:"Compaction finished \u2014 context freed. The context meters (and Context low/critical) re-arm."},{event:"permissionDenied",label:"Permission denied",hint:"A tool call was auto-blocked by permission rules (PermissionDenied) \u2014 without asking you.",tooltip:"A tool call was auto-blocked by permission rules without asking you \u2014 worth a glance at what was refused."},{event:"taskCompleted",label:"Task completed",hint:"A background task or agent finished (TaskCompleted) while the session kept going.",tooltip:"A background task or agent finished while the main session kept going."},{event:"usageHigh",label:"Usage high",hint:"Plan usage crossed your threshold below (default 80%) \u2014 fed by the statusline feed (5-hour/7-day window).",tooltip:"Your Claude plan usage crossed your chosen percentage of the 5-hour or weekly window \u2014 pace yourself before the hard limit. Needs the AC Bridge statusline tee (installed by acbridge).",threshold:ys("usageHigh")},{event:"modePlan",label:"Plan mode",hint:"The session switched INTO plan mode (shift+tab) \u2014 read from the session transcript.",tooltip:"You switched the session into plan mode \u2014 Claude researches and proposes before touching anything. Fires on the switch itself; Plan ready fires later, when a finished plan awaits your approval. A session that OPENS in plan mode stays quiet until the mode actually moves."},{event:"modeAuto",label:"Auto-accept mode",hint:"The session switched into auto-accept \u2014 edits apply without per-action confirmation.",tooltip:"You switched into auto-accept mode \u2014 edits and tool calls apply without per-action confirmation. Fires once on the switch, not per edit."},{event:"modeBypass",label:"Bypass permissions",hint:"The session entered bypass-permissions mode \u2014 ALL permission checks are skipped.",tooltip:"The session entered bypass-permissions mode: every permission check is skipped until you leave it. The riskiest mode \u2014 a bright warning scene is a good fit."},{event:"modeNormal",label:"Normal mode",hint:"The session returned to default permission checks (from plan, auto-accept, or bypass).",tooltip:"The session returned to normal permission checks \u2014 the exit edge of the other mode states, handy for restoring your regular working scene."},{event:"modelChanged",label:"Model changed",hint:"The session's model switched mid-run (/model, fast mode) \u2014 the announcement names the new model.",tooltip:`The session's model changed mid-run \u2014 /model, a fast-mode toggle, or an opusplan hand-off. The spoken announcement names the new model ("Claude switched to Opus 4.8").`,modelMatch:!0},{event:"workflowStarted",label:"Workflow started",hint:"Claude kicked off a multi-agent workflow (Workflow tool) \u2014 expect a subagent burst.",tooltip:"Claude launched a multi-agent workflow. Expect a burst of Subagent started/finished signals until it completes \u2014 the completion itself lands as Task completed."},{event:"reviewChanged",label:"Review changed",hint:"Your PR's review state changed (approved / changes requested) \u2014 read from the statusline's pr.review_state field.",tooltip:"The statusline tee reports your pull request's review state, and this fires the moment it changes \u2014 approved, changes requested, or back to pending \u2014 so a CI-review scene can react the instant someone reviews your PR. Needs the AC Bridge statusline tee and an open PR with review data (installed by acbridge). Claude's own exclusive state \u2014 Codex has no equivalent."},{event:"costHigh",label:"Cost alarm",hint:"This session's estimated spend crossed your dollar threshold (default $5) \u2014 from the statusline cost feed.",tooltip:"Fires once when Claude's estimated session cost passes the dollar amount you set below. Needs the AC Bridge statusline tee (installed by acbridge); Codex sessions have no dollar cost, so this is Claude-only.",threshold:ys("costHigh")},{event:"longRunning",label:"Long run",hint:"The session has been working non-stop past your minutes threshold (default 10) \u2014 a hub timer.",tooltip:"Fires when a session stays in 'working' longer than the minutes you set below without pausing for you \u2014 a 'did it get stuck / long task still going' watchdog. Re-arms on the next turn. Works for Claude and Codex.",threshold:ys("longRunning")}],k_={started:{hint:"Codex opens a fresh rollout in this repo \u2014 a true cold start, not reopening an earlier conversation.",tooltip:"A new Codex session spins up against a repo bound to this profile, beginning an empty rollout. Reopening a prior conversation routes to Resumed instead, so this card only marks genuine first starts."},resumed:{hint:"A previous Codex conversation picks up where it left off.",tooltip:"A previous Codex conversation resumes \u2014 Codex reloads its prior rollout and continues from where it stopped."},working:{hint:"A turn begins on Codex's UserPromptSubmit hook \u2014 your prompt is in and work has started.",tooltip:"Codex's UserPromptSubmit hook trips as each turn opens: the moment your prompt is submitted. This is the 'now busy' edge."},finished:{hint:"Codex's Stop hook lands at the end of every reply \u2014 turn done, not the session closing.",tooltip:"Codex fires its Stop hook when a turn wraps, once per reply. It marks end-of-turn rather than a closed session, so expect it after every answer \u2014 the routine 'ready for you' beat."},needs_permission:{hint:"Codex paused to ask approval for a command \u2014 waiting on your yes/no.",tooltip:"Codex paused mid-task to ask for your approval to run a command and is waiting on your decision. Sandbox and network escalation requests fire the separate 'Sandbox escalation' state instead \u2014 bind that too if you want one scene for every approval."},compacting:{hint:"Codex is about to compact its context to free room.",tooltip:"Codex is about to compact its context \u2014 manual or automatic once its context window is nearly full."},compactDone:{hint:"Codex's PostCompact hook lands once the squeeze is done \u2014 room reclaimed.",tooltip:"The compaction Codex flagged with Compacting has just completed via its PostCompact hook, so the freed headroom resets what the context thresholds watch. A natural cue to swap back from any 'compacting' scene."},subagentStart:{hint:"Codex delegated a subtask \u2014 its SubagentStart hook signals a child agent spinning up.",tooltip:"Codex handed part of the work to a child agent; the SubagentStart lifecycle hook fires as that delegate begins. Pair it with Subagent finished to bracket the detour."},subagentFinished:{hint:"A delegated child agent wrapped up \u2014 Codex's SubagentStop hook fires as it returns.",tooltip:"The child agent Codex delegated to has completed and folded its result back into the main run; the SubagentStop lifecycle hook marks the hand-back."},contextLow:{hint:"Context use crossed your threshold below (default 75%) \u2014 tallied from Codex's rollout token counts.",tooltip:"Codex's context window filled past your chosen percentage, tallied from its rollout file's token counts \u2014 your early warning to wrap up or compact."},contextCritical:{hint:"Codex's context is nearly full \u2014 your second, higher threshold (default 90%).",tooltip:"Codex's context is nearly full, past your higher threshold, tallied from its rollout token counts \u2014 last call before it has to compact."},modePlan:{hint:"Codex's permission_mode flipped to plan \u2014 it will propose a course before acting.",tooltip:"The permission_mode field in Codex's hook payloads changed to plan, usually from a /approvals switch in the TUI. In this mode Codex maps out its approach for you rather than editing straightaway; the card marks the switch, not any later approval."},modeAuto:{hint:"Codex's permission_mode moved to acceptEdits \u2014 file edits auto-approve from here.",tooltip:"Codex reported an acceptEdits (dontAsk) permission_mode in its hook payload, so it stops prompting before each edit and applies them on its own. One signal on the mode change, never one per edit."},modeBypass:{hint:"permission_mode hit bypassPermissions \u2014 Codex now runs commands with no approval gate at all.",tooltip:"Codex's hook payload shows a bypassPermissions permission_mode: it executes edits and commands with every approval prompt turned off until the mode changes back. This is the most dangerous state to sit in, so a loud, unmistakable scene earns its place here."},modeNormal:{hint:"permission_mode fell back to default \u2014 Codex is asking before each action again.",tooltip:"Codex's permission_mode returned to default, so it resumes prompting for approval on every edit and command. Treat this as leaving plan, auto-accept, or full-access \u2014 the cue to restore your everyday working scene."},modelChanged:{hint:"The model slug in Codex's hook payload changed \u2014 the model was swapped mid-session.",tooltip:"Codex emitted a different model slug between hook payloads, usually after a /model pick in its TUI. The state carries whichever model is now in charge, so the read-back can name it."},error:{hint:"A Codex turn fails or the app-server crashes mid-turn (voice sessions) \u2014 or any codex session's tool result comes back error-shaped.",tooltip:"In a voice session, Codex's turn/completed event reports a failure it can't classify as a usage limit or a full context window, or the app-server itself dies while a turn is in flight. In any codex session running the plugin's hooks, a tool result flagged as an error (is_error, isError, or a non-empty error field) raises it too \u2014 the one card codex can fire outside a voice session."},idle:{hint:"Voice sessions only: your turn was interrupted and Codex is left waiting on you.",tooltip:"Voice-session only \u2014 Codex's turn/completed event reports status interrupted (you cut it off, or it landed mid-turn) and Codex now sits idle waiting for your next prompt. Codex has no separate idle-after-a-minute hook, so this fires on the interruption itself, not a timer."},ended:{hint:"Voice sessions only: the adapter session closes \u2014 the same signal a codex profile relies on to revert its devices.",tooltip:"Voice-session only \u2014 when the Codex adapter tears down, this fires as its last act, before any still-pending approvals are auto-declined and the process exits. It's the state a codex profile needs to revert its devices, since Codex has no SessionEnd hook of its own outside the adapter."},permissionDenied:{hint:"Voice sessions only: you decline a Codex approval request \u2014 by voice or the local keyboard shortcut.",tooltip:"Voice-session only \u2014 fires when a pending Codex approval (a command or file-change request) is declined, whether you say no over Alexa or press the deny key locally. An approved request instead just returns Codex to working."},planReady:{hint:"Voice sessions only: Codex shares its plan for the turn \u2014 the first plan update, not every step after.",tooltip:"Voice-session only \u2014 the first plan/updated notification after a turn starts fires this once; later step-status updates within the same turn stay silent so it isn't a play-by-play. The latch resets on the next turn, so a fresh turn's first plan fires again."},rateLimited:{hint:"Voice sessions only: a Codex turn fails because you've hit your usage limit.",tooltip:"Voice-session only \u2014 Codex's turn/completed event reports a failure it specifically recognizes as a usage-limit hit, distinct from the generic Error card for anything it can't classify that precisely."},sandboxEscalation:{hint:"Voice sessions only, codex-exclusive: Codex asks to leave its sandbox for network or full access \u2014 its loudest approval request.",tooltip:"Voice-session only, and a state only Codex can raise \u2014 when its app-server sends an item/permissions/requestApproval (rather than a routine command or file-change approval), it's asking to escalate out of its sandbox for network or unrestricted access. This is codex's own exclusive approval type, so give it the loudest scene you've got."},longRunning:{hint:"Codex has been mid-turn past your minutes threshold (default 10) \u2014 a hub timer watching its turns.",tooltip:"Fires when Codex stays mid-turn longer than the minutes you set below without pausing for your input \u2014 a 'still going, might be stuck' watchdog fed by the hub's own timer, not a Codex hook. The latch resets the moment a new turn begins."}},WU=[{event:"sandboxEscalation",label:"Sandbox escalation",...k_.sandboxEscalation}],VU=new Set(["idle","ended","permissionDenied","planReady","rateLimited","sandboxEscalation"]);function Hl(e,t=!1){if(e!=="codex")return{curated:y_,advanced:x_};let r=n=>Bl(e,n)&&(t||!VU.has(n)),o=n=>n.filter(i=>r(i.event)).map(i=>{let s=k_[i.event];return s?{...i,hint:s.hint,tooltip:s.tooltip}:i});return{curated:o(y_),advanced:[...o(x_),...WU.filter(n=>r(n.event))]}}import{resolve as cj}from"node:path";var JU=new Set(["--device","--color","--brightness","--scale","--kelvin","--power","--return","--effect-json","--action","--param","--instance","--threshold","--models","--direction","--announce","--clear-device"]),qU=new Set(["--hold","--allow-security","--clear","--enable","--disable","--json"]);function xs(e){let t={devices:[],hold:!1,allowSecurity:!1,params:[],clear:!1,clearDevices:[],json:!1},r=o=>({...t,bad:o});for(let o=0;o<e.length;o+=1){let n=e[o];if(qU.has(n)){if(n==="--hold")t.hold=!0;else if(n==="--allow-security")t.allowSecurity=!0;else if(n==="--clear")t.clear=!0;else if(n==="--json")t.json=!0;else if(n==="--enable"||n==="--disable"){let s=n==="--enable";if(t.enable!==void 0&&t.enable!==s)return r("--enable and --disable are opposites \u2014 pick one");t.enable=s}continue}if(!JU.has(n))return r(`unknown flag: ${n}`);let i=e[o+1];if(i===void 0||i.startsWith("--")&&!/^-?\d/.test(i.slice(2)))return r(`${n} needs a value`);switch(o+=1,n){case"--device":t.devices.push(i);break;case"--clear-device":t.clearDevices.push(i);break;case"--param":t.params.push(i);break;case"--instance":t.instance=i;break;case"--action":t.action=i;break;case"--effect-json":t.effectJson=i;break;case"--color":{if(i==="main"||i==="session"||i==="none")t.color=i;else{let s=i.split(",").map(a=>Number(a.trim()));if(s.length!==2||!s.every(Number.isFinite)||s[0]<0||s[0]>360||s[1]<0||s[1]>100)return r(`--color takes main | session | none | <hue 0-360>,<sat 0-100>, got: ${i}`);t.color={hue:s[0],saturation:s[1]}}break}case"--brightness":{if(i==="none")t.brightness="none";else{let s=Number(i);if(!Number.isFinite(s)||s<0||s>100)return r(`--brightness takes 0-100 or none, got: ${i}`);t.brightness=s}break}case"--scale":{let s=Number(i);if(!Number.isFinite(s)||s<0||s>2)return r(`--scale takes 0-2 (relative to main), got: ${i}`);t.scale=s;break}case"--kelvin":{if(i==="none")t.kelvin="none";else{let s=Number(i);if(!Number.isFinite(s))return r(`--kelvin takes a colour temperature or none, got: ${i}`);t.kelvin=s}break}case"--power":{if(i!=="on"&&i!=="off"&&i!=="auto")return r(`--power takes on | off | auto, got: ${i}`);t.power=i;break}case"--return":{if(i!=="main"&&i!=="session"&&i!=="hold"&&i!=="off")return r(`--return takes main | session | hold | off, got: ${i}`);t.ret=i;break}case"--threshold":{let s=Number(i);if(!Number.isFinite(s))return r(`--threshold takes a number, got: ${i}`);t.threshold=s;break}case"--models":t.models=i.split(",").map(s=>s.trim().toLowerCase()).filter(Boolean);break;case"--direction":{if(i!=="becomes"&&i!=="leaves")return r(`--direction takes becomes | leaves, got: ${i}`);t.direction=i;break}case"--announce":{if(i!=="on"&&i!=="off")return r(`--announce takes on | off, got: ${i}`);t.announce=i;break}}}return t.brightness!==void 0&&t.scale!==void 0?r("--brightness (absolute) and --scale (relative to main) are exclusive \u2014 pick one"):t}var KU=e=>e.capabilities.some(t=>t.type==="color");function XU(){return{enabled:!0,actions:[],looks:[],allowSecurity:!1}}function YU(e){return e.color!==void 0||e.brightness!==void 0||e.scale!==void 0||e.kelvin!==void 0||e.power!==void 0||e.ret!==void 0||e.hold||e.effectJson!==void 0}function QU(e,t,r){let o={...e?.look??{}};r.color==="none"?delete o.color:r.color==="main"||r.color==="session"?o.color={kind:"token",token:r.color}:r.color!==void 0&&(o.color={kind:"literal",hue:r.color.hue,saturation:r.color.saturation}),r.brightness==="none"?delete o.brightnessPct:r.brightness!==void 0&&(o.brightnessPct=r.brightness,delete o.brightnessScale),r.scale!==void 0&&(o.brightnessScale=r.scale,delete o.brightnessPct),r.kelvin==="none"?delete o.kelvin:r.kelvin!==void 0&&(o.kelvin=r.kelvin),r.power==="auto"?delete o.power:r.power!==void 0&&(o.power=r.power==="on");let n=e?.effect;if(r.effectJson!==void 0){let l;try{l=JSON.parse(r.effectJson)}catch{return{error:"--effect-json isn't valid JSON"}}let u=_r.safeParse(l);if(!u.success)return{error:`--effect-json isn't a valid effect: ${u.error.issues[0]?.message??"invalid"}`};n=u.data}let i=r.ret??e?.returnTo,s=r.ret==="hold"||r.hold?!0:r.ret!==void 0?!1:e?.hold??!1,a=Object.keys(o).length>0;return!a&&!n?null:{deviceId:t,...r.instance!==void 0?{instance:r.instance}:e?.instance!==void 0?{instance:e.instance}:{},...a?{look:o}:{},...n?{effect:n}:{},...i!==void 0?{returnTo:i}:{},hold:s}}function ks(e,t,r,o,n){let i=[],s={...e.states},a=e.notifications,l=[...e.deviceScope];if(Hw.has(t)&&i.push(`note: '${t}' never fires \u2014 no producer emits it (kept for stored-config compatibility only)`),r.clear)delete s[t];else{let p=s[t]?{...s[t],actions:[...s[t].actions],looks:[...s[t].looks]}:XU();for(let g of n)p.looks=p.looks.filter(h=>h.deviceId!==g.id),p.actions=p.actions.filter(h=>h.deviceId!==g.id);let d=YU(r),m=r.action!==void 0;if((d||m)&&o.length===0)return{ok:!1,message:"that edit targets devices \u2014 name at least one with --device <id|name>"};for(let g of o)l.includes(g.id)||(l=[...l,g.id],i.push(`added ${g.name} to the profile's device scope`));if(d){let g=r.color!==void 0&&r.color!=="none";for(let h of o){if(g&&!KU(h))return{ok:!1,message:`${h.name} has no color capability \u2014 drop --color for it (brightness/power/kelvin still work)`};let v=p.looks.findIndex(S=>S.deviceId===h.id&&S.instance===r.instance),k=QU(v>=0?p.looks[v]:void 0,h.id,r);if(k&&typeof k=="object"&&"error"in k)return{ok:!1,message:k.error};k===null?v>=0&&(p.looks=p.looks.filter((S,I)=>I!==v)):v>=0?p.looks=p.looks.map((S,I)=>I===v?k:S):p.looks=[...p.looks,k]}}if(r.action!==void 0){let g=dh(r.params);if(!g.ok)return{ok:!1,message:g.message};for(let h of o){let v=$l(h,r.action,g.params);if(!v.ok)return{ok:!1,message:v.message};let k={deviceId:h.id,capability:v.capability,...r.instance!==void 0?{instance:r.instance}:{},command:v.command,params:v.params};p.actions=[...p.actions.filter(S=>!(S.deviceId===h.id&&S.capability===k.capability&&S.instance===k.instance)),k]}}if(r.threshold!==void 0){let g=nr[t];if(!g)return{ok:!1,message:`"${t}" has no threshold \u2014 the threshold states are: ${Object.keys(nr).join(", ")}`};if(r.threshold<g.min||r.threshold>g.max)return{ok:!1,message:`--threshold for ${t} takes ${g.min}-${g.max} (${g.unitLabel})`};p={...p,threshold:r.threshold}}if(r.models!==void 0||r.direction!==void 0){if(t!=="modelChanged")return{ok:!1,message:"--models/--direction filter the modelChanged state only"};if(!r.models||r.models.length===0)return{ok:!1,message:"--models needs at least one model family"};p={...p,modelMatch:{models:r.models,direction:r.direction??"becomes"}}}r.allowSecurity&&(p={...p,allowSecurity:!0}),r.enable!==void 0&&(p={...p,enabled:r.enable}),(d||m||n.length>0||r.threshold!==void 0||r.models!==void 0||r.allowSecurity||r.enable!==void 0||r.announce!==void 0||s[t])&&(s[t]=p)}r.announce!==void 0&&(a={...a,announce:{...a.announce,[t]:r.announce==="on"}});let u=en.safeParse({...e,states:s,notifications:a,deviceScope:l});return u.success?{ok:!0,result:{profile:u.data,notes:i}}:{ok:!1,message:`that edit doesn't parse as a valid profile: ${u.error.issues[0]?.message??"invalid"}`}}function w_(e,t){let r=e.find(s=>s.id===t);if(r)return{ok:!0,profile:r};let o=t.toLowerCase(),n=e.filter(s=>s.name.toLowerCase()===o);if(n.length===1)return{ok:!0,profile:n[0]};let i=n.length>1?n:e.filter(s=>s.name.toLowerCase().includes(o));return i.length===1?{ok:!0,profile:i[0]}:i.length>1?{ok:!1,kind:"ambiguous",candidates:i.map(s=>({id:s.id,name:s.name}))}:{ok:!1,kind:"not-found",candidates:[]}}var ej=e=>({enabled:!0,actions:[],looks:e,allowSecurity:!1}),Lr=(e,t)=>({deviceId:e,look:t,hold:!1}),tj=[{event:"started",color:e=>e.hasColor?Lr(e.id,{color:{kind:"token",token:"session"}}):null},{event:"working",color:e=>e.hasColor?Lr(e.id,{color:{kind:"token",token:"session"}}):null},{event:"needs_permission",color:e=>Lr(e.id,e.hasColor?{color:{kind:"literal",hue:45,saturation:100},brightnessPct:100}:{brightnessPct:100})},{event:"planReady",color:e=>Lr(e.id,e.hasColor?{color:{kind:"literal",hue:190,saturation:90},brightnessPct:100}:{brightnessPct:100})},{event:"error",color:e=>Lr(e.id,e.hasColor?{color:{kind:"literal",hue:0,saturation:100},brightnessPct:100}:{brightnessPct:100})},{event:"finished",color:e=>e.hasColor?Lr(e.id,{color:{kind:"literal",hue:120,saturation:80}}):null},{event:"idle",color:e=>Lr(e.id,e.hasColor?{color:{kind:"token",token:"main"},brightnessScale:.3}:{brightnessScale:.3})}];function nj(e,t){return e!=="codex"?!0:Wh.includes(t)}function S_(e,t){if(t.length===0)return{};let r={};for(let o of tj){if(!nj(e,o.event))continue;let n=t.map(i=>o.color(i)).filter(i=>i!==null);n.length>0&&(r[o.event]=ej(n))}return r}import{createInterface as __}from"node:readline/promises";function rj(e){let t=__({input:process.stdin,output:process.stdout});return t.question(e).finally(()=>t.close())}function oj(e){return new Promise(t=>{let r=__({input:process.stdin,output:process.stdout,terminal:!0}),o=!1,n=r;n._writeToOutput=i=>{o?(i.includes(`
|
|
265
274
|
`)||i.includes("\r"))&&process.stdout.write(`
|
|
266
|
-
`):(process.stdout.write(e),o=!0)},r.question(e).then(i=>{r.close(),t(i)})})}var
|
|
275
|
+
`):(process.stdout.write(e),o=!0)},r.question(e).then(i=>{r.close(),t(i)})})}var Xo={isTTY:()=>process.stdin.isTTY===!0&&process.stdout.isTTY===!0,write:e=>process.stdout.write(e),ask:rj,askMasked:oj};function $_(e,t,r){e.write(`${t}
|
|
267
276
|
`),r.forEach((o,n)=>{e.write(` ${n+1}) ${o.label}${o.hint?` \u2014 ${o.hint}`:""}
|
|
268
|
-
`)})}function
|
|
269
|
-
`)}}async function
|
|
270
|
-
`)}}async function Pn(e,t,r){let o=r.def?"[Y/n]":"[y/N]",n=(await e.ask(`${t} ${o} `)).trim().toLowerCase();return n?n==="y"||n==="yes":r.def}async function
|
|
271
|
-
`)),await Pn(e,"Save profile?",{def:!0})?{name:n,agent:o,deviceIds:i,starter:s,bindCwd:a}:null}async function
|
|
272
|
-
`);continue}let I=
|
|
273
|
-
`);continue}for(let
|
|
274
|
-
`);n=k.result.profile,i=!0}return i?n:null}import{basename as
|
|
275
|
-
`,384)}function
|
|
277
|
+
`)})}function I_(e,t){let r=e.trim().toLowerCase();if(!r)return null;if(/^[0-9]+$/.test(r)){let n=Number(r);return n>=1&&n<=t.length?n-1:null}let o=t.flatMap((n,i)=>n.label.toLowerCase().startsWith(r)?[i]:[]);return o.length===1?o[0]:null}async function Ur(e,t,r,o={}){$_(e,t,r);let n=o.def!==void 0?` [${o.def+1}]`:"";for(;;){let i=(await e.ask(`> ${n?n.trim()+" ":""}`)).trim();if(!i&&o.def!==void 0)return o.def;let s=i?I_(i,r):null;if(s!==null)return s;e.write(` Pick a number from the list (or a unique name prefix).
|
|
278
|
+
`)}}async function Zl(e,t,r){for($_(e,t,r);;){let o=(await e.ask("> (comma-separated, `all`, or empty for none) ")).trim();if(!o)return[];if(o.toLowerCase()==="all")return r.map((s,a)=>a);let n=new Set,i=!1;for(let s of o.split(",")){let a=I_(s,r);if(a===null){i=!0;break}n.add(a)}if(!i)return[...n].sort((s,a)=>s-a);e.write(` Use numbers from the list (or unique name prefixes), separated by commas.
|
|
279
|
+
`)}}async function Pn(e,t,r){let o=r.def?"[Y/n]":"[y/N]",n=(await e.ask(`${t} ${o} `)).trim().toLowerCase();return n?n==="y"||n==="yes":r.def}async function Yo(e,t,r={}){let o=r.def!==void 0?` [${r.def}]`:"",n=(await e.ask(`${t}${o}: `)).trim();return n||r.def||n}var Qh=e=>({label:e.name,hint:e.type}),ij=e=>e.capabilities.some(t=>t.type==="color");async function E_(e,t){let o=await Ur(e,"Which agent is this profile for?",[{label:"Claude",hint:"Claude Code sessions"},{label:"Codex",hint:"OpenAI Codex CLI sessions"}],{def:0})===1?"codex":void 0,n=await Yo(e,"Profile name",{def:"New profile"}),i=[];t.devices.length>0?i=(await Zl(e,"Which devices should this profile drive?",t.devices.map(Qh))).map(p=>t.devices[p].id):e.write("(no devices connected yet \u2014 add some with `acbridge scan`, then `acbridge profiles set-state`)\n");let s=i.length>0?await Pn(e,"Pre-wire a starter scene set (working, needs permission, plan ready, error, finished, idle)?",{def:!0}):!1,a=await Pn(e,`Bind to this folder (${t.cwd}) for ${o??"claude"} sessions?`,{def:t.cwdLooksLikeRepo});return e.write(["",` name: ${n}`,` agent: ${o??"claude"}`,` devices: ${i.length===0?"none yet":i.length}`,` starter: ${s?"yes":"no"}`,` binding: ${a?t.cwd:"none"}`,""].join(`
|
|
280
|
+
`)),await Pn(e,"Save profile?",{def:!0})?{name:n,agent:o,deviceIds:i,starter:s,bindCwd:a}:null}async function sj(e,t,r){let o=xs([]);if(r){let s=await Ur(e,"Colour",[{label:"Session",hint:"each session's own palette colour"},{label:"Main",hint:"the device's main colour"},{label:"Custom",hint:"a literal hue,saturation"},{label:"Keep",hint:"leave the colour axis as it is"}],{def:3});if(s===0)o.color="session";else if(s===1)o.color="main";else if(s===2){let l=(await Yo(e,"Hue,Saturation (0-360,0-100)",{def:"200,80"})).split(",").map(u=>Number(u.trim()));l.length===2&&l.every(Number.isFinite)&&(o.color={hue:l[0],saturation:l[1]})}}let n=await Ur(e,"Brightness",[{label:"Keep",hint:"leave as it is"},{label:"Full",hint:"100%"},{label:"Dim",hint:"30% of the main brightness"},{label:"Custom %"}],{def:0});if(n===1)o.brightness=100;else if(n===2)o.scale=.3;else if(n===3){let s=Number(await Yo(e,"Brightness %",{def:"60"}));Number.isFinite(s)&&(o.brightness=Math.max(0,Math.min(100,s)))}let i=await Ur(e,"Power",[{label:"Auto",hint:"on when the look has something to show"},{label:"Force on"},{label:"Force off"}],{def:0});return i===0?o.power="auto":i===1?o.power="on":i===2&&(o.power="off"),o}function aj(e,t){let r=Hl(e,t);return[...r.curated,...r.advanced]}async function A_(e,t,r,o){let n=t,i=!1;for(;;){let s=await Ur(e,`Editing "${n.name}" (${n.agent??"claude"})`,[{label:"Rename"},{label:"Device scope",hint:`${n.deviceScope.length} device${n.deviceScope.length===1?"":"s"}`},{label:"Edit a state",hint:"looks, thresholds, enable/disable"},{label:"Done"}],{def:3});if(s===3)break;if(s===0){let S=await Yo(e,"New name",{def:n.name});S&&S!==n.name&&(n=en.parse({...n,name:S}),i=!0);continue}if(s===1){if(r.length===0){e.write("no devices connected \u2014 `acbridge scan` finds some first\n");continue}let S=await Zl(e,"Devices this profile drives (replaces the current scope; EMPTY keeps it as is)",r.map(Qh));if(S.length===0){e.write(` scope unchanged
|
|
281
|
+
`);continue}let I=S.map(z=>r[z].id),_=n.deviceScope.filter(z=>!I.includes(z)),C=Object.fromEntries(Object.entries(n.states).map(([z,F])=>[z,{...F,looks:F.looks.filter(K=>!_.includes(K.deviceId)),actions:F.actions.filter(K=>!_.includes(K.deviceId))}]));n=en.parse({...n,deviceScope:I,states:C}),i=!0;continue}let a=aj(n.agent,o),l=await Ur(e,"Which state?",a.map(S=>({label:S.label,hint:S.hint}))),u=a[l],p=u.event,d=n.states[p]?.enabled??!0,m=await Pn(e,`Keep "${u.label}" enabled?`,{def:d}),f=r.filter(S=>n.deviceScope.includes(S.id)),g=[];f.length>0&&(g=(await Zl(e,"Set the look on which devices?",f.map(Qh))).map(I=>f[I]));let h=xs([]);g.length>0&&(h=await sj(e,p,g.every(ij)),h.devices=g.map(S=>S.id)),h.enable=m;let v=nr[p];if(v){let S=n.states[p]?.threshold??v.default,I=await Yo(e,`Fire at (${v.min}-${v.max} ${v.unitLabel})`,{def:String(S)}),_=Number(I);Number.isFinite(_)&&_>=v.min&&_<=v.max&&(h.threshold=_)}let k=ks(n,p,h,g,[]);if(!k.ok){e.write(` ${k.message}
|
|
282
|
+
`);continue}for(let S of k.result.notes)e.write(` ${S}
|
|
283
|
+
`);n=k.result.profile,i=!0}return i?n:null}import{basename as C_}from"node:path";function P_(e){let t=N(e.workspaceFile);if(!t)return{doc:{},corrupt:!1};try{let r=JSON.parse(t);return r&&typeof r=="object"&&!Array.isArray(r)?{doc:r,corrupt:!1}:{doc:{},corrupt:!0}}catch{return{doc:{},corrupt:!0}}}function rr(e){let t=P_(e).doc.repos;if(!Array.isArray(t))return[];let r=[];for(let o of t){if(!o||typeof o!="object")continue;let n=o;typeof n.path!="string"||!n.path||r.push({path:n.path,name:typeof n.name=="string"&&n.name?n.name:C_(n.path),bridge:typeof n.bridge=="string"&&n.bridge?n.bridge:C_(n.path),branch:typeof n.branch=="string"&&n.branch?n.branch:"\u2014",fav:n.fav===!0})}return r}function ws(e,t){let r=P_(e);if(r.corrupt)throw new Error("workspace.json exists but isn't readable JSON \u2014 fix or remove it first (nothing was written)");let o={...r.doc,repos:t};we(e.workspaceFile,`${JSON.stringify(o,null,2)}
|
|
284
|
+
`,384)}function T_(e,t,r){let o=e!==null&&typeof e=="object"&&!Array.isArray(e)?e:{};return Object.entries(o).filter(n=>typeof n[1]=="string").map(([n,i])=>({repo:n,profile:r.get(i)??`${i} (missing)`,lane:t}))}function lj(e){let t=e??{},o=(Array.isArray(t.profiles)?t.profiles:[]).filter(s=>s!==null&&typeof s=="object").map(s=>({id:typeof s.id=="string"?s.id:"(unknown)",name:typeof s.name=="string"&&s.name.trim()?s.name:"(unnamed)",states:s.states!==null&&typeof s.states=="object"?Object.keys(s.states).length:0,agent:s.agent==="codex"?"codex":"claude"})),n=new Map(o.map(s=>[s.id,s.name])),i=[...T_(t.bindings,"claude",n),...T_(t.codexBindings,"codex",n)];return{profiles:o,bindings:i}}function uj(e){if(e.profiles.length===0)return["no profiles yet \u2014 create one: acbridge profiles create"];let t=e.profiles.map(r=>`${r.name.padEnd(24)} ${r.states} state${r.states===1?"":"s"}${r.agent==="codex"?" [codex]":""} (${r.id})`);if(e.bindings.length>0){t.push("","bindings (repo \u2192 profile):");for(let r of e.bindings)t.push(` ${r.repo} \u2192 ${r.profile} [${r.lane}]`)}return t}var dj={message:"Not signed in. Run `acbridge login` first.",exitCode:3};async function Tn(e,t){let r=(e.auth??(()=>$t({notSignedIn:dj})))();if(!r.ok)return E(r.message,r.exitCode);let o=await(e.fetchConfig??io)(r.token);return o===null?E("couldn't read the profiles document from the relay \u2014 check your connection",1):{token:r.token,config:o,voice:e.voice??je(),json:t,deps:e}}var pj=Jh;async function jr(e,t){try{return await(e.deps.commit??Go)(e.token,r=>{if(qh(r)==="malformed")throw new Error(pj);return b_(r,t(Dt(r)),e.voice)})}catch(r){return{outcome:"raced",message:r instanceof Error?r.message:String(r)}}}function zr(e,t){switch(e.outcome){case"committed":return t(e.version),0;case"unavailable":return E("couldn't read the profiles document from the relay \u2014 check your connection",1);case"conflict-exhausted":return E("profiles changed elsewhere (another device kept editing) \u2014 try again",1);case"raced":return E(e.message,1);default:return E(e.error??"couldn't save profiles",1)}}function Fr(e,t){let r=w_(e.profiles,t);return r.ok?r.profile:r.kind==="ambiguous"?E(`"${t}" matches more than one profile:
|
|
276
285
|
${r.candidates.map(o=>`${o.name} (${o.id})`).join(`
|
|
277
|
-
`)}`,2):E(`no profile matches "${t}" \u2014 see \`acbridge profiles\``,1)}async function
|
|
278
|
-
`);async function d_(e=[],t={}){let r=e.includes("--json");r&&be(!0);let o=e.filter(u=>u!=="--json"),n=o[0]&&!o[0].startsWith("--")?o[0]:"list",i=o[0]===n?o.slice(1):o,s=t.interactive??Jo.isTTY(),a=t.io??Jo,l=TU(o);if(l==="bad")return E("--agent takes claude | codex",2);switch(n){case"list":{let u=await Cn(t,r);if(typeof u=="number")return u;let d=EU(u.config),p=o.includes("--agent")?{...d,profiles:d.profiles.filter(m=>m.agent===(l??"claude"))}:d;if(r)K(p);else for(let m of AU(p))v(m);return 0}case"show":{let u=i[0];if(!u)return E(nr,2);let d=await Cn(t,r);if(typeof d=="number")return d;let p=Ot(d.config),m=Ur(p,u);if(typeof m=="number")return m;let f=Object.entries(p.bindings).filter(([,y])=>y===m.id).map(([y])=>y),g=Object.entries(p.codexBindings).filter(([,y])=>y===m.id).map(([y])=>y);if(r)return K({profile:m,bindings:{claude:f,codex:g}}),0;v(`${m.name} (${m.id}) \u2014 ${m.agent??"claude"}`),v(`scope: ${m.deviceScope.length===0?"no devices":m.deviceScope.join(", ")}`);let h=Object.keys(m.states);if(h.length===0)v("states: none configured \u2014 try `acbridge profiles set-state`");else{v("states:");for(let y of h){let k=m.states[y],_=[`${k.looks.length} look${k.looks.length===1?"":"s"}`,`${k.actions.length} action${k.actions.length===1?"":"s"}`,...k.threshold!==void 0?[`fires at ${k.threshold}`]:[],...k.enabled?[]:["disabled"]];v(` ${y.padEnd(18)} ${_.join(", ")}`)}}for(let y of f)v(`bound: ${y} [claude]`);for(let y of g)v(`bound: ${y} [codex]`);return 0}case"states":{let u=t.voice??Ue(),d=Nl(l,u);if(r){let p=m=>({event:m.event,label:m.label,hint:m.hint,...m.threshold?{threshold:m.threshold}:{}});return K({agent:l??"claude",curated:d.curated.map(p),advanced:d.advanced.map(p)}),0}v(me(`states a ${l??"claude"} profile can react to (use the left column with set-state):`));for(let[p,m]of[["curated",d.curated],["advanced",d.advanced]]){v(`${p}:`);for(let f of m){let g=f.threshold?` (threshold ${f.threshold.min}-${f.threshold.max} ${f.threshold.unitLabel}, default ${f.threshold.defaultPct})`:"";v(` ${f.event.padEnd(18)} ${f.label} \u2014 ${f.hint}${g}`)}}return 0}case"create":{let u=await Cn(t,r);if(typeof u=="number")return u;let d=i.filter((D,Z)=>!D.startsWith("--")&&!["--agent","--devices","--bind"].includes(i[Z-1]??"")),p=d[0];if(d.length>1)return E("one profile name (quote names with spaces)",2);let m=i.includes("--starter"),f=[],g=i.indexOf("--devices");if(g!==-1){let D=i[g+1];if(!D||D.startsWith("--"))return E("--devices takes a comma-separated list",2);f=D.split(",").map(Z=>Z.trim()).filter(Boolean)}let h=i.indexOf("--bind"),y=null;if(h!==-1){let D=i[h+1];y=D&&!D.startsWith("--")&&!d.includes(D)?D:void 0}let k=l,_=[],I=[],S=s&&!r&&i.length===0;if(f.length>0||S){let D=await zh(u);if(typeof D=="number")return D;I=D}if(S){let D=(t.cwd??(()=>process.cwd()))(),Z=await i_(a,{devices:I,cwd:D,cwdLooksLikeRepo:!0});if(!Z)return v("nothing saved"),0;p=Z.name,k=Z.agent,_=Z.deviceIds,m=Z.starter,y=Z.bindCwd?void 0:null}else if(f.length>0){let D=Fh(I,f);if(typeof D=="string")return E(D,2);_=D.map(Z=>Z.id)}m&&_.length===0&&(z("--starter needs devices to wire \u2014 creating a blank profile instead (add some with --devices)"),m=!1);let T=I.filter(D=>_.includes(D.id)).map(D=>({id:D.id,hasColor:D.capabilities.some(Z=>Z.type==="color")})),j=JS(p||"New profile",k),F=Qt.parse({...j,deviceScope:_,states:m?t_(k,T):{}}),J=y===null?null:u_(u,y).key,fe=await Nr(u,D=>({profiles:[...D.profiles,F],...J===null?{bindings:D.bindings,codexBindings:D.codexBindings}:Uh({bindings:D.bindings,codexBindings:D.codexBindings},J,F.id,k)}));return Lr(fe,()=>{$(`created "${F.name}" (${F.id})${m?" with the starter scene set":""}`),J!==null&&$(`bound ${J} \u2192 ${F.name} [${k??"claude"}]`),m||v(`wire a state next: acbridge profiles set-state ${F.id} working --device <name> --color session`),r&&K({ok:!0,profile:F})})}case"rename":{let[u,...d]=i,p=d.join(" ").trim();if(!u||!p)return E(nr,2);let m=await Cn(t,r);if(typeof m=="number")return m;let f=Ur(Ot(m.config),u);if(typeof f=="number")return f;let g=await Nr(m,h=>({...h,profiles:h.profiles.map(y=>y.id===f.id?{...y,name:p}:y)}));return Lr(g,()=>{$(`renamed to "${p}"`),r&&K({ok:!0,id:f.id,name:p})})}case"duplicate":{let[u,...d]=i.filter(h=>!h.startsWith("--"));if(!u)return E(nr,2);let p=await Cn(t,r);if(typeof p=="number")return p;let m=Ur(Ot(p.config),u);if(typeof m=="number")return m;let f={...m,id:Nh(),name:d.join(" ").trim()||`${m.name||"Profile"} copy`},g=await Nr(p,h=>({...h,profiles:[...h.profiles,f]}));return Lr(g,()=>{$(`duplicated "${m.name}" \u2192 "${f.name}" (${f.id})`),r&&K({ok:!0,profile:f})})}case"delete":{let u=i.includes("--yes"),d=i.filter(g=>!g.startsWith("--"))[0];if(!d)return E(nr,2);let p=await Cn(t,r);if(typeof p=="number")return p;let m=Ur(Ot(p.config),d);if(typeof m=="number")return m;if(!u){if(!s||r)return E(`deleting "${m.name}" needs --yes when not on a terminal`,2);if(!await Pn(a,`Delete "${m.name}" and unbind it everywhere?`,{def:!1}))return v("kept"),0}let f=await Nr(p,g=>({profiles:g.profiles.filter(h=>h.id!==m.id),bindings:Object.fromEntries(Object.entries(g.bindings).filter(([,h])=>h!==m.id)),codexBindings:Object.fromEntries(Object.entries(g.codexBindings).filter(([,h])=>h!==m.id))}));return Lr(f,()=>{$(`deleted "${m.name}" (bindings in both lanes pruned)`),r&&K({ok:!0,deleted:m.id})})}case"edit":{let u=i[0];if(!u)return E(nr,2);if(!s||r)return E("`profiles edit` is interactive \u2014 use `profiles set-state` for scripting",2);let d=await Cn(t,r);if(typeof d=="number")return d;let p=Ur(Ot(d.config),u);if(typeof p=="number")return p;let m=await zh(d);if(typeof m=="number")return m;let f=await s_(a,p,m,d.voice);if(!f)return v("no changes"),0;let g=await Nr(d,h=>{if(!h.profiles.some(y=>y.id===f.id))throw new Error(`"${p.name}" was deleted on another device while you edited \u2014 nothing saved`);return{...h,profiles:h.profiles.map(y=>y.id===f.id?f:y)}});return Lr(g,()=>$(`saved "${f.name}"`))}case"set-state":{let[u,d,...p]=i;if(!u||!d)return E(nr,2);let m=vs(p);if(m.bad)return E(m.bad,2);let f=await Cn(t,r);if(typeof f=="number")return f;let g=Ur(Ot(f.config),u);if(typeof g=="number")return g;if(!ss.options.includes(d))return E(`"${d}" isn't a session state \u2014 see \`acbridge profiles states --agent ${g.agent??"claude"}\``,2);let h=d;if(!Dl(g.agent,h))return E(`a ${g.agent??"claude"} profile can't react to "${h}" \u2014 see \`acbridge profiles states --agent ${g.agent??"claude"}\``,2);let y=[],k=[];if(m.devices.length>0||m.clearDevices.length>0){let S=await zh(f);if(typeof S=="number")return S;let T=Fh(S,m.devices);if(typeof T=="string")return E(T,2);y=T;let j=Fh(S,m.clearDevices);if(typeof j=="string")return E(j,2);k=j}let _=ys(g,h,m,y,k);if(!_.ok)return E(_.message,2);for(let S of _.result.notes)$(S);let I=await Nr(f,S=>{let T=S.profiles.find(F=>F.id===g.id);if(!T)throw new Error(`"${g.name}" was deleted on another device \u2014 nothing saved`);let j=ys(T,h,m,y,k);if(!j.ok)throw new Error(j.message);return{...S,profiles:S.profiles.map(F=>F.id===g.id?j.result.profile:F)}});return Lr(I,S=>{$(`${g.name} \xB7 ${h} updated`),r&&K({ok:!0,profile:g.id,state:h,version:S})})}case"bind":case"unbind":{let u=n==="bind",d=u?i.filter((j,F)=>!j.startsWith("--")&&i[F-1]!=="--repo"&&i[F-1]!=="--agent")[0]:void 0;if(u&&!d)return E(nr,2);let p,m=i.indexOf("--repo");if(m!==-1&&(p=i[m+1],!p||p.startsWith("--")))return E("--repo needs a path or a repos-list name",2);let f=await Cn(t,r);if(typeof f=="number")return f;let g=Ot(f.config),h=u?Ur(g,d):null;if(typeof h=="number")return h;let{key:y,note:k}=u_(f,p);k&&z(k);let _=o.includes("--agent"),I=_?l:u&&h.agent==="codex"?"codex":l;u&&_&&(l??"claude")!==(h.agent??"claude")&&z(`"${h.name}" is a ${h.agent??"claude"} profile \u2014 a ${l??"claude"}-lane binding for it never fires`);let S=Lh(I);if(!u&&g[S][y]===void 0)return v(`nothing bound to ${y} in the ${I??"claude"} lane`),0;let T=await Nr(f,j=>({profiles:j.profiles,...Uh({bindings:j.bindings,codexBindings:j.codexBindings},y,u?h.id:null,I)}));return Lr(T,()=>{u?$(`bound ${y} \u2192 ${h.name} [${I??"claude"}]`):$(`unbound ${y} [${I??"claude"}]`),r&&K({ok:!0,repo:y,lane:I??"claude",...u?{profile:h.id}:{unbound:!0}})})}default:return E(nr,2)}}async function p_(e=[]){let t=e[0],r=e.slice(1).join(" ").trim();if(!t||!r)return x("Usage: acbridge rename <device> <new name>"),2;let o=await _r();if(!o.ok)return x(o.message),3;let n=await q("/local/devices",{method:"GET",timeoutMs:5e3});if(n.hubOffline||n.status!==200||!n.body)return x(Fe()),1;let i=Kn(n.body.devices,t);if(!i.ok){if(i.kind==="ambiguous"){x(`"${t}" matches several devices:`);for(let l of i.candidates)v(` ${l.name} (${l.id})`)}else x(`no device matches "${t}" \u2014 try \`acbridge devices\``);return 2}let s={deviceId:i.device.id,name:r},a=await q("/local/rename",{method:"POST",body:s,timeoutMs:8e3});return!a.hubOffline&&a.status===200&&a.body?.ok?($(`renamed ${i.device.name} \u2192 ${r}`),0):(x(a.body?.error??`rename failed (HTTP ${a.status??"offline"})`),1)}import{spawn as RU}from"node:child_process";import{chmodSync as OU,openSync as DU,writeFileSync as NU}from"node:fs";var LU="Usage: acbridge start [--no-revert] [--attach] [--json]",m_=35;function UU(e){let t=e.daemonPidRaw?Number(e.daemonPidRaw):0;return t>0&&(e.identifiable||e.hubUp)?"already-running":t>0?"stale-pid":"proceed"}function jU(e,t){return e.daemonAlive?e.hubUp&&(t||e.session==="active"||e.session==="unavailable")?"ready":"waiting":"died"}async function Ul(e=[]){let t=e.includes("--json");t&&be(!0);let r=e.includes("--no-revert"),o=e.includes("--attach"),n=e.find(f=>!["--json","--no-revert","--attach"].includes(f));if(n!==void 0)return x(`unknown option: ${n}`),v(LU),2;let i=await Fo();if(!i.ok)return x(i.message),i.exitCode;await Ut(de().relayUrl);let s=N(Qe),a=s?Number(s):0,l=UU({daemonPidRaw:s,identifiable:a>0&&jo({pid:a}),hubUp:await Ne()});if(l==="already-running")return $(`bridge already running (daemon pid ${a})`),t&&K({started:!1,alreadyRunning:!0}),0;l==="stale-pid"&&(ve(Qe),se("removed a stale daemon.pid")),ve(Si);let u=r?["--no-revert"]:[];if(o)return v("running the bridge keeper in the foreground (Ctrl-C to stop)\u2026"),fl(u);let d=Kw(u);NU(Ln,"",{mode:384}),OU(Ln,384);let p=DU(Ln,"a"),m=RU(d.file,d.args,{cwd:ln,detached:!0,stdio:["ignore",p,p],env:process.env});m.unref(),se(`bridge keeper starting (pid ${m.pid??"?"})`);for(let f=0;f<m_;f++){await FU(1e3);let g={daemonAlive:m.pid?aa(m.pid):!1,hubUp:await Ne(),session:await zU()},h=jU(g,r);if(h==="ready"){let y=r?"revert-on-stop off":g.session==="active"?"revert-on-stop armed":"session probe unavailable (older hub)";return $(`bridge running \u2014 hub up, ${y}`),v("stop it with: acbridge stop"),t&&K({started:!0,revertOnStop:!r,session:g.session}),0}if(h==="died"){x("the bridge keeper exited during startup");let y=N(Ln);return y&&v(me(f_(y,8))),1}}x(`timed out waiting for the bridge to come up (${m_}s)`);for(let f of[Ln,wt]){let g=N(f);g?.trim()&&v(me(f_(g,6)))}return 1}async function zU(){let e=await q("/local/session",{method:"GET",timeoutMs:3e3});return e.hubOffline||e.status!==200||!e.body?"unavailable":e.body.active?"active":"inactive"}function f_(e,t){return e.trimEnd().split(`
|
|
286
|
+
`)}`,2):E(`no profile matches "${t}" \u2014 see \`acbridge profiles\``,1)}async function ev(e){let t=await(e.deps.graph??Ar)();return t&&"refusal"in t?E(t.refusal.message,t.refusal.exitCode):t?.doc.devices??[]}function tv(e,t){let r=[];for(let o of t){let n=Yn(e,o);if(!n.ok)return n.kind==="ambiguous"?`"${o}" matches more than one device: ${n.candidates.map(i=>i.name).join(" | ")}`:`no device matches "${o}" \u2014 see \`acbridge devices\``;r.push(n.device)}return r}function R_(e,t){if(t===void 0)return{key:(e.deps.cwd??(()=>process.cwd()))()};let r=(e.deps.repos??(()=>{let o=De();return o?rr(o):null}))();if(r){let o=t.toLowerCase(),n=r.filter(i=>i.name.toLowerCase()===o||i.bridge.toLowerCase()===o);if(n.length===1)return{key:n[0].path}}return t.includes("/")||t.includes("\\")||t.startsWith(".")?{key:cj(t)}:{key:t,note:`"${t}" isn't in the repos list \u2014 stored as a NAME binding (matches any repo folder named ${t})`}}var mj=e=>{let t=e.indexOf("--agent");if(t===-1)return;let r=e[t+1];if(r!=="claude")return r==="codex"?"codex":"bad"},or=["Usage: acbridge profiles [list] [--agent claude|codex] [--json]"," acbridge profiles show <profile> [--json]"," acbridge profiles states [--agent claude|codex] [--json]"," acbridge profiles create [<name>] [--agent claude|codex] [--devices <id|name>,...] [--starter] [--bind [<repo>]] [--json]"," acbridge profiles rename <profile> <new-name> [--json]"," acbridge profiles duplicate <profile> [<new-name>] [--json]"," acbridge profiles delete <profile> [--yes] [--json]"," acbridge profiles edit <profile>"," acbridge profiles set-state <profile> <state> [--device <d>]... [--color main|session|<h>,<s>|none]"," [--brightness <0-100>|none | --scale <0-2>] [--kelvin <k>|none] [--power on|off|auto]"," [--return main|session|hold|off] [--hold] [--effect-json '<spec>'] [--action <cap.cmd>]"," [--param k=v]... [--instance <i>] [--threshold <n>] [--models <m>,... [--direction becomes|leaves]]"," [--allow-security] [--announce on|off] [--enable|--disable] [--clear] [--clear-device <d>]..."," acbridge profiles bind <profile> [--repo <path|name>] [--agent claude|codex] [--json]"," acbridge profiles unbind [--repo <path|name>] [--agent claude|codex] [--json]"].join(`
|
|
287
|
+
`);async function O_(e=[],t={}){let r=e.includes("--json");r&&ye(!0);let o=e.filter(u=>u!=="--json"),n=o[0]&&!o[0].startsWith("--")?o[0]:"list",i=o[0]===n?o.slice(1):o,s=t.interactive??Xo.isTTY(),a=t.io??Xo,l=mj(o);if(l==="bad")return E("--agent takes claude | codex",2);switch(n){case"list":{let u=await Tn(t,r);if(typeof u=="number")return u;let p=lj(u.config),d=o.includes("--agent")?{...p,profiles:p.profiles.filter(m=>m.agent===(l??"claude"))}:p;if(r)q(d);else for(let m of uj(d))b(m);return 0}case"show":{let u=i[0];if(!u)return E(or,2);let p=await Tn(t,r);if(typeof p=="number")return p;let d=Dt(p.config),m=Fr(d,u);if(typeof m=="number")return m;let f=Object.entries(d.bindings).filter(([,v])=>v===m.id).map(([v])=>v),g=Object.entries(d.codexBindings).filter(([,v])=>v===m.id).map(([v])=>v);if(r)return q({profile:m,bindings:{claude:f,codex:g}}),0;b(`${m.name} (${m.id}) \u2014 ${m.agent??"claude"}`),b(`scope: ${m.deviceScope.length===0?"no devices":m.deviceScope.join(", ")}`),b(`agent device awareness: ${m.agentDeviceAwareness?"on":"off"} (the in-chat device brief \u2014 see \`acbridge brief\`)`);let h=Object.keys(m.states);if(h.length===0)b("states: none configured \u2014 try `acbridge profiles set-state`");else{b("states:");for(let v of h){let k=m.states[v],S=[`${k.looks.length} look${k.looks.length===1?"":"s"}`,`${k.actions.length} action${k.actions.length===1?"":"s"}`,...k.threshold!==void 0?[`fires at ${k.threshold}`]:[],...k.enabled?[]:["disabled"]];b(` ${v.padEnd(18)} ${S.join(", ")}`)}}for(let v of f)b(`bound: ${v} [claude]`);for(let v of g)b(`bound: ${v} [codex]`);return 0}case"states":{let u=t.voice??je(),p=Hl(l,u);if(r){let d=m=>({event:m.event,label:m.label,hint:m.hint,...m.threshold?{threshold:m.threshold}:{}});return q({agent:l??"claude",curated:p.curated.map(d),advanced:p.advanced.map(d)}),0}b(me(`states a ${l??"claude"} profile can react to (use the left column with set-state):`));for(let[d,m]of[["curated",p.curated],["advanced",p.advanced]]){b(`${d}:`);for(let f of m){let g=f.threshold?` (threshold ${f.threshold.min}-${f.threshold.max} ${f.threshold.unitLabel}, default ${f.threshold.defaultPct})`:"";b(` ${f.event.padEnd(18)} ${f.label} \u2014 ${f.hint}${g}`)}}return 0}case"create":{let u=await Tn(t,r);if(typeof u=="number")return u;let p=i.filter((D,B)=>!D.startsWith("--")&&!["--agent","--devices","--bind"].includes(i[B-1]??"")),d=p[0];if(p.length>1)return E("one profile name (quote names with spaces)",2);let m=i.includes("--starter"),f=[],g=i.indexOf("--devices");if(g!==-1){let D=i[g+1];if(!D||D.startsWith("--"))return E("--devices takes a comma-separated list",2);f=D.split(",").map(B=>B.trim()).filter(Boolean)}let h=i.indexOf("--bind"),v=null;if(h!==-1){let D=i[h+1];v=D&&!D.startsWith("--")&&!p.includes(D)?D:void 0}let k=l,S=[],I=[],_=s&&!r&&i.length===0;if(f.length>0||_){let D=await ev(u);if(typeof D=="number")return D;I=D}if(_){let D=(t.cwd??(()=>process.cwd()))(),B=await E_(a,{devices:I,cwd:D,cwdLooksLikeRepo:!0});if(!B)return b("nothing saved"),0;d=B.name,k=B.agent,S=B.deviceIds,m=B.starter,v=B.bindCwd?void 0:null}else if(f.length>0){let D=tv(I,f);if(typeof D=="string")return E(D,2);S=D.map(B=>B.id)}m&&S.length===0&&(j("--starter needs devices to wire \u2014 creating a blank profile instead (add some with --devices)"),m=!1);let C=I.filter(D=>S.includes(D.id)).map(D=>({id:D.id,hasColor:D.capabilities.some(B=>B.type==="color")})),z=v_(d||"New profile",k),F=en.parse({...z,deviceScope:S,states:m?S_(k,C):{}}),K=v===null?null:R_(u,v).key,he=await jr(u,D=>({profiles:[...D.profiles,F],...K===null?{bindings:D.bindings,codexBindings:D.codexBindings}:Yh({bindings:D.bindings,codexBindings:D.codexBindings},K,F.id,k)}));return zr(he,()=>{$(`created "${F.name}" (${F.id})${m?" with the starter scene set":""}`),K!==null&&$(`bound ${K} \u2192 ${F.name} [${k??"claude"}]`),m||b(`wire a state next: acbridge profiles set-state ${F.id} working --device <name> --color session`),r&&q({ok:!0,profile:F})})}case"rename":{let[u,...p]=i,d=p.join(" ").trim();if(!u||!d)return E(or,2);let m=await Tn(t,r);if(typeof m=="number")return m;let f=Fr(Dt(m.config),u);if(typeof f=="number")return f;let g=await jr(m,h=>({...h,profiles:h.profiles.map(v=>v.id===f.id?{...v,name:d}:v)}));return zr(g,()=>{$(`renamed to "${d}"`),r&&q({ok:!0,id:f.id,name:d})})}case"duplicate":{let[u,...p]=i.filter(h=>!h.startsWith("--"));if(!u)return E(or,2);let d=await Tn(t,r);if(typeof d=="number")return d;let m=Fr(Dt(d.config),u);if(typeof m=="number")return m;let f={...m,id:Kh(),name:p.join(" ").trim()||`${m.name||"Profile"} copy`},g=await jr(d,h=>({...h,profiles:[...h.profiles,f]}));return zr(g,()=>{$(`duplicated "${m.name}" \u2192 "${f.name}" (${f.id})`),r&&q({ok:!0,profile:f})})}case"delete":{let u=i.includes("--yes"),p=i.filter(g=>!g.startsWith("--"))[0];if(!p)return E(or,2);let d=await Tn(t,r);if(typeof d=="number")return d;let m=Fr(Dt(d.config),p);if(typeof m=="number")return m;if(!u){if(!s||r)return E(`deleting "${m.name}" needs --yes when not on a terminal`,2);if(!await Pn(a,`Delete "${m.name}" and unbind it everywhere?`,{def:!1}))return b("kept"),0}let f=await jr(d,g=>({profiles:g.profiles.filter(h=>h.id!==m.id),bindings:Object.fromEntries(Object.entries(g.bindings).filter(([,h])=>h!==m.id)),codexBindings:Object.fromEntries(Object.entries(g.codexBindings).filter(([,h])=>h!==m.id))}));return zr(f,()=>{$(`deleted "${m.name}" (bindings in both lanes pruned)`),r&&q({ok:!0,deleted:m.id})})}case"edit":{let u=i[0];if(!u)return E(or,2);if(!s||r)return E("`profiles edit` is interactive \u2014 use `profiles set-state` for scripting",2);let p=await Tn(t,r);if(typeof p=="number")return p;let d=Fr(Dt(p.config),u);if(typeof d=="number")return d;let m=await ev(p);if(typeof m=="number")return m;let f=await A_(a,d,m,p.voice);if(!f)return b("no changes"),0;let g=await jr(p,h=>{if(!h.profiles.some(v=>v.id===f.id))throw new Error(`"${d.name}" was deleted on another device while you edited \u2014 nothing saved`);return{...h,profiles:h.profiles.map(v=>v.id===f.id?f:v)}});return zr(g,()=>$(`saved "${f.name}"`))}case"set-state":{let[u,p,...d]=i;if(!u||!p)return E(or,2);let m=xs(d);if(m.bad)return E(m.bad,2);let f=await Tn(t,r);if(typeof f=="number")return f;let g=Fr(Dt(f.config),u);if(typeof g=="number")return g;if(!ls.options.includes(p))return E(`"${p}" isn't a session state \u2014 see \`acbridge profiles states --agent ${g.agent??"claude"}\``,2);let h=p;if(!Bl(g.agent,h))return E(`a ${g.agent??"claude"} profile can't react to "${h}" \u2014 see \`acbridge profiles states --agent ${g.agent??"claude"}\``,2);let v=[],k=[];if(m.devices.length>0||m.clearDevices.length>0){let _=await ev(f);if(typeof _=="number")return _;let C=tv(_,m.devices);if(typeof C=="string")return E(C,2);v=C;let z=tv(_,m.clearDevices);if(typeof z=="string")return E(z,2);k=z}let S=ks(g,h,m,v,k);if(!S.ok)return E(S.message,2);for(let _ of S.result.notes)$(_);let I=await jr(f,_=>{let C=_.profiles.find(F=>F.id===g.id);if(!C)throw new Error(`"${g.name}" was deleted on another device \u2014 nothing saved`);let z=ks(C,h,m,v,k);if(!z.ok)throw new Error(z.message);return{..._,profiles:_.profiles.map(F=>F.id===g.id?z.result.profile:F)}});return zr(I,_=>{$(`${g.name} \xB7 ${h} updated`),r&&q({ok:!0,profile:g.id,state:h,version:_})})}case"bind":case"unbind":{let u=n==="bind",p=u?i.filter((z,F)=>!z.startsWith("--")&&i[F-1]!=="--repo"&&i[F-1]!=="--agent")[0]:void 0;if(u&&!p)return E(or,2);let d,m=i.indexOf("--repo");if(m!==-1&&(d=i[m+1],!d||d.startsWith("--")))return E("--repo needs a path or a repos-list name",2);let f=await Tn(t,r);if(typeof f=="number")return f;let g=Dt(f.config),h=u?Fr(g,p):null;if(typeof h=="number")return h;let{key:v,note:k}=R_(f,d);k&&j(k);let S=o.includes("--agent"),I=S?l:u&&h.agent==="codex"?"codex":l;u&&S&&(l??"claude")!==(h.agent??"claude")&&j(`"${h.name}" is a ${h.agent??"claude"} profile \u2014 a ${l??"claude"}-lane binding for it never fires`);let _=Xh(I);if(!u&&g[_][v]===void 0)return b(`nothing bound to ${v} in the ${I??"claude"} lane`),0;let C=await jr(f,z=>({profiles:z.profiles,...Yh({bindings:z.bindings,codexBindings:z.codexBindings},v,u?h.id:null,I)}));return zr(C,()=>{u?$(`bound ${v} \u2192 ${h.name} [${I??"claude"}]`):$(`unbound ${v} [${I??"claude"}]`),r&&q({ok:!0,repo:v,lane:I??"claude",...u?{profile:h.id}:{unbound:!0}})})}default:return E(or,2)}}async function D_(e=[]){let t=e[0],r=e.slice(1).join(" ").trim();if(!t||!r)return x("Usage: acbridge rename <device> <new name>"),2;let o=await Ir();if(!o.ok)return x(o.message),3;let n=await W("/local/devices",{method:"GET",timeoutMs:5e3});if(n.hubOffline||n.status!==200||!n.body)return x(Te()),1;let i=Yn(n.body.devices,t);if(!i.ok){if(i.kind==="ambiguous"){x(`"${t}" matches several devices:`);for(let l of i.candidates)b(` ${l.name} (${l.id})`)}else x(`no device matches "${t}" \u2014 try \`acbridge devices\``);return 2}let s={deviceId:i.device.id,name:r},a=await W("/local/rename",{method:"POST",body:s,timeoutMs:8e3});return!a.hubOffline&&a.status===200&&a.body?.ok?($(`renamed ${i.device.name} \u2192 ${r}`),0):(x(a.body?.error??`rename failed (HTTP ${a.status??"offline"})`),1)}import{spawn as fj}from"node:child_process";import{chmodSync as gj,openSync as hj,writeFileSync as vj}from"node:fs";var bj="Usage: acbridge start [--no-revert] [--attach] [--json]",N_=35;function yj(e){let t=e.daemonPidRaw?Number(e.daemonPidRaw):0;return t>0&&(e.identifiable||e.hubUp)?"already-running":t>0?"stale-pid":"proceed"}function xj(e,t){return e.daemonAlive?e.hubUp&&(t||e.session==="active"||e.session==="unavailable")?"ready":"waiting":"died"}async function Gl(e=[]){let t=e.includes("--json");t&&ye(!0);let r=e.includes("--no-revert"),o=e.includes("--attach"),n=e.find(f=>!["--json","--no-revert","--attach"].includes(f));if(n!==void 0)return x(`unknown option: ${n}`),b(bj),2;let i=await Ho();if(!i.ok)return x(i.message),i.exitCode;await jt(de().relayUrl);let s=N(Qe),a=s?Number(s):0,l=yj({daemonPidRaw:s,identifiable:a>0&&Mo({pid:a}),hubUp:await Le()});if(l==="already-running")return $(`bridge already running (daemon pid ${a})`),t&&q({started:!1,alreadyRunning:!0}),0;l==="stale-pid"&&(ve(Qe),se("removed a stale daemon.pid")),ve(Ii);let u=r?["--no-revert"]:[];if(o)return b("running the bridge keeper in the foreground (Ctrl-C to stop)\u2026"),wl(u);let p=h0(u);vj(Un,"",{mode:384}),gj(Un,384);let d=hj(Un,"a"),m=fj(p.file,p.args,{cwd:un,detached:!0,stdio:["ignore",d,d],env:process.env});m.unref(),se(`bridge keeper starting (pid ${m.pid??"?"})`);for(let f=0;f<N_;f++){await wj(1e3);let g={daemonAlive:m.pid?ga(m.pid):!1,hubUp:await Le(),session:await kj()},h=xj(g,r);if(h==="ready"){let v=r?"revert-on-stop off":g.session==="active"?"revert-on-stop armed":"session probe unavailable (older hub)";return $(`bridge running \u2014 hub up, ${v}`),b("stop it with: acbridge stop"),t&&q({started:!0,revertOnStop:!r,session:g.session}),0}if(h==="died"){x("the bridge keeper exited during startup");let v=N(Un);return v&&b(me(L_(v,8))),1}}x(`timed out waiting for the bridge to come up (${N_}s)`);for(let f of[Un,St]){let g=N(f);g?.trim()&&b(me(L_(g,6)))}return 1}async function kj(){let e=await W("/local/session",{method:"GET",timeoutMs:3e3});return e.hubOffline||e.status!==200||!e.body?"unavailable":e.body.active?"active":"inactive"}function L_(e,t){return e.trimEnd().split(`
|
|
279
288
|
`).slice(-t).join(`
|
|
280
|
-
`)}function
|
|
281
|
-
`),
|
|
282
|
-
${g.join(", ")}`:""}`)}return 0}case"add":{let m=n.slice(1).join(" ").trim();if(!m)return E(
|
|
283
|
-
${
|
|
284
|
-
`)}`,2);if(!
|
|
285
|
-
${g.candidates.map(
|
|
286
|
-
`)}`,2);if(!g.group)return E(`no group matches "${f}" \u2014 see \`acbridge groups\``,1);let h=await(t.graph??
|
|
287
|
-
`);async function
|
|
288
|
-
${
|
|
289
|
+
`)}function wj(e){return new Promise(t=>setTimeout(t,e))}async function U_(e=[],t={}){let r=await(t.stop??tr)([]);return r!==0?r:(t.start??Gl)(e)}var Ss=["Usage: acbridge groups [list] [--json]"," acbridge groups add <name>"," acbridge groups rename <id|name> <new-name>"," acbridge groups remove <id|name> [--yes]"," acbridge groups assign <device> <group>"," acbridge groups unassign <device> <group>"].join(`
|
|
290
|
+
`),Sj={message:"Not signed in. Run `acbridge login` first.",exitCode:3};function Wl(e){return e.deviceGroups!==void 0&&!Sl.safeParse(e.deviceGroups).success?"this account's device groups are unreadable by this CLI version \u2014 update acbridge (nothing was written)":null}function j_(e,t){let r=e.find(s=>s.id===t);if(r)return{group:r};let o=t.toLowerCase(),n=e.filter(s=>s.name.toLowerCase()===o);if(n.length===1)return{group:n[0]};let i=n.length>1?n:e.filter(s=>s.name.toLowerCase().includes(o));return i.length===1?{group:i[0]}:i.length>1?{candidates:i}:{}}function _j(e,t,r,o){let n=Er.safeParse(e.deviceSettings);if(e.deviceSettings!==void 0&&!n.success)return{error:"this machine's device settings are unreadable by this CLI version \u2014 update acbridge (nothing was written)"};let i=n.success?n.data:{},s=i[t]??Zo.parse({}),a=o?[...new Set([...s.groups,r])]:s.groups.filter(l=>l!==r);return{config:{...e,deviceSettings:{...i,[t]:{...s,groups:a}}}}}function $j(e){let t=Er.safeParse(e.deviceSettings),r=new Map;if(!t.success)return r;for(let[o,n]of Object.entries(t.data))for(let i of n.groups)r.set(i,[...r.get(i)??[],o]);return r}var Ij=()=>`grp_${Date.now().toString(36)}${Math.random().toString(36).slice(2,6)}`;function Vl(e,t){return e.outcome==="committed"?(t(),0):e.outcome==="unavailable"?E("couldn't read the groups document from the relay \u2014 check your connection",1):e.outcome==="conflict-exhausted"?E("groups changed elsewhere \u2014 try again",1):E(e.error??"couldn't save groups",1)}async function z_(e=[],t={}){let r=e.includes("--json");r&&ye(!0);let o=e.includes("--yes"),n=e.filter(m=>m!=="--json"&&m!=="--yes"),i=n[0]??"list",s=t.interactive??Xo.isTTY(),a=t.io??Xo,l=(t.auth??(()=>$t({notSignedIn:Sj})))();if(!l.ok)return E(l.message,l.exitCode);let u=await(t.fetchConfig??io)(l.token);if(u===null)return E("couldn't read the groups document from the relay \u2014 check your connection",1);let p=ms(u),d=t.commit??Go;switch(i){case"list":{let m=$j(u);if(r)return q({groups:p.map(f=>({...f,devices:m.get(f.id)??[]}))}),0;if(p.length===0)b("no groups yet \u2014 add one: acbridge groups add <name>");else for(let f of p){let g=m.get(f.id)??[];b(`${f.name.padEnd(20)} ${g.length} device${g.length===1?"":"s"} ${me(`(${f.id})`)}${g.length>0?`
|
|
291
|
+
${g.join(", ")}`:""}`)}return 0}case"add":{let m=n.slice(1).join(" ").trim();if(!m)return E(Ss,2);let f=Wl(u);if(f)return E(f,1);let g=Ij(),h=await d(l.token,v=>{let k=Wl(v);if(k)throw new Error(k);return U0(v,g,m)??v});return Vl(h,()=>{$(`added "${m}" (${g})`),r&&q({ok:!0,id:g,name:m})})}case"rename":case"remove":case"assign":case"unassign":{if(i==="rename"||i==="remove"){let _=n[1];if(!_)return E(Ss,2);let C=j_(p,_);if(C.candidates)return E(`"${_}" matches more than one group:
|
|
292
|
+
${C.candidates.map(F=>`${F.name} (${F.id})`).join(`
|
|
293
|
+
`)}`,2);if(!C.group)return E(`no group matches "${_}" \u2014 see \`acbridge groups\``,1);if(i==="rename"){let F=n.slice(2).join(" ").trim();if(!F)return E(Ss,2);let K=Wl(u);if(K)return E(K,1);let he=await d(l.token,D=>{let B=Wl(D);if(B)throw new Error(B);return j0(D,C.group.id,F)??D});return Vl(he,()=>{$(`renamed "${C.group.name}" \u2192 "${F}"`),r&&q({ok:!0,id:C.group.id,name:F})})}if(!o){if(!s||r)return E(`removing "${C.group.name}" prunes its membership from every device \u2014 add --yes`,2);if(!await Pn(a,`Remove "${C.group.name}" and prune it from every device?`,{def:!1}))return b("kept"),0}let z=await d(l.token,F=>z0(F,C.group.id));return Vl(z,()=>{$(`removed "${C.group.name}" (membership pruned from every device)`),r&&q({ok:!0,removed:C.group.id})})}let m=n[1],f=n[2];if(!m||!f)return E(Ss,2);let g=j_(p,f);if(g.candidates)return E(`"${f}" matches more than one group:
|
|
294
|
+
${g.candidates.map(_=>`${_.name} (${_.id})`).join(`
|
|
295
|
+
`)}`,2);if(!g.group)return E(`no group matches "${f}" \u2014 see \`acbridge groups\``,1);let h=await(t.graph??Ar)();if(h&&"refusal"in h)return E(h.refusal.message,h.refusal.exitCode);let v=h&&"doc"in h?h.doc.devices:[],k=Yn(v,m);if(!k.ok)return E(k.kind==="ambiguous"?`"${m}" matches more than one device: ${k.candidates.map(_=>_.name).join(" | ")}`:`no device matches "${m}" \u2014 see \`acbridge devices\``,2);let S=i==="assign",I=await d(l.token,_=>{let C=_j(_,k.device.id,g.group.id,S);if("error"in C)throw new Error(C.error);return C.config}).catch(_=>({outcome:"error",error:_ instanceof Error?_.message:String(_)}));return Vl(I,()=>{$(`${k.device.name} ${S?"\u2192":"\xD7"} ${g.group.name}`),r&&q({ok:!0,deviceId:k.device.id,group:g.group.id,member:S})})}default:return E(Ss,2)}}var Ej=/^\/\/(?:wsl\.localhost|wsl\$)\/([^/]+)(\/.*)?$/i,Aj=/^\/mnt\/([a-zA-Z])(\/.*)?$/;var Cj=e=>e.replace(/\\/g,"/");function F_(e){let t=Cj(e),r=Ej.exec(t);if(r)return r[2]??"/";let o=Aj.exec(t);return o?`${o[1]?.toLowerCase()}:${o[2]??"/"}`.toLowerCase():/^[a-zA-Z]:/.test(t)?t.toLowerCase():t}function nv(e,t){let r=F_(e.replace(/\\/g,"/")),o=F_(t.replace(/\\/g,"/"));if(o===r)return!0;let n=r.endsWith("/")?r:r+"/";return!!(o.startsWith(n)||!r.includes("/")&&o.replace(/\/+$/,"").split("/").pop()?.toLowerCase()===r.toLowerCase())}import{existsSync as Pj,statSync as Tj}from"node:fs";import{resolve as M_}from"node:path";var Qo=["Usage: acbridge repos [list] [--refresh] [--json]"," acbridge repos add <path> [--root] [--name <label>] [--json]"," acbridge repos remove <path|name> [--json]"].join(`
|
|
296
|
+
`);async function Rj(){let e=Mt();if(e.state!=="ok")return null;let t=await io(e.token);if(!t)return null;let r=Dt(t);return{bindings:r.bindings,codexBindings:r.codexBindings}}function Oj(e){try{return Pj(e)&&Tj(e).isDirectory()}catch{return!1}}function Dj(e){if(e.length===0)return["no bridges yet \u2014 add one: acbridge repos add <path>"];let t=Math.max(6,...e.map(n=>(n.bridge||n.name).length)),r=Math.max(6,...e.map(n=>n.branch.length)),o=[me(`${"BRIDGE".padEnd(t+2)}${"BRANCH".padEnd(r+2)}PATH`)];for(let n of e)o.push(`${n.fav?"\u2605 ":" "}${(n.bridge||n.name).padEnd(t)}${n.branch.padEnd(r+2)}${n.path}`.trimEnd());return o}function rv(e,t){let r=M_(t),o=e.find(a=>a.path===t||a.path===r);if(o)return{row:o};let n=t.toLowerCase(),i=e.filter(a=>a.name.toLowerCase()===n||a.bridge.toLowerCase()===n);if(i.length===1)return{row:i[0]};if(i.length>1)return{candidates:i};let s=e.filter(a=>a.name.toLowerCase().startsWith(n)||a.bridge.toLowerCase().startsWith(n));return s.length===1?{row:s[0]}:s.length>1?{candidates:s}:{}}async function B_(e=[],t={}){try{return await Nj(e,t)}catch(r){return E(r instanceof Error?r.message:String(r),1)}}async function Nj(e,t){let r=e.includes("--json");r&&ye(!0);let o=e.filter(a=>a!=="--json"),n=o[0]??"list",i=(t.paths??De)();if(!i)return E("Not signed in. Run `acbridge login` first.",3);let s=a=>{if(r)q({repos:a});else for(let l of Dj(a))b(l);return 0};switch(n){case"list":{let a=o.includes("--refresh");if(o.filter(u=>u!=="--refresh").length>1)return E(Qo,2);let l=rr(i);return a&&(l=Qb(l),ws(i,l)),s(l)}case"add":{let a=!1,l,u=[],p=o.slice(1);for(let h=0;h<p.length;h+=1){let v=p[h];if(v==="--root")a=!0;else if(v==="--name"){if(l=p[h+1],!l||l.startsWith("--"))return E(Qo,2);h+=1}else{if(v.startsWith("--"))return E(`unknown flag: ${v}
|
|
297
|
+
${Qo}`,2);u.push(v)}}let d=u[0];if(!d||u.length>1)return E(Qo,2);if(a&&l!==void 0)return E("--name labels ONE bridge \u2014 it can't apply to a --root import.",2);let m=M_(d);if(!Oj(m))return E(`not a folder: ${m}`,2);let f=rr(i),g=Yb(f,m,a?"root":"single");return g.length===f.length?l!==void 0&&!a?(g=Bu(f,m,{bridge:l}),ws(i,g),$("already in the list \u2014 label updated"),s(g)):($(a?"nothing new under that root \u2014 every subfolder is already in the list":"already in the list"),s(f)):(l!==void 0&&(g=Bu(g,m,{bridge:l})),ws(i,g),$(`added ${g.length-f.length} bridge${g.length-f.length===1?"":"s"}`),s(g))}case"remove":{let a=o[1];if(!a||o.length>2)return E(Qo,2);let l=rr(i),u=rv(l,a);if(u.candidates)return E(`"${a}" matches more than one bridge:
|
|
289
298
|
${u.candidates.map(m=>`${m.name} (${m.path})`).join(`
|
|
290
|
-
`)}`,2);if(!u.row)return E(`no bridge matches "${a}" \u2014 see \`acbridge repos list\``,1);let
|
|
299
|
+
`)}`,2);if(!u.row)return E(`no bridge matches "${a}" \u2014 see \`acbridge repos list\``,1);let p=await(t.fetchBindings??Rj)();if(p){let m=[...Object.keys(p.bindings).filter(f=>nv(f,u.row.path)).map(f=>`claude: ${f}`),...Object.keys(p.codexBindings).filter(f=>nv(f,u.row.path)).map(f=>`codex: ${f}`)];m.length>0&&j(`this repo still has profile bindings (they keep firing \u2014 unbind with \`acbridge profiles unbind\`):
|
|
291
300
|
${m.join(`
|
|
292
|
-
`)}`)}let p=l.filter(m=>m.path!==u.row.path);return bs(i,p),$(`removed ${u.row.bridge||u.row.name}`),s(p)}default:return E(Xo,2)}}import{spawnSync as rI}from"node:child_process";import{randomUUID as c2}from"node:crypto";import{existsSync as l2,mkdirSync as u2,statSync as d2,writeFileSync as p2}from"node:fs";import m2 from"node:os";import Os from"node:path";import{createInterface as f2}from"node:readline";import{spawn as Hz,spawnSync as Zz}from"node:child_process";import{randomUUID as Gz}from"node:crypto";import{readFileSync as Wz}from"node:fs";import{request as Vz}from"node:http";import{createInterface as qz}from"node:readline";import{readFileSync as Ez}from"node:fs";var xz=rn(g$(),1),kz=rn(ql(),1),wz=rn(ei(),1),Sz=rn(Qh(),1),_z=rn(nv(),1),$z=rn(cv(),1),As=rn(Yl(),1),Iz=rn(S$(),1);var _$=100;function $$(e){let t=null,r=!1,o=1e3,n=null,i=[],s=()=>"endpoint"in e?e.endpoint():{port:e.port,tokenFile:e.tokenFile},a=p=>{try{return Ez(p,"utf8").trim()}catch(m){return console.error(`[channel] cannot read hub token file ${p}:`,m),""}},l=p=>(i.push(p),i.length>_$&&(i.shift(),console.error(`[channel] outbound buffer at cap (${_$}); dropped oldest frame`)),!0),u=p=>{for(;i.length>0&&p.readyState===As.default.OPEN;){let m=i.shift();m&&p.send(JSON.stringify(m))}},d=()=>{if(r)return;let{port:p,tokenFile:m}=s(),f=a(m),g=new As.default(`ws://${e.host??"127.0.0.1"}:${p}`,{headers:{"x-bridge-hub-token":f}});t=g;let h=!0,y=null;g.on("open",()=>{o=1e3;let k=e.hello?.();k&&g.send(JSON.stringify(k)),u(g),h=!0,y=setInterval(()=>{if(!h){g.terminate();return}h=!1;try{g.ping()}catch{}},3e4)}),g.on("pong",()=>{h=!0}),g.on("message",k=>{try{e.onMessage(Ew(k.toString()))}catch(_){console.error("[channel] bad hub frame:",_)}}),g.on("error",k=>console.error("[channel] hub ws error:",k)),g.on("close",()=>{if(y&&(clearInterval(y),y=null),t===g&&(t=null),r)return;let k=o;o=Math.min(o*2,5e3),n=setTimeout(d,k)})};return d(),{send:p=>{if(r)return!1;let m=t;return m&&m.readyState===As.default.OPEN&&i.length===0?(m.send(JSON.stringify(p)),!0):l(p)},close:()=>{r=!0,n&&clearTimeout(n),t?.close()}}}var ce=e=>e;var I$=ce({id:"ActivateScene",target:"hub",customHandler:!0,scaffold:!0,carrier:"scene",utterances:["activate {scene} scene","activate scene {scene}","run scene {scene}","start {scene} scene"],slots:[{name:"scene",type:"SceneName",dynamic:!0,elicitationPrompts:["Which scene?"]}],customTypes:[{name:"SceneName",values:["movie night","good morning","bedtime","focus"]}],deviceCommands:[{capability:"scene",command:"activate"}],args:c.object({scene:c.string()}),result:c.object({ok:c.boolean()}),fromSlots:e=>({scene:e.scene??""}),ackSpeech:()=>"",speak:()=>""});var E$=ce({id:"Attach",target:"hub",skillLocal:!0,carrier:"attach",utterances:["attach to {target}","attach","switch to {target}","use {target}"],slots:[{name:"target",type:"SessionName",required:!0,dynamic:!0,elicitationPrompts:["Which session?","Which one would you like to attach to?"]}],customTypes:[{name:"SessionName",values:["one","two","three","four","five","six","seven","eight","nine","ten"]}],args:c.object({target:c.string()}),result:c.object({name:c.string()}),precheck:(e,t)=>t.sessionCount===0?"No sessions are running yet.":null,fromSlots:e=>({target:e.target??""}),ackSpeech:()=>"",speak:e=>`Entered ${e.name}.`});var A$=ce({id:"AttachBridge",target:"hub",skillLocal:!0,attachLevel:"bridge",carrier:"bridge",utterances:["attach to bridge {bridge}","switch to bridge {bridge}","open bridge {bridge}","go to bridge {bridge}"],slots:[{name:"bridge",type:"BridgeName",required:!0,dynamic:!0,elicitationPrompts:["Which bridge?","Which bridge would you like to attach to?"]}],customTypes:[{name:"BridgeName",values:["one","two","three","four","five","six","seven","eight","nine","ten"]}],args:c.object({target:c.string()}),result:c.object({name:c.string()}),precheck:(e,t)=>(t.bridgeCount??0)===0?"No bridges have a running session yet.":null,fromSlots:e=>({target:e.bridge??""}),ackSpeech:()=>"",speak:e=>`Entered ${e.name}.`});var P$=ce({id:"ControlDevice",target:"hub",customHandler:!0,scaffold:!0,carrier:"turn",utterances:["turn on {device}","turn off {device}","turn on the {device}","turn off the {device}","toggle {device}"],slots:[{name:"device",type:"DeviceName",dynamic:!0,elicitationPrompts:["Which device?"]}],customTypes:[{name:"DeviceName",values:["light","lamp","fan","plug","heater"]}],deviceCommands:[{capability:"power",command:"turnOn"},{capability:"power",command:"turnOff"},{capability:"power",command:"toggle"}],args:c.object({device:c.string()}),result:c.object({ok:c.boolean()}),fromSlots:e=>({device:e.device??""}),ackSpeech:()=>"",speak:()=>""});var C$=ce({id:"ControlGroup",target:"hub",customHandler:!0,scaffold:!0,carrier:"group",utterances:["turn on the {group} group","turn off the {group} group","turn off {group} group"],slots:[{name:"group",type:"GroupName",dynamic:!0,elicitationPrompts:["Which group or room?"]}],customTypes:[{name:"GroupName",values:["living room","bedroom","kitchen","office","studio"]}],deviceCommands:[{capability:"power",command:"turnOn"},{capability:"power",command:"turnOff"}],args:c.object({group:c.string()}),result:c.object({ok:c.boolean()}),fromSlots:e=>({group:e.group??""}),ackSpeech:()=>"",speak:()=>""});var T$=e=>`In the current working directory, ${e}. Keep the answer brief enough to be read aloud.`;var R$=ce({id:"GitStatus",target:"session",carrier:"git",utterances:["git status","what's the git status","any uncommitted changes in git"],slots:[],args:c.object({}),result:c.object({}),fromSlots:()=>({}),ackSpeech:()=>"Asking git status.",speak:()=>"",render:()=>T$("run git status and report the current branch and any uncommitted changes")});var Az=c.object({index:c.number().int().positive(),name:c.string(),id:c.string(),sessionCount:c.number().int().nonnegative()}),O$=ce({id:"ListBridges",target:"hub",carrier:"bridge",utterances:["list bridges","list my bridges","what bridges do I have","what bridges are running","which bridges are running"],slots:[],args:c.object({}),result:c.object({bridges:c.array(Az)}),speaksResult:!0,cacheSource:"bridges",providesBridgeCatalog:!0,fromSlots:()=>({}),ackSpeech:()=>"",speak:e=>{let t=e.bridges.length;if(t===0)return"No bridges have a running session.";let r=e.bridges.map(o=>`${o.index}, ${o.name}`).join("; ");return`${t} bridge${t===1?"":"s"}: ${r}.`}});var Pz=c.object({name:c.string(),type:c.string(),room:c.string().nullable(),online:c.boolean()}),Cz=c.object({provider:c.string(),status:c.string()}),D$=ce({id:"ListDevices",target:"hub",carrier:"device",utterances:["list devices","list my devices","what devices do I have","what devices are online"],slots:[],args:c.object({}),result:c.object({devices:c.array(Pz),accounts:c.array(Cz)}),speaksResult:!0,cacheSource:"devices",fromSlots:()=>({}),ackSpeech:()=>"",speak:e=>{let t=e.accounts.filter(i=>i.status!=="linked"),r=t.length?` ${t.map(i=>`${i.provider} needs re-linking`).join("; ")}.`:"",o=e.devices.length;if(o===0)return`No devices are connected.${r}`;let n=e.devices.filter(i=>i.online).length;return`${o} device${o===1?"":"s"}, ${n} online.${r}`}});var Tz=c.object({index:c.number().int().positive(),name:c.string(),id:c.string()}),N$=ce({id:"ListSessions",target:"hub",carrier:"session",utterances:["list sessions","list my sessions","what sessions do I have","what sessions are running"],slots:[],args:c.object({}),result:c.object({sessions:c.array(Tz)}),speaksResult:!0,cacheSource:"sessions",providesSessionCatalog:!0,fromSlots:()=>({}),ackSpeech:()=>"",speak:e=>{let t=e.sessions.length;if(t===0)return"No sessions are running.";let r=e.sessions.map(o=>`${o.index}, ${o.name}`).join("; ");return`${t} session${t===1?"":"s"}: ${r}.`}});var L$=ce({id:"ReadMore",target:"hub",carrier:"more",utterances:["read more","continue reading","keep reading"],slots:[],args:c.object({}),result:Qc,speaksResult:!0,cacheSource:"output",fromSlots:()=>({}),ackSpeech:()=>"",speak:e=>e.latestReply?e.hasMore?`${e.latestReply} Say read more to continue.`:e.latestReply:"That's the end of the output."});var U$=ce({id:"ReadOutput",target:"hub",carrier:"output",utterances:["read output","read the output","what's the output","read reply","read the reply","what's the reply","read the last reply","read it","replies","read replies","dev replies","any replies","latest reply"],slots:[],args:c.object({}),result:Qc,speaksResult:!0,cacheSource:"output",fromSlots:()=>({}),ackSpeech:()=>"",speak:e=>e.latestReply?e.hasMore?`${e.latestReply} Say read more to continue.`:e.latestReply:"No output yet."});var Rz=c.object({index:c.number().int().positive(),name:c.string(),id:c.string(),sessionCount:c.number().int().nonnegative()}),j$=ce({id:"RenameBridge",target:"hub",relayMutation:!0,customHandler:!0,carrier:"bridge",utterances:["rename bridge {bridge}","rename a bridge","rename this bridge","rename the bridge","rename this bridge to {name}","rename the bridge to {name}","call the bridge {name}"],slots:[{name:"bridge",type:"BridgeName",dynamic:!0},{name:"name",type:"AMAZON.SearchQuery",allowFreeText:!0}],args:c.object({name:c.string(),bridgeId:c.string().optional()}),result:c.object({bridges:c.array(Rz)}),providesBridgeCatalog:!0,precheck:e=>e.name.trim()?null:"What would you like to call it?",fromSlots:e=>({name:(e.name??"").trim()}),ackSpeech:e=>`Okay, I'll call it ${e.name}.`,speak:()=>""});var Oz=c.object({index:c.number().int().positive(),name:c.string(),id:c.string()}),z$=ce({id:"RenameSession",target:"hub",relayMutation:!0,customHandler:!0,carrier:"rename",utterances:["rename","rename a session","rename this session","rename the session","rename it","rename {target}","rename session {target}","rename to {name}","rename this session to {name}","call it {name}"],slots:[{name:"target",type:"SessionName",dynamic:!0},{name:"name",type:"AMAZON.SearchQuery",allowFreeText:!0}],args:c.object({name:c.string()}),result:c.object({sessions:c.array(Oz)}),providesSessionCatalog:!0,precheck:e=>e.name.trim()?null:"What would you like to call it?",fromSlots:e=>({name:(e.name??"").trim()}),ackSpeech:e=>`Okay, I'll call it ${e.name}.`,speak:()=>""});var F$=ce({id:"Return",target:"hub",skillLocal:!0,clearsAttach:!0,carrier:"return",utterances:["return","go back","back to the main menu","main menu","leave the session","leave this session"],slots:[],args:c.object({}),result:c.object({}),fromSlots:()=>({}),ackSpeech:()=>"",speak:()=>"Back at the main menu."});var M$=ce({id:"SetBrightness",target:"hub",customHandler:!0,scaffold:!0,carrier:"brightness",utterances:["set brightness of {device} to {level}","set {device} brightness to {level}","dim {device} to {level}"],slots:[{name:"device",type:"DeviceName",dynamic:!0,elicitationPrompts:["Which device?"]},{name:"level",type:"AMAZON.NUMBER",elicitationPrompts:["What level, 0 to 100?"]}],customTypes:[{name:"DeviceName",values:["light","lamp","fan","plug","heater"]}],deviceCommands:[{capability:"brightness",command:"setBrightness"}],args:c.object({device:c.string(),level:c.number()}),result:c.object({ok:c.boolean()}),fromSlots:e=>({device:e.device??"",level:Number(e.level??0)}),ackSpeech:()=>"",speak:()=>""});var B$=ce({id:"SetTemperature",target:"hub",customHandler:!0,scaffold:!0,carrier:"temperature",utterances:["set temperature of {device} to {temperature}","set {device} temperature to {temperature}","set {device} to {temperature} degrees"],slots:[{name:"device",type:"DeviceName",dynamic:!0,elicitationPrompts:["Which thermostat?"]},{name:"temperature",type:"AMAZON.NUMBER",elicitationPrompts:["What temperature?"]}],customTypes:[{name:"DeviceName",values:["light","lamp","fan","plug","heater"]}],deviceCommands:[{capability:"thermostat",command:"setSetpoint"}],args:c.object({device:c.string(),temperature:c.number()}),result:c.object({ok:c.boolean()}),fromSlots:e=>({device:e.device??"",temperature:Number(e.temperature??0)}),ackSpeech:()=>"",speak:()=>""});var H$=[I$,E$,A$,P$,C$,R$,O$,D$,N$,L$,U$,j$,z$,F$,M$,B$],Z$=new Map(H$.map(e=>[e.id,e])),l7=new Map(H$.map(e=>[`${e.id}Intent`,e]));function G$(e){if(e.type==="prompt")return e.text;let t=Z$.get(e.id);if(!t?.render)throw new Error(`channel got command "${e.id}" with no render() \u2014 not a session-target command`);return t.render(t.args.parse(e.args))}var Dz=new Set(["item/commandExecution/requestApproval","item/fileChange/requestApproval","item/permissions/requestApproval"]);function W$(e){return{decision:e}}var Nz="Added to the current turn.",V$="late verdict dropped",Lz="approve? [y/n/a]",uv="Codex restarted before this prompt ran \u2014 please resend.",Uz=16e3;function Pe(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:{}}function q$(e){let t=e.replace(/\\/g,"/").replace(/\/+$/,""),r=t.lastIndexOf("/");return(r>=0?t.slice(r+1):t)||e}function J$(e){return(Array.isArray(e)?e.map(String).join(" "):typeof e=="string"?e:"").replace(/\s+/g," ").trim()}function jz(e){return e.replace(/^```.*\n?/gm,"").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1")}function zz(e,t){return e.length>t?e.slice(0,t):e}function Fz(e){let t=Pe(e),r=t.codexErrorInfo,o=typeof r=="string"?r:r&&typeof r=="object"?String(Pe(r).kind??Pe(r).code??""):"",n=typeof t.message=="string"?t.message:"",i=`${o} ${n}`;return/usagelimitexceeded/i.test(i)?"rateLimited":/contextwindowexceeded/i.test(i)?"contextCritical":"error"}function Mz(e,t,r,o,n){let i=Pe(t);switch(e){case"item/commandExecution/requestApproval":{let s=J$(i.command),a=typeof i.cwd=="string"&&i.cwd?i.cwd:n,{command:l,cwd:u,...d}=i;return{type:"permission_request",sessionId:r,requestId:o,tool:"Shell",description:`\`${s}\` in ${q$(a)}`,preview:JSON.stringify({command:s,cwd:a,...d})}}case"item/fileChange/requestApproval":{let a=(Array.isArray(i.files)?i.files:[]).map(d=>typeof d=="string"?d:Pe(d).path).filter(d=>typeof d=="string"&&d.length>0),l=a.slice(0,3).map(q$).join(", "),u=a.length>3?", \u2026":"";return{type:"permission_request",sessionId:r,requestId:o,tool:"File change",description:`edit ${a.length} file(s): ${l}${u}`,preview:JSON.stringify(i)}}case"item/permissions/requestApproval":{let s=typeof i.mode=="string"?i.mode:typeof i.requestedMode=="string"?i.requestedMode:"unknown";return{type:"permission_request",sessionId:r,requestId:o,tool:"Permissions",description:`escalate sandbox to ${s}`,preview:JSON.stringify(i)}}default:return{type:"permission_request",sessionId:r,requestId:o,tool:"Approval",description:"approve this action?",preview:JSON.stringify(i)}}}var eu=class{sessionId;cwd;steerSupported;newSeq;turnInFlight=!1;owner=null;queue=[];pendingApprovals=new Map;lastApprovalRequestId=null;planReadyFired=!1;pendingSteerAcks=new Set;constructor(t){this.sessionId=t.sessionId,this.cwd=t.cwd,this.steerSupported=t.steerSupported,this.newSeq=t.newSeq}setSteerSupported(t){this.steerSupported=t}handle(t){switch(t.kind){case"hub":return this.onHub(t.msg);case"notification":return this.onNotification(t.method,t.params);case"server-request":return this.onServerRequest(t.id,t.method,t.params);case"local-line":return this.onLocalInput(t.text);case"local-approval":return this.onLocalApproval(t.behavior);case"steer-ok":return this.onSteerOk(t.requestId);case"sigint":return this.turnInFlight?[{kind:"rpc",method:"turn/interrupt"}]:this.endSession();case"teardown":return this.endSession();case"server-exit":return this.onServerExit();default:return[]}}onHub(t){switch(t.type){case"prompt":return this.onHubInput(t.requestId,t.text);case"command":return this.onHubInput(t.requestId,G$(t));case"permission_verdict":return this.onHubVerdict(t.requestId,t.behavior);default:return[]}}onHubInput(t,r){return this.turnInFlight?this.steerSupported?(this.pendingSteerAcks.add(t),[{kind:"rpc",method:"turn/steer",params:{text:r}}]):(this.queue.push({source:"hub",requestId:t,text:r}),[]):this.startTurn({kind:"hub",requestId:t},r)}onLocalInput(t){return this.turnInFlight?this.steerSupported?[{kind:"rpc",method:"turn/steer",params:{text:t}}]:(this.queue.push({source:"local",text:t}),[]):this.startTurn({kind:"local"},t)}startTurn(t,r){this.turnInFlight=!0,this.owner=t;let o=[{kind:"rpc",method:"turn/start",params:{text:r}}];return t.kind==="hub"&&o.push({kind:"render",channel:"voice",text:`[alexa] ${r}`}),o}onSteerOk(t){return this.pendingSteerAcks.has(t)?(this.pendingSteerAcks.delete(t),[this.replyAction(t,Nz)]):[]}replyAction(t,r){return{kind:"hub-send",msg:{type:"reply",sessionId:this.sessionId,requestId:t,seq:this.newSeq(),text:r,final:!0}}}statePost(t,r){return{kind:"state-post",state:t,event:`codex-adapter:${r}`}}onNotification(t,r){switch(t){case"turn/started":return this.planReadyFired=!1,[this.statePost("working","turn-started")];case"turn/completed":return this.onTurnCompleted(r);case"item/agentMessage/delta":return this.onAgentDelta(r);case"item/started":return this.onItemStarted(r);case"item/completed":return this.onItemCompleted(r);case"item/commandExecution/outputDelta":return this.onOutputDelta(r);case"turn/plan/updated":return this.onPlanUpdated(r);case"thread/tokenUsage/updated":return this.onTokenUsage(r);default:return[]}}onTurnCompleted(t){let r=Pe(t),o=Pe(r.turn),n=typeof o.status=="string"?o.status:typeof r.status=="string"?r.status:"",i=o.error??r.error,s=[];if(n==="completed")s.push(this.statePost("finished","turn-completed"));else if(n==="failed"){if(this.owner?.kind==="hub"){let a=Pe(i),l=typeof a.message=="string"?a.message:"unknown error";s.push(this.replyAction(this.owner.requestId,`Codex hit an error: ${l}`))}s.push(this.statePost(Fz(i),"turn-failed"))}else n==="interrupted"&&s.push(this.statePost("idle","turn-interrupted"));return s.push(...this.finishTurnAndDrain()),s}finishTurnAndDrain(){this.turnInFlight=!1,this.owner=null;let t=this.queue.shift();return t?t.source==="hub"?this.startTurn({kind:"hub",requestId:t.requestId},t.text):this.startTurn({kind:"local"},t.text):[]}onAgentDelta(t){let r=Pe(t).delta;return typeof r=="string"&&r?[{kind:"render",channel:"agent",text:r}]:[]}onItemStarted(t){let r=Pe(Pe(t).item);return r.type==="commandExecution"?[{kind:"render",channel:"tool",text:`$ ${J$(r.command)}`}]:[]}onItemCompleted(t){let r=Pe(Pe(t).item);if(r.type==="agentMessage"){if(this.owner?.kind!=="hub")return[];let o=zz(jz(typeof r.text=="string"?r.text:""),Uz);return[this.replyAction(this.owner.requestId,o)]}if(r.type==="commandExecution"){let o=r.exitCode;return[{kind:"render",channel:"tool",text:typeof o=="number"?`(exit ${o})`:"(done)"}]}return[]}onOutputDelta(t){let r=Pe(t).delta;return typeof r=="string"&&r?[{kind:"render",channel:"tool",text:r}]:[]}onPlanUpdated(t){let r=Pe(t).plan;if(!Array.isArray(r))return[];let o=r.map(n=>({kind:"render",channel:"meta",text:`- ${String(n)}`}));return this.planReadyFired||(this.planReadyFired=!0,o.push(this.statePost("planReady","plan-updated"))),o}onTokenUsage(t){let r=Pe(t),o=Pe(r.tokenUsage),n=Pe(o.total),i=Pe(o.last),s=m=>typeof m=="number"&&Number.isFinite(m)?m:void 0,a=[],l=s(n.inputTokens),u=s(n.outputTokens);l!==void 0&&u!==void 0&&a.push({kind:"usage-post",inputTokens:l,cachedInputTokens:s(n.cachedInputTokens)??0,outputTokens:u});let d=s(i.totalTokens),p=s(o.modelContextWindow);if(d!==void 0&&p!==void 0&&p>0){let m=Math.round(d/p*1e3)/10;a.push({kind:"context-post",pct:m,usedTokens:d,windowTokens:p})}return a}onServerRequest(t,r,o){if(!Dz.has(r))return[];let n=`codex-approval-${this.newSeq()}`,i=Mz(r,o,this.sessionId,n,this.cwd);this.pendingApprovals.set(n,{serverRequestId:t}),this.lastApprovalRequestId=n;let s=r==="item/permissions/requestApproval"?"sandboxEscalation":"needs_permission";return[{kind:"hub-send",msg:i},this.statePost(s,"approval-requested"),{kind:"render",channel:"meta",text:Lz}]}onHubVerdict(t,r){let o=r==="allow"?"accept":"decline",n={kind:"render",channel:"voice",text:r==="allow"?"[alexa] approved":"[alexa] denied"};return this.resolveApproval(t,o,n)}onLocalApproval(t){let r=this.lastApprovalRequestId;if(!r)return[{kind:"render",channel:"meta",text:V$}];let o=t==="allow"?"accept":t==="allow-session"?"acceptForSession":"decline",n=t==="allow"?"approved":t==="allow-session"?"approved for session":"denied";return this.resolveApproval(r,o,{kind:"render",channel:"meta",text:n})}resolveApproval(t,r,o){let n=this.pendingApprovals.get(t);if(!n)return[{kind:"render",channel:"meta",text:V$}];this.pendingApprovals.delete(t),this.lastApprovalRequestId===t&&(this.lastApprovalRequestId=null);let i=r==="decline";return[{kind:"rpc-respond",id:n.serverRequestId,result:W$(r)},this.statePost(i?"permissionDenied":"working",i?"approval-denied":"approval-allowed"),o]}endSession(){let t=[...this.pendingApprovals.values()].map(r=>({kind:"rpc-respond",id:r.serverRequestId,result:W$("decline")}));return this.pendingApprovals.clear(),this.lastApprovalRequestId=null,this.pendingSteerAcks.clear(),[this.statePost("ended","teardown"),...t,{kind:"exit"}]}onServerExit(){let t=[];this.turnInFlight&&t.push(this.statePost("error","server-exit"));for(let r of this.queue)r.source==="hub"&&t.push(this.replyAction(r.requestId,uv));return this.queue=[],this.turnInFlight=!1,this.owner=null,this.pendingApprovals.clear(),this.lastApprovalRequestId=null,this.pendingSteerAcks.clear(),t}};import Bz from"node:path";function K$(e,t){let r=Bz.basename(e)||"session";return{id:`${r}@${t}+codex`,name:`${r} codex (${t})`}}function X$(e){let{sub:t,...r}=e;return{...r,voice:!0,agent:"codex",...t?{sub:t}:{}}}var Ps=class extends Error{code;constructor(t,r){super(`codex app-server error ${t}: ${r}`),this.name="AppServerError",this.code=t}};function dv(e,t){let r=1,o=!1,n="",i=new Map,s=[],a=[],l=[];function u(k){o||e.write(`${JSON.stringify(k)}
|
|
293
|
-
`)}function
|
|
294
|
-
`))>=0;){let I=n.slice(0,
|
|
295
|
-
`);return}if(t==="tool"){this.out.write(
|
|
301
|
+
`)}`)}let d=l.filter(m=>m.path!==u.row.path);return ws(i,d),$(`removed ${u.row.bridge||u.row.name}`),s(d)}default:return E(Qo,2)}}import{spawnSync as $I}from"node:child_process";import{randomUUID as Z2}from"node:crypto";import{existsSync as G2,mkdirSync as W2,statSync as V2,writeFileSync as J2}from"node:fs";import q2 from"node:os";import Ls from"node:path";import{createInterface as K2}from"node:readline";import{spawn as $2,spawnSync as I2}from"node:child_process";import{randomUUID as E2}from"node:crypto";import{readFileSync as A2}from"node:fs";import{request as C2}from"node:http";import{createInterface as P2}from"node:readline";import{readFileSync as l2}from"node:fs";var n2=on(U$(),1),r2=on(nu(),1),o2=on(ni(),1),i2=on(fv(),1),s2=on(vv(),1),a2=on(Sv(),1),Ts=on(su(),1),c2=on(G$(),1);var W$=100;function V$(e){let t=null,r=!1,o=1e3,n=null,i=[],s=()=>"endpoint"in e?e.endpoint():{port:e.port,tokenFile:e.tokenFile},a=d=>{try{return l2(d,"utf8").trim()}catch(m){return console.error(`[channel] cannot read hub token file ${d}:`,m),""}},l=d=>(i.push(d),i.length>W$&&(i.shift(),console.error(`[channel] outbound buffer at cap (${W$}); dropped oldest frame`)),!0),u=d=>{for(;i.length>0&&d.readyState===Ts.default.OPEN;){let m=i.shift();m&&d.send(JSON.stringify(m))}},p=()=>{if(r)return;let{port:d,tokenFile:m}=s(),f=a(m),g=new Ts.default(`ws://${e.host??"127.0.0.1"}:${d}`,{headers:{"x-bridge-hub-token":f}});t=g;let h=!0,v=null;g.on("open",()=>{o=1e3;let k=e.hello?.();k&&g.send(JSON.stringify(k)),u(g),h=!0,v=setInterval(()=>{if(!h){g.terminate();return}h=!1;try{g.ping()}catch{}},3e4)}),g.on("pong",()=>{h=!0}),g.on("message",k=>{try{e.onMessage(Vw(k.toString()))}catch(S){console.error("[channel] bad hub frame:",S)}}),g.on("error",k=>console.error("[channel] hub ws error:",k)),g.on("close",()=>{if(v&&(clearInterval(v),v=null),t===g&&(t=null),r)return;let k=o;o=Math.min(o*2,5e3),n=setTimeout(p,k)})};return p(),{send:d=>{if(r)return!1;let m=t;return m&&m.readyState===Ts.default.OPEN&&i.length===0?(m.send(JSON.stringify(d)),!0):l(d)},close:()=>{r=!0,n&&clearTimeout(n),t?.close()}}}var ce=e=>e;var J$=ce({id:"ActivateScene",target:"hub",customHandler:!0,scaffold:!0,carrier:"scene",utterances:["activate {scene} scene","activate scene {scene}","run scene {scene}","start {scene} scene"],slots:[{name:"scene",type:"SceneName",dynamic:!0,elicitationPrompts:["Which scene?"]}],customTypes:[{name:"SceneName",values:["movie night","good morning","bedtime","focus"]}],deviceCommands:[{capability:"scene",command:"activate"}],args:c.object({scene:c.string()}),result:c.object({ok:c.boolean()}),fromSlots:e=>({scene:e.scene??""}),ackSpeech:()=>"",speak:()=>""});var q$=ce({id:"Attach",target:"hub",skillLocal:!0,carrier:"attach",utterances:["attach to {target}","attach","switch to {target}","use {target}"],slots:[{name:"target",type:"SessionName",required:!0,dynamic:!0,elicitationPrompts:["Which session?","Which one would you like to attach to?"]}],customTypes:[{name:"SessionName",values:["one","two","three","four","five","six","seven","eight","nine","ten"]}],args:c.object({target:c.string()}),result:c.object({name:c.string()}),precheck:(e,t)=>t.sessionCount===0?"No sessions are running yet.":null,fromSlots:e=>({target:e.target??""}),ackSpeech:()=>"",speak:e=>`Entered ${e.name}.`});var K$=ce({id:"AttachBridge",target:"hub",skillLocal:!0,attachLevel:"bridge",carrier:"bridge",utterances:["attach to bridge {bridge}","switch to bridge {bridge}","open bridge {bridge}","go to bridge {bridge}"],slots:[{name:"bridge",type:"BridgeName",required:!0,dynamic:!0,elicitationPrompts:["Which bridge?","Which bridge would you like to attach to?"]}],customTypes:[{name:"BridgeName",values:["one","two","three","four","five","six","seven","eight","nine","ten"]}],args:c.object({target:c.string()}),result:c.object({name:c.string()}),precheck:(e,t)=>(t.bridgeCount??0)===0?"No bridges have a running session yet.":null,fromSlots:e=>({target:e.bridge??""}),ackSpeech:()=>"",speak:e=>`Entered ${e.name}.`});var X$=ce({id:"ControlDevice",target:"hub",customHandler:!0,scaffold:!0,carrier:"turn",utterances:["turn on {device}","turn off {device}","turn on the {device}","turn off the {device}","toggle {device}"],slots:[{name:"device",type:"DeviceName",dynamic:!0,elicitationPrompts:["Which device?"]}],customTypes:[{name:"DeviceName",values:["light","lamp","fan","plug","heater"]}],deviceCommands:[{capability:"power",command:"turnOn"},{capability:"power",command:"turnOff"},{capability:"power",command:"toggle"}],args:c.object({device:c.string()}),result:c.object({ok:c.boolean()}),fromSlots:e=>({device:e.device??""}),ackSpeech:()=>"",speak:()=>""});var Y$=ce({id:"ControlGroup",target:"hub",customHandler:!0,scaffold:!0,carrier:"group",utterances:["turn on the {group} group","turn off the {group} group","turn off {group} group"],slots:[{name:"group",type:"GroupName",dynamic:!0,elicitationPrompts:["Which group or room?"]}],customTypes:[{name:"GroupName",values:["living room","bedroom","kitchen","office","studio"]}],deviceCommands:[{capability:"power",command:"turnOn"},{capability:"power",command:"turnOff"}],args:c.object({group:c.string()}),result:c.object({ok:c.boolean()}),fromSlots:e=>({group:e.group??""}),ackSpeech:()=>"",speak:()=>""});var Q$=e=>`In the current working directory, ${e}. Keep the answer brief enough to be read aloud.`;var eI=ce({id:"GitStatus",target:"session",carrier:"git",utterances:["git status","what's the git status","any uncommitted changes in git"],slots:[],args:c.object({}),result:c.object({}),fromSlots:()=>({}),ackSpeech:()=>"Asking git status.",speak:()=>"",render:()=>Q$("run git status and report the current branch and any uncommitted changes")});var u2=c.object({index:c.number().int().positive(),name:c.string(),id:c.string(),sessionCount:c.number().int().nonnegative()}),tI=ce({id:"ListBridges",target:"hub",carrier:"bridge",utterances:["list bridges","list my bridges","what bridges do I have","what bridges are running","which bridges are running"],slots:[],args:c.object({}),result:c.object({bridges:c.array(u2)}),speaksResult:!0,cacheSource:"bridges",providesBridgeCatalog:!0,fromSlots:()=>({}),ackSpeech:()=>"",speak:e=>{let t=e.bridges.length;if(t===0)return"No bridges have a running session.";let r=e.bridges.map(o=>`${o.index}, ${o.name}`).join("; ");return`${t} bridge${t===1?"":"s"}: ${r}.`}});var d2=c.object({name:c.string(),type:c.string(),room:c.string().nullable(),online:c.boolean()}),p2=c.object({provider:c.string(),status:c.string()}),nI=ce({id:"ListDevices",target:"hub",carrier:"device",utterances:["list devices","list my devices","what devices do I have","what devices are online"],slots:[],args:c.object({}),result:c.object({devices:c.array(d2),accounts:c.array(p2)}),speaksResult:!0,cacheSource:"devices",fromSlots:()=>({}),ackSpeech:()=>"",speak:e=>{let t=e.accounts.filter(i=>i.status!=="linked"),r=t.length?` ${t.map(i=>`${i.provider} needs re-linking`).join("; ")}.`:"",o=e.devices.length;if(o===0)return`No devices are connected.${r}`;let n=e.devices.filter(i=>i.online).length;return`${o} device${o===1?"":"s"}, ${n} online.${r}`}});var m2=c.object({index:c.number().int().positive(),name:c.string(),id:c.string()}),rI=ce({id:"ListSessions",target:"hub",carrier:"session",utterances:["list sessions","list my sessions","what sessions do I have","what sessions are running"],slots:[],args:c.object({}),result:c.object({sessions:c.array(m2)}),speaksResult:!0,cacheSource:"sessions",providesSessionCatalog:!0,fromSlots:()=>({}),ackSpeech:()=>"",speak:e=>{let t=e.sessions.length;if(t===0)return"No sessions are running.";let r=e.sessions.map(o=>`${o.index}, ${o.name}`).join("; ");return`${t} session${t===1?"":"s"}: ${r}.`}});var oI=ce({id:"ReadMore",target:"hub",carrier:"more",utterances:["read more","continue reading","keep reading"],slots:[],args:c.object({}),result:al,speaksResult:!0,cacheSource:"output",fromSlots:()=>({}),ackSpeech:()=>"",speak:e=>e.latestReply?e.hasMore?`${e.latestReply} Say read more to continue.`:e.latestReply:"That's the end of the output."});var iI=ce({id:"ReadOutput",target:"hub",carrier:"output",utterances:["read output","read the output","what's the output","read reply","read the reply","what's the reply","read the last reply","read it","replies","read replies","dev replies","any replies","latest reply"],slots:[],args:c.object({}),result:al,speaksResult:!0,cacheSource:"output",fromSlots:()=>({}),ackSpeech:()=>"",speak:e=>e.latestReply?e.hasMore?`${e.latestReply} Say read more to continue.`:e.latestReply:"No output yet."});var f2=c.object({index:c.number().int().positive(),name:c.string(),id:c.string(),sessionCount:c.number().int().nonnegative()}),sI=ce({id:"RenameBridge",target:"hub",relayMutation:!0,customHandler:!0,carrier:"bridge",utterances:["rename bridge {bridge}","rename a bridge","rename this bridge","rename the bridge","rename this bridge to {name}","rename the bridge to {name}","call the bridge {name}"],slots:[{name:"bridge",type:"BridgeName",dynamic:!0},{name:"name",type:"AMAZON.SearchQuery",allowFreeText:!0}],args:c.object({name:c.string(),bridgeId:c.string().optional()}),result:c.object({bridges:c.array(f2)}),providesBridgeCatalog:!0,precheck:e=>e.name.trim()?null:"What would you like to call it?",fromSlots:e=>({name:(e.name??"").trim()}),ackSpeech:e=>`Okay, I'll call it ${e.name}.`,speak:()=>""});var g2=c.object({index:c.number().int().positive(),name:c.string(),id:c.string()}),aI=ce({id:"RenameSession",target:"hub",relayMutation:!0,customHandler:!0,carrier:"rename",utterances:["rename","rename a session","rename this session","rename the session","rename it","rename {target}","rename session {target}","rename to {name}","rename this session to {name}","call it {name}"],slots:[{name:"target",type:"SessionName",dynamic:!0},{name:"name",type:"AMAZON.SearchQuery",allowFreeText:!0}],args:c.object({name:c.string()}),result:c.object({sessions:c.array(g2)}),providesSessionCatalog:!0,precheck:e=>e.name.trim()?null:"What would you like to call it?",fromSlots:e=>({name:(e.name??"").trim()}),ackSpeech:e=>`Okay, I'll call it ${e.name}.`,speak:()=>""});var cI=ce({id:"Return",target:"hub",skillLocal:!0,clearsAttach:!0,carrier:"return",utterances:["return","go back","back to the main menu","main menu","leave the session","leave this session"],slots:[],args:c.object({}),result:c.object({}),fromSlots:()=>({}),ackSpeech:()=>"",speak:()=>"Back at the main menu."});var lI=ce({id:"SetBrightness",target:"hub",customHandler:!0,scaffold:!0,carrier:"brightness",utterances:["set brightness of {device} to {level}","set {device} brightness to {level}","dim {device} to {level}"],slots:[{name:"device",type:"DeviceName",dynamic:!0,elicitationPrompts:["Which device?"]},{name:"level",type:"AMAZON.NUMBER",elicitationPrompts:["What level, 0 to 100?"]}],customTypes:[{name:"DeviceName",values:["light","lamp","fan","plug","heater"]}],deviceCommands:[{capability:"brightness",command:"setBrightness"}],args:c.object({device:c.string(),level:c.number()}),result:c.object({ok:c.boolean()}),fromSlots:e=>({device:e.device??"",level:Number(e.level??0)}),ackSpeech:()=>"",speak:()=>""});var uI=ce({id:"SetTemperature",target:"hub",customHandler:!0,scaffold:!0,carrier:"temperature",utterances:["set temperature of {device} to {temperature}","set {device} temperature to {temperature}","set {device} to {temperature} degrees"],slots:[{name:"device",type:"DeviceName",dynamic:!0,elicitationPrompts:["Which thermostat?"]},{name:"temperature",type:"AMAZON.NUMBER",elicitationPrompts:["What temperature?"]}],customTypes:[{name:"DeviceName",values:["light","lamp","fan","plug","heater"]}],deviceCommands:[{capability:"thermostat",command:"setSetpoint"}],args:c.object({device:c.string(),temperature:c.number()}),result:c.object({ok:c.boolean()}),fromSlots:e=>({device:e.device??"",temperature:Number(e.temperature??0)}),ackSpeech:()=>"",speak:()=>""});var dI=[J$,q$,K$,X$,Y$,eI,tI,nI,rI,oI,iI,sI,aI,cI,lI,uI],pI=new Map(dI.map(e=>[e.id,e])),fY=new Map(dI.map(e=>[`${e.id}Intent`,e]));function mI(e){if(e.type==="prompt")return e.text;let t=pI.get(e.id);if(!t?.render)throw new Error(`channel got command "${e.id}" with no render() \u2014 not a session-target command`);return t.render(t.args.parse(e.args))}var h2=new Set(["item/commandExecution/requestApproval","item/fileChange/requestApproval","item/permissions/requestApproval"]);function fI(e){return{decision:e}}var v2="Added to the current turn.",gI="late verdict dropped",b2="approve? [y/n/a]",$v="Codex restarted before this prompt ran \u2014 please resend.",y2=16e3;function Ce(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:{}}function hI(e){let t=e.replace(/\\/g,"/").replace(/\/+$/,""),r=t.lastIndexOf("/");return(r>=0?t.slice(r+1):t)||e}function vI(e){return(Array.isArray(e)?e.map(String).join(" "):typeof e=="string"?e:"").replace(/\s+/g," ").trim()}function x2(e){return e.replace(/^```.*\n?/gm,"").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1")}function k2(e,t){return e.length>t?e.slice(0,t):e}function w2(e){let t=Ce(e),r=t.codexErrorInfo,o=typeof r=="string"?r:r&&typeof r=="object"?String(Ce(r).kind??Ce(r).code??""):"",n=typeof t.message=="string"?t.message:"",i=`${o} ${n}`;return/usagelimitexceeded/i.test(i)?"rateLimited":/contextwindowexceeded/i.test(i)?"contextCritical":"error"}function S2(e,t,r,o,n){let i=Ce(t);switch(e){case"item/commandExecution/requestApproval":{let s=vI(i.command),a=typeof i.cwd=="string"&&i.cwd?i.cwd:n,{command:l,cwd:u,...p}=i;return{type:"permission_request",sessionId:r,requestId:o,tool:"Shell",description:`\`${s}\` in ${hI(a)}`,preview:JSON.stringify({command:s,cwd:a,...p})}}case"item/fileChange/requestApproval":{let a=(Array.isArray(i.files)?i.files:[]).map(p=>typeof p=="string"?p:Ce(p).path).filter(p=>typeof p=="string"&&p.length>0),l=a.slice(0,3).map(hI).join(", "),u=a.length>3?", \u2026":"";return{type:"permission_request",sessionId:r,requestId:o,tool:"File change",description:`edit ${a.length} file(s): ${l}${u}`,preview:JSON.stringify(i)}}case"item/permissions/requestApproval":{let s=typeof i.mode=="string"?i.mode:typeof i.requestedMode=="string"?i.requestedMode:"unknown";return{type:"permission_request",sessionId:r,requestId:o,tool:"Permissions",description:`escalate sandbox to ${s}`,preview:JSON.stringify(i)}}default:return{type:"permission_request",sessionId:r,requestId:o,tool:"Approval",description:"approve this action?",preview:JSON.stringify(i)}}}var cu=class{sessionId;cwd;steerSupported;newSeq;turnInFlight=!1;owner=null;queue=[];pendingApprovals=new Map;lastApprovalRequestId=null;planReadyFired=!1;pendingSteerAcks=new Set;constructor(t){this.sessionId=t.sessionId,this.cwd=t.cwd,this.steerSupported=t.steerSupported,this.newSeq=t.newSeq}setSteerSupported(t){this.steerSupported=t}handle(t){switch(t.kind){case"hub":return this.onHub(t.msg);case"notification":return this.onNotification(t.method,t.params);case"server-request":return this.onServerRequest(t.id,t.method,t.params);case"local-line":return this.onLocalInput(t.text);case"local-approval":return this.onLocalApproval(t.behavior);case"steer-ok":return this.onSteerOk(t.requestId);case"sigint":return this.turnInFlight?[{kind:"rpc",method:"turn/interrupt"}]:this.endSession();case"teardown":return this.endSession();case"server-exit":return this.onServerExit();default:return[]}}onHub(t){switch(t.type){case"prompt":return this.onHubInput(t.requestId,t.text);case"command":return this.onHubInput(t.requestId,mI(t));case"permission_verdict":return this.onHubVerdict(t.requestId,t.behavior);default:return[]}}onHubInput(t,r){return this.turnInFlight?this.steerSupported?(this.pendingSteerAcks.add(t),[{kind:"rpc",method:"turn/steer",params:{text:r}}]):(this.queue.push({source:"hub",requestId:t,text:r}),[]):this.startTurn({kind:"hub",requestId:t},r)}onLocalInput(t){return this.turnInFlight?this.steerSupported?[{kind:"rpc",method:"turn/steer",params:{text:t}}]:(this.queue.push({source:"local",text:t}),[]):this.startTurn({kind:"local"},t)}startTurn(t,r){this.turnInFlight=!0,this.owner=t;let o=[{kind:"rpc",method:"turn/start",params:{text:r}}];return t.kind==="hub"&&o.push({kind:"render",channel:"voice",text:`[alexa] ${r}`}),o}onSteerOk(t){return this.pendingSteerAcks.has(t)?(this.pendingSteerAcks.delete(t),[this.replyAction(t,v2)]):[]}replyAction(t,r){return{kind:"hub-send",msg:{type:"reply",sessionId:this.sessionId,requestId:t,seq:this.newSeq(),text:r,final:!0}}}statePost(t,r){return{kind:"state-post",state:t,event:`codex-adapter:${r}`}}onNotification(t,r){switch(t){case"turn/started":return this.planReadyFired=!1,[this.statePost("working","turn-started")];case"turn/completed":return this.onTurnCompleted(r);case"item/agentMessage/delta":return this.onAgentDelta(r);case"item/started":return this.onItemStarted(r);case"item/completed":return this.onItemCompleted(r);case"item/commandExecution/outputDelta":return this.onOutputDelta(r);case"turn/plan/updated":return this.onPlanUpdated(r);case"thread/tokenUsage/updated":return this.onTokenUsage(r);default:return[]}}onTurnCompleted(t){let r=Ce(t),o=Ce(r.turn),n=typeof o.status=="string"?o.status:typeof r.status=="string"?r.status:"",i=o.error??r.error,s=[];if(n==="completed")s.push(this.statePost("finished","turn-completed"));else if(n==="failed"){if(this.owner?.kind==="hub"){let a=Ce(i),l=typeof a.message=="string"?a.message:"unknown error";s.push(this.replyAction(this.owner.requestId,`Codex hit an error: ${l}`))}s.push(this.statePost(w2(i),"turn-failed"))}else n==="interrupted"&&s.push(this.statePost("idle","turn-interrupted"));return s.push(...this.finishTurnAndDrain()),s}finishTurnAndDrain(){this.turnInFlight=!1,this.owner=null;let t=this.queue.shift();return t?t.source==="hub"?this.startTurn({kind:"hub",requestId:t.requestId},t.text):this.startTurn({kind:"local"},t.text):[]}onAgentDelta(t){let r=Ce(t).delta;return typeof r=="string"&&r?[{kind:"render",channel:"agent",text:r}]:[]}onItemStarted(t){let r=Ce(Ce(t).item);return r.type==="commandExecution"?[{kind:"render",channel:"tool",text:`$ ${vI(r.command)}`}]:[]}onItemCompleted(t){let r=Ce(Ce(t).item);if(r.type==="agentMessage"){if(this.owner?.kind!=="hub")return[];let o=k2(x2(typeof r.text=="string"?r.text:""),y2);return[this.replyAction(this.owner.requestId,o)]}if(r.type==="commandExecution"){let o=r.exitCode;return[{kind:"render",channel:"tool",text:typeof o=="number"?`(exit ${o})`:"(done)"}]}return[]}onOutputDelta(t){let r=Ce(t).delta;return typeof r=="string"&&r?[{kind:"render",channel:"tool",text:r}]:[]}onPlanUpdated(t){let r=Ce(t).plan;if(!Array.isArray(r))return[];let o=r.map(n=>({kind:"render",channel:"meta",text:`- ${String(n)}`}));return this.planReadyFired||(this.planReadyFired=!0,o.push(this.statePost("planReady","plan-updated"))),o}onTokenUsage(t){let r=Ce(t),o=Ce(r.tokenUsage),n=Ce(o.total),i=Ce(o.last),s=m=>typeof m=="number"&&Number.isFinite(m)?m:void 0,a=[],l=s(n.inputTokens),u=s(n.outputTokens);l!==void 0&&u!==void 0&&a.push({kind:"usage-post",inputTokens:l,cachedInputTokens:s(n.cachedInputTokens)??0,outputTokens:u});let p=s(i.totalTokens),d=s(o.modelContextWindow);if(p!==void 0&&d!==void 0&&d>0){let m=Math.round(p/d*1e3)/10;a.push({kind:"context-post",pct:m,usedTokens:p,windowTokens:d})}return a}onServerRequest(t,r,o){if(!h2.has(r))return[];let n=`codex-approval-${this.newSeq()}`,i=S2(r,o,this.sessionId,n,this.cwd);this.pendingApprovals.set(n,{serverRequestId:t}),this.lastApprovalRequestId=n;let s=r==="item/permissions/requestApproval"?"sandboxEscalation":"needs_permission";return[{kind:"hub-send",msg:i},this.statePost(s,"approval-requested"),{kind:"render",channel:"meta",text:b2}]}onHubVerdict(t,r){let o=r==="allow"?"accept":"decline",n={kind:"render",channel:"voice",text:r==="allow"?"[alexa] approved":"[alexa] denied"};return this.resolveApproval(t,o,n)}onLocalApproval(t){let r=this.lastApprovalRequestId;if(!r)return[{kind:"render",channel:"meta",text:gI}];let o=t==="allow"?"accept":t==="allow-session"?"acceptForSession":"decline",n=t==="allow"?"approved":t==="allow-session"?"approved for session":"denied";return this.resolveApproval(r,o,{kind:"render",channel:"meta",text:n})}resolveApproval(t,r,o){let n=this.pendingApprovals.get(t);if(!n)return[{kind:"render",channel:"meta",text:gI}];this.pendingApprovals.delete(t),this.lastApprovalRequestId===t&&(this.lastApprovalRequestId=null);let i=r==="decline";return[{kind:"rpc-respond",id:n.serverRequestId,result:fI(r)},this.statePost(i?"permissionDenied":"working",i?"approval-denied":"approval-allowed"),o]}endSession(){let t=[...this.pendingApprovals.values()].map(r=>({kind:"rpc-respond",id:r.serverRequestId,result:fI("decline")}));return this.pendingApprovals.clear(),this.lastApprovalRequestId=null,this.pendingSteerAcks.clear(),[this.statePost("ended","teardown"),...t,{kind:"exit"}]}onServerExit(){let t=[];this.turnInFlight&&t.push(this.statePost("error","server-exit"));for(let r of this.queue)r.source==="hub"&&t.push(this.replyAction(r.requestId,$v));return this.queue=[],this.turnInFlight=!1,this.owner=null,this.pendingApprovals.clear(),this.lastApprovalRequestId=null,this.pendingSteerAcks.clear(),t}};import _2 from"node:path";function bI(e,t){let r=_2.basename(e)||"session";return{id:`${r}@${t}+codex`,name:`${r} codex (${t})`}}function yI(e){let{sub:t,...r}=e;return{...r,voice:!0,agent:"codex",...t?{sub:t}:{}}}var Rs=class extends Error{code;constructor(t,r){super(`codex app-server error ${t}: ${r}`),this.name="AppServerError",this.code=t}};function Iv(e,t){let r=1,o=!1,n="",i=new Map,s=[],a=[],l=[];function u(k){o||e.write(`${JSON.stringify(k)}
|
|
302
|
+
`)}function p(k){let S=k.trim();if(!S)return;let I;try{I=JSON.parse(S)}catch{return}if(!I||typeof I!="object"||Array.isArray(I))return;let _=I,C=_.id,z=typeof C=="number"||typeof C=="string",F=_.method;if(typeof F=="string"){if(z)for(let K of a)K(C,F,_.params);else for(let K of s)K(F,_.params);return}if(z&&("result"in _||"error"in _)){if(typeof C!="number")return;let K=i.get(C);if(!K)return;if(i.delete(C),"error"in _&&_.error){let he=_.error,D=typeof he.code=="number"?he.code:-32603,B=typeof he.message=="string"?he.message:"unknown app-server error";K.reject(new Rs(D,B))}else K.resolve(_.result);return}}function d(k){n+=k;let S;for(;(S=n.indexOf(`
|
|
303
|
+
`))>=0;){let I=n.slice(0,S);n=n.slice(S+1),p(I)}}function m(){t.removeListener("data",d),t.removeListener("end",h),t.removeListener("error",v),e.removeListener("error",v)}function f(k){m();let S=k??new Error("codex app-server stream closed");for(let I of i.values())I.reject(S);i.clear()}function g(k){if(!o){o=!0,f(k);for(let S of l)S(k)}}function h(){g()}function v(k){g(k)}return t.setEncoding("utf8"),t.on("data",d),t.on("end",h),t.on("error",v),e.on("error",v),{request(k,S){if(o)return Promise.reject(new Error("codex app-server client is closed"));let I=r++;return new Promise((_,C)=>{i.set(I,{resolve:_,reject:C}),u({id:I,method:k,params:S})})},notify(k,S){u({method:k,params:S})},respond(k,S){u({id:k,result:S})},onNotification(k){s.push(k)},onServerRequest(k){a.push(k)},onClose(k){l.push(k)},close(){o||(o=!0,f())}}}function T2(e,t){return $2(e.file,[...e.argsPrefix,"app-server"],{env:t,stdio:["pipe","pipe","inherit"]})}function Os(e){if(process.platform==="win32"&&e.pid){I2("taskkill",["/pid",String(e.pid),"/T","/F"]);return}try{e.kill?.("SIGTERM")}catch{}}function R2(e){return new Promise(t=>setTimeout(t,e))}function O2(e,t){return{...t?{threadId:t}:{},input:[{type:"text",text:e}]}}function D2(e,t,r){if(e==="turn/start"||e==="turn/steer"){let o=t,n=typeof o?.text=="string"?o.text:"";return O2(n,r)}return e==="turn/interrupt"?r?{threadId:r}:void 0:t}function Pv(e){if(!e||typeof e!="object")return;let t=e;if(typeof t.threadId=="string"&&t.threadId)return t.threadId;if(typeof t.thread_id=="string"&&t.thread_id)return t.thread_id;let r=t.thread;if(r&&typeof r=="object"){let o=r.id;if(typeof o=="string"&&o)return o}}function N2(e){return Pv(e)!==void 0?!1:!!e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length>0}function kI(e){if(Array.isArray(e))return e;if(e&&typeof e=="object"&&Array.isArray(e.threads))return e.threads}function L2(e){let t=kI(e);if(!t)return[];let r=[];for(let o of t){if(!o||typeof o!="object")continue;let n=o,i=typeof n.threadId=="string"?n.threadId:typeof n.thread_id=="string"?n.thread_id:typeof n.id=="string"?n.id:void 0;if(!i)continue;let s=typeof n.cwd=="string"?n.cwd:typeof n.workingDirectory=="string"?n.workingDirectory:typeof n.path=="string"?n.path:void 0,a=n.updatedAt??n.lastActiveAt??n.createdAt,l=typeof a=="number"?a:typeof a=="string"?Date.parse(a):void 0;r.push({id:i,cwd:s,updatedAt:l!==void 0&&Number.isFinite(l)?l:void 0})}return r}function U2(e){return kI(e)!==void 0?!1:!!e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length>0}function j2(e,t){let r=L2(e).filter(o=>o.cwd===t);if(r.length!==0)return r.sort((o,n)=>(n.updatedAt??0)-(o.updatedAt??0)),r[0]?.id}function z2(e){switch(e.trim().toLowerCase()){case"y":case"yes":return"allow";case"a":case"always":return"allow-session";case"n":case"no":return"deny";default:return null}}var Ds={dim:"\x1B[2m",italic:"\x1B[3m",reset:"\x1B[0m",cyan:"\x1B[36m"};function Ev(e,t,r){return r?`${e}${t}${Ds.reset}`:t}var Cv=class{constructor(t){this.out=t;this.colorEnabled=!!t.isTTY&&!process.env.NO_COLOR}out;atLineStart=!0;colorEnabled;render(t,r){if(t==="agent"){this.out.write(r),this.atLineStart=r.endsWith(`
|
|
304
|
+
`);return}if(t==="tool"){this.out.write(Ev(Ds.dim,r,this.colorEnabled)),this.atLineStart=r.endsWith(`
|
|
296
305
|
`);return}if(this.atLineStart||this.out.write(`
|
|
297
|
-
`),t==="meta")this.out.write(`${
|
|
298
|
-
`);else{let o=/^(\[[^\]]+\]\s?)/.exec(r),n=o?`${
|
|
299
|
-
`)}this.atLineStart=!0}};function
|
|
300
|
-
${
|
|
301
|
-
`)}`),2;if(!
|
|
306
|
+
`),t==="meta")this.out.write(`${Ev(`${Ds.dim}${Ds.italic}`,`\u2022 ${r}`,this.colorEnabled)}
|
|
307
|
+
`);else{let o=/^(\[[^\]]+\]\s?)/.exec(r),n=o?`${Ev(Ds.cyan,o[1],this.colorEnabled)}${r.slice(o[1].length)}`:r;this.out.write(`${n}
|
|
308
|
+
`)}this.atLineStart=!0}};function Av(e){return new Promise(t=>{let r="";try{r=A2(e.tokenFile,"utf8").trim()}catch{}let o=JSON.stringify(e.body),n=C2({host:"127.0.0.1",port:e.hubPort,path:e.path,method:"POST",headers:{"content-type":"application/json","content-length":Buffer.byteLength(o),"x-bridge-hub-token":r},timeout:2e3},i=>{i.on("data",()=>{}),i.on("end",()=>t())});n.on("timeout",()=>{n.destroy(),t()}),n.on("error",()=>t()),n.end(o)})}function ci(e){return e instanceof Error?e.message:String(e)}function F2(e){if(e.kind!=="hub")return;let t=e.msg;return t.type==="prompt"||t.type==="command"?t.requestId:void 0}async function Ns(e,t,r){let o=await e.request("thread/start",{cwd:t});return N2(o)&&r("thread/start returned a result but no recognizable thread id (threadId/thread_id/thread.id) \u2014 codex resume may not work"),Pv(o)}async function wI(e,t,r,o){try{let n=await e.request("thread/resume",{threadId:r});return Pv(n)??r}catch{return o("codex thread/resume was rejected \u2014 starting a fresh thread instead"),Ns(e,t,o)}}async function M2(e,t,r){let o=await e.request("thread/list",{cwd:t});if(U2(o))return r("thread/list returned a result but no recognizable thread list \u2014 starting a fresh thread"),Ns(e,t,r);let n=j2(o,t);return n?(r(`resuming the most recent codex thread for this cwd (${n})`),wI(e,t,n,r)):(r("no existing codex thread found for this cwd \u2014 starting a fresh thread"),Ns(e,t,r))}var xI=5,B2=1e3,H2=3e4;async function SI(e){let t=e.codexCmd??Kr(),r=e.clientVersion??"0.0.0",o=e.voice??Ms({isDevBuild:Ut()===null}),n=e.spawn??T2,i=e.delay??R2,s=e.stdin??process.stdin,a=e.stdout??process.stdout,l=new Cv(a),u=0;function p(){return u+=1,{...process.env,ACB_CODEX_ADAPTER:"1",ACB_CODEX_GENERATION:String(u)}}let d;try{d=n(t,p())}catch(I){return l.render("meta",`failed to launch codex: ${ci(I)}`),1}d.on("error",I=>l.render("meta",`codex process error: ${ci(I)}`));let m=Iv(d.stdin,d.stdout),f=null,g=I=>(l.render("meta",I),m.close(),Os(d),f&&ve(f),1),h,v,k,S={};try{await m.request("initialize",{clientInfo:{name:"acbridge",title:"AC Bridge",version:r}}),m.notify("initialized",{});let I=_=>l.render("meta",_);h=e.resume?await M2(m,e.cwd,I):await Ns(m,e.cwd,I),k=E2(),v=bI(e.cwd,e.machine),f=qu(k),S=yI({id:v.id,name:v.name,hubPort:e.hubPort,hubTokenFile:e.hubTokenFile,claudeSessionId:k,cwd:e.cwd,sub:e.sub}),we(f,JSON.stringify({...S,...h?{codexThreadId:h}:{}}))}catch(I){return g(`codex bring-up failed: ${ci(I)}`)}return new Promise(I=>{let _=!1,C=0,z=()=>C+=1,F=new cu({sessionId:v.id,cwd:e.cwd,steerSupported:!0,newSeq:z}),K=!1,he=!1,D=[];function B(X){if(he){D.push(X);return}nn(X)}function ke(){let X=D.splice(0,D.length);for(let le of X){if(le.kind!=="hub")continue;let V=le.msg;V.type!=="prompt"&&V.type!=="command"||Ae.send({type:"reply",sessionId:v.id,requestId:V.requestId,seq:z(),text:$v,final:!0})}}let Ae=V$({port:e.hubPort,tokenFile:e.hubTokenFile,hello:()=>o?{type:"register",sessions:[{id:v.id,name:v.name,cwd:e.cwd,online:!0,agent:"codex"}],claudeSessionId:k}:null,onMessage:X=>B({kind:"hub",msg:X})}),xt=P2({input:s,output:a,terminal:!!s.isTTY}),Lt=null;function re(X){_||(_=!0,Lt&&(Os(Lt),Lt=null),m.close(),Ae.close(),Os(d),f&&ve(f),xt.close(),I(X))}function Us(X,le){Av({hubPort:e.hubPort,tokenFile:e.hubTokenFile,path:"/local/session/state",body:{sessionId:v.id,claudeSessionId:k,cwd:e.cwd,ts:Date.now(),state:X,event:le,agent:"codex"}})}function jI(X,le,V){if(X===void 0)return;let Me={pct:X};le!==void 0&&(Me.usedTokens=le),V!==void 0&&(Me.windowTokens=V),Av({hubPort:e.hubPort,tokenFile:e.hubTokenFile,path:"/local/session/context",body:{sessionId:v.id,claudeSessionId:k,cwd:e.cwd,ts:Date.now(),agent:"codex",context:Me}})}function zI(X){h&&Av({hubPort:e.hubPort,tokenFile:e.hubTokenFile,path:"/local/session/usage",body:{sessionId:v.id,claudeSessionId:k,codexThreadId:h,cwd:e.cwd,ts:Date.now(),agent:"codex",inputTokens:X.inputTokens,cachedInputTokens:X.cachedInputTokens,outputTokens:X.outputTokens}})}function FI(){f&&we(f,JSON.stringify({...S,...h?{codexThreadId:h}:{}}))}function Rv(X,le){for(let V of X)switch(V.kind){case"rpc":{let Me=V.method,di=D2(Me,V.params,h);m.request(Me,di).then(()=>{if(Me!=="turn/steer")return;let Wr=F2(le);Wr&&nn({kind:"steer-ok",requestId:Wr})},Wr=>{if(Me==="turn/steer"&&Wr instanceof Rs&&Wr.code===-32601){F.setSteerSupported(!1),Rv(F.handle(le),le);return}l.render("meta",`codex error (${Me}): ${ci(Wr)}`)});break}case"rpc-respond":K=!1,m.respond(V.id,V.result);break;case"hub-send":V.msg.type==="permission_request"&&(K=!0),Ae.send(V.msg);break;case"state-post":Us(V.state,V.event);break;case"context-post":jI(V.pct,V.usedTokens,V.windowTokens);break;case"usage-post":zI(V);break;case"render":l.render(V.channel,V.text);break;case"exit":re(0);break;default:break}}function nn(X){Rv(F.handle(X),X)}let pu=!1,js,ui=0;function Ov(){ui+=1;let X=ui;d.on("exit",le=>{X===ui&&(js=le,mu())}),m.onClose(()=>{X===ui&&(js!==void 0?mu():setTimeout(()=>{X===ui&&mu()},25))}),m.onNotification((le,V)=>nn({kind:"notification",method:le,params:V})),m.onServerRequest((le,V,Me)=>nn({kind:"server-request",id:le,method:V,params:Me}))}async function MI(){let X=n(t,p());Lt=X,X.on("error",V=>l.render("meta",`codex process error: ${ci(V)}`));let le=Iv(X.stdin,X.stdout);try{await le.request("initialize",{clientInfo:{name:"acbridge",title:"AC Bridge",version:r}}),le.notify("initialized",{});let V=di=>l.render("meta",di),Me=h?await wI(le,e.cwd,h,V):await Ns(le,e.cwd,V);return Lt=null,{child:X,client:le,threadId:Me}}catch(V){throw Lt=null,le.close(),Os(X),V}}async function BI(){let X=B2,le=0;for(;;){if(await i(X),_)return;try{let V=await MI();if(_){V.client.close(),Os(V.child);return}d=V.child,m=V.client,pu=!1,js=void 0,K=!1,Ov(),V.threadId!==void 0&&V.threadId!==h&&(h=V.threadId,FI()),l.render("meta","codex reconnected \u2014 session resumed"),Us("resumed","codex-adapter:respawned"),he=!1;let Me=D.splice(0,D.length);for(let di of Me)nn(di);return}catch(V){if(le+=1,l.render("meta",`codex respawn attempt ${le} failed: ${ci(V)}`),_)return;if(le>=xI){Us("error","codex-adapter:respawn-gave-up"),l.render("meta",`codex gave up respawning after ${xI} consecutive failed attempts \u2014 ending session`),ke(),re(1);return}X=Math.min(X*2,H2)}}}function mu(){if(pu||_)return;pu=!0;let X=js??null;nn({kind:"server-exit",code:X}),l.render("meta",`codex exited unexpectedly (code ${X??"unknown"}) \u2014 attempting to respawn`),K=!1,he=!0,BI()}Ov(),xt.on("line",X=>{let le=X.trim();if(K){let V=z2(le);if(V){nn({kind:"local-approval",behavior:V});return}}B({kind:"local-line",text:le})}),xt.on("SIGINT",()=>nn({kind:"sigint"})),xt.on("close",()=>{_||nn({kind:"teardown"})}),Us("started","codex-adapter:started")})}function X2(e){try{return G2(e)&&V2(e).isDirectory()}catch{return!1}}function Y2(e){let t=De();return t?rv(rr(t),e):{signedOut:!0}}function Q2(e){let t=e.flatMap(i=>{for(let s of["--cwd","--agent"])if(i.startsWith(`${s}=`))return[s,i.slice(s.length+1)];return[i]}),r={hold:t.includes("--hold"),agent:"claude",resume:t.includes("--resume")},o=t.indexOf("--agent");if(o>=0){let i=t[o+1];i==="claude"||i==="codex"?r.agent=i:r.bad=`invalid --agent: ${i??"(none)"} (use claude | codex)`}let n=t.indexOf("--cwd");if(!r.bad&&n>=0){let i=t[n+1];i&&!i.startsWith("--")?r.cwd=i:r.bad="--cwd needs a folder path"}if(!r.bad){let i=t.filter((s,a)=>!s.startsWith("--")&&t[a-1]!=="--agent"&&t[a-1]!=="--cwd");i.length>1?r.bad="at most one repo name (see `acbridge repos list`)":i.length===1&&(r.cwd!==void 0?r.bad="pick ONE launch folder: a repo name or --cwd <path>":r.repo=i[0])}return!r.bad&&r.resume&&r.agent!=="codex"&&(r.bad="--resume requires --agent codex"),r}function e4(e,t,r){let o={...r,BRIDGE_SESSION_ID:t.sessionId,BRIDGE_SESSION_NAME:t.sessionName,BRIDGE_HUB_PORT:String(t.hubPort)};return delete o.ELECTRON_RUN_AS_NODE,{file:e.file,args:[...e.argsPrefix,"--session-id",t.claudeSessionId,"--channels","plugin:alexa@bridge"],env:o}}function t4(e){let{sub:t,...r}=e;return{...r,voice:!0,...t?{sub:t}:{}}}async function n4(){b("[bridge] session closed \u2014 press Enter to exit\u2026"),await new Promise(e=>{let t=K2({input:process.stdin,output:process.stdout});t.question("",()=>{t.close(),e()})})}var _I="https://github.com/openai/codex#install";function r4(e){return $I(e.file,[...e.argsPrefix,"--version"],{encoding:"utf8",timeout:5e3}).status===0}function o4(e={}){let t;try{t=(e.resolveCodex??Kr)()}catch{return{ok:!1,message:`codex CLI not found \u2014 install it: ${_I}`}}return(e.probeCodex??r4)(t)?(e.codexLoggedIn??Vs)()?{ok:!0,codexCmd:t}:{ok:!1,message:"Run `codex login` first."}:{ok:!1,message:`codex CLI not found \u2014 install it: ${_I}`}}async function II(e=[],t={}){let r=Q2(e);if(r.bad)return x(r.bad),2;if(r.cwd!==void 0||r.repo!==void 0){let B=t.chdir??(Ae=>process.chdir(Ae)),ke;if(r.cwd!==void 0){if(ke=Ls.resolve(r.cwd),!X2(ke))return x(`not a folder: ${ke}`),2}else{let Ae=(t.repoLookup??Y2)(r.repo);if(Ae.signedOut)return x("Not signed in. Run `acbridge login` first \u2014 the bridges list is per-account."),3;if(Ae.candidates)return x(`"${r.repo}" matches more than one bridge:
|
|
309
|
+
${Ae.candidates.map(xt=>`${xt.name} (${xt.path})`).join(`
|
|
310
|
+
`)}`),2;if(!Ae.row)return x(`no bridge matches "${r.repo}" \u2014 see \`acbridge repos list\``),2;ke=Ae.row.path}try{B(ke)}catch(Ae){return x(`couldn't enter ${ke}: ${Ae instanceof Error?Ae.message:String(Ae)}`),1}}if(!(t.voice??je()))return x("voice sessions are turned off in this build."),b("Your devices and Profiles are unaffected \u2014 `acbridge start` keeps the bridge running."),b(`Launch the agent yourself in this folder: \`${r.agent}\` \u2014 its hooks still drive your Profiles.`),1;let{hold:o,agent:n}=r,i=de(),s=t.preflightAccount??Ho,a=t.ensureFreshToken??jt,l=t.ensureHub??ct,u=t.hubRelease??fl,p=t.readActiveUser??Pe,d=t.holdForEnter??n4,m=await s();if(!m.ok)return x(m.message),m.exitCode;await a(i.relayUrl);let{holderId:f}=await l({kind:"run"});if(n==="codex"){let B=!1,ke=async()=>{if(!B&&(B=!0,f))try{await u(f)}catch{}};process.once("SIGINT",()=>{ke()}),process.once("SIGTERM",()=>{ke()});let Ae=(t.codexPreflight??o4)();if(!Ae.ok)return x(Ae.message),await ke(),1;b(`Launching Codex with the Alexa channel \u2014 cwd: ${process.cwd()}`);let Lt=await(t.runCodexAdapter??SI)({cwd:process.cwd(),machine:i.machine,hubPort:i.hubPort,hubTokenFile:ah(),sub:p()?.sub,codexCmd:Ae.codexCmd,clientVersion:Ut()??void 0,voice:!0,resume:r.resume});return await ke(),o&&await d(),Lt}for(let B of hl({...t.ensurePluginInstalled?{ensurePluginInstalled:t.ensurePluginInstalled}:{},...t.ensureStatusline?{ensureStatusline:t.ensureStatusline}:{}}))(B.level==="info"?b:j)(B.message);let g=Ls.basename(process.cwd())||"session",h=`${g}@${i.machine}`,v=`${g} (${i.machine})`,k=Z2(),S=Ls.join(Y,"sessions");W2(S,{recursive:!0});let I=Ls.join(S,`${k}.json`),_=process.cwd(),C=Ls.join(q2.homedir(),".claude","projects",_.replace(/[^A-Za-z0-9]/g,"-"),`${k}.jsonl`),z=ah();J2(I,JSON.stringify(t4({id:h,name:v,hubPort:i.hubPort,hubTokenFile:z,claudeSessionId:k,transcriptPath:C,cwd:_,sub:p()?.sub})),{mode:384});let F=!1,K=async()=>{if(!F&&(F=!0,ve(I),f))try{await u(f)}catch{}};process.once("SIGINT",()=>{K()}),process.once("SIGTERM",()=>{K()}),b(`Launching Claude with the Alexa channel \u2014 session: ${h}`);let he=e4((t.resolveClaude??cn)(),{sessionId:h,claudeSessionId:k,sessionName:v,hubPort:i.hubPort},process.env),D=$I(he.file,he.args,{stdio:"inherit",env:he.env});return await K(),o&&await d(),D.status??0}var i4="Usage: acbridge scan [--json] [--timeout <seconds>]",s4=1e3,a4=e=>o0(e);function c4(e){let t={json:!1,timeoutMs:3e4};for(let r=0;r<e.length;r++){let o=e[r];if(o==="--json")t.json=!0;else if(o==="--timeout"||o?.startsWith("--timeout=")){let n=o==="--timeout"?e[++r]:o.slice(10),i=Number(n);!Number.isFinite(i)||i<=0?t.bad=`invalid --timeout: ${n??"(none)"}`:t.timeoutMs=Math.min(120,Math.max(5,Math.round(i)))*1e3}else t.bad=`unknown option: ${o??""}`}return t}async function PI(e){let t=c4(e);if(t.bad)return x(t.bad),b(i4),2;if(t.json&&ye(!0),!await Le()){let i=$r();if(!i.ok)return x(i.message),3;if(t.json)return x(Te()),1;try{await ct({kind:"cli"})}catch(s){return x(`couldn't start the hub: ${s.message}`),b("check ~/.claude-bridge/hub.log, or start it yourself with `acbridge daemon` and re-run"),1}}let r=await W("/local/scan",{method:"POST"});if(r.hubOffline)return x(Te()),1;if(r.status!==200||!r.body?.scanId)return x(`hub answered HTTP ${r.status} starting the scan \u2014 token mismatch? restart the hub`),1;let{session:o,expired:n}=await l4(r.body.scanId,t);return o?t.json?(console.log(JSON.stringify(o)),o.status==="failed"?1:0):(n&&b(me("(scan session expired mid-poll \u2014 showing the hub's last-known devices)")),o.status==="failed"?(x(`scan failed: ${o.error??"unknown error"}`),1):(o.status==="running"&&j("scan still running at --timeout \u2014 showing partial results (re-run `acbridge scan` for the final list)"),f4(o.devices,o.env,o.accountDevices),await v4(o.devices),0)):(x(Te()),1)}async function l4(e,t){let r=Date.now()+t.timeoutMs,o=!t.json&&process.stdout.isTTY,n=null;!t.json&&!o&&b("scanning\u2026");try{for(;;){let i=await W(`/local/scan/${e}`);if(i.hubOffline)return{session:n,expired:!1};if(i.status===404){let s=await W("/local/discovered");return s.status===200&&s.body?{session:u4(e,s.body),expired:!0}:{session:n,expired:!0}}if(i.status===200&&i.body&&(n=i.body,o&&process.stdout.write(`\r\u2022 scanning\u2026 ${n.devices.length} device(s) found`),n.status!=="running"))return{session:n,expired:!1};if(Date.now()>=r)return{session:n,expired:!1};await new Promise(s=>setTimeout(s,s4))}}finally{o&&process.stdout.write("\r\x1B[2K")}}var u4=(e,t)=>({id:e,status:"done",startedAt:t.updatedAt,finishedAt:t.updatedAt,devices:t.devices,...t.accountDevices?{accountDevices:t.accountDevices}:{},env:t.env}),d4={ready:0,ecosystems:1,"needs-setup":2,unidentified:3,infrastructure:4},p4={ready:"Ready",ecosystems:"Link account","needs-setup":"Needs setup",unidentified:"Unknown",infrastructure:"Infrastructure"};function EI(e){return d4[Fo(e)]}function m4(e){return p4[Fo(e)]}function lu(e){let t=[e.identity.manufacturer,e.identity.model].filter(Boolean).join(" ");return e.identity.name??(t||e.identity.hint||e.addresses.hostname||e.addresses.ip)}function AI(e){if(e.alreadyLinked)return`connected \u2713 (via ${e.alreadyLinked.provider})`;if(e.bucket==="connect-now"&&e.localProtocol)return`acbridge connect ${e.discoveredId}`;if(e.bucket==="link-ecosystem"){let t=e.suggestedProvider;return t==="homeassistant"?"acbridge link home-assistant":t==="mqtt"?`acbridge link mqtt --host ${e.addresses.ip}`:t==="hue"||t==="smartthings"?`acbridge link ${t}`:`acbridge link ${t}`}return"\u2014"}function CI(e){let t=g4(e);if(t.length!==0){b(""),b(me(t[0]));for(let r of t.slice(1))b(r)}}function f4(e,t,r){let o=e0(t);if(o&&t.interop==="windows-arp"?j("WSL detected \u2014 mDNS/broadcast limited; using the Windows neighbor table for ARP discovery"):o&&t.wsl?j("WSL detected \u2014 LAN scan degraded (mDNS/broadcast limited); results may be incomplete"):o&&j("multicast self-test failed \u2014 mDNS results may be missing"),e.length===0){o&&t.wsl?b("0 devices found \u2014 expected to be incomplete under WSL (see `acbridge doctor`)."):o?b("0 devices found \u2014 the multicast self-test failed, so this scan is expected to be incomplete (see `acbridge doctor`)."):t0(t,e.length)?b(`No devices found. ${n0}`):b("No devices found. Devices must be on the same network/VLAN; Wi-Fi isolation limits discovery."),CI(r);return}let n=[...e].sort((m,f)=>EI(m)-EI(f)||lu(m).localeCompare(lu(f))),i=n.map(m=>[TI(lu(m),28),m.expectedType??"\u2014",m.addresses.ip,m.addresses.mac??"\u2014",m4(m),AI(m)]),s=["NAME","TYPE","IP","MAC","STATUS","ACTION"],a=s.map((m,f)=>Math.max(m.length,...i.map(g=>g[f].length))),l=m=>m.map((f,g)=>f.padEnd(a[g])).join(" ").trimEnd();b(me(l(s)));for(let m of i)b(l(m));b("");let u=new Map;for(let m of n)u.set(Fo(m),(u.get(Fo(m))??0)+1);let p=[["ready","ready"],["ecosystems","ecosystem"],["needs-setup","need setup"],["unidentified","unidentified"],["infrastructure","infrastructure"]].map(([m,f])=>u.get(m)?`${u.get(m)} ${f}`:null).filter(m=>m!==null);b(`${e.length} device(s)${p.length>0?` \u2014 ${p.join(" \xB7 ")}`:""}`);let d=n.filter(m=>m.identity.hint!==void 0&&AI(m)==="\u2014"&&Fo(m)!=="unidentified");if(d.length>0){b(""),b(me("Notes:"));for(let m of d)b(` \u2022 ${lu(m)} (${m.addresses.ip}): ${m.identity.hint}`)}CI(r)}var TI=(e,t)=>e.length>t?`${e.slice(0,t-1)}\u2026`:e;function g4(e){let t=e??[];if(t.length===0)return[];let r=[`Known from your accounts (${t.length}):`];for(let o of t){let n=o.state==="cloud"?`added \u2014 reads over the ${o.provider} cloud, so it never appears in a scan`:`in your ${o.provider} account \u2014 not seen on this network`;r.push(` \u2022 ${h4(o)}: ${n}`)}return r}var h4=e=>TI(e.name,40);async function v4(e){if(!e.some(a4))return;let t=await W("/local/config");t.status!==200||t.body?.autoConnect!=="unset"||(b(""),$("Tip: `acbridge connect --auto on` auto-connects open-protocol lights/plugs (never locks, cameras, or doors)."))}import{existsSync as b4}from"node:fs";import{dirname as y4}from"node:path";function Tv(e=Y){return ia(to(no(e)))}function uu(e){return Mb(jn,{home:e?.home,configFile:e?.configFile,env:e?.env,nodeCommand:e?.nodeCommand??Tv(e?.bridgeDir)})}function du(e){return Zb(jn,{home:e?.home,configFile:e?.configFile,env:e?.env,nodeCommand:e?.nodeCommand??Tv(e?.bridgeDir)})}function x4(e){return e?"Setup complete. Run `acbridge run` in any project to start a voice-driven session.":"Setup complete. `acbridge start` runs the bridge; launch `claude` in any project \u2014 its hooks drive your Profiles."}async function RI(e={}){let t=e.installPlugin??gl,r=e.applyManaged??BS,o=e.applyFirewall??(()=>zS()),n=e.ensureStatusline??Bo,i=e.ensureAgentPerms??(()=>Qs()),s=e.ensureCodexHooks??uu,a=e.ensureCodexMcp??du,l=e.voice??je(),u=(e.codexInstalled??(()=>b4(y4(eo()))))(),p=(e.claudeInstalled??Zs)();if(b(l?`Setting up the Alexa bridge on this machine\u2026
|
|
302
311
|
`:`Setting up AC Bridge on this machine\u2026
|
|
303
|
-
`),
|
|
304
|
-
${
|
|
305
|
-
${
|
|
312
|
+
`),p)try{se("installing the alexa@bridge plugin (bound to this install)");let d=t();$(d.marketplaceRepointed?"plugin marketplace re-pointed to this install + installed":d.pluginReinstalled?"plugin refreshed from this install":"plugin already current")}catch(d){if(!u)return x(`plugin install failed: ${d.message}`),1;j(`plugin install skipped (${d.message}) \u2014 no Claude Code here; continuing for Codex.`)}else{let d=Bs(process.platform).manualCommand;if(!u)return x(`no coding agent found \u2014 setup wires the Claude Code plugin and Codex hooks. Install Claude Code (\`${d}\`) or Codex, then re-run \`acbridge setup\`. Device control from this CLI works without either \u2014 but the desktop app's first-run setup does require one.`),1;j(`plugin install skipped (claude CLI not found \u2014 install it: ${d}) \u2014 no Claude Code here; continuing for Codex.`)}try{se(l?`allowlisting the channel in ${dr()}`:`checking managed settings in ${dr()}`);let d=r();d.replacedDefaultAllowlist&&j("allowedChannelPlugins was unset \u2014 setting it REPLACES Anthropic's default channel list. If you also use Telegram/Discord channels, add them to the managed-settings file too."),$(d.changed?`managed settings written${d.usedSudo?" (via sudo)":""}`:"managed settings already current")}catch(d){if(!u)return x(`managed settings: ${d.message}`),b("Write it manually if needed \u2014 `acbridge doctor` prints the exact path + expected JSON."),1;j(`managed settings skipped (${d.message}) \u2014 not needed for Codex-only.`)}try{se("adding the LAN device-scan firewall rule");let d=o();d.status==="nothing-to-do"?$("no active firewall detected \u2014 nothing to add"):d.status==="needs-elevation"?(j("firewall rule not applied (declined or unavailable)."),d.manualCommand&&b(`Run it manually if device scanning misses devices:
|
|
313
|
+
${d.manualCommand}`)):($(d.changed?"firewall rule added":"firewall rule already present"),d.userNote&&b(d.userNote))}catch(d){j(`firewall rule skipped: ${d.message}`)}try{se("installing the statusline tee (context + usage readings)");let d=n();$(d.enabled?d.changed?"statusline tee installed (any existing statusline is chained)":"statusline tee already current":"statusline tee disabled by config \u2014 skipped")}catch(d){j(`statusline tee skipped: ${d.message}`)}try{se("pre-approving the bridge device tools in Claude Code permissions");let d=i();d.corrupt?j("~/.claude/settings.json is unparseable \u2014 fix or delete it, then re-run setup"):d.enabled?d.changed?$("bridge device tools pre-approved (locks & other security devices still need in-app approval)"):$("agent permissions already current"):$("agent permissions disabled by config \u2014 skipped")}catch(d){j(`agent permissions skipped: ${d.message}`)}try{se("installing Codex hooks (session-state signals for OpenAI Codex CLI)");let d=s();if(d.skipped)$("Codex not detected (no ~/.codex) \u2014 hooks skipped");else if(d.corrupt)j("~/.codex/hooks.json is unparseable \u2014 fix or delete it, then re-run setup.");else if(!d.enabled)$("Codex hooks disabled by config \u2014 skipped");else if(d.changed){$("Codex hooks installed (any existing hooks are preserved)");let m=d.addedEvents&&d.addedEvents.length>0?` (new: ${d.addedEvents.join(", ")})`:"";b(`Codex hooks installed \u2014 run /hooks once inside Codex to review and trust the AC Bridge hook${m}.`)}else $("Codex hooks already current")}catch(d){j(`Codex hooks skipped: ${d.message}`)}try{se("registering the AC Bridge device MCP server with Codex");let d=a();d.skipped?$("Codex not detected (no ~/.codex) \u2014 MCP registration skipped"):d.blocked==="foreign"?j("~/.codex/config.toml already defines [mcp_servers.acbridge] outside the AC Bridge block \u2014 remove it, then re-run setup."):d.blocked==="malformed"?j("~/.codex/config.toml's AC Bridge markers are damaged \u2014 fix or delete the marked block, then re-run setup."):d.enabled?d.changed?($("Codex MCP server registered (device tools + the profile brief in Codex chats)"),b("Restart Codex to pick up the device tools \u2014 calls are pre-approved; locks and other security devices still need in-app approval.")):$("Codex MCP registration already current"):$("Codex MCP registration disabled by config \u2014 skipped")}catch(d){j(`Codex MCP registration skipped: ${d.message}`)}return b(""),$(x4(l)),0}function k4(e){return e.voice&&e.hubUp&&e.signedIn}function w4(e){let t=[`relay: ${e.relayUrl}`,`machine: ${e.machine}`,`version: ${e.version??"dev"}`,`signed in: ${e.signedIn?e.paired?"yes (paired)":"yes":"no"}`,`hub: ${e.hubUp?"running":"stopped"}`];if(e.update&&t.push(`update: ${e.update.latest} available (you have ${e.version??"dev"})`),e.accountMismatch&&t.push("account: signed-in account does not match this machine's credential \u2014 run `acbridge logout` then `acbridge login`"),e.daemonPid!==void 0&&t.push(`daemon: running (pid ${e.daemonPid})`),e.relayLink&&t.push(`relay link: ${e.relayLink.connected?"connected":e.relayLink.code===4426?"refused \u2014 app update required":"down"}`),e.session&&t.push(e.session.active?`session: active \u2014 ${[e.session.owner?`owner ${e.session.owner}`:null,`${e.session.touched} touched`,e.session.revertOnStop?"revert on stop":"no revert"].filter(Boolean).join(", ")}`:"session: none"),e.sessions!==null&&t.push(`sessions: ${e.sessions}`),e.entitlement&&(t.push(`plan: ${e.entitlement.plan}`),t.push(`capture: telemetry=${e.entitlement.capture.telemetry} transcripts=${e.entitlement.capture.transcripts}`)),e.signedIn)if(e.entitlementFile==="absent")t.push("entitlement file: absent (capture off, fail-closed)");else if(e.entitlementFile==="unreadable")t.push("entitlement file: unreadable (capture off, fail-closed)");else{let n=e.entitlementFile.ageHours;t.push(`entitlement file: ${n.toFixed(1)}h old (${n<=24?"fresh":"STALE \u2014 capture off, fail-closed"})`)}let r;if(e.sessions!==null)try{r=JSON.parse(e.sessions)}catch{r=e.sessions}let o={relayUrl:e.relayUrl,machine:e.machine,version:e.version??"dev",...e.update?{updateAvailable:!0,latestVersion:e.update.latest}:{},signedIn:e.signedIn,paired:e.paired,hub:e.hubUp?"running":"stopped",...e.accountMismatch?{accountMismatch:!0}:{},...e.daemonPid!==void 0?{daemonPid:e.daemonPid}:{},...e.relayLink?{relayLink:e.relayLink}:{},...e.session?{session:e.session}:{},...e.sessions!==null?{sessions:r}:{},...e.entitlement?{plan:e.entitlement.plan,capture:e.entitlement.capture}:{},...typeof e.entitlementFile=="object"?{entitlementFile:{ageHours:e.entitlementFile.ageHours,fresh:e.entitlementFile.ageHours<=24}}:{}};return{lines:t,exitCode:e.hubUp?0:1,json:o}}async function OI(e=[]){let t=e.includes("--json");t&&ye(!0);let r=de(),o=Mt(),n=o.state==="ok"?o.token:"",i=!!n,s=o.state==="mismatch",a=!!N(Se().refreshFile)?.trim(),l=await Le(),u=k4({voice:je(),hubUp:l,signedIn:i}),p=u?await Ty(n):null;u&&p===null&&j("could not reach the relay /sessions endpoint");let d=i?await Ft(n):null,m=d?{plan:d.plan,capture:{telemetry:d.capture.telemetry,transcripts:d.capture.transcripts}}:null,f="absent",g=i?De():null,h=g?N(g.entitlementFile):null;if(h)try{let B=JSON.parse(h);f={ageHours:(Date.now()-(B.fetchedAt??0))/36e5}}catch{f="unreadable"}let v=N(Qe),k=v?Number(v):0,S=k>0&&Mo({pid:k})?k:void 0,I,_=N($y);if(l&&_)try{let B=JSON.parse(_);typeof B.connected=="boolean"&&(I={connected:B.connected,...typeof B.code=="number"?{code:B.code}:{}})}catch{}let C=Xn(),z=C.version,F=ps(z,yl(),process.platform,C.channel??"app"),K=F.state==="update"?{latest:F.latest}:void 0,he;if(l){let B=await W("/local/session",{method:"GET",timeoutMs:3e3});!B.hubOffline&&B.status===200&&B.body&&(he={active:B.body.active,...B.body.owner?{owner:B.body.owner}:{},touched:B.body.touched,revertOnStop:B.body.revertOnStop})}let D=w4({relayUrl:r.relayUrl,machine:r.machine,version:z,...K?{update:K}:{},signedIn:i,paired:a,hubUp:l,sessions:p,entitlement:m,entitlementFile:f,...s?{accountMismatch:!0}:{},...S!==void 0?{daemonPid:S}:{},...I?{relayLink:I}:{},...he?{session:he}:{}});if(t)q(D.json);else for(let B of D.lines)b(B);return D.exitCode}import{rmSync as S4}from"node:fs";import{createInterface as _4}from"node:readline/promises";var DI="Usage: acbridge uninstall [--purge | --keep-account] [--json]",$4=new Set(["--purge","--keep-account","--json"]);async function NI(e=[],t={}){let r=e.filter(d=>!$4.has(d));if(r.length>0)return x(`unknown option: ${r[0]}`),b(DI),2;let o=e.includes("--purge"),n=e.includes("--keep-account");if(o&&n)return x("--purge and --keep-account are opposites \u2014 pick one"),b(DI),2;let i=e.includes("--json");i&&ye(!0);let s={},a=async(d,m,f)=>{se(m);try{await f(),s[d]="ok"}catch(g){s[d]="failed",j(`${m} failed (${g.message}) \u2014 continuing`)}};await a("stop","stopping the bridge (devices revert)\u2026",()=>(t.stopBridge??tr)([])),await a("statusline","restoring your Claude Code statusline\u2026",()=>(t.restoreStatusline??(()=>Bo({env:{...process.env,BRIDGE_STATUSLINE:"0"}})))()),await a("agentPerms","removing the bridge device-tool permissions\u2026",()=>(t.removeAgentPerms??(()=>Qs({env:{...process.env,BRIDGE_AGENT_PERMS:"0"}})))()),await a("codex","removing the Codex hooks\u2026",()=>(t.removeCodexHooks??(()=>uu({env:{...process.env,BRIDGE_CODEX_HOOKS:"0"}})))()),await a("codexMcp","removing the Codex MCP registration\u2026",()=>(t.removeCodexMcp??(()=>du({env:{...process.env,BRIDGE_CODEX_MCP:"0"}})))()),(t.claudeInstalled??Zs)()?await a("plugin","removing the Claude Code plugin + marketplace\u2026",()=>(t.removePlugin??$0)()):(s.plugin="skipped",b("no Claude Code here \u2014 plugin removal skipped")),await a("firewall","removing the LAN-discovery firewall rule\u2026",()=>{let d=(t.removeFirewall??FS)();d.status==="needs-elevation"&&d.manualCommand&&j(`couldn't remove the firewall rule without elevation \u2014 run it yourself:
|
|
314
|
+
${d.manualCommand}`)});let l=!1,u=!1;if(!n){let d=o;if(!d)if(t.isTTY??!!(process.stdin.isTTY&&process.stdout.isTTY)){let g=(await(t.ask??(async h=>{let v=_4({input:process.stdin,output:process.stdout});try{return await v.question(h)}finally{v.close()}}))("Sign out and delete this machine's account data (credentials, provider keys, device configs, logs)? [y/N] ")).trim().toLowerCase();d=g==="y"||g==="yes"}else b("keeping account data (non-interactive) \u2014 pass --purge to remove everything, --keep-account to silence this");d&&(await a("signOut","signing out (revokes this machine at the relay)\u2026",()=>(t.signOut??Fl)([])),l=s.signOut==="ok",o&&(await a("purgeHome","deleting the AC Bridge home (100% fresh next install)\u2026",()=>(t.purgeHome??(()=>S4(Y,{recursive:!0,force:!0})))()),u=s.purgeHome==="ok"))}let p=Object.entries(s).filter(([,d])=>d==="failed").map(([d])=>d);return p.length===0?$("AC Bridge is unwired from this machine."):j(`unwired with issues (${p.join(", ")}) \u2014 see above`),b("finish with: npm uninstall -g acbridge"),i&&q({steps:s,signedOut:l,purged:u}),0}function li(e){return`${e?"acbridge \u2014 voice-driven Claude Code, on any machine":"acbridge \u2014 the AC Bridge companion CLI: bridge, devices, and profiles from any terminal"}
|
|
306
315
|
|
|
307
316
|
Usage: acbridge <command>
|
|
308
317
|
|
|
@@ -341,6 +350,9 @@ ${e?" setup One-time: install the channel plugin + allowlist it (manag
|
|
|
341
350
|
Profiles, end to end: list/inspect them, create (bare \`create\` opens a wizard;
|
|
342
351
|
--starter pre-wires a scene set), edit states \u2192 device looks/actions, and bind
|
|
343
352
|
them to repos \u2014 per agent lane (a wrong/missing verb prints the full grammar)
|
|
353
|
+
brief [--cwd <path>] [--agent claude|codex] [--json]
|
|
354
|
+
Print the device brief a session in that cwd receives (the "Make agent aware of
|
|
355
|
+
devices in chat" tick box) \u2014 or why it wouldn't (off / unbound / no hub)
|
|
344
356
|
integrations [list | enable <id> | disable <id> | remove <id|smartthings>] [--json]
|
|
345
357
|
Linked provider accounts: list them (with per-account ids), pause/resume a local
|
|
346
358
|
account, or remove one (credentials deleted; cloud accounts revoke at the relay)
|
|
@@ -357,6 +369,6 @@ ${e?" setup One-time: install the channel plugin + allowlist it (manag
|
|
|
357
369
|
|
|
358
370
|
Exit codes: 0 ok \xB7 1 failure \xB7 2 usage error \xB7 3 not signed in (run \`acbridge login\`)
|
|
359
371
|
\xB7 4 update required (below the minimum supported version) \xB7 5 no active subscription (ac-bridge.com/home)
|
|
360
|
-
`}function
|
|
372
|
+
`}function LI(e){return e.some(t=>t==="-h"||t==="--help")}function UI(e,t){let r=li(t).split(`
|
|
361
373
|
`),o=new RegExp(`^ {2}${e.replace(/[.*+?^${}()|[\]\\-]/g,"\\$&")}(?=\\s|$)`),n=r.findIndex(s=>o.test(s));if(n===-1)return null;let i=[r[n]];for(let s of r.slice(n+1)){if(s.trim()===""||/^ {2}\S/.test(s))break;i.push(s)}return i.join(`
|
|
362
|
-
`).trimEnd()}async function
|
|
374
|
+
`).trimEnd()}async function I4(){try{ky()}catch(r){x(`archiveLegacyUserState() failed (non-fatal): ${r instanceof Error?r.message:String(r)}`)}let[,,e,...t]=process.argv;if(e&&LI(t)){let r=je();return b(UI(e,r)??li(r)),0}switch(e){case"login":return p_(t);case"logout":return Fl(t);case"whoami":return zl(t);case"start":return Gl(t);case"restart":return U_(t);case"run":return II(t);case"repos":return B_(t);case"groups":return z_(t);case"setup":return RI();case"uninstall":return NI(t);case"pair":return x("the pairing-code flow was retired \u2014 sign this machine in with `acbridge login` instead."),2;case"link":return t_(t);case"unlink":return r_(t);case"devices":return F0(t);case"profiles":return O_(t);case"brief":return f_(t);case"integrations":return a_(t);case"rename":return D_(t);case"scan":return PI(t);case"connect":return S0(t);case"daemon":return wl(t);case"stop":return tr(t);case"status":return OI(t);case"capture":return zy(t);case"doctor":return ZS();case"--version":case"-V":return b(Xn().version??"dev (unversioned)"),0;case void 0:case"-h":case"--help":case"help":return b(li(je())),0;default:return x(`unknown command: ${e}`),b(li(je())),2}}I4().then(e=>process.exit(e),e=>{x(e instanceof Error?e.message:String(e)),process.exit(1)});
|