@staff0rd/assist 0.1067.0 → 0.1068.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/built-version +1 -1
- package/dist/commands/extension/extension/updates.json +2 -2
- package/dist/commands/sessions/web/bundle.js +304 -304
- package/dist/index.js +630 -738
- package/package.json +1 -1
- package/claude/skills/review-ci/SKILL.md +0 -69
- package/claude/skills/review-ci/review-ci.yml +0 -55
- package/claude/skills/review-ci/scripts/check.mjs +0 -2
- package/claude/skills/review-ci/scripts/init.mjs +0 -34
- package/claude/skills/review-ci/scripts/review.mjs +0 -787
|
@@ -1,787 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
var Dz=Object.create;var jd=Object.defineProperty;var Lz=Object.getOwnPropertyDescriptor;var zz=Object.getOwnPropertyNames;var jz=Object.getPrototypeOf,Uz=Object.prototype.hasOwnProperty;var X=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var S=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Pt=(t,e)=>{for(var r in e)jd(t,r,{get:e[r],enumerable:!0})},Mz=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of zz(e))!Uz.call(t,n)&&n!==r&&jd(t,n,{get:()=>e[n],enumerable:!(i=Lz(e,n))||i.enumerable});return t};var ia=(t,e,r)=>(r=t!=null?Dz(jz(t)):{},Mz(e||!t||!t.__esModule?jd(r,"default",{value:t,enumerable:!0}):r,t));var Tk=S((xY,ao)=>{"use strict";var k4=typeof process<"u"&&process.env.TERM_PROGRAM==="Hyper",T4=typeof process<"u"&&process.platform==="win32",_k=typeof process<"u"&&process.platform==="linux",bf={ballotDisabled:"\u2612",ballotOff:"\u2610",ballotOn:"\u2611",bullet:"\u2022",bulletWhite:"\u25E6",fullBlock:"\u2588",heart:"\u2764",identicalTo:"\u2261",line:"\u2500",mark:"\u203B",middot:"\xB7",minus:"\uFF0D",multiplication:"\xD7",obelus:"\xF7",pencilDownRight:"\u270E",pencilRight:"\u270F",pencilUpRight:"\u2710",percent:"%",pilcrow2:"\u2761",pilcrow:"\xB6",plusMinus:"\xB1",question:"?",section:"\xA7",starsOff:"\u2606",starsOn:"\u2605",upDownArrow:"\u2195"},$k=Object.assign({},bf,{check:"\u221A",cross:"\xD7",ellipsisLarge:"...",ellipsis:"...",info:"i",questionSmall:"?",pointer:">",pointerSmall:"\xBB",radioOff:"( )",radioOn:"(*)",warning:"\u203C"}),kk=Object.assign({},bf,{ballotCross:"\u2718",check:"\u2714",cross:"\u2716",ellipsisLarge:"\u22EF",ellipsis:"\u2026",info:"\u2139",questionFull:"\uFF1F",questionSmall:"\uFE56",pointer:_k?"\u25B8":"\u276F",pointerSmall:_k?"\u2023":"\u203A",radioOff:"\u25EF",radioOn:"\u25C9",warning:"\u26A0"});ao.exports=T4&&!k4?$k:kk;Reflect.defineProperty(ao.exports,"common",{enumerable:!1,value:bf});Reflect.defineProperty(ao.exports,"windows",{enumerable:!1,value:$k});Reflect.defineProperty(ao.exports,"other",{enumerable:!1,value:kk})});var Da=S((_Y,wf)=>{"use strict";var E4=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),I4=/[\u001b\u009b][[\]#;?()]*(?:(?:(?:[^\W_]*;?[^\W_]*)\u0007)|(?:(?:[0-9]{1,4}(;[0-9]{0,4})*)?[~0-9=<>cf-nqrtyA-PRZ]))/g,C4=()=>typeof process<"u"?process.env.FORCE_COLOR!=="0":!1,Ek=()=>{let t={enabled:C4(),visible:!0,styles:{},keys:{}},e=o=>{let s=o.open=`\x1B[${o.codes[0]}m`,a=o.close=`\x1B[${o.codes[1]}m`,l=o.regex=new RegExp(`\\u001b\\[${o.codes[1]}m`,"g");return o.wrap=(c,u)=>{c.includes(a)&&(c=c.replace(l,a+s));let d=s+c+a;return u?d.replace(/\r*\n/g,`${a}$&${s}`):d},o},r=(o,s,a)=>typeof o=="function"?o(s):o.wrap(s,a),i=(o,s)=>{if(o===""||o==null)return"";if(t.enabled===!1)return o;if(t.visible===!1)return"";let a=""+o,l=a.includes(`
|
|
3
|
-
`),c=s.length;for(c>0&&s.includes("unstyle")&&(s=[...new Set(["unstyle",...s])].reverse());c-- >0;)a=r(t.styles[s[c]],a,l);return a},n=(o,s,a)=>{t.styles[o]=e({name:o,codes:s}),(t.keys[a]||(t.keys[a]=[])).push(o),Reflect.defineProperty(t,o,{configurable:!0,enumerable:!0,set(c){t.alias(o,c)},get(){let c=u=>i(u,c.stack);return Reflect.setPrototypeOf(c,t),c.stack=this.stack?this.stack.concat(o):[o],c}})};return n("reset",[0,0],"modifier"),n("bold",[1,22],"modifier"),n("dim",[2,22],"modifier"),n("italic",[3,23],"modifier"),n("underline",[4,24],"modifier"),n("inverse",[7,27],"modifier"),n("hidden",[8,28],"modifier"),n("strikethrough",[9,29],"modifier"),n("black",[30,39],"color"),n("red",[31,39],"color"),n("green",[32,39],"color"),n("yellow",[33,39],"color"),n("blue",[34,39],"color"),n("magenta",[35,39],"color"),n("cyan",[36,39],"color"),n("white",[37,39],"color"),n("gray",[90,39],"color"),n("grey",[90,39],"color"),n("bgBlack",[40,49],"bg"),n("bgRed",[41,49],"bg"),n("bgGreen",[42,49],"bg"),n("bgYellow",[43,49],"bg"),n("bgBlue",[44,49],"bg"),n("bgMagenta",[45,49],"bg"),n("bgCyan",[46,49],"bg"),n("bgWhite",[47,49],"bg"),n("blackBright",[90,39],"bright"),n("redBright",[91,39],"bright"),n("greenBright",[92,39],"bright"),n("yellowBright",[93,39],"bright"),n("blueBright",[94,39],"bright"),n("magentaBright",[95,39],"bright"),n("cyanBright",[96,39],"bright"),n("whiteBright",[97,39],"bright"),n("bgBlackBright",[100,49],"bgBright"),n("bgRedBright",[101,49],"bgBright"),n("bgGreenBright",[102,49],"bgBright"),n("bgYellowBright",[103,49],"bgBright"),n("bgBlueBright",[104,49],"bgBright"),n("bgMagentaBright",[105,49],"bgBright"),n("bgCyanBright",[106,49],"bgBright"),n("bgWhiteBright",[107,49],"bgBright"),t.ansiRegex=I4,t.hasColor=t.hasAnsi=o=>(t.ansiRegex.lastIndex=0,typeof o=="string"&&o!==""&&t.ansiRegex.test(o)),t.alias=(o,s)=>{let a=typeof s=="string"?t[s]:s;if(typeof a!="function")throw new TypeError("Expected alias to be the name of an existing color (string) or a function");a.stack||(Reflect.defineProperty(a,"name",{value:o}),t.styles[o]=a,a.stack=[o]),Reflect.defineProperty(t,o,{configurable:!0,enumerable:!0,set(l){t.alias(o,l)},get(){let l=c=>i(c,l.stack);return Reflect.setPrototypeOf(l,t),l.stack=this.stack?this.stack.concat(a.stack):a.stack,l}})},t.theme=o=>{if(!E4(o))throw new TypeError("Expected theme to be an object");for(let s of Object.keys(o))t.alias(s,o[s]);return t},t.alias("unstyle",o=>typeof o=="string"&&o!==""?(t.ansiRegex.lastIndex=0,o.replace(t.ansiRegex,"")):""),t.alias("noop",o=>o),t.none=t.clear=t.noop,t.stripColor=t.unstyle,t.symbols=Tk(),t.define=n,t};wf.exports=Ek();wf.exports.create=Ek});var Ae=S(Q=>{"use strict";var P4=Object.prototype.toString,ft=Da(),Ik=!1,lo=new Set,Ck={yellow:"blue",cyan:"red",green:"magenta",black:"white",blue:"yellow",red:"cyan",magenta:"green",white:"black"};Q.longest=(t,e)=>t.reduce((r,i)=>Math.max(r,e?i[e].length:i.length),0);Q.hasColor=t=>!!t&&ft.hasColor(t);var La=Q.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);Q.nativeType=t=>P4.call(t).slice(8,-1).toLowerCase().replace(/\s/g,"");Q.isAsyncFn=t=>Q.nativeType(t)==="asyncfunction";Q.isPrimitive=t=>t!=null&&typeof t!="object"&&typeof t!="function";Q.resolve=(t,e,...r)=>typeof e=="function"?e.call(t,...r):e;Q.scrollDown=(t=[])=>[...t.slice(1),t[0]];Q.scrollUp=(t=[])=>[t.pop(),...t];Q.reorder=(t=[])=>{let e=t.slice();return e.sort((r,i)=>r.index>i.index?1:r.index<i.index?-1:0),e};Q.swap=(t,e,r)=>{let i=t.length,n=r===i?0:r<0?i-1:r,o=t[e];t[e]=t[n],t[n]=o};Q.width=(t,e=80)=>{let r=t&&t.columns?t.columns:e;return t&&typeof t.getWindowSize=="function"&&(r=t.getWindowSize()[0]),process.platform==="win32"?r-1:r};Q.height=(t,e=20)=>{let r=t&&t.rows?t.rows:e;return t&&typeof t.getWindowSize=="function"&&(r=t.getWindowSize()[1]),r};Q.wordWrap=(t,e={})=>{if(!t)return t;typeof e=="number"&&(e={width:e});let{indent:r="",newline:i=`
|
|
4
|
-
`+r,width:n=80}=e,o=(i+r).match(/[^\S\n]/g)||[];n-=o.length;let s=`.{1,${n}}([\\s\\u200B]+|$)|[^\\s\\u200B]+?([\\s\\u200B]+|$)`,a=t.trim(),l=new RegExp(s,"g"),c=a.match(l)||[];return c=c.map(u=>u.replace(/\n$/,"")),e.padEnd&&(c=c.map(u=>u.padEnd(n," "))),e.padStart&&(c=c.map(u=>u.padStart(n," "))),r+c.join(i)};Q.unmute=t=>{let e=t.stack.find(i=>ft.keys.color.includes(i));return e?ft[e]:t.stack.find(i=>i.slice(2)==="bg")?ft[e.slice(2)]:i=>i};Q.pascal=t=>t?t[0].toUpperCase()+t.slice(1):"";Q.inverse=t=>{if(!t||!t.stack)return t;let e=t.stack.find(i=>ft.keys.color.includes(i));if(e){let i=ft["bg"+Q.pascal(e)];return i?i.black:t}let r=t.stack.find(i=>i.slice(0,2)==="bg");return r?ft[r.slice(2).toLowerCase()]||t:ft.none};Q.complement=t=>{if(!t||!t.stack)return t;let e=t.stack.find(i=>ft.keys.color.includes(i)),r=t.stack.find(i=>i.slice(0,2)==="bg");if(e&&!r)return ft[Ck[e]||e];if(r){let i=r.slice(2).toLowerCase(),n=Ck[i];return n&&ft["bg"+Q.pascal(n)]||t}return ft.none};Q.meridiem=t=>{let e=t.getHours(),r=t.getMinutes(),i=e>=12?"pm":"am";e=e%12;let n=e===0?12:e,o=r<10?"0"+r:r;return n+":"+o+" "+i};Q.set=(t={},e="",r)=>e.split(".").reduce((i,n,o,s)=>{let a=s.length-1>o?i[n]||{}:r;return!Q.isObject(a)&&o<s.length-1&&(a={}),i[n]=a},t);Q.get=(t={},e="",r)=>{let i=t[e]==null?e.split(".").reduce((n,o)=>n&&n[o],t):t[e];return i??r};Q.mixin=(t,e)=>{if(!La(t))return e;if(!La(e))return t;for(let r of Object.keys(e)){let i=Object.getOwnPropertyDescriptor(e,r);if(hasOwnProperty.call(i,"value"))if(hasOwnProperty.call(t,r)&&La(i.value)){let n=Object.getOwnPropertyDescriptor(t,r);La(n.value)&&n.value!==i.value?t[r]=Q.merge({},t[r],e[r]):Reflect.defineProperty(t,r,i)}else Reflect.defineProperty(t,r,i);else Reflect.defineProperty(t,r,i)}return t};Q.merge=(...t)=>{let e={};for(let r of t)Q.mixin(e,r);return e};Q.mixinEmitter=(t,e)=>{let r=e.constructor.prototype;for(let i of Object.keys(r)){let n=r[i];typeof n=="function"?Q.define(t,i,n.bind(e)):Q.define(t,i,n)}};var za=(t,e)=>{Ik||(Ik=!0,lo.forEach(r=>r()),t===!0&&process.exit(128+e))},Pk=za.bind(null,!0,15),Nk=za.bind(null,!0,2);Q.onExit=t=>(lo.size===0&&(process.once("SIGTERM",Pk),process.once("SIGINT",Nk),process.once("exit",za)),lo.add(t),()=>{lo.delete(t),lo.size===0&&(process.off("SIGTERM",Pk),process.off("SIGINT",Nk),process.off("exit",za))});Q.define=(t,e,r)=>{Reflect.defineProperty(t,e,{value:r})};Q.defineExport=(t,e,r)=>{let i;Reflect.defineProperty(t,e,{enumerable:!0,configurable:!0,set(n){i=n},get(){return i?i():r()}})}});var Ak=S((kY,Ok)=>{"use strict";Ok.exports=({onlyFirst:t=!1}={})=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}});var ar=S((TY,Rk)=>{"use strict";var N4=Ak();Rk.exports=t=>typeof t=="string"?t.replace(N4(),""):t});var Dk=S($n=>{"use strict";$n.ctrl={a:"first",b:"backward",c:"cancel",d:"deleteForward",e:"last",f:"forward",g:"reset",i:"tab",k:"cutForward",l:"reset",n:"newItem",m:"cancel",j:"submit",p:"search",r:"remove",s:"save",u:"undo",w:"cutLeft",x:"toggleCursor",v:"paste"};$n.shift={up:"shiftUp",down:"shiftDown",left:"shiftLeft",right:"shiftRight",tab:"prev"};$n.fn={up:"pageUp",down:"pageDown",left:"pageLeft",right:"pageRight",delete:"deleteForward"};$n.option={b:"backward",f:"forward",d:"cutRight",left:"cutLeft",up:"altUp",down:"altDown"};$n.keys={pageup:"pageUp",pagedown:"pageDown",home:"home",end:"end",cancel:"cancel",delete:"deleteForward",backspace:"delete",down:"down",enter:"submit",escape:"cancel",left:"left",space:"space",number:"number",return:"submit",right:"right",tab:"next",up:"up"}});var zk=S((CY,Lk)=>{"use strict";Lk.exports=class{_queue=[];_executing=!1;_jobRunner=null;constructor(e){this._jobRunner=e}enqueue=(...e)=>{this._queue.push(e),this._dequeue()};destroy(){this._queue.length=0,this._jobRunner=null}_dequeue(){this._executing||!this._queue.length||(this._executing=!0,this._jobRunner(...this._queue.shift()),setTimeout(()=>{this._executing=!1,this._dequeue()}))}}});var Sf=S((PY,Uk)=>{"use strict";var jk=X("readline"),O4=Dk(),A4=zk(),R4=/^(?:\x1b)([a-zA-Z0-9])$/,D4=/^(?:\x1b+)(O|N|\[|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/,L4={OP:"f1",OQ:"f2",OR:"f3",OS:"f4","[11~":"f1","[12~":"f2","[13~":"f3","[14~":"f4","[[A":"f1","[[B":"f2","[[C":"f3","[[D":"f4","[[E":"f5","[15~":"f5","[17~":"f6","[18~":"f7","[19~":"f8","[20~":"f9","[21~":"f10","[23~":"f11","[24~":"f12","[A":"up","[B":"down","[C":"right","[D":"left","[E":"clear","[F":"end","[H":"home",OA:"up",OB:"down",OC:"right",OD:"left",OE:"clear",OF:"end",OH:"home","[1~":"home","[2~":"insert","[3~":"delete","[4~":"end","[5~":"pageup","[6~":"pagedown","[[5~":"pageup","[[6~":"pagedown","[7~":"home","[8~":"end","[a":"up","[b":"down","[c":"right","[d":"left","[e":"clear","[2$":"insert","[3$":"delete","[5$":"pageup","[6$":"pagedown","[7$":"home","[8$":"end",Oa:"up",Ob:"down",Oc:"right",Od:"left",Oe:"clear","[2^":"insert","[3^":"delete","[5^":"pageup","[6^":"pagedown","[7^":"home","[8^":"end","[Z":"tab"};function z4(t){return["[a","[b","[c","[d","[e","[2$","[3$","[5$","[6$","[7$","[8$","[Z"].includes(t)}function j4(t){return["Oa","Ob","Oc","Od","Oe","[2^","[3^","[5^","[6^","[7^","[8^"].includes(t)}var ja=(t="",e={})=>{let r,i={name:e.name,ctrl:!1,meta:!1,shift:!1,option:!1,sequence:t,raw:t,...e};if(Buffer.isBuffer(t)?t[0]>127&&t[1]===void 0?(t[0]-=128,t="\x1B"+String(t)):t=String(t):t!==void 0&&typeof t!="string"?t=String(t):t||(t=i.sequence||""),i.sequence=i.sequence||t||i.name,t==="\r")i.raw=void 0,i.name="return";else if(t===`
|
|
5
|
-
`)i.name="enter";else if(t===" ")i.name="tab";else if(t==="\b"||t==="\x7F"||t==="\x1B\x7F"||t==="\x1B\b")i.name="backspace",i.meta=t.charAt(0)==="\x1B";else if(t==="\x1B"||t==="\x1B\x1B")i.name="escape",i.meta=t.length===2;else if(t===" "||t==="\x1B ")i.name="space",i.meta=t.length===2;else if(t<="")i.name=String.fromCharCode(t.charCodeAt(0)+97-1),i.ctrl=!0;else if(t.length===1&&t>="0"&&t<="9")i.name="number";else if(t.length===1&&t>="a"&&t<="z")i.name=t;else if(t.length===1&&t>="A"&&t<="Z")i.name=t.toLowerCase(),i.shift=!0;else if(r=R4.exec(t))i.meta=!0,i.shift=/^[A-Z]$/.test(r[1]);else if(r=D4.exec(t)){let n=[...t];n[0]==="\x1B"&&n[1]==="\x1B"&&(i.option=!0);let o=[r[1],r[2],r[4],r[6]].filter(Boolean).join(""),s=(r[3]||r[5]||1)-1;i.ctrl=!!(s&4),i.meta=!!(s&10),i.shift=!!(s&1),i.code=o,i.name=L4[o],i.shift=z4(o)||i.shift,i.ctrl=j4(o)||i.ctrl}return i};ja.listen=(t={},e)=>{let{stdin:r}=t;if(!r||r!==process.stdin&&!r.isTTY)throw new Error("Invalid stream passed");let i=jk.createInterface({terminal:!0,input:r});jk.emitKeypressEvents(r,i);let n=new A4((a,l)=>e(a,ja(a,l),i)),o=r.isRaw;return r.isTTY&&r.setRawMode(!0),r.on("keypress",n.enqueue),i.resume(),()=>{r.isTTY&&r.setRawMode(o),r.removeListener("keypress",n.enqueue),n.destroy(),i.pause(),i.close()}};ja.action=(t,e,r)=>{let i={...O4,...r};return e.ctrl?(e.action=i.ctrl[e.name],e):e.option&&i.option?(e.action=i.option[e.name],e):e.shift?(e.action=i.shift[e.name],e):(e.action=i.keys[e.name],e)};Uk.exports=ja});var qk=S((NY,Mk)=>{"use strict";Mk.exports=t=>{t.timers=t.timers||{};let e=t.options.timers;if(e)for(let r of Object.keys(e)){let i=e[r];typeof i=="number"&&(i={interval:i}),U4(t,r,i)}};function U4(t,e,r={}){let i=t.timers[e]={name:e,start:Date.now(),ms:0,tick:0},n=r.interval||120;i.frames=r.frames||[],i.loading=!0;let o=setInterval(()=>{i.ms=Date.now()-i.start,i.tick++,t.render()},n);return i.stop=()=>{i.loading=!1,clearInterval(o)},Reflect.defineProperty(i,"interval",{value:o}),t.once("close",()=>i.stop()),i.stop}});var Bk=S((OY,Fk)=>{"use strict";var{define:M4,width:q4}=Ae(),xf=class{constructor(e){let r=e.options;M4(this,"_prompt",e),this.type=e.type,this.name=e.name,this.message="",this.header="",this.footer="",this.error="",this.hint="",this.input="",this.cursor=0,this.index=0,this.lines=0,this.tick=0,this.prompt="",this.buffer="",this.width=q4(r.stdout||process.stdout),Object.assign(this,r),this.name=this.name||this.message,this.message=this.message||this.name,this.symbols=e.symbols,this.styles=e.styles,this.required=new Set,this.cancelled=!1,this.submitted=!1}clone(){let e={...this};return e.status=this.status,e.buffer=Buffer.from(e.buffer),delete e.clone,e}set color(e){this._color=e}get color(){let e=this.prompt.styles;if(this.cancelled)return e.cancelled;if(this.submitted)return e.submitted;let r=this._color||e[this.status];return typeof r=="function"?r:e.pending}set loading(e){this._loading=e}get loading(){return typeof this._loading=="boolean"?this._loading:this.loadingChoices?"choices":!1}get status(){return this.cancelled?"cancelled":this.submitted?"submitted":"pending"}};Fk.exports=xf});var Kk=S((AY,Zk)=>{"use strict";var _f=Ae(),Pe=Da(),$f={default:Pe.noop,noop:Pe.noop,set inverse(t){this._inverse=t},get inverse(){return this._inverse||_f.inverse(this.primary)},set complement(t){this._complement=t},get complement(){return this._complement||_f.complement(this.primary)},primary:Pe.cyan,success:Pe.green,danger:Pe.magenta,strong:Pe.bold,warning:Pe.yellow,muted:Pe.dim,disabled:Pe.gray,dark:Pe.dim.gray,underline:Pe.underline,set info(t){this._info=t},get info(){return this._info||this.primary},set em(t){this._em=t},get em(){return this._em||this.primary.underline},set heading(t){this._heading=t},get heading(){return this._heading||this.muted.underline},set pending(t){this._pending=t},get pending(){return this._pending||this.primary},set submitted(t){this._submitted=t},get submitted(){return this._submitted||this.success},set cancelled(t){this._cancelled=t},get cancelled(){return this._cancelled||this.danger},set typing(t){this._typing=t},get typing(){return this._typing||this.dim},set placeholder(t){this._placeholder=t},get placeholder(){return this._placeholder||this.primary.dim},set highlight(t){this._highlight=t},get highlight(){return this._highlight||this.inverse}};$f.merge=(t={})=>{t.styles&&typeof t.styles.enabled=="boolean"&&(Pe.enabled=t.styles.enabled),t.styles&&typeof t.styles.visible=="boolean"&&(Pe.visible=t.styles.visible);let e=_f.merge({},$f,t.styles);delete e.merge;for(let r of Object.keys(Pe))hasOwnProperty.call(e,r)||Reflect.defineProperty(e,r,{get:()=>Pe[r]});for(let r of Object.keys(Pe.styles))hasOwnProperty.call(e,r)||Reflect.defineProperty(e,r,{get:()=>Pe[r]});return e};Zk.exports=$f});var Gk=S((RY,Vk)=>{"use strict";var kf=process.platform==="win32",Bt=Da(),F4=Ae(),Tf={...Bt.symbols,upDownDoubleArrow:"\u21D5",upDownDoubleArrow2:"\u2B0D",upDownArrow:"\u2195",asterisk:"*",asterism:"\u2042",bulletWhite:"\u25E6",electricArrow:"\u2301",ellipsisLarge:"\u22EF",ellipsisSmall:"\u2026",fullBlock:"\u2588",identicalTo:"\u2261",indicator:Bt.symbols.check,leftAngle:"\u2039",mark:"\u203B",minus:"\u2212",multiplication:"\xD7",obelus:"\xF7",percent:"%",pilcrow:"\xB6",pilcrow2:"\u2761",pencilUpRight:"\u2710",pencilDownRight:"\u270E",pencilRight:"\u270F",plus:"+",plusMinus:"\xB1",pointRight:"\u261E",rightAngle:"\u203A",section:"\xA7",hexagon:{off:"\u2B21",on:"\u2B22",disabled:"\u2B22"},ballot:{on:"\u2611",off:"\u2610",disabled:"\u2612"},stars:{on:"\u2605",off:"\u2606",disabled:"\u2606"},folder:{on:"\u25BC",off:"\u25B6",disabled:"\u25B6"},prefix:{pending:Bt.symbols.question,submitted:Bt.symbols.check,cancelled:Bt.symbols.cross},separator:{pending:Bt.symbols.pointerSmall,submitted:Bt.symbols.middot,cancelled:Bt.symbols.middot},radio:{off:kf?"( )":"\u25EF",on:kf?"(*)":"\u25C9",disabled:kf?"(|)":"\u24BE"},numbers:["\u24EA","\u2460","\u2461","\u2462","\u2463","\u2464","\u2465","\u2466","\u2467","\u2468","\u2469","\u246A","\u246B","\u246C","\u246D","\u246E","\u246F","\u2470","\u2471","\u2472","\u2473","\u3251","\u3252","\u3253","\u3254","\u3255","\u3256","\u3257","\u3258","\u3259","\u325A","\u325B","\u325C","\u325D","\u325E","\u325F","\u32B1","\u32B2","\u32B3","\u32B4","\u32B5","\u32B6","\u32B7","\u32B8","\u32B9","\u32BA","\u32BB","\u32BC","\u32BD","\u32BE","\u32BF"]};Tf.merge=t=>{let e=F4.merge({},Bt.symbols,Tf,t.symbols);return delete e.merge,e};Vk.exports=Tf});var Jk=S((DY,Qk)=>{"use strict";var B4=Kk(),Z4=Gk(),K4=Ae();Qk.exports=t=>{t.options=K4.merge({},t.options.theme,t.options),t.symbols=Z4.merge(t.options),t.styles=B4.merge(t.options)}});var e0=S((Yk,Xk)=>{"use strict";var Wk=process.env.TERM_PROGRAM==="Apple_Terminal",V4=ar(),Ef=Ae(),xt=Xk.exports=Yk,pe="\x1B[",Hk="\x07",If=!1,lr=xt.code={bell:Hk,beep:Hk,beginning:`${pe}G`,down:`${pe}J`,esc:pe,getPosition:`${pe}6n`,hide:`${pe}?25l`,line:`${pe}2K`,lineEnd:`${pe}K`,lineStart:`${pe}1K`,restorePosition:pe+(Wk?"8":"u"),savePosition:pe+(Wk?"7":"s"),screen:`${pe}2J`,show:`${pe}?25h`,up:`${pe}1J`},qr=xt.cursor={get hidden(){return If},hide(){return If=!0,lr.hide},show(){return If=!1,lr.show},forward:(t=1)=>`${pe}${t}C`,backward:(t=1)=>`${pe}${t}D`,nextLine:(t=1)=>`${pe}E`.repeat(t),prevLine:(t=1)=>`${pe}F`.repeat(t),up:(t=1)=>t?`${pe}${t}A`:"",down:(t=1)=>t?`${pe}${t}B`:"",right:(t=1)=>t?`${pe}${t}C`:"",left:(t=1)=>t?`${pe}${t}D`:"",to(t,e){return e?`${pe}${e+1};${t+1}H`:`${pe}${t+1}G`},move(t=0,e=0){let r="";return r+=t<0?qr.left(-t):t>0?qr.right(t):"",r+=e<0?qr.up(-e):e>0?qr.down(e):"",r},strLen(t){for(var e=0,r=t.length,i=-1,n=0;n<r;n++)i=t.charCodeAt(n),i>=0&&i<=128?e+=1:e+=2;return e},restore(t={}){let{after:e,cursor:r,initial:i,input:n,prompt:o,size:s,value:a}=t;if(i=Ef.isPrimitive(i)?String(i):"",n=Ef.isPrimitive(n)?String(n):"",a=Ef.isPrimitive(a)?String(a):"",s){let l=xt.cursor.up(s)+xt.cursor.to(this.strLen(o)),c=n.length-r;return c>0&&(l+=xt.cursor.left(c)),l}if(a||e){let l=!n&&i?-this.strLen(i):-this.strLen(n)+r;return e&&(l-=this.strLen(e)),n===""&&i&&!o.includes(i)&&(l+=this.strLen(i)),xt.cursor.move(l)}}},Cf=xt.erase={screen:lr.screen,up:lr.up,down:lr.down,line:lr.line,lineEnd:lr.lineEnd,lineStart:lr.lineStart,lines(t){let e="";for(let r=0;r<t;r++)e+=xt.erase.line+(r<t-1?xt.cursor.up(1):"");return t&&(e+=xt.code.beginning),e}};xt.clear=(t="",e=process.stdout.columns)=>{if(!e)return Cf.line+qr.to(0);let r=o=>[...V4(o)].length,i=t.split(/\r?\n/),n=0;for(let o of i)n+=1+Math.floor(Math.max(r(o)-1,0)/e);return(Cf.line+qr.prevLine()).repeat(n-1)+Cf.line+qr.to(0)}});var kn=S((LY,r0)=>{"use strict";var G4=X("events"),t0=ar(),Pf=Sf(),Q4=qk(),J4=Bk(),W4=Jk(),Ze=Ae(),Fr=e0(),Nf=class t extends G4{constructor(e={}){super(),this.name=e.name,this.type=e.type,this.options=e,W4(this),Q4(this),this.state=new J4(this),this.initial=[e.initial,e.default].find(r=>r!=null),this.stdout=e.stdout||process.stdout,this.stdin=e.stdin||process.stdin,this.scale=e.scale||1,this.term=this.options.term||process.env.TERM_PROGRAM,this.margin=Y4(this.options.margin),this.setMaxListeners(0),H4(this)}async keypress(e,r={}){this.keypressed=!0;let i=Pf.action(e,Pf(e,r),this.options.actions);this.state.keypress=i,this.emit("keypress",e,i),this.emit("state",this.state.clone());let n=this.options[i.action]||this[i.action]||this.dispatch;if(typeof n=="function")return await n.call(this,e,i);this.alert()}alert(){delete this.state.alert,this.options.show===!1?this.emit("alert"):this.stdout.write(Fr.code.beep)}cursorHide(){this.stdout.write(Fr.cursor.hide());let e=Ze.onExit(()=>this.cursorShow());this.on("close",()=>{this.cursorShow(),e()})}cursorShow(){this.stdout.write(Fr.cursor.show())}write(e){e&&(this.stdout&&this.state.show!==!1&&this.stdout.write(e),this.state.buffer+=e)}clear(e=0){let r=this.state.buffer;this.state.buffer="",!(!r&&!e||this.options.show===!1)&&this.stdout.write(Fr.cursor.down(e)+Fr.clear(r,this.width))}restore(){if(this.state.closed||this.options.show===!1)return;let{prompt:e,after:r,rest:i}=this.sections(),{cursor:n,initial:o="",input:s="",value:a=""}=this,l=this.state.size=i.length,c={after:r,cursor:n,initial:o,input:s,prompt:e,size:l,value:a},u=Fr.cursor.restore(c);u&&this.stdout.write(u)}sections(){let{buffer:e,input:r,prompt:i}=this.state;i=t0(i);let n=t0(e),o=n.indexOf(i),s=n.slice(0,o),l=n.slice(o).split(`
|
|
6
|
-
`),c=l[0],u=l[l.length-1],f=(i+(r?" "+r:"")).length,m=f<c.length?c.slice(f+1):"";return{header:s,prompt:c,after:m,rest:l.slice(1),last:u}}async submit(){this.state.submitted=!0,this.state.validating=!0,this.options.onSubmit&&await this.options.onSubmit.call(this,this.name,this.value,this);let e=this.state.error||await this.validate(this.value,this.state);if(e!==!0){let r=`
|
|
7
|
-
`+this.symbols.pointer+" ";typeof e=="string"?r+=e.trim():r+="Invalid input",this.state.error=`
|
|
8
|
-
`+this.styles.danger(r),this.state.submitted=!1,await this.render(),await this.alert(),this.state.validating=!1,this.state.error=void 0;return}this.state.validating=!1,await this.render(),await this.close(),this.value=await this.result(this.value),this.emit("submit",this.value)}async cancel(e){this.state.cancelled=this.state.submitted=!0,await this.render(),await this.close(),typeof this.options.onCancel=="function"&&await this.options.onCancel.call(this,this.name,this.value,this),this.emit("cancel",await this.error(e))}async close(){this.state.closed=!0;try{let e=this.sections(),r=Math.ceil(e.prompt.length/this.width);e.rest&&this.write(Fr.cursor.down(e.rest.length)),this.write(`
|
|
9
|
-
`.repeat(r))}catch{}this.emit("close")}start(){!this.stop&&this.options.show!==!1&&(this.stop=Pf.listen(this,this.keypress.bind(this)),this.once("close",this.stop),this.emit("start",this))}async skip(){return this.skipped=this.options.skip===!0,typeof this.options.skip=="function"&&(this.skipped=await this.options.skip.call(this,this.name,this.value)),this.skipped}async initialize(){let{format:e,options:r,result:i}=this;if(this.format=()=>e.call(this,this.value),this.result=()=>i.call(this,this.value),typeof r.initial=="function"&&(this.initial=await r.initial.call(this,this)),typeof r.onRun=="function"&&await r.onRun.call(this,this),typeof r.onSubmit=="function"){let n=r.onSubmit.bind(this),o=this.submit.bind(this);delete this.options.onSubmit,this.submit=async()=>(await n(this.name,this.value,this),o())}await this.start(),await this.render()}render(){throw new Error("expected prompt to have a custom render method")}run(){return new Promise(async(e,r)=>{if(this.once("submit",e),this.once("cancel",r),await this.skip())return this.render=()=>{},this.submit();await this.initialize(),this.emit("run")})}async element(e,r,i){let{options:n,state:o,symbols:s,timers:a}=this,l=a&&a[e];o.timer=l;let c=n[e]||o[e]||s[e],u=r&&r[e]!=null?r[e]:await c;if(u==="")return u;let d=await this.resolve(u,o,r,i);return!d&&r&&r[e]?this.resolve(c,o,r,i):d}async prefix(){let e=await this.element("prefix")||this.symbols,r=this.timers&&this.timers.prefix,i=this.state;return i.timer=r,Ze.isObject(e)&&(e=e[i.status]||e.pending),Ze.hasColor(e)?e:(this.styles[i.status]||this.styles.pending)(e)}async message(){let e=await this.element("message");return Ze.hasColor(e)?e:this.styles.strong(e)}async separator(){let e=await this.element("separator")||this.symbols,r=this.timers&&this.timers.separator,i=this.state;i.timer=r;let n=e[i.status]||e.pending||i.separator,o=await this.resolve(n,i);return Ze.isObject(o)&&(o=o[i.status]||o.pending),Ze.hasColor(o)?o:this.styles.muted(o)}async pointer(e,r){let i=await this.element("pointer",e,r);if(typeof i=="string"&&Ze.hasColor(i))return i;if(i){let n=this.styles,o=this.index===r,s=o?n.primary:c=>c,a=await this.resolve(i[o?"on":"off"]||i,this.state),l=Ze.hasColor(a)?a:s(a);return o?l:" ".repeat(a.length)}}async indicator(e,r){let i=await this.element("indicator",e,r);if(typeof i=="string"&&Ze.hasColor(i))return i;if(i){let n=this.styles,o=e.enabled===!0,s=o?n.success:n.dark,a=i[o?"on":"off"]||i;return Ze.hasColor(a)?a:s(a)}return""}body(){return null}footer(){if(this.state.status==="pending")return this.element("footer")}header(){if(this.state.status==="pending")return this.element("header")}async hint(){if(this.state.status==="pending"&&!this.isValue(this.state.input)){let e=await this.element("hint");return Ze.hasColor(e)?e:this.styles.muted(e)}}error(e){return this.state.submitted?"":e||this.state.error}format(e){return e}result(e){return e}validate(e){return this.options.required===!0?this.isValue(e):!0}isValue(e){return e!=null&&e!==""}resolve(e,...r){return Ze.resolve(this,e,...r)}get base(){return t.prototype}get style(){return this.styles[this.state.status]}get height(){return this.options.rows||Ze.height(this.stdout,25)}get width(){return this.options.columns||Ze.width(this.stdout,80)}get size(){return{width:this.width,height:this.height}}set cursor(e){this.state.cursor=e}get cursor(){return this.state.cursor}set input(e){this.state.input=e}get input(){return this.state.input}set value(e){this.state.value=e}get value(){let{input:e,value:r}=this.state,i=[r,e].find(this.isValue.bind(this));return this.isValue(i)?i:this.initial}static get prompt(){return e=>new this(e).run()}};function H4(t){let e=n=>t[n]===void 0||typeof t[n]=="function",r=["actions","choices","initial","margin","roles","styles","symbols","theme","timers","value"],i=["body","footer","error","header","hint","indicator","message","prefix","separator","skip"];for(let n of Object.keys(t.options)){if(r.includes(n)||/^on[A-Z]/.test(n))continue;let o=t.options[n];typeof o=="function"&&e(n)?i.includes(n)||(t[n]=o.bind(t)):typeof t[n]!="function"&&(t[n]=o)}}function Y4(t){typeof t=="number"&&(t=[t,t,t,t]);let e=[].concat(t||[]),r=n=>n%2===0?`
|
|
10
|
-
`:" ",i=[];for(let n=0;n<4;n++){let o=r(n);e[n]?i.push(o.repeat(e[n])):i.push("")}return i}r0.exports=Nf});var o0=S((zY,i0)=>{"use strict";var X4=Ae(),n0={default(t,e){return e},checkbox(t,e){throw new Error("checkbox role is not implemented yet")},editable(t,e){throw new Error("editable role is not implemented yet")},expandable(t,e){throw new Error("expandable role is not implemented yet")},heading(t,e){return e.disabled="",e.indicator=[e.indicator," "].find(r=>r!=null),e.message=e.message||"",e},input(t,e){throw new Error("input role is not implemented yet")},option(t,e){return n0.default(t,e)},radio(t,e){throw new Error("radio role is not implemented yet")},separator(t,e){return e.disabled="",e.indicator=[e.indicator," "].find(r=>r!=null),e.message=e.message||t.symbols.line.repeat(5),e},spacer(t,e){return e}};i0.exports=(t,e={})=>{let r=X4.merge({},n0,e.roles);return r[t]||r.default}});var co=S((jY,l0)=>{"use strict";var eM=ar(),tM=kn(),rM=o0(),Ua=Ae(),{reorder:Of,scrollUp:nM,scrollDown:iM,isObject:s0,swap:oM}=Ua,Af=class extends tM{constructor(e){super(e),this.cursorHide(),this.maxSelected=e.maxSelected||1/0,this.multiple=e.multiple||!1,this.initial=e.initial||0,this.delay=e.delay||0,this.longest=0,this.num=""}async initialize(){typeof this.options.initial=="function"&&(this.initial=await this.options.initial.call(this)),await this.reset(!0),await super.initialize()}async reset(){let{choices:e,initial:r,autofocus:i,suggest:n}=this.options;if(this.state._choices=[],this.state.choices=[],this.choices=await Promise.all(await this.toChoices(e)),this.choices.forEach(o=>o.enabled=!1),typeof n!="function"&&this.selectable.length===0)throw new Error("At least one choice must be selectable");s0(r)&&(r=Object.keys(r)),Array.isArray(r)?(i!=null&&(this.index=this.findIndex(i)),r.forEach(o=>this.enable(this.find(o))),await this.render()):(i!=null&&(r=i),typeof r=="string"&&(r=this.findIndex(r)),typeof r=="number"&&r>-1&&(this.index=Math.max(0,Math.min(r,this.choices.length)),this.enable(this.find(this.index)))),this.isDisabled(this.focused)&&await this.down()}async toChoices(e,r){this.state.loadingChoices=!0;let i=[],n=0,o=async(s,a)=>{typeof s=="function"&&(s=await s.call(this)),s instanceof Promise&&(s=await s);for(let l=0;l<s.length;l++){let c=s[l]=await this.toChoice(s[l],n++,a);i.push(c),c.choices&&await o(c.choices,c)}return i};return o(e,r).then(s=>(this.state.loadingChoices=!1,s))}async toChoice(e,r,i){if(typeof e=="function"&&(e=await e.call(this,this)),e instanceof Promise&&(e=await e),typeof e=="string"&&(e={name:e}),e.normalized)return e;e.normalized=!0;let n=e.value;if(e=rM(e.role,this.options)(this,e),typeof e.disabled=="string"&&!e.hint&&(e.hint=e.disabled,e.disabled=!0),e.disabled===!0&&e.hint==null&&(e.hint="(disabled)"),e.index!=null)return e;e.name=e.name||e.key||e.title||e.value||e.message,e.message=e.message||e.name||"",e.value=[e.value,e.name].find(this.isValue.bind(this)),e.input="",e.index=r,e.cursor=0,Ua.define(e,"parent",i),e.level=i?i.level+1:1,e.indent==null&&(e.indent=i?i.indent+" ":e.indent||""),e.path=i?i.path+"."+e.name:e.name,e.enabled=!!(this.multiple&&!this.isDisabled(e)&&(e.enabled||this.isSelected(e))),this.isDisabled(e)||(this.longest=Math.max(this.longest,eM(e.message).length));let s={...e};return e.reset=(a=s.input,l=s.value)=>{for(let c of Object.keys(s))e[c]=s[c];e.input=a,e.value=l},n==null&&typeof e.initial=="function"&&(e.input=await e.initial.call(this,this.state,e,r)),e}async onChoice(e,r){this.emit("choice",e,r,this),typeof e.onChoice=="function"&&await e.onChoice.call(this,this.state,e,r)}async addChoice(e,r,i){let n=await this.toChoice(e,r,i);return this.choices.push(n),this.index=this.choices.length-1,this.limit=this.choices.length,n}async newItem(e,r,i){let n={name:"New choice name?",editable:!0,newChoice:!0,...e},o=await this.addChoice(n,r,i);return o.updateChoice=()=>{delete o.newChoice,o.name=o.message=o.input,o.input="",o.cursor=0},this.render()}indent(e){return e.indent==null?e.level>1?" ".repeat(e.level-1):"":e.indent}dispatch(e,r){if(this.multiple&&this[r.name])return this[r.name]();this.alert()}focus(e,r){return typeof r!="boolean"&&(r=e.enabled),r&&!e.enabled&&this.selected.length>=this.maxSelected?this.alert():(this.index=e.index,e.enabled=r&&!this.isDisabled(e),e)}space(){if(!this.multiple)return this.alert();if(this.focused)return this.toggle(this.focused),this.render()}a(){if(this.maxSelected<this.choices.length)return this.alert();let e=this.selectable.every(r=>r.enabled);return this.choices.forEach(r=>r.enabled=!e),this.render()}i(){return this.choices.length-this.selected.length>this.maxSelected?this.alert():(this.choices.forEach(e=>e.enabled=!e.enabled),this.render())}g(){if(!this.choices.some(r=>!!r.parent))return this.a();let e=this.focused;return this.toggle(e.parent&&!e.choices?e.parent:e),this.render()}toggle(e,r){if(!e.enabled&&this.selected.length>=this.maxSelected)return this.alert();typeof r!="boolean"&&(r=!e.enabled),e.enabled=r,e.choices&&e.choices.forEach(n=>this.toggle(n,r));let i=e.parent;for(;i;){let n=i.choices.filter(o=>this.isDisabled(o));i.enabled=n.every(o=>o.enabled===!0),i=i.parent}return a0(this,this.choices),this.emit("toggle",e,this),e}enable(e){return this.selected.length>=this.maxSelected?this.alert():(e.enabled=!this.isDisabled(e),e.choices&&e.choices.forEach(this.enable.bind(this)),e)}disable(e){return e.enabled=!1,e.choices&&e.choices.forEach(this.disable.bind(this)),e}number(e){this.num+=e;let r=i=>{let n=Number(i);if(n>this.choices.length-1)return this.alert();let o=this.focused,s=this.choices.find(a=>n===a.index);if(!s.enabled&&this.selected.length>=this.maxSelected)return this.alert();if(this.visible.indexOf(s)===-1){let a=Of(this.choices),l=a.indexOf(s);if(o.index>l){let c=a.slice(l,l+this.limit),u=a.filter(d=>!c.includes(d));this.choices=c.concat(u)}else{let c=l-this.limit+1;this.choices=a.slice(c).concat(a.slice(0,c))}}return this.index=this.choices.indexOf(s),this.toggle(this.focused),this.render()};return clearTimeout(this.numberTimeout),new Promise(i=>{let n=this.choices.length,o=this.num,s=(a=!1,l)=>{clearTimeout(this.numberTimeout),a&&(l=r(o)),this.num="",i(l)};if(o==="0"||o.length===1&&+(o+"0")>n)return s(!0);if(Number(o)>n)return s(!1,this.alert());this.numberTimeout=setTimeout(()=>s(!0),this.delay)})}home(){return this.choices=Of(this.choices),this.index=0,this.render()}end(){let e=this.choices.length-this.limit,r=Of(this.choices);return this.choices=r.slice(e).concat(r.slice(0,e)),this.index=this.limit-1,this.render()}first(){return this.index=0,this.render()}last(){return this.index=this.visible.length-1,this.render()}prev(){return this.visible.length<=1?this.alert():this.up()}next(){return this.visible.length<=1?this.alert():this.down()}right(){return this.cursor>=this.input.length?this.alert():(this.cursor++,this.render())}left(){return this.cursor<=0?this.alert():(this.cursor--,this.render())}up(){let e=this.choices.length,r=this.visible.length,i=this.index;return this.options.scroll===!1&&i===0?this.alert():e>r&&i===0?this.scrollUp():(this.index=(i-1%e+e)%e,this.isDisabled()&&!this.allChoicesAreDisabled()?this.up():this.render())}down(){let e=this.choices.length,r=this.visible.length,i=this.index;return this.options.scroll===!1&&i===r-1?this.alert():e>r&&i===r-1?this.scrollDown():(this.index=(i+1)%e,this.isDisabled()&&!this.allChoicesAreDisabled()?this.down():this.render())}scrollUp(e=0){return this.choices=nM(this.choices),this.index=e,this.isDisabled()?this.up():this.render()}scrollDown(e=this.visible.length-1){return this.choices=iM(this.choices),this.index=e,this.isDisabled()?this.down():this.render()}async shiftUp(){if(this.options.sort===!0){this.sorting=!0,this.swap(this.index-1),await this.up(),this.sorting=!1;return}return this.scrollUp(this.index)}async shiftDown(){if(this.options.sort===!0){this.sorting=!0,this.swap(this.index+1),await this.down(),this.sorting=!1;return}return this.scrollDown(this.index)}pageUp(){return this.visible.length<=1?this.alert():(this.limit=Math.max(this.limit-1,0),this.index=Math.min(this.limit-1,this.index),this._limit=this.limit,this.isDisabled()?this.up():this.render())}pageDown(){return this.visible.length>=this.choices.length?this.alert():(this.index=Math.max(0,this.index),this.limit=Math.min(this.limit+1,this.choices.length),this._limit=this.limit,this.isDisabled()?this.down():this.render())}swap(e){oM(this.choices,this.index,e)}allChoicesAreDisabled(e=this.choices){return e.every(r=>this.isDisabled(r))}isDisabled(e=this.focused){return e&&["disabled","collapsed","hidden","completing","readonly"].some(i=>e[i]===!0)?!0:e&&e.role==="heading"}isEnabled(e=this.focused){if(Array.isArray(e))return e.every(r=>this.isEnabled(r));if(e.choices){let r=e.choices.filter(i=>!this.isDisabled(i));return e.enabled&&r.every(i=>this.isEnabled(i))}return e.enabled&&!this.isDisabled(e)}isChoice(e,r){return e.name===r||e.index===Number(r)}isSelected(e){return Array.isArray(this.initial)?this.initial.some(r=>this.isChoice(e,r)):this.isChoice(e,this.initial)}map(e=[],r="value"){return[].concat(e||[]).reduce((i,n)=>(i[n]=this.find(n,r),i),{})}filter(e,r){let n=typeof e=="function"?e:(a,l)=>[a.name,l].includes(e),s=(this.options.multiple?this.state._choices:this.choices).filter(n);return r?s.map(a=>a[r]):s}find(e,r){if(s0(e))return r?e[r]:e;let n=typeof e=="function"?e:(s,a)=>[s.name,a].includes(e),o=this.choices.find(n);if(o)return r?o[r]:o}findIndex(e){return this.choices.indexOf(this.find(e))}async submit(){let e=this.focused;if(!e)return this.alert();if(e.newChoice)return e.input?(e.updateChoice(),this.render()):this.alert();if(this.choices.some(s=>s.newChoice))return this.alert();let{reorder:r,sort:i}=this.options,n=this.multiple===!0,o=this.selected;return o===void 0?this.alert():(Array.isArray(o)&&r!==!1&&i!==!0&&(o=Ua.reorder(o)),this.value=n?o.map(s=>s.name):o.name,super.submit())}set choices(e=[]){this.state._choices=this.state._choices||[],this.state.choices=e;for(let r of e)this.state._choices.some(i=>i.name===r.name)||this.state._choices.push(r);if(!this._initial&&this.options.initial){this._initial=!0;let r=this.initial;if(typeof r=="string"||typeof r=="number"){let i=this.find(r);i&&(this.initial=i.index,this.focus(i,!0))}}}get choices(){return a0(this,this.state.choices||[])}set visible(e){this.state.visible=e}get visible(){return(this.state.visible||this.choices).slice(0,this.limit)}set limit(e){this.state.limit=e}get limit(){let{state:e,options:r,choices:i}=this,n=e.limit||this._limit||r.limit||i.length;return Math.min(n,this.height)}set value(e){super.value=e}get value(){return typeof super.value!="string"&&super.value===this.initial?this.input:super.value}set index(e){this.state.index=e}get index(){return Math.max(0,this.state?this.state.index:0)}get enabled(){return this.filter(this.isEnabled.bind(this))}get focused(){let e=this.choices[this.index];return e&&this.state.submitted&&this.multiple!==!0&&(e.enabled=!0),e}get selectable(){return this.choices.filter(e=>!this.isDisabled(e))}get selected(){return this.multiple?this.enabled:this.focused}};function a0(t,e){if(e instanceof Promise)return e;if(typeof e=="function"){if(Ua.isAsyncFn(e))return e;e=e.call(t,t)}for(let r of e){if(Array.isArray(r.choices)){let i=r.choices.filter(n=>!t.isDisabled(n));r.enabled=i.every(n=>n.enabled===!0)}t.isDisabled(r)===!0&&delete r.enabled}return e}l0.exports=Af});var cr=S((UY,c0)=>{"use strict";var sM=co(),Rf=Ae(),Df=class extends sM{constructor(e){super(e),this.emptyError=this.options.emptyError||"No items were selected"}async dispatch(e,r){if(this.multiple)return this[r.name]?await this[r.name](e,r):await super.dispatch(e,r);this.alert()}separator(){if(this.options.separator)return super.separator();let e=this.styles.muted(this.symbols.ellipsis);return this.state.submitted?super.separator():e}pointer(e,r){return!this.multiple||this.options.pointer?super.pointer(e,r):""}indicator(e,r){return this.multiple?super.indicator(e,r):""}choiceMessage(e,r){let i=this.resolve(e.message,this.state,e,r);return e.role==="heading"&&!Rf.hasColor(i)&&(i=this.styles.strong(i)),this.resolve(i,this.state,e,r)}choiceSeparator(){return":"}async renderChoice(e,r){await this.onChoice(e,r);let i=this.index===r,n=await this.pointer(e,r),o=await this.indicator(e,r)+(e.pad||""),s=await this.resolve(e.hint,this.state,e,r);s&&!Rf.hasColor(s)&&(s=this.styles.muted(s));let a=this.indent(e),l=await this.choiceMessage(e,r),c=()=>[this.margin[3],a+n+o,l,this.margin[1],s].filter(Boolean).join(" ");return e.role==="heading"?c():e.disabled?(Rf.hasColor(l)||(l=this.styles.disabled(l)),c()):(i&&(l=this.styles.em(l)),c())}async renderChoices(){if(this.state.loading==="choices")return this.styles.warning("Loading choices");if(this.state.submitted)return"";let e=this.visible.map(async(o,s)=>await this.renderChoice(o,s)),r=await Promise.all(e);r.length||r.push(this.styles.danger("No matching choices"));let i=this.margin[0]+r.join(`
|
|
11
|
-
`),n;return this.options.choicesHeader&&(n=await this.resolve(this.options.choicesHeader,this.state)),[n,i].filter(Boolean).join(`
|
|
12
|
-
`)}format(){return!this.state.submitted||this.state.cancelled?"":Array.isArray(this.selected)?this.selected.map(e=>this.styles.primary(e.name)).join(", "):this.styles.primary(this.selected.name)}async render(){let{submitted:e,size:r}=this.state,i="",n=await this.header(),o=await this.prefix(),s=await this.separator(),a=await this.message();this.options.promptLine!==!1&&(i=[o,a,s,""].join(" "),this.state.prompt=i);let l=await this.format(),c=await this.error()||await this.hint(),u=await this.renderChoices(),d=await this.footer();l&&(i+=l),c&&!i.includes(c)&&(i+=" "+c),e&&!l&&!u.trim()&&this.multiple&&this.emptyError!=null&&(i+=this.styles.danger(this.emptyError)),this.clear(r),this.write([n,i,u,d].filter(Boolean).join(`
|
|
13
|
-
`)),this.write(this.margin[2]),this.restore()}};c0.exports=Df});var d0=S((MY,u0)=>{"use strict";var aM=cr(),lM=(t,e)=>{let r=t?new RegExp(t,"ig"):/$^/;return i=>t?i.replace(r,n=>e(n)):i},Lf=class extends aM{constructor(e){super(e),this.cursorShow()}moveCursor(e){this.state.cursor+=e}dispatch(e){return this.append(e)}space(e){return this.options.multiple?super.space(e):this.append(e)}append(e){let{cursor:r,input:i}=this.state;return this.input=i.slice(0,r)+e+i.slice(r),this.moveCursor(1),this.complete()}delete(){let{cursor:e,input:r}=this.state;return r?(this.input=r.slice(0,e-1)+r.slice(e),this.moveCursor(-1),this.complete()):this.alert()}deleteForward(){let{cursor:e,input:r}=this.state;return r[e]===void 0?this.alert():(this.input=`${r}`.slice(0,e)+`${r}`.slice(e+1),this.complete())}number(e){return this.append(e)}async complete(){this.completing=!0,this.choices=await this.suggest(this.input,this.state._choices),this.state.limit=void 0,this.index=Math.min(Math.max(this.visible.length-1,0),this.index),await this.render(),this.completing=!1}suggest(e=this.input,r=this.state._choices){if(typeof this.options.suggest=="function")return this.options.suggest.call(this,e,r);let i=e.toLowerCase();return r.filter(n=>n.message.toLowerCase().includes(i))}pointer(){return""}format(){if(!this.focused)return this.input;if(this.options.multiple&&this.state.submitted)return this.selected.map(e=>this.styles.primary(e.message)).join(", ");if(this.state.submitted){let e=this.value=this.input=this.focused.value;return this.styles.primary(e)}return this.input}async render(){if(this.state.status!=="pending")return super.render();let e=this.options.highlight||this.styles.complement,r=(o,s)=>o&&(e.stack?e(o):e.call(this,o)),i=lM(this.input,r),n=this.choices;this.choices=n.map(o=>({...o,message:i(o.message)})),await super.render(),this.choices=n}submit(){return this.options.multiple&&(this.value=this.selected.map(e=>e.name)),super.submit()}};u0.exports=Lf});var jf=S((qY,f0)=>{"use strict";var zf=Ae();f0.exports=(t,e={})=>{t.cursorHide();let{input:r="",initial:i="",pos:n,showCursor:o=!0,color:s}=e,a=s||t.styles.placeholder,l=zf.inverse(t.styles.primary),c=h=>l(t.styles.black(h)),u=r,d=" ",f=c(d);if(t.blink&&t.blink.off===!0&&(c=h=>h,f=""),o&&n===0&&i===""&&r==="")return c(d);if(o&&n===0&&(r===i||r===""))return c(i[0])+a(i.slice(1));i=zf.isPrimitive(i)?`${i}`:"",r=zf.isPrimitive(r)?`${r}`:"";let m=i&&i.startsWith(r)&&i!==r,y=m?c(i[r.length]):f;if(n!==r.length&&o===!0&&(u=r.slice(0,n)+c(r[n])+r.slice(n+1),y=""),o===!1&&(y=""),m){let h=t.styles.unstyle(u+y);return u+y+a(i.slice(h.length))}return u+y}});var Ma=S((FY,m0)=>{"use strict";var cM=ar(),uM=cr(),dM=jf(),Uf=class extends uM{constructor(e){super({...e,multiple:!0}),this.type="form",this.initial=this.options.initial,this.align=[this.options.align,"right"].find(r=>r!=null),this.emptyError="",this.values={}}async reset(e){return await super.reset(),e===!0&&(this._index=this.index),this.index=this._index,this.values={},this.choices.forEach(r=>r.reset&&r.reset()),this.render()}dispatch(e){return!!e&&this.append(e)}append(e){let r=this.focused;if(!r)return this.alert();let{cursor:i,input:n}=r;return r.value=r.input=n.slice(0,i)+e+n.slice(i),r.cursor++,this.render()}delete(){let e=this.focused;if(!e||e.cursor<=0)return this.alert();let{cursor:r,input:i}=e;return e.value=e.input=i.slice(0,r-1)+i.slice(r),e.cursor--,this.render()}deleteForward(){let e=this.focused;if(!e)return this.alert();let{cursor:r,input:i}=e;if(i[r]===void 0)return this.alert();let n=`${i}`.slice(0,r)+`${i}`.slice(r+1);return e.value=e.input=n,this.render()}right(){let e=this.focused;return e?e.cursor>=e.input.length?this.alert():(e.cursor++,this.render()):this.alert()}left(){let e=this.focused;return e?e.cursor<=0?this.alert():(e.cursor--,this.render()):this.alert()}space(e,r){return this.dispatch(e,r)}number(e,r){return this.dispatch(e,r)}next(){let e=this.focused;if(!e)return this.alert();let{initial:r,input:i}=e;return r&&r.startsWith(i)&&i!==r?(e.value=e.input=r,e.cursor=e.value.length,this.render()):super.next()}prev(){let e=this.focused;return e?e.cursor===0?super.prev():(e.value=e.input="",e.cursor=0,this.render()):this.alert()}separator(){return""}format(e){return this.state.submitted?"":super.format(e)}pointer(){return""}indicator(e){return e.input?"\u29BF":"\u2299"}async choiceSeparator(e,r){let i=await this.resolve(e.separator,this.state,e,r)||":";return i?" "+this.styles.disabled(i):""}async renderChoice(e,r){await this.onChoice(e,r);let{state:i,styles:n}=this,{cursor:o,initial:s="",name:a,input:l=""}=e,{muted:c,submitted:u,primary:d,danger:f}=n,m=this.index===r,y=e.validate||(()=>!0),h=await this.choiceSeparator(e,r),w=e.message;this.align==="right"&&(w=w.padStart(this.longest+1," ")),this.align==="left"&&(w=w.padEnd(this.longest+1," "));let _=this.values[a]=l||s,T=l?"success":"dark";await y.call(e,_,this.state)!==!0&&(T="danger");let k=n[T],E=k(await this.indicator(e,r))+(e.pad||""),R=this.indent(e),L=()=>[R,E,w+h,l].filter(Boolean).join(" ");if(i.submitted)return w=cM(w),l=u(l),L();if(e.format)l=await e.format.call(this,l,e,r);else{let U=this.styles.muted;l=dM(this,{input:l,initial:s,pos:o,showCursor:m,color:U})}return this.isValue(l)||(l=this.styles.muted(this.symbols.ellipsis)),e.result&&(this.values[a]=await e.result.call(this,_,e,r)),m&&(w=d(w)),e.error?l+=(l?" ":"")+f(e.error.trim()):e.hint&&(l+=(l?" ":"")+c(e.hint.trim())),L()}async submit(){return this.value=this.values,super.base.submit.call(this)}};m0.exports=Uf});var Mf=S((BY,h0)=>{"use strict";var fM=Ma(),mM=()=>{throw new Error("expected prompt to have a custom authenticate method")},p0=(t=mM)=>{class e extends fM{constructor(i){super(i)}async submit(){this.value=await t.call(this,this.values,this.state),super.base.submit.call(this)}static create(i){return p0(i)}}return e};h0.exports=p0()});var v0=S((ZY,y0)=>{"use strict";var pM=Mf();function hM(t,e){return t.username===this.options.username&&t.password===this.options.password}var g0=(t=hM)=>{let e=[{name:"username",message:"username"},{name:"password",message:"password",format(i){return this.options.showPassword?i:(this.state.submitted?this.styles.primary:this.styles.muted)(this.symbols.asterisk.repeat(i.length))}}];class r extends pM.create(t){constructor(n){super({...n,choices:e})}static create(n){return g0(n)}}return r};y0.exports=g0()});var qa=S((KY,b0)=>{"use strict";var gM=kn(),{isPrimitive:yM,hasColor:vM}=Ae(),qf=class extends gM{constructor(e){super(e),this.cursorHide()}async initialize(){let e=await this.resolve(this.initial,this.state);this.input=await this.cast(e),await super.initialize()}dispatch(e){return this.isValue(e)?(this.input=e,this.submit()):this.alert()}format(e){let{styles:r,state:i}=this;return i.submitted?r.success(e):r.primary(e)}cast(e){return this.isTrue(e)}isTrue(e){return/^[ty1]/i.test(e)}isFalse(e){return/^[fn0]/i.test(e)}isValue(e){return yM(e)&&(this.isTrue(e)||this.isFalse(e))}async hint(){if(this.state.status==="pending"){let e=await this.element("hint");return vM(e)?e:this.styles.muted(e)}}async render(){let{input:e,size:r}=this.state,i=await this.prefix(),n=await this.separator(),o=await this.message(),s=this.styles.muted(this.default),a=[i,o,s,n].filter(Boolean).join(" ");this.state.prompt=a;let l=await this.header(),c=this.value=this.cast(e),u=await this.format(c),d=await this.error()||await this.hint(),f=await this.footer();d&&!a.includes(d)&&(u+=" "+d),a+=" "+u,this.clear(r),this.write([l,a,f].filter(Boolean).join(`
|
|
14
|
-
`)),this.restore()}set value(e){super.value=e}get value(){return this.cast(super.value)}};b0.exports=qf});var S0=S((VY,w0)=>{"use strict";var bM=qa(),Ff=class extends bM{constructor(e){super(e),this.default=this.options.default||(this.initial?"(Y/n)":"(y/N)")}};w0.exports=Ff});var _0=S((GY,x0)=>{"use strict";var wM=cr(),SM=Ma(),Tn=SM.prototype,Bf=class extends wM{constructor(e){super({...e,multiple:!0}),this.align=[this.options.align,"left"].find(r=>r!=null),this.emptyError="",this.values={}}dispatch(e,r){let i=this.focused,n=i.parent||{};return!i.editable&&!n.editable&&(e==="a"||e==="i")?super[e]():Tn.dispatch.call(this,e,r)}append(e,r){return Tn.append.call(this,e,r)}delete(e,r){return Tn.delete.call(this,e,r)}space(e){return this.focused.editable?this.append(e):super.space()}number(e){return this.focused.editable?this.append(e):super.number(e)}next(){return this.focused.editable?Tn.next.call(this):super.next()}prev(){return this.focused.editable?Tn.prev.call(this):super.prev()}async indicator(e,r){let i=e.indicator||"",n=e.editable?i:super.indicator(e,r);return await this.resolve(n,this.state,e,r)||""}indent(e){return e.role==="heading"?"":e.editable?" ":" "}async renderChoice(e,r){return e.indent="",e.editable?Tn.renderChoice.call(this,e,r):super.renderChoice(e,r)}error(){return""}footer(){return this.state.error}async validate(){let e=!0;for(let r of this.choices){if(typeof r.validate!="function"||r.role==="heading")continue;let i=r.parent?this.value[r.parent.name]:this.value;if(r.editable?i=r.value===r.name?r.initial||"":r.value:this.isDisabled(r)||(i=r.enabled===!0),e=await r.validate(i,this.state),e!==!0)break}return e!==!0&&(this.state.error=typeof e=="string"?e:"Invalid Input"),e}submit(){if(this.focused.newChoice===!0)return super.submit();if(this.choices.some(e=>e.newChoice))return this.alert();this.value={};for(let e of this.choices){let r=e.parent?this.value[e.parent.name]:this.value;if(e.role==="heading"){this.value[e.name]={};continue}e.editable?r[e.name]=e.value===e.name?e.initial||"":e.value:this.isDisabled(e)||(r[e.name]=e.enabled===!0)}return this.base.submit.call(this)}};x0.exports=Bf});var Br=S((QY,$0)=>{"use strict";var xM=kn(),_M=Sf(),$M=jf(),{isPrimitive:kM}=Ae(),Zf=class extends xM{constructor(e){super(e),this.initial=kM(this.initial)?String(this.initial):"",this.initial&&this.cursorHide(),this.state.prevCursor=0,this.state.clipboard=[],this.keypressTimeout=this.options.keypressTimeout!==void 0?this.options.keypressTimeout:null}async keypress(e,r=e?_M(e,{}):{}){let i=Date.now(),n=i-this.lastKeypress;this.lastKeypress=i;let o=r.name==="return"||r.name==="enter",s=this.state.prevKeypress,a;if(this.state.prevKeypress=r,this.keypressTimeout!=null&&o){if(n<this.keypressTimeout)return this.submit();this.state.multilineBuffer=this.state.multilineBuffer||"",this.state.multilineBuffer+=e,a=!0,s=null}return(a||this.options.multiline&&o)&&(!s||s.name!=="return")?this.append(`
|
|
15
|
-
`,r):super.keypress(e,r)}moveCursor(e){this.cursor+=e}reset(){return this.input=this.value="",this.cursor=0,this.render()}dispatch(e,r){if(!e||r.ctrl||r.code)return this.alert();this.append(e)}append(e){let{cursor:r,input:i}=this.state;this.input=`${i}`.slice(0,r)+e+`${i}`.slice(r),this.moveCursor(String(e).length),this.render()}insert(e){this.append(e)}delete(){let{cursor:e,input:r}=this.state;if(e<=0)return this.alert();this.input=`${r}`.slice(0,e-1)+`${r}`.slice(e),this.moveCursor(-1),this.render()}deleteForward(){let{cursor:e,input:r}=this.state;if(r[e]===void 0)return this.alert();this.input=`${r}`.slice(0,e)+`${r}`.slice(e+1),this.render()}cutForward(){let e=this.cursor;if(this.input.length<=e)return this.alert();this.state.clipboard.push(this.input.slice(e)),this.input=this.input.slice(0,e),this.render()}cutLeft(){let e=this.cursor;if(e===0)return this.alert();let r=this.input.slice(0,e),i=this.input.slice(e),n=r.split(" ");this.state.clipboard.push(n.pop()),this.input=n.join(" "),this.cursor=this.input.length,this.input+=i,this.render()}paste(){if(!this.state.clipboard.length)return this.alert();this.insert(this.state.clipboard.pop()),this.render()}toggleCursor(){this.state.prevCursor?(this.cursor=this.state.prevCursor,this.state.prevCursor=0):(this.state.prevCursor=this.cursor,this.cursor=0),this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.input.length-1,this.render()}next(){let e=this.initial!=null?String(this.initial):"";if(!e||!e.startsWith(this.input))return this.alert();this.input=this.initial,this.cursor=this.initial.length,this.render()}prev(){if(!this.input)return this.alert();this.reset()}backward(){return this.left()}forward(){return this.right()}right(){return this.cursor>=this.input.length?this.alert():(this.moveCursor(1),this.render())}left(){return this.cursor<=0?this.alert():(this.moveCursor(-1),this.render())}isValue(e){return!!e}async format(e=this.value){let r=await this.resolve(this.initial,this.state);return this.state.submitted?this.styles.submitted(e||r):$M(this,{input:e,initial:r,pos:this.cursor})}async render(){let e=this.state.size,r=await this.prefix(),i=await this.separator(),n=await this.message(),o=[r,n,i].filter(Boolean).join(" ");this.state.prompt=o;let s=await this.header(),a=await this.format(),l=await this.error()||await this.hint(),c=await this.footer();l&&!a.includes(l)&&(a+=" "+l),o+=" "+a,this.clear(e),this.write([s,o,c].filter(Boolean).join(`
|
|
16
|
-
`)),this.restore()}};$0.exports=Zf});var T0=S((JY,k0)=>{"use strict";var TM=t=>t.filter((e,r)=>t.lastIndexOf(e)===r),Fa=t=>TM(t).filter(Boolean);k0.exports=(t,e={},r="")=>{let{past:i=[],present:n=""}=e,o,s;switch(t){case"prev":case"undo":return o=i.slice(0,i.length-1),s=i[i.length-1]||"",{past:Fa([r,...o]),present:s};case"next":case"redo":return o=i.slice(1),s=i[0]||"",{past:Fa([...o,r]),present:s};case"save":return{past:Fa([...i,r]),present:""};case"remove":return s=Fa(i.filter(a=>a!==r)),n="",s.length&&(n=s.pop()),{past:s,present:n};default:throw new Error(`Invalid action: "${t}"`)}}});var Vf=S((WY,I0)=>{"use strict";var EM=Br(),E0=T0(),Kf=class extends EM{constructor(e){super(e);let r=this.options.history;if(r&&r.store){let i=r.values||this.initial;this.autosave=!!r.autosave,this.store=r.store,this.data=this.store.get("values")||{past:[],present:i},this.initial=this.data.present||this.data.past[this.data.past.length-1]}}completion(e){return this.store?(this.data=E0(e,this.data,this.input),this.data.present?(this.input=this.data.present,this.cursor=this.input.length,this.render()):this.alert()):this.alert()}altUp(){return this.completion("prev")}altDown(){return this.completion("next")}prev(){return this.save(),super.prev()}save(){this.store&&(this.data=E0("save",this.data,this.input),this.store.set("values",this.data))}submit(){return this.store&&this.autosave===!0&&this.save(),super.submit()}};I0.exports=Kf});var P0=S((HY,C0)=>{"use strict";var IM=Br(),Gf=class extends IM{format(){return""}};C0.exports=Gf});var O0=S((YY,N0)=>{"use strict";var CM=Br(),Qf=class extends CM{constructor(e={}){super(e),this.sep=this.options.separator||/, */,this.initial=e.initial||""}split(e=this.value){return e?String(e).split(this.sep):[]}format(){let e=this.state.submitted?this.styles.primary:r=>r;return this.list.map(e).join(", ")}async submit(e){let r=this.state.error||await this.validate(this.list,this.state);return r!==!0?(this.state.error=r,super.submit()):(this.value=this.list,super.submit())}get list(){return this.split()}};N0.exports=Qf});var R0=S((XY,A0)=>{"use strict";var PM=cr(),Jf=class extends PM{constructor(e){super({...e,multiple:!0})}};A0.exports=Jf});var Hf=S((eX,D0)=>{"use strict";var NM=Br(),Wf=class extends NM{constructor(e={}){super({style:"number",...e}),this.min=this.isValue(e.min)?this.toNumber(e.min):-1/0,this.max=this.isValue(e.max)?this.toNumber(e.max):1/0,this.delay=e.delay!=null?e.delay:1e3,this.float=e.float!==!1,this.round=e.round===!0||e.float===!1,this.major=e.major||10,this.minor=e.minor||1,this.initial=e.initial!=null?e.initial:"",this.input=String(this.initial),this.cursor=this.input.length,this.cursorShow()}append(e){return!/[-+.]/.test(e)||e==="."&&this.input.includes(".")?this.alert("invalid number"):super.append(e)}number(e){return super.append(e)}next(){return this.input&&this.input!==this.initial?this.alert():this.isValue(this.initial)?(this.input=this.initial,this.cursor=String(this.initial).length,this.render()):this.alert()}up(e){let r=e||this.minor,i=this.toNumber(this.input);return i>this.max+r?this.alert():(this.input=`${i+r}`,this.render())}down(e){let r=e||this.minor,i=this.toNumber(this.input);return i<this.min-r?this.alert():(this.input=`${i-r}`,this.render())}shiftDown(){return this.down(this.major)}shiftUp(){return this.up(this.major)}format(e=this.input){return typeof this.options.format=="function"?this.options.format.call(this,e):this.styles.info(e)}toNumber(e=""){return this.float?+e:Math.round(+e)}isValue(e){return/^[-+]?[0-9]+((\.)|(\.[0-9]+))?$/.test(e)}submit(){let e=[this.input,this.initial].find(r=>this.isValue(r));return this.value=this.toNumber(e||0),super.submit()}};D0.exports=Wf});var z0=S((tX,L0)=>{L0.exports=Hf()});var U0=S((rX,j0)=>{"use strict";var OM=Br(),Yf=class extends OM{constructor(e){super(e),this.cursorShow()}format(e=this.input){return this.keypressed?(this.state.submitted?this.styles.primary:this.styles.muted)(this.symbols.asterisk.repeat(e.length)):""}};j0.exports=Yf});var F0=S((nX,q0)=>{"use strict";var AM=ar(),RM=co(),M0=Ae(),Xf=class extends RM{constructor(e={}){super(e),this.widths=[].concat(e.messageWidth||50),this.align=[].concat(e.align||"left"),this.linebreak=e.linebreak||!1,this.edgeLength=e.edgeLength||3,this.newline=e.newline||`
|
|
17
|
-
`;let r=e.startNumber||1;typeof this.scale=="number"&&(this.scaleKey=!1,this.scale=Array(this.scale).fill(0).map((i,n)=>({name:n+r})))}async reset(){return this.tableized=!1,await super.reset(),this.render()}tableize(){if(this.tableized===!0)return;this.tableized=!0;let e=0;for(let r of this.choices){e=Math.max(e,r.message.length),r.scaleIndex=r.initial||2,r.scale=[];for(let i=0;i<this.scale.length;i++)r.scale.push({index:i})}this.widths[0]=Math.min(this.widths[0],e+3)}async dispatch(e,r){if(this.multiple)return this[r.name]?await this[r.name](e,r):await super.dispatch(e,r);this.alert()}heading(e,r,i){return this.styles.strong(e)}separator(){return this.styles.muted(this.symbols.ellipsis)}right(){let e=this.focused;return e.scaleIndex>=this.scale.length-1?this.alert():(e.scaleIndex++,this.render())}left(){let e=this.focused;return e.scaleIndex<=0?this.alert():(e.scaleIndex--,this.render())}indent(){return""}format(){return this.state.submitted?this.choices.map(r=>this.styles.info(r.index)).join(", "):""}pointer(){return""}renderScaleKey(){return this.scaleKey===!1||this.state.submitted?"":["",...this.scale.map(i=>` ${i.name} - ${i.message}`)].map(i=>this.styles.muted(i)).join(`
|
|
18
|
-
`)}renderScaleHeading(e){let r=this.scale.map(l=>l.name);typeof this.options.renderScaleHeading=="function"&&(r=this.options.renderScaleHeading.call(this,e));let i=this.scaleLength-r.join("").length,n=Math.round(i/(r.length-1)),s=r.map(l=>this.styles.strong(l)).join(" ".repeat(n)),a=" ".repeat(this.widths[0]);return this.margin[3]+a+this.margin[1]+s}scaleIndicator(e,r,i){if(typeof this.options.scaleIndicator=="function")return this.options.scaleIndicator.call(this,e,r,i);let n=e.scaleIndex===r.index;return r.disabled?this.styles.hint(this.symbols.radio.disabled):n?this.styles.success(this.symbols.radio.on):this.symbols.radio.off}renderScale(e,r){let i=e.scale.map(o=>this.scaleIndicator(e,o,r)),n=this.term==="Hyper"?"":" ";return i.join(n+this.symbols.line.repeat(this.edgeLength))}async renderChoice(e,r){await this.onChoice(e,r);let i=this.index===r,n=await this.pointer(e,r),o=await e.hint;o&&!M0.hasColor(o)&&(o=this.styles.muted(o));let s=y=>this.margin[3]+y.replace(/\s+$/,"").padEnd(this.widths[0]," "),a=this.newline,l=this.indent(e),c=await this.resolve(e.message,this.state,e,r),u=await this.renderScale(e,r),d=this.margin[1]+this.margin[3];this.scaleLength=AM(u).length,this.widths[0]=Math.min(this.widths[0],this.width-this.scaleLength-d.length);let m=M0.wordWrap(c,{width:this.widths[0],newline:a}).split(`
|
|
19
|
-
`).map(y=>s(y)+this.margin[1]);return i&&(u=this.styles.info(u),m=m.map(y=>this.styles.info(y))),m[0]+=u,this.linebreak&&m.push(""),[l+n,m.join(`
|
|
20
|
-
`)].filter(Boolean)}async renderChoices(){if(this.state.submitted)return"";this.tableize();let e=this.visible.map(async(n,o)=>await this.renderChoice(n,o)),r=await Promise.all(e),i=await this.renderScaleHeading();return this.margin[0]+[i,...r.map(n=>n.join(" "))].join(`
|
|
21
|
-
`)}async render(){let{submitted:e,size:r}=this.state,i=await this.prefix(),n=await this.separator(),o=await this.message(),s="";this.options.promptLine!==!1&&(s=[i,o,n,""].join(" "),this.state.prompt=s);let a=await this.header(),l=await this.format(),c=await this.renderScaleKey(),u=await this.error()||await this.hint(),d=await this.renderChoices(),f=await this.footer(),m=this.emptyError;l&&(s+=l),u&&!s.includes(u)&&(s+=" "+u),e&&!l&&!d.trim()&&this.multiple&&m!=null&&(s+=this.styles.danger(m)),this.clear(r),this.write([a,s,c,d,f].filter(Boolean).join(`
|
|
22
|
-
`)),this.state.submitted||this.write(this.margin[2]),this.restore()}submit(){this.value={};for(let e of this.choices)this.value[e.name]=e.scaleIndex;return this.base.submit.call(this)}};q0.exports=Xf});var K0=S((iX,Z0)=>{"use strict";var B0=ar(),DM=(t="")=>typeof t=="string"?t.replace(/^['"]|['"]$/g,""):"",tm=class{constructor(e){this.name=e.key,this.field=e.field||{},this.value=DM(e.initial||this.field.initial||""),this.message=e.message||this.name,this.cursor=0,this.input="",this.lines=[]}},LM=async(t={},e={},r=i=>i)=>{let i=new Set,n=t.fields||[],o=t.template,s=[],a=[],l=[],c=1;typeof o=="function"&&(o=await o());let u=-1,d=()=>o[++u],f=()=>o[u+1],m=y=>{y.line=c,s.push(y)};for(m({type:"bos",value:""});u<o.length-1;){let y=d();if(/^[^\S\n ]$/.test(y)){m({type:"text",value:y});continue}if(y===`
|
|
23
|
-
`){m({type:"newline",value:y}),c++;continue}if(y==="\\"){y+=d(),m({type:"text",value:y});continue}if((y==="$"||y==="#"||y==="{")&&f()==="{"){let w=d();y+=w;let _={type:"template",open:y,inner:"",close:"",value:y},T;for(;T=d();){if(T==="}"){f()==="}"&&(T+=d()),_.value+=T,_.close=T;break}T===":"?(_.initial="",_.key=_.inner):_.initial!==void 0&&(_.initial+=T),_.value+=T,_.inner+=T}_.template=_.open+(_.initial||_.inner)+_.close,_.key=_.key||_.inner,hasOwnProperty.call(e,_.key)&&(_.initial=e[_.key]),_=r(_),m(_),l.push(_.key),i.add(_.key);let k=a.find(E=>E.name===_.key);_.field=n.find(E=>E.name===_.key),k||(k=new tm(_),a.push(k)),k.lines.push(_.line-1);continue}let h=s[s.length-1];h.type==="text"&&h.line===c?h.value+=y:m({type:"text",value:y})}return m({type:"eos",value:""}),{input:o,tabstops:s,unique:i,keys:l,items:a}};Z0.exports=async t=>{let e=t.options,r=new Set(e.required===!0?[]:e.required||[]),i={...e.values,...e.initial},{tabstops:n,items:o,keys:s}=await LM(e,i),a=em("result",t,e),l=em("format",t,e),c=em("validate",t,e,!0),u=t.isValue.bind(t);return async(d={},f=!1)=>{let m=0;d.required=r,d.items=o,d.keys=s,d.output="";let y=async(T,k,E,R)=>{let L=await c(T,k,E,R);return L===!1?"Invalid field "+E.name:L};for(let T of n){let k=T.value,E=T.key;if(T.type!=="template"){k&&(d.output+=k);continue}if(T.type==="template"){let R=o.find(Se=>Se.name===E);e.required===!0&&d.required.add(R.name);let L=[R.input,d.values[R.value],R.value,k].find(u),I=(R.field||{}).message||T.inner;if(f){let Se=await y(d.values[E],d,R,m);if(Se&&typeof Se=="string"||Se===!1){d.invalid.set(E,Se);continue}d.invalid.delete(E);let ct=await a(d.values[E],d,R,m);d.output+=B0(ct);continue}R.placeholder=!1;let G=k;k=await l(k,d,R,m),L!==k?(d.values[E]=L,k=t.styles.typing(L),d.missing.delete(I)):(d.values[E]=void 0,L=`<${I}>`,k=t.styles.primary(L),R.placeholder=!0,d.required.has(E)&&d.missing.add(I)),d.missing.has(I)&&d.validating&&(k=t.styles.warning(L)),d.invalid.has(E)&&d.validating&&(k=t.styles.danger(L)),m===d.index&&(G!==k?k=t.styles.underline(k):k=t.styles.heading(B0(k))),m++}k&&(d.output+=k)}let h=d.output.split(`
|
|
24
|
-
`).map(T=>" "+T),w=o.length,_=0;for(let T of o)d.invalid.has(T.name)&&T.lines.forEach(k=>{h[k][0]===" "&&(h[k]=d.styles.danger(d.symbols.bullet)+h[k].slice(1))}),t.isValue(d.values[T.name])&&_++;return d.completed=(_/w*100).toFixed(0),d.output=h.join(`
|
|
25
|
-
`),d.output}};function em(t,e,r,i){return(n,o,s,a)=>typeof s.field[t]=="function"?s.field[t].call(e,n,o,s,a):[i,n].find(l=>e.isValue(l))}});var G0=S((oX,V0)=>{"use strict";var zM=ar(),jM=K0(),UM=kn(),rm=class extends UM{constructor(e){super(e),this.cursorHide(),this.reset(!0)}async initialize(){this.interpolate=await jM(this),await super.initialize()}async reset(e){this.state.keys=[],this.state.invalid=new Map,this.state.missing=new Set,this.state.completed=0,this.state.values={},e!==!0&&(await this.initialize(),await this.render())}moveCursor(e){let r=this.getItem();this.cursor+=e,r.cursor+=e}dispatch(e,r){if(!r.code&&!r.ctrl&&e!=null&&this.getItem()){this.append(e,r);return}this.alert()}append(e,r){let i=this.getItem(),n=i.input.slice(0,this.cursor),o=i.input.slice(this.cursor);this.input=i.input=`${n}${e}${o}`,this.moveCursor(1),this.render()}delete(){let e=this.getItem();if(this.cursor<=0||!e.input)return this.alert();let r=e.input.slice(this.cursor),i=e.input.slice(0,this.cursor-1);this.input=e.input=`${i}${r}`,this.moveCursor(-1),this.render()}increment(e){return e>=this.state.keys.length-1?0:e+1}decrement(e){return e<=0?this.state.keys.length-1:e-1}first(){this.state.index=0,this.render()}last(){this.state.index=this.state.keys.length-1,this.render()}right(){if(this.cursor>=this.input.length)return this.alert();this.moveCursor(1),this.render()}left(){if(this.cursor<=0)return this.alert();this.moveCursor(-1),this.render()}prev(){this.state.index=this.decrement(this.state.index),this.getItem(),this.render()}next(){this.state.index=this.increment(this.state.index),this.getItem(),this.render()}up(){this.prev()}down(){this.next()}format(e){let r=this.state.completed<100?this.styles.warning:this.styles.success;return this.state.submitted===!0&&this.state.completed!==100&&(r=this.styles.danger),r(`${this.state.completed}% completed`)}async render(){let{index:e,keys:r=[],submitted:i,size:n}=this.state,o=[this.options.newline,`
|
|
26
|
-
`].find(T=>T!=null),s=await this.prefix(),a=await this.separator(),l=await this.message(),c=[s,l,a].filter(Boolean).join(" ");this.state.prompt=c;let u=await this.header(),d=await this.error()||"",f=await this.hint()||"",m=i?"":await this.interpolate(this.state),y=this.state.key=r[e]||"",h=await this.format(y),w=await this.footer();h&&(c+=" "+h),f&&!h&&this.state.completed===0&&(c+=" "+f),this.clear(n);let _=[u,c,m,w,d.trim()];this.write(_.filter(Boolean).join(o)),this.restore()}getItem(e){let{items:r,keys:i,index:n}=this.state,o=r.find(s=>s.name===i[n]);return o&&o.input!=null&&(this.input=o.input,this.cursor=o.cursor),o}async submit(){typeof this.interpolate!="function"&&await this.initialize(),await this.interpolate(this.state,!0);let{invalid:e,missing:r,output:i,values:n}=this.state;if(e.size){let a="";for(let[l,c]of e)a+=`Invalid ${l}: ${c}
|
|
27
|
-
`;return this.state.error=a,super.submit()}if(r.size)return this.state.error="Required: "+[...r.keys()].join(", "),super.submit();let s=zM(i).split(`
|
|
28
|
-
`).map(a=>a.slice(1)).join(`
|
|
29
|
-
`);return this.value={values:n,result:s},super.submit()}};V0.exports=rm});var J0=S((sX,Q0)=>{"use strict";var MM="(Use <shift>+<up/down> to sort)",qM=cr(),nm=class extends qM{constructor(e){super({...e,reorder:!1,sort:!0,multiple:!0}),this.state.hint=[this.options.hint,MM].find(this.isValue.bind(this))}indicator(){return""}async renderChoice(e,r){let i=await super.renderChoice(e,r),n=this.symbols.identicalTo+" ",o=this.index===r&&this.sorting?this.styles.muted(n):" ";return this.options.drag===!1&&(o=""),this.options.numbered===!0?o+`${r+1} - `+i:o+i}get selected(){return this.choices}submit(){return this.value=this.choices.map(e=>e.value),super.submit()}};Q0.exports=nm});var H0=S((aX,W0)=>{"use strict";var FM=co(),im=class extends FM{constructor(e={}){if(super(e),this.emptyError=e.emptyError||"No items were selected",this.term=process.env.TERM_PROGRAM,!this.options.header){let r=["","4 - Strongly Agree","3 - Agree","2 - Neutral","1 - Disagree","0 - Strongly Disagree",""];r=r.map(i=>this.styles.muted(i)),this.state.header=r.join(`
|
|
30
|
-
`)}}async toChoices(...e){if(this.createdScales)return!1;this.createdScales=!0;let r=await super.toChoices(...e);for(let i of r)i.scale=BM(5,this.options),i.scaleIdx=2;return r}dispatch(){this.alert()}space(){let e=this.focused,r=e.scale[e.scaleIdx],i=r.selected;return e.scale.forEach(n=>n.selected=!1),r.selected=!i,this.render()}indicator(){return""}pointer(){return""}separator(){return this.styles.muted(this.symbols.ellipsis)}right(){let e=this.focused;return e.scaleIdx>=e.scale.length-1?this.alert():(e.scaleIdx++,this.render())}left(){let e=this.focused;return e.scaleIdx<=0?this.alert():(e.scaleIdx--,this.render())}indent(){return" "}async renderChoice(e,r){await this.onChoice(e,r);let i=this.index===r,n=this.term==="Hyper",o=n?9:8,s=n?"":" ",a=this.symbols.line.repeat(o),l=" ".repeat(o+(n?0:1)),c=k=>(k?this.styles.success("\u25C9"):"\u25EF")+s,u=r+1+".",d=i?this.styles.heading:this.styles.noop,f=await this.resolve(e.message,this.state,e,r),m=this.indent(e),y=m+e.scale.map((k,E)=>c(E===e.scaleIdx)).join(a),h=k=>k===e.scaleIdx?d(k):k,w=m+e.scale.map((k,E)=>h(E)).join(l),_=()=>[u,f].filter(Boolean).join(" "),T=()=>[_(),y,w," "].filter(Boolean).join(`
|
|
31
|
-
`);return i&&(y=this.styles.cyan(y),w=this.styles.cyan(w)),T()}async renderChoices(){if(this.state.submitted)return"";let e=this.visible.map(async(i,n)=>await this.renderChoice(i,n)),r=await Promise.all(e);return r.length||r.push(this.styles.danger("No matching choices")),r.join(`
|
|
32
|
-
`)}format(){return this.state.submitted?this.choices.map(r=>this.styles.info(r.scaleIdx)).join(", "):""}async render(){let{submitted:e,size:r}=this.state,i=await this.prefix(),n=await this.separator(),o=await this.message(),s=[i,o,n].filter(Boolean).join(" ");this.state.prompt=s;let a=await this.header(),l=await this.format(),c=await this.error()||await this.hint(),u=await this.renderChoices(),d=await this.footer();(l||!c)&&(s+=" "+l),c&&!s.includes(c)&&(s+=" "+c),e&&!l&&!u&&this.multiple&&this.type!=="form"&&(s+=this.styles.danger(this.emptyError)),this.clear(r),this.write([s,a,u,d].filter(Boolean).join(`
|
|
33
|
-
`)),this.restore()}submit(){this.value={};for(let e of this.choices)this.value[e.name]=e.scaleIdx;return this.base.submit.call(this)}};function BM(t,e={}){if(Array.isArray(e.scale))return e.scale.map(i=>({...i}));let r=[];for(let i=1;i<t+1;i++)r.push({i,selected:!1});return r}W0.exports=im});var X0=S((lX,Y0)=>{Y0.exports=Vf()});var tT=S((cX,eT)=>{"use strict";var ZM=qa(),om=class extends ZM{async initialize(){await super.initialize(),this.value=this.initial=this.resolve(this.options.initial),this.disabled=this.options.disabled||"no",this.enabled=this.options.enabled||"yes",await this.render()}reset(){this.value=this.initial,this.render()}delete(){this.alert()}toggle(){this.value=!this.value,this.render()}enable(){if(this.value===!0)return this.alert();this.value=!0,this.render()}disable(){if(this.value===!1)return this.alert();this.value=!1,this.render()}up(){this.toggle()}down(){this.toggle()}right(){this.toggle()}left(){this.toggle()}next(){this.toggle()}prev(){this.toggle()}dispatch(e="",r){switch(e.toLowerCase()){case" ":return this.toggle();case"1":case"y":case"t":return this.enable();case"0":case"n":case"f":return this.disable();default:return this.alert()}}format(){let e=i=>this.styles.primary.underline(i);return[this.value?this.disabled:e(this.disabled),this.value?e(this.enabled):this.enabled].join(this.styles.muted(" / "))}async render(){let{size:e}=this.state,r=await this.header(),i=await this.prefix(),n=await this.separator(),o=await this.message(),s=await this.format(),a=await this.error()||await this.hint(),l=await this.footer(),c=[i,o,n,s].join(" ");this.state.prompt=c,a&&!c.includes(a)&&(c+=" "+a),this.clear(e),this.write([r,c,l].filter(Boolean).join(`
|
|
34
|
-
`)),this.write(this.margin[2]),this.restore()}};eT.exports=om});var nT=S((uX,rT)=>{"use strict";var KM=cr(),sm=class extends KM{constructor(e){if(super(e),typeof this.options.correctChoice!="number"||this.options.correctChoice<0)throw new Error("Please specify the index of the correct answer from the list of choices")}async toChoices(e,r){let i=await super.toChoices(e,r);if(i.length<2)throw new Error("Please give at least two choices to the user");if(this.options.correctChoice>i.length)throw new Error("Please specify the index of the correct answer from the list of choices");return i}check(e){return e.index===this.options.correctChoice}async result(e){return{selectedAnswer:e,correctAnswer:this.options.choices[this.options.correctChoice].value,correct:await this.check(this.state)}}};rT.exports=sm});var oT=S(am=>{"use strict";var iT=Ae(),Te=(t,e)=>{iT.defineExport(am,t,e),iT.defineExport(am,t.toLowerCase(),e)};Te("AutoComplete",()=>d0());Te("BasicAuth",()=>v0());Te("Confirm",()=>S0());Te("Editable",()=>_0());Te("Form",()=>Ma());Te("Input",()=>Vf());Te("Invisible",()=>P0());Te("List",()=>O0());Te("MultiSelect",()=>R0());Te("Numeral",()=>z0());Te("Password",()=>U0());Te("Scale",()=>F0());Te("Select",()=>cr());Te("Snippet",()=>G0());Te("Sort",()=>J0());Te("Survey",()=>H0());Te("Text",()=>X0());Te("Toggle",()=>tT());Te("Quiz",()=>nT())});var aT=S((fX,sT)=>{sT.exports={ArrayPrompt:co(),AuthPrompt:Mf(),BooleanPrompt:qa(),NumberPrompt:Hf(),StringPrompt:Br()}});var uT=S((mX,cT)=>{"use strict";var lT=X("assert"),cm=X("events"),ur=Ae(),_t=class extends cm{constructor(e,r){super(),this.options=ur.merge({},e),this.answers={...r}}register(e,r){if(ur.isObject(e)){for(let n of Object.keys(e))this.register(n,e[n]);return this}lT.equal(typeof r,"function","expected a function");let i=e.toLowerCase();return r.prototype instanceof this.Prompt?this.prompts[i]=r:this.prompts[i]=r(this.Prompt,this),this}async prompt(e=[]){for(let r of[].concat(e))try{typeof r=="function"&&(r=await r.call(this)),await this.ask(ur.merge({},this.options,r))}catch(i){return Promise.reject(i)}return this.answers}async ask(e){typeof e=="function"&&(e=await e.call(this));let r=ur.merge({},this.options,e),{type:i,name:n}=e,{set:o,get:s}=ur;if(typeof i=="function"&&(i=await i.call(this,e,this.answers)),!i)return this.answers[n];i==="number"&&(i="numeral"),lT(this.prompts[i],`Prompt "${i}" is not registered`);let a=new this.prompts[i](r),l=s(this.answers,n);a.state.answers=this.answers,a.enquirer=this,n&&a.on("submit",u=>{this.emit("answer",n,u,a),o(this.answers,n,u)});let c=a.emit.bind(a);return a.emit=(...u)=>(this.emit.call(this,...u),c(...u)),this.emit("prompt",a,this),r.autofill&&l!=null?(a.value=a.input=l,r.autofill==="show"&&await a.submit()):l=a.value=await a.run(),l}use(e){return e.call(this,this),this}set Prompt(e){this._Prompt=e}get Prompt(){return this._Prompt||this.constructor.Prompt}get prompts(){return this.constructor.prompts}static set Prompt(e){this._Prompt=e}static get Prompt(){return this._Prompt||kn()}static get prompts(){return oT()}static get types(){return aT()}static get prompt(){let e=(r,...i)=>{let n=new this(...i),o=n.emit.bind(n);return n.emit=(...s)=>(e.emit(...s),o(...s)),n.prompt(r)};return ur.mixinEmitter(e,new cm),e}};ur.mixinEmitter(_t,new cm);var lm=_t.prompts;for(let t of Object.keys(lm)){let e=t.toLowerCase(),r=i=>new lm[t](i).run();_t.prompt[e]=r,_t[e]=r,_t[t]||Reflect.defineProperty(_t,t,{get:()=>lm[t]})}var uo=t=>{ur.defineExport(_t,t,()=>_t.types[t])};uo("ArrayPrompt");uo("AuthPrompt");uo("BooleanPrompt");uo("NumberPrompt");uo("StringPrompt");cT.exports=_t});var dm=S(yT=>{"use strict";yT.parse=function(t,e){return new um(t,e).parse()};var um=class t{constructor(e,r){this.source=e,this.transform=r||JM,this.position=0,this.entries=[],this.recorded=[],this.dimension=0}isEof(){return this.position>=this.source.length}nextCharacter(){var e=this.source[this.position++];return e==="\\"?{value:this.source[this.position++],escaped:!0}:{value:e,escaped:!1}}record(e){this.recorded.push(e)}newEntry(e){var r;(this.recorded.length>0||e)&&(r=this.recorded.join(""),r==="NULL"&&!e&&(r=null),r!==null&&(r=this.transform(r)),this.entries.push(r),this.recorded=[])}consumeDimensions(){if(this.source[0]==="[")for(;!this.isEof();){var e=this.nextCharacter();if(e.value==="=")break}}parse(e){var r,i,n;for(this.consumeDimensions();!this.isEof();)if(r=this.nextCharacter(),r.value==="{"&&!n)this.dimension++,this.dimension>1&&(i=new t(this.source.substr(this.position-1),this.transform),this.entries.push(i.parse(!0)),this.position+=i.position-2);else if(r.value==="}"&&!n){if(this.dimension--,!this.dimension&&(this.newEntry(),e))return this.entries}else r.value==='"'&&!r.escaped?(n&&this.newEntry(!0),n=!n):r.value===","&&!n?this.newEntry():this.record(r.value);if(this.dimension!==0)throw new Error("array dimension not balanced");return this.entries}};function JM(t){return t}});var fm=S((TX,vT)=>{var WM=dm();vT.exports={create:function(t,e){return{parse:function(){return WM.parse(t,e)}}}}});var ST=S((EX,wT)=>{"use strict";var HM=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/,YM=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,XM=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,e6=/^-?infinity$/;wT.exports=function(e){if(e6.test(e))return Number(e.replace("i","I"));var r=HM.exec(e);if(!r)return t6(e)||null;var i=!!r[8],n=parseInt(r[1],10);i&&(n=bT(n));var o=parseInt(r[2],10)-1,s=r[3],a=parseInt(r[4],10),l=parseInt(r[5],10),c=parseInt(r[6],10),u=r[7];u=u?1e3*parseFloat(u):0;var d,f=r6(e);return f!=null?(d=new Date(Date.UTC(n,o,s,a,l,c,u)),mm(n)&&d.setUTCFullYear(n),f!==0&&d.setTime(d.getTime()-f)):(d=new Date(n,o,s,a,l,c,u),mm(n)&&d.setFullYear(n)),d};function t6(t){var e=YM.exec(t);if(e){var r=parseInt(e[1],10),i=!!e[4];i&&(r=bT(r));var n=parseInt(e[2],10)-1,o=e[3],s=new Date(r,n,o);return mm(r)&&s.setFullYear(r),s}}function r6(t){if(t.endsWith("+00"))return 0;var e=XM.exec(t.split(" ")[1]);if(e){var r=e[1];if(r==="Z")return 0;var i=r==="-"?-1:1,n=parseInt(e[2],10)*3600+parseInt(e[3]||0,10)*60+parseInt(e[4]||0,10);return n*i*1e3}}function bT(t){return-(t-1)}function mm(t){return t>=0&&t<100}});var _T=S((IX,xT)=>{xT.exports=i6;var n6=Object.prototype.hasOwnProperty;function i6(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var i in r)n6.call(r,i)&&(t[i]=r[i])}return t}});var TT=S((CX,kT)=>{"use strict";var o6=_T();kT.exports=In;function In(t){if(!(this instanceof In))return new In(t);o6(this,y6(t))}var s6=["seconds","minutes","hours","days","months","years"];In.prototype.toPostgres=function(){var t=s6.filter(this.hasOwnProperty,this);return this.milliseconds&&t.indexOf("seconds")<0&&t.push("seconds"),t.length===0?"0":t.map(function(e){var r=this[e]||0;return e==="seconds"&&this.milliseconds&&(r=(r+this.milliseconds/1e3).toFixed(6).replace(/\.?0+$/,"")),r+" "+e},this).join(" ")};var a6={years:"Y",months:"M",days:"D",hours:"H",minutes:"M",seconds:"S"},l6=["years","months","days"],c6=["hours","minutes","seconds"];In.prototype.toISOString=In.prototype.toISO=function(){var t=l6.map(r,this).join(""),e=c6.map(r,this).join("");return"P"+t+"T"+e;function r(i){var n=this[i]||0;return i==="seconds"&&this.milliseconds&&(n=(n+this.milliseconds/1e3).toFixed(6).replace(/0+$/,"")),n+a6[i]}};var pm="([+-]?\\d+)",u6=pm+"\\s+years?",d6=pm+"\\s+mons?",f6=pm+"\\s+days?",m6="([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?",p6=new RegExp([u6,d6,f6,m6].map(function(t){return"("+t+")?"}).join("\\s*")),$T={years:2,months:4,days:6,hours:9,minutes:10,seconds:11,milliseconds:12},h6=["hours","minutes","seconds","milliseconds"];function g6(t){var e=t+"000000".slice(t.length);return parseInt(e,10)/1e3}function y6(t){if(!t)return{};var e=p6.exec(t),r=e[8]==="-";return Object.keys($T).reduce(function(i,n){var o=$T[n],s=e[o];return!s||(s=n==="milliseconds"?g6(s):parseInt(s,10),!s)||(r&&~h6.indexOf(n)&&(s*=-1),i[n]=s),i},{})}});var CT=S((PX,IT)=>{"use strict";var ET=Buffer.from||Buffer;IT.exports=function(e){if(/^\\x/.test(e))return ET(e.substr(2),"hex");for(var r="",i=0;i<e.length;)if(e[i]!=="\\")r+=e[i],++i;else if(/[0-7]{3}/.test(e.substr(i+1,3)))r+=String.fromCharCode(parseInt(e.substr(i+1,3),8)),i+=4;else{for(var n=1;i+n<e.length&&e[i+n]==="\\";)n++;for(var o=0;o<Math.floor(n/2);++o)r+="\\";i+=Math.floor(n/2)*2}return ET(r,"binary")}});var LT=S((NX,DT)=>{var fo=dm(),mo=fm(),Ba=ST(),NT=TT(),OT=CT();function Za(t){return function(r){return r===null?r:t(r)}}function AT(t){return t===null?t:t==="TRUE"||t==="t"||t==="true"||t==="y"||t==="yes"||t==="on"||t==="1"}function v6(t){return t?fo.parse(t,AT):null}function b6(t){return parseInt(t,10)}function hm(t){return t?fo.parse(t,Za(b6)):null}function w6(t){return t?fo.parse(t,Za(function(e){return RT(e).trim()})):null}var S6=function(t){if(!t)return null;var e=mo.create(t,function(r){return r!==null&&(r=bm(r)),r});return e.parse()},gm=function(t){if(!t)return null;var e=mo.create(t,function(r){return r!==null&&(r=parseFloat(r)),r});return e.parse()},mt=function(t){if(!t)return null;var e=mo.create(t);return e.parse()},ym=function(t){if(!t)return null;var e=mo.create(t,function(r){return r!==null&&(r=Ba(r)),r});return e.parse()},x6=function(t){if(!t)return null;var e=mo.create(t,function(r){return r!==null&&(r=NT(r)),r});return e.parse()},_6=function(t){return t?fo.parse(t,Za(OT)):null},vm=function(t){return parseInt(t,10)},RT=function(t){var e=String(t);return/^\d+$/.test(e)?e:t},PT=function(t){return t?fo.parse(t,Za(JSON.parse)):null},bm=function(t){return t[0]!=="("?null:(t=t.substring(1,t.length-1).split(","),{x:parseFloat(t[0]),y:parseFloat(t[1])})},$6=function(t){if(t[0]!=="<"&&t[1]!=="(")return null;for(var e="(",r="",i=!1,n=2;n<t.length-1;n++){if(i||(e+=t[n]),t[n]===")"){i=!0;continue}else if(!i)continue;t[n]!==","&&(r+=t[n])}var o=bm(e);return o.radius=parseFloat(r),o},k6=function(t){t(20,RT),t(21,vm),t(23,vm),t(26,vm),t(700,parseFloat),t(701,parseFloat),t(16,AT),t(1082,Ba),t(1114,Ba),t(1184,Ba),t(600,bm),t(651,mt),t(718,$6),t(1e3,v6),t(1001,_6),t(1005,hm),t(1007,hm),t(1028,hm),t(1016,w6),t(1017,S6),t(1021,gm),t(1022,gm),t(1231,gm),t(1014,mt),t(1015,mt),t(1008,mt),t(1009,mt),t(1040,mt),t(1041,mt),t(1115,ym),t(1182,ym),t(1185,ym),t(1186,NT),t(1187,x6),t(17,OT),t(114,JSON.parse.bind(JSON)),t(3802,JSON.parse.bind(JSON)),t(199,PT),t(3807,PT),t(3907,mt),t(2951,mt),t(791,mt),t(1183,mt),t(1270,mt)};DT.exports={init:k6}});var jT=S((OX,zT)=>{"use strict";var Ke=1e6;function T6(t){var e=t.readInt32BE(0),r=t.readUInt32BE(4),i="";e<0&&(e=~e+(r===0),r=~r+1>>>0,i="-");var n="",o,s,a,l,c,u;{if(o=e%Ke,e=e/Ke>>>0,s=4294967296*o+r,r=s/Ke>>>0,a=""+(s-Ke*r),r===0&&e===0)return i+a+n;for(l="",c=6-a.length,u=0;u<c;u++)l+="0";n=l+a+n}{if(o=e%Ke,e=e/Ke>>>0,s=4294967296*o+r,r=s/Ke>>>0,a=""+(s-Ke*r),r===0&&e===0)return i+a+n;for(l="",c=6-a.length,u=0;u<c;u++)l+="0";n=l+a+n}{if(o=e%Ke,e=e/Ke>>>0,s=4294967296*o+r,r=s/Ke>>>0,a=""+(s-Ke*r),r===0&&e===0)return i+a+n;for(l="",c=6-a.length,u=0;u<c;u++)l+="0";n=l+a+n}return o=e%Ke,s=4294967296*o+r,a=""+s%Ke,i+a+n}zT.exports=T6});var BT=S((AX,FT)=>{var E6=jT(),he=function(t,e,r,i,n){r=r||0,i=i||!1,n=n||function(m,y,h){return m*Math.pow(2,h)+y};var o=r>>3,s=function(m){return i?~m&255:m},a=255,l=8-r%8;e<l&&(a=255<<8-e&255,l=e),r&&(a=a>>r%8);var c=0;r%8+e>=8&&(c=n(0,s(t[o])&a,l));for(var u=e+r>>3,d=o+1;d<u;d++)c=n(c,s(t[d]),8);var f=(e+r)%8;return f>0&&(c=n(c,s(t[u])>>8-f,f)),c},qT=function(t,e,r){var i=Math.pow(2,r-1)-1,n=he(t,1),o=he(t,r,1);if(o===0)return 0;var s=1,a=function(c,u,d){c===0&&(c=1);for(var f=1;f<=d;f++)s/=2,(u&1<<d-f)>0&&(c+=s);return c},l=he(t,e,r+1,!1,a);return o==Math.pow(2,r+1)-1?l===0?n===0?1/0:-1/0:NaN:(n===0?1:-1)*Math.pow(2,o-i)*l},I6=function(t){return he(t,1)==1?-1*(he(t,15,1,!0)+1):he(t,15,1)},UT=function(t){return he(t,1)==1?-1*(he(t,31,1,!0)+1):he(t,31,1)},C6=function(t){return qT(t,23,8)},P6=function(t){return qT(t,52,11)},N6=function(t){var e=he(t,16,32);if(e==49152)return NaN;for(var r=Math.pow(1e4,he(t,16,16)),i=0,n=[],o=he(t,16),s=0;s<o;s++)i+=he(t,16,64+16*s)*r,r/=1e4;var a=Math.pow(10,he(t,16,48));return(e===0?1:-1)*Math.round(i*a)/a},MT=function(t,e){var r=he(e,1),i=he(e,63,1),n=new Date((r===0?1:-1)*i/1e3+9466848e5);return t||n.setTime(n.getTime()+n.getTimezoneOffset()*6e4),n.usec=i%1e3,n.getMicroSeconds=function(){return this.usec},n.setMicroSeconds=function(o){this.usec=o},n.getUTCMicroSeconds=function(){return this.usec},n},po=function(t){for(var e=he(t,32),r=he(t,32,32),i=he(t,32,64),n=96,o=[],s=0;s<e;s++)o[s]=he(t,32,n),n+=32,n+=32;var a=function(c){var u=he(t,32,n);if(n+=32,u==4294967295)return null;var d;if(c==23||c==20)return d=he(t,u*8,n),n+=u*8,d;if(c==25)return d=t.toString(this.encoding,n>>3,(n+=u<<3)>>3),d;console.log("ERROR: ElementType not implemented: "+c)},l=function(c,u){var d=[],f;if(c.length>1){var m=c.shift();for(f=0;f<m;f++)d[f]=l(c,u);c.unshift(m)}else for(f=0;f<c[0];f++)d[f]=a(u);return d};return l(o,i)},O6=function(t){return t.toString("utf8")},A6=function(t){return t===null?null:he(t,8)>0},R6=function(t){t(20,E6),t(21,I6),t(23,UT),t(26,UT),t(1700,N6),t(700,C6),t(701,P6),t(16,A6),t(1114,MT.bind(null,!1)),t(1184,MT.bind(null,!0)),t(1e3,po),t(1007,po),t(1016,po),t(1008,po),t(1009,po),t(25,O6)};FT.exports={init:R6}});var KT=S((RX,ZT)=>{ZT.exports={BOOL:16,BYTEA:17,CHAR:18,INT8:20,INT2:21,INT4:23,REGPROC:24,TEXT:25,OID:26,TID:27,XID:28,CID:29,JSON:114,XML:142,PG_NODE_TREE:194,SMGR:210,PATH:602,POLYGON:604,CIDR:650,FLOAT4:700,FLOAT8:701,ABSTIME:702,RELTIME:703,TINTERVAL:704,CIRCLE:718,MACADDR8:774,MONEY:790,MACADDR:829,INET:869,ACLITEM:1033,BPCHAR:1042,VARCHAR:1043,DATE:1082,TIME:1083,TIMESTAMP:1114,TIMESTAMPTZ:1184,INTERVAL:1186,TIMETZ:1266,BIT:1560,VARBIT:1562,NUMERIC:1700,REFCURSOR:1790,REGPROCEDURE:2202,REGOPER:2203,REGOPERATOR:2204,REGCLASS:2205,REGTYPE:2206,UUID:2950,TXID_SNAPSHOT:2970,PG_LSN:3220,PG_NDISTINCT:3361,PG_DEPENDENCIES:3402,TSVECTOR:3614,TSQUERY:3615,GTSVECTOR:3642,REGCONFIG:3734,REGDICTIONARY:3769,JSONB:3802,REGNAMESPACE:4089,REGROLE:4096}});var yo=S(go=>{var D6=LT(),L6=BT(),z6=fm(),j6=KT();go.getTypeParser=U6;go.setTypeParser=M6;go.arrayParser=z6;go.builtins=j6;var ho={text:{},binary:{}};function VT(t){return String(t)}function U6(t,e){return e=e||"text",ho[e]&&ho[e][t]||VT}function M6(t,e,r){typeof e=="function"&&(r=e,e="text"),ho[e][t]=r}D6.init(function(t,e){ho.text[t]=e});L6.init(function(t,e){ho.binary[t]=e})});var vo=S((LX,wm)=>{"use strict";var GT;try{GT=process.platform==="win32"?process.env.USERNAME:process.env.USER}catch{}wm.exports={host:"localhost",user:GT,database:void 0,password:null,connectionString:void 0,port:5432,rows:0,binary:!1,max:10,idleTimeoutMillis:3e4,client_encoding:"",ssl:!1,application_name:void 0,fallback_application_name:void 0,options:void 0,parseInputDatesAsUTC:!1,statement_timeout:!1,lock_timeout:!1,idle_in_transaction_session_timeout:!1,query_timeout:!1,connect_timeout:0,keepalives:1,keepalives_idle:0};var Cn=yo(),q6=Cn.getTypeParser(20,"text"),F6=Cn.getTypeParser(1016,"text");wm.exports.__defineSetter__("parseInt8",function(t){Cn.setTypeParser(20,"text",t?Cn.getTypeParser(23,"text"):q6),Cn.setTypeParser(1016,"text",t?Cn.getTypeParser(1007,"text"):F6)})});var Pn=S((zX,JT)=>{"use strict";var B6=vo(),{isDate:Z6}=X("util/types");function K6(t){return'"'+t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'}function QT(t){let e="{";for(let r=0;r<t.length;r++){r>0&&(e+=",");let i=t[r];i==null?e+="NULL":Array.isArray(i)?e+=QT(i):ArrayBuffer.isView(i)?(i instanceof Buffer||(i=Buffer.from(i.buffer,i.byteOffset,i.byteLength)),e+="\\\\x"+i.toString("hex")):e+=K6(Ka(i))}return e+="}",e}var Ka=function(t,e){return t==null?null:typeof t=="object"?t instanceof Buffer?t:ArrayBuffer.isView(t)?Buffer.from(t.buffer,t.byteOffset,t.byteLength):Z6(t)?B6.parseInputDatesAsUTC?Q6(t):G6(t):Array.isArray(t)?QT(t):V6(t,e):t.toString()};function V6(t,e){if(t&&typeof t.toPostgres=="function"){if(e=e||[],e.indexOf(t)!==-1)throw new Error('circular reference detected while preparing "'+t+'" for query');return e.push(t),Ka(t.toPostgres(Ka),e)}return JSON.stringify(t)}function G6(t){let e=-t.getTimezoneOffset(),r=t.getFullYear(),i=r<1;i&&(r=Math.abs(r)+1);let n=String(r).padStart(4,"0")+"-"+String(t.getMonth()+1).padStart(2,"0")+"-"+String(t.getDate()).padStart(2,"0")+"T"+String(t.getHours()).padStart(2,"0")+":"+String(t.getMinutes()).padStart(2,"0")+":"+String(t.getSeconds()).padStart(2,"0")+"."+String(t.getMilliseconds()).padStart(3,"0");return e<0?(n+="-",e*=-1):n+="+",n+=String(Math.floor(e/60)).padStart(2,"0")+":"+String(e%60).padStart(2,"0"),i&&(n+=" BC"),n}function Q6(t){let e=t.getUTCFullYear(),r=e<1;r&&(e=Math.abs(e)+1);let i=String(e).padStart(4,"0")+"-"+String(t.getUTCMonth()+1).padStart(2,"0")+"-"+String(t.getUTCDate()).padStart(2,"0")+"T"+String(t.getUTCHours()).padStart(2,"0")+":"+String(t.getUTCMinutes()).padStart(2,"0")+":"+String(t.getUTCSeconds()).padStart(2,"0")+"."+String(t.getUTCMilliseconds()).padStart(3,"0");return i+="+00:00",r&&(i+=" BC"),i}function J6(t,e,r){return t=typeof t=="string"?{text:t}:t,e&&(typeof e=="function"?t.callback=e:t.values=e),r&&(t.callback=r),t}var W6=function(t){return'"'+t.replace(/"/g,'""')+'"'},H6=function(t){let e=!1,r="'";if(t==null||typeof t!="string")return"''";for(let i=0;i<t.length;i++){let n=t[i];n==="'"?r+=n+n:n==="\\"?(r+=n+n,e=!0):r+=n}return r+="'",e===!0&&(r=" E"+r),r};JT.exports={prepareValue:function(e){return Ka(e)},normalizeQueryConfig:J6,escapeIdentifier:W6,escapeLiteral:H6}});var _m=S((jX,YT)=>{var WT=X("crypto");YT.exports={postgresMd5PasswordHash:X6,randomBytes:Y6,deriveKey:nq,sha256:eq,hashByName:tq,hmacSha256:rq,md5:Sm};var HT=WT.webcrypto||globalThis.crypto,Zr=HT.subtle,xm=new TextEncoder;function Y6(t){return HT.getRandomValues(Buffer.alloc(t))}async function Sm(t){try{return WT.createHash("md5").update(t,"utf-8").digest("hex")}catch{let r=typeof t=="string"?xm.encode(t):t,i=await Zr.digest("MD5",r);return Array.from(new Uint8Array(i)).map(n=>n.toString(16).padStart(2,"0")).join("")}}async function X6(t,e,r){let i=await Sm(e+t);return"md5"+await Sm(Buffer.concat([Buffer.from(i),r]))}async function eq(t){return await Zr.digest("SHA-256",t)}async function tq(t,e){return await Zr.digest(t,e)}async function rq(t,e){let r=await Zr.importKey("raw",t,{name:"HMAC",hash:"SHA-256"},!1,["sign"]);return await Zr.sign("HMAC",r,xm.encode(e))}async function nq(t,e,r){let i=await Zr.importKey("raw",xm.encode(t),"PBKDF2",!1,["deriveBits"]),n={name:"PBKDF2",hash:"SHA-256",salt:e,iterations:r};return await Zr.deriveBits(n,i,256,["deriveBits"])}});var tE=S((UX,eE)=>{function Kr(t,e){return new Error("SASL channel binding: "+t+" when parsing public certificate "+e.toString("base64"))}function $m(t,e){let r=t[e++];if(r<128)return{length:r,index:e};let i=r&127;if(i>4)throw Kr("bad length",t);r=0;for(let n=0;n<i;n++)r=r<<8|t[e++];return{length:r,index:e}}function XT(t,e){if(t[e++]!==6)throw Kr("non-OID data",t);let{length:r,index:i}=$m(t,e);e=i;let n=e+r,o=t[e++],s=(o/40>>0)+"."+o%40;for(;e<n;){let a=0;for(;e<n;){let l=t[e++];if(a=a<<7|l&127,l<128)break}s+="."+a}return{oid:s,index:e}}function bo(t,e){if(t[e++]!==48)throw Kr("non-sequence data",t);return $m(t,e)}function iq(t,e){e===void 0&&(e=0),e=bo(t,e).index;let{length:r,index:i}=bo(t,e);e=i+r,e=bo(t,e).index;let{oid:n,index:o}=XT(t,e);switch(n){case"1.2.840.113549.1.1.4":return"MD5";case"1.2.840.113549.1.1.5":return"SHA-1";case"1.2.840.113549.1.1.11":return"SHA-256";case"1.2.840.113549.1.1.12":return"SHA-384";case"1.2.840.113549.1.1.13":return"SHA-512";case"1.2.840.113549.1.1.14":return"SHA-224";case"1.2.840.113549.1.1.15":return"SHA512-224";case"1.2.840.113549.1.1.16":return"SHA512-256";case"1.2.840.10045.4.1":return"SHA-1";case"1.2.840.10045.4.3.1":return"SHA-224";case"1.2.840.10045.4.3.2":return"SHA-256";case"1.2.840.10045.4.3.3":return"SHA-384";case"1.2.840.10045.4.3.4":return"SHA-512";case"1.2.840.113549.1.1.10":{if(e=o,e=bo(t,e).index,t[e++]!==160)throw Kr("non-tag data",t);e=$m(t,e).index,e=bo(t,e).index;let{oid:s}=XT(t,e);switch(s){case"1.2.840.113549.2.5":return"MD5";case"1.3.14.3.2.26":return"SHA-1";case"2.16.840.1.101.3.4.2.1":return"SHA-256";case"2.16.840.1.101.3.4.2.2":return"SHA-384";case"2.16.840.1.101.3.4.2.3":return"SHA-512"}throw Kr("unknown hash OID "+s,t)}case"1.3.101.110":case"1.3.101.112":return"SHA-512";case"1.3.101.111":case"1.3.101.113":throw Kr("Ed448 certificate channel binding is not currently supported by Postgres")}throw Kr("unknown OID "+n,t)}eE.exports={signatureAlgorithmHashFromCertificate:iq}});var oE=S((MX,iE)=>{"use strict";var dr=_m(),{signatureAlgorithmHashFromCertificate:oq}=tE();function sq(t){let e=/[\u00A0\u1680\u2000-\u200B\u202F\u205F\u3000]/g,r=/[\u00AD\u034F\u1806\u180B\u180C\u180D\u200C\u200D\u2060\uFE00-\uFE0F\uFEFF]/g;return t.replace(e," ").replace(r,"").normalize("NFKC")}var km=1e5;function aq(t,e,r=km){let i=["SCRAM-SHA-256"];e&&i.unshift("SCRAM-SHA-256-PLUS");let n=i.find(a=>t.includes(a));if(!n)throw new Error("SASL: Only mechanism(s) "+i.join(" and ")+" are supported");if(n==="SCRAM-SHA-256-PLUS"&&typeof e.getPeerCertificate!="function")throw new Error("SASL: Mechanism SCRAM-SHA-256-PLUS requires a certificate");let o=dr.randomBytes(18).toString("base64");return{mechanism:n,clientNonce:o,response:(n==="SCRAM-SHA-256-PLUS"?"p=tls-server-end-point":e?"y":"n")+",,n=*,r="+o,message:"SASLInitialResponse",scramMaxIterations:r}}async function lq(t,e,r,i){if(t.message!=="SASLInitialResponse")throw new Error("SASL: Last message was not SASLInitialResponse");if(typeof e!="string")throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a string");if(e==="")throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a non-empty string");if(typeof r!="string")throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: serverData must be a string");let n=dq(r);if(n.nonce.startsWith(t.clientNonce)){if(n.nonce.length===t.clientNonce.length)throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce is too short")}else throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce does not start with client nonce");let o=typeof t.scramMaxIterations=="number"?t.scramMaxIterations:km;if(o!==0&&n.iteration>o)throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: iteration count "+n.iteration+" exceeds scramMaxIterations of "+o);let s="n=*,r="+t.clientNonce,a="r="+n.nonce+",s="+n.salt+",i="+n.iteration,l=i?"eSws":"biws";if(t.mechanism==="SCRAM-SHA-256-PLUS"){let k=i.getPeerCertificate().raw,E=oq(k);(E==="MD5"||E==="SHA-1")&&(E="SHA-256");let R=await dr.hashByName(E,k);l=Buffer.concat([Buffer.from("p=tls-server-end-point,,"),Buffer.from(R)]).toString("base64")}let c="c="+l+",r="+n.nonce,u=s+","+a+","+c,d=Buffer.from(n.salt,"base64"),f=await dr.deriveKey(sq(e),d,n.iteration),m=await dr.hmacSha256(f,"Client Key"),y=await dr.sha256(m),h=await dr.hmacSha256(y,u),w=mq(Buffer.from(m),Buffer.from(h)).toString("base64"),_=await dr.hmacSha256(f,"Server Key"),T=await dr.hmacSha256(_,u);t.message="SASLResponse",t.serverSignature=Buffer.from(T).toString("base64"),t.response=c+",p="+w}function cq(t,e){if(t.message!=="SASLResponse")throw new Error("SASL: Last message was not SASLResponse");if(typeof e!="string")throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: serverData must be a string");let{serverSignature:r}=fq(e);if(r!==t.serverSignature)throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature does not match")}function uq(t){if(typeof t!="string")throw new TypeError("SASL: text must be a string");return t.split("").map((e,r)=>t.charCodeAt(r)).every(e=>e>=33&&e<=43||e>=45&&e<=126)}function rE(t){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/.test(t)}function nE(t){if(typeof t!="string")throw new TypeError("SASL: attribute pairs text must be a string");return new Map(t.split(",").map(e=>{if(!/^.=/.test(e))throw new Error("SASL: Invalid attribute pair entry");let r=e[0],i=e.substring(2);return[r,i]}))}function dq(t){let e=nE(t),r=e.get("r");if(r){if(!uq(r))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce must only contain printable characters")}else throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce missing");let i=e.get("s");if(i){if(!rE(i))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt must be base64")}else throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt missing");let n=e.get("i");if(n){if(!/^[1-9][0-9]*$/.test(n))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: invalid iteration count")}else throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: iteration missing");let o=parseInt(n,10);return{nonce:r,salt:i,iteration:o}}function fq(t){let e=nE(t),r=e.get("e"),i=e.get("v");if(r)throw new Error(`SASL: SCRAM-SERVER-FINAL-MESSAGE: server returned error: "${r}"`);if(i){if(!rE(i))throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature must be base64")}else throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature is missing");return{serverSignature:i}}function mq(t,e){if(!Buffer.isBuffer(t))throw new TypeError("first argument must be a Buffer");if(!Buffer.isBuffer(e))throw new TypeError("second argument must be a Buffer");if(t.length!==e.length)throw new Error("Buffer lengths must match");if(t.length===0)throw new Error("Buffers cannot be empty");return Buffer.from(t.map((r,i)=>t[i]^e[i]))}iE.exports={startSession:aq,continueSession:lq,finalizeSession:cq,DEFAULT_MAX_SCRAM_ITERATIONS:km}});var Ga=S((qX,sE)=>{"use strict";var pq=yo();function Va(t){this._types=t||pq,this.text={},this.binary={}}Va.prototype.getOverrides=function(t){switch(t){case"text":return this.text;case"binary":return this.binary;default:return{}}};Va.prototype.setTypeParser=function(t,e,r){typeof e=="function"&&(r=e,e="text"),this.getOverrides(e)[t]=r};Va.prototype.getTypeParser=function(t,e){return e=e||"text",this.getOverrides(e)[t]||this._types.getTypeParser(t,e)};sE.exports=Va});var cE=S((FX,lE)=>{"use strict";function Nn(t,e={}){if(t.charAt(0)==="/"){let l=t.split(" ");return{host:l[0],database:l[1]}}let r=Object.create(null),i,n=!1;/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i.test(t)&&(t=encodeURI(t).replace(/%25(\d\d)/g,"%$1"));try{try{i=new URL(t,"postgres://base")}catch{i=new URL(t.replace("@/","@___DUMMY___/"),"postgres://base"),n=!0}}catch(l){throw l.input&&(l.input="*****REDACTED*****"),l}for(let l of i.searchParams.entries())r[l[0]]=l[1];if(r.user=r.user||decodeURIComponent(i.username),r.password=r.password||decodeURIComponent(i.password),i.protocol=="socket:")return r.host=decodeURI(i.pathname),r.database=i.searchParams.get("db"),r.client_encoding=i.searchParams.get("encoding"),r;let o=n?"":i.hostname;r.host?o&&/^%2f/i.test(o)&&(i.pathname=o+i.pathname):r.host=decodeURIComponent(o),r.port||(r.port=i.port);let s=i.pathname.slice(1)||null;r.database=s?decodeURI(s):null,(r.ssl==="true"||r.ssl==="1")&&(r.ssl=!0),r.ssl==="0"&&(r.ssl=!1),(r.sslcert||r.sslkey||r.sslrootcert||r.sslmode)&&(r.ssl={});let a=r.sslcert||r.sslkey||r.sslrootcert?X("fs"):null;if(r.sslcert&&(r.ssl.cert=a.readFileSync(r.sslcert).toString()),r.sslkey&&(r.ssl.key=a.readFileSync(r.sslkey).toString()),r.sslrootcert&&(r.ssl.ca=a.readFileSync(r.sslrootcert).toString()),e.useLibpqCompat&&r.uselibpqcompat)throw new Error("Both useLibpqCompat and uselibpqcompat are set. Please use only one of them.");if(r.uselibpqcompat==="true"||e.useLibpqCompat)switch(r.sslmode){case"disable":{r.ssl=!1;break}case"prefer":{r.ssl.rejectUnauthorized=!1;break}case"require":{r.sslrootcert?r.ssl.checkServerIdentity=function(){}:r.ssl.rejectUnauthorized=!1;break}case"verify-ca":{if(!r.ssl.ca)throw new Error("SECURITY WARNING: Using sslmode=verify-ca requires specifying a CA with sslrootcert. If a public CA is used, verify-ca allows connections to a server that somebody else may have registered with the CA, making you vulnerable to Man-in-the-Middle attacks. Either specify a custom CA certificate with sslrootcert parameter or use sslmode=verify-full for proper security.");r.ssl.checkServerIdentity=function(){};break}case"verify-full":break}else switch(r.sslmode){case"disable":{r.ssl=!1;break}case"prefer":case"require":case"verify-ca":case"verify-full":{r.sslmode!=="verify-full"&&Tm(r.sslmode);break}case"no-verify":{r.ssl.rejectUnauthorized=!1;break}}return r}function hq(t){return Object.entries(t).reduce((r,[i,n])=>(n!=null&&(r[i]=n),r),Object.create(null))}function aE(t){return Object.entries(t).reduce((r,[i,n])=>{if(i==="ssl"){let o=n;typeof o=="boolean"&&(r[i]=o),typeof o=="object"&&(r[i]=hq(o))}else if(n!=null)if(i==="port"){if(n!==""){let o=parseInt(n,10);if(isNaN(o))throw new Error(`Invalid ${i}: ${n}`);r[i]=o}}else r[i]=n;return r},Object.create(null))}function gq(t){return aE(Nn(t))}function Tm(t){!Tm.warned&&typeof process<"u"&&process.emitWarning&&(Tm.warned=!0,process.emitWarning(`SECURITY WARNING: The SSL modes 'prefer', 'require', and 'verify-ca' are treated as aliases for 'verify-full'.
|
|
35
|
-
In the next major version (pg-connection-string v3.0.0 and pg v9.0.0), these modes will adopt standard libpq semantics, which have weaker security guarantees.
|
|
36
|
-
|
|
37
|
-
To prepare for this change:
|
|
38
|
-
- If you want the current behavior, explicitly use 'sslmode=verify-full'
|
|
39
|
-
- If you want libpq compatibility now, use 'uselibpqcompat=true&sslmode=${t}'
|
|
40
|
-
|
|
41
|
-
See https://www.postgresql.org/docs/current/libpq-ssl.html for libpq SSL mode definitions.`))}lE.exports=Nn;Nn.parse=Nn;Nn.toClientConfig=aE;Nn.parseIntoClientConfig=gq});var Im=S((BX,fE)=>{"use strict";var yq=X("dns"),dE=vo(),uE=cE().parse,je=function(t,e,r){return e[t]?e[t]:(r===void 0?r=process.env["PG"+t.toUpperCase()]:r===!1||(r=process.env[r]),r||dE[t])},vq=function(){switch(process.env.PGSSLMODE){case"disable":return!1;case"prefer":case"require":case"verify-ca":case"verify-full":return!0;case"no-verify":return{rejectUnauthorized:!1}}return dE.ssl},On=function(t){return"'"+(""+t).replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"},pt=function(t,e,r){let i=e[r];i!=null&&t.push(r+"="+On(i))},Em=class{constructor(e){e=typeof e=="string"?uE(e):e||{},e.connectionString&&(e=Object.assign({},e,uE(e.connectionString))),this.user=je("user",e),this.database=je("database",e),this.database===void 0&&(this.database=this.user),this.port=parseInt(je("port",e),10),this.host=je("host",e),Object.defineProperty(this,"password",{configurable:!0,enumerable:!1,writable:!0,value:je("password",e)}),this.binary=je("binary",e),this.options=je("options",e),this.ssl=typeof e.ssl>"u"?vq():e.ssl,typeof this.ssl=="string"&&this.ssl==="true"&&(this.ssl=!0),this.ssl==="no-verify"&&(this.ssl={rejectUnauthorized:!1}),this.ssl&&this.ssl.key&&Object.defineProperty(this.ssl,"key",{enumerable:!1}),this.client_encoding=je("client_encoding",e),this.replication=je("replication",e),this.isDomainSocket=!(this.host||"").indexOf("/"),this.application_name=je("application_name",e,"PGAPPNAME"),this.fallback_application_name=je("fallback_application_name",e,!1),this.statement_timeout=je("statement_timeout",e,!1),this.lock_timeout=je("lock_timeout",e,!1),this.idle_in_transaction_session_timeout=je("idle_in_transaction_session_timeout",e,!1),this.query_timeout=je("query_timeout",e,!1),e.connectionTimeoutMillis===void 0?this.connect_timeout=process.env.PGCONNECT_TIMEOUT||0:this.connect_timeout=Math.floor(e.connectionTimeoutMillis/1e3),e.keepAlive===!1?this.keepalives=0:e.keepAlive===!0&&(this.keepalives=1),typeof e.keepAliveInitialDelayMillis=="number"&&(this.keepalives_idle=Math.floor(e.keepAliveInitialDelayMillis/1e3))}getLibpqConnectionString(e){let r=[];pt(r,this,"user"),pt(r,this,"password"),pt(r,this,"port"),pt(r,this,"application_name"),pt(r,this,"fallback_application_name"),pt(r,this,"connect_timeout"),pt(r,this,"options");let i=typeof this.ssl=="object"?this.ssl:this.ssl?{sslmode:this.ssl}:{};if(pt(r,i,"sslmode"),pt(r,i,"sslca"),pt(r,i,"sslkey"),pt(r,i,"sslcert"),pt(r,i,"sslrootcert"),this.database&&r.push("dbname="+On(this.database)),this.replication&&r.push("replication="+On(this.replication)),this.host&&r.push("host="+On(this.host)),this.isDomainSocket)return e(null,r.join(" "));this.client_encoding&&r.push("client_encoding="+On(this.client_encoding)),yq.lookup(this.host,function(n,o){return n?e(n,null):(r.push("hostaddr="+On(o)),e(null,r.join(" ")))})}};fE.exports=Em});var Pm=S((ZX,pE)=>{"use strict";var bq=yo(),mE=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/,Cm=class{constructor(e,r){this.command=null,this.rowCount=null,this.oid=null,this.rows=[],this.fields=[],this._parsers=void 0,this._types=r,this.RowCtor=null,this.rowAsArray=e==="array",this.rowAsArray&&(this.parseRow=this._parseRowAsArray),this._prebuiltEmptyResultObject=null}addCommandComplete(e){let r;e.text?r=mE.exec(e.text):r=mE.exec(e.command),r&&(this.command=r[1],r[3]?(this.oid=parseInt(r[2],10),this.rowCount=parseInt(r[3],10)):r[2]&&(this.rowCount=parseInt(r[2],10)))}_parseRowAsArray(e){let r=new Array(e.length);for(let i=0,n=e.length;i<n;i++){let o=e[i];o!==null?r[i]=this._parsers[i](o):r[i]=null}return r}parseRow(e){let r={...this._prebuiltEmptyResultObject};for(let i=0,n=e.length;i<n;i++){let o=e[i],s=this.fields[i].name;if(o!==null){let a=this.fields[i].format==="binary"?Buffer.from(o):o;r[s]=this._parsers[i](a)}else r[s]=null}return r}addRow(e){this.rows.push(e)}addFields(e){this.fields=e,this.fields.length&&(this._parsers=new Array(e.length));let r=Object.create(null);for(let i=0;i<e.length;i++){let n=e[i];r[n.name]=null,this._types?this._parsers[i]=this._types.getTypeParser(n.dataTypeID,n.format||"text"):this._parsers[i]=bq.getTypeParser(n.dataTypeID,n.format||"text")}this._prebuiltEmptyResultObject={...r}}};pE.exports=Cm});var vE=S((KX,yE)=>{"use strict";var{EventEmitter:wq}=X("events"),hE=Pm(),gE=Pn(),Nm=class extends wq{constructor(e,r,i){super(),e=gE.normalizeQueryConfig(e,r,i),this.text=e.text,this.values=e.values,this.rows=e.rows,this.types=e.types,this.name=e.name,this.queryMode=e.queryMode,this.binary=e.binary,this.portal=e.portal||"",this.callback=e.callback,this._rowMode=e.rowMode,process.domain&&e.callback&&(this.callback=process.domain.bind(e.callback)),this._result=new hE(this._rowMode,this.types),this._results=this._result,this._canceledDueToError=!1}requiresPreparation(){return this.queryMode==="extended"||this.name||this.rows?!0:!this.text||!this.values?!1:this.values.length>0}_checkForMultirow(){this._result.command&&(Array.isArray(this._results)||(this._results=[this._result]),this._result=new hE(this._rowMode,this._result._types),this._results.push(this._result))}handleRowDescription(e){this._checkForMultirow(),this._result.addFields(e.fields),this._accumulateRows=this.callback||!this.listeners("row").length}handleDataRow(e){let r;if(!this._canceledDueToError){try{r=this._result.parseRow(e.fields)}catch(i){this._canceledDueToError=i;return}this.emit("row",r,this._result),this._accumulateRows&&this._result.addRow(r)}}handleCommandComplete(e,r){this._checkForMultirow(),this._result.addCommandComplete(e),this.rows&&r.sync()}handleEmptyQuery(e){this.rows&&e.sync()}handleError(e,r){if(this._canceledDueToError&&(e=this._canceledDueToError,this._canceledDueToError=!1),this.callback)return this.callback(e);this.emit("error",e)}handleReadyForQuery(e){if(this._canceledDueToError)return this.handleError(this._canceledDueToError,e);if(this.callback)try{this.callback(null,this._results)}catch(r){process.nextTick(()=>{throw r})}this.emit("end",this._results)}submit(e){if(typeof this.text!="string"&&typeof this.name!="string")return new Error("A query must have either text or a name. Supplying neither is unsupported.");let r=e.parsedStatements[this.name];if(this.text&&r&&this.text!==r)return new Error(`Prepared statements must be unique - '${this.name}' was used for a different statement`);if(this.values&&!Array.isArray(this.values))return new Error("Query values must be an array");if(this.requiresPreparation()){e.stream.cork&&e.stream.cork();try{this.prepare(e)}finally{e.stream.uncork&&e.stream.uncork()}}else e.query(this.text);return null}hasBeenParsed(e){return this.name&&e.parsedStatements[this.name]}handlePortalSuspended(e){this._getRows(e,this.rows)}_getRows(e,r){e.execute({portal:this.portal,rows:r}),r?e.flush():e.sync()}prepare(e){this.hasBeenParsed(e)||e.parse({text:this.text,name:this.name,types:this.types});try{e.bind({portal:this.portal,statement:this.name,values:this.values,binary:this.binary,valueMapper:gE.prepareValue})}catch(r){this.handleError(r,e);return}e.describe({type:"P",name:this.portal||""}),this._getRows(e,this.rows)}handleCopyInResponse(e){e.sendCopyFail("No source stream defined")}handleCopyData(e,r){}};yE.exports=Nm});var Vm=S(F=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});F.NoticeMessage=F.DataRowMessage=F.CommandCompleteMessage=F.ReadyForQueryMessage=F.NotificationResponseMessage=F.BackendKeyDataMessage=F.AuthenticationMD5Password=F.ParameterStatusMessage=F.ParameterDescriptionMessage=F.RowDescriptionMessage=F.Field=F.CopyResponse=F.CopyDataMessage=F.DatabaseError=F.copyDone=F.emptyQuery=F.replicationStart=F.portalSuspended=F.noData=F.closeComplete=F.bindComplete=F.parseComplete=void 0;F.parseComplete={name:"parseComplete",length:5};F.bindComplete={name:"bindComplete",length:5};F.closeComplete={name:"closeComplete",length:5};F.noData={name:"noData",length:5};F.portalSuspended={name:"portalSuspended",length:5};F.replicationStart={name:"replicationStart",length:4};F.emptyQuery={name:"emptyQuery",length:4};F.copyDone={name:"copyDone",length:4};var Om=class extends Error{constructor(e,r,i){super(e),this.length=r,this.name=i}};F.DatabaseError=Om;var Am=class{constructor(e,r){this.length=e,this.chunk=r,this.name="copyData"}};F.CopyDataMessage=Am;var Rm=class{constructor(e,r,i,n){this.length=e,this.name=r,this.binary=i,this.columnTypes=new Array(n)}};F.CopyResponse=Rm;var Dm=class{constructor(e,r,i,n,o,s,a){this.name=e,this.tableID=r,this.columnID=i,this.dataTypeID=n,this.dataTypeSize=o,this.dataTypeModifier=s,this.format=a}};F.Field=Dm;var Lm=class{constructor(e,r){this.length=e,this.fieldCount=r,this.name="rowDescription",this.fields=new Array(this.fieldCount)}};F.RowDescriptionMessage=Lm;var zm=class{constructor(e,r){this.length=e,this.parameterCount=r,this.name="parameterDescription",this.dataTypeIDs=new Array(this.parameterCount)}};F.ParameterDescriptionMessage=zm;var jm=class{constructor(e,r,i){this.length=e,this.parameterName=r,this.parameterValue=i,this.name="parameterStatus"}};F.ParameterStatusMessage=jm;var Um=class{constructor(e,r){this.length=e,this.salt=r,this.name="authenticationMD5Password"}};F.AuthenticationMD5Password=Um;var Mm=class{constructor(e,r,i){this.length=e,this.processID=r,this.secretKey=i,this.name="backendKeyData"}};F.BackendKeyDataMessage=Mm;var qm=class{constructor(e,r,i,n){this.length=e,this.processId=r,this.channel=i,this.payload=n,this.name="notification"}};F.NotificationResponseMessage=qm;var Fm=class{constructor(e,r){this.length=e,this.status=r,this.name="readyForQuery"}};F.ReadyForQueryMessage=Fm;var Bm=class{constructor(e,r){this.length=e,this.text=r,this.name="commandComplete"}};F.CommandCompleteMessage=Bm;var Zm=class{constructor(e,r){this.length=e,this.fields=r,this.name="dataRow",this.fieldCount=r.length}};F.DataRowMessage=Zm;var Km=class{constructor(e,r){this.length=e,this.message=r,this.name="notice"}};F.NoticeMessage=Km});var bE=S(Qa=>{"use strict";Object.defineProperty(Qa,"__esModule",{value:!0});Qa.Writer=void 0;var Gm=class{constructor(e=256){this.size=e,this.offset=5,this.headerPosition=0,this.buffer=Buffer.allocUnsafe(e)}ensure(e){if(this.buffer.length-this.offset<e){let i=this.buffer,n=i.length+(i.length>>1)+e;this.buffer=Buffer.allocUnsafe(n),i.copy(this.buffer)}}addInt32(e){return this.ensure(4),this.buffer[this.offset++]=e>>>24&255,this.buffer[this.offset++]=e>>>16&255,this.buffer[this.offset++]=e>>>8&255,this.buffer[this.offset++]=e>>>0&255,this}addInt16(e){return this.ensure(2),this.buffer[this.offset++]=e>>>8&255,this.buffer[this.offset++]=e>>>0&255,this}addCString(e){if(!e)this.ensure(1);else{let r=Buffer.byteLength(e);this.ensure(r+1),this.buffer.write(e,this.offset,"utf-8"),this.offset+=r}return this.buffer[this.offset++]=0,this}addString(e=""){let r=Buffer.byteLength(e);return this.ensure(r),this.buffer.write(e,this.offset),this.offset+=r,this}add(e){return this.ensure(e.length),e.copy(this.buffer,this.offset),this.offset+=e.length,this}join(e){if(e){this.buffer[this.headerPosition]=e;let r=this.offset-(this.headerPosition+1);this.buffer.writeInt32BE(r,this.headerPosition+1)}return this.buffer.slice(e?0:5,this.offset)}flush(e){let r=this.join(e);return this.offset=5,this.headerPosition=0,this.buffer=Buffer.allocUnsafe(this.size),r}};Qa.Writer=Gm});var SE=S(Wa=>{"use strict";Object.defineProperty(Wa,"__esModule",{value:!0});Wa.serialize=void 0;var Qm=bE(),me=new Qm.Writer,Sq=t=>{me.addInt16(3).addInt16(0);for(let i of Object.keys(t))me.addCString(i).addCString(t[i]);me.addCString("client_encoding").addCString("UTF8");let e=me.addCString("").flush(),r=e.length+4;return new Qm.Writer().addInt32(r).add(e).flush()},xq=()=>{let t=Buffer.allocUnsafe(8);return t.writeInt32BE(8,0),t.writeInt32BE(80877103,4),t},_q=t=>me.addCString(t).flush(112),$q=function(t,e){return me.addCString(t).addInt32(Buffer.byteLength(e)).addString(e),me.flush(112)},kq=function(t){return me.addString(t).flush(112)},Tq=t=>me.addCString(t).flush(81),wE=[],Eq=t=>{let e=t.name||"";e.length>63&&(console.error("Warning! Postgres only supports 63 characters for query names."),console.error("You supplied %s (%s)",e,e.length),console.error("This can cause conflicts and silent errors executing queries"));let r=t.types||wE,i=r.length,n=me.addCString(e).addCString(t.text).addInt16(i);for(let o=0;o<i;o++)n.addInt32(r[o]);return me.flush(80)},An=new Qm.Writer,Iq=function(t,e){for(let r=0;r<t.length;r++){let i=e?e(t[r],r):t[r];i==null?(me.addInt16(0),An.addInt32(-1)):i instanceof Buffer?(me.addInt16(1),An.addInt32(i.length),An.add(i)):(me.addInt16(0),An.addInt32(Buffer.byteLength(i)),An.addString(i))}},Cq=(t={})=>{let e=t.portal||"",r=t.statement||"",i=t.binary||!1,n=t.values||wE,o=n.length;return me.addCString(e).addCString(r),me.addInt16(o),Iq(n,t.valueMapper),me.addInt16(o),me.add(An.flush()),me.addInt16(1),me.addInt16(i?1:0),me.flush(66)},Pq=Buffer.from([69,0,0,0,9,0,0,0,0,0]),Nq=t=>{if(!t||!t.portal&&!t.rows)return Pq;let e=t.portal||"",r=t.rows||0,i=Buffer.byteLength(e),n=4+i+1+4,o=Buffer.allocUnsafe(1+n);return o[0]=69,o.writeInt32BE(n,1),o.write(e,5,"utf-8"),o[i+5]=0,o.writeUInt32BE(r,o.length-4),o},Oq=(t,e)=>{let r=Buffer.allocUnsafe(16);return r.writeInt32BE(16,0),r.writeInt16BE(1234,4),r.writeInt16BE(5678,6),r.writeInt32BE(t,8),r.writeInt32BE(e,12),r},Jm=(t,e)=>{let i=4+Buffer.byteLength(e)+1,n=Buffer.allocUnsafe(1+i);return n[0]=t,n.writeInt32BE(i,1),n.write(e,5,"utf-8"),n[i]=0,n},Aq=me.addCString("P").flush(68),Rq=me.addCString("S").flush(68),Dq=t=>t.name?Jm(68,`${t.type}${t.name||""}`):t.type==="P"?Aq:Rq,Lq=t=>{let e=`${t.type}${t.name||""}`;return Jm(67,e)},zq=t=>me.add(t).flush(100),jq=t=>Jm(102,t),Ja=t=>Buffer.from([t,0,0,0,4]),Uq=Ja(72),Mq=Ja(83),qq=Ja(88),Fq=Ja(99),Bq={startup:Sq,password:_q,requestSsl:xq,sendSASLInitialResponseMessage:$q,sendSCRAMClientFinalMessage:kq,query:Tq,parse:Eq,bind:Cq,execute:Nq,describe:Dq,close:Lq,flush:()=>Uq,sync:()=>Mq,end:()=>qq,copyData:zq,copyDone:()=>Fq,copyFail:jq,cancel:Oq};Wa.serialize=Bq});var xE=S(Ha=>{"use strict";Object.defineProperty(Ha,"__esModule",{value:!0});Ha.BufferReader=void 0;var Wm=class{constructor(e=0){this.offset=e,this.buffer=Buffer.allocUnsafe(0),this.encoding="utf-8"}setBuffer(e,r){this.offset=e,this.buffer=r}int16(){let e=this.buffer.readInt16BE(this.offset);return this.offset+=2,e}byte(){let e=this.buffer[this.offset];return this.offset++,e}int32(){let e=this.buffer.readInt32BE(this.offset);return this.offset+=4,e}uint32(){let e=this.buffer.readUInt32BE(this.offset);return this.offset+=4,e}string(e){let r=this.buffer.toString(this.encoding,this.offset,this.offset+e);return this.offset+=e,r}cstring(){let e=this.offset,r=e;for(;this.buffer[r++]!==0;);return this.offset=r,this.buffer.toString(this.encoding,e,r-1)}bytes(e){let r=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,r}};Ha.BufferReader=Wm});var TE=S(Ya=>{"use strict";Object.defineProperty(Ya,"__esModule",{value:!0});Ya.Parser=void 0;var ge=Vm(),Zq=xE(),Ym=1,Kq=4,_E=Ym+Kq,nt=-1,Hm=Buffer.allocUnsafe(0),Xm=class{constructor(e){if(this.buffer=Hm,this.bufferLength=0,this.bufferOffset=0,this.reader=new Zq.BufferReader,e?.mode==="binary")throw new Error("Binary mode not supported yet");this.mode=e?.mode||"text"}parse(e,r){this.mergeBuffer(e);let i=this.bufferOffset+this.bufferLength,n=this.bufferOffset;for(;n+_E<=i;){let o=this.buffer[n],s=this.buffer.readUInt32BE(n+Ym),a=Ym+s;if(a+n<=i){let l=this.handlePacket(n+_E,o,s,this.buffer);r(l),n+=a}else break}n===i?(this.buffer=Hm,this.bufferLength=0,this.bufferOffset=0):(this.bufferLength=i-n,this.bufferOffset=n)}mergeBuffer(e){if(this.bufferLength>0){let r=this.bufferLength+e.byteLength;if(r+this.bufferOffset>this.buffer.byteLength){let n;if(r<=this.buffer.byteLength&&this.bufferOffset>=this.bufferLength)n=this.buffer;else{let o=this.buffer.byteLength*2;for(;r>=o;)o*=2;n=Buffer.allocUnsafe(o)}this.buffer.copy(n,0,this.bufferOffset,this.bufferOffset+this.bufferLength),this.buffer=n,this.bufferOffset=0}e.copy(this.buffer,this.bufferOffset+this.bufferLength),this.bufferLength=r}else this.buffer=e,this.bufferOffset=0,this.bufferLength=e.byteLength}handlePacket(e,r,i,n){let{reader:o}=this;o.setBuffer(e,n);let s;switch(r){case 50:s=ge.bindComplete;break;case 49:s=ge.parseComplete;break;case 51:s=ge.closeComplete;break;case 110:s=ge.noData;break;case 115:s=ge.portalSuspended;break;case 99:s=ge.copyDone;break;case 87:s=ge.replicationStart;break;case 73:s=ge.emptyQuery;break;case 68:s=tF(o);break;case 67:s=Gq(o);break;case 90:s=Vq(o);break;case 65:s=Hq(o);break;case 82:s=iF(o,i);break;case 83:s=rF(o);break;case 75:s=nF(o);break;case 69:s=$E(o,"error");break;case 78:s=$E(o,"notice");break;case 84:s=Yq(o);break;case 116:s=eF(o);break;case 71:s=Jq(o);break;case 72:s=Wq(o);break;case 100:s=Qq(o,i);break;default:return new ge.DatabaseError("received invalid response: "+r.toString(16),i,"error")}return o.setBuffer(0,Hm),s.length=i,s}};Ya.Parser=Xm;var Vq=t=>{let e=t.string(1);return new ge.ReadyForQueryMessage(nt,e)},Gq=t=>{let e=t.cstring();return new ge.CommandCompleteMessage(nt,e)},Qq=(t,e)=>{let r=t.bytes(e-4);return new ge.CopyDataMessage(nt,r)},Jq=t=>kE(t,"copyInResponse"),Wq=t=>kE(t,"copyOutResponse"),kE=(t,e)=>{let r=t.byte()!==0,i=t.int16(),n=new ge.CopyResponse(nt,e,r,i);for(let o=0;o<i;o++)n.columnTypes[o]=t.int16();return n},Hq=t=>{let e=t.int32(),r=t.cstring(),i=t.cstring();return new ge.NotificationResponseMessage(nt,e,r,i)},Yq=t=>{let e=t.int16(),r=new ge.RowDescriptionMessage(nt,e);for(let i=0;i<e;i++)r.fields[i]=Xq(t);return r},Xq=t=>{let e=t.cstring(),r=t.uint32(),i=t.int16(),n=t.uint32(),o=t.int16(),s=t.int32(),a=t.int16()===0?"text":"binary";return new ge.Field(e,r,i,n,o,s,a)},eF=t=>{let e=t.int16(),r=new ge.ParameterDescriptionMessage(nt,e);for(let i=0;i<e;i++)r.dataTypeIDs[i]=t.int32();return r},tF=t=>{let e=t.int16(),r=new Array(e);for(let i=0;i<e;i++){let n=t.int32();r[i]=n===-1?null:t.string(n)}return new ge.DataRowMessage(nt,r)},rF=t=>{let e=t.cstring(),r=t.cstring();return new ge.ParameterStatusMessage(nt,e,r)},nF=t=>{let e=t.int32(),r=t.int32();return new ge.BackendKeyDataMessage(nt,e,r)},iF=(t,e)=>{let r=t.int32(),i={name:"authenticationOk",length:e};switch(r){case 0:break;case 3:i.length===8&&(i.name="authenticationCleartextPassword");break;case 5:if(i.length===12){i.name="authenticationMD5Password";let n=t.bytes(4);return new ge.AuthenticationMD5Password(nt,n)}break;case 10:{i.name="authenticationSASL",i.mechanisms=[];let n;do n=t.cstring(),n&&i.mechanisms.push(n);while(n)}break;case 11:i.name="authenticationSASLContinue",i.data=t.string(e-8);break;case 12:i.name="authenticationSASLFinal",i.data=t.string(e-8);break;default:throw new Error("Unknown authenticationOk message type "+r)}return i},$E=(t,e)=>{let r={},i=t.string(1);for(;i!=="\0";)r[i]=t.cstring(),i=t.string(1);let n=r.M,o=e==="notice"?new ge.NoticeMessage(nt,n):new ge.DatabaseError(n,nt,e);return o.severity=r.S,o.code=r.C,o.detail=r.D,o.hint=r.H,o.position=r.P,o.internalPosition=r.p,o.internalQuery=r.q,o.where=r.W,o.schema=r.s,o.table=r.t,o.column=r.c,o.dataType=r.d,o.constraint=r.n,o.file=r.F,o.line=r.L,o.routine=r.R,o}});var ep=S(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});fr.DatabaseError=fr.serialize=fr.parse=void 0;var oF=Vm();Object.defineProperty(fr,"DatabaseError",{enumerable:!0,get:function(){return oF.DatabaseError}});var sF=SE();Object.defineProperty(fr,"serialize",{enumerable:!0,get:function(){return sF.serialize}});var aF=TE();function lF(t,e){let r=new aF.Parser;return t.on("data",i=>r.parse(i,e)),new Promise(i=>t.on("end",()=>i()))}fr.parse=lF});var EE=S(tp=>{"use strict";Object.defineProperty(tp,"__esModule",{value:!0});tp.default={}});var CE=S((XX,IE)=>{var{getStream:cF,getSecureStream:uF}=pF();IE.exports={getStream:cF,getSecureStream:uF};function dF(){function t(r){let i=X("net");return new i.Socket}function e(r){return X("tls").connect(r)}return{getStream:t,getSecureStream:e}}function fF(){function t(r){let{CloudflareSocket:i}=EE();return new i(r)}function e(r){return r.socket.startTls(r),r.socket}return{getStream:t,getSecureStream:e}}function mF(){if(typeof navigator=="object"&&navigator!==null&&typeof navigator.userAgent=="string")return navigator.userAgent==="Cloudflare-Workers";if(typeof Response=="function"){let t=new Response(null,{cf:{thing:!0}});if(typeof t.cf=="object"&&t.cf!==null&&t.cf.thing)return!0}return!1}function pF(){return mF()?fF():dF()}});var np=S((eee,PE)=>{"use strict";var hF=X("events").EventEmitter,{parse:gF,serialize:Ce}=ep(),{getStream:yF,getSecureStream:vF}=CE(),bF=Ce.flush(),wF=Ce.sync(),SF=Ce.end(),rp=class extends hF{constructor(e){super(),e=e||{},this.stream=e.stream||yF(e.ssl),typeof this.stream=="function"&&(this.stream=this.stream(e)),this._keepAlive=e.keepAlive,this._keepAliveInitialDelayMillis=e.keepAliveInitialDelayMillis,this.parsedStatements={},this.ssl=e.ssl||!1,this._ending=!1,this._emitMessage=!1;let r=this;this.on("newListener",function(i){i==="message"&&(r._emitMessage=!0)})}connect(e,r){let i=this;this._connecting=!0,this.stream.setNoDelay(!0),this.stream.connect(e,r),this.stream.once("connect",function(){i._keepAlive&&i.stream.setKeepAlive(!0,i._keepAliveInitialDelayMillis),i.emit("connect")});let n=function(o){i._ending&&(o.code==="ECONNRESET"||o.code==="EPIPE")||i.emit("error",o)};if(this.stream.on("error",n),this.stream.on("close",function(){i.emit("end")}),!this.ssl)return this.attachListeners(this.stream);this.stream.once("data",function(o){switch(o.toString("utf8")){case"S":break;case"N":return i.stream.end(),i.emit("error",new Error("The server does not support SSL connections"));default:return i.stream.end(),i.emit("error",new Error("There was an error establishing an SSL connection"))}let a={socket:i.stream};i.ssl!==!0&&(Object.assign(a,i.ssl),"key"in i.ssl&&(a.key=i.ssl.key));let l=X("net");l.isIP&&l.isIP(r)===0&&(a.servername=r);try{i.stream=vF(a)}catch(c){return i.emit("error",c)}i.attachListeners(i.stream),i.stream.on("error",n),i.emit("sslconnect")})}attachListeners(e){gF(e,r=>{let i=r.name==="error"?"errorMessage":r.name;this._emitMessage&&this.emit("message",r),this.emit(i,r)})}requestSsl(){this.stream.write(Ce.requestSsl())}startup(e){this.stream.write(Ce.startup(e))}cancel(e,r){this._send(Ce.cancel(e,r))}password(e){this._send(Ce.password(e))}sendSASLInitialResponseMessage(e,r){this._send(Ce.sendSASLInitialResponseMessage(e,r))}sendSCRAMClientFinalMessage(e){this._send(Ce.sendSCRAMClientFinalMessage(e))}_send(e){return this.stream.writable?this.stream.write(e):!1}query(e){this._send(Ce.query(e))}parse(e){this._send(Ce.parse(e))}bind(e){this._send(Ce.bind(e))}execute(e){this._send(Ce.execute(e))}flush(){this.stream.writable&&this.stream.write(bF)}sync(){this._ending=!0,this._send(wF)}ref(){this.stream.ref()}unref(){this.stream.unref()}end(){if(this._ending=!0,!this._connecting||!this.stream.writable){this.stream.end();return}return this.stream.write(SF,()=>{this.stream.end()})}close(e){this._send(Ce.close(e))}describe(e){this._send(Ce.describe(e))}sendCopyFromChunk(e){this._send(Ce.copyData(e))}endCopyFrom(){this._send(Ce.copyDone())}sendCopyFail(e){this._send(Ce.copyFail(e))}};PE.exports=rp});var RE=S((tee,AE)=>{"use strict";var{Transform:xF}=X("stream"),{StringDecoder:_F}=X("string_decoder"),mr=Symbol("last"),Xa=Symbol("decoder");function $F(t,e,r){let i;if(this.overflow){if(i=this[Xa].write(t).split(this.matcher),i.length===1)return r();i.shift(),this.overflow=!1}else this[mr]+=this[Xa].write(t),i=this[mr].split(this.matcher);this[mr]=i.pop();for(let n=0;n<i.length;n++)try{OE(this,this.mapper(i[n]))}catch(o){return r(o)}if(this.overflow=this[mr].length>this.maxLength,this.overflow&&!this.skipOverflow){r(new Error("maximum buffer reached"));return}r()}function kF(t){if(this[mr]+=this[Xa].end(),this[mr])try{OE(this,this.mapper(this[mr]))}catch(e){return t(e)}t()}function OE(t,e){e!==void 0&&t.push(e)}function NE(t){return t}function TF(t,e,r){switch(t=t||/\r?\n/,e=e||NE,r=r||{},arguments.length){case 1:typeof t=="function"?(e=t,t=/\r?\n/):typeof t=="object"&&!(t instanceof RegExp)&&!t[Symbol.split]&&(r=t,t=/\r?\n/);break;case 2:typeof t=="function"?(r=e,e=t,t=/\r?\n/):typeof e=="object"&&(r=e,e=NE)}r=Object.assign({},r),r.autoDestroy=!0,r.transform=$F,r.flush=kF,r.readableObjectMode=!0;let i=new xF(r);return i[mr]="",i[Xa]=new _F("utf8"),i.matcher=t,i.mapper=e,i.maxLength=r.maxLength,i.skipOverflow=r.skipOverflow||!1,i.overflow=!1,i._destroy=function(n,o){this._writableState.errorEmitted=!1,o(n)},i}AE.exports=TF});var zE=S((ree,Zt)=>{"use strict";var DE=X("path"),EF=X("stream").Stream,IF=RE(),LE=X("util"),CF=5432,el=process.platform==="win32",wo=process.stderr,PF=56,NF=7,OF=61440,AF=32768;function RF(t){return(t&OF)==AF}var Rn=["host","port","database","user","password"],ip=Rn.length,DF=Rn[ip-1];function op(){var t=wo instanceof EF&&wo.writable===!0;if(t){var e=Array.prototype.slice.call(arguments).concat(`
|
|
42
|
-
`);wo.write(LE.format.apply(LE,e))}}Object.defineProperty(Zt.exports,"isWin",{get:function(){return el},set:function(t){el=t}});Zt.exports.warnTo=function(t){var e=wo;return wo=t,e};Zt.exports.getFileName=function(t){var e=t||process.env,r=e.PGPASSFILE||(el?DE.join(e.APPDATA||"./","postgresql","pgpass.conf"):DE.join(e.HOME||"./",".pgpass"));return r};Zt.exports.usePgPass=function(t,e){return Object.prototype.hasOwnProperty.call(process.env,"PGPASSWORD")?!1:el?!0:(e=e||"<unkn>",RF(t.mode)?t.mode&(PF|NF)?(op('WARNING: password file "%s" has group or world access; permissions should be u=rw (0600) or less',e),!1):!0:(op('WARNING: password file "%s" is not a plain file',e),!1))};var LF=Zt.exports.match=function(t,e){return Rn.slice(0,-1).reduce(function(r,i,n){return n==1&&Number(t[i]||CF)===Number(e[i])?r&&!0:r&&(e[i]==="*"||e[i]===t[i])},!0)};Zt.exports.getPassword=function(t,e,r){var i,n=e.pipe(IF());function o(l){var c=zF(l);c&&jF(c)&&LF(t,c)&&(i=c[DF],n.end())}var s=function(){e.destroy(),r(i)},a=function(l){e.destroy(),op("WARNING: error on reading file: %s",l),r(void 0)};e.on("error",a),n.on("data",o).on("end",s).on("error",a)};var zF=Zt.exports.parseLine=function(t){if(t.length<11||t.match(/^\s+#/))return null;for(var e="",r="",i=0,n=0,o=0,s={},a=!1,l=function(u,d,f){var m=t.substring(d,f);Object.hasOwnProperty.call(process.env,"PGPASS_NO_DEESCAPE")||(m=m.replace(/\\([:\\])/g,"$1")),s[Rn[u]]=m},c=0;c<t.length-1;c+=1){if(e=t.charAt(c+1),r=t.charAt(c),a=i==ip-1,a){l(i,n);break}c>=0&&e==":"&&r!=="\\"&&(l(i,n,c+1),n=c+2,i+=1)}return s=Object.keys(s).length===ip?s:null,s},jF=Zt.exports.isValidEntry=function(t){for(var e={0:function(s){return s.length>0},1:function(s){return s==="*"?!0:(s=Number(s),isFinite(s)&&s>0&&s<9007199254740992&&Math.floor(s)===s)},2:function(s){return s.length>0},3:function(s){return s.length>0},4:function(s){return s.length>0}},r=0;r<Rn.length;r+=1){var i=e[r],n=t[Rn[r]]||"",o=i(n);if(!o)return!1}return!0}});var UE=S((iee,sp)=>{"use strict";var nee=X("path"),jE=X("fs"),tl=zE();sp.exports=function(t,e){var r=tl.getFileName();jE.stat(r,function(i,n){if(i||!tl.usePgPass(n,r))return e(void 0);var o=jE.createReadStream(r);tl.getPassword(t,o,e)})};sp.exports.warnTo=tl.warnTo});var ZE=S((oee,BE)=>{var UF=X("events").EventEmitter,ME=Pn(),So=X("util"),rl=oE(),MF=Ga(),qF=Im(),FE=vE(),FF=vo(),BF=np(),ZF=_m(),qE=So.deprecate(()=>{},"Client.activeQuery is deprecated and will be removed in pg@9.0"),KF=So.deprecate(()=>{},"Client.queryQueue is deprecated and will be removed in pg@9.0."),VF=So.deprecate(()=>{},"pgpass support is deprecated and will be removed in pg@9.0. You can provide an async function as the password property to the Client/Pool constructor that returns a password instead. Within this function you can call the pgpass module in your own code."),GF=So.deprecate(()=>{},"Passing a custom Promise implementation to the Client/Pool constructor is deprecated and will be removed in pg@9.0."),QF=So.deprecate(()=>{},"Calling client.query() when the client is already executing a query is deprecated and will be removed in pg@9.0. Use async/await or an external async flow control mechanism instead.");function JF(t,e){if(typeof t=="number")return Number.isFinite(t)?t:e;if(typeof t=="string"&&t.trim()!==""){let r=Number(t);return Number.isFinite(r)?r:e}return e}var nl=class extends UF{constructor(e){super(),this.connectionParameters=new qF(e),this.user=this.connectionParameters.user,this.database=this.connectionParameters.database,this.port=this.connectionParameters.port,this.host=this.connectionParameters.host,Object.defineProperty(this,"password",{configurable:!0,enumerable:!1,writable:!0,value:this.connectionParameters.password}),this.replication=this.connectionParameters.replication;let r=e||{};r.Promise&&GF(),this._Promise=r.Promise||global.Promise,this._types=new MF(r.types),this._ending=!1,this._ended=!1,this._connecting=!1,this._connected=!1,this._connectionError=!1,this._queryable=!0,this._activeQuery=null,this._txStatus=null,this.enableChannelBinding=!!r.enableChannelBinding,this.scramMaxIterations=JF(r.scramMaxIterations,rl.DEFAULT_MAX_SCRAM_ITERATIONS),this.connection=r.connection||new BF({stream:r.stream,ssl:this.connectionParameters.ssl,keepAlive:r.keepAlive||!1,keepAliveInitialDelayMillis:r.keepAliveInitialDelayMillis||0,encoding:this.connectionParameters.client_encoding||"utf8"}),this._queryQueue=[],this.binary=r.binary||FF.binary,this.processID=null,this.secretKey=null,this.ssl=this.connectionParameters.ssl||!1,this.ssl&&this.ssl.key&&Object.defineProperty(this.ssl,"key",{enumerable:!1}),this._connectionTimeoutMillis=r.connectionTimeoutMillis||0}get activeQuery(){return qE(),this._activeQuery}set activeQuery(e){qE(),this._activeQuery=e}_getActiveQuery(){return this._activeQuery}_errorAllQueries(e){let r=n=>{process.nextTick(()=>{n.handleError(e,this.connection)})},i=this._getActiveQuery();i&&(r(i),this._activeQuery=null),this._queryQueue.forEach(r),this._queryQueue.length=0}_connect(e){let r=this,i=this.connection;if(this._connectionCallback=e,this._connecting||this._connected){let n=new Error("Client has already been connected. You cannot reuse a client.");process.nextTick(()=>{e(n)});return}this._connecting=!0,this._connectionTimeoutMillis>0&&(this.connectionTimeoutHandle=setTimeout(()=>{i._ending=!0,i.stream.destroy(new Error("timeout expired"))},this._connectionTimeoutMillis),this.connectionTimeoutHandle.unref&&this.connectionTimeoutHandle.unref()),this.host&&this.host.indexOf("/")===0?i.connect(this.host+"/.s.PGSQL."+this.port):i.connect(this.port,this.host),i.on("connect",function(){r.ssl?i.requestSsl():i.startup(r.getStartupConf())}),i.on("sslconnect",function(){i.startup(r.getStartupConf())}),this._attachListeners(i),i.once("end",()=>{let n=this._ending?new Error("Connection terminated"):new Error("Connection terminated unexpectedly");clearTimeout(this.connectionTimeoutHandle),this._errorAllQueries(n),this._ended=!0,this._ending||(this._connecting&&!this._connectionError?this._connectionCallback?this._connectionCallback(n):this._handleErrorEvent(n):this._connectionError||this._handleErrorEvent(n)),process.nextTick(()=>{this.emit("end")})})}connect(e){if(e){this._connect(e);return}return new this._Promise((r,i)=>{this._connect(n=>{n?i(n):r(this)})})}_attachListeners(e){e.on("authenticationCleartextPassword",this._handleAuthCleartextPassword.bind(this)),e.on("authenticationMD5Password",this._handleAuthMD5Password.bind(this)),e.on("authenticationSASL",this._handleAuthSASL.bind(this)),e.on("authenticationSASLContinue",this._handleAuthSASLContinue.bind(this)),e.on("authenticationSASLFinal",this._handleAuthSASLFinal.bind(this)),e.on("backendKeyData",this._handleBackendKeyData.bind(this)),e.on("error",this._handleErrorEvent.bind(this)),e.on("errorMessage",this._handleErrorMessage.bind(this)),e.on("readyForQuery",this._handleReadyForQuery.bind(this)),e.on("notice",this._handleNotice.bind(this)),e.on("rowDescription",this._handleRowDescription.bind(this)),e.on("dataRow",this._handleDataRow.bind(this)),e.on("portalSuspended",this._handlePortalSuspended.bind(this)),e.on("emptyQuery",this._handleEmptyQuery.bind(this)),e.on("commandComplete",this._handleCommandComplete.bind(this)),e.on("parseComplete",this._handleParseComplete.bind(this)),e.on("copyInResponse",this._handleCopyInResponse.bind(this)),e.on("copyData",this._handleCopyData.bind(this)),e.on("notification",this._handleNotification.bind(this))}_getPassword(e){let r=this.connection;if(typeof this.password=="function")this._Promise.resolve().then(()=>this.password(this.connectionParameters)).then(i=>{if(i!==void 0){if(typeof i!="string"){r.emit("error",new TypeError("Password must be a string"));return}this.connectionParameters.password=this.password=i}else this.connectionParameters.password=this.password=null;e()}).catch(i=>{r.emit("error",i)});else if(this.password!==null)e();else try{UE()(this.connectionParameters,n=>{n!==void 0&&(VF(),this.connectionParameters.password=this.password=n),e()})}catch(i){this.emit("error",i)}}_handleAuthCleartextPassword(e){this._getPassword(()=>{this.connection.password(this.password)})}_handleAuthMD5Password(e){this._getPassword(async()=>{try{let r=await ZF.postgresMd5PasswordHash(this.user,this.password,e.salt);this.connection.password(r)}catch(r){this.emit("error",r)}})}_handleAuthSASL(e){this._getPassword(()=>{try{this.saslSession=rl.startSession(e.mechanisms,this.enableChannelBinding&&this.connection.stream,this.scramMaxIterations),this.connection.sendSASLInitialResponseMessage(this.saslSession.mechanism,this.saslSession.response)}catch(r){this.connection.emit("error",r)}})}async _handleAuthSASLContinue(e){try{await rl.continueSession(this.saslSession,this.password,e.data,this.enableChannelBinding&&this.connection.stream),this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)}catch(r){this.connection.emit("error",r)}}_handleAuthSASLFinal(e){try{rl.finalizeSession(this.saslSession,e.data),this.saslSession=null}catch(r){this.connection.emit("error",r)}}_handleBackendKeyData(e){this.processID=e.processID,this.secretKey=e.secretKey}_handleReadyForQuery(e){this._connecting&&(this._connecting=!1,this._connected=!0,clearTimeout(this.connectionTimeoutHandle),this._connectionCallback&&(this._connectionCallback(null,this),this._connectionCallback=null),this.emit("connect"));let r=this._getActiveQuery();this._activeQuery=null,this._txStatus=e?.status??null,this.readyForQuery=!0,r&&r.handleReadyForQuery(this.connection),this._pulseQueryQueue()}_handleErrorWhileConnecting(e){if(!this._connectionError){if(this._connectionError=!0,clearTimeout(this.connectionTimeoutHandle),this._connectionCallback)return this._connectionCallback(e);this.emit("error",e)}}_handleErrorEvent(e){if(this._connecting)return this._handleErrorWhileConnecting(e);this._queryable=!1,this._errorAllQueries(e),this.emit("error",e)}_handleErrorMessage(e){if(this._connecting)return this._handleErrorWhileConnecting(e);let r=this._getActiveQuery();if(!r){this._handleErrorEvent(e);return}this._activeQuery=null,r.handleError(e,this.connection)}_handleRowDescription(e){let r=this._getActiveQuery();if(r==null){let i=new Error("Received unexpected rowDescription message from backend.");this._handleErrorEvent(i);return}r.handleRowDescription(e)}_handleDataRow(e){let r=this._getActiveQuery();if(r==null){let i=new Error("Received unexpected dataRow message from backend.");this._handleErrorEvent(i);return}r.handleDataRow(e)}_handlePortalSuspended(e){let r=this._getActiveQuery();if(r==null){let i=new Error("Received unexpected portalSuspended message from backend.");this._handleErrorEvent(i);return}r.handlePortalSuspended(this.connection)}_handleEmptyQuery(e){let r=this._getActiveQuery();if(r==null){let i=new Error("Received unexpected emptyQuery message from backend.");this._handleErrorEvent(i);return}r.handleEmptyQuery(this.connection)}_handleCommandComplete(e){let r=this._getActiveQuery();if(r==null){let i=new Error("Received unexpected commandComplete message from backend.");this._handleErrorEvent(i);return}r.handleCommandComplete(e,this.connection)}_handleParseComplete(){let e=this._getActiveQuery();if(e==null){let r=new Error("Received unexpected parseComplete message from backend.");this._handleErrorEvent(r);return}e.name&&(this.connection.parsedStatements[e.name]=e.text)}_handleCopyInResponse(e){let r=this._getActiveQuery();if(r==null){let i=new Error("Received unexpected copyInResponse message from backend.");this._handleErrorEvent(i);return}r.handleCopyInResponse(this.connection)}_handleCopyData(e){let r=this._getActiveQuery();if(r==null){let i=new Error("Received unexpected copyData message from backend.");this._handleErrorEvent(i);return}r.handleCopyData(e,this.connection)}_handleNotification(e){this.emit("notification",e)}_handleNotice(e){this.emit("notice",e)}getStartupConf(){let e=this.connectionParameters,r={user:e.user,database:e.database},i=e.application_name||e.fallback_application_name;return i&&(r.application_name=i),e.replication&&(r.replication=""+e.replication),e.statement_timeout&&(r.statement_timeout=String(parseInt(e.statement_timeout,10))),e.lock_timeout&&(r.lock_timeout=String(parseInt(e.lock_timeout,10))),e.idle_in_transaction_session_timeout&&(r.idle_in_transaction_session_timeout=String(parseInt(e.idle_in_transaction_session_timeout,10))),e.options&&(r.options=e.options),r}cancel(e,r){if(e.activeQuery===r){let i=this.connection;this.host&&this.host.indexOf("/")===0?i.connect(this.host+"/.s.PGSQL."+this.port):i.connect(this.port,this.host),i.on("connect",function(){i.cancel(e.processID,e.secretKey)})}else e._queryQueue.indexOf(r)!==-1&&e._queryQueue.splice(e._queryQueue.indexOf(r),1)}setTypeParser(e,r,i){return this._types.setTypeParser(e,r,i)}getTypeParser(e,r){return this._types.getTypeParser(e,r)}escapeIdentifier(e){return ME.escapeIdentifier(e)}escapeLiteral(e){return ME.escapeLiteral(e)}_pulseQueryQueue(){if(this.readyForQuery===!0){this._activeQuery=this._queryQueue.shift();let e=this._getActiveQuery();if(e){this.readyForQuery=!1,this.hasExecuted=!0;let r=e.submit(this.connection);r&&process.nextTick(()=>{e.handleError(r,this.connection),this.readyForQuery=!0,this._pulseQueryQueue()})}else this.hasExecuted&&(this._activeQuery=null,this.emit("drain"))}}query(e,r,i){let n,o;if(e==null)throw new TypeError("Client was passed a null or undefined query");if(typeof e.submit=="function")o=n=e,n.callback||(typeof r=="function"?n.callback=r:i&&(n.callback=i));else if(n=new FE(e,r,i),!n.callback)o=new this._Promise((a,l)=>{n.callback=(c,u)=>c?l(c):a(u)}).catch(a=>{throw Error.captureStackTrace(a),a});else if(typeof n.callback!="function")throw new TypeError("callback is not a function");let s=e.query_timeout||this.connectionParameters.query_timeout;if(s){let a=n.callback||(()=>{}),l=setTimeout(()=>{let c=new Error("Query read timeout");process.nextTick(()=>{n.handleError(c,this.connection)}),a(c),n.callback=()=>{};let u=this._queryQueue.indexOf(n);u>-1&&this._queryQueue.splice(u,1),this._pulseQueryQueue()},s);n.callback=(c,u)=>{clearTimeout(l),a(c,u)}}return this.binary&&!n.binary&&(n.binary=!0),n._result&&!n._result._types&&(n._result._types=this._types),this._queryable?this._ending?(process.nextTick(()=>{n.handleError(new Error("Client was closed and is not queryable"),this.connection)}),o):(this._queryQueue.length>0&&QF(),this._queryQueue.push(n),this._pulseQueryQueue(),o):(process.nextTick(()=>{n.handleError(new Error("Client has encountered a connection error and is not queryable"),this.connection)}),o)}ref(){this.connection.ref()}unref(){this.connection.unref()}getTransactionStatus(){return this._txStatus}end(e){if(this._ending=!0,!this.connection._connecting||this._ended)if(e){e();return}else return this._Promise.resolve();if(this._getActiveQuery()||!this._queryable?this.connection.stream.destroy():this.connection.end(),e)this.connection.once("end",e);else return new this._Promise(r=>{this.connection.once("end",r)})}get queryQueue(){return KF(),this._queryQueue}};nl.Query=FE;BE.exports=nl});var GE=S((see,VE)=>{"use strict";var WF=X("events").EventEmitter,ap=function(){},KE=(t,e)=>{let r=t.findIndex(e);return r===-1?void 0:t.splice(r,1)[0]},lp=class{constructor(e,r,i){this.client=e,this.idleListener=r,this.timeoutId=i}},Dn=class{constructor(e){this.callback=e}};function HF(){throw new Error("Release called on client which has already been released to the pool.")}function il(t,e){if(e)return{callback:e,result:void 0};let r,i,n=function(s,a){s?r(s):i(a)},o=new t(function(s,a){i=s,r=a}).catch(s=>{throw Error.captureStackTrace(s),s});return{callback:n,result:o}}function YF(t,e){return function r(i){i.client=e,e.removeListener("error",r),e.on("error",()=>{t.log("additional client error after disconnection due to error",i)}),t._remove(e),t.emit("error",i,e)}}var cp=class extends WF{constructor(e,r){super(),this.options=Object.assign({},e),e!=null&&"password"in e&&Object.defineProperty(this.options,"password",{configurable:!0,enumerable:!1,writable:!0,value:e.password}),e!=null&&e.ssl&&e.ssl.key&&Object.defineProperty(this.options.ssl,"key",{enumerable:!1}),this.options.max=this.options.max||this.options.poolSize||10,this.options.min=this.options.min||0,this.options.maxUses=this.options.maxUses||1/0,this.options.allowExitOnIdle=this.options.allowExitOnIdle||!1,this.options.maxLifetimeSeconds=this.options.maxLifetimeSeconds||0,this.log=this.options.log||function(){},this.Client=this.options.Client||r||up().Client,this.Promise=this.options.Promise||global.Promise,typeof this.options.idleTimeoutMillis>"u"&&(this.options.idleTimeoutMillis=1e4),this._clients=[],this._idle=[],this._expired=new WeakSet,this._pendingQueue=[],this._endCallback=void 0,this.ending=!1,this.ended=!1}_promiseTry(e){let r=this.Promise;return typeof r.try=="function"?r.try(e):new r(i=>i(e()))}_isFull(){return this._clients.length>=this.options.max}_isAboveMin(){return this._clients.length>this.options.min}_pulseQueue(){if(this.log("pulse queue"),this.ended){this.log("pulse queue ended");return}if(this.ending){this.log("pulse queue on ending"),this._idle.length&&this._idle.slice().map(r=>{this._remove(r.client)}),this._clients.length||(this.ended=!0,this._endCallback());return}if(!this._pendingQueue.length){this.log("no queued requests");return}if(!this._idle.length&&this._isFull())return;let e=this._pendingQueue.shift();if(this._idle.length){let r=this._idle.pop();clearTimeout(r.timeoutId);let i=r.client;i.ref&&i.ref();let n=r.idleListener;return this._acquireClient(i,e,n,!1)}if(!this._isFull())return this.newClient(e);throw new Error("unexpected condition")}_remove(e,r){let i=KE(this._idle,o=>o.client===e);i!==void 0&&clearTimeout(i.timeoutId),this._clients=this._clients.filter(o=>o!==e);let n=this;e.end(()=>{n.emit("remove",e),typeof r=="function"&&r()})}connect(e){if(this.ending){let n=new Error("Cannot use a pool after calling end on the pool");return e?e(n):this.Promise.reject(n)}let r=il(this.Promise,e),i=r.result;if(this._isFull()||this._idle.length){if(this._idle.length&&process.nextTick(()=>this._pulseQueue()),!this.options.connectionTimeoutMillis)return this._pendingQueue.push(new Dn(r.callback)),i;let n=(a,l,c)=>{clearTimeout(s),r.callback(a,l,c)},o=new Dn(n),s=setTimeout(()=>{KE(this._pendingQueue,a=>a.callback===n),o.timedOut=!0,r.callback(new Error("timeout exceeded when trying to connect"))},this.options.connectionTimeoutMillis);return s.unref&&s.unref(),this._pendingQueue.push(o),i}return this.newClient(new Dn(r.callback)),i}newClient(e){let r=new this.Client(this.options);this._clients.push(r);let i=YF(this,r);this.log("checking client timeout");let n,o=!1;this.options.connectionTimeoutMillis&&(n=setTimeout(()=>{r.connection?(this.log("ending client due to timeout"),o=!0,r.connection.stream.destroy()):r.isConnected()||(this.log("ending client due to timeout"),o=!0,r.end())},this.options.connectionTimeoutMillis)),this.log("connecting new client"),r.connect(s=>{if(n&&clearTimeout(n),r.on("error",i),s)this.log("client failed to connect",s),this._clients=this._clients.filter(a=>a!==r),o&&(s=new Error("Connection terminated due to connection timeout",{cause:s})),this._pulseQueue(),e.timedOut||e.callback(s,void 0,ap);else{if(this.log("new client connected"),this.options.onConnect){this._promiseTry(()=>this.options.onConnect(r)).then(()=>{this._afterConnect(r,e,i)},a=>{this._clients=this._clients.filter(l=>l!==r),r.end(()=>{this._pulseQueue(),e.timedOut||e.callback(a,void 0,ap)})});return}return this._afterConnect(r,e,i)}})}_afterConnect(e,r,i){if(this.options.maxLifetimeSeconds!==0){let n=setTimeout(()=>{this.log("ending client due to expired lifetime"),this._expired.add(e),this._idle.findIndex(s=>s.client===e)!==-1&&this._acquireClient(e,new Dn((s,a,l)=>l()),i,!1)},this.options.maxLifetimeSeconds*1e3);n.unref(),e.once("end",()=>clearTimeout(n))}return this._acquireClient(e,r,i,!0)}_acquireClient(e,r,i,n){n&&this.emit("connect",e),this.emit("acquire",e),e.release=this._releaseOnce(e,i),e.removeListener("error",i),r.timedOut?n&&this.options.verify?this.options.verify(e,e.release):e.release():n&&this.options.verify?this.options.verify(e,o=>{if(o)return e.release(o),r.callback(o,void 0,ap);r.callback(void 0,e,e.release)}):r.callback(void 0,e,e.release)}_releaseOnce(e,r){let i=!1;return n=>{i&&HF(),i=!0,this._release(e,r,n)}}_release(e,r,i){if(e.on("error",r),e._poolUseCount=(e._poolUseCount||0)+1,this.emit("release",i,e),i||this.ending||!e._queryable||e._ending||e._poolUseCount>=this.options.maxUses)return e._poolUseCount>=this.options.maxUses&&this.log("remove expended client"),this._remove(e,this._pulseQueue.bind(this));if(this._expired.has(e))return this.log("remove expired client"),this._expired.delete(e),this._remove(e,this._pulseQueue.bind(this));let o;this.options.idleTimeoutMillis&&this._isAboveMin()&&(o=setTimeout(()=>{this._isAboveMin()&&(this.log("remove idle client"),this._remove(e,this._pulseQueue.bind(this)))},this.options.idleTimeoutMillis),this.options.allowExitOnIdle&&o.unref()),this.options.allowExitOnIdle&&e.unref(),this._idle.push(new lp(e,r,o)),this._pulseQueue()}query(e,r,i){if(typeof e=="function"){let o=il(this.Promise,e);return setImmediate(function(){return o.callback(new Error("Passing a function as the first parameter to pool.query is not supported"))}),o.result}typeof r=="function"&&(i=r,r=void 0);let n=il(this.Promise,i);return i=n.callback,this.connect((o,s)=>{if(o)return i(o);let a=!1,l=c=>{a||(a=!0,s.release(c),i(c))};s.once("error",l),this.log("dispatching query");try{s.query(e,r,(c,u)=>{if(this.log("query dispatched"),s.removeListener("error",l),!a)return a=!0,s.release(c),c?i(c):i(void 0,u)})}catch(c){return s.release(c),i(c)}}),n.result}end(e){if(this.log("ending"),this.ending){let i=new Error("Called end on pool more than once");return e?e(i):this.Promise.reject(i)}this.ending=!0;let r=il(this.Promise,e);return this._endCallback=r.callback,this._pulseQueue(),r.result}get waitingCount(){return this._pendingQueue.length}get idleCount(){return this._idle.length}get expiredCount(){return this._clients.reduce((e,r)=>e+(this._expired.has(r)?1:0),0)}get totalCount(){return this._clients.length}};VE.exports=cp});var WE=S((aee,JE)=>{"use strict";var QE=X("events").EventEmitter,XF=X("util"),dp=Pn(),Ln=JE.exports=function(t,e,r){QE.call(this),t=dp.normalizeQueryConfig(t,e,r),this.text=t.text,this.values=t.values,this.name=t.name,this.queryMode=t.queryMode,this.callback=t.callback,this.state="new",this._arrayMode=t.rowMode==="array",this._emitRowEvents=!1,this.on("newListener",function(i){i==="row"&&(this._emitRowEvents=!0)}.bind(this))};XF.inherits(Ln,QE);var eB={sqlState:"code",statementPosition:"position",messagePrimary:"message",context:"where",schemaName:"schema",tableName:"table",columnName:"column",dataTypeName:"dataType",constraintName:"constraint",sourceFile:"file",sourceLine:"line",sourceFunction:"routine"};Ln.prototype.handleError=function(t){let e=this.native.pq.resultErrorFields();if(e)for(let r in e){let i=eB[r]||r;t[i]=e[r]}this.callback?this.callback(t):this.emit("error",t),this.state="error"};Ln.prototype.then=function(t,e){return this._getPromise().then(t,e)};Ln.prototype.catch=function(t){return this._getPromise().catch(t)};Ln.prototype._getPromise=function(){return this._promise?this._promise:(this._promise=new Promise(function(t,e){this._once("end",t),this._once("error",e)}.bind(this)),this._promise)};Ln.prototype.submit=function(t){this.state="running";let e=this;this.native=t.native,t.native.arrayMode=this._arrayMode;let r=function(i,n,o){if(t.native.arrayMode=!1,setImmediate(function(){e.emit("_done")}),i)return e.handleError(i);e._emitRowEvents&&(o.length>1?n.forEach((s,a)=>{s.forEach(l=>{e.emit("row",l,o[a])})}):n.forEach(function(s){e.emit("row",s,o)})),e.state="end",e.emit("end",o),e.callback&&e.callback(null,o)};if(process.domain&&(r=process.domain.bind(r)),this.name){this.name.length>63&&(console.error("Warning! Postgres only supports 63 characters for query names."),console.error("You supplied %s (%s)",this.name,this.name.length),console.error("This can cause conflicts and silent errors executing queries"));let i=(this.values||[]).map(dp.prepareValue);if(t.namedQueries[this.name]){if(this.text&&t.namedQueries[this.name]!==this.text){let n=new Error(`Prepared statements must be unique - '${this.name}' was used for a different statement`);return r(n)}return t.native.execute(this.name,i,r)}return t.native.prepare(this.name,this.text,i.length,function(n){return n?r(n):(t.namedQueries[e.name]=e.text,e.native.execute(e.name,i,r))})}else if(this.values){if(!Array.isArray(this.values)){let n=new Error("Query values must be an array");return r(n)}let i=this.values.map(dp.prepareValue);t.native.query(this.text,i,r)}else this.queryMode==="extended"?t.native.query(this.text,[],r):t.native.query(this.text,r)}});var tI=S((lee,eI)=>{var tB=X("util"),HE;try{HE=X("pg-native")}catch(t){throw t}var rB=Ga(),YE=X("events").EventEmitter,nB=X("util"),iB=Im(),XE=WE(),oB=tB.deprecate(()=>{},"Calling client.query() when the client is already executing a query is deprecated and will be removed in pg@9.0. Use async/await or an external async flow control mechanism instead."),Re=eI.exports=function(t){YE.call(this),t=t||{},this._Promise=t.Promise||global.Promise,this._types=new rB(t.types),this.native=new HE({types:this._types}),this._queryQueue=[],this._ending=!1,this._connecting=!1,this._connected=!1,this._queryable=!0;let e=this.connectionParameters=new iB(t);t.nativeConnectionString&&(e.nativeConnectionString=t.nativeConnectionString),this.user=e.user,Object.defineProperty(this,"password",{configurable:!0,enumerable:!1,writable:!0,value:e.password}),this.database=e.database,this.host=e.host,this.port=e.port,this.namedQueries={}};Re.Query=XE;nB.inherits(Re,YE);Re.prototype._errorAllQueries=function(t){let e=r=>{process.nextTick(()=>{r.native=this.native,r.handleError(t)})};this._hasActiveQuery()&&(e(this._activeQuery),this._activeQuery=null),this._queryQueue.forEach(e),this._queryQueue.length=0};Re.prototype._connect=function(t){let e=this;if(this._connecting){process.nextTick(()=>t(new Error("Client has already been connected. You cannot reuse a client.")));return}this._connecting=!0,this.connectionParameters.getLibpqConnectionString(function(r,i){if(e.connectionParameters.nativeConnectionString&&(i=e.connectionParameters.nativeConnectionString),r)return t(r);e.native.connect(i,function(n){if(n)return e.native.end(),t(n);e._connected=!0,e.native.on("error",function(o){e._queryable=!1,e._errorAllQueries(o),e.emit("error",o)}),e.native.on("notification",function(o){e.emit("notification",{channel:o.relname,payload:o.extra})}),e.emit("connect"),e._pulseQueryQueue(!0),t(null,this)})})};Re.prototype.connect=function(t){if(t){this._connect(t);return}return new this._Promise((e,r)=>{this._connect(i=>{i?r(i):e(this)})})};Re.prototype.query=function(t,e,r){let i,n,o,s,a;if(t==null)throw new TypeError("Client was passed a null or undefined query");if(typeof t.submit=="function")o=t.query_timeout||this.connectionParameters.query_timeout,n=i=t,typeof e=="function"&&(t.callback=e);else if(o=t.query_timeout||this.connectionParameters.query_timeout,i=new XE(t,e,r),!i.callback){let l,c;n=new this._Promise((u,d)=>{l=u,c=d}).catch(u=>{throw Error.captureStackTrace(u),u}),i.callback=(u,d)=>u?c(u):l(d)}return o&&(a=i.callback||(()=>{}),s=setTimeout(()=>{let l=new Error("Query read timeout");process.nextTick(()=>{i.handleError(l,this.connection)}),a(l),i.callback=()=>{};let c=this._queryQueue.indexOf(i);c>-1&&this._queryQueue.splice(c,1),this._pulseQueryQueue()},o),i.callback=(l,c)=>{clearTimeout(s),a(l,c)}),this._queryable?this._ending?(i.native=this.native,process.nextTick(()=>{i.handleError(new Error("Client was closed and is not queryable"))}),n):(this._queryQueue.length>0&&oB(),this._queryQueue.push(i),this._pulseQueryQueue(),n):(i.native=this.native,process.nextTick(()=>{i.handleError(new Error("Client has encountered a connection error and is not queryable"))}),n)};Re.prototype.end=function(t){let e=this;this._ending=!0,this._connecting&&!this._connected&&this.once("connect",()=>{this.end(()=>{})});let r;return t||(r=new this._Promise(function(i,n){t=o=>o?n(o):i()})),this.native.end(function(){e._connected=!1,e._errorAllQueries(new Error("Connection terminated")),process.nextTick(()=>{e.emit("end"),t&&t()})}),r};Re.prototype._hasActiveQuery=function(){return this._activeQuery&&this._activeQuery.state!=="error"&&this._activeQuery.state!=="end"};Re.prototype._pulseQueryQueue=function(t){if(!this._connected||this._hasActiveQuery())return;let e=this._queryQueue.shift();if(!e){t||this.emit("drain");return}this._activeQuery=e,e.submit(this);let r=this;e.once("_done",function(){r._pulseQueryQueue()})};Re.prototype.cancel=function(t){this._activeQuery===t?this.native.cancel(function(){}):this._queryQueue.indexOf(t)!==-1&&this._queryQueue.splice(this._queryQueue.indexOf(t),1)};Re.prototype.ref=function(){};Re.prototype.unref=function(){};Re.prototype.setTypeParser=function(t,e,r){return this._types.setTypeParser(t,e,r)};Re.prototype.getTypeParser=function(t,e){return this._types.getTypeParser(t,e)};Re.prototype.isConnected=function(){return this._connected};Re.prototype.getTransactionStatus=function(){return this.native.getTransactionStatus()}});var fp=S((cee,rI)=>{"use strict";rI.exports=tI()});var up=S((dee,ol)=>{"use strict";var sB=ZE(),aB=vo(),lB=np(),cB=Pm(),uB=Pn(),dB=GE(),fB=Ga(),{DatabaseError:mB}=ep(),{escapeIdentifier:pB,escapeLiteral:hB}=Pn(),gB=t=>class extends dB{constructor(r){super(r,t)}},nI=function(t){this.defaults=aB,this.Client=t,this.Query=this.Client.Query,this.Pool=gB(this.Client),this._pools=[],this.Connection=lB,this.types=yo(),this.DatabaseError=mB,this.TypeOverrides=fB,this.escapeIdentifier=pB,this.escapeLiteral=hB,this.Result=cB,this.utils=uB},iI=sB,oI=!1;try{oI=!!process.env.NODE_PG_FORCE_NATIVE}catch{}oI&&(iI=fp());ol.exports=new nI(iI);Object.defineProperty(ol.exports,"native",{configurable:!0,enumerable:!1,get(){let t=null;try{t=new nI(fp())}catch(e){if(e.code!=="MODULE_NOT_FOUND")throw e}return Object.defineProperty(ol.exports,"native",{value:t}),t}})});var Y=S(Ne=>{"use strict";var mp=Symbol.for("yaml.alias"),aI=Symbol.for("yaml.document"),sl=Symbol.for("yaml.map"),lI=Symbol.for("yaml.pair"),pp=Symbol.for("yaml.scalar"),al=Symbol.for("yaml.seq"),Kt=Symbol.for("yaml.node.type"),yB=t=>!!t&&typeof t=="object"&&t[Kt]===mp,vB=t=>!!t&&typeof t=="object"&&t[Kt]===aI,bB=t=>!!t&&typeof t=="object"&&t[Kt]===sl,wB=t=>!!t&&typeof t=="object"&&t[Kt]===lI,cI=t=>!!t&&typeof t=="object"&&t[Kt]===pp,SB=t=>!!t&&typeof t=="object"&&t[Kt]===al;function uI(t){if(t&&typeof t=="object")switch(t[Kt]){case sl:case al:return!0}return!1}function xB(t){if(t&&typeof t=="object")switch(t[Kt]){case mp:case sl:case pp:case al:return!0}return!1}var _B=t=>(cI(t)||uI(t))&&!!t.anchor;Ne.ALIAS=mp;Ne.DOC=aI;Ne.MAP=sl;Ne.NODE_TYPE=Kt;Ne.PAIR=lI;Ne.SCALAR=pp;Ne.SEQ=al;Ne.hasAnchor=_B;Ne.isAlias=yB;Ne.isCollection=uI;Ne.isDocument=vB;Ne.isMap=bB;Ne.isNode=xB;Ne.isPair=wB;Ne.isScalar=cI;Ne.isSeq=SB});var xo=S(hp=>{"use strict";var Ee=Y(),Ve=Symbol("break visit"),dI=Symbol("skip children"),Ot=Symbol("remove node");function ll(t,e){let r=fI(e);Ee.isDocument(t)?jn(null,t.contents,r,Object.freeze([t]))===Ot&&(t.contents=null):jn(null,t,r,Object.freeze([]))}ll.BREAK=Ve;ll.SKIP=dI;ll.REMOVE=Ot;function jn(t,e,r,i){let n=mI(t,e,r,i);if(Ee.isNode(n)||Ee.isPair(n))return pI(t,i,n),jn(t,n,r,i);if(typeof n!="symbol"){if(Ee.isCollection(e)){i=Object.freeze(i.concat(e));for(let o=0;o<e.items.length;++o){let s=jn(o,e.items[o],r,i);if(typeof s=="number")o=s-1;else{if(s===Ve)return Ve;s===Ot&&(e.items.splice(o,1),o-=1)}}}else if(Ee.isPair(e)){i=Object.freeze(i.concat(e));let o=jn("key",e.key,r,i);if(o===Ve)return Ve;o===Ot&&(e.key=null);let s=jn("value",e.value,r,i);if(s===Ve)return Ve;s===Ot&&(e.value=null)}}return n}async function cl(t,e){let r=fI(e);Ee.isDocument(t)?await Un(null,t.contents,r,Object.freeze([t]))===Ot&&(t.contents=null):await Un(null,t,r,Object.freeze([]))}cl.BREAK=Ve;cl.SKIP=dI;cl.REMOVE=Ot;async function Un(t,e,r,i){let n=await mI(t,e,r,i);if(Ee.isNode(n)||Ee.isPair(n))return pI(t,i,n),Un(t,n,r,i);if(typeof n!="symbol"){if(Ee.isCollection(e)){i=Object.freeze(i.concat(e));for(let o=0;o<e.items.length;++o){let s=await Un(o,e.items[o],r,i);if(typeof s=="number")o=s-1;else{if(s===Ve)return Ve;s===Ot&&(e.items.splice(o,1),o-=1)}}}else if(Ee.isPair(e)){i=Object.freeze(i.concat(e));let o=await Un("key",e.key,r,i);if(o===Ve)return Ve;o===Ot&&(e.key=null);let s=await Un("value",e.value,r,i);if(s===Ve)return Ve;s===Ot&&(e.value=null)}}return n}function fI(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function mI(t,e,r,i){if(typeof r=="function")return r(t,e,i);if(Ee.isMap(e))return r.Map?.(t,e,i);if(Ee.isSeq(e))return r.Seq?.(t,e,i);if(Ee.isPair(e))return r.Pair?.(t,e,i);if(Ee.isScalar(e))return r.Scalar?.(t,e,i);if(Ee.isAlias(e))return r.Alias?.(t,e,i)}function pI(t,e,r){let i=e[e.length-1];if(Ee.isCollection(i))i.items[t]=r;else if(Ee.isPair(i))t==="key"?i.key=r:i.value=r;else if(Ee.isDocument(i))i.contents=r;else{let n=Ee.isAlias(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${n} parent`)}}hp.visit=ll;hp.visitAsync=cl});var gp=S(gI=>{"use strict";var hI=Y(),$B=xo(),kB={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},TB=t=>t.replace(/[!,[\]{}]/g,e=>kB[e]),_o=class t{constructor(e,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,r)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,r){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let i=e.trim().split(/[ \t]+/),n=i.shift();switch(n){case"%TAG":{if(i.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;let[o,s]=i;return this.tags[o]=s,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[o]=i;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{let s=/^\d+\.\d+$/.test(o);return r(6,`Unsupported YAML version ${o}`,s),!1}}default:return r(0,`Unknown directive ${n}`,!0),!1}}tagName(e,r){if(e==="!")return"!";if(e[0]!=="!")return r(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let s=e.slice(2,-1);return s==="!"||s==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),s)}let[,i,n]=e.match(/^(.*!)([^!]*)$/s);n||r(`The ${e} tag has no suffix`);let o=this.tags[i];if(o)try{return o+decodeURIComponent(n)}catch(s){return r(String(s)),null}return i==="!"?e:(r(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[r,i]of Object.entries(this.tags))if(e.startsWith(i))return r+TB(e.substring(i.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags),n;if(e&&i.length>0&&hI.isNode(e.contents)){let o={};$B.visit(e.contents,(s,a)=>{hI.isNode(a)&&a.tag&&(o[a.tag]=!0)}),n=Object.keys(o)}else n=[];for(let[o,s]of i)o==="!!"&&s==="tag:yaml.org,2002:"||(!e||n.some(a=>a.startsWith(s)))&&r.push(`%TAG ${o} ${s}`);return r.join(`
|
|
43
|
-
`)}};_o.defaultYaml={explicit:!1,version:"1.2"};_o.defaultTags={"!!":"tag:yaml.org,2002:"};gI.Directives=_o});var ul=S($o=>{"use strict";var yI=Y(),EB=xo();function IB(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(r)}return!0}function vI(t){let e=new Set;return EB.visit(t,{Value(r,i){i.anchor&&e.add(i.anchor)}}),e}function bI(t,e){for(let r=1;;++r){let i=`${t}${r}`;if(!e.has(i))return i}}function CB(t,e){let r=[],i=new Map,n=null;return{onAnchor:o=>{r.push(o),n??(n=vI(t));let s=bI(e,n);return n.add(s),s},setAnchors:()=>{for(let o of r){let s=i.get(o);if(typeof s=="object"&&s.anchor&&(yI.isScalar(s.node)||yI.isCollection(s.node)))s.node.anchor=s.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=o,a}}},sourceObjects:i}}$o.anchorIsValid=IB;$o.anchorNames=vI;$o.createNodeAnchors=CB;$o.findNewAnchor=bI});var yp=S(wI=>{"use strict";function ko(t,e,r,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let n=0,o=i.length;n<o;++n){let s=i[n],a=ko(t,i,String(n),s);a===void 0?delete i[n]:a!==s&&(i[n]=a)}else if(i instanceof Map)for(let n of Array.from(i.keys())){let o=i.get(n),s=ko(t,i,n,o);s===void 0?i.delete(n):s!==o&&i.set(n,s)}else if(i instanceof Set)for(let n of Array.from(i)){let o=ko(t,i,n,n);o===void 0?i.delete(n):o!==n&&(i.delete(n),i.add(o))}else for(let[n,o]of Object.entries(i)){let s=ko(t,i,n,o);s===void 0?delete i[n]:s!==o&&(i[n]=s)}return t.call(e,r,i)}wI.applyReviver=ko});var pr=S(xI=>{"use strict";var PB=Y();function SI(t,e,r){if(Array.isArray(t))return t.map((i,n)=>SI(i,String(n),r));if(t&&typeof t.toJSON=="function"){if(!r||!PB.hasAnchor(t))return t.toJSON(e,r);let i={aliasCount:0,count:1,res:void 0};r.anchors.set(t,i),r.onCreate=o=>{i.res=o,delete r.onCreate};let n=t.toJSON(e,r);return r.onCreate&&r.onCreate(n),n}return typeof t=="bigint"&&!r?.keep?Number(t):t}xI.toJS=SI});var dl=S($I=>{"use strict";var NB=yp(),_I=Y(),OB=pr(),vp=class{constructor(e){Object.defineProperty(this,_I.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:r,maxAliasCount:i,onAnchor:n,reviver:o}={}){if(!_I.isDocument(e))throw new TypeError("A document argument is required");let s={anchors:new Map,doc:e,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},a=OB.toJS(this,"",s);if(typeof n=="function")for(let{count:l,res:c}of s.anchors.values())n(c,l);return typeof o=="function"?NB.applyReviver(o,{"":a},"",a):a}};$I.NodeBase=vp});var To=S(kI=>{"use strict";var AB=ul(),RB=xo(),Mn=Y(),DB=dl(),LB=pr(),bp=class extends DB.NodeBase{constructor(e){super(Mn.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,r){let i;r?.aliasResolveCache?i=r.aliasResolveCache:(i=[],RB.visit(e,{Node:(o,s)=>{(Mn.isAlias(s)||Mn.hasAnchor(s))&&i.push(s)}}),r&&(r.aliasResolveCache=i));let n;for(let o of i){if(o===this)break;o.anchor===this.source&&(n=o)}return n}toJSON(e,r){if(!r)return{source:this.source};let{anchors:i,doc:n,maxAliasCount:o}=r,s=this.resolve(n,r);if(!s){let l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let a=i.get(s);if(a||(LB.toJS(s,null,r),a=i.get(s)),a?.res===void 0){let l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(o>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=fl(n,s,i)),a.count*a.aliasCount>o)){let l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return a.res}toString(e,r,i){let n=`*${this.source}`;if(e){if(AB.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(e.implicitKey)return`${n} `}return n}};function fl(t,e,r){if(Mn.isAlias(e)){let i=e.resolve(t),n=r&&i&&r.get(i);return n?n.count*n.aliasCount:0}else if(Mn.isCollection(e)){let i=0;for(let n of e.items){let o=fl(t,n,r);o>i&&(i=o)}return i}else if(Mn.isPair(e)){let i=fl(t,e.key,r),n=fl(t,e.value,r);return Math.max(i,n)}return 1}kI.Alias=bp});var xe=S(wp=>{"use strict";var zB=Y(),jB=dl(),UB=pr(),MB=t=>!t||typeof t!="function"&&typeof t!="object",hr=class extends jB.NodeBase{constructor(e){super(zB.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:UB.toJS(this.value,e,r)}toString(){return String(this.value)}};hr.BLOCK_FOLDED="BLOCK_FOLDED";hr.BLOCK_LITERAL="BLOCK_LITERAL";hr.PLAIN="PLAIN";hr.QUOTE_DOUBLE="QUOTE_DOUBLE";hr.QUOTE_SINGLE="QUOTE_SINGLE";wp.Scalar=hr;wp.isScalarValue=MB});var Eo=S(EI=>{"use strict";var qB=To(),Vr=Y(),TI=xe(),FB="tag:yaml.org,2002:";function BB(t,e,r){if(e){let i=r.filter(o=>o.tag===e),n=i.find(o=>!o.format)??i[0];if(!n)throw new Error(`Tag ${e} not found`);return n}return r.find(i=>i.identify?.(t)&&!i.format)}function ZB(t,e,r){if(Vr.isDocument(t)&&(t=t.contents),Vr.isNode(t))return t;if(Vr.isPair(t)){let d=r.schema[Vr.MAP].createNode?.(r.schema,null,r);return d.items.push(t),d}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:i,onAnchor:n,onTagObj:o,schema:s,sourceObjects:a}=r,l;if(i&&t&&typeof t=="object"){if(l=a.get(t),l)return l.anchor??(l.anchor=n(t)),new qB.Alias(l.anchor);l={anchor:null,node:null},a.set(t,l)}e?.startsWith("!!")&&(e=FB+e.slice(2));let c=BB(t,e,s.tags);if(!c){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let d=new TI.Scalar(t);return l&&(l.node=d),d}c=t instanceof Map?s[Vr.MAP]:Symbol.iterator in Object(t)?s[Vr.SEQ]:s[Vr.MAP]}o&&(o(c),delete r.onTagObj);let u=c?.createNode?c.createNode(r.schema,t,r):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(r.schema,t,r):new TI.Scalar(t);return e?u.tag=e:c.default||(u.tag=c.tag),l&&(l.node=u),u}EI.createNode=ZB});var pl=S(ml=>{"use strict";var KB=Eo(),At=Y(),VB=dl();function Sp(t,e,r){let i=r;for(let n=e.length-1;n>=0;--n){let o=e[n];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){let s=[];s[o]=i,i=s}else i=new Map([[o,i]])}return KB.createNode(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var II=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,xp=class extends VB.NodeBase{constructor(e,r){super(e),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(e){let r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(r.schema=e),r.items=r.items.map(i=>At.isNode(i)||At.isPair(i)?i.clone(e):i),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(II(e))this.add(r);else{let[i,...n]=e,o=this.get(i,!0);if(At.isCollection(o))o.addIn(n,r);else if(o===void 0&&this.schema)this.set(i,Sp(this.schema,n,r));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${n}`)}}deleteIn(e){let[r,...i]=e;if(i.length===0)return this.delete(r);let n=this.get(r,!0);if(At.isCollection(n))return n.deleteIn(i);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}getIn(e,r){let[i,...n]=e,o=this.get(i,!0);return n.length===0?!r&&At.isScalar(o)?o.value:o:At.isCollection(o)?o.getIn(n,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!At.isPair(r))return!1;let i=r.value;return i==null||e&&At.isScalar(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(e){let[r,...i]=e;if(i.length===0)return this.has(r);let n=this.get(r,!0);return At.isCollection(n)?n.hasIn(i):!1}setIn(e,r){let[i,...n]=e;if(n.length===0)this.set(i,r);else{let o=this.get(i,!0);if(At.isCollection(o))o.setIn(n,r);else if(o===void 0&&this.schema)this.set(i,Sp(this.schema,n,r));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${n}`)}}};ml.Collection=xp;ml.collectionFromPath=Sp;ml.isEmptyPath=II});var Io=S(hl=>{"use strict";var GB=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function _p(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var QB=(t,e,r)=>t.endsWith(`
|
|
44
|
-
`)?_p(r,e):r.includes(`
|
|
45
|
-
`)?`
|
|
46
|
-
`+_p(r,e):(t.endsWith(" ")?"":" ")+r;hl.indentComment=_p;hl.lineComment=QB;hl.stringifyComment=GB});var PI=S(Co=>{"use strict";var JB="flow",$p="block",gl="quoted";function WB(t,e,r="flow",{indentAtStart:i,lineWidth:n=80,minContentWidth:o=20,onFold:s,onOverflow:a}={}){if(!n||n<0)return t;n<o&&(o=0);let l=Math.max(1+o,1+n-e.length);if(t.length<=l)return t;let c=[],u={},d=n-e.length;typeof i=="number"&&(i>n-Math.max(2,o)?c.push(0):d=n-i);let f,m,y=!1,h=-1,w=-1,_=-1;r===$p&&(h=CI(t,h,e.length),h!==-1&&(d=h+l));for(let k;k=t[h+=1];){if(r===gl&&k==="\\"){switch(w=h,t[h+1]){case"x":h+=3;break;case"u":h+=5;break;case"U":h+=9;break;default:h+=1}_=h}if(k===`
|
|
47
|
-
`)r===$p&&(h=CI(t,h,e.length)),d=h+e.length+l,f=void 0;else{if(k===" "&&m&&m!==" "&&m!==`
|
|
48
|
-
`&&m!==" "){let E=t[h+1];E&&E!==" "&&E!==`
|
|
49
|
-
`&&E!==" "&&(f=h)}if(h>=d)if(f)c.push(f),d=f+l,f=void 0;else if(r===gl){for(;m===" "||m===" ";)m=k,k=t[h+=1],y=!0;let E=h>_+1?h-2:w-1;if(u[E])return t;c.push(E),u[E]=!0,d=E+l,f=void 0}else y=!0}m=k}if(y&&a&&a(),c.length===0)return t;s&&s();let T=t.slice(0,c[0]);for(let k=0;k<c.length;++k){let E=c[k],R=c[k+1]||t.length;E===0?T=`
|
|
50
|
-
${e}${t.slice(0,R)}`:(r===gl&&u[E]&&(T+=`${t[E]}\\`),T+=`
|
|
51
|
-
${e}${t.slice(E+1,R)}`)}return T}function CI(t,e,r){let i=e,n=e+1,o=t[n];for(;o===" "||o===" ";)if(e<n+r)o=t[++e];else{do o=t[++e];while(o&&o!==`
|
|
52
|
-
`);i=e,n=e+1,o=t[n]}return i}Co.FOLD_BLOCK=$p;Co.FOLD_FLOW=JB;Co.FOLD_QUOTED=gl;Co.foldFlowLines=WB});var No=S(NI=>{"use strict";var $t=xe(),gr=PI(),vl=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),bl=t=>/^(%|---|\.\.\.)/m.test(t);function HB(t,e,r){if(!e||e<0)return!1;let i=e-r,n=t.length;if(n<=i)return!1;for(let o=0,s=0;o<n;++o)if(t[o]===`
|
|
53
|
-
`){if(o-s>i)return!0;if(s=o+1,n-s<=i)return!1}return!0}function Po(t,e){let r=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return r;let{implicitKey:i}=e,n=e.options.doubleQuotedMinMultiLineLength,o=e.indent||(bl(t)?" ":""),s="",a=0;for(let l=0,c=r[l];c;c=r[++l])if(c===" "&&r[l+1]==="\\"&&r[l+2]==="n"&&(s+=r.slice(a,l)+"\\ ",l+=1,a=l,c="\\"),c==="\\")switch(r[l+1]){case"u":{s+=r.slice(a,l);let u=r.substr(l+2,4);switch(u){case"0000":s+="\\0";break;case"0007":s+="\\a";break;case"000b":s+="\\v";break;case"001b":s+="\\e";break;case"0085":s+="\\N";break;case"00a0":s+="\\_";break;case"2028":s+="\\L";break;case"2029":s+="\\P";break;default:u.substr(0,2)==="00"?s+="\\x"+u.substr(2):s+=r.substr(l,6)}l+=5,a=l+1}break;case"n":if(i||r[l+2]==='"'||r.length<n)l+=1;else{for(s+=r.slice(a,l)+`
|
|
54
|
-
|
|
55
|
-
`;r[l+2]==="\\"&&r[l+3]==="n"&&r[l+4]!=='"';)s+=`
|
|
56
|
-
`,l+=2;s+=o,r[l+2]===" "&&(s+="\\"),l+=1,a=l+1}break;default:l+=1}return s=a?s+r.slice(a):r,i?s:gr.foldFlowLines(s,o,gr.FOLD_QUOTED,vl(e,!1))}function kp(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
|
|
57
|
-
`)||/[ \t]\n|\n[ \t]/.test(t))return Po(t,e);let r=e.indent||(bl(t)?" ":""),i="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
58
|
-
${r}`)+"'";return e.implicitKey?i:gr.foldFlowLines(i,r,gr.FOLD_FLOW,vl(e,!1))}function qn(t,e){let{singleQuote:r}=e.options,i;if(r===!1)i=Po;else{let n=t.includes('"'),o=t.includes("'");n&&!o?i=kp:o&&!n?i=Po:i=r?kp:Po}return i(t,e)}var Tp;try{Tp=new RegExp(`(^|(?<!
|
|
59
|
-
))
|
|
60
|
-
+(?!
|
|
61
|
-
|$)`,"g")}catch{Tp=/\n+(?!\n|$)/g}function yl({comment:t,type:e,value:r},i,n,o){let{blockQuote:s,commentString:a,lineWidth:l}=i.options;if(!s||/\n[\t ]+$/.test(r))return qn(r,i);let c=i.indent||(i.forceBlockIndent||bl(r)?" ":""),u=s==="literal"?!0:s==="folded"||e===$t.Scalar.BLOCK_FOLDED?!1:e===$t.Scalar.BLOCK_LITERAL?!0:!HB(r,l,c.length);if(!r)return u?`|
|
|
62
|
-
`:`>
|
|
63
|
-
`;let d,f;for(f=r.length;f>0;--f){let R=r[f-1];if(R!==`
|
|
64
|
-
`&&R!==" "&&R!==" ")break}let m=r.substring(f),y=m.indexOf(`
|
|
65
|
-
`);y===-1?d="-":r===m||y!==m.length-1?(d="+",o&&o()):d="",m&&(r=r.slice(0,-m.length),m[m.length-1]===`
|
|
66
|
-
`&&(m=m.slice(0,-1)),m=m.replace(Tp,`$&${c}`));let h=!1,w,_=-1;for(w=0;w<r.length;++w){let R=r[w];if(R===" ")h=!0;else if(R===`
|
|
67
|
-
`)_=w;else break}let T=r.substring(0,_<w?_+1:w);T&&(r=r.substring(T.length),T=T.replace(/\n+/g,`$&${c}`));let E=(h?c?"2":"1":"")+d;if(t&&(E+=" "+a(t.replace(/ ?[\r\n]+/g," ")),n&&n()),!u){let R=r.replace(/\n+/g,`
|
|
68
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`),L=!1,U=vl(i,!0);s!=="folded"&&e!==$t.Scalar.BLOCK_FOLDED&&(U.onOverflow=()=>{L=!0});let I=gr.foldFlowLines(`${T}${R}${m}`,c,gr.FOLD_BLOCK,U);if(!L)return`>${E}
|
|
69
|
-
${c}${I}`}return r=r.replace(/\n+/g,`$&${c}`),`|${E}
|
|
70
|
-
${c}${T}${r}${m}`}function YB(t,e,r,i){let{type:n,value:o}=t,{actualString:s,implicitKey:a,indent:l,indentStep:c,inFlow:u}=e;if(a&&o.includes(`
|
|
71
|
-
`)||u&&/[[\]{},]/.test(o))return qn(o,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return a||u||!o.includes(`
|
|
72
|
-
`)?qn(o,e):yl(t,e,r,i);if(!a&&!u&&n!==$t.Scalar.PLAIN&&o.includes(`
|
|
73
|
-
`))return yl(t,e,r,i);if(bl(o)){if(l==="")return e.forceBlockIndent=!0,yl(t,e,r,i);if(a&&l===c)return qn(o,e)}let d=o.replace(/\n+/g,`$&
|
|
74
|
-
${l}`);if(s){let f=h=>h.default&&h.tag!=="tag:yaml.org,2002:str"&&h.test?.test(d),{compat:m,tags:y}=e.doc.schema;if(y.some(f)||m?.some(f))return qn(o,e)}return a?d:gr.foldFlowLines(d,l,gr.FOLD_FLOW,vl(e,!1))}function XB(t,e,r,i){let{implicitKey:n,inFlow:o}=e,s=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:a}=t;a!==$t.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value)&&(a=$t.Scalar.QUOTE_DOUBLE);let l=u=>{switch(u){case $t.Scalar.BLOCK_FOLDED:case $t.Scalar.BLOCK_LITERAL:return n||o?qn(s.value,e):yl(s,e,r,i);case $t.Scalar.QUOTE_DOUBLE:return Po(s.value,e);case $t.Scalar.QUOTE_SINGLE:return kp(s.value,e);case $t.Scalar.PLAIN:return YB(s,e,r,i);default:return null}},c=l(a);if(c===null){let{defaultKeyType:u,defaultStringType:d}=e.options,f=n&&u||d;if(c=l(f),c===null)throw new Error(`Unsupported default string type ${f}`)}return c}NI.stringifyString=XB});var Oo=S(Ep=>{"use strict";var e9=ul(),yr=Y(),t9=Io(),r9=No();function n9(t,e){let r=Object.assign({blockQuote:!0,commentString:t9.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),i;switch(r.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:t,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent=="number"?" ".repeat(r.indent):" ",inFlow:i,options:r}}function i9(t,e){if(e.tag){let n=t.filter(o=>o.tag===e.tag);if(n.length>0)return n.find(o=>o.format===e.format)??n[0]}let r,i;if(yr.isScalar(e)){i=e.value;let n=t.filter(o=>o.identify?.(i));if(n.length>1){let o=n.filter(s=>s.test);o.length>0&&(n=o)}r=n.find(o=>o.format===e.format)??n.find(o=>!o.format)}else i=e,r=t.find(n=>n.nodeClass&&i instanceof n.nodeClass);if(!r){let n=i?.constructor?.name??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${n} value`)}return r}function o9(t,e,{anchors:r,doc:i}){if(!i.directives)return"";let n=[],o=(yr.isScalar(t)||yr.isCollection(t))&&t.anchor;o&&e9.anchorIsValid(o)&&(r.add(o),n.push(`&${o}`));let s=t.tag??(e.default?null:e.tag);return s&&n.push(i.directives.tagString(s)),n.join(" ")}function s9(t,e,r,i){if(yr.isPair(t))return t.toString(e,r,i);if(yr.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let n,o=yr.isNode(t)?t:e.doc.createNode(t,{onTagObj:l=>n=l});n??(n=i9(e.doc.schema.tags,o));let s=o9(o,n,e);s.length>0&&(e.indentAtStart=(e.indentAtStart??0)+s.length+1);let a=typeof n.stringify=="function"?n.stringify(o,e,r,i):yr.isScalar(o)?r9.stringifyString(o,e,r,i):o.toString(e,r,i);return s?yr.isScalar(o)||a[0]==="{"||a[0]==="["?`${s} ${a}`:`${s}
|
|
75
|
-
${e.indent}${a}`:a}Ep.createStringifyContext=n9;Ep.stringify=s9});var DI=S(RI=>{"use strict";var Vt=Y(),OI=xe(),AI=Oo(),Ao=Io();function a9({key:t,value:e},r,i,n){let{allNullValues:o,doc:s,indent:a,indentStep:l,options:{commentString:c,indentSeq:u,simpleKeys:d}}=r,f=Vt.isNode(t)&&t.comment||null;if(d){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(Vt.isCollection(t)||!Vt.isNode(t)&&typeof t=="object"){let U="With simple keys, collection cannot be used as a key value";throw new Error(U)}}let m=!d&&(!t||f&&e==null&&!r.inFlow||Vt.isCollection(t)||(Vt.isScalar(t)?t.type===OI.Scalar.BLOCK_FOLDED||t.type===OI.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!m&&(d||!o),indent:a+l});let y=!1,h=!1,w=AI.stringify(t,r,()=>y=!0,()=>h=!0);if(!m&&!r.inFlow&&w.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(r.inFlow){if(o||e==null)return y&&i&&i(),w===""?"?":m?`? ${w}`:w}else if(o&&!d||e==null&&m)return w=`? ${w}`,f&&!y?w+=Ao.lineComment(w,r.indent,c(f)):h&&n&&n(),w;y&&(f=null),m?(f&&(w+=Ao.lineComment(w,r.indent,c(f))),w=`? ${w}
|
|
76
|
-
${a}:`):(w=`${w}:`,f&&(w+=Ao.lineComment(w,r.indent,c(f))));let _,T,k;Vt.isNode(e)?(_=!!e.spaceBefore,T=e.commentBefore,k=e.comment):(_=!1,T=null,k=null,e&&typeof e=="object"&&(e=s.createNode(e))),r.implicitKey=!1,!m&&!f&&Vt.isScalar(e)&&(r.indentAtStart=w.length+1),h=!1,!u&&l.length>=2&&!r.inFlow&&!m&&Vt.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let E=!1,R=AI.stringify(e,r,()=>E=!0,()=>h=!0),L=" ";if(f||_||T){if(L=_?`
|
|
77
|
-
`:"",T){let U=c(T);L+=`
|
|
78
|
-
${Ao.indentComment(U,r.indent)}`}R===""&&!r.inFlow?L===`
|
|
79
|
-
`&&k&&(L=`
|
|
80
|
-
|
|
81
|
-
`):L+=`
|
|
82
|
-
${r.indent}`}else if(!m&&Vt.isCollection(e)){let U=R[0],I=R.indexOf(`
|
|
83
|
-
`),G=I!==-1,Se=r.inFlow??e.flow??e.items.length===0;if(G||!Se){let ct=!1;if(G&&(U==="&"||U==="!")){let ae=R.indexOf(" ");U==="&"&&ae!==-1&&ae<I&&R[ae+1]==="!"&&(ae=R.indexOf(" ",ae+1)),(ae===-1||I<ae)&&(ct=!0)}ct||(L=`
|
|
84
|
-
${r.indent}`)}}else(R===""||R[0]===`
|
|
85
|
-
`)&&(L="");return w+=L+R,r.inFlow?E&&i&&i():k&&!E?w+=Ao.lineComment(w,r.indent,c(k)):h&&n&&n(),w}RI.stringifyPair=a9});var Cp=S(Ip=>{"use strict";var LI=X("process");function l9(t,...e){t==="debug"&&console.log(...e)}function c9(t,e){(t==="debug"||t==="warn")&&(typeof LI.emitWarning=="function"?LI.emitWarning(e):console.warn(e))}Ip.debug=l9;Ip.warn=c9});var _l=S(xl=>{"use strict";var Ro=Y(),zI=xe(),wl="<<",Sl={identify:t=>t===wl||typeof t=="symbol"&&t.description===wl,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new zI.Scalar(Symbol(wl)),{addToJSMap:jI}),stringify:()=>wl},u9=(t,e)=>(Sl.identify(e)||Ro.isScalar(e)&&(!e.type||e.type===zI.Scalar.PLAIN)&&Sl.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===Sl.tag&&r.default);function jI(t,e,r){if(r=t&&Ro.isAlias(r)?r.resolve(t.doc):r,Ro.isSeq(r))for(let i of r.items)Pp(t,e,i);else if(Array.isArray(r))for(let i of r)Pp(t,e,i);else Pp(t,e,r)}function Pp(t,e,r){let i=t&&Ro.isAlias(r)?r.resolve(t.doc):r;if(!Ro.isMap(i))throw new Error("Merge sources must be maps or map aliases");let n=i.toJSON(null,t,Map);for(let[o,s]of n)e instanceof Map?e.has(o)||e.set(o,s):e instanceof Set?e.add(o):Object.prototype.hasOwnProperty.call(e,o)||Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0});return e}xl.addMergeToJSMap=jI;xl.isMergeKey=u9;xl.merge=Sl});var Op=S(qI=>{"use strict";var d9=Cp(),UI=_l(),f9=Oo(),MI=Y(),Np=pr();function m9(t,e,{key:r,value:i}){if(MI.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,i);else if(UI.isMergeKey(t,r))UI.addMergeToJSMap(t,e,i);else{let n=Np.toJS(r,"",t);if(e instanceof Map)e.set(n,Np.toJS(i,n,t));else if(e instanceof Set)e.add(n);else{let o=p9(r,n,t),s=Np.toJS(i,o,t);o in e?Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0}):e[o]=s}}return e}function p9(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(MI.isNode(t)&&r?.doc){let i=f9.createStringifyContext(r.doc,{});i.anchors=new Set;for(let o of r.anchors.keys())i.anchors.add(o.anchor);i.inFlow=!0,i.inStringifyKey=!0;let n=t.toString(i);if(!r.mapKeyWarned){let o=JSON.stringify(n);o.length>40&&(o=o.substring(0,36)+'..."'),d9.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return n}return JSON.stringify(e)}qI.addPairToJSMap=m9});var vr=S(Ap=>{"use strict";var FI=Eo(),h9=DI(),g9=Op(),$l=Y();function y9(t,e,r){let i=FI.createNode(t,void 0,r),n=FI.createNode(e,void 0,r);return new kl(i,n)}var kl=class t{constructor(e,r=null){Object.defineProperty(this,$l.NODE_TYPE,{value:$l.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:i}=this;return $l.isNode(r)&&(r=r.clone(e)),$l.isNode(i)&&(i=i.clone(e)),new t(r,i)}toJSON(e,r){let i=r?.mapAsMap?new Map:{};return g9.addPairToJSMap(r,i,this)}toString(e,r,i){return e?.doc?h9.stringifyPair(this,e,r,i):JSON.stringify(this)}};Ap.Pair=kl;Ap.createPair=y9});var Rp=S(ZI=>{"use strict";var Gr=Y(),BI=Oo(),Tl=Io();function v9(t,e,r){return(e.inFlow??t.flow?w9:b9)(t,e,r)}function b9({comment:t,items:e},r,{blockItemPrefix:i,flowChars:n,itemIndent:o,onChompKeep:s,onComment:a}){let{indent:l,options:{commentString:c}}=r,u=Object.assign({},r,{indent:o,type:null}),d=!1,f=[];for(let y=0;y<e.length;++y){let h=e[y],w=null;if(Gr.isNode(h))!d&&h.spaceBefore&&f.push(""),El(r,f,h.commentBefore,d),h.comment&&(w=h.comment);else if(Gr.isPair(h)){let T=Gr.isNode(h.key)?h.key:null;T&&(!d&&T.spaceBefore&&f.push(""),El(r,f,T.commentBefore,d))}d=!1;let _=BI.stringify(h,u,()=>w=null,()=>d=!0);w&&(_+=Tl.lineComment(_,o,c(w))),d&&w&&(d=!1),f.push(i+_)}let m;if(f.length===0)m=n.start+n.end;else{m=f[0];for(let y=1;y<f.length;++y){let h=f[y];m+=h?`
|
|
86
|
-
${l}${h}`:`
|
|
87
|
-
`}}return t?(m+=`
|
|
88
|
-
`+Tl.indentComment(c(t),l),a&&a()):d&&s&&s(),m}function w9({items:t},e,{flowChars:r,itemIndent:i}){let{indent:n,indentStep:o,flowCollectionPadding:s,options:{commentString:a}}=e;i+=o;let l=Object.assign({},e,{indent:i,inFlow:!0,type:null}),c=!1,u=0,d=[];for(let y=0;y<t.length;++y){let h=t[y],w=null;if(Gr.isNode(h))h.spaceBefore&&d.push(""),El(e,d,h.commentBefore,!1),h.comment&&(w=h.comment);else if(Gr.isPair(h)){let T=Gr.isNode(h.key)?h.key:null;T&&(T.spaceBefore&&d.push(""),El(e,d,T.commentBefore,!1),T.comment&&(c=!0));let k=Gr.isNode(h.value)?h.value:null;k?(k.comment&&(w=k.comment),k.commentBefore&&(c=!0)):h.value==null&&T?.comment&&(w=T.comment)}w&&(c=!0);let _=BI.stringify(h,l,()=>w=null);y<t.length-1&&(_+=","),w&&(_+=Tl.lineComment(_,i,a(w))),!c&&(d.length>u||_.includes(`
|
|
89
|
-
`))&&(c=!0),d.push(_),u=d.length}let{start:f,end:m}=r;if(d.length===0)return f+m;if(!c){let y=d.reduce((h,w)=>h+w.length+2,2);c=e.options.lineWidth>0&&y>e.options.lineWidth}if(c){let y=f;for(let h of d)y+=h?`
|
|
90
|
-
${o}${n}${h}`:`
|
|
91
|
-
`;return`${y}
|
|
92
|
-
${n}${m}`}else return`${f}${s}${d.join(" ")}${s}${m}`}function El({indent:t,options:{commentString:e}},r,i,n){if(i&&n&&(i=i.replace(/^\n+/,"")),i){let o=Tl.indentComment(e(i),t);r.push(o.trimStart())}}ZI.stringifyCollection=v9});var wr=S(Lp=>{"use strict";var S9=Rp(),x9=Op(),_9=pl(),br=Y(),Il=vr(),$9=xe();function Do(t,e){let r=br.isScalar(e)?e.value:e;for(let i of t)if(br.isPair(i)&&(i.key===e||i.key===r||br.isScalar(i.key)&&i.key.value===r))return i}var Dp=class extends _9.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(br.MAP,e),this.items=[]}static from(e,r,i){let{keepUndefined:n,replacer:o}=i,s=new this(e),a=(l,c)=>{if(typeof o=="function")c=o.call(r,l,c);else if(Array.isArray(o)&&!o.includes(l))return;(c!==void 0||n)&&s.items.push(Il.createPair(l,c,i))};if(r instanceof Map)for(let[l,c]of r)a(l,c);else if(r&&typeof r=="object")for(let l of Object.keys(r))a(l,r[l]);return typeof e.sortMapEntries=="function"&&s.items.sort(e.sortMapEntries),s}add(e,r){let i;br.isPair(e)?i=e:!e||typeof e!="object"||!("key"in e)?i=new Il.Pair(e,e?.value):i=new Il.Pair(e.key,e.value);let n=Do(this.items,i.key),o=this.schema?.sortMapEntries;if(n){if(!r)throw new Error(`Key ${i.key} already set`);br.isScalar(n.value)&&$9.isScalarValue(i.value)?n.value.value=i.value:n.value=i.value}else if(o){let s=this.items.findIndex(a=>o(i,a)<0);s===-1?this.items.push(i):this.items.splice(s,0,i)}else this.items.push(i)}delete(e){let r=Do(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let n=Do(this.items,e)?.value;return(!r&&br.isScalar(n)?n.value:n)??void 0}has(e){return!!Do(this.items,e)}set(e,r){this.add(new Il.Pair(e,r),!0)}toJSON(e,r,i){let n=i?new i:r?.mapAsMap?new Map:{};r?.onCreate&&r.onCreate(n);for(let o of this.items)x9.addPairToJSMap(r,n,o);return n}toString(e,r,i){if(!e)return JSON.stringify(this);for(let n of this.items)if(!br.isPair(n))throw new Error(`Map items must all be pairs; found ${JSON.stringify(n)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),S9.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:i,onComment:r})}};Lp.YAMLMap=Dp;Lp.findPair=Do});var Fn=S(VI=>{"use strict";var k9=Y(),KI=wr(),T9={collection:"map",default:!0,nodeClass:KI.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return k9.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,r)=>KI.YAMLMap.from(t,e,r)};VI.map=T9});var Sr=S(GI=>{"use strict";var E9=Eo(),I9=Rp(),C9=pl(),Pl=Y(),P9=xe(),N9=pr(),zp=class extends C9.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Pl.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=Cl(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let i=Cl(e);if(typeof i!="number")return;let n=this.items[i];return!r&&Pl.isScalar(n)?n.value:n}has(e){let r=Cl(e);return typeof r=="number"&&r<this.items.length}set(e,r){let i=Cl(e);if(typeof i!="number")throw new Error(`Expected a valid index, not ${e}.`);let n=this.items[i];Pl.isScalar(n)&&P9.isScalarValue(r)?n.value=r:this.items[i]=r}toJSON(e,r){let i=[];r?.onCreate&&r.onCreate(i);let n=0;for(let o of this.items)i.push(N9.toJS(o,String(n++),r));return i}toString(e,r,i){return e?I9.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:i,onComment:r}):JSON.stringify(this)}static from(e,r,i){let{replacer:n}=i,o=new this(e);if(r&&Symbol.iterator in Object(r)){let s=0;for(let a of r){if(typeof n=="function"){let l=r instanceof Set?a:String(s++);a=n.call(r,l,a)}o.items.push(E9.createNode(a,void 0,i))}}return o}};function Cl(t){let e=Pl.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}GI.YAMLSeq=zp});var Bn=S(JI=>{"use strict";var O9=Y(),QI=Sr(),A9={collection:"seq",default:!0,nodeClass:QI.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return O9.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,r)=>QI.YAMLSeq.from(t,e,r)};JI.seq=A9});var Lo=S(WI=>{"use strict";var R9=No(),D9={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,r,i){return e=Object.assign({actualString:!0},e),R9.stringifyString(t,e,r,i)}};WI.string=D9});var Nl=S(XI=>{"use strict";var HI=xe(),YI={identify:t=>t==null,createNode:()=>new HI.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new HI.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&YI.test.test(t)?t:e.options.nullStr};XI.nullTag=YI});var jp=S(tC=>{"use strict";var L9=xe(),eC={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new L9.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},r){if(t&&eC.test.test(t)){let i=t[0]==="t"||t[0]==="T";if(e===i)return t}return e?r.options.trueStr:r.options.falseStr}};tC.boolTag=eC});var Zn=S(rC=>{"use strict";function z9({format:t,minFractionDigits:e,tag:r,value:i}){if(typeof i=="bigint")return String(i);let n=typeof i=="number"?i:Number(i);if(!isFinite(n))return isNaN(n)?".nan":n<0?"-.inf":".inf";let o=Object.is(i,-0)?"-0":JSON.stringify(i);if(!t&&e&&(!r||r==="tag:yaml.org,2002:float")&&/^\d/.test(o)){let s=o.indexOf(".");s<0&&(s=o.length,o+=".");let a=e-(o.length-s-1);for(;a-- >0;)o+="0"}return o}rC.stringifyNumber=z9});var Mp=S(Ol=>{"use strict";var j9=xe(),Up=Zn(),U9={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Up.stringifyNumber},M9={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():Up.stringifyNumber(t)}},q9={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new j9.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:Up.stringifyNumber};Ol.float=q9;Ol.floatExp=M9;Ol.floatNaN=U9});var Fp=S(Rl=>{"use strict";var nC=Zn(),Al=t=>typeof t=="bigint"||Number.isInteger(t),qp=(t,e,r,{intAsBigInt:i})=>i?BigInt(t):parseInt(t.substring(e),r);function iC(t,e,r){let{value:i}=t;return Al(i)&&i>=0?r+i.toString(e):nC.stringifyNumber(t)}var F9={identify:t=>Al(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,r)=>qp(t,2,8,r),stringify:t=>iC(t,8,"0o")},B9={identify:Al,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,r)=>qp(t,0,10,r),stringify:nC.stringifyNumber},Z9={identify:t=>Al(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,r)=>qp(t,2,16,r),stringify:t=>iC(t,16,"0x")};Rl.int=B9;Rl.intHex=Z9;Rl.intOct=F9});var sC=S(oC=>{"use strict";var K9=Fn(),V9=Nl(),G9=Bn(),Q9=Lo(),J9=jp(),Bp=Mp(),Zp=Fp(),W9=[K9.map,G9.seq,Q9.string,V9.nullTag,J9.boolTag,Zp.intOct,Zp.int,Zp.intHex,Bp.floatNaN,Bp.floatExp,Bp.float];oC.schema=W9});var cC=S(lC=>{"use strict";var H9=xe(),Y9=Fn(),X9=Bn();function aC(t){return typeof t=="bigint"||Number.isInteger(t)}var Dl=({value:t})=>JSON.stringify(t),e8=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Dl},{identify:t=>t==null,createNode:()=>new H9.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Dl},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:Dl},{identify:aC,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:r})=>r?BigInt(t):parseInt(t,10),stringify:({value:t})=>aC(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:Dl}],t8={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},r8=[Y9.map,X9.seq].concat(e8,t8);lC.schema=r8});var Vp=S(uC=>{"use strict";var zo=X("buffer"),Kp=xe(),n8=No(),i8={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof zo.Buffer=="function")return zo.Buffer.from(t,"base64");if(typeof atob=="function"){let r=atob(t.replace(/[\n\r]/g,"")),i=new Uint8Array(r.length);for(let n=0;n<r.length;++n)i[n]=r.charCodeAt(n);return i}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:r},i,n,o){if(!r)return"";let s=r,a;if(typeof zo.Buffer=="function")a=s instanceof zo.Buffer?s.toString("base64"):zo.Buffer.from(s.buffer).toString("base64");else if(typeof btoa=="function"){let l="";for(let c=0;c<s.length;++c)l+=String.fromCharCode(s[c]);a=btoa(l)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=Kp.Scalar.BLOCK_LITERAL),e!==Kp.Scalar.QUOTE_DOUBLE){let l=Math.max(i.options.lineWidth-i.indent.length,i.options.minContentWidth),c=Math.ceil(a.length/l),u=new Array(c);for(let d=0,f=0;d<c;++d,f+=l)u[d]=a.substr(f,l);a=u.join(e===Kp.Scalar.BLOCK_LITERAL?`
|
|
93
|
-
`:" ")}return n8.stringifyString({comment:t,type:e,value:a},i,n,o)}};uC.binary=i8});var jl=S(zl=>{"use strict";var Ll=Y(),Gp=vr(),o8=xe(),s8=Sr();function dC(t,e){if(Ll.isSeq(t))for(let r=0;r<t.items.length;++r){let i=t.items[r];if(!Ll.isPair(i)){if(Ll.isMap(i)){i.items.length>1&&e("Each pair must have its own sequence indicator");let n=i.items[0]||new Gp.Pair(new o8.Scalar(null));if(i.commentBefore&&(n.key.commentBefore=n.key.commentBefore?`${i.commentBefore}
|
|
94
|
-
${n.key.commentBefore}`:i.commentBefore),i.comment){let o=n.value??n.key;o.comment=o.comment?`${i.comment}
|
|
95
|
-
${o.comment}`:i.comment}i=n}t.items[r]=Ll.isPair(i)?i:new Gp.Pair(i)}}else e("Expected a sequence for this tag");return t}function fC(t,e,r){let{replacer:i}=r,n=new s8.YAMLSeq(t);n.tag="tag:yaml.org,2002:pairs";let o=0;if(e&&Symbol.iterator in Object(e))for(let s of e){typeof i=="function"&&(s=i.call(e,String(o++),s));let a,l;if(Array.isArray(s))if(s.length===2)a=s[0],l=s[1];else throw new TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){let c=Object.keys(s);if(c.length===1)a=c[0],l=s[a];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=s;n.items.push(Gp.createPair(a,l,r))}return n}var a8={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:dC,createNode:fC};zl.createPairs=fC;zl.pairs=a8;zl.resolvePairs=dC});var Wp=S(Jp=>{"use strict";var mC=Y(),Qp=pr(),jo=wr(),l8=Sr(),pC=jl(),Qr=class t extends l8.YAMLSeq{constructor(){super(),this.add=jo.YAMLMap.prototype.add.bind(this),this.delete=jo.YAMLMap.prototype.delete.bind(this),this.get=jo.YAMLMap.prototype.get.bind(this),this.has=jo.YAMLMap.prototype.has.bind(this),this.set=jo.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,r){if(!r)return super.toJSON(e);let i=new Map;r?.onCreate&&r.onCreate(i);for(let n of this.items){let o,s;if(mC.isPair(n)?(o=Qp.toJS(n.key,"",r),s=Qp.toJS(n.value,o,r)):o=Qp.toJS(n,"",r),i.has(o))throw new Error("Ordered maps must not include duplicate keys");i.set(o,s)}return i}static from(e,r,i){let n=pC.createPairs(e,r,i),o=new this;return o.items=n.items,o}};Qr.tag="tag:yaml.org,2002:omap";var c8={collection:"seq",identify:t=>t instanceof Map,nodeClass:Qr,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=pC.resolvePairs(t,e),i=[];for(let{key:n}of r.items)mC.isScalar(n)&&(i.includes(n.value)?e(`Ordered maps must not include duplicate keys: ${n.value}`):i.push(n.value));return Object.assign(new Qr,r)},createNode:(t,e,r)=>Qr.from(t,e,r)};Jp.YAMLOMap=Qr;Jp.omap=c8});var bC=S(Hp=>{"use strict";var hC=xe();function gC({value:t,source:e},r){return e&&(t?yC:vC).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var yC={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new hC.Scalar(!0),stringify:gC},vC={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new hC.Scalar(!1),stringify:gC};Hp.falseTag=vC;Hp.trueTag=yC});var wC=S(Ul=>{"use strict";var u8=xe(),Yp=Zn(),d8={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Yp.stringifyNumber},f8={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():Yp.stringifyNumber(t)}},m8={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new u8.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(r!==-1){let i=t.substring(r+1).replace(/_/g,"");i[i.length-1]==="0"&&(e.minFractionDigits=i.length)}return e},stringify:Yp.stringifyNumber};Ul.float=m8;Ul.floatExp=f8;Ul.floatNaN=d8});var xC=S(Mo=>{"use strict";var SC=Zn(),Uo=t=>typeof t=="bigint"||Number.isInteger(t);function Ml(t,e,r,{intAsBigInt:i}){let n=t[0];if((n==="-"||n==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),i){switch(r){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let s=BigInt(t);return n==="-"?BigInt(-1)*s:s}let o=parseInt(t,r);return n==="-"?-1*o:o}function Xp(t,e,r){let{value:i}=t;if(Uo(i)){let n=i.toString(e);return i<0?"-"+r+n.substr(1):r+n}return SC.stringifyNumber(t)}var p8={identify:Uo,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>Ml(t,2,2,r),stringify:t=>Xp(t,2,"0b")},h8={identify:Uo,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>Ml(t,1,8,r),stringify:t=>Xp(t,8,"0")},g8={identify:Uo,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>Ml(t,0,10,r),stringify:SC.stringifyNumber},y8={identify:Uo,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>Ml(t,2,16,r),stringify:t=>Xp(t,16,"0x")};Mo.int=g8;Mo.intBin=p8;Mo.intHex=y8;Mo.intOct=h8});var th=S(eh=>{"use strict";var Bl=Y(),ql=vr(),Fl=wr(),Jr=class t extends Fl.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let r;Bl.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new ql.Pair(e.key,null):r=new ql.Pair(e,null),Fl.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let i=Fl.findPair(this.items,e);return!r&&Bl.isPair(i)?Bl.isScalar(i.key)?i.key.value:i.key:i}set(e,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);let i=Fl.findPair(this.items,e);i&&!r?this.items.splice(this.items.indexOf(i),1):!i&&r&&this.items.push(new ql.Pair(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,i){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,i);throw new Error("Set items must all have null values")}static from(e,r,i){let{replacer:n}=i,o=new this(e);if(r&&Symbol.iterator in Object(r))for(let s of r)typeof n=="function"&&(s=n.call(r,s,s)),o.items.push(ql.createPair(s,null,i));return o}};Jr.tag="tag:yaml.org,2002:set";var v8={collection:"map",identify:t=>t instanceof Set,nodeClass:Jr,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>Jr.from(t,e,r),resolve(t,e){if(Bl.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new Jr,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};eh.YAMLSet=Jr;eh.set=v8});var nh=S(Zl=>{"use strict";var b8=Zn();function rh(t,e){let r=t[0],i=r==="-"||r==="+"?t.substring(1):t,n=s=>e?BigInt(s):Number(s),o=i.replace(/_/g,"").split(":").reduce((s,a)=>s*n(60)+n(a),n(0));return r==="-"?n(-1)*o:o}function _C(t){let{value:e}=t,r=s=>s;if(typeof e=="bigint")r=s=>BigInt(s);else if(isNaN(e)||!isFinite(e))return b8.stringifyNumber(t);let i="";e<0&&(i="-",e*=r(-1));let n=r(60),o=[e%n];return e<60?o.unshift(0):(e=(e-o[0])/n,o.unshift(e%n),e>=60&&(e=(e-o[0])/n,o.unshift(e))),i+o.map(s=>String(s).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var w8={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:r})=>rh(t,r),stringify:_C},S8={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>rh(t,!1),stringify:_C},$C={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){let e=t.match($C.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,i,n,o,s,a]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0,c=Date.UTC(r,i-1,n,o||0,s||0,a||0,l),u=e[8];if(u&&u!=="Z"){let d=rh(u,!1);Math.abs(d)<30&&(d*=60),c-=6e4*d}return new Date(c)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Zl.floatTime=S8;Zl.intTime=w8;Zl.timestamp=$C});var EC=S(TC=>{"use strict";var x8=Fn(),_8=Nl(),$8=Bn(),k8=Lo(),T8=Vp(),kC=bC(),ih=wC(),Kl=xC(),E8=_l(),I8=Wp(),C8=jl(),P8=th(),oh=nh(),N8=[x8.map,$8.seq,k8.string,_8.nullTag,kC.trueTag,kC.falseTag,Kl.intBin,Kl.intOct,Kl.int,Kl.intHex,ih.floatNaN,ih.floatExp,ih.float,T8.binary,E8.merge,I8.omap,C8.pairs,P8.set,oh.intTime,oh.floatTime,oh.timestamp];TC.schema=N8});var zC=S(lh=>{"use strict";var NC=Fn(),O8=Nl(),OC=Bn(),A8=Lo(),R8=jp(),sh=Mp(),ah=Fp(),D8=sC(),L8=cC(),AC=Vp(),qo=_l(),RC=Wp(),DC=jl(),IC=EC(),LC=th(),Vl=nh(),CC=new Map([["core",D8.schema],["failsafe",[NC.map,OC.seq,A8.string]],["json",L8.schema],["yaml11",IC.schema],["yaml-1.1",IC.schema]]),PC={binary:AC.binary,bool:R8.boolTag,float:sh.float,floatExp:sh.floatExp,floatNaN:sh.floatNaN,floatTime:Vl.floatTime,int:ah.int,intHex:ah.intHex,intOct:ah.intOct,intTime:Vl.intTime,map:NC.map,merge:qo.merge,null:O8.nullTag,omap:RC.omap,pairs:DC.pairs,seq:OC.seq,set:LC.set,timestamp:Vl.timestamp},z8={"tag:yaml.org,2002:binary":AC.binary,"tag:yaml.org,2002:merge":qo.merge,"tag:yaml.org,2002:omap":RC.omap,"tag:yaml.org,2002:pairs":DC.pairs,"tag:yaml.org,2002:set":LC.set,"tag:yaml.org,2002:timestamp":Vl.timestamp};function j8(t,e,r){let i=CC.get(e);if(i&&!t)return r&&!i.includes(qo.merge)?i.concat(qo.merge):i.slice();let n=i;if(!n)if(Array.isArray(t))n=[];else{let o=Array.from(CC.keys()).filter(s=>s!=="yaml11").map(s=>JSON.stringify(s)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${o} or define customTags array`)}if(Array.isArray(t))for(let o of t)n=n.concat(o);else typeof t=="function"&&(n=t(n.slice()));return r&&(n=n.concat(qo.merge)),n.reduce((o,s)=>{let a=typeof s=="string"?PC[s]:s;if(!a){let l=JSON.stringify(s),c=Object.keys(PC).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return o.includes(a)||o.push(a),o},[])}lh.coreKnownTags=z8;lh.getTags=j8});var dh=S(jC=>{"use strict";var ch=Y(),U8=Fn(),M8=Bn(),q8=Lo(),Gl=zC(),F8=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,uh=class t{constructor({compat:e,customTags:r,merge:i,resolveKnownTags:n,schema:o,sortMapEntries:s,toStringDefaults:a}){this.compat=Array.isArray(e)?Gl.getTags(e,"compat"):e?Gl.getTags(null,e):null,this.name=typeof o=="string"&&o||"core",this.knownTags=n?Gl.coreKnownTags:{},this.tags=Gl.getTags(r,this.name,i),this.toStringOptions=a??null,Object.defineProperty(this,ch.MAP,{value:U8.map}),Object.defineProperty(this,ch.SCALAR,{value:q8.string}),Object.defineProperty(this,ch.SEQ,{value:M8.seq}),this.sortMapEntries=typeof s=="function"?s:s===!0?F8:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};jC.Schema=uh});var MC=S(UC=>{"use strict";var B8=Y(),fh=Oo(),Fo=Io();function Z8(t,e){let r=[],i=e.directives===!0;if(e.directives!==!1&&t.directives){let l=t.directives.toString(t);l?(r.push(l),i=!0):t.directives.docStart&&(i=!0)}i&&r.push("---");let n=fh.createStringifyContext(t,e),{commentString:o}=n.options;if(t.commentBefore){r.length!==1&&r.unshift("");let l=o(t.commentBefore);r.unshift(Fo.indentComment(l,""))}let s=!1,a=null;if(t.contents){if(B8.isNode(t.contents)){if(t.contents.spaceBefore&&i&&r.push(""),t.contents.commentBefore){let u=o(t.contents.commentBefore);r.push(Fo.indentComment(u,""))}n.forceBlockIndent=!!t.comment,a=t.contents.comment}let l=a?void 0:()=>s=!0,c=fh.stringify(t.contents,n,()=>a=null,l);a&&(c+=Fo.lineComment(c,"",o(a))),(c[0]==="|"||c[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${c}`:r.push(c)}else r.push(fh.stringify(t.contents,n));if(t.directives?.docEnd)if(t.comment){let l=o(t.comment);l.includes(`
|
|
96
|
-
`)?(r.push("..."),r.push(Fo.indentComment(l,""))):r.push(`... ${l}`)}else r.push("...");else{let l=t.comment;l&&s&&(l=l.replace(/^\n+/,"")),l&&((!s||a)&&r[r.length-1]!==""&&r.push(""),r.push(Fo.indentComment(o(l),"")))}return r.join(`
|
|
97
|
-
`)+`
|
|
98
|
-
`}UC.stringifyDocument=Z8});var Bo=S(qC=>{"use strict";var K8=To(),Kn=pl(),ht=Y(),V8=vr(),G8=pr(),Q8=dh(),J8=MC(),mh=ul(),W8=yp(),H8=Eo(),ph=gp(),hh=class t{constructor(e,r,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,ht.NODE_TYPE,{value:ht.DOC});let n=null;typeof r=="function"||Array.isArray(r)?n=r:i===void 0&&r&&(i=r,r=void 0);let o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=o;let{version:s}=o;i?._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(s=this.directives.yaml.version)):this.directives=new ph.Directives({version:s}),this.setSchema(s,i),this.contents=e===void 0?null:this.createNode(e,n,i)}clone(){let e=Object.create(t.prototype,{[ht.NODE_TYPE]:{value:ht.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=ht.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Vn(this.contents)&&this.contents.add(e)}addIn(e,r){Vn(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let i=mh.anchorNames(this);e.anchor=!r||i.has(r)?mh.findNewAnchor(r||"a",i):r}return new K8.Alias(e.anchor)}createNode(e,r,i){let n;if(typeof r=="function")e=r.call({"":e},"",e),n=r;else if(Array.isArray(r)){let w=T=>typeof T=="number"||T instanceof String||T instanceof Number,_=r.filter(w).map(String);_.length>0&&(r=r.concat(_)),n=r}else i===void 0&&r&&(i=r,r=void 0);let{aliasDuplicateObjects:o,anchorPrefix:s,flow:a,keepUndefined:l,onTagObj:c,tag:u}=i??{},{onAnchor:d,setAnchors:f,sourceObjects:m}=mh.createNodeAnchors(this,s||"a"),y={aliasDuplicateObjects:o??!0,keepUndefined:l??!1,onAnchor:d,onTagObj:c,replacer:n,schema:this.schema,sourceObjects:m},h=H8.createNode(e,u,y);return a&&ht.isCollection(h)&&(h.flow=!0),f(),h}createPair(e,r,i={}){let n=this.createNode(e,null,i),o=this.createNode(r,null,i);return new V8.Pair(n,o)}delete(e){return Vn(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Kn.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):Vn(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return ht.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return Kn.isEmptyPath(e)?!r&&ht.isScalar(this.contents)?this.contents.value:this.contents:ht.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return ht.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return Kn.isEmptyPath(e)?this.contents!==void 0:ht.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=Kn.collectionFromPath(this.schema,[e],r):Vn(this.contents)&&this.contents.set(e,r)}setIn(e,r){Kn.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=Kn.collectionFromPath(this.schema,Array.from(e),r):Vn(this.contents)&&this.contents.setIn(e,r)}setSchema(e,r={}){typeof e=="number"&&(e=String(e));let i;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new ph.Directives({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new ph.Directives({version:e}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{let n=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${n}`)}}if(r.schema instanceof Object)this.schema=r.schema;else if(i)this.schema=new Q8.Schema(Object.assign(i,r));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:r,mapAsMap:i,maxAliasCount:n,onAnchor:o,reviver:s}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},l=G8.toJS(this.contents,r??"",a);if(typeof o=="function")for(let{count:c,res:u}of a.anchors.values())o(u,c);return typeof s=="function"?W8.applyReviver(s,{"":l},"",l):l}toJSON(e,r){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:r})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let r=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${r}`)}return J8.stringifyDocument(this,e)}};function Vn(t){if(ht.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}qC.Document=hh});var Vo=S(Ko=>{"use strict";var Zo=class extends Error{constructor(e,r,i,n){super(),this.name=e,this.code=i,this.message=n,this.pos=r}},gh=class extends Zo{constructor(e,r,i){super("YAMLParseError",e,r,i)}},yh=class extends Zo{constructor(e,r,i){super("YAMLWarning",e,r,i)}},Y8=(t,e)=>r=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map(a=>e.linePos(a));let{line:i,col:n}=r.linePos[0];r.message+=` at line ${i}, column ${n}`;let o=n-1,s=t.substring(e.lineStarts[i-1],e.lineStarts[i]).replace(/[\n\r]+$/,"");if(o>=60&&s.length>80){let a=Math.min(o-39,s.length-79);s="\u2026"+s.substring(a),o-=a-1}if(s.length>80&&(s=s.substring(0,79)+"\u2026"),i>1&&/^ *$/.test(s.substring(0,o))){let a=t.substring(e.lineStarts[i-2],e.lineStarts[i-1]);a.length>80&&(a=a.substring(0,79)+`\u2026
|
|
99
|
-
`),s=a+s}if(/[^ ]/.test(s)){let a=1,l=r.linePos[1];l?.line===i&&l.col>n&&(a=Math.max(1,Math.min(l.col-n,80-o)));let c=" ".repeat(o)+"^".repeat(a);r.message+=`:
|
|
100
|
-
|
|
101
|
-
${s}
|
|
102
|
-
${c}
|
|
103
|
-
`}};Ko.YAMLError=Zo;Ko.YAMLParseError=gh;Ko.YAMLWarning=yh;Ko.prettifyError=Y8});var Go=S(FC=>{"use strict";function X8(t,{flow:e,indicator:r,next:i,offset:n,onError:o,parentIndent:s,startOnNewline:a}){let l=!1,c=a,u=a,d="",f="",m=!1,y=!1,h=null,w=null,_=null,T=null,k=null,E=null,R=null;for(let I of t)switch(y&&(I.type!=="space"&&I.type!=="newline"&&I.type!=="comma"&&o(I.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y=!1),h&&(c&&I.type!=="comment"&&I.type!=="newline"&&o(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),h=null),I.type){case"space":!e&&(r!=="doc-start"||i?.type!=="flow-collection")&&I.source.includes(" ")&&(h=I),u=!0;break;case"comment":{u||o(I,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let G=I.source.substring(1)||" ";d?d+=f+G:d=G,f="",c=!1;break}case"newline":c?d?d+=I.source:(!E||r!=="seq-item-ind")&&(l=!0):f+=I.source,c=!0,m=!0,(w||_)&&(T=I),u=!0;break;case"anchor":w&&o(I,"MULTIPLE_ANCHORS","A node can have at most one anchor"),I.source.endsWith(":")&&o(I.offset+I.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),w=I,R??(R=I.offset),c=!1,u=!1,y=!0;break;case"tag":{_&&o(I,"MULTIPLE_TAGS","A node can have at most one tag"),_=I,R??(R=I.offset),c=!1,u=!1,y=!0;break}case r:(w||_)&&o(I,"BAD_PROP_ORDER",`Anchors and tags must be after the ${I.source} indicator`),E&&o(I,"UNEXPECTED_TOKEN",`Unexpected ${I.source} in ${e??"collection"}`),E=I,c=r==="seq-item-ind"||r==="explicit-key-ind",u=!1;break;case"comma":if(e){k&&o(I,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),k=I,c=!1,u=!1;break}default:o(I,"UNEXPECTED_TOKEN",`Unexpected ${I.type} token`),c=!1,u=!1}let L=t[t.length-1],U=L?L.offset+L.source.length:n;return y&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&o(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),h&&(c&&h.indent<=s||i?.type==="block-map"||i?.type==="block-seq")&&o(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:k,found:E,spaceBefore:l,comment:d,hasNewline:m,anchor:w,tag:_,newlineAfterProp:T,end:U,start:R??U}}FC.resolveProps=X8});var Ql=S(BC=>{"use strict";function vh(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
|
|
104
|
-
`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let r of e.start)if(r.type==="newline")return!0;if(e.sep){for(let r of e.sep)if(r.type==="newline")return!0}if(vh(e.key)||vh(e.value))return!0}return!1;default:return!0}}BC.containsNewline=vh});var bh=S(ZC=>{"use strict";var e3=Ql();function t3(t,e,r){if(e?.type==="flow-collection"){let i=e.end[0];i.indent===t&&(i.source==="]"||i.source==="}")&&e3.containsNewline(e)&&r(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}ZC.flowIndentCheck=t3});var wh=S(VC=>{"use strict";var KC=Y();function r3(t,e,r){let{uniqueKeys:i}=t.options;if(i===!1)return!1;let n=typeof i=="function"?i:(o,s)=>o===s||KC.isScalar(o)&&KC.isScalar(s)&&o.value===s.value;return e.some(o=>n(o.key,r))}VC.mapIncludes=r3});var YC=S(HC=>{"use strict";var GC=vr(),n3=wr(),QC=Go(),i3=Ql(),JC=bh(),o3=wh(),WC="All mapping items must start at the same column";function s3({composeNode:t,composeEmptyNode:e},r,i,n,o){let s=o?.nodeClass??n3.YAMLMap,a=new s(r.schema);r.atRoot&&(r.atRoot=!1);let l=i.offset,c=null;for(let u of i.items){let{start:d,key:f,sep:m,value:y}=u,h=QC.resolveProps(d,{indicator:"explicit-key-ind",next:f??m?.[0],offset:l,onError:n,parentIndent:i.indent,startOnNewline:!0}),w=!h.found;if(w){if(f&&(f.type==="block-seq"?n(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==i.indent&&n(l,"BAD_INDENT",WC)),!h.anchor&&!h.tag&&!m){c=h.end,h.comment&&(a.comment?a.comment+=`
|
|
105
|
-
`+h.comment:a.comment=h.comment);continue}(h.newlineAfterProp||i3.containsNewline(f))&&n(f??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else h.found?.indent!==i.indent&&n(l,"BAD_INDENT",WC);r.atKey=!0;let _=h.end,T=f?t(r,f,h,n):e(r,_,d,null,h,n);r.schema.compat&&JC.flowIndentCheck(i.indent,f,n),r.atKey=!1,o3.mapIncludes(r,a.items,T)&&n(_,"DUPLICATE_KEY","Map keys must be unique");let k=QC.resolveProps(m??[],{indicator:"map-value-ind",next:y,offset:T.range[2],onError:n,parentIndent:i.indent,startOnNewline:!f||f.type==="block-scalar"});if(l=k.end,k.found){w&&(y?.type==="block-map"&&!k.hasNewline&&n(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&h.start<k.found.offset-1024&&n(T.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let E=y?t(r,y,k,n):e(r,l,m,null,k,n);r.schema.compat&&JC.flowIndentCheck(i.indent,y,n),l=E.range[2];let R=new GC.Pair(T,E);r.options.keepSourceTokens&&(R.srcToken=u),a.items.push(R)}else{w&&n(T.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),k.comment&&(T.comment?T.comment+=`
|
|
106
|
-
`+k.comment:T.comment=k.comment);let E=new GC.Pair(T);r.options.keepSourceTokens&&(E.srcToken=u),a.items.push(E)}}return c&&c<l&&n(c,"IMPOSSIBLE","Map comment with trailing content"),a.range=[i.offset,l,c??l],a}HC.resolveBlockMap=s3});var e1=S(XC=>{"use strict";var a3=Sr(),l3=Go(),c3=bh();function u3({composeNode:t,composeEmptyNode:e},r,i,n,o){let s=o?.nodeClass??a3.YAMLSeq,a=new s(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let l=i.offset,c=null;for(let{start:u,value:d}of i.items){let f=l3.resolveProps(u,{indicator:"seq-item-ind",next:d,offset:l,onError:n,parentIndent:i.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||d)d?.type==="block-seq"?n(f.end,"BAD_INDENT","All sequence items must start at the same column"):n(l,"MISSING_CHAR","Sequence item without - indicator");else{c=f.end,f.comment&&(a.comment=f.comment);continue}let m=d?t(r,d,f,n):e(r,f.end,u,null,f,n);r.schema.compat&&c3.flowIndentCheck(i.indent,d,n),l=m.range[2],a.items.push(m)}return a.range=[i.offset,l,c??l],a}XC.resolveBlockSeq=u3});var Gn=S(t1=>{"use strict";function d3(t,e,r,i){let n="";if(t){let o=!1,s="";for(let a of t){let{source:l,type:c}=a;switch(c){case"space":o=!0;break;case"comment":{r&&!o&&i(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=l.substring(1)||" ";n?n+=s+u:n=u,s="";break}case"newline":n&&(s+=l),o=!0;break;default:i(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=l.length}}return{comment:n,offset:e}}t1.resolveEnd=d3});var o1=S(i1=>{"use strict";var f3=Y(),m3=vr(),r1=wr(),p3=Sr(),h3=Gn(),n1=Go(),g3=Ql(),y3=wh(),Sh="Block collections are not allowed within flow collections",xh=t=>t&&(t.type==="block-map"||t.type==="block-seq");function v3({composeNode:t,composeEmptyNode:e},r,i,n,o){let s=i.start.source==="{",a=s?"flow map":"flow sequence",l=o?.nodeClass??(s?r1.YAMLMap:p3.YAMLSeq),c=new l(r.schema);c.flow=!0;let u=r.atRoot;u&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let d=i.offset+i.start.source.length;for(let w=0;w<i.items.length;++w){let _=i.items[w],{start:T,key:k,sep:E,value:R}=_,L=n1.resolveProps(T,{flow:a,indicator:"explicit-key-ind",next:k??E?.[0],offset:d,onError:n,parentIndent:i.indent,startOnNewline:!1});if(!L.found){if(!L.anchor&&!L.tag&&!E&&!R){w===0&&L.comma?n(L.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):w<i.items.length-1&&n(L.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),L.comment&&(c.comment?c.comment+=`
|
|
107
|
-
`+L.comment:c.comment=L.comment),d=L.end;continue}!s&&r.options.strict&&g3.containsNewline(k)&&n(k,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(w===0)L.comma&&n(L.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(L.comma||n(L.start,"MISSING_CHAR",`Missing , between ${a} items`),L.comment){let U="";e:for(let I of T)switch(I.type){case"comma":case"space":break;case"comment":U=I.source.substring(1);break e;default:break e}if(U){let I=c.items[c.items.length-1];f3.isPair(I)&&(I=I.value??I.key),I.comment?I.comment+=`
|
|
108
|
-
`+U:I.comment=U,L.comment=L.comment.substring(U.length+1)}}if(!s&&!E&&!L.found){let U=R?t(r,R,L,n):e(r,L.end,E,null,L,n);c.items.push(U),d=U.range[2],xh(R)&&n(U.range,"BLOCK_IN_FLOW",Sh)}else{r.atKey=!0;let U=L.end,I=k?t(r,k,L,n):e(r,U,T,null,L,n);xh(k)&&n(I.range,"BLOCK_IN_FLOW",Sh),r.atKey=!1;let G=n1.resolveProps(E??[],{flow:a,indicator:"map-value-ind",next:R,offset:I.range[2],onError:n,parentIndent:i.indent,startOnNewline:!1});if(G.found){if(!s&&!L.found&&r.options.strict){if(E)for(let ae of E){if(ae===G.found)break;if(ae.type==="newline"){n(ae,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}L.start<G.found.offset-1024&&n(G.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else R&&("source"in R&&R.source?.[0]===":"?n(R,"MISSING_CHAR",`Missing space after : in ${a}`):n(G.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let Se=R?t(r,R,G,n):G.found?e(r,G.end,E,null,G,n):null;Se?xh(R)&&n(Se.range,"BLOCK_IN_FLOW",Sh):G.comment&&(I.comment?I.comment+=`
|
|
109
|
-
`+G.comment:I.comment=G.comment);let ct=new m3.Pair(I,Se);if(r.options.keepSourceTokens&&(ct.srcToken=_),s){let ae=c;y3.mapIncludes(r,ae.items,I)&&n(U,"DUPLICATE_KEY","Map keys must be unique"),ae.items.push(ct)}else{let ae=new r1.YAMLMap(r.schema);ae.flow=!0,ae.items.push(ct);let bt=(Se??I).range;ae.range=[I.range[0],bt[1],bt[2]],c.items.push(ae)}d=Se?Se.range[2]:G.end}}let f=s?"}":"]",[m,...y]=i.end,h=d;if(m?.source===f)h=m.offset+m.source.length;else{let w=a[0].toUpperCase()+a.substring(1),_=u?`${w} must end with a ${f}`:`${w} in block collection must be sufficiently indented and end with a ${f}`;n(d,u?"MISSING_CHAR":"BAD_INDENT",_),m&&m.source.length!==1&&y.unshift(m)}if(y.length>0){let w=h3.resolveEnd(y,h,r.options.strict,n);w.comment&&(c.comment?c.comment+=`
|
|
110
|
-
`+w.comment:c.comment=w.comment),c.range=[i.offset,h,w.offset]}else c.range=[i.offset,h,h];return c}i1.resolveFlowCollection=v3});var a1=S(s1=>{"use strict";var b3=Y(),w3=xe(),S3=wr(),x3=Sr(),_3=YC(),$3=e1(),k3=o1();function _h(t,e,r,i,n,o){let s=r.type==="block-map"?_3.resolveBlockMap(t,e,r,i,o):r.type==="block-seq"?$3.resolveBlockSeq(t,e,r,i,o):k3.resolveFlowCollection(t,e,r,i,o),a=s.constructor;return n==="!"||n===a.tagName?(s.tag=a.tagName,s):(n&&(s.tag=n),s)}function T3(t,e,r,i,n){let o=i.tag,s=o?e.directives.tagName(o.source,f=>n(o,"TAG_RESOLVE_FAILED",f)):null;if(r.type==="block-seq"){let{anchor:f,newlineAfterProp:m}=i,y=f&&o?f.offset>o.offset?f:o:f??o;y&&(!m||m.offset<y.offset)&&n(y,"MISSING_CHAR","Missing newline after block sequence props")}let a=r.type==="block-map"?"map":r.type==="block-seq"?"seq":r.start.source==="{"?"map":"seq";if(!o||!s||s==="!"||s===S3.YAMLMap.tagName&&a==="map"||s===x3.YAMLSeq.tagName&&a==="seq")return _h(t,e,r,n,s);let l=e.schema.tags.find(f=>f.tag===s&&f.collection===a);if(!l){let f=e.schema.knownTags[s];if(f?.collection===a)e.schema.tags.push(Object.assign({},f,{default:!1})),l=f;else return f?n(o,"BAD_COLLECTION_TYPE",`${f.tag} used for ${a} collection, but expects ${f.collection??"scalar"}`,!0):n(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,!0),_h(t,e,r,n,s)}let c=_h(t,e,r,n,s,l),u=l.resolve?.(c,f=>n(o,"TAG_RESOLVE_FAILED",f),e.options)??c,d=b3.isNode(u)?u:new w3.Scalar(u);return d.range=c.range,d.tag=s,l?.format&&(d.format=l.format),d}s1.composeCollection=T3});var kh=S(l1=>{"use strict";var $h=xe();function E3(t,e,r){let i=e.offset,n=I3(e,t.options.strict,r);if(!n)return{value:"",type:null,comment:"",range:[i,i,i]};let o=n.mode===">"?$h.Scalar.BLOCK_FOLDED:$h.Scalar.BLOCK_LITERAL,s=e.source?C3(e.source):[],a=s.length;for(let h=s.length-1;h>=0;--h){let w=s[h][1];if(w===""||w==="\r")a=h;else break}if(a===0){let h=n.chomp==="+"&&s.length>0?`
|
|
111
|
-
`.repeat(Math.max(1,s.length-1)):"",w=i+n.length;return e.source&&(w+=e.source.length),{value:h,type:o,comment:n.comment,range:[i,w,w]}}let l=e.indent+n.indent,c=e.offset+n.length,u=0;for(let h=0;h<a;++h){let[w,_]=s[h];if(_===""||_==="\r")n.indent===0&&w.length>l&&(l=w.length);else{w.length<l&&r(c+w.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),n.indent===0&&(l=w.length),u=h,l===0&&!t.atRoot&&r(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=w.length+_.length+1}for(let h=s.length-1;h>=a;--h)s[h][0].length>l&&(a=h+1);let d="",f="",m=!1;for(let h=0;h<u;++h)d+=s[h][0].slice(l)+`
|
|
112
|
-
`;for(let h=u;h<a;++h){let[w,_]=s[h];c+=w.length+_.length+1;let T=_[_.length-1]==="\r";if(T&&(_=_.slice(0,-1)),_&&w.length<l){let E=`Block scalar lines must not be less indented than their ${n.indent?"explicit indentation indicator":"first line"}`;r(c-_.length-(T?2:1),"BAD_INDENT",E),w=""}o===$h.Scalar.BLOCK_LITERAL?(d+=f+w.slice(l)+_,f=`
|
|
113
|
-
`):w.length>l||_[0]===" "?(f===" "?f=`
|
|
114
|
-
`:!m&&f===`
|
|
115
|
-
`&&(f=`
|
|
116
|
-
|
|
117
|
-
`),d+=f+w.slice(l)+_,f=`
|
|
118
|
-
`,m=!0):_===""?f===`
|
|
119
|
-
`?d+=`
|
|
120
|
-
`:f=`
|
|
121
|
-
`:(d+=f+_,f=" ",m=!1)}switch(n.chomp){case"-":break;case"+":for(let h=a;h<s.length;++h)d+=`
|
|
122
|
-
`+s[h][0].slice(l);d[d.length-1]!==`
|
|
123
|
-
`&&(d+=`
|
|
124
|
-
`);break;default:d+=`
|
|
125
|
-
`}let y=i+n.length+e.source.length;return{value:d,type:o,comment:n.comment,range:[i,y,y]}}function I3({offset:t,props:e},r,i){if(e[0].type!=="block-scalar-header")return i(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:n}=e[0],o=n[0],s=0,a="",l=-1;for(let f=1;f<n.length;++f){let m=n[f];if(!a&&(m==="-"||m==="+"))a=m;else{let y=Number(m);!s&&y?s=y:l===-1&&(l=t+f)}}l!==-1&&i(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${n}`);let c=!1,u="",d=n.length;for(let f=1;f<e.length;++f){let m=e[f];switch(m.type){case"space":c=!0;case"newline":d+=m.source.length;break;case"comment":r&&!c&&i(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),d+=m.source.length,u=m.source.substring(1);break;case"error":i(m,"UNEXPECTED_TOKEN",m.message),d+=m.source.length;break;default:{let y=`Unexpected token in block scalar header: ${m.type}`;i(m,"UNEXPECTED_TOKEN",y);let h=m.source;h&&typeof h=="string"&&(d+=h.length)}}}return{mode:o,indent:s,chomp:a,comment:u,length:d}}function C3(t){let e=t.split(/\n( *)/),r=e[0],i=r.match(/^( *)/),o=[i?.[1]?[i[1],r.slice(i[1].length)]:["",r]];for(let s=1;s<e.length;s+=2)o.push([e[s],e[s+1]]);return o}l1.resolveBlockScalar=E3});var Eh=S(u1=>{"use strict";var Th=xe(),P3=Gn();function N3(t,e,r){let{offset:i,type:n,source:o,end:s}=t,a,l,c=(f,m,y)=>r(i+f,m,y);switch(n){case"scalar":a=Th.Scalar.PLAIN,l=O3(o,c);break;case"single-quoted-scalar":a=Th.Scalar.QUOTE_SINGLE,l=A3(o,c);break;case"double-quoted-scalar":a=Th.Scalar.QUOTE_DOUBLE,l=R3(o,c);break;default:return r(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${n}`),{value:"",type:null,comment:"",range:[i,i+o.length,i+o.length]}}let u=i+o.length,d=P3.resolveEnd(s,u,e,r);return{value:l,type:a,comment:d.comment,range:[i,u,d.offset]}}function O3(t,e){let r="";switch(t[0]){case" ":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":{r=`block scalar indicator ${t[0]}`;break}case"@":case"`":{r=`reserved character ${t[0]}`;break}}return r&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`),c1(t)}function A3(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),c1(t.slice(1,-1)).replace(/''/g,"'")}function c1(t){let e,r;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
126
|
-
`,"sy"),r=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
127
|
-
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,r=/[ \t]*(.*?)[ \t]*\r?\n/sy}let i=e.exec(t);if(!i)return t;let n=i[1],o=" ",s=e.lastIndex;for(r.lastIndex=s;i=r.exec(t);)i[1]===""?o===`
|
|
128
|
-
`?n+=o:o=`
|
|
129
|
-
`:(n+=o+i[1],o=" "),s=r.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=s,i=a.exec(t),n+o+(i?.[1]??"")}function R3(t,e){let r="";for(let i=1;i<t.length-1;++i){let n=t[i];if(!(n==="\r"&&t[i+1]===`
|
|
130
|
-
`))if(n===`
|
|
131
|
-
`){let{fold:o,offset:s}=D3(t,i);r+=o,i=s}else if(n==="\\"){let o=t[++i],s=L3[o];if(s)r+=s;else if(o===`
|
|
132
|
-
`)for(o=t[i+1];o===" "||o===" ";)o=t[++i+1];else if(o==="\r"&&t[i+1]===`
|
|
133
|
-
`)for(o=t[++i+1];o===" "||o===" ";)o=t[++i+1];else if(o==="x"||o==="u"||o==="U"){let a={x:2,u:4,U:8}[o];r+=z3(t,i+1,a,e),i+=a}else{let a=t.substr(i-1,2);e(i-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),r+=a}}else if(n===" "||n===" "){let o=i,s=t[i+1];for(;s===" "||s===" ";)s=t[++i+1];s!==`
|
|
134
|
-
`&&!(s==="\r"&&t[i+2]===`
|
|
135
|
-
`)&&(r+=i>o?t.slice(o,i+1):n)}else r+=n}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),r}function D3(t,e){let r="",i=t[e+1];for(;(i===" "||i===" "||i===`
|
|
136
|
-
`||i==="\r")&&!(i==="\r"&&t[e+2]!==`
|
|
137
|
-
`);)i===`
|
|
138
|
-
`&&(r+=`
|
|
139
|
-
`),e+=1,i=t[e+1];return r||(r=" "),{fold:r,offset:e}}var L3={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
140
|
-
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function z3(t,e,r,i){let n=t.substr(e,r),s=n.length===r&&/^[0-9a-fA-F]+$/.test(n)?parseInt(n,16):NaN;if(isNaN(s)){let a=t.substr(e-2,r+2);return i(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}return String.fromCodePoint(s)}u1.resolveFlowScalar=N3});var m1=S(f1=>{"use strict";var Wr=Y(),d1=xe(),j3=kh(),U3=Eh();function M3(t,e,r,i){let{value:n,type:o,comment:s,range:a}=e.type==="block-scalar"?j3.resolveBlockScalar(t,e,i):U3.resolveFlowScalar(e,t.options.strict,i),l=r?t.directives.tagName(r.source,d=>i(r,"TAG_RESOLVE_FAILED",d)):null,c;t.options.stringKeys&&t.atKey?c=t.schema[Wr.SCALAR]:l?c=q3(t.schema,n,l,r,i):e.type==="scalar"?c=F3(t,n,e,i):c=t.schema[Wr.SCALAR];let u;try{let d=c.resolve(n,f=>i(r??e,"TAG_RESOLVE_FAILED",f),t.options);u=Wr.isScalar(d)?d:new d1.Scalar(d)}catch(d){let f=d instanceof Error?d.message:String(d);i(r??e,"TAG_RESOLVE_FAILED",f),u=new d1.Scalar(n)}return u.range=a,u.source=n,o&&(u.type=o),l&&(u.tag=l),c.format&&(u.format=c.format),s&&(u.comment=s),u}function q3(t,e,r,i,n){if(r==="!")return t[Wr.SCALAR];let o=[];for(let a of t.tags)if(!a.collection&&a.tag===r)if(a.default&&a.test)o.push(a);else return a;for(let a of o)if(a.test?.test(e))return a;let s=t.knownTags[r];return s&&!s.collection?(t.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(n(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),t[Wr.SCALAR])}function F3({atKey:t,directives:e,schema:r},i,n,o){let s=r.tags.find(a=>(a.default===!0||t&&a.default==="key")&&a.test?.test(i))||r[Wr.SCALAR];if(r.compat){let a=r.compat.find(l=>l.default&&l.test?.test(i))??r[Wr.SCALAR];if(s.tag!==a.tag){let l=e.tagString(s.tag),c=e.tagString(a.tag),u=`Value may be parsed as either ${l} or ${c}`;o(n,"TAG_RESOLVE_FAILED",u,!0)}}return s}f1.composeScalar=M3});var h1=S(p1=>{"use strict";function B3(t,e,r){if(e){r??(r=e.length);for(let i=r-1;i>=0;--i){let n=e[i];switch(n.type){case"space":case"comment":case"newline":t-=n.source.length;continue}for(n=e[++i];n?.type==="space";)t+=n.source.length,n=e[++i];break}}return t}p1.emptyScalarPosition=B3});var v1=S(Ch=>{"use strict";var Z3=To(),K3=Y(),V3=a1(),g1=m1(),G3=Gn(),Q3=h1(),J3={composeNode:y1,composeEmptyNode:Ih};function y1(t,e,r,i){let n=t.atKey,{spaceBefore:o,comment:s,anchor:a,tag:l}=r,c,u=!0;switch(e.type){case"alias":c=W3(t,e,i),(a||l)&&i(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=g1.composeScalar(t,e,l,i),a&&(c.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":c=V3.composeCollection(J3,t,e,r,i),a&&(c.anchor=a.source.substring(1));break;default:{let d=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;i(e,"UNEXPECTED_TOKEN",d),c=Ih(t,e.offset,void 0,null,r,i),u=!1}}return a&&c.anchor===""&&i(a,"BAD_ALIAS","Anchor cannot be an empty string"),n&&t.options.stringKeys&&(!K3.isScalar(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&i(l??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(c.spaceBefore=!0),s&&(e.type==="scalar"&&e.source===""?c.comment=s:c.commentBefore=s),t.options.keepSourceTokens&&u&&(c.srcToken=e),c}function Ih(t,e,r,i,{spaceBefore:n,comment:o,anchor:s,tag:a,end:l},c){let u={type:"scalar",offset:Q3.emptyScalarPosition(e,r,i),indent:-1,source:""},d=g1.composeScalar(t,u,a,c);return s&&(d.anchor=s.source.substring(1),d.anchor===""&&c(s,"BAD_ALIAS","Anchor cannot be an empty string")),n&&(d.spaceBefore=!0),o&&(d.comment=o,d.range[2]=l),d}function W3({options:t},{offset:e,source:r,end:i},n){let o=new Z3.Alias(r.substring(1));o.source===""&&n(e,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&n(e+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let s=e+r.length,a=G3.resolveEnd(i,s,t.strict,n);return o.range=[e,s,a.offset],a.comment&&(o.comment=a.comment),o}Ch.composeEmptyNode=Ih;Ch.composeNode=y1});var S1=S(w1=>{"use strict";var H3=Bo(),b1=v1(),Y3=Gn(),X3=Go();function eZ(t,e,{offset:r,start:i,value:n,end:o},s){let a=Object.assign({_directives:e},t),l=new H3.Document(void 0,a),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},u=X3.resolveProps(i,{indicator:"doc-start",next:n??o?.[0],offset:r,onError:s,parentIndent:0,startOnNewline:!0});u.found&&(l.directives.docStart=!0,n&&(n.type==="block-map"||n.type==="block-seq")&&!u.hasNewline&&s(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=n?b1.composeNode(c,n,u,s):b1.composeEmptyNode(c,u.end,i,null,u,s);let d=l.contents.range[2],f=Y3.resolveEnd(o,d,!1,s);return f.comment&&(l.comment=f.comment),l.range=[r,d,f.offset],l}w1.composeDoc=eZ});var Nh=S($1=>{"use strict";var tZ=X("process"),rZ=gp(),nZ=Bo(),Qo=Vo(),x1=Y(),iZ=S1(),oZ=Gn();function Jo(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:r}=t;return[e,e+(typeof r=="string"?r.length:1)]}function _1(t){let e="",r=!1,i=!1;for(let n=0;n<t.length;++n){let o=t[n];switch(o[0]){case"#":e+=(e===""?"":i?`
|
|
141
|
-
|
|
142
|
-
`:`
|
|
143
|
-
`)+(o.substring(1)||" "),r=!0,i=!1;break;case"%":t[n+1]?.[0]!=="#"&&(n+=1),r=!1;break;default:r||(i=!0),r=!1}}return{comment:e,afterEmptyLine:i}}var Ph=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(r,i,n,o)=>{let s=Jo(r);o?this.warnings.push(new Qo.YAMLWarning(s,i,n)):this.errors.push(new Qo.YAMLParseError(s,i,n))},this.directives=new rZ.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:i,afterEmptyLine:n}=_1(this.prelude);if(i){let o=e.contents;if(r)e.comment=e.comment?`${e.comment}
|
|
144
|
-
${i}`:i;else if(n||e.directives.docStart||!o)e.commentBefore=i;else if(x1.isCollection(o)&&!o.flow&&o.items.length>0){let s=o.items[0];x1.isPair(s)&&(s=s.key);let a=s.commentBefore;s.commentBefore=a?`${i}
|
|
145
|
-
${a}`:i}else{let s=o.commentBefore;o.commentBefore=s?`${i}
|
|
146
|
-
${s}`:i}}r?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:_1(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,r=!1,i=-1){for(let n of e)yield*this.next(n);yield*this.end(r,i)}*next(e){switch(tZ.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(r,i,n)=>{let o=Jo(e);o[0]+=r,this.onError(o,"BAD_DIRECTIVE",i,n)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=iZ.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!r.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(r,!1),this.doc&&(yield this.doc),this.doc=r,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let r=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,i=new Qo.YAMLParseError(Jo(e),"UNEXPECTED_TOKEN",r);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){let i="Unexpected doc-end without preceding document";this.errors.push(new Qo.YAMLParseError(Jo(e),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;let r=oZ.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),r.comment){let i=this.doc.comment;this.doc.comment=i?`${i}
|
|
147
|
-
${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new Qo.YAMLParseError(Jo(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,r=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let i=Object.assign({_directives:this.directives},this.options),n=new nZ.Document(void 0,i);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),n.range=[0,r,r],this.decorate(n,!1),yield n}}};$1.Composer=Ph});var E1=S(Jl=>{"use strict";var sZ=kh(),aZ=Eh(),lZ=Vo(),k1=No();function cZ(t,e=!0,r){if(t){let i=(n,o,s)=>{let a=typeof n=="number"?n:Array.isArray(n)?n[0]:n.offset;if(r)r(a,o,s);else throw new lZ.YAMLParseError([a,a+1],o,s)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return aZ.resolveFlowScalar(t,e,i);case"block-scalar":return sZ.resolveBlockScalar({options:{strict:e}},t,i)}}return null}function uZ(t,e){let{implicitKey:r=!1,indent:i,inFlow:n=!1,offset:o=-1,type:s="PLAIN"}=e,a=k1.stringifyString({type:s,value:t},{implicitKey:r,indent:i>0?" ".repeat(i):"",inFlow:n,options:{blockQuote:!0,lineWidth:-1}}),l=e.end??[{type:"newline",offset:-1,indent:i,source:`
|
|
148
|
-
`}];switch(a[0]){case"|":case">":{let c=a.indexOf(`
|
|
149
|
-
`),u=a.substring(0,c),d=a.substring(c+1)+`
|
|
150
|
-
`,f=[{type:"block-scalar-header",offset:o,indent:i,source:u}];return T1(f,l)||f.push({type:"newline",offset:-1,indent:i,source:`
|
|
151
|
-
`}),{type:"block-scalar",offset:o,indent:i,props:f,source:d}}case'"':return{type:"double-quoted-scalar",offset:o,indent:i,source:a,end:l};case"'":return{type:"single-quoted-scalar",offset:o,indent:i,source:a,end:l};default:return{type:"scalar",offset:o,indent:i,source:a,end:l}}}function dZ(t,e,r={}){let{afterKey:i=!1,implicitKey:n=!1,inFlow:o=!1,type:s}=r,a="indent"in t?t.indent:null;if(i&&typeof a=="number"&&(a+=2),!s)switch(t.type){case"single-quoted-scalar":s="QUOTE_SINGLE";break;case"double-quoted-scalar":s="QUOTE_DOUBLE";break;case"block-scalar":{let c=t.props[0];if(c.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s=c.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:s="PLAIN"}let l=k1.stringifyString({type:s,value:e},{implicitKey:n||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":fZ(t,l);break;case'"':Oh(t,l,"double-quoted-scalar");break;case"'":Oh(t,l,"single-quoted-scalar");break;default:Oh(t,l,"scalar")}}function fZ(t,e){let r=e.indexOf(`
|
|
152
|
-
`),i=e.substring(0,r),n=e.substring(r+1)+`
|
|
153
|
-
`;if(t.type==="block-scalar"){let o=t.props[0];if(o.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o.source=i,t.source=n}else{let{offset:o}=t,s="indent"in t?t.indent:-1,a=[{type:"block-scalar-header",offset:o,indent:s,source:i}];T1(a,"end"in t?t.end:void 0)||a.push({type:"newline",offset:-1,indent:s,source:`
|
|
154
|
-
`});for(let l of Object.keys(t))l!=="type"&&l!=="offset"&&delete t[l];Object.assign(t,{type:"block-scalar",indent:s,props:a,source:n})}}function T1(t,e){if(e)for(let r of e)switch(r.type){case"space":case"comment":t.push(r);break;case"newline":return t.push(r),!0}return!1}function Oh(t,e,r){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=r,t.source=e;break;case"block-scalar":{let i=t.props.slice(1),n=e.length;t.props[0].type==="block-scalar-header"&&(n-=t.props[0].source.length);for(let o of i)o.offset+=n;delete t.props,Object.assign(t,{type:r,source:e,end:i});break}case"block-map":case"block-seq":{let n={type:"newline",offset:t.offset+e.length,indent:t.indent,source:`
|
|
155
|
-
`};delete t.items,Object.assign(t,{type:r,source:e,end:[n]});break}default:{let i="indent"in t?t.indent:-1,n="end"in t&&Array.isArray(t.end)?t.end.filter(o=>o.type==="space"||o.type==="comment"||o.type==="newline"):[];for(let o of Object.keys(t))o!=="type"&&o!=="offset"&&delete t[o];Object.assign(t,{type:r,indent:i,source:e,end:n})}}}Jl.createScalarToken=uZ;Jl.resolveAsScalar=cZ;Jl.setScalarValue=dZ});var C1=S(I1=>{"use strict";var mZ=t=>"type"in t?Hl(t):Wl(t);function Hl(t){switch(t.type){case"block-scalar":{let e="";for(let r of t.props)e+=Hl(r);return e+t.source}case"block-map":case"block-seq":{let e="";for(let r of t.items)e+=Wl(r);return e}case"flow-collection":{let e=t.start.source;for(let r of t.items)e+=Wl(r);for(let r of t.end)e+=r.source;return e}case"document":{let e=Wl(t);if(t.end)for(let r of t.end)e+=r.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let r of t.end)e+=r.source;return e}}}function Wl({start:t,key:e,sep:r,value:i}){let n="";for(let o of t)n+=o.source;if(e&&(n+=Hl(e)),r)for(let o of r)n+=o.source;return i&&(n+=Hl(i)),n}I1.stringify=mZ});var A1=S(O1=>{"use strict";var Ah=Symbol("break visit"),pZ=Symbol("skip children"),P1=Symbol("remove item");function Hr(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),N1(Object.freeze([]),t,e)}Hr.BREAK=Ah;Hr.SKIP=pZ;Hr.REMOVE=P1;Hr.itemAtPath=(t,e)=>{let r=t;for(let[i,n]of e){let o=r?.[i];if(o&&"items"in o)r=o.items[n];else return}return r};Hr.parentCollection=(t,e)=>{let r=Hr.itemAtPath(t,e.slice(0,-1)),i=e[e.length-1][0],n=r?.[i];if(n&&"items"in n)return n;throw new Error("Parent collection not found")};function N1(t,e,r){let i=r(e,t);if(typeof i=="symbol")return i;for(let n of["key","value"]){let o=e[n];if(o&&"items"in o){for(let s=0;s<o.items.length;++s){let a=N1(Object.freeze(t.concat([[n,s]])),o.items[s],r);if(typeof a=="number")s=a-1;else{if(a===Ah)return Ah;a===P1&&(o.items.splice(s,1),s-=1)}}typeof i=="function"&&n==="key"&&(i=i(e,t))}}return typeof i=="function"?i(e,t):i}O1.visit=Hr});var Yl=S(Ge=>{"use strict";var Rh=E1(),hZ=C1(),gZ=A1(),Dh="\uFEFF",Lh="",zh="",jh="",yZ=t=>!!t&&"items"in t,vZ=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function bZ(t){switch(t){case Dh:return"<BOM>";case Lh:return"<DOC>";case zh:return"<FLOW_END>";case jh:return"<SCALAR>";default:return JSON.stringify(t)}}function wZ(t){switch(t){case Dh:return"byte-order-mark";case Lh:return"doc-mode";case zh:return"flow-error-end";case jh:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
156
|
-
`:case`\r
|
|
157
|
-
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}Ge.createScalarToken=Rh.createScalarToken;Ge.resolveAsScalar=Rh.resolveAsScalar;Ge.setScalarValue=Rh.setScalarValue;Ge.stringify=hZ.stringify;Ge.visit=gZ.visit;Ge.BOM=Dh;Ge.DOCUMENT=Lh;Ge.FLOW_END=zh;Ge.SCALAR=jh;Ge.isCollection=yZ;Ge.isScalar=vZ;Ge.prettyToken=bZ;Ge.tokenType=wZ});var qh=S(D1=>{"use strict";var Wo=Yl();function kt(t){switch(t){case void 0:case" ":case`
|
|
158
|
-
`:case"\r":case" ":return!0;default:return!1}}var R1=new Set("0123456789ABCDEFabcdef"),SZ=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Xl=new Set(",[]{}"),xZ=new Set(` ,[]{}
|
|
159
|
-
\r `),Uh=t=>!t||xZ.has(t),Mh=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,r=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!r;let i=this.next??"stream";for(;i&&(r||this.hasChars(1));)i=yield*this.parseNext(i)}atLineEnd(){let e=this.pos,r=this.buffer[e];for(;r===" "||r===" ";)r=this.buffer[++e];return!r||r==="#"||r===`
|
|
160
|
-
`?!0:r==="\r"?this.buffer[e+1]===`
|
|
161
|
-
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let r=this.buffer[e];if(this.indentNext>0){let i=0;for(;r===" ";)r=this.buffer[++i+e];if(r==="\r"){let n=this.buffer[i+e+1];if(n===`
|
|
162
|
-
`||!n&&!this.atEnd)return e+i+1}return r===`
|
|
163
|
-
`||i>=this.indentNext||!r&&!this.atEnd?e+i:-1}if(r==="-"||r==="."){let i=this.buffer.substr(e,3);if((i==="---"||i==="...")&&kt(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
|
|
164
|
-
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===Wo.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let r=e.length,i=e.indexOf("#");for(;i!==-1;){let o=e[i-1];if(o===" "||o===" "){r=i-1;break}else i=e.indexOf("#",i+1)}for(;;){let o=e[r-1];if(o===" "||o===" ")r-=1;else break}let n=(yield*this.pushCount(r))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-n),this.pushNewline(),"stream"}if(this.atLineEnd()){let r=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-r),yield*this.pushNewline(),"stream"}return yield Wo.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let r=this.peek(3);if((r==="---"||r==="...")&&kt(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,r==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!kt(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,r]=this.peek(2);if(!r&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&kt(r)){let i=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=i,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let r=yield*this.pushIndicators();switch(e[r]){case"#":yield*this.pushCount(e.length-r);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Uh),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return r+=yield*this.parseBlockScalarHeader(),r+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-r),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,r,i=-1;do e=yield*this.pushNewline(),e>0?(r=yield*this.pushSpaces(!1),this.indentValue=i=r):r=0,r+=yield*this.pushSpaces(!0);while(e+r>0);let n=this.getLine();if(n===null)return this.setNext("flow");if((i!==-1&&i<this.indentNext&&n[0]!=="#"||i===0&&(n.startsWith("---")||n.startsWith("..."))&&kt(n[3]))&&!(i===this.indentNext-1&&this.flowLevel===1&&(n[0]==="]"||n[0]==="}")))return this.flowLevel=0,yield Wo.FLOW_END,yield*this.parseLineStart();let o=0;for(;n[o]===",";)o+=yield*this.pushCount(1),o+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(o+=yield*this.pushIndicators(),n[o]){case void 0:return"flow";case"#":return yield*this.pushCount(n.length-o),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Uh),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let s=this.charAt(1);if(this.flowKey||kt(s)||s===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),r=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;r!==-1&&this.buffer[r+1]==="'";)r=this.buffer.indexOf("'",r+2);else for(;r!==-1;){let o=0;for(;this.buffer[r-1-o]==="\\";)o+=1;if(o%2===0)break;r=this.buffer.indexOf('"',r+1)}let i=this.buffer.substring(0,r),n=i.indexOf(`
|
|
165
|
-
`,this.pos);if(n!==-1){for(;n!==-1;){let o=this.continueScalar(n+1);if(o===-1)break;n=i.indexOf(`
|
|
166
|
-
`,o)}n!==-1&&(r=n-(i[n-1]==="\r"?2:1))}if(r===-1){if(!this.atEnd)return this.setNext("quoted-scalar");r=this.buffer.length}return yield*this.pushToIndex(r+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let r=this.buffer[++e];if(r==="+")this.blockScalarKeep=!0;else if(r>"0"&&r<="9")this.blockScalarIndent=Number(r)-1;else if(r!=="-")break}return yield*this.pushUntil(r=>kt(r)||r==="#")}*parseBlockScalar(){let e=this.pos-1,r=0,i;e:for(let o=this.pos;i=this.buffer[o];++o)switch(i){case" ":r+=1;break;case`
|
|
167
|
-
`:e=o,r=0;break;case"\r":{let s=this.buffer[o+1];if(!s&&!this.atEnd)return this.setNext("block-scalar");if(s===`
|
|
168
|
-
`)break}default:break e}if(!i&&!this.atEnd)return this.setNext("block-scalar");if(r>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=r:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let o=this.continueScalar(e+1);if(o===-1)break;e=this.buffer.indexOf(`
|
|
169
|
-
`,o)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let n=e+1;for(i=this.buffer[n];i===" ";)i=this.buffer[++n];if(i===" "){for(;i===" "||i===" "||i==="\r"||i===`
|
|
170
|
-
`;)i=this.buffer[++n];e=n-1}else if(!this.blockScalarKeep)do{let o=e-1,s=this.buffer[o];s==="\r"&&(s=this.buffer[--o]);let a=o;for(;s===" ";)s=this.buffer[--o];if(s===`
|
|
171
|
-
`&&o>=this.pos&&o+1+r>a)e=o;else break}while(!0);return yield Wo.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,r=this.pos-1,i=this.pos-1,n;for(;n=this.buffer[++i];)if(n===":"){let o=this.buffer[i+1];if(kt(o)||e&&Xl.has(o))break;r=i}else if(kt(n)){let o=this.buffer[i+1];if(n==="\r"&&(o===`
|
|
172
|
-
`?(i+=1,n=`
|
|
173
|
-
`,o=this.buffer[i+1]):r=i),o==="#"||e&&Xl.has(o))break;if(n===`
|
|
174
|
-
`){let s=this.continueScalar(i+1);if(s===-1)break;i=Math.max(i,s-2)}}else{if(e&&Xl.has(n))break;r=i}return!n&&!this.atEnd?this.setNext("plain-scalar"):(yield Wo.SCALAR,yield*this.pushToIndex(r+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,r){let i=this.buffer.slice(this.pos,e);return i?(yield i,this.pos+=i.length,i.length):(r&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(Uh))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let e=this.flowLevel>0,r=this.charAt(1);if(kt(r)||e&&Xl.has(r))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,r=this.buffer[e];for(;!kt(r)&&r!==">";)r=this.buffer[++e];return yield*this.pushToIndex(r===">"?e+1:e,!1)}else{let e=this.pos+1,r=this.buffer[e];for(;r;)if(SZ.has(r))r=this.buffer[++e];else if(r==="%"&&R1.has(this.buffer[e+1])&&R1.has(this.buffer[e+2]))r=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
|
|
175
|
-
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
|
|
176
|
-
`?yield*this.pushCount(2):0}*pushSpaces(e){let r=this.pos-1,i;do i=this.buffer[++r];while(i===" "||e&&i===" ");let n=r-this.pos;return n>0&&(yield this.buffer.substr(this.pos,n),this.pos=r),n}*pushUntil(e){let r=this.pos,i=this.buffer[r];for(;!e(i);)i=this.buffer[++r];return yield*this.pushToIndex(r,!1)}};D1.Lexer=Mh});var Bh=S(L1=>{"use strict";var Fh=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let r=0,i=this.lineStarts.length;for(;r<i;){let o=r+i>>1;this.lineStarts[o]<e?r=o+1:i=o}if(this.lineStarts[r]===e)return{line:r+1,col:1};if(r===0)return{line:0,col:e};let n=this.lineStarts[r-1];return{line:r,col:e-n+1}}}};L1.LineCounter=Fh});var Kh=S(q1=>{"use strict";var _Z=X("process"),z1=Yl(),$Z=qh();function xr(t,e){for(let r=0;r<t.length;++r)if(t[r].type===e)return!0;return!1}function j1(t){for(let e=0;e<t.length;++e)switch(t[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function M1(t){switch(t?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function ec(t){switch(t.type){case"document":return t.start;case"block-map":{let e=t.items[t.items.length-1];return e.sep??e.start}case"block-seq":return t.items[t.items.length-1].start;default:return[]}}function Qn(t){if(t.length===0)return[];let e=t.length;e:for(;--e>=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function U1(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!xr(e.start,"explicit-key-ind")&&!xr(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,M1(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}var Zh=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new $Z.Lexer,this.onNewLine=e}*parse(e,r=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let i of this.lexer.lex(e,r))yield*this.next(i);r||(yield*this.end())}*next(e){if(this.source=e,_Z.env.LOG_TOKENS&&console.log("|",z1.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let r=z1.tokenType(e);if(r)if(r==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=r,yield*this.step(),r){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let i=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:i,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let r=e??this.stack.pop();if(!r)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield r;else{let i=this.peek(1);switch(r.type==="block-scalar"?r.indent="indent"in i?i.indent:0:r.type==="flow-collection"&&i.type==="document"&&(r.indent=0),r.type==="flow-collection"&&U1(r),i.type){case"document":i.value=r;break;case"block-scalar":i.props.push(r);break;case"block-map":{let n=i.items[i.items.length-1];if(n.value){i.items.push({start:[],key:r,sep:[]}),this.onKeyLine=!0;return}else if(n.sep)n.value=r;else{Object.assign(n,{key:r,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case"block-seq":{let n=i.items[i.items.length-1];n.value?i.items.push({start:[],value:r}):n.value=r;break}case"flow-collection":{let n=i.items[i.items.length-1];!n||n.value?i.items.push({start:[],key:r,sep:[]}):n.sep?n.value=r:Object.assign(n,{key:r,sep:[]});return}default:yield*this.pop(),yield*this.pop(r)}if((i.type==="document"||i.type==="block-map"||i.type==="block-seq")&&(r.type==="block-map"||r.type==="block-seq")){let n=r.items[r.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&j1(n.start)===-1&&(r.indent===0||n.start.every(o=>o.type!=="comment"||o.indent<r.indent))&&(i.type==="document"?i.end=n.start:i.items.push({start:n.start}),r.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{j1(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let r=this.startBlockValue(e);r?this.stack.push(r):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let r=ec(this.peek(2)),i=Qn(r),n;e.end?(n=e.end,n.push(this.sourceToken),delete e.end):n=[this.sourceToken];let o={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:n}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let r=this.source.indexOf(`
|
|
177
|
-
`)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
|
|
178
|
-
`,r)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,r.value){let i="end"in r.value?r.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else if(r.sep)r.sep.push(this.sourceToken);else{if(this.atIndentedComment(r.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Array.prototype.push.apply(n,r.start),n.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let i=!this.onKeyLine&&this.indent===e.indent,n=i&&(r.sep||r.explicitKey)&&this.type!=="seq-item-ind",o=[];if(n&&r.sep&&!r.value){let s=[];for(let a=0;a<r.sep.length;++a){let l=r.sep[a];switch(l.type){case"newline":s.push(a);break;case"space":break;case"comment":l.indent>e.indent&&(s.length=0);break;default:s.length=0}}s.length>=2&&(o=r.sep.splice(s[1]))}switch(this.type){case"anchor":case"tag":n||r.value?(o.push(this.sourceToken),e.items.push({start:o}),this.onKeyLine=!0):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"explicit-key-ind":!r.sep&&!r.explicitKey?(r.start.push(this.sourceToken),r.explicitKey=!0):n||r.value?(o.push(this.sourceToken),e.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(r.explicitKey)if(r.sep)if(r.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(xr(r.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(M1(r.key)&&!xr(r.sep,"newline")){let s=Qn(r.start),a=r.key,l=r.sep;l.push(this.sourceToken),delete r.key,delete r.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:a,sep:l}]})}else o.length>0?r.sep=r.sep.concat(o,this.sourceToken):r.sep.push(this.sourceToken);else if(xr(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let s=Qn(r.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]})}else r.sep?r.value||n?e.items.push({start:o,key:null,sep:[this.sourceToken]}):xr(r.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let s=this.flowScalar(this.type);n||r.value?(e.items.push({start:o,key:s,sep:[]}),this.onKeyLine=!0):r.sep?this.stack.push(s):(Object.assign(r,{key:s,sep:[]}),this.onKeyLine=!0);return}default:{let s=this.startBlockValue(e);if(s){if(s.type==="block-seq"){if(!r.explicitKey&&r.sep&&!xr(r.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else i&&e.items.push({start:o});this.stack.push(s);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(r.value){let i="end"in r.value?r.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(r.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Array.prototype.push.apply(n,r.start),n.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return;case"anchor":case"tag":if(r.value||this.indent<=e.indent)break;r.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;r.value||xr(r.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return}if(this.indent>e.indent){let i=this.startBlockValue(e);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let r=e.items[e.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while(i?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!r||r.sep?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return;case"map-value-ind":!r||r.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!r||r.value?e.items.push({start:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let n=this.flowScalar(this.type);!r||r.value?e.items.push({start:[],key:n,sep:[]}):r.sep?this.stack.push(n):Object.assign(r,{key:n,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let i=this.startBlockValue(e);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{let i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===e.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){let n=ec(i),o=Qn(n);U1(e);let s=e.end.splice(1,e.end.length);s.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:o,key:e,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let r=this.source.indexOf(`
|
|
179
|
-
`)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
|
|
180
|
-
`,r)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let r=ec(e),i=Qn(r);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let r=ec(e),i=Qn(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,r){return this.type!=="comment"||this.indent<=r?!1:e.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};q1.Parser=Zh});var V1=S(Yo=>{"use strict";var F1=Nh(),kZ=Bo(),Ho=Vo(),TZ=Cp(),EZ=Y(),IZ=Bh(),B1=Kh();function Z1(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new IZ.LineCounter||null,prettyErrors:e}}function CZ(t,e={}){let{lineCounter:r,prettyErrors:i}=Z1(e),n=new B1.Parser(r?.addNewLine),o=new F1.Composer(e),s=Array.from(o.compose(n.parse(t)));if(i&&r)for(let a of s)a.errors.forEach(Ho.prettifyError(t,r)),a.warnings.forEach(Ho.prettifyError(t,r));return s.length>0?s:Object.assign([],{empty:!0},o.streamInfo())}function K1(t,e={}){let{lineCounter:r,prettyErrors:i}=Z1(e),n=new B1.Parser(r?.addNewLine),o=new F1.Composer(e),s=null;for(let a of o.compose(n.parse(t),!0,t.length))if(!s)s=a;else if(s.options.logLevel!=="silent"){s.errors.push(new Ho.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&r&&(s.errors.forEach(Ho.prettifyError(t,r)),s.warnings.forEach(Ho.prettifyError(t,r))),s}function PZ(t,e,r){let i;typeof e=="function"?i=e:r===void 0&&e&&typeof e=="object"&&(r=e);let n=K1(t,r);if(!n)return null;if(n.warnings.forEach(o=>TZ.warn(n.options.logLevel,o)),n.errors.length>0){if(n.options.logLevel!=="silent")throw n.errors[0];n.errors=[]}return n.toJS(Object.assign({reviver:i},r))}function NZ(t,e,r){let i=null;if(typeof e=="function"||Array.isArray(e)?i=e:r===void 0&&e&&(r=e),typeof r=="string"&&(r=r.length),typeof r=="number"){let n=Math.round(r);r=n<1?void 0:n>8?{indent:8}:{indent:n}}if(t===void 0){let{keepUndefined:n}=r??e??{};if(!n)return}return EZ.isDocument(t)&&!i?t.toString(r):new kZ.Document(t,i,r).toString(r)}Yo.parse=PZ;Yo.parseAllDocuments=CZ;Yo.parseDocument=K1;Yo.stringify=NZ});var Gh=S(ee=>{"use strict";var OZ=Nh(),AZ=Bo(),RZ=dh(),Vh=Vo(),DZ=To(),_r=Y(),LZ=vr(),zZ=xe(),jZ=wr(),UZ=Sr(),MZ=Yl(),qZ=qh(),FZ=Bh(),BZ=Kh(),tc=V1(),G1=xo();ee.Composer=OZ.Composer;ee.Document=AZ.Document;ee.Schema=RZ.Schema;ee.YAMLError=Vh.YAMLError;ee.YAMLParseError=Vh.YAMLParseError;ee.YAMLWarning=Vh.YAMLWarning;ee.Alias=DZ.Alias;ee.isAlias=_r.isAlias;ee.isCollection=_r.isCollection;ee.isDocument=_r.isDocument;ee.isMap=_r.isMap;ee.isNode=_r.isNode;ee.isPair=_r.isPair;ee.isScalar=_r.isScalar;ee.isSeq=_r.isSeq;ee.Pair=LZ.Pair;ee.Scalar=zZ.Scalar;ee.YAMLMap=jZ.YAMLMap;ee.YAMLSeq=UZ.YAMLSeq;ee.CST=MZ;ee.Lexer=qZ.Lexer;ee.LineCounter=FZ.LineCounter;ee.Parser=BZ.Parser;ee.parse=tc.parse;ee.parseAllDocuments=tc.parseAllDocuments;ee.parseDocument=tc.parseDocument;ee.stringify=tc.stringify;ee.visit=G1.visit;ee.visitAsync=G1.visitAsync});import{execSync as x_}from"node:child_process";function Vi(t){let e=t.split(/\s+/)[0],r={encoding:"utf8",stdio:["ignore","pipe","pipe"],windowsHide:!0};try{return x_(`command -v ${e}`,r),!0}catch{try{return x_(`where ${e}`,r),!0}catch{return!1}}}var oa;function __(t){oa=t}function $_(){return oa}function k_(t){return oa===void 0?t():String(oa)}import{basename as iJ}from"node:path";import{appendFileSync as Pj,readFileSync as Nj}from"node:fs";function fn(t){return t.filter(e=>e.source!=="already-raised")}var qz=["blocker","major","minor","nit"],Fz=["confirmed","disputed","claude-only","codex-only","already-raised"];function Bz(t){return qz.includes(t)}function Zz(t){return Fz.includes(t)}function Gi(t,e){let r=new RegExp(`^-\\s+${e}:\\s*(.*)$`,"im"),i=t.match(r);return i?i[1].trim():""}function Kz(t){return t.replace(/^`+|`+$/g,"").trim()}function Vz(t){let e=t.indexOf(`
|
|
181
|
-
`),r=e===-1?t.trim():t.slice(0,e).trim(),i=e===-1?"":t.slice(e+1),n=Gi(i,"Severity").toLowerCase(),o=Gi(i,"Source").toLowerCase();return{title:r,severity:Bz(n)?n:null,source:Zz(o)?o:null,location:Kz(Gi(i,"Location")),impact:Gi(i,"Impact"),recommendation:Gi(i,"Recommendation")}}function sa(t){return t.split(/^###\s+Finding:\s*/m).slice(1).map(Vz)}var Gz=["blocker","major","minor","nit"];function Qz(t){return Gz.includes(t)}function Jz(t){let e=t.match(/^##\s+Summary\s*\n([\s\S]*?)(?=\n##\s|\n###\s|$)/m);return e?e[1].trim():""}function Wz(t){let e={blocker:0,major:0,minor:0,nit:0},r=/^-\s+Severity:\s*([a-zA-Z]+)/gm;for(let i of t.matchAll(r)){let n=i[1].toLowerCase();Qz(n)&&e[n]++}return e}function T_(t){let e=Wz(t),r=e.blocker+e.major+e.minor+e.nit;return{summary:Jz(t),totals:e,findingCount:r}}function E_(t){let e=[],{totals:r,findingCount:i}=t;return e.push(`Findings: ${i} (blocker ${r.blocker}, major ${r.major}, minor ${r.minor}, nit ${r.nit})`),t.summary&&e.push("",t.summary),e.join(`
|
|
182
|
-
`)}var Hz={"out-of-diff":"its line falls outside the PR diff",unlocated:"it has no parseable file:line","comment-rejected":"GitHub rejected its line comment"};function I_(t){return`- **${t.severity??"finding"}: ${t.title}**`}function Yz(t){let e=t.location.trim();return!e||e.toLowerCase()==="n/a"?"no location":`\`${e}\``}function Xz(t){let e=[`${I_(t)} \u2014 ${Yz(t)}`,` - Not anchored: ${Hz[t.reason]}`];return t.impact&&e.push(` - Impact: ${t.impact}`),t.recommendation&&e.push(` - Recommendation: ${t.recommendation}`),e}function nr(t,e=[]){let r=T_(t),i=sa(t),n=["## Code review summary","",E_(r)];if(i.length>0){n.push("","### Findings","");for(let s of i)n.push(I_(s))}let o=fn(e);if(o.length>0){n.push("","### Findings not anchored to the diff","","No line comment could be attached to these, so the detail is here instead.","");for(let s of o)n.push(...Xz(s))}return n.join(`
|
|
183
|
-
`)}function C_(t){return Number.isInteger(t)&&t>=1}function ej(t){if(!t.location||t.location.toLowerCase()==="n/a")return null;let e=t.location.match(/^(.+):(\d+)(?:-(\d+))?$/);if(!e)return null;let r=Number.parseInt(e[2],10),i=e[3]?Number.parseInt(e[3],10):r;if(!C_(r)||!C_(i)||i<r)return null;let n={...t,file:e[1],line:i};return r===i?n:{...n,startLine:r}}function P_(t){let e=[],r=[],i=[];for(let n of t){if(n.source==="already-raised"){i.push(n);continue}let o=ej(n);o?e.push(o):r.push(n)}return{lineBound:e,unlocated:r,alreadyRaised:i}}var tj=/^\+\+\+ (?:b\/)?(.+)$/,rj=/^@@ -\d+(?:,\d+)? \+(\d+)(?:,\d+)? @@/;function N_(t){let e=new Map,r=null,i=0;for(let n of t.split(`
|
|
184
|
-
`)){let o=n.match(tj);if(o){r=o[1]==="/dev/null"?null:o[1];continue}let s=n.match(rj);if(s){i=Number(s[1]);continue}if(r!==null&&!n.startsWith("-")&&(n.startsWith("+")||n.startsWith(" "))){let a=e.get(r);a||(a=new Set,e.set(r,a)),a.add(i),i++}}return e}import{execSync as qd}from"node:child_process";import{execSync as Md}from"node:child_process";import{execSync as Ud}from"node:child_process";var nj=/(?:git@github\.com:|https:\/\/github\.com\/)([^/]+)\/([^/]+?)(?:\.git)?\/?$/;function O_(t){let e=t.match(nj);return e?{org:e[1],repo:e[2]}:null}function ij(t,e){try{return Ud(`git remote get-url ${t}`,{encoding:"utf8",stdio:["pipe","pipe","pipe"],windowsHide:!0,cwd:e}).trim()}catch{return null}}function oj(t){try{let e=Ud("git rev-parse --abbrev-ref --symbolic-full-name @{u}",{encoding:"utf8",stdio:["pipe","pipe","pipe"],windowsHide:!0,cwd:t}).trim(),[r]=e.split("/",1);return r||null}catch{return null}}function sj(t){try{return Ud("git remote",{encoding:"utf8",stdio:["pipe","pipe","pipe"],windowsHide:!0,cwd:t}).trim().split(`
|
|
185
|
-
`).filter(Boolean)}catch{return[]}}function A_(t){let e=[],r=oj(t);r&&e.push(r),e.includes("origin")||e.push("origin");for(let i of sj(t))i!=="upstream"&&!e.includes(i)&&e.push(i);for(let i of e){let n=ij(i,t);if(!n)continue;let o=O_(n);if(o)return o}return null}function aa(t){if(t instanceof Error){let e=t.message.toLowerCase();return e.includes("enoent")||e.includes("command not found")}return!1}function ir(){let t=A_();if(t)return t;let e=JSON.parse(Md("gh repo view --json owner,name",{encoding:"utf8"}));return{org:e.owner.login,repo:e.name}}function aj(){return Md("git rev-parse --abbrev-ref HEAD",{encoding:"utf8"}).trim()}function R_(t){let{org:e,repo:r}=ir();return JSON.parse(Md(`gh pr view ${k_(aj)} --json ${t} -R ${e}/${r}`,{encoding:"utf8"}))}function la(){try{return R_("id").id}catch(t){throw t instanceof Error&&t.message.includes("no pull requests")&&(console.error("Error: No pull request found for the current branch."),process.exit(1)),t}}function ca(){return lj()?.number??null}function lj(){try{return R_("number,state")}catch(t){if(t instanceof Error&&t.message.includes("no pull requests"))return null;throw t}}function ua(t,e,r){let{org:i,repo:n}=ir();try{return qd(`gh pr diff ${t} -R ${i}/${n}`,{encoding:"utf8",maxBuffer:256*1024*1024,stdio:["ignore","pipe","pipe"]})}catch(o){if(!cj(o))throw o;return uj(e,r)}}function cj(t){return t instanceof Error&&(t.message.includes("too_large")||t.message.includes("maximum number of files"))}function uj(t,e){try{qd(`git fetch origin ${t} ${e}`,{stdio:"ignore"})}catch{}return qd(`git diff ${t}...${e}`,{encoding:"utf8",maxBuffer:256*1024*1024})}function dj(t,e){let r=e.get(t.file);return!(!r||!r.has(t.line)||t.startLine!==void 0&&!r.has(t.startLine))}function D_(t,e){let r=[],i=[];for(let n of t)dj(n,e)?r.push(n):i.push(n);return{inDiff:r,outOfDiff:i}}var L_=(t=0)=>e=>`\x1B[${e+t}m`,z_=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,j_=(t=0)=>(e,r,i)=>`\x1B[${38+t};2;${e};${r};${i}m`,ue={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},UJ=Object.keys(ue.modifier),fj=Object.keys(ue.color),mj=Object.keys(ue.bgColor),MJ=[...fj,...mj];function pj(){let t=new Map;for(let[e,r]of Object.entries(ue)){for(let[i,n]of Object.entries(r))ue[i]={open:`\x1B[${n[0]}m`,close:`\x1B[${n[1]}m`},r[i]=ue[i],t.set(n[0],n[1]);Object.defineProperty(ue,e,{value:r,enumerable:!1})}return Object.defineProperty(ue,"codes",{value:t,enumerable:!1}),ue.color.close="\x1B[39m",ue.bgColor.close="\x1B[49m",ue.color.ansi=L_(),ue.color.ansi256=z_(),ue.color.ansi16m=j_(),ue.bgColor.ansi=L_(10),ue.bgColor.ansi256=z_(10),ue.bgColor.ansi16m=j_(10),Object.defineProperties(ue,{rgbToAnsi256:{value(e,r,i){return e===r&&r===i?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(i/255*5)},enumerable:!1},hexToRgb:{value(e){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[i]=r;i.length===3&&(i=[...i].map(o=>o+o).join(""));let n=Number.parseInt(i,16);return[n>>16&255,n>>8&255,n&255]},enumerable:!1},hexToAnsi256:{value:e=>ue.rgbToAnsi256(...ue.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,i,n;if(e>=232)r=((e-232)*10+8)/255,i=r,n=r;else{e-=16;let a=e%36;r=Math.floor(e/36)/5,i=Math.floor(a/6)/5,n=a%6/5}let o=Math.max(r,i,n)*2;if(o===0)return 30;let s=30+(Math.round(n)<<2|Math.round(i)<<1|Math.round(r));return o===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(e,r,i)=>ue.ansi256ToAnsi(ue.rgbToAnsi256(e,r,i)),enumerable:!1},hexToAnsi:{value:e=>ue.ansi256ToAnsi(ue.hexToAnsi256(e)),enumerable:!1}}),ue}var hj=pj(),wt=hj;import Fd from"node:process";import gj from"node:os";import U_ from"node:tty";function ut(t,e=globalThis.Deno?globalThis.Deno.args:Fd.argv){let r=t.startsWith("-")?"":t.length===1?"-":"--",i=e.indexOf(r+t),n=e.indexOf("--");return i!==-1&&(n===-1||i<n)}var{env:de}=Fd,da;ut("no-color")||ut("no-colors")||ut("color=false")||ut("color=never")?da=0:(ut("color")||ut("colors")||ut("color=true")||ut("color=always"))&&(da=1);function yj(){if("FORCE_COLOR"in de)return de.FORCE_COLOR==="true"?1:de.FORCE_COLOR==="false"?0:de.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(de.FORCE_COLOR,10),3)}function vj(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function bj(t,{streamIsTTY:e,sniffFlags:r=!0}={}){let i=yj();i!==void 0&&(da=i);let n=r?da:i;if(n===0)return 0;if(r){if(ut("color=16m")||ut("color=full")||ut("color=truecolor"))return 3;if(ut("color=256"))return 2}if("TF_BUILD"in de&&"AGENT_NAME"in de)return 1;if(t&&!e&&n===void 0)return 0;let o=n||0;if(de.TERM==="dumb")return o;if(Fd.platform==="win32"){let s=gj.release().split(".");return Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in de)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(s=>s in de)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(s=>s in de)||de.CI_NAME==="codeship"?1:o;if("TEAMCITY_VERSION"in de)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(de.TEAMCITY_VERSION)?1:0;if(de.COLORTERM==="truecolor"||de.TERM==="xterm-kitty"||de.TERM==="xterm-ghostty"||de.TERM==="wezterm")return 3;if("TERM_PROGRAM"in de){let s=Number.parseInt((de.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(de.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(de.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(de.TERM)||"COLORTERM"in de?1:o}function M_(t,e={}){let r=bj(t,{streamIsTTY:t&&t.isTTY,...e});return vj(r)}var wj={stdout:M_({isTTY:U_.isatty(1)}),stderr:M_({isTTY:U_.isatty(2)})},q_=wj;function F_(t,e,r){let i=t.indexOf(e);if(i===-1)return t;let n=e.length,o=0,s="";do s+=t.slice(o,i)+e+r,o=i+n,i=t.indexOf(e,o);while(i!==-1);return s+=t.slice(o),s}function B_(t,e,r,i){let n=0,o="";do{let s=t[i-1]==="\r";o+=t.slice(n,s?i-1:i)+e+(s?`\r
|
|
186
|
-
`:`
|
|
187
|
-
`)+r,n=i+1,i=t.indexOf(`
|
|
188
|
-
`,n)}while(i!==-1);return o+=t.slice(n),o}var{stdout:Z_,stderr:K_}=q_,Bd=Symbol("GENERATOR"),mn=Symbol("STYLER"),Qi=Symbol("IS_EMPTY"),V_=["ansi","ansi","ansi256","ansi16m"],pn=Object.create(null),Sj=(t,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let r=Z_?Z_.level:0;t.level=e.level===void 0?r:e.level};var xj=t=>{let e=(...r)=>r.join(" ");return Sj(e,t),Object.setPrototypeOf(e,Ji.prototype),e};function Ji(t){return xj(t)}Object.setPrototypeOf(Ji.prototype,Function.prototype);for(let[t,e]of Object.entries(wt))pn[t]={get(){let r=fa(this,Kd(e.open,e.close,this[mn]),this[Qi]);return Object.defineProperty(this,t,{value:r}),r}};pn.visible={get(){let t=fa(this,this[mn],!0);return Object.defineProperty(this,"visible",{value:t}),t}};var Zd=(t,e,r,...i)=>t==="rgb"?e==="ansi16m"?wt[r].ansi16m(...i):e==="ansi256"?wt[r].ansi256(wt.rgbToAnsi256(...i)):wt[r].ansi(wt.rgbToAnsi(...i)):t==="hex"?Zd("rgb",e,r,...wt.hexToRgb(...i)):wt[r][t](...i),_j=["rgb","hex","ansi256"];for(let t of _j){pn[t]={get(){let{level:r}=this;return function(...i){let n=Kd(Zd(t,V_[r],"color",...i),wt.color.close,this[mn]);return fa(this,n,this[Qi])}}};let e="bg"+t[0].toUpperCase()+t.slice(1);pn[e]={get(){let{level:r}=this;return function(...i){let n=Kd(Zd(t,V_[r],"bgColor",...i),wt.bgColor.close,this[mn]);return fa(this,n,this[Qi])}}}}var $j=Object.defineProperties(()=>{},{...pn,level:{enumerable:!0,get(){return this[Bd].level},set(t){this[Bd].level=t}}}),Kd=(t,e,r)=>{let i,n;return r===void 0?(i=t,n=e):(i=r.openAll+t,n=e+r.closeAll),{open:t,close:e,openAll:i,closeAll:n,parent:r}},fa=(t,e,r)=>{let i=(...n)=>kj(i,n.length===1?""+n[0]:n.join(" "));return Object.setPrototypeOf(i,$j),i[Bd]=t,i[mn]=e,i[Qi]=r,i},kj=(t,e)=>{if(t.level<=0||!e)return t[Qi]?"":e;let r=t[mn];if(r===void 0)return e;let{openAll:i,closeAll:n}=r;if(e.includes("\x1B"))for(;r!==void 0;)e=F_(e,r.close,r.open),r=r.parent;let o=e.indexOf(`
|
|
189
|
-
`);return o!==-1&&(e=B_(e,n,i,o)),i+e+n};Object.defineProperties(Ji.prototype,pn);var Tj=Ji(),WJ=Ji({level:K_?K_.level:0});var rt=Tj;function G_(t){if(t.length!==0){console.warn(rt.yellow(`Moved ${t.length} finding(s) whose lines fall outside the PR diff into the review body (GitHub cannot anchor a comment on these):`));for(let e of t){let r=e.startLine!==void 0?`${e.startLine}-${e.line}`:`${e.line}`;console.warn(` ${rt.yellow("\xB7")} ${e.title} ${rt.dim(`(${e.file}:${r})`)}`)}}}function Q_(t,e){let r=ua(e.prNumber,e.baseSha,e.headSha),{inDiff:i,outOfDiff:n}=D_(t,N_(r));return G_(n),{inDiff:i,unanchored:n.map(o=>({...o,reason:"out-of-diff"}))}}function J_(t){if(t.length!==0){console.warn(rt.yellow(`Moved ${t.length} finding(s) without a parseable file:line into the review body:`));for(let e of t){let r=e.location||rt.dim("missing");console.warn(` ${rt.yellow("\xB7")} ${e.title} ${rt.dim(`(${r})`)}`)}}}function ma(t,e){let r=sa(t);if(r.length===0)return console.log("Synthesis contains no findings; nothing to post."),{inDiff:[],unanchored:[]};let{lineBound:i,unlocated:n,alreadyRaised:o}=P_(r);J_(n),o.length>0&&console.log(`Skipped ${o.length} finding(s) already raised by prior comments.`);let s=n.map(c=>({...c,reason:"unlocated"}));if(i.length===0)return console.log("No line-bound findings to comment on."),{inDiff:[],unanchored:s};let{inDiff:a,unanchored:l}=Q_(i,e);return a.length===0&&console.log("No findings fall within the PR diff; no line comments to post."),{inDiff:a,unanchored:[...s,...l]}}var Ej=["Reviewer 1","Reviewer 2","Synthesis"];function or(t){return t===void 0?"\u2014":t.toLocaleString("en-US")}function Ij(t){return t?[or(t.input),or(t.output),or(t.cacheRead),or(t.cacheWrite)]:["\u2014","\u2014","\u2014","\u2014"]}function pa(t,e){let r=t.map(e).filter(i=>i!==void 0);return r.length===0?void 0:r.reduce((i,n)=>i+n,0)}function Cj(t){let e=t.filter(r=>r!==void 0);return[or(pa(e,r=>r.input)),or(pa(e,r=>r.output)),or(pa(e,r=>r.cacheRead)),or(pa(e,r=>r.cacheWrite))]}function W_(t,e){return`| ${t} | ${e.join(" | ")} |`}function H_(t){return["## Token usage","","| Slot | Input | Output | Cache read | Cache write |","| --- | ---: | ---: | ---: | ---: |",...t.map((e,r)=>W_(Ej[r]??`Slot ${r+1}`,Ij(e))),W_("**Total**",Cj(t))].join(`
|
|
190
|
-
`)}function Y_(t,e,r,i){if(!r)return;let n=Nj(t,"utf8"),{unanchored:o}=ma(n,e),s=H_(i.map(a=>a.usage));Pj(r,`${nr(n,o)}
|
|
191
|
-
|
|
192
|
-
${s}
|
|
193
|
-
`)}function hn(t,e){return e?`${t}
|
|
194
|
-
|
|
195
|
-
${e}`:t}import{spawnSync as Oj}from"node:child_process";import{unlinkSync as Aj,writeFileSync as Rj}from"node:fs";import{tmpdir as Dj}from"node:os";import{join as Lj}from"node:path";function X_(t){let e;try{e=JSON.parse(t)}catch{return}if(!e||typeof e!="object")return;let r=e.errors;if(!Array.isArray(r)||r.length===0)return;let i=r.map(n=>n&&typeof n=="object"&&"message"in n?String(n.message):String(n)).join("; ");throw new Error(i||"GraphQL request returned errors")}function zj(t,e){let r=["api","graphql","-F",`query=@${t}`];for(let[i,n]of Object.entries(e)){let o=typeof n=="number"?"-F":"-f";r.push(o,`${i}=${n}`)}return r}function Wi(t,e){let r=Lj(Dj(),`gh-query-${Date.now()}.graphql`);Rj(r,t);try{let i=Oj("gh",zj(r,e),{encoding:"utf8",windowsHide:!0});if(i.status!==0)throw new Error(i.stderr||i.stdout);return X_(i.stdout),i.stdout}finally{Aj(r)}}function ha(t,e){try{let r=la();return Wi(t,{prId:r,body:e}),console.log("Submitted review."),!0}catch(r){if(aa(r))return console.error("Error: GitHub CLI (gh) is not installed."),!1;let i=r instanceof Error?r.message:String(r);return console.error(`Failed to submit review: ${i}`),!1}}var jj="mutation($prId: ID!, $body: String) { addPullRequestReview(input: { pullRequestId: $prId, event: COMMENT, body: $body }) { pullRequestReview { id } } }";function gn(t){return ha(jj,t)}function Uj(t){return t.length===0?"The review did not complete.":`The review did not complete: ${t.map(r=>r.name.replace("-"," ")).join(" and ")} failed.`}function e$(t,e,r){let i=["## Code review failed","",`${Uj(t)} No findings were posted.`];r&&i.push("",`See the [workflow run](${r}) for details.`),gn(hn(i.join(`
|
|
196
|
-
`),e))}function t$(t,e){console.error("Review failed; no findings were posted."),e$(t,e.footer,e.runUrl),process.exit(1)}import{statSync as Mj}from"node:fs";function yn(t,e){let r;try{r=Mj(e).size}catch{return null}return r===0?null:(console.log(`[${t}] cached \u2192 ${e} (${r} bytes)`),{name:t,outputPath:e,exitCode:0,stderr:""})}import hk from"node:process";var Ie={};Pt(Ie,{ConEmu:()=>c$,beep:()=>g2,beginSynchronizedOutput:()=>s$,clearScreen:()=>c2,clearTerminal:()=>f2,clearViewport:()=>u2,cursorBackward:()=>Qj,cursorDown:()=>Vj,cursorForward:()=>Gj,cursorGetPosition:()=>Hj,cursorHide:()=>e2,cursorLeft:()=>i$,cursorMove:()=>Kj,cursorNextLine:()=>Yj,cursorPrevLine:()=>Xj,cursorRestorePosition:()=>Wj,cursorSavePosition:()=>Jj,cursorShow:()=>t2,cursorTo:()=>Zj,cursorUp:()=>n$,endSynchronizedOutput:()=>a$,enterAlternativeScreen:()=>m2,eraseDown:()=>o2,eraseEndLine:()=>n2,eraseLine:()=>o$,eraseLines:()=>r2,eraseScreen:()=>ga,eraseStartLine:()=>i2,eraseUp:()=>s2,exitAlternativeScreen:()=>p2,iTerm:()=>l$,image:()=>v2,link:()=>y2,scrollDown:()=>l2,scrollUp:()=>a2,setCwd:()=>b2,synchronizedOutput:()=>h2});import bn from"node:process";import qj from"node:os";var vn=globalThis.window?.document!==void 0,jW=globalThis.process?.versions?.node!==void 0,UW=globalThis.process?.versions?.bun!==void 0,MW=globalThis.Deno?.version?.deno!==void 0,qW=globalThis.process?.versions?.electron!==void 0,FW=globalThis.navigator?.userAgent?.includes("jsdom")===!0,BW=typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope,ZW=typeof DedicatedWorkerGlobalScope<"u"&&globalThis instanceof DedicatedWorkerGlobalScope,KW=typeof SharedWorkerGlobalScope<"u"&&globalThis instanceof SharedWorkerGlobalScope,VW=typeof ServiceWorkerGlobalScope<"u"&&globalThis instanceof ServiceWorkerGlobalScope,Hi=globalThis.navigator?.userAgentData?.platform,GW=Hi==="macOS"||globalThis.navigator?.platform==="MacIntel"||globalThis.navigator?.userAgent?.includes(" Mac ")===!0||globalThis.process?.platform==="darwin",QW=Hi==="Windows"||globalThis.navigator?.platform==="Win32"||globalThis.process?.platform==="win32",JW=Hi==="Linux"||globalThis.navigator?.platform?.startsWith("Linux")===!0||globalThis.navigator?.userAgent?.includes(" Linux ")===!0||globalThis.process?.platform==="linux",WW=Hi==="iOS"||globalThis.navigator?.platform==="MacIntel"&&globalThis.navigator?.maxTouchPoints>1||/iPad|iPhone|iPod/.test(globalThis.navigator?.platform),HW=Hi==="Android"||globalThis.navigator?.platform==="Android"||globalThis.navigator?.userAgent?.includes(" Android ")===!0||globalThis.process?.platform==="android";var H="\x1B[",wn="\x1B]",jr="\x07",Yi=";",r$=!vn&&bn.env.TERM_PROGRAM==="Apple_Terminal",Fj=!vn&&bn.platform==="win32",Bj=!vn&&(bn.env.TERM?.startsWith("screen")||bn.env.TERM?.startsWith("tmux")||bn.env.TMUX!==void 0),Vd=vn?()=>{throw new Error("`process.cwd()` only works in Node.js, not the browser.")}:bn.cwd,Sn=t=>Bj?"\x1BPtmux;"+t.replaceAll("\x1B","\x1B\x1B")+"\x1B\\":t,Zj=(t,e)=>{if(typeof t!="number")throw new TypeError("The `x` argument is required");return typeof e!="number"?H+(t+1)+"G":H+(e+1)+Yi+(t+1)+"H"},Kj=(t,e)=>{if(typeof t!="number")throw new TypeError("The `x` argument is required");let r="";return t<0?r+=H+-t+"D":t>0&&(r+=H+t+"C"),e<0?r+=H+-e+"A":e>0&&(r+=H+e+"B"),r},n$=(t=1)=>H+t+"A",Vj=(t=1)=>H+t+"B",Gj=(t=1)=>H+t+"C",Qj=(t=1)=>H+t+"D",i$=H+"G",Jj=r$?"\x1B7":H+"s",Wj=r$?"\x1B8":H+"u",Hj=H+"6n",Yj=H+"E",Xj=H+"F",e2=H+"?25l",t2=H+"?25h",r2=t=>{let e="";for(let r=0;r<t;r++)e+=o$+(r<t-1?n$():"");return t&&(e+=i$),e},n2=H+"K",i2=H+"1K",o$=H+"2K",o2=H+"J",s2=H+"1J",ga=H+"2J",a2=H+"S",l2=H+"T",c2="\x1Bc",u2=`${ga}${H}H`,d2=()=>{if(vn||!Fj)return!1;let t=qj.release().split("."),e=Number(t[0]),r=Number(t[2]??0);return e<10||e===10&&r<10586},f2=d2()?`${ga}${H}0f`:`${ga}${H}3J${H}H`,m2=H+"?1049h",p2=H+"?1049l",s$=H+"?2026h",a$=H+"?2026l",h2=t=>s$+t+a$,g2=jr,y2=(t,e)=>{let r=Sn(`${wn}8${Yi}${Yi}${e}${jr}`),i=Sn(`${wn}8${Yi}${Yi}${jr}`);return r+t+i},v2=(t,e={})=>{let r=`${wn}1337;File=inline=1`;e.width&&(r+=`;width=${e.width}`),e.height&&(r+=`;height=${e.height}`),e.preserveAspectRatio===!1&&(r+=";preserveAspectRatio=0");let i=Buffer.from(t);return Sn(r+`;size=${i.byteLength}:`+i.toString("base64")+jr)},l$={setCwd:(t=Vd())=>Sn(`${wn}50;CurrentDir=${t}${jr}`),annotation(t,e={}){let r=`${wn}1337;`,i=e.x!==void 0,n=e.y!==void 0;if((i||n)&&!(i&&n&&e.length!==void 0))throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");return t=t.replaceAll("|",""),r+=e.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",e.length>0?r+=(i?[t,e.length,e.x,e.y]:[e.length,t]).join("|"):r+=t,Sn(r+jr)}},c$={setCwd:(t=Vd())=>Sn(`${wn}9;9;${t}${jr}`)},b2=(t=Vd())=>l$.setCwd(t)+c$.setCwd(t);import h$ from"node:process";import wa from"node:process";var w2=(t,e,r,i)=>{if(r==="length"||r==="prototype"||r==="arguments"||r==="caller")return;let n=Object.getOwnPropertyDescriptor(t,r),o=Object.getOwnPropertyDescriptor(e,r);!S2(n,o)&&i||Object.defineProperty(t,r,o)},S2=function(t,e){return t===void 0||t.configurable||t.writable===e.writable&&t.enumerable===e.enumerable&&t.configurable===e.configurable&&(t.writable||t.value===e.value)},x2=(t,e)=>{let r=Object.getPrototypeOf(e);r!==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,r)},_2=(t,e)=>`/* Wrapped ${t}*/
|
|
197
|
-
${e}`,$2=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),k2=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),T2=(t,e,r)=>{let i=r===""?"":`with ${r.trim()}() `,n=_2.bind(null,i,e.toString());Object.defineProperty(n,"name",k2);let{writable:o,enumerable:s,configurable:a}=$2;Object.defineProperty(t,"toString",{value:n,writable:o,enumerable:s,configurable:a})};function Gd(t,e,{ignoreNonConfigurable:r=!1}={}){let{name:i}=t;for(let n of Reflect.ownKeys(e))w2(t,e,n,r);return x2(t,e),T2(t,e,i),t}var ya=new WeakMap,u$=(t,e={})=>{if(typeof t!="function")throw new TypeError("Expected a function");let r,i=0,n=t.displayName||t.name||"<anonymous>",o=function(...s){if(ya.set(o,++i),i===1)r=t.apply(this,s),t=void 0;else if(e.throw===!0)throw new Error(`Function \`${n}\` can only be called once`);return r};return Gd(o,t),ya.set(o,i),o};u$.callCount=t=>{if(!ya.has(t))throw new Error(`The given function \`${t.name}\` is not wrapped by the \`onetime\` package`);return ya.get(t)};var d$=u$;var Ur=[];Ur.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&Ur.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Ur.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var va=t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function",Qd=Symbol.for("signal-exit emitter"),Jd=globalThis,E2=Object.defineProperty.bind(Object),Wd=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(Jd[Qd])return Jd[Qd];E2(Jd,Qd,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,r){this.listeners[e].push(r)}removeListener(e,r){let i=this.listeners[e],n=i.indexOf(r);n!==-1&&(n===0&&i.length===1?i.length=0:i.splice(n,1))}emit(e,r,i){if(this.emitted[e])return!1;this.emitted[e]=!0;let n=!1;for(let o of this.listeners[e])n=o(r,i)===!0||n;return e==="exit"&&(n=this.emit("afterExit",r,i)||n),n}},ba=class{},I2=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),Hd=class extends ba{onExit(){return()=>{}}load(){}unload(){}},Yd=class extends ba{#s=Xd.platform==="win32"?"SIGINT":"SIGHUP";#t=new Wd;#e;#i;#o;#n={};#r=!1;constructor(e){super(),this.#e=e,this.#n={};for(let r of Ur)this.#n[r]=()=>{let i=this.#e.listeners(r),{count:n}=this.#t,o=e;if(typeof o.__signal_exit_emitter__=="object"&&typeof o.__signal_exit_emitter__.count=="number"&&(n+=o.__signal_exit_emitter__.count),i.length===n){this.unload();let s=this.#t.emit("exit",null,r),a=r==="SIGHUP"?this.#s:r;s||e.kill(e.pid,a)}};this.#o=e.reallyExit,this.#i=e.emit}onExit(e,r){if(!va(this.#e))return()=>{};this.#r===!1&&this.load();let i=r?.alwaysLast?"afterExit":"exit";return this.#t.on(i,e),()=>{this.#t.removeListener(i,e),this.#t.listeners.exit.length===0&&this.#t.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#r){this.#r=!0,this.#t.count+=1;for(let e of Ur)try{let r=this.#n[e];r&&this.#e.on(e,r)}catch{}this.#e.emit=(e,...r)=>this.#l(e,...r),this.#e.reallyExit=e=>this.#a(e)}}unload(){this.#r&&(this.#r=!1,Ur.forEach(e=>{let r=this.#n[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#e.removeListener(e,r)}catch{}}),this.#e.emit=this.#i,this.#e.reallyExit=this.#o,this.#t.count-=1)}#a(e){return va(this.#e)?(this.#e.exitCode=e||0,this.#t.emit("exit",this.#e.exitCode,null),this.#o.call(this.#e,this.#e.exitCode)):0}#l(e,...r){let i=this.#i;if(e==="exit"&&va(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let n=i.call(this.#e,e,...r);return this.#t.emit("exit",this.#e.exitCode,null),n}else return i.call(this.#e,e,...r)}},Xd=globalThis.process,{onExit:f$,load:cH,unload:uH}=I2(va(Xd)?new Yd(Xd):new Hd);var m$=wa.stderr.isTTY?wa.stderr:wa.stdout.isTTY?wa.stdout:void 0,C2=m$?d$(()=>{f$(()=>{m$.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},p$=C2;var Sa=!1,xn={};xn.show=(t=h$.stderr)=>{t.isTTY&&(Sa=!1,t.write("\x1B[?25h"))};xn.hide=(t=h$.stderr)=>{t.isTTY&&(p$(),Sa=!0,t.write("\x1B[?25l"))};xn.toggle=(t,e)=>{t!==void 0&&(Sa=t),Sa?xn.show(e):xn.hide(e)};var ef=xn;function tf({onlyFirst:t=!1}={}){let n="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(n,t?void 0:"g")}var P2=tf();function sr(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return!t.includes("\x1B")&&!t.includes("\x9B")?t:t.replace(P2,"")}var g$=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],y$=12288,v$=65510,b$=[12288,12288,65281,65376,65504,65510];var w$=4352,S$=262141,rf=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141];var xa=(t,e)=>{let r=0,i=Math.floor(t.length/2)-1;for(;r<=i;){let n=Math.floor((r+i)/2),o=n*2;if(e<t[o])i=n-1;else if(e>t[o+1])r=n+1;else return!0}return!1};var x$=19968,[A2,R2]=D2(rf);function D2(t){let e=t[0],r=t[1];for(let i=0;i<t.length;i+=2){let n=t[i],o=t[i+1];if(x$>=n&&x$<=o)return[n,o];o-n>r-e&&(e=n,r=o)}return[e,r]}var _$=t=>t<161||t>1114109?!1:xa(g$,t),Xi=t=>t<y$||t>v$?!1:xa(b$,t);var eo=t=>t>=A2&&t<=R2?!0:t<w$||t>S$?!1:xa(rf,t);function L2(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}function to(t,{ambiguousAsWide:e=!1}={}){return L2(t),Xi(t)||eo(t)||e&&_$(t)?2:1}var z2=new Intl.Segmenter,$$=new RegExp("^(?:\\p{Default_Ignorable_Code_Point}|\\p{Control}|\\p{Format}|\\p{Mark}|\\p{Surrogate})+$","v"),j2=new RegExp("^[\\p{Default_Ignorable_Code_Point}\\p{Control}\\p{Format}\\p{Mark}\\p{Surrogate}]+","v"),U2=new RegExp("^\\p{RGI_Emoji}$","v"),M2=/^[\d#*]\u20E3$/,q2=new RegExp("\\p{Extended_Pictographic}","gu");function F2(t){if(t.length>50)return!1;if(M2.test(t))return!0;if(t.includes("\u200D")){let e=t.match(q2);return e!==null&&e.length>=2}return!1}function B2(t){return t.replace(j2,"")}function Z2(t){return $$.test(t)}function k$(t){return t>=4352&&t<=4447||t>=43360&&t<=43388}function T$(t){return t>=4448&&t<=4519||t>=55216&&t<=55238}function E$(t){return t>=4520&&t<=4607||t>=55243&&t<=55291}function K2(t){return k$(t)||T$(t)||E$(t)}function V2(t,e){let r=[];for(let n of t)$$.test(n)||r.push(n.codePointAt(0));if(r.length===0)return;let i=0;for(let n=0;n<r.length;n++){let o=r[n];if(!K2(o)){if(i===0)return;for(let s=n;s<r.length;s++)i+=to(r[s],e);return i}if(k$(o)&&T$(r[n+1])){i+=2,n+=E$(r[n+2])?2:1;continue}i+=to(o,e)}return i}function G2(t,e){let r=0,i=!0;for(let n of t){if(i){i=!1;continue}n>="\uFF00"&&n<="\uFFEF"&&(r+=to(n.codePointAt(0),e))}return r}function Nt(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:i=!1}=e,n=t;if(!i&&(n.includes("\x1B")||n.includes("\x9B"))&&(n=sr(n)),n.length===0)return 0;if(/^[\u0020-\u007E]*$/.test(n))return n.length;let o=0,s={ambiguousAsWide:!r};for(let{segment:a}of z2.segment(n)){if(Z2(a))continue;if(U2.test(a)||F2(a)){o+=2;continue}let l=B2(a),c=V2(l,s);if(c!==void 0){o+=c;continue}let u=l.codePointAt(0);o+=to(u,s),o+=G2(l,s)}return o}var I$=(t=0)=>e=>`\x1B[${e+t}m`,C$=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,P$=(t=0)=>(e,r,i)=>`\x1B[${38+t};2;${e};${r};${i}m`,fe={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},MH=Object.keys(fe.modifier),Q2=Object.keys(fe.color),J2=Object.keys(fe.bgColor),qH=[...Q2,...J2];function W2(){let t=new Map;for(let[e,r]of Object.entries(fe)){for(let[i,n]of Object.entries(r))fe[i]={open:`\x1B[${n[0]}m`,close:`\x1B[${n[1]}m`},r[i]=fe[i],t.set(n[0],n[1]);Object.defineProperty(fe,e,{value:r,enumerable:!1})}return Object.defineProperty(fe,"codes",{value:t,enumerable:!1}),fe.color.close="\x1B[39m",fe.bgColor.close="\x1B[49m",fe.color.ansi=I$(),fe.color.ansi256=C$(),fe.color.ansi16m=P$(),fe.bgColor.ansi=I$(10),fe.bgColor.ansi256=C$(10),fe.bgColor.ansi16m=P$(10),Object.defineProperties(fe,{rgbToAnsi256:{value(e,r,i){return e===r&&r===i?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(i/255*5)},enumerable:!1},hexToRgb:{value(e){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[i]=r;i.length===3&&(i=[...i].map(o=>o+o).join(""));let n=Number.parseInt(i,16);return[n>>16&255,n>>8&255,n&255]},enumerable:!1},hexToAnsi256:{value:e=>fe.rgbToAnsi256(...fe.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,i,n;if(e>=232)r=((e-232)*10+8)/255,i=r,n=r;else{e-=16;let a=e%36;r=Math.floor(e/36)/5,i=Math.floor(a/6)/5,n=a%6/5}let o=Math.max(r,i,n)*2;if(o===0)return 30;let s=30+(Math.round(n)<<2|Math.round(i)<<1|Math.round(r));return o===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(e,r,i)=>fe.ansi256ToAnsi(fe.rgbToAnsi256(e,r,i)),enumerable:!1},hexToAnsi:{value:e=>fe.ansi256ToAnsi(fe.hexToAnsi256(e)),enumerable:!1}}),fe}var H2=W2(),dt=H2;var Mr="\x1B",of="\x9B",Y2=new Set([Mr,of]),L$="\x07",z$="[",X2="]",ka="m",Ta=0,j$=39,U$=49,M$=59,q$=38,F$=48,B$=58,eU=5,tU=2,$a=`${X2}8;;`,Z$=new RegExp(`^\\u001B(?:\\${z$}(?<sgr>[0-9;]*)${ka}|${$a}(?<uri>[^\\u0007\\u001B]*)(?:\\u0007|\\u001B\\\\))`),K$=new RegExp(`^\\u009B(?<sgr>[0-9;]*)${ka}`),V$=new Set(dt.codes.values());V$.delete(Ta);var rU=new Intl.Segmenter,G$=t=>Array.from(rU.segment(t),({segment:e})=>e),N$=8,Q$=t=>`${Mr}${z$}${t}${ka}`,O$=t=>`${Mr}${$a}${t}${L$}`,J$=t=>{let e=t.split(";").map(i=>i===""?Ta:Number.parseInt(i,10)),r=[];for(let i=0;i<e.length;i++){let n=e[i];if(Number.isFinite(n)){if(n===q$||n===F$||n===B$){if(i+1>=e.length)break;let o=e[i+1];if(o===eU&&Number.isFinite(e[i+2])){r.push([n,o,e[i+2]]),i+=2;continue}let s=e[i+2],a=e[i+3],l=e[i+4];if(o===tU&&Number.isFinite(s)&&Number.isFinite(a)&&Number.isFinite(l)){r.push([n,o,s,a,l]),i+=4;continue}break}r.push([n])}}return r},_a=(t,e)=>{let r=t.findIndex(i=>i.family===e);r!==-1&&t.splice(r,1)},A$=(t,e)=>{_a(t,e.family),t.push(e)},nU=(t,e)=>{for(let r=t.length-1;r>=0;r--){let i=t[r];i.family.startsWith("modifier-")&&i.close===e&&t.splice(r,1)}},iU=(t,e)=>{if(t>=30&&t<=37||t>=90&&t<=97||t===q$&&e.length>1)return{family:"foreground",open:e.join(";"),close:j$};if(t>=40&&t<=47||t>=100&&t<=107||t===F$&&e.length>1)return{family:"background",open:e.join(";"),close:U$};if(t===B$&&e.length>1)return{family:"underlineColor",open:e.join(";"),close:M$}},W$=(t,e)=>t===Ta?(e.length=0,!0):t===j$?(_a(e,"foreground"),!0):t===U$?(_a(e,"background"),!0):t===M$?(_a(e,"underlineColor"),!0):V$.has(t)?(nU(e,t),!0):!1,oU=(t,e)=>{let[r]=t;if(W$(r,e))return;let i=iU(r,t);if(i){A$(e,i);return}let n=dt.codes.get(r);n!==void 0&&n!==Ta&&A$(e,{family:`modifier-${r}`,open:t.join(";"),close:n})},R$=(t,e)=>{for(let r of J$(t))oU(r,e)},D$=(t,e)=>{for(let r of J$(t)){let[i]=r;W$(i,e)}},sU=(t,e)=>{let r=t;for(;r.length>0;){if(r.startsWith(Mr)&&r[1]!=="\\"){let i=Z$.exec(r);if(!i)break;i.groups.sgr!==void 0&&D$(i.groups.sgr,e),r=r.slice(i[0].length);continue}if(r.startsWith(of)){let i=K$.exec(r);if(!i||i.groups.sgr===void 0)break;D$(i.groups.sgr,e),r=r.slice(i[0].length);continue}break}},aU=t=>[...t].reverse().map(e=>Q$(e.close)).join(""),lU=t=>t.map(e=>Q$(e.open)).join(""),cU=t=>t.split(" ").map(e=>Nt(e)),nf=(t,e,r)=>{let i=G$(e),n=!1,o=!1,s=Nt(sr(t.at(-1)));for(let[a,l]of i.entries()){let c=Nt(l);if(s+c<=r?t[t.length-1]+=l:(t.push(l),s=0),Y2.has(l)&&!(o&&l===Mr&&i[a+1]==="\\")&&(n=!0,o=i.slice(a+1,a+1+$a.length).join("")===$a),n){o?(l===L$||l==="\\"&&a>0&&i[a-1]===Mr)&&(n=!1,o=!1):l===ka&&(n=!1);continue}s+=c,s===r&&a<i.length-1&&(t.push(""),s=0)}!s&&t.at(-1).length>0&&t.length>1&&(t[t.length-2]+=t.pop())},uU=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(Nt(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},dU=t=>{if(!t.includes(" "))return t;let e=t.split(" "),r=0,i="";for(let[n,o]of e.entries())if(i+=o,r+=Nt(o),n<e.length-1){let s=N$-r%N$;i+=" ".repeat(s),r+=s}return i},fU=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let i="",n,o=[],s=cU(t),a=[""];for(let[d,f]of t.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a.at(-1).trimStart());let m=Nt(a.at(-1));if(d!==0&&(m>=e&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),m=0),(m>0||r.trim===!1)&&(a[a.length-1]+=" ",m++)),r.hard&&r.wordWrap!==!1&&s[d]>e){let y=e-m,h=1+Math.floor((s[d]-y-1)/e);Math.floor((s[d]-1)/e)<h&&a.push(""),nf(a,f,e);continue}if(m+s[d]>e&&m>0&&s[d]>0){if(r.wordWrap===!1&&m<e){nf(a,f,e);continue}a.push("")}if(m+s[d]>e&&r.wordWrap===!1){nf(a,f,e);continue}a[a.length-1]+=f}r.trim!==!1&&(a=a.map(d=>uU(d)));let l=a.join(`
|
|
198
|
-
`),c=G$(l),u=0;for(let[d,f]of c.entries()){if(i+=f,f===Mr&&c[d+1]!=="\\"){let{groups:m}=Z$.exec(l.slice(u))||{groups:{}};m.sgr!==void 0?R$(m.sgr,o):m.uri!==void 0&&(n=m.uri.length===0?void 0:m.uri)}else if(f===of){let{groups:m}=K$.exec(l.slice(u))||{groups:{}};m.sgr!==void 0&&R$(m.sgr,o)}if(c[d+1]===`
|
|
199
|
-
`)n&&(i+=O$("")),i+=aU(o);else if(f===`
|
|
200
|
-
`){let m=[...o];sU(l.slice(u+1),m),i+=lU(m),n&&(i+=O$(n))}u+=f.length}return i};function sf(t,e,r){return String(t).normalize().replaceAll(`\r
|
|
201
|
-
`,`
|
|
202
|
-
`).split(`
|
|
203
|
-
`).map(i=>fU(dU(i),e,r)).join(`
|
|
204
|
-
`)}function Ea(t){return Number.isInteger(t)?Xi(t)||eo(t):!1}var no=27,ek=144,tk=152,rk=155,nk=156,Na=157,ik=158,ok=159,io=new Set([no,ek,tk,rk,nk,Na,ik,ok]),_n="\x1B",uf="\x07",mf="[",sk="]",mU="P",pU="X",hU="^",gU="_",ak="m",Ca="\\",lk=`${_n}${Ca}`,yU="\x9D",Pa="\x9C",df=`${_n}${sk}8;`,ff=`${yU}8;`,vU=`${df};`,bU=`${ff};`,wU="0".codePointAt(0),SU="9".codePointAt(0),xU=";".codePointAt(0),_U=":".codePointAt(0),$U="0".codePointAt(0),kU="?".codePointAt(0),TU=" ".codePointAt(0),EU="/".codePointAt(0),IU="@".codePointAt(0),CU="~".codePointAt(0),PU=127462,NU=127487,H$=0,Ia=38,af=39,OU=48,lf=49,AU=5,RU=2,Y$=3,X$=5,DU=2,LU=4,zU=65039,jU=8419,UU=new RegExp("\\p{Emoji_Presentation}","v"),pf=new Intl.Segmenter(void 0,{granularity:"grapheme"}),ck=new Set;for(let[,t]of dt.codes)ck.add(t);function MU(t){return t>=wU&&t<=SU||t===xU||t===_U}function qU(t){return t>=$U&&t<=kU}function FU(t){return t>=TU&&t<=EU}function BU(t){return t>=IU&&t<=CU}function ZU(t){return t>=PU&&t<=NU}function St(t,e){return{token:{type:"control",code:t},endIndex:e}}function KU(t){if(UU.test(t))return!0;for(let e of t){let r=e.codePointAt(0);if(r===zU||r===jU)return!0}return!1}function uk(t){let e=0;for(let r of t){let i=r.codePointAt(0);if(Ea(i))return 2;ZU(i)&&e++}return e>=1||KU(t)?2:1}function VU(t){return t.startsWith("\x9B")?"\x9B":`${_n}${mf}`}function ro(t,e){return`${t}${e.join(";")}${ak}`}function GU(t){let e=[],r=VU(t),i;if(t.startsWith(`${_n}${mf}`))i=t.slice(2,-1);else if(t.startsWith("\x9B"))i=t.slice(1,-1);else return e;let n=i.length===0?[String(H$)]:i.split(";"),o=0;for(;o<n.length;){let s=Number.parseInt(n[o],10);if(Number.isNaN(s)){o++;continue}if(s===H$){e.push({type:"reset"}),o++;continue}if(s===Ia||s===OU){let c=Number.parseInt(n[o+1],10);if(c===AU&&o+DU<n.length){let d=ro(r,n.slice(o,o+Y$));e.push({type:"start",code:d,endCode:dt.color.ansi(s===Ia?af:lf)}),o+=Y$;continue}if(c===RU&&o+LU<n.length){let d=ro(r,n.slice(o,o+X$));e.push({type:"start",code:d,endCode:dt.color.ansi(s===Ia?af:lf)}),o+=X$;continue}let u=ro(r,[n[o]]);e.push({type:"start",code:u,endCode:dt.color.ansi(s===Ia?af:lf)}),o++;continue}if(ck.has(s)){e.push({type:"end",endCode:dt.color.ansi(s)}),o++;continue}let a=dt.codes.get(s);if(a!==void 0){let c=ro(r,[n[o]]);e.push({type:"start",code:c,endCode:dt.color.ansi(a)}),o++;continue}let l=ro(r,[n[o]]);e.push({type:"start",code:l,endCode:dt.reset.open}),o++}return e.length===0&&e.push({type:"reset"}),e}function QU(t,e){let r=t.codePointAt(e),i;if(r===no){if(t[e+1]!==mf)return;i=e+2}else if(r===rk)i=e+1;else return;let n=!0;for(let o=i;o<t.length;o++){let s=t.codePointAt(o);if(BU(s)){let l=t.slice(e,o+1);return t[o]!==ak||!n?St(l,o+1):{token:{type:"sgr",code:l,fragments:GU(l)},endIndex:o+1}}if(qU(s)){MU(s)||(n=!1);continue}if(FU(s)){n=!1;continue}let a=o;return St(t.slice(e,a),a)}return St(t.slice(e),t.length)}function JU(t,e){let r,i,n=t.codePointAt(e);if(n===no&&t.startsWith(df,e))r=df,i=vU;else if(n===Na&&t.startsWith(ff,e))r=ff,i=bU;else return;let o=t.indexOf(";",e+r.length);if(o===-1)return St(t.slice(e),t.length);for(let s=o+1;s<t.length;s++){let a=t[s];if(a===uf){let l=t.slice(e,s+1),c=s===o+1?"close":"open";return{token:{type:"hyperlink",code:l,action:c,closePrefix:i,terminator:uf},endIndex:s+1}}if(a===_n&&t[s+1]===Ca){let l=t.slice(e,s+2),c=s===o+1?"close":"open";return{token:{type:"hyperlink",code:l,action:c,closePrefix:i,terminator:lk},endIndex:s+2}}if(a===Pa){let l=t.slice(e,s+1),c=s===o+1?"close":"open";return{token:{type:"hyperlink",code:l,action:c,closePrefix:i,terminator:Pa},endIndex:s+1}}}return St(t.slice(e),t.length)}function WU(t,e){let r=t.codePointAt(e),i,n=!1;switch(r){case no:{switch(t[e+1]){case sk:{i=e+2,n=!0;break}case mU:case pU:case hU:case gU:{i=e+2;break}case Ca:return St(lk,e+2);default:return}break}case Na:{i=e+1,n=!0;break}case ek:case tk:case ik:case ok:{i=e+1;break}case nk:return St(Pa,e+1);default:return}for(let o=i;o<t.length;o++){if(n&&t[o]===uf)return St(t.slice(e,o+1),o+1);if(t[o]===_n&&t[o+1]===Ca)return St(t.slice(e,o+2),o+2);if(t[o]===Pa)return St(t.slice(e,o+1),o+1)}return St(t.slice(e),t.length)}function oo(t,e){let r=t.codePointAt(e);if(r===no||r===Na){let n=JU(t,e);if(n)return n}let i=WU(t,e);return i||QU(t,e)}function dk(t,e,r){for(;e<t.length;){let i=t.codePointAt(e);if(!io.has(i))break;let n=oo(t,e);if(!n)break;r.push(n.token),e=n.endIndex}return e}function fk(t,e,r){let i=r.containing(e);if(!(!i||i.index!==e))return{token:{type:"character",value:i.segment,visibleWidth:uk(i.segment),isGraphemeContinuation:!1},endIndex:e+i.segment.length}}function HU(t){let e=[],r=0;for(;r<t.length;){let i=t.codePointAt(r);if(io.has(i)){let o=oo(t,r);if(o){r=o.endIndex;continue}}let n=String.fromCodePoint(i);e.push({value:n,visibleWidth:1,isGraphemeContinuation:!1}),r+=n.length}return e}function YU(t){if(t.length===0)return;let e=t.map(({value:o})=>o).join(""),r=[],i=0;for(let o of t)r.push(i),i+=o.value.length;let n=0;for(let o of pf.segment(e)){for(;n<t.length&&r[n]<o.index;)n++;let s=n,a=!0;for(;s<t.length&&r[s]<o.index+o.segment.length;)t[s].visibleWidth=a?uk(o.segment):0,t[s].isGraphemeContinuation=!a,a=!1,s++;n=s}}function cf(t,{endCharacter:e=Number.POSITIVE_INFINITY}={}){let r=[],i=HU(t);YU(i);let n=0,o=0,s=0;for(;n<t.length;){let a=t.codePointAt(n);if(io.has(a)){let f=oo(t,n);if(f){r.push(f.token),n=f.endIndex;continue}}let l=String.fromCodePoint(a),c=i[o],u=Ea(a)?2:l.length;c&&(u=c.visibleWidth);let d={type:"character",value:l,visibleWidth:u,isGraphemeContinuation:c?c.isGraphemeContinuation:!1};if(r.push(d),n+=l.length,o++,s+=d.visibleWidth,s>=e){let f=i[o];if(!f||!f.isGraphemeContinuation){n=dk(t,n,r);break}}}return r}function mk(t,e){let r=`${t}${e}`,i=t.length;for(let n of pf.segment(r)){if(n.index===i)return!1;if(n.index>i)return!0}return!0}function XU(t,e,r,i){if(!r)return!1;let n=e,o=!1;for(;n<t.length;){let s=t.codePointAt(n);if(io.has(s)){let l=oo(t,n);if(l){o=!0,n=l.endIndex;continue}}if(!o)return!1;let a=fk(t,n,i);return a?mk(r,a.token.value):!0}return!1}function hf(t,{endCharacter:e=Number.POSITIVE_INFINITY}={}){let r=[],i=pf.segment(t),n=0,o=0,s,a=!1;for(;n<t.length;){let l=t.codePointAt(n);if(io.has(l)){let u=oo(t,n);if(u){r.push(u.token),n=u.endIndex,a=!0;continue}}let c=fk(t,n,i);if(!c)return cf(t,{endCharacter:e});if(a&&s&&mk(s,c.token.value))return cf(t,{endCharacter:e});if(r.push(c.token),n=c.endIndex,o+=c.token.visibleWidth,a=!1,s=c.token.value,o>=e){if(XU(t,n,s,i))return cf(t,{endCharacter:e});n=dk(t,n,r);break}}return r}function e4(t,e){for(let r of e)switch(r.type){case"reset":{t.clear();break}case"end":{t.delete(r.endCode);break}case"start":{t.delete(r.endCode),t.set(r.endCode,r.code);break}default:break}return t}function t4(t){return[...t.keys()].toReversed().join("")}function r4(t){return`${t.closePrefix}${t.terminator}`}function n4(t,e){let r=!1,i=!1;for(let n of t.fragments){if(n.type==="start"){r=!0;continue}if(n.type==="reset"&&e.size>0){i=!0;continue}n.type==="end"&&e.has(n.endCode)&&(i=!0)}return i&&!r}function i4(t){return t.fragments.some(e=>e.type==="start")}function pk(t){if(t.activeHyperlink&&!t.activeHyperlinkHasVisibleText&&t.activeHyperlinkOutputIndex!==void 0){let e=t.activeHyperlink.code.length;t.returnValue=t.returnValue.slice(0,t.activeHyperlinkOutputIndex)+t.returnValue.slice(t.activeHyperlinkOutputIndex+e),t.pendingSgrOutputIndex!==void 0&&t.pendingSgrOutputIndex>t.activeHyperlinkOutputIndex&&(t.pendingSgrOutputIndex-=e)}t.activeHyperlink=void 0,t.activeHyperlinkHasVisibleText=!1,t.activeHyperlinkOutputIndex=void 0}function o4(t){return t.isPastEnd&&!n4(t.token,t.activeStyles)||(t.include&&i4(t.token)&&t.pendingSgrOutputIndex===void 0&&(t.pendingSgrOutputIndex=t.returnValue.length,t.pendingSgrActiveStyles=new Map(t.activeStyles)),t.activeStyles=e4(t.activeStyles,t.token.fragments),t.include&&(t.returnValue+=t.token.code)),t}function s4(t){if(t.isPastEnd&&(t.token.action!=="close"||!t.activeHyperlink))return t;if(t.token.action==="open")t.activeHyperlink=t.token,t.activeHyperlinkHasVisibleText=!1,t.activeHyperlinkOutputIndex=void 0,t.include&&(t.activeHyperlinkOutputIndex=t.returnValue.length);else if(t.token.action==="close"){if(t.include&&t.activeHyperlink&&!t.activeHyperlinkHasVisibleText)return pk(t),t;t.activeHyperlink=void 0,t.activeHyperlinkHasVisibleText=!1,t.activeHyperlinkOutputIndex=void 0}return t.include&&(t.returnValue+=t.token.code),t}function a4(t){return!t.isPastEnd&&t.include&&(t.returnValue+=t.token.code),t}function l4(t){return!t.include&&t.position>=t.start&&!t.token.isGraphemeContinuation&&(t.include=!0,t.returnValue=[...t.activeStyles.values()].join(""),t.activeHyperlink&&(t.activeHyperlinkOutputIndex=t.returnValue.length,t.returnValue+=t.activeHyperlink.code)),t.include&&(t.returnValue+=t.token.value,t.pendingSgrOutputIndex=void 0,t.pendingSgrActiveStyles=void 0,t.activeHyperlink&&(t.activeHyperlinkHasVisibleText=!0)),t.position+=t.token.visibleWidth,t}var c4={sgr:o4,hyperlink:s4,control:a4,character:l4};function u4(t){let e=c4[t.token.type];return e?e(t):t}function d4(t){let e=Array.from({length:t.length},()=>!1),r=!1;for(let i=t.length-1;i>=0;i--){let n=t[i];e[i]=r,n.type==="character"&&(r=!!n.isGraphemeContinuation)}return e}function f4(t,e,r){return r===void 0?!1:e>=r?!0:t.type==="character"&&!t.isGraphemeContinuation&&e+t.visibleWidth>r}function so(t,e,r){let i=hf(t,{endCharacter:r}),n=d4(i),o=new Map,s,a=!1,l,c,u,d=0,f="",m=!1;for(let[y,h]of i.entries()){let w=f4(h,d,r);if(w&&h.type!=="character"&&n[y]&&(w=!1),w&&h.type==="character"&&!h.isGraphemeContinuation){if(s&&!a){let _={activeHyperlink:s,activeHyperlinkHasVisibleText:a,activeHyperlinkOutputIndex:l,pendingSgrOutputIndex:c,returnValue:f};pk(_),{activeHyperlink:s,activeHyperlinkHasVisibleText:a,activeHyperlinkOutputIndex:l,pendingSgrOutputIndex:c,returnValue:f}=_}c!==void 0&&(f=f.slice(0,c),o=u,c=void 0,u=void 0);break}({activeStyles:o,activeHyperlink:s,activeHyperlinkHasVisibleText:a,activeHyperlinkOutputIndex:l,pendingSgrOutputIndex:c,pendingSgrActiveStyles:u,position:d,returnValue:f,include:m}=u4({token:h,isPastEnd:w,start:e,activeStyles:o,activeHyperlink:s,activeHyperlinkHasVisibleText:a,activeHyperlinkOutputIndex:l,pendingSgrOutputIndex:c,pendingSgrActiveStyles:u,position:d,returnValue:f,include:m}))}return m?(s&&(f+=r4(s)),f+=t4(o),f):""}var Oa=(t,e)=>t.columns??e??80,m4="\x1B[?2026h",p4="\x1B[?2026l",h4=t=>t.split(`
|
|
205
|
-
`).length,gf=t=>{let e=sr(t);return e===""?0:e.split(`
|
|
206
|
-
`).length},g4=(t,e,r)=>{let i=t.rows??r??24;if(i===0)return{text:"",wasClipped:e!==""};let o=sr(e).split(`
|
|
207
|
-
`),s=Math.max(0,o.length-i);if(s===0)return{text:e,wasClipped:!1};let a=0;for(let u=0;u<s;u++)a+=Nt(o[u])+1;let l=so(e,a),c=gf(l);for(;c>i;)a++,l=so(e,a),c=gf(l);for(;a>0;){let u=so(e,a-1);if(gf(u)>i)break;a--,l=u}return{text:l,wasClipped:a>0}},y4=(t,e)=>{let r=0;for(;r<t.length&&r<e.length&&t[r]===e[r];r++);let i=t.length-1,n=e.length-1;for(;i>=r&&n>=r&&t[i]===e[n];)i--,n--;return{start:r,endPrevious:i,endNext:n}},v4=({prevCount:t,start:e,endPrevious:r,endNext:i,nextLines:n,nextWrappedEndsWithNewline:o})=>{let s="",a=t-1,l=e-a;l>0&&(s+=Ie.cursorDown(l)),l<0&&(s+=Ie.cursorUp(-l)),s+=Ie.cursorLeft;let c=Math.max(0,r-e+1);for(let h=0;h<c;h++)s+=Ie.eraseLine,h<c-1&&(s+=Ie.cursorDown());c>1&&(s+=Ie.cursorUp(c-1)),s+=Ie.cursorLeft;let u=n.slice(e,i+1),d=0;if(u.length>0){let h=u.join(`
|
|
208
|
-
`),w=o&&i<n.length-1&&!h.endsWith(`
|
|
209
|
-
`);s+=h,d=h4(h)-1,s+=Ie.eraseEndLine,w&&(s+=`
|
|
210
|
-
`,d++)}let f=e+d,y=n.length-1-f;return y>0&&(s+=Ie.cursorDown(y)),y<0&&(s+=Ie.cursorUp(-y)),s};function Aa(t,{showCursor:e=!1,defaultWidth:r,defaultHeight:i}={}){let n=0,o=Oa(t,r),s="",a=t.isTTY===!0,l=f=>{if(f!==""){if(a){t.write(m4+f+p4);return}t.write(f)}},c=(f,m,y=!0)=>{let h=String(f),w=h.endsWith(`
|
|
211
|
-
`)?h:`${h}
|
|
212
|
-
`,_=sf(w,m,{trim:!1,hard:!0,wordWrap:!1}),{text:T,wasClipped:k}=y?g4(t,_,i):{text:_,wasClipped:!1},E=T===""?[]:T.split(`
|
|
213
|
-
`);return{wrapped:T,lines:E,wasClipped:k}},u=()=>{s="",o=Oa(t,r),n=0},d=(...f)=>{e||ef.hide();let m=Oa(t,r),{wrapped:y,lines:h,wasClipped:w}=c(f.join(" "),m);if(h.length===0){n>0&&l(Ie.eraseLines(n)),s=y,o=m,n=0;return}if(y===s&&o===m)return;if(n===0){l(y),s=y,o=m,n=h.length;return}if(o!==m||w){l(Ie.eraseLines(n)+y),s=y,o=m,n=h.length;return}let _=s===""?[]:s.split(`
|
|
214
|
-
`),{start:T,endPrevious:k,endNext:E}=y4(_,h);if(_.length!==h.length&&(k=_.length-1,E=h.length-1),T===h.length&&n===h.length)return;if(T===0){l(Ie.eraseLines(n)+y),s=y,o=m,n=h.length;return}let R=v4({prevCount:n,start:T,endPrevious:k,endNext:E,nextLines:h,nextWrappedEndsWithNewline:y.endsWith(`
|
|
215
|
-
`)});l(R),s=y,o=m,n=h.length};return d.clear=()=>{l(Ie.eraseLines(n)),u()},d.done=()=>{u(),e||ef.show()},d.persist=(...f)=>{let m=n>0?Ie.eraseLines(n):"",y=Oa(t,r),{wrapped:h}=c(f.join(" "),y,!1);l(m+h),u()},d}var aY=Aa(hk.stdout);var lY=Aa(hk.stderr);var yf=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];function b4(t){if(t.elapsedStart===void 0||t.state!=="running")return;let e=Math.round((Date.now()-t.elapsedStart)/1e3);t.text=`${t.elapsedPrefix??"elapsed"}: ${e}s`}function gk(t,e){let r=[...t].sort((i,n)=>+!!i.footer-+!!n.footer);for(let i of r)b4(i);return r.map(i=>vf(i,e)).join(`
|
|
216
|
-
`)}function vf(t,e){return t.state==="succeeded"?`\u2714 ${t.text}`:t.state==="failed"?`\u2716 ${t.text}`:`${yf[e]} ${t.text}`}import{appendFileSync as vk,mkdirSync as S4}from"node:fs";import{join as x4}from"node:path";var w4=new RegExp("\x1B\\[[0-9;?]*[ -/]*[@-~]","g");function yk(t){return t.replace(w4,"")}var _4="review.log";function bk(){let t,e=[];return{append(r){let i=yk(r);if(!t){e.push(i);return}vk(t,`${i}
|
|
217
|
-
`)},attach(r){S4(r,{recursive:!0}),t=x4(r,_4);let i=["",`=== ${new Date().toISOString()} ===`,`$ ${process.argv.slice(1).join(" ")}`,...e];e=[],vk(t,`${i.join(`
|
|
218
|
-
`)}
|
|
219
|
-
`)}}}var wk=bk();function Sk(t){wk.append(t)}function xk(t){wk.attach(t)}var $4=80,Ra=class{entries=[];log=Aa(process.stdout);timer;frame=0;finished=!1;create(e){return this.add({state:"running",text:e})}addElapsed(e="elapsed"){return this.add({state:"running",text:`${e}: 0s`,footer:!0,elapsedStart:Date.now(),elapsedPrefix:e})}failRemaining(e){for(let r of this.entries)r.state==="running"&&this.resolve(r,"failed",e)}add(e){return this.entries.push(e),this.ensureTicking(),{get text(){return e.text},set text(r){e.text=r},succeed:r=>this.resolve(e,"succeeded",r),fail:r=>this.resolve(e,"failed",r)}}resolve(e,r,i){e.state==="running"&&(e.state=r,i!==void 0&&(e.text=i),e.elapsedStart=void 0,Sk(vf(e,0)),this.render(),this.maybeFinish())}ensureTicking(){this.timer||this.finished||(this.render(),this.timer=setInterval(()=>{this.frame=(this.frame+1)%yf.length,this.render()},$4))}render(){this.log(gk(this.entries,this.frame))}maybeFinish(){this.entries.some(e=>e.state==="running")||(this.timer&&clearInterval(this.timer),this.timer=void 0,this.finished=!0,this.render(),this.log.done())}};import{spawnSync as VM}from"node:child_process";var fT=ia(uT(),1);async function dT(t){try{return await t}catch(e){throw(e===""||e===void 0)&&process.exit(0),e}}async function En(t,e=!0){let{confirmed:r}=await dT(fT.default.prompt({type:"confirm",name:"confirmed",message:t,initial:e,symbols:{on:"[x]",off:"[ ]"}}));return r}function GM(){let t=VM("npm",["install","-g","@openai/codex"],{stdio:"inherit",shell:!0});return t.status===0&&t.error===void 0}async function mT(){return Vi("codex")?"available":(console.log("codex CLI was not found on PATH."),await En("Install @openai/codex globally via npm install -g @openai/codex?",!0)?(console.log("Installing @openai/codex..."),GM()?Vi("codex")?"available":(console.error("codex still not found on PATH after install. Skipping codex reviewer."),"skipped"):(console.error("npm install -g @openai/codex failed. Skipping codex reviewer."),"skipped")):(console.log("Skipping codex reviewer."),"skipped"))}async function pT(t,e){let r=yn("codex",t);return r?{kind:"cached",cached:r}:e?{kind:"run"}:await mT()==="available"?{kind:"run"}:{kind:"skipped"}}function hT(t){return{name:"codex",outputPath:t,exitCode:0,stderr:""}}var QM=`You are acting as a reviewer for a proposed code change made by another engineer. The full review request \u2014 branch, base, changed files, and unified diff \u2014 is in the request file whose absolute path is given below.
|
|
220
|
-
|
|
221
|
-
Your working directory is the repository under review, so you can read any file in it for context beyond the diff.
|
|
222
|
-
|
|
223
|
-
Read the request file, then produce a thorough code review in Markdown.
|
|
224
|
-
|
|
225
|
-
## When to flag a finding
|
|
226
|
-
|
|
227
|
-
A finding is worth raising only if all of the following hold:
|
|
228
|
-
|
|
229
|
-
1. It meaningfully impacts the accuracy, performance, security, or maintainability of the code.
|
|
230
|
-
2. The issue is discrete and actionable \u2014 not a vague observation about the codebase or a tangle of several things.
|
|
231
|
-
3. Fixing it does not demand more rigour than the rest of the codebase already shows (e.g. don't ask for exhaustive input validation in a repo of one-off scripts).
|
|
232
|
-
4. The issue was introduced by this change. Do not flag pre-existing bugs.
|
|
233
|
-
5. The original author would likely fix it if made aware.
|
|
234
|
-
6. It does not rely on unstated assumptions about the codebase or author's intent.
|
|
235
|
-
7. You can name the concretely affected code path. Speculation that a change *might* disrupt something elsewhere is not enough \u2014 identify the other code that is provably affected.
|
|
236
|
-
8. It is clearly not an intentional change by the author.
|
|
237
|
-
|
|
238
|
-
## Never recommend adding a code comment
|
|
239
|
-
|
|
240
|
-
This codebase enforces self-documenting code. Never raise a finding whose recommendation is to add a code comment \u2014 including a comment that restates what the code does, labels a block, or narrates why the change was made. The absence of comments is never a defect: do not ask for explanatory comments, doc comments, or TODOs, and do not list "missing comments" as an observation.
|
|
241
|
-
|
|
242
|
-
Two cases are still legitimate findings:
|
|
243
|
-
|
|
244
|
-
1. A comment this change made stale or wrong. Recommend removing or correcting it.
|
|
245
|
-
2. Genuinely misleading code. You may raise it, but the recommendation must be a clearer name, a smaller function, or a test. Only as a last resort, when none of those can carry the meaning, may you mention that \`assist code-comment\` exists for a single short comment.
|
|
246
|
-
|
|
247
|
-
## Tautological and vacuous tests
|
|
248
|
-
|
|
249
|
-
Flag tests added or changed by this change that cannot fail when the behaviour they claim to cover breaks. Do not flag pre-existing tests the change left untouched. Patterns:
|
|
250
|
-
|
|
251
|
-
1. Asserting a mock returns what it was stubbed to return.
|
|
252
|
-
2. Computing the expected value with the code under test, or with a copy of its logic.
|
|
253
|
-
3. Asserting only that a mocked function was called, when that mock is the whole subject of the test.
|
|
254
|
-
4. Any test that would still pass if the implementation were broken.
|
|
255
|
-
5. No assertions, or only \`toBeDefined\`/truthy checks.
|
|
256
|
-
6. Snapshots of mocked output.
|
|
257
|
-
|
|
258
|
-
Recommendation: assert against an independent expected value (a literal or a hand-derived result) or real behaviour, or delete the test. Severity is **minor** by default; **major** when the test is the sole coverage of a behaviour this change introduces or modifies, since that behaviour is then effectively untested.
|
|
259
|
-
|
|
260
|
-
## How to write the comment (Impact + Recommendation)
|
|
261
|
-
|
|
262
|
-
1. Make clear *why* the issue is a bug.
|
|
263
|
-
2. Communicate severity accurately \u2014 do not inflate.
|
|
264
|
-
3. Keep it brief: at most one paragraph of prose. Avoid line breaks inside the natural-language flow unless needed for a code fragment.
|
|
265
|
-
4. Do not paste code chunks longer than 3 lines. Wrap short snippets in inline code or a fenced block.
|
|
266
|
-
5. State explicitly the scenarios, environments, or inputs needed for the bug to manifest \u2014 and signal up front that severity depends on those factors.
|
|
267
|
-
6. Tone is matter-of-fact: not accusatory, not gushing. Read as a helpful assistant, not a performative human reviewer.
|
|
268
|
-
7. Write so the author grasps the point on first read.
|
|
269
|
-
8. Avoid flattery and filler ("Great job\u2026", "Thanks for\u2026"). They are not useful to the author.
|
|
270
|
-
|
|
271
|
-
Ignore trivial style unless it obscures meaning or violates a documented standard. One finding per distinct issue.
|
|
272
|
-
|
|
273
|
-
## How many findings to return
|
|
274
|
-
|
|
275
|
-
List every finding that the original author would want to know about and fix. Do not stop at the first qualifying one. If nothing clears the bar above, return no findings \u2014 empty is better than padded.
|
|
276
|
-
|
|
277
|
-
## Output format
|
|
278
|
-
|
|
279
|
-
For each finding include:
|
|
280
|
-
- Severity (blocker, major, minor, nit) \u2014 see rubric below
|
|
281
|
-
- File and line (e.g. \`src/foo.ts:42\`) when the finding is tied to a specific location. Take the line number from the diff's left gutter (its line in the new file); never count lines in the request file.
|
|
282
|
-
- Impact: what could go wrong, including the conditions under which it manifests
|
|
283
|
-
- Recommendation: a concrete change
|
|
284
|
-
|
|
285
|
-
Severity rubric:
|
|
286
|
-
- **blocker** \u2014 ships broken behaviour: crash, data loss, security hole, breaks the build or existing tests, or violates a stated requirement.
|
|
287
|
-
- **major** \u2014 likely bug, missing error handling on a real failure mode, or a regression in existing behaviour. Not "this could be cleaner" or "this might be slow."
|
|
288
|
-
- **minor** \u2014 narrow correctness or clarity issue with limited blast radius; worth fixing but not urgent.
|
|
289
|
-
- **nit** \u2014 style, naming, micro-refactors, comment wording; reviewer would not block on it.
|
|
290
|
-
|
|
291
|
-
Default to the lower tier when uncertain. Code-style preferences, refactor suggestions, and "I would have written it differently" belong in nit \u2014 not major. A finding is only major if you can name a concrete failure mode or regression.
|
|
292
|
-
|
|
293
|
-
Group findings by severity. If you have no findings in a category, omit it. End with a short overall summary.
|
|
294
|
-
|
|
295
|
-
Output only the review Markdown. Do not include any preamble or commentary about the process.`;function gT(t){return`${QM}
|
|
296
|
-
|
|
297
|
-
The review request is at: ${t}
|
|
298
|
-
`}var it=ia(up(),1),fee=it.default.Client,sI=it.default.Pool,mee=it.default.Connection,pee=it.default.types,hee=it.default.Query,gee=it.default.DatabaseError,yee=it.default.escapeIdentifier,vee=it.default.escapeLiteral,bee=it.default.Result,wee=it.default.TypeOverrides,See=it.default.defaults,zn=it.default;var bG=ia(Gh(),1);import{existsSync as TA}from"node:fs";import{homedir as yG}from"node:os";import{dirname as EA,join as Ku}from"node:path";import{existsSync as Q1,readFileSync as ZZ,statSync as KZ}from"node:fs";import{basename as VZ,dirname as Qh,isAbsolute as GZ,join as Jh,resolve as J1}from"node:path";function W1(t){let e=QZ(t);if(!e)return null;let r=WZ(e);if(!r)return null;let i=HZ(r);if(!i||VZ(i)!==".git")return null;let n=Qh(i);return Q1(n)?{root:e,clone:n}:null}function QZ(t){let e=J1(t);for(;e!==Qh(e);){let r=Jh(e,".git");if(Q1(r))return JZ(r)?e:null;e=Qh(e)}return null}function JZ(t){try{return KZ(t).isFile()}catch{return!1}}function WZ(t){let e=H1(Jh(t,".git"));return e?.startsWith("gitdir:")?Y1(e.slice(7).trim(),t):null}function HZ(t){let e=H1(Jh(t,"commondir"));return e?Y1(e,t):YZ(t)}function YZ(t){let e=/^(.*)[/\\]worktrees[/\\][^/\\]+[/\\]?$/.exec(t);return e?e[1]:null}function H1(t){try{let e=ZZ(t,"utf8").trim();return e===""?null:e}catch{return null}}function Y1(t,e){return GZ(t)?t:J1(e,t)}var X1=ia(Gh(),1);import{existsSync as XZ,readFileSync as eK}from"node:fs";function Jn(t){if(!XZ(t))return{};try{let e=eK(t,"utf8");return(0,X1.parse)(e)||{}}catch{return{}}}function eP(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Wh(t,e){let r={...t};for(let[i,n]of Object.entries(e)){let o=r[i];r[i]=eP(o)&&eP(n)?Wh(o,n):n}return r}function tP(t){let e=t.advice;return Array.isArray(e?.rules)?e.rules:void 0}function rP(t,e){let r=tP(t),i=tP(e);if(!(!r||!i))return[...r,...i]}function tK(t,e){if(!t&&!e)return;if(!t)return e;if(!e)return t;let r=new Set(e.map(n=>n.pattern));return[...t.filter(n=>!r.has(n.pattern)),...e]}function nP(t){return typeof t.name=="string"?t.name:void 0}function rK(t,e){if(!t&&!e)return;if(!t)return e;if(!e)return t;let r=new Set(e.map(nP).filter(n=>n!==void 0));return[...t.filter(n=>{let o=nP(n);return o===void 0||!r.has(o)}),...e]}function rc(t,e){let r=tK(t.deny,e.deny),i=rK(t.run,e.run),n=rP(t,e),o=Wh(t,e);return n!==void 0&&(o.advice={...o.advice,rules:n}),r!==void 0&&(o.deny=r),i!==void 0&&(o.run=i),o}import{existsSync as oK,readFileSync as sK}from"node:fs";import{join as aK}from"node:path";import{homedir as nK}from"node:os";import{join as iK}from"node:path";function iP(){return process.env.ASSIST_STORE_DIR||iK(nK(),".assist")}function lK(){return aK(iP(),"repo-config-cache.json")}function Hh(){let t=lK();if(!oK(t))return{};try{return JSON.parse(sK(t,"utf8"))??{}}catch{return{}}}function oP(){return Hh().repos??{}}import{existsSync as cK}from"node:fs";import Yh from"node:path";function sP(t){let e=t;for(;e!==Yh.dirname(e);){if(cK(Yh.join(e,".git")))return e;e=Yh.dirname(e)}return null}import{execFileSync as uK}from"node:child_process";function nc(t,e){let r=/^[A-Za-z]:[\\/]/.test(t),i=r?"git.exe":"git",n=r?["-C",t,...e]:e;try{return{ok:!0,out:uK(i,n,{encoding:"utf8",windowsHide:!0,stdio:["pipe","pipe","pipe"],...r?{}:{cwd:t}}).trim()}}catch{return{ok:!1,out:""}}}function aP(t,e){return nc(t,e).out||null}function lP(t){let e=nc(t,["remote","get-url","origin"]);if(e.out)return{url:e.out,ok:!0};let r=nc(t,["remote"]);if(!r.ok)return{url:null,ok:!1};let i=!1;for(let n of r.out.split(`
|
|
299
|
-
`).map(o=>o.trim()).filter(Boolean)){let o=nc(t,["remote","get-url",n]);if(o.out)return{url:o.out,ok:!0};o.ok||(i=!0)}return{url:null,ok:!i}}var dK=/^[A-Za-z]:[\\/]/;function cP(t){return t.replace(/^\/+/,"")}function fK(t){let e=t.trim().replace(/\.git$/i,"").replace(/\/+$/,""),r=e.match(/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\/(?:[^@/]+@)?([^/:]+)(?::\d+)?\/(.+)$/);if(r)return`${r[1].toLowerCase()}/${cP(r[2])}`;if(!e.includes("://")){let i=e.match(/^(?:[^@/]+@)?([^/:]+):(.+)$/);if(i)return`${i[1].toLowerCase()}/${cP(i[2])}`}return e.toLowerCase()}function uP(t){if(!dK.test(t)&&sP(t)===null)return{origin:`local:${t}`,stable:!1};let e=lP(t);return e.url?{origin:fK(e.url),stable:!0}:{origin:`local:${aP(t,["rev-parse","--show-toplevel"])??t}`,stable:e.ok}}var dP=new Map;function fP(t){let e=dP.get(t);if(e!==void 0)return e;let{origin:r,stable:i}=uP(t);return i&&dP.set(t,r),r}function mP(t){if(t.startsWith("local:")){let i=t.slice(6).replace(/\/+$/,"").split("/").filter(Boolean);return i[i.length-1]??t}let e=t.indexOf("/");return e===-1?t:t.slice(e+1)}var Xh=class extends Error{name="AmbiguousRepoConfigError"};function mK(t){let e=mP(t),r=e.split("/"),i=r[r.length-1]??e;return new Set([t,e,i])}function ic(t,e,r="~/.assist.yml"){let i=t.repos;if(!i||typeof i!="object"||Array.isArray(i))return;let n=i,o=mK(e),s=Object.keys(n).filter(a=>o.has(a));if(s.length!==0){if(s.length>1)throw new Xh(`Ambiguous repos config in ${r}: keys ${s.map(a=>`"${a}"`).join(", ")} all match the current repository (${e}). Keep a single key per repository.`);return s[0]}}function eg(t,e,r){let i=ic(t,e,r);if(i===void 0)return{};let n=t.repos[i];return!n||typeof n!="object"||Array.isArray(n)?{}:n}var pP="the shared db",hP=new Set;function gP(t,e){let r={repos:oP()};if(Object.keys(r.repos).length===0&&!t.repos)return{override:{}};let i=fP(e),n=ic(r,i,pP);if(n!==void 0)return{override:eg(r,i,pP),key:n,source:"db"};let o=ic(t,i);return o===void 0?{override:{}}:(pK(o),{override:eg(t,i),key:o,source:"yml"})}function pK(t){hP.has(t)||(hP.add(t),console.error(rt.yellow(`repos.${t} in ~/.assist.yml is not in the shared db, so other nodes don't see it. Run 'assist config import-repos' to share it.`)))}var hK=["windowsProjectsRoot","windowsDaemonHost","windowsDaemonPort","windowsVersionCheck","topBar","floatWaiting","floatWaitingAfterMs","parkWaitingAfterMs","askQuestionAutoApprove"],gK=["watcher","includeDrafts"],yK=["skip"];function tg(t,e){if(!t||typeof t!="object")return t;let r={...t};for(let i of e)delete r[i];return r}function vK(t){return!t||typeof t!="object"?t:Object.fromEntries(Object.entries(t).map(([e,r])=>[e,r&&typeof r=="object"?rg(r):r]))}function rg(t){let e={...t};e.repos&&(e.repos=vK(e.repos)),delete e.backlog,delete e.cliReadVerbs,delete e.roam;let r=e.news;if(r&&typeof r=="object"&&"feeds"in r){let{feeds:i,...n}=r;e.news=n}return e.sessions&&(e.sessions=tg(e.sessions,hK)),e.worktree&&(e.worktree=tg(e.worktree,gK)),e.devlog&&(e.devlog=tg(e.devlog,yK)),e}var p={};Pt(p,{$brand:()=>oc,$input:()=>xv,$output:()=>Sv,NEVER:()=>ng,TimePrecision:()=>Tv,ZodAny:()=>hw,ZodArray:()=>bw,ZodBase64:()=>Ou,ZodBase64URL:()=>Au,ZodBigInt:()=>ki,ZodBigIntFormat:()=>Lu,ZodBoolean:()=>$i,ZodCIDRv4:()=>Pu,ZodCIDRv6:()=>Nu,ZodCUID:()=>_u,ZodCUID2:()=>$u,ZodCatch:()=>qw,ZodCodec:()=>Zu,ZodCustom:()=>Ps,ZodCustomStringFormat:()=>xi,ZodDate:()=>ks,ZodDefault:()=>Dw,ZodDiscriminatedUnion:()=>Sw,ZodE164:()=>Ru,ZodEmail:()=>wu,ZodEmoji:()=>Su,ZodEnum:()=>wi,ZodError:()=>V5,ZodExactOptional:()=>Ow,ZodFile:()=>Pw,ZodFirstPartyTypeKind:()=>Xw,ZodFunction:()=>Ww,ZodGUID:()=>ws,ZodIPv4:()=>Iu,ZodIPv6:()=>Cu,ZodISODate:()=>pu,ZodISODateTime:()=>mu,ZodISODuration:()=>gu,ZodISOTime:()=>hu,ZodIntersection:()=>xw,ZodIssueCode:()=>Q5,ZodJWT:()=>Du,ZodKSUID:()=>Eu,ZodLazy:()=>Gw,ZodLiteral:()=>Cw,ZodMAC:()=>lw,ZodMap:()=>Ew,ZodNaN:()=>Bw,ZodNanoID:()=>xu,ZodNever:()=>yw,ZodNonOptional:()=>Fu,ZodNull:()=>mw,ZodNullable:()=>Rw,ZodNumber:()=>_i,ZodNumberFormat:()=>sn,ZodObject:()=>Es,ZodOptional:()=>qu,ZodPipe:()=>Bu,ZodPrefault:()=>zw,ZodPromise:()=>Jw,ZodReadonly:()=>Zw,ZodRealError:()=>We,ZodRecord:()=>Cs,ZodSet:()=>Iw,ZodString:()=>Si,ZodStringFormat:()=>ie,ZodSuccess:()=>Mw,ZodSymbol:()=>dw,ZodTemplateLiteral:()=>Vw,ZodTransform:()=>Nw,ZodTuple:()=>$w,ZodType:()=>K,ZodULID:()=>ku,ZodURL:()=>$s,ZodUUID:()=>zt,ZodUndefined:()=>fw,ZodUnion:()=>Is,ZodUnknown:()=>gw,ZodVoid:()=>vw,ZodXID:()=>Tu,ZodXor:()=>ww,_ZodString:()=>bu,_default:()=>Lw,_function:()=>JO,any:()=>EO,array:()=>Ts,base64:()=>uO,base64url:()=>dO,bigint:()=>xO,boolean:()=>uw,catch:()=>Fw,check:()=>WO,cidrv4:()=>lO,cidrv6:()=>cO,clone:()=>Ue,codec:()=>VO,coerce:()=>eS,config:()=>ye,core:()=>Jt,cuid:()=>eO,cuid2:()=>tO,custom:()=>HO,date:()=>CO,decode:()=>tw,decodeAsync:()=>nw,describe:()=>YO,discriminatedUnion:()=>DO,e164:()=>fO,email:()=>ZN,emoji:()=>YN,encode:()=>ew,encodeAsync:()=>rw,endsWith:()=>ui,enum:()=>Uu,exactOptional:()=>Aw,file:()=>FO,flattenError:()=>as,float32:()=>vO,float64:()=>bO,formatError:()=>ls,fromJSONSchema:()=>oA,function:()=>JO,getErrorMap:()=>W5,globalRegistry:()=>Oe,gt:()=>Dt,gte:()=>Me,guid:()=>KN,hash:()=>yO,hex:()=>gO,hostname:()=>hO,httpUrl:()=>HN,includes:()=>li,instanceof:()=>eA,int:()=>vu,int32:()=>wO,int64:()=>_O,intersection:()=>_w,ipv4:()=>oO,ipv6:()=>aO,iso:()=>bi,json:()=>rA,jwt:()=>mO,keyof:()=>PO,ksuid:()=>iO,lazy:()=>Qw,length:()=>nn,literal:()=>qO,locales:()=>gs,looseObject:()=>AO,looseRecord:()=>zO,lowercase:()=>si,lt:()=>Rt,lte:()=>st,mac:()=>sO,map:()=>jO,maxLength:()=>rn,maxSize:()=>Pr,meta:()=>XO,mime:()=>di,minLength:()=>Qt,minSize:()=>Lt,multipleOf:()=>Cr,nan:()=>KO,nanoid:()=>XN,nativeEnum:()=>MO,negative:()=>nu,never:()=>zu,nonnegative:()=>ou,nonoptional:()=>Uw,nonpositive:()=>iu,normalize:()=>fi,null:()=>pw,nullable:()=>xs,nullish:()=>BO,number:()=>cw,object:()=>NO,optional:()=>Ss,overwrite:()=>Et,parse:()=>Wb,parseAsync:()=>Hb,partialRecord:()=>LO,pipe:()=>_s,positive:()=>ru,prefault:()=>jw,preprocess:()=>nA,prettifyError:()=>hg,promise:()=>QO,property:()=>su,readonly:()=>Kw,record:()=>Tw,refine:()=>Hw,regex:()=>oi,regexes:()=>yt,registry:()=>Dc,safeDecode:()=>ow,safeDecodeAsync:()=>aw,safeEncode:()=>iw,safeEncodeAsync:()=>sw,safeParse:()=>Yb,safeParseAsync:()=>Xb,set:()=>UO,setErrorMap:()=>J5,size:()=>tn,slugify:()=>gi,startsWith:()=>ci,strictObject:()=>OO,string:()=>yu,stringFormat:()=>pO,stringbool:()=>tA,success:()=>ZO,superRefine:()=>Yw,symbol:()=>kO,templateLiteral:()=>GO,toJSONSchema:()=>uu,toLowerCase:()=>pi,toUpperCase:()=>hi,transform:()=>Mu,treeifyError:()=>pg,trim:()=>mi,tuple:()=>kw,uint32:()=>SO,uint64:()=>$O,ulid:()=>rO,undefined:()=>TO,union:()=>ju,unknown:()=>on,uppercase:()=>ai,url:()=>WN,util:()=>N,uuid:()=>VN,uuidv4:()=>GN,uuidv6:()=>QN,uuidv7:()=>JN,void:()=>IO,xid:()=>nO,xor:()=>RO});var Jt={};Pt(Jt,{$ZodAny:()=>By,$ZodArray:()=>Qy,$ZodAsyncError:()=>Tt,$ZodBase64:()=>Ay,$ZodBase64URL:()=>Ry,$ZodBigInt:()=>Ic,$ZodBigIntFormat:()=>Uy,$ZodBoolean:()=>fs,$ZodCIDRv4:()=>Py,$ZodCIDRv6:()=>Ny,$ZodCUID:()=>vy,$ZodCUID2:()=>by,$ZodCatch:()=>fv,$ZodCheck:()=>oe,$ZodCheckBigIntFormat:()=>Qg,$ZodCheckEndsWith:()=>sy,$ZodCheckGreaterThan:()=>Sc,$ZodCheckIncludes:()=>iy,$ZodCheckLengthEquals:()=>ey,$ZodCheckLessThan:()=>wc,$ZodCheckLowerCase:()=>ry,$ZodCheckMaxLength:()=>Yg,$ZodCheckMaxSize:()=>Jg,$ZodCheckMimeType:()=>ly,$ZodCheckMinLength:()=>Xg,$ZodCheckMinSize:()=>Wg,$ZodCheckMultipleOf:()=>Vg,$ZodCheckNumberFormat:()=>Gg,$ZodCheckOverwrite:()=>cy,$ZodCheckProperty:()=>ay,$ZodCheckRegex:()=>ty,$ZodCheckSizeEquals:()=>Hg,$ZodCheckStartsWith:()=>oy,$ZodCheckStringFormat:()=>ni,$ZodCheckUpperCase:()=>ny,$ZodCodec:()=>ps,$ZodCustom:()=>wv,$ZodCustomStringFormat:()=>zy,$ZodDate:()=>Gy,$ZodDefault:()=>lv,$ZodDiscriminatedUnion:()=>Hy,$ZodE164:()=>Dy,$ZodEmail:()=>py,$ZodEmoji:()=>gy,$ZodEncodeError:()=>$r,$ZodEnum:()=>rv,$ZodError:()=>ss,$ZodExactOptional:()=>sv,$ZodFile:()=>iv,$ZodFunction:()=>yv,$ZodGUID:()=>fy,$ZodIPv4:()=>Ey,$ZodIPv6:()=>Iy,$ZodISODate:()=>$y,$ZodISODateTime:()=>_y,$ZodISODuration:()=>Ty,$ZodISOTime:()=>ky,$ZodIntersection:()=>Yy,$ZodJWT:()=>Ly,$ZodKSUID:()=>xy,$ZodLazy:()=>bv,$ZodLiteral:()=>nv,$ZodMAC:()=>Cy,$ZodMap:()=>ev,$ZodNaN:()=>mv,$ZodNanoID:()=>yy,$ZodNever:()=>Ky,$ZodNonOptional:()=>uv,$ZodNull:()=>Fy,$ZodNullable:()=>av,$ZodNumber:()=>Ec,$ZodNumberFormat:()=>jy,$ZodObject:()=>BP,$ZodObjectJIT:()=>Jy,$ZodOptional:()=>Pc,$ZodPipe:()=>pv,$ZodPrefault:()=>cv,$ZodPromise:()=>vv,$ZodReadonly:()=>hv,$ZodRealError:()=>Je,$ZodRecord:()=>Xy,$ZodRegistry:()=>Rc,$ZodSet:()=>tv,$ZodString:()=>en,$ZodStringFormat:()=>ne,$ZodSuccess:()=>dv,$ZodSymbol:()=>My,$ZodTemplateLiteral:()=>gv,$ZodTransform:()=>ov,$ZodTuple:()=>Cc,$ZodType:()=>B,$ZodULID:()=>wy,$ZodURL:()=>hy,$ZodUUID:()=>my,$ZodUndefined:()=>qy,$ZodUnion:()=>ms,$ZodUnknown:()=>Zy,$ZodVoid:()=>Vy,$ZodXID:()=>Sy,$ZodXor:()=>Wy,$brand:()=>oc,$constructor:()=>b,$input:()=>xv,$output:()=>Sv,Doc:()=>ds,JSONSchema:()=>FN,JSONSchemaGenerator:()=>du,NEVER:()=>ng,TimePrecision:()=>Tv,_any:()=>Gv,_array:()=>eb,_base64:()=>Yc,_base64url:()=>Xc,_bigint:()=>Mv,_boolean:()=>jv,_catch:()=>j5,_check:()=>qN,_cidrv4:()=>Wc,_cidrv6:()=>Hc,_coercedBigint:()=>qv,_coercedBoolean:()=>Uv,_coercedDate:()=>Yv,_coercedNumber:()=>Ov,_coercedString:()=>$v,_cuid:()=>Bc,_cuid2:()=>Zc,_custom:()=>rb,_date:()=>Hv,_decode:()=>dc,_decodeAsync:()=>mc,_default:()=>D5,_discriminatedUnion:()=>_5,_e164:()=>eu,_email:()=>Lc,_emoji:()=>qc,_encode:()=>uc,_encodeAsync:()=>fc,_endsWith:()=>ui,_enum:()=>C5,_file:()=>tb,_float32:()=>Rv,_float64:()=>Dv,_gt:()=>Dt,_gte:()=>Me,_guid:()=>ys,_includes:()=>li,_int:()=>Av,_int32:()=>Lv,_int64:()=>Fv,_intersection:()=>$5,_ipv4:()=>Qc,_ipv6:()=>Jc,_isoDate:()=>Iv,_isoDateTime:()=>Ev,_isoDuration:()=>Pv,_isoTime:()=>Cv,_jwt:()=>tu,_ksuid:()=>Gc,_lazy:()=>F5,_length:()=>nn,_literal:()=>N5,_lowercase:()=>si,_lt:()=>Rt,_lte:()=>st,_mac:()=>kv,_map:()=>E5,_max:()=>st,_maxLength:()=>rn,_maxSize:()=>Pr,_mime:()=>di,_min:()=>Me,_minLength:()=>Qt,_minSize:()=>Lt,_multipleOf:()=>Cr,_nan:()=>Xv,_nanoid:()=>Fc,_nativeEnum:()=>P5,_negative:()=>nu,_never:()=>Jv,_nonnegative:()=>ou,_nonoptional:()=>L5,_nonpositive:()=>iu,_normalize:()=>fi,_null:()=>Vv,_nullable:()=>R5,_number:()=>Nv,_optional:()=>A5,_overwrite:()=>Et,_parse:()=>Xn,_parseAsync:()=>ei,_pipe:()=>U5,_positive:()=>ru,_promise:()=>B5,_property:()=>su,_readonly:()=>M5,_record:()=>T5,_refine:()=>nb,_regex:()=>oi,_safeDecode:()=>hc,_safeDecodeAsync:()=>yc,_safeEncode:()=>pc,_safeEncodeAsync:()=>gc,_safeParse:()=>ti,_safeParseAsync:()=>ri,_set:()=>I5,_size:()=>tn,_slugify:()=>gi,_startsWith:()=>ci,_string:()=>_v,_stringFormat:()=>yi,_stringbool:()=>ab,_success:()=>z5,_superRefine:()=>ib,_symbol:()=>Zv,_templateLiteral:()=>q5,_toLowerCase:()=>pi,_toUpperCase:()=>hi,_transform:()=>O5,_trim:()=>mi,_tuple:()=>k5,_uint32:()=>zv,_uint64:()=>Bv,_ulid:()=>Kc,_undefined:()=>Kv,_union:()=>S5,_unknown:()=>Qv,_uppercase:()=>ai,_url:()=>vs,_uuid:()=>zc,_uuidv4:()=>jc,_uuidv6:()=>Uc,_uuidv7:()=>Mc,_void:()=>Wv,_xid:()=>Vc,_xor:()=>x5,clone:()=>Ue,config:()=>ye,createStandardJSONSchemaMethod:()=>vi,createToJSONSchemaMethod:()=>lb,decode:()=>VK,decodeAsync:()=>QK,describe:()=>ob,encode:()=>KK,encodeAsync:()=>GK,extractDefs:()=>Or,finalize:()=>Ar,flattenError:()=>as,formatError:()=>ls,globalConfig:()=>Xo,globalRegistry:()=>Oe,initializeContext:()=>Nr,isValidBase64:()=>Oy,isValidBase64URL:()=>UP,isValidJWT:()=>MP,locales:()=>gs,meta:()=>sb,parse:()=>lc,parseAsync:()=>cc,prettifyError:()=>hg,process:()=>te,regexes:()=>yt,registry:()=>Dc,safeDecode:()=>WK,safeDecodeAsync:()=>YK,safeEncode:()=>JK,safeEncodeAsync:()=>HK,safeParse:()=>gg,safeParseAsync:()=>yg,toDotPath:()=>SP,toJSONSchema:()=>uu,treeifyError:()=>pg,util:()=>N,version:()=>uy});var ng=Object.freeze({status:"aborted"});function b(t,e,r){function i(a,l){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:l,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(t))return;a._zod.traits.add(t),e(a,l);let c=s.prototype,u=Object.keys(c);for(let d=0;d<u.length;d++){let f=u[d];f in a||(a[f]=c[f].bind(a))}}let n=r?.Parent??Object;class o extends n{}Object.defineProperty(o,"name",{value:t});function s(a){var l;let c=r?.Parent?new o:this;i(c,a),(l=c._zod).deferred??(l.deferred=[]);for(let u of c._zod.deferred)u();return c}return Object.defineProperty(s,"init",{value:i}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(t)}),Object.defineProperty(s,"name",{value:t}),s}var oc=Symbol("zod_brand"),Tt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},$r=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},Xo={};function ye(t){return t&&Object.assign(Xo,t),Xo}var N={};Pt(N,{BIGINT_FORMAT_RANGES:()=>mg,Class:()=>og,NUMBER_FORMAT_RANGES:()=>fg,aborted:()=>Ir,allowsEval:()=>lg,assert:()=>_K,assertEqual:()=>bK,assertIs:()=>SK,assertNever:()=>xK,assertNotEqual:()=>wK,assignProp:()=>Tr,base64ToUint8Array:()=>vP,base64urlToUint8Array:()=>MK,cached:()=>Hn,captureStackTrace:()=>ac,cleanEnum:()=>UK,cleanRegex:()=>rs,clone:()=>Ue,cloneDef:()=>kK,createTransparentProxy:()=>NK,defineLazy:()=>V,esc:()=>sc,escapeRegex:()=>gt,extend:()=>RK,finalizeIssue:()=>Qe,floatSafeRemainder:()=>sg,getElementAtPath:()=>TK,getEnumValues:()=>ts,getLengthableOrigin:()=>os,getParsedType:()=>PK,getSizableOrigin:()=>is,hexToUint8Array:()=>FK,isObject:()=>Yr,isPlainObject:()=>Er,issue:()=>Yn,joinValues:()=>x,jsonStringifyReplacer:()=>Wn,merge:()=>LK,mergeDefs:()=>Gt,normalizeParams:()=>O,nullish:()=>kr,numKeys:()=>CK,objectClone:()=>$K,omit:()=>AK,optionalKeys:()=>dg,parsedType:()=>P,partial:()=>zK,pick:()=>OK,prefixIssues:()=>ot,primitiveTypes:()=>ug,promiseAllObject:()=>EK,propertyKeyTypes:()=>ns,randomString:()=>IK,required:()=>jK,safeExtend:()=>DK,shallowClone:()=>cg,slugify:()=>ag,stringifyPrimitive:()=>C,uint8ArrayToBase64:()=>bP,uint8ArrayToBase64url:()=>qK,uint8ArrayToHex:()=>BK,unwrapMessage:()=>es});function bK(t){return t}function wK(t){return t}function SK(t){}function xK(t){throw new Error("Unexpected value in exhaustive check")}function _K(t){}function ts(t){let e=Object.values(t).filter(i=>typeof i=="number");return Object.entries(t).filter(([i,n])=>e.indexOf(+i)===-1).map(([i,n])=>n)}function x(t,e="|"){return t.map(r=>C(r)).join(e)}function Wn(t,e){return typeof e=="bigint"?e.toString():e}function Hn(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function kr(t){return t==null}function rs(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function sg(t,e){let r=(t.toString().split(".")[1]||"").length,i=e.toString(),n=(i.split(".")[1]||"").length;if(n===0&&/\d?e-\d?/.test(i)){let l=i.match(/\d?e-(\d?)/);l?.[1]&&(n=Number.parseInt(l[1]))}let o=r>n?r:n,s=Number.parseInt(t.toFixed(o).replace(".","")),a=Number.parseInt(e.toFixed(o).replace(".",""));return s%a/10**o}var yP=Symbol("evaluating");function V(t,e,r){let i;Object.defineProperty(t,e,{get(){if(i!==yP)return i===void 0&&(i=yP,i=r()),i},set(n){Object.defineProperty(t,e,{value:n})},configurable:!0})}function $K(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function Tr(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Gt(...t){let e={};for(let r of t){let i=Object.getOwnPropertyDescriptors(r);Object.assign(e,i)}return Object.defineProperties({},e)}function kK(t){return Gt(t._zod.def)}function TK(t,e){return e?e.reduce((r,i)=>r?.[i],t):t}function EK(t){let e=Object.keys(t),r=e.map(i=>t[i]);return Promise.all(r).then(i=>{let n={};for(let o=0;o<e.length;o++)n[e[o]]=i[o];return n})}function IK(t=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let i=0;i<t;i++)r+=e[Math.floor(Math.random()*e.length)];return r}function sc(t){return JSON.stringify(t)}function ag(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var ac="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function Yr(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var lg=Hn(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function Er(t){if(Yr(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(Yr(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function cg(t){return Er(t)?{...t}:Array.isArray(t)?[...t]:t}function CK(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}var PK=t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},ns=new Set(["string","number","symbol"]),ug=new Set(["string","number","bigint","boolean","symbol","undefined"]);function gt(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ue(t,e,r){let i=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(i._zod.parent=t),i}function O(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function NK(t){let e;return new Proxy({},{get(r,i,n){return e??(e=t()),Reflect.get(e,i,n)},set(r,i,n,o){return e??(e=t()),Reflect.set(e,i,n,o)},has(r,i){return e??(e=t()),Reflect.has(e,i)},deleteProperty(r,i){return e??(e=t()),Reflect.deleteProperty(e,i)},ownKeys(r){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,i){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,i)},defineProperty(r,i,n){return e??(e=t()),Reflect.defineProperty(e,i,n)}})}function C(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function dg(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}var fg={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]},mg={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function OK(t,e){let r=t._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o=Gt(t._zod.def,{get shape(){let s={};for(let a in e){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&(s[a]=r.shape[a])}return Tr(this,"shape",s),s},checks:[]});return Ue(t,o)}function AK(t,e){let r=t._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=Gt(t._zod.def,{get shape(){let s={...t._zod.def.shape};for(let a in e){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&delete s[a]}return Tr(this,"shape",s),s},checks:[]});return Ue(t,o)}function RK(t,e){if(!Er(e))throw new Error("Invalid input to extend: expected a plain object");let r=t._zod.def.checks;if(r&&r.length>0){let o=t._zod.def.shape;for(let s in e)if(Object.getOwnPropertyDescriptor(o,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=Gt(t._zod.def,{get shape(){let o={...t._zod.def.shape,...e};return Tr(this,"shape",o),o}});return Ue(t,n)}function DK(t,e){if(!Er(e))throw new Error("Invalid input to safeExtend: expected a plain object");let r=Gt(t._zod.def,{get shape(){let i={...t._zod.def.shape,...e};return Tr(this,"shape",i),i}});return Ue(t,r)}function LK(t,e){let r=Gt(t._zod.def,{get shape(){let i={...t._zod.def.shape,...e._zod.def.shape};return Tr(this,"shape",i),i},get catchall(){return e._zod.def.catchall},checks:[]});return Ue(t,r)}function zK(t,e,r){let n=e._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let s=Gt(e._zod.def,{get shape(){let a=e._zod.def.shape,l={...a};if(r)for(let c in r){if(!(c in a))throw new Error(`Unrecognized key: "${c}"`);r[c]&&(l[c]=t?new t({type:"optional",innerType:a[c]}):a[c])}else for(let c in a)l[c]=t?new t({type:"optional",innerType:a[c]}):a[c];return Tr(this,"shape",l),l},checks:[]});return Ue(e,s)}function jK(t,e,r){let i=Gt(e._zod.def,{get shape(){let n=e._zod.def.shape,o={...n};if(r)for(let s in r){if(!(s in o))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=new t({type:"nonoptional",innerType:n[s]}))}else for(let s in n)o[s]=new t({type:"nonoptional",innerType:n[s]});return Tr(this,"shape",o),o}});return Ue(e,i)}function Ir(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue!==!0)return!0;return!1}function ot(t,e){return e.map(r=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(t),r})}function es(t){return typeof t=="string"?t:t?.message}function Qe(t,e,r){let i={...t,path:t.path??[]};if(!t.message){let n=es(t.inst?._zod.def?.error?.(t))??es(e?.error?.(t))??es(r.customError?.(t))??es(r.localeError?.(t))??"Invalid input";i.message=n}return delete i.inst,delete i.continue,e?.reportInput||delete i.input,i}function is(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function os(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function P(t){let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"nan":"number";case"object":{if(t===null)return"null";if(Array.isArray(t))return"array";let r=t;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return e}function Yn(...t){let[e,r,i]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:i}:{...e}}function UK(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function vP(t){let e=atob(t),r=new Uint8Array(e.length);for(let i=0;i<e.length;i++)r[i]=e.charCodeAt(i);return r}function bP(t){let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}function MK(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-e.length%4)%4);return vP(e+r)}function qK(t){return bP(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function FK(t){let e=t.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(e.length/2);for(let i=0;i<e.length;i+=2)r[i/2]=Number.parseInt(e.slice(i,i+2),16);return r}function BK(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}var og=class{constructor(...e){}};var wP=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,Wn,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},ss=b("$ZodError",wP),Je=b("$ZodError",wP,{Parent:Error});function as(t,e=r=>r.message){let r={},i=[];for(let n of t.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(e(n))):i.push(e(n));return{formErrors:i,fieldErrors:r}}function ls(t,e=r=>r.message){let r={_errors:[]},i=n=>{for(let o of n.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(s=>i({issues:s}));else if(o.code==="invalid_key")i({issues:o.issues});else if(o.code==="invalid_element")i({issues:o.issues});else if(o.path.length===0)r._errors.push(e(o));else{let s=r,a=0;for(;a<o.path.length;){let l=o.path[a];a===o.path.length-1?(s[l]=s[l]||{_errors:[]},s[l]._errors.push(e(o))):s[l]=s[l]||{_errors:[]},s=s[l],a++}}};return i(t),r}function pg(t,e=r=>r.message){let r={errors:[]},i=(n,o=[])=>{var s,a;for(let l of n.issues)if(l.code==="invalid_union"&&l.errors.length)l.errors.map(c=>i({issues:c},l.path));else if(l.code==="invalid_key")i({issues:l.issues},l.path);else if(l.code==="invalid_element")i({issues:l.issues},l.path);else{let c=[...o,...l.path];if(c.length===0){r.errors.push(e(l));continue}let u=r,d=0;for(;d<c.length;){let f=c[d],m=d===c.length-1;typeof f=="string"?(u.properties??(u.properties={}),(s=u.properties)[f]??(s[f]={errors:[]}),u=u.properties[f]):(u.items??(u.items=[]),(a=u.items)[f]??(a[f]={errors:[]}),u=u.items[f]),m&&u.errors.push(e(l)),d++}}};return i(t),r}function SP(t){let e=[],r=t.map(i=>typeof i=="object"?i.key:i);for(let i of r)typeof i=="number"?e.push(`[${i}]`):typeof i=="symbol"?e.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?e.push(`[${JSON.stringify(i)}]`):(e.length&&e.push("."),e.push(i));return e.join("")}function hg(t){let e=[],r=[...t.issues].sort((i,n)=>(i.path??[]).length-(n.path??[]).length);for(let i of r)e.push(`\u2716 ${i.message}`),i.path?.length&&e.push(` \u2192 at ${SP(i.path)}`);return e.join(`
|
|
300
|
-
`)}var Xn=t=>(e,r,i,n)=>{let o=i?Object.assign(i,{async:!1}):{async:!1},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new Tt;if(s.issues.length){let a=new(n?.Err??t)(s.issues.map(l=>Qe(l,o,ye())));throw ac(a,n?.callee),a}return s.value},lc=Xn(Je),ei=t=>async(e,r,i,n)=>{let o=i?Object.assign(i,{async:!0}):{async:!0},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let a=new(n?.Err??t)(s.issues.map(l=>Qe(l,o,ye())));throw ac(a,n?.callee),a}return s.value},cc=ei(Je),ti=t=>(e,r,i)=>{let n=i?{...i,async:!1}:{async:!1},o=e._zod.run({value:r,issues:[]},n);if(o instanceof Promise)throw new Tt;return o.issues.length?{success:!1,error:new(t??ss)(o.issues.map(s=>Qe(s,n,ye())))}:{success:!0,data:o.value}},gg=ti(Je),ri=t=>async(e,r,i)=>{let n=i?Object.assign(i,{async:!0}):{async:!0},o=e._zod.run({value:r,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new t(o.issues.map(s=>Qe(s,n,ye())))}:{success:!0,data:o.value}},yg=ri(Je),uc=t=>(e,r,i)=>{let n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Xn(t)(e,r,n)},KK=uc(Je),dc=t=>(e,r,i)=>Xn(t)(e,r,i),VK=dc(Je),fc=t=>async(e,r,i)=>{let n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return ei(t)(e,r,n)},GK=fc(Je),mc=t=>async(e,r,i)=>ei(t)(e,r,i),QK=mc(Je),pc=t=>(e,r,i)=>{let n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return ti(t)(e,r,n)},JK=pc(Je),hc=t=>(e,r,i)=>ti(t)(e,r,i),WK=hc(Je),gc=t=>async(e,r,i)=>{let n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return ri(t)(e,r,n)},HK=gc(Je),yc=t=>async(e,r,i)=>ri(t)(e,r,i),YK=yc(Je);var yt={};Pt(yt,{base64:()=>Ag,base64url:()=>vc,bigint:()=>Ug,boolean:()=>qg,browserEmail:()=>sV,cidrv4:()=>Ng,cidrv6:()=>Og,cuid:()=>vg,cuid2:()=>bg,date:()=>Dg,datetime:()=>zg,domain:()=>cV,duration:()=>$g,e164:()=>Rg,email:()=>Tg,emoji:()=>Eg,extendedDuration:()=>XK,guid:()=>kg,hex:()=>uV,hostname:()=>lV,html5Email:()=>nV,idnEmail:()=>oV,integer:()=>Mg,ipv4:()=>Ig,ipv6:()=>Cg,ksuid:()=>xg,lowercase:()=>Zg,mac:()=>Pg,md5_base64:()=>fV,md5_base64url:()=>mV,md5_hex:()=>dV,nanoid:()=>_g,null:()=>Fg,number:()=>bc,rfc5322Email:()=>iV,sha1_base64:()=>hV,sha1_base64url:()=>gV,sha1_hex:()=>pV,sha256_base64:()=>vV,sha256_base64url:()=>bV,sha256_hex:()=>yV,sha384_base64:()=>SV,sha384_base64url:()=>xV,sha384_hex:()=>wV,sha512_base64:()=>$V,sha512_base64url:()=>kV,sha512_hex:()=>_V,string:()=>jg,time:()=>Lg,ulid:()=>wg,undefined:()=>Bg,unicodeEmail:()=>xP,uppercase:()=>Kg,uuid:()=>Xr,uuid4:()=>eV,uuid6:()=>tV,uuid7:()=>rV,xid:()=>Sg});var vg=/^[cC][^\s-]{8,}$/,bg=/^[0-9a-z]+$/,wg=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Sg=/^[0-9a-vA-V]{20}$/,xg=/^[A-Za-z0-9]{27}$/,_g=/^[a-zA-Z0-9_-]{21}$/,$g=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,XK=/^[-+]?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)?)??$/,kg=/^([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})$/,Xr=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[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)$/,eV=Xr(4),tV=Xr(6),rV=Xr(7),Tg=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,nV=/^[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])?)*$/,iV=/^(([^<>()\[\]\\.,;:\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,}))$/,xP=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,oV=xP,sV=/^[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])?)*$/,aV="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Eg(){return new RegExp(aV,"u")}var Ig=/^(?:(?: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])$/,Cg=/^(([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}|:))$/,Pg=t=>{let e=gt(t??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},Ng=/^((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])$/,Og=/^(([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])$/,Ag=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,vc=/^[A-Za-z0-9_-]*$/,lV=/^(?=.{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])?)*\.?$/,cV=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Rg=/^\+[1-9]\d{6,14}$/,_P="(?:(?:\\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])))",Dg=new RegExp(`^${_P}$`);function $P(t){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Lg(t){return new RegExp(`^${$P(t)}$`)}function zg(t){let e=$P({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let i=`${e}(?:${r.join("|")})`;return new RegExp(`^${_P}T(?:${i})$`)}var jg=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},Ug=/^-?\d+n?$/,Mg=/^-?\d+$/,bc=/^-?\d+(?:\.\d+)?$/,qg=/^(?:true|false)$/i,Fg=/^null$/i;var Bg=/^undefined$/i;var Zg=/^[^A-Z]*$/,Kg=/^[^a-z]*$/,uV=/^[0-9a-fA-F]*$/;function cs(t,e){return new RegExp(`^[A-Za-z0-9+/]{${t}}${e}$`)}function us(t){return new RegExp(`^[A-Za-z0-9_-]{${t}}$`)}var dV=/^[0-9a-fA-F]{32}$/,fV=cs(22,"=="),mV=us(22),pV=/^[0-9a-fA-F]{40}$/,hV=cs(27,"="),gV=us(27),yV=/^[0-9a-fA-F]{64}$/,vV=cs(43,"="),bV=us(43),wV=/^[0-9a-fA-F]{96}$/,SV=cs(64,""),xV=us(64),_V=/^[0-9a-fA-F]{128}$/,$V=cs(86,"=="),kV=us(86);var oe=b("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),TP={number:"number",bigint:"bigint",object:"date"},wc=b("$ZodCheckLessThan",(t,e)=>{oe.init(t,e);let r=TP[typeof e.value];t._zod.onattach.push(i=>{let n=i._zod.bag,o=(e.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<o&&(e.inclusive?n.maximum=e.value:n.exclusiveMaximum=e.value)}),t._zod.check=i=>{(e.inclusive?i.value<=e.value:i.value<e.value)||i.issues.push({origin:r,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),Sc=b("$ZodCheckGreaterThan",(t,e)=>{oe.init(t,e);let r=TP[typeof e.value];t._zod.onattach.push(i=>{let n=i._zod.bag,o=(e.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>o&&(e.inclusive?n.minimum=e.value:n.exclusiveMinimum=e.value)}),t._zod.check=i=>{(e.inclusive?i.value>=e.value:i.value>e.value)||i.issues.push({origin:r,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),Vg=b("$ZodCheckMultipleOf",(t,e)=>{oe.init(t,e),t._zod.onattach.push(r=>{var i;(i=r._zod.bag).multipleOf??(i.multipleOf=e.value)}),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):sg(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort})}}),Gg=b("$ZodCheckNumberFormat",(t,e)=>{oe.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),i=r?"int":"number",[n,o]=fg[e.format];t._zod.onattach.push(s=>{let a=s._zod.bag;a.format=e.format,a.minimum=n,a.maximum=o,r&&(a.pattern=Mg)}),t._zod.check=s=>{let a=s.value;if(r){if(!Number.isInteger(a)){s.issues.push({expected:i,format:e.format,code:"invalid_type",continue:!1,input:a,inst:t});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:t,origin:i,inclusive:!0,continue:!e.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:i,inclusive:!0,continue:!e.abort});return}}a<n&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:n,inclusive:!0,inst:t,continue:!e.abort}),a>o&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inclusive:!0,inst:t,continue:!e.abort})}}),Qg=b("$ZodCheckBigIntFormat",(t,e)=>{oe.init(t,e);let[r,i]=mg[e.format];t._zod.onattach.push(n=>{let o=n._zod.bag;o.format=e.format,o.minimum=r,o.maximum=i}),t._zod.check=n=>{let o=n.value;o<r&&n.issues.push({origin:"bigint",input:o,code:"too_small",minimum:r,inclusive:!0,inst:t,continue:!e.abort}),o>i&&n.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inclusive:!0,inst:t,continue:!e.abort})}}),Jg=b("$ZodCheckMaxSize",(t,e)=>{var r;oe.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return!kr(n)&&n.size!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<n&&(i._zod.bag.maximum=e.maximum)}),t._zod.check=i=>{let n=i.value;n.size<=e.maximum||i.issues.push({origin:is(n),code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),Wg=b("$ZodCheckMinSize",(t,e)=>{var r;oe.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return!kr(n)&&n.size!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>n&&(i._zod.bag.minimum=e.minimum)}),t._zod.check=i=>{let n=i.value;n.size>=e.minimum||i.issues.push({origin:is(n),code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),Hg=b("$ZodCheckSizeEquals",(t,e)=>{var r;oe.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return!kr(n)&&n.size!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag;n.minimum=e.size,n.maximum=e.size,n.size=e.size}),t._zod.check=i=>{let n=i.value,o=n.size;if(o===e.size)return;let s=o>e.size;i.issues.push({origin:is(n),...s?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:i.value,inst:t,continue:!e.abort})}}),Yg=b("$ZodCheckMaxLength",(t,e)=>{var r;oe.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return!kr(n)&&n.length!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<n&&(i._zod.bag.maximum=e.maximum)}),t._zod.check=i=>{let n=i.value;if(n.length<=e.maximum)return;let s=os(n);i.issues.push({origin:s,code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),Xg=b("$ZodCheckMinLength",(t,e)=>{var r;oe.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return!kr(n)&&n.length!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>n&&(i._zod.bag.minimum=e.minimum)}),t._zod.check=i=>{let n=i.value;if(n.length>=e.minimum)return;let s=os(n);i.issues.push({origin:s,code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),ey=b("$ZodCheckLengthEquals",(t,e)=>{var r;oe.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return!kr(n)&&n.length!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag;n.minimum=e.length,n.maximum=e.length,n.length=e.length}),t._zod.check=i=>{let n=i.value,o=n.length;if(o===e.length)return;let s=os(n),a=o>e.length;i.issues.push({origin:s,...a?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:i.value,inst:t,continue:!e.abort})}}),ni=b("$ZodCheckStringFormat",(t,e)=>{var r,i;oe.init(t,e),t._zod.onattach.push(n=>{let o=n._zod.bag;o.format=e.format,e.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=n=>{e.pattern.lastIndex=0,!e.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:e.format,input:n.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(i=t._zod).check??(i.check=()=>{})}),ty=b("$ZodCheckRegex",(t,e)=>{ni.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),ry=b("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=Zg),ni.init(t,e)}),ny=b("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=Kg),ni.init(t,e)}),iy=b("$ZodCheckIncludes",(t,e)=>{oe.init(t,e);let r=gt(e.includes),i=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=i,t._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),t._zod.check=n=>{n.value.includes(e.includes,e.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:n.value,inst:t,continue:!e.abort})}}),oy=b("$ZodCheckStartsWith",(t,e)=>{oe.init(t,e);let r=new RegExp(`^${gt(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.onattach.push(i=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),t._zod.check=i=>{i.value.startsWith(e.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:i.value,inst:t,continue:!e.abort})}}),sy=b("$ZodCheckEndsWith",(t,e)=>{oe.init(t,e);let r=new RegExp(`.*${gt(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.onattach.push(i=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),t._zod.check=i=>{i.value.endsWith(e.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:i.value,inst:t,continue:!e.abort})}});function kP(t,e,r){t.issues.length&&e.issues.push(...ot(r,t.issues))}var ay=b("$ZodCheckProperty",(t,e)=>{oe.init(t,e),t._zod.check=r=>{let i=e.schema._zod.run({value:r.value[e.property],issues:[]},{});if(i instanceof Promise)return i.then(n=>kP(n,r,e.property));kP(i,r,e.property)}}),ly=b("$ZodCheckMimeType",(t,e)=>{oe.init(t,e);let r=new Set(e.mime);t._zod.onattach.push(i=>{i._zod.bag.mime=e.mime}),t._zod.check=i=>{r.has(i.value.type)||i.issues.push({code:"invalid_value",values:e.mime,input:i.value.type,inst:t,continue:!e.abort})}}),cy=b("$ZodCheckOverwrite",(t,e)=>{oe.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}});var ds=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let i=e.split(`
|
|
301
|
-
`).filter(s=>s),n=Math.min(...i.map(s=>s.length-s.trimStart().length)),o=i.map(s=>s.slice(n)).map(s=>" ".repeat(this.indent*2)+s);for(let s of o)this.content.push(s)}compile(){let e=Function,r=this?.args,n=[...(this?.content??[""]).map(o=>` ${o}`)];return new e(...r,n.join(`
|
|
302
|
-
`))}};var uy={major:4,minor:3,patch:6};var B=b("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=uy;let i=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&i.unshift(t);for(let n of i)for(let o of n._zod.onattach)o(t);if(i.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let n=(s,a,l)=>{let c=Ir(s),u;for(let d of a){if(d._zod.def.when){if(!d._zod.def.when(s))continue}else if(c)continue;let f=s.issues.length,m=d._zod.check(s);if(m instanceof Promise&&l?.async===!1)throw new Tt;if(u||m instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await m,s.issues.length!==f&&(c||(c=Ir(s,f)))});else{if(s.issues.length===f)continue;c||(c=Ir(s,f))}}return u?u.then(()=>s):s},o=(s,a,l)=>{if(Ir(s))return s.aborted=!0,s;let c=n(a,i,l);if(c instanceof Promise){if(l.async===!1)throw new Tt;return c.then(u=>t._zod.parse(u,l))}return t._zod.parse(c,l)};t._zod.run=(s,a)=>{if(a.skipChecks)return t._zod.parse(s,a);if(a.direction==="backward"){let c=t._zod.parse({value:s.value,issues:[]},{...a,skipChecks:!0});return c instanceof Promise?c.then(u=>o(u,s,a)):o(c,s,a)}let l=t._zod.parse(s,a);if(l instanceof Promise){if(a.async===!1)throw new Tt;return l.then(c=>n(c,i,a))}return n(l,i,a)}}V(t,"~standard",()=>({validate:n=>{try{let o=gg(t,n);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return yg(t,n).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),en=b("$ZodString",(t,e)=>{B.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??jg(t._zod.bag),t._zod.parse=(r,i)=>{if(e.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:t}),r}}),ne=b("$ZodStringFormat",(t,e)=>{ni.init(t,e),en.init(t,e)}),fy=b("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=kg),ne.init(t,e)}),my=b("$ZodUUID",(t,e)=>{if(e.version){let i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(i===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=Xr(i))}else e.pattern??(e.pattern=Xr());ne.init(t,e)}),py=b("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=Tg),ne.init(t,e)}),hy=b("$ZodURL",(t,e)=>{ne.init(t,e),t._zod.check=r=>{try{let i=r.value.trim(),n=new URL(i);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),e.normalize?r.value=n.href:r.value=i;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),gy=b("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=Eg()),ne.init(t,e)}),yy=b("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=_g),ne.init(t,e)}),vy=b("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=vg),ne.init(t,e)}),by=b("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=bg),ne.init(t,e)}),wy=b("$ZodULID",(t,e)=>{e.pattern??(e.pattern=wg),ne.init(t,e)}),Sy=b("$ZodXID",(t,e)=>{e.pattern??(e.pattern=Sg),ne.init(t,e)}),xy=b("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=xg),ne.init(t,e)}),_y=b("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=zg(e)),ne.init(t,e)}),$y=b("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=Dg),ne.init(t,e)}),ky=b("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=Lg(e)),ne.init(t,e)}),Ty=b("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=$g),ne.init(t,e)}),Ey=b("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=Ig),ne.init(t,e),t._zod.bag.format="ipv4"}),Iy=b("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=Cg),ne.init(t,e),t._zod.bag.format="ipv6",t._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}}),Cy=b("$ZodMAC",(t,e)=>{e.pattern??(e.pattern=Pg(e.delimiter)),ne.init(t,e),t._zod.bag.format="mac"}),Py=b("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=Ng),ne.init(t,e)}),Ny=b("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=Og),ne.init(t,e),t._zod.check=r=>{let i=r.value.split("/");try{if(i.length!==2)throw new Error;let[n,o]=i;if(!o)throw new Error;let s=Number(o);if(`${s}`!==o)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:t,continue:!e.abort})}}});function Oy(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}var Ay=b("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=Ag),ne.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=r=>{Oy(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});function UP(t){if(!vc.test(t))return!1;let e=t.replace(/[-_]/g,i=>i==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return Oy(r)}var Ry=b("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=vc),ne.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=r=>{UP(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),Dy=b("$ZodE164",(t,e)=>{e.pattern??(e.pattern=Rg),ne.init(t,e)});function MP(t,e=null){try{let r=t.split(".");if(r.length!==3)return!1;let[i]=r;if(!i)return!1;let n=JSON.parse(atob(i));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||e&&(!("alg"in n)||n.alg!==e))}catch{return!1}}var Ly=b("$ZodJWT",(t,e)=>{ne.init(t,e),t._zod.check=r=>{MP(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),zy=b("$ZodCustomStringFormat",(t,e)=>{ne.init(t,e),t._zod.check=r=>{e.fn(r.value)||r.issues.push({code:"invalid_format",format:e.format,input:r.value,inst:t,continue:!e.abort})}}),Ec=b("$ZodNumber",(t,e)=>{B.init(t,e),t._zod.pattern=t._zod.bag.pattern??bc,t._zod.parse=(r,i)=>{if(e.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 o=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:t,...o?{received:o}:{}}),r}}),jy=b("$ZodNumberFormat",(t,e)=>{Gg.init(t,e),Ec.init(t,e)}),fs=b("$ZodBoolean",(t,e)=>{B.init(t,e),t._zod.pattern=qg,t._zod.parse=(r,i)=>{if(e.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:t}),r}}),Ic=b("$ZodBigInt",(t,e)=>{B.init(t,e),t._zod.pattern=Ug,t._zod.parse=(r,i)=>{if(e.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:t}),r}}),Uy=b("$ZodBigIntFormat",(t,e)=>{Qg.init(t,e),Ic.init(t,e)}),My=b("$ZodSymbol",(t,e)=>{B.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;return typeof n=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:t}),r}}),qy=b("$ZodUndefined",(t,e)=>{B.init(t,e),t._zod.pattern=Bg,t._zod.values=new Set([void 0]),t._zod.optin="optional",t._zod.optout="optional",t._zod.parse=(r,i)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:t}),r}}),Fy=b("$ZodNull",(t,e)=>{B.init(t,e),t._zod.pattern=Fg,t._zod.values=new Set([null]),t._zod.parse=(r,i)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:t}),r}}),By=b("$ZodAny",(t,e)=>{B.init(t,e),t._zod.parse=r=>r}),Zy=b("$ZodUnknown",(t,e)=>{B.init(t,e),t._zod.parse=r=>r}),Ky=b("$ZodNever",(t,e)=>{B.init(t,e),t._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)}),Vy=b("$ZodVoid",(t,e)=>{B.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"void",code:"invalid_type",input:n,inst:t}),r}}),Gy=b("$ZodDate",(t,e)=>{B.init(t,e),t._zod.parse=(r,i)=>{if(e.coerce)try{r.value=new Date(r.value)}catch{}let n=r.value,o=n instanceof Date;return o&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...o?{received:"Invalid Date"}:{},inst:t}),r}});function IP(t,e,r){t.issues.length&&e.issues.push(...ot(r,t.issues)),e.value[r]=t.value}var Qy=b("$ZodArray",(t,e)=>{B.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:t}),r;r.value=Array(n.length);let o=[];for(let s=0;s<n.length;s++){let a=n[s],l=e.element._zod.run({value:a,issues:[]},i);l instanceof Promise?o.push(l.then(c=>IP(c,r,s))):IP(l,r,s)}return o.length?Promise.all(o).then(()=>r):r}});function Tc(t,e,r,i,n){if(t.issues.length){if(n&&!(r in i))return;e.issues.push(...ot(r,t.issues))}t.value===void 0?r in i&&(e.value[r]=void 0):e.value[r]=t.value}function qP(t){let e=Object.keys(t.shape);for(let i of e)if(!t.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);let r=dg(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}function FP(t,e,r,i,n,o){let s=[],a=n.keySet,l=n.catchall._zod,c=l.def.type,u=l.optout==="optional";for(let d in e){if(a.has(d))continue;if(c==="never"){s.push(d);continue}let f=l.run({value:e[d],issues:[]},i);f instanceof Promise?t.push(f.then(m=>Tc(m,r,d,e,u))):Tc(f,r,d,e,u)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:e,inst:o}),t.length?Promise.all(t).then(()=>r):r}var BP=b("$ZodObject",(t,e)=>{if(B.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let a=e.shape;Object.defineProperty(e,"shape",{get:()=>{let l={...a};return Object.defineProperty(e,"shape",{value:l}),l}})}let i=Hn(()=>qP(e));V(t._zod,"propValues",()=>{let a=e.shape,l={};for(let c in a){let u=a[c]._zod;if(u.values){l[c]??(l[c]=new Set);for(let d of u.values)l[c].add(d)}}return l});let n=Yr,o=e.catchall,s;t._zod.parse=(a,l)=>{s??(s=i.value);let c=a.value;if(!n(c))return a.issues.push({expected:"object",code:"invalid_type",input:c,inst:t}),a;a.value={};let u=[],d=s.shape;for(let f of s.keys){let m=d[f],y=m._zod.optout==="optional",h=m._zod.run({value:c[f],issues:[]},l);h instanceof Promise?u.push(h.then(w=>Tc(w,a,f,c,y))):Tc(h,a,f,c,y)}return o?FP(u,c,a,l,i.value,t):u.length?Promise.all(u).then(()=>a):a}}),Jy=b("$ZodObjectJIT",(t,e)=>{BP.init(t,e);let r=t._zod.parse,i=Hn(()=>qP(e)),n=f=>{let m=new ds(["shape","payload","ctx"]),y=i.value,h=k=>{let E=sc(k);return`shape[${E}]._zod.run({ value: input[${E}], issues: [] }, ctx)`};m.write("const input = payload.value;");let w=Object.create(null),_=0;for(let k of y.keys)w[k]=`key_${_++}`;m.write("const newResult = {};");for(let k of y.keys){let E=w[k],R=sc(k),U=f[k]?._zod?.optout==="optional";m.write(`const ${E} = ${h(k)};`),U?m.write(`
|
|
303
|
-
if (${E}.issues.length) {
|
|
304
|
-
if (${R} in input) {
|
|
305
|
-
payload.issues = payload.issues.concat(${E}.issues.map(iss => ({
|
|
306
|
-
...iss,
|
|
307
|
-
path: iss.path ? [${R}, ...iss.path] : [${R}]
|
|
308
|
-
})));
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
if (${E}.value === undefined) {
|
|
313
|
-
if (${R} in input) {
|
|
314
|
-
newResult[${R}] = undefined;
|
|
315
|
-
}
|
|
316
|
-
} else {
|
|
317
|
-
newResult[${R}] = ${E}.value;
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
`):m.write(`
|
|
321
|
-
if (${E}.issues.length) {
|
|
322
|
-
payload.issues = payload.issues.concat(${E}.issues.map(iss => ({
|
|
323
|
-
...iss,
|
|
324
|
-
path: iss.path ? [${R}, ...iss.path] : [${R}]
|
|
325
|
-
})));
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
if (${E}.value === undefined) {
|
|
329
|
-
if (${R} in input) {
|
|
330
|
-
newResult[${R}] = undefined;
|
|
331
|
-
}
|
|
332
|
-
} else {
|
|
333
|
-
newResult[${R}] = ${E}.value;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
`)}m.write("payload.value = newResult;"),m.write("return payload;");let T=m.compile();return(k,E)=>T(f,k,E)},o,s=Yr,a=!Xo.jitless,c=a&&lg.value,u=e.catchall,d;t._zod.parse=(f,m)=>{d??(d=i.value);let y=f.value;return s(y)?a&&c&&m?.async===!1&&m.jitless!==!0?(o||(o=n(e.shape)),f=o(f,m),u?FP([],y,f,m,d,t):f):r(f,m):(f.issues.push({expected:"object",code:"invalid_type",input:y,inst:t}),f)}});function CP(t,e,r,i){for(let o of t)if(o.issues.length===0)return e.value=o.value,e;let n=t.filter(o=>!Ir(o));return n.length===1?(e.value=n[0].value,n[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(o=>o.issues.map(s=>Qe(s,i,ye())))}),e)}var ms=b("$ZodUnion",(t,e)=>{B.init(t,e),V(t._zod,"optin",()=>e.options.some(n=>n._zod.optin==="optional")?"optional":void 0),V(t._zod,"optout",()=>e.options.some(n=>n._zod.optout==="optional")?"optional":void 0),V(t._zod,"values",()=>{if(e.options.every(n=>n._zod.values))return new Set(e.options.flatMap(n=>Array.from(n._zod.values)))}),V(t._zod,"pattern",()=>{if(e.options.every(n=>n._zod.pattern)){let n=e.options.map(o=>o._zod.pattern);return new RegExp(`^(${n.map(o=>rs(o.source)).join("|")})$`)}});let r=e.options.length===1,i=e.options[0]._zod.run;t._zod.parse=(n,o)=>{if(r)return i(n,o);let s=!1,a=[];for(let l of e.options){let c=l._zod.run({value:n.value,issues:[]},o);if(c instanceof Promise)a.push(c),s=!0;else{if(c.issues.length===0)return c;a.push(c)}}return s?Promise.all(a).then(l=>CP(l,n,t,o)):CP(a,n,t,o)}});function PP(t,e,r,i){let n=t.filter(o=>o.issues.length===0);return n.length===1?(e.value=n[0].value,e):(n.length===0?e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(o=>o.issues.map(s=>Qe(s,i,ye())))}):e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:[],inclusive:!1}),e)}var Wy=b("$ZodXor",(t,e)=>{ms.init(t,e),e.inclusive=!1;let r=e.options.length===1,i=e.options[0]._zod.run;t._zod.parse=(n,o)=>{if(r)return i(n,o);let s=!1,a=[];for(let l of e.options){let c=l._zod.run({value:n.value,issues:[]},o);c instanceof Promise?(a.push(c),s=!0):a.push(c)}return s?Promise.all(a).then(l=>PP(l,n,t,o)):PP(a,n,t,o)}}),Hy=b("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,ms.init(t,e);let r=t._zod.parse;V(t._zod,"propValues",()=>{let n={};for(let o of e.options){let s=o._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(let[a,l]of Object.entries(s)){n[a]||(n[a]=new Set);for(let c of l)n[a].add(c)}}return n});let i=Hn(()=>{let n=e.options,o=new Map;for(let s of n){let a=s._zod.propValues?.[e.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let l of a){if(o.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);o.set(l,s)}}return o});t._zod.parse=(n,o)=>{let s=n.value;if(!Yr(s))return n.issues.push({code:"invalid_type",expected:"object",input:s,inst:t}),n;let a=i.value.get(s?.[e.discriminator]);return a?a._zod.run(n,o):e.unionFallback?r(n,o):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:s,path:[e.discriminator],inst:t}),n)}}),Yy=b("$ZodIntersection",(t,e)=>{B.init(t,e),t._zod.parse=(r,i)=>{let n=r.value,o=e.left._zod.run({value:n,issues:[]},i),s=e.right._zod.run({value:n,issues:[]},i);return o instanceof Promise||s instanceof Promise?Promise.all([o,s]).then(([l,c])=>NP(r,l,c)):NP(r,o,s)}});function dy(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(Er(t)&&Er(e)){let r=Object.keys(e),i=Object.keys(t).filter(o=>r.indexOf(o)!==-1),n={...t,...e};for(let o of i){let s=dy(t[o],e[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};n[o]=s.data}return{valid:!0,data:n}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let i=0;i<t.length;i++){let n=t[i],o=e[i],s=dy(n,o);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function NP(t,e,r){let i=new Map,n;for(let a of e.issues)if(a.code==="unrecognized_keys"){n??(n=a);for(let l of a.keys)i.has(l)||i.set(l,{}),i.get(l).l=!0}else t.issues.push(a);for(let a of r.issues)if(a.code==="unrecognized_keys")for(let l of a.keys)i.has(l)||i.set(l,{}),i.get(l).r=!0;else t.issues.push(a);let o=[...i].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(o.length&&n&&t.issues.push({...n,keys:o}),Ir(t))return t;let s=dy(e.value,r.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return t.value=s.data,t}var Cc=b("$ZodTuple",(t,e)=>{B.init(t,e);let r=e.items;t._zod.parse=(i,n)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:t,expected:"tuple",code:"invalid_type"}),i;i.value=[];let s=[],a=[...r].reverse().findIndex(u=>u._zod.optin!=="optional"),l=a===-1?0:r.length-a;if(!e.rest){let u=o.length>r.length,d=o.length<l-1;if(u||d)return i.issues.push({...u?{code:"too_big",maximum:r.length,inclusive:!0}:{code:"too_small",minimum:r.length},input:o,inst:t,origin:"array"}),i}let c=-1;for(let u of r){if(c++,c>=o.length&&c>=l)continue;let d=u._zod.run({value:o[c],issues:[]},n);d instanceof Promise?s.push(d.then(f=>xc(f,i,c))):xc(d,i,c)}if(e.rest){let u=o.slice(r.length);for(let d of u){c++;let f=e.rest._zod.run({value:d,issues:[]},n);f instanceof Promise?s.push(f.then(m=>xc(m,i,c))):xc(f,i,c)}}return s.length?Promise.all(s).then(()=>i):i}});function xc(t,e,r){t.issues.length&&e.issues.push(...ot(r,t.issues)),e.value[r]=t.value}var Xy=b("$ZodRecord",(t,e)=>{B.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;if(!Er(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:t}),r;let o=[],s=e.keyType._zod.values;if(s){r.value={};let a=new Set;for(let c of s)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){a.add(typeof c=="number"?c.toString():c);let u=e.valueType._zod.run({value:n[c],issues:[]},i);u instanceof Promise?o.push(u.then(d=>{d.issues.length&&r.issues.push(...ot(c,d.issues)),r.value[c]=d.value})):(u.issues.length&&r.issues.push(...ot(c,u.issues)),r.value[c]=u.value)}let l;for(let c in n)a.has(c)||(l=l??[],l.push(c));l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:t,keys:l})}else{r.value={};for(let a of Reflect.ownKeys(n)){if(a==="__proto__")continue;let l=e.keyType._zod.run({value:a,issues:[]},i);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&bc.test(a)&&l.issues.length){let d=e.keyType._zod.run({value:Number(a),issues:[]},i);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){e.mode==="loose"?r.value[a]=n[a]:r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(d=>Qe(d,i,ye())),input:a,path:[a],inst:t});continue}let u=e.valueType._zod.run({value:n[a],issues:[]},i);u instanceof Promise?o.push(u.then(d=>{d.issues.length&&r.issues.push(...ot(a,d.issues)),r.value[l.value]=d.value})):(u.issues.length&&r.issues.push(...ot(a,u.issues)),r.value[l.value]=u.value)}}return o.length?Promise.all(o).then(()=>r):r}}),ev=b("$ZodMap",(t,e)=>{B.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;if(!(n instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:n,inst:t}),r;let o=[];r.value=new Map;for(let[s,a]of n){let l=e.keyType._zod.run({value:s,issues:[]},i),c=e.valueType._zod.run({value:a,issues:[]},i);l instanceof Promise||c instanceof Promise?o.push(Promise.all([l,c]).then(([u,d])=>{OP(u,d,r,s,n,t,i)})):OP(l,c,r,s,n,t,i)}return o.length?Promise.all(o).then(()=>r):r}});function OP(t,e,r,i,n,o,s){t.issues.length&&(ns.has(typeof i)?r.issues.push(...ot(i,t.issues)):r.issues.push({code:"invalid_key",origin:"map",input:n,inst:o,issues:t.issues.map(a=>Qe(a,s,ye()))})),e.issues.length&&(ns.has(typeof i)?r.issues.push(...ot(i,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:o,key:i,issues:e.issues.map(a=>Qe(a,s,ye()))})),r.value.set(t.value,e.value)}var tv=b("$ZodSet",(t,e)=>{B.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;if(!(n instanceof Set))return r.issues.push({input:n,inst:t,expected:"set",code:"invalid_type"}),r;let o=[];r.value=new Set;for(let s of n){let a=e.valueType._zod.run({value:s,issues:[]},i);a instanceof Promise?o.push(a.then(l=>AP(l,r))):AP(a,r)}return o.length?Promise.all(o).then(()=>r):r}});function AP(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}var rv=b("$ZodEnum",(t,e)=>{B.init(t,e);let r=ts(e.entries),i=new Set(r);t._zod.values=i,t._zod.pattern=new RegExp(`^(${r.filter(n=>ns.has(typeof n)).map(n=>typeof n=="string"?gt(n):n.toString()).join("|")})$`),t._zod.parse=(n,o)=>{let s=n.value;return i.has(s)||n.issues.push({code:"invalid_value",values:r,input:s,inst:t}),n}}),nv=b("$ZodLiteral",(t,e)=>{if(B.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(e.values);t._zod.values=r,t._zod.pattern=new RegExp(`^(${e.values.map(i=>typeof i=="string"?gt(i):i?gt(i.toString()):String(i)).join("|")})$`),t._zod.parse=(i,n)=>{let o=i.value;return r.has(o)||i.issues.push({code:"invalid_value",values:e.values,input:o,inst:t}),i}}),iv=b("$ZodFile",(t,e)=>{B.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;return n instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:n,inst:t}),r}}),ov=b("$ZodTransform",(t,e)=>{B.init(t,e),t._zod.parse=(r,i)=>{if(i.direction==="backward")throw new $r(t.constructor.name);let n=e.transform(r.value,r);if(i.async)return(n instanceof Promise?n:Promise.resolve(n)).then(s=>(r.value=s,r));if(n instanceof Promise)throw new Tt;return r.value=n,r}});function RP(t,e){return t.issues.length&&e===void 0?{issues:[],value:void 0}:t}var Pc=b("$ZodOptional",(t,e)=>{B.init(t,e),t._zod.optin="optional",t._zod.optout="optional",V(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),V(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${rs(r.source)})?$`):void 0}),t._zod.parse=(r,i)=>{if(e.innerType._zod.optin==="optional"){let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>RP(o,r.value)):RP(n,r.value)}return r.value===void 0?r:e.innerType._zod.run(r,i)}}),sv=b("$ZodExactOptional",(t,e)=>{Pc.init(t,e),V(t._zod,"values",()=>e.innerType._zod.values),V(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(r,i)=>e.innerType._zod.run(r,i)}),av=b("$ZodNullable",(t,e)=>{B.init(t,e),V(t._zod,"optin",()=>e.innerType._zod.optin),V(t._zod,"optout",()=>e.innerType._zod.optout),V(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${rs(r.source)}|null)$`):void 0}),V(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,i)=>r.value===null?r:e.innerType._zod.run(r,i)}),lv=b("$ZodDefault",(t,e)=>{B.init(t,e),t._zod.optin="optional",V(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,i)=>{if(i.direction==="backward")return e.innerType._zod.run(r,i);if(r.value===void 0)return r.value=e.defaultValue,r;let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>DP(o,e)):DP(n,e)}});function DP(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}var cv=b("$ZodPrefault",(t,e)=>{B.init(t,e),t._zod.optin="optional",V(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,i)=>(i.direction==="backward"||r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,i))}),uv=b("$ZodNonOptional",(t,e)=>{B.init(t,e),V(t._zod,"values",()=>{let r=e.innerType._zod.values;return r?new Set([...r].filter(i=>i!==void 0)):void 0}),t._zod.parse=(r,i)=>{let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>LP(o,t)):LP(n,t)}});function LP(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}var dv=b("$ZodSuccess",(t,e)=>{B.init(t,e),t._zod.parse=(r,i)=>{if(i.direction==="backward")throw new $r("ZodSuccess");let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>(r.value=o.issues.length===0,r)):(r.value=n.issues.length===0,r)}}),fv=b("$ZodCatch",(t,e)=>{B.init(t,e),V(t._zod,"optin",()=>e.innerType._zod.optin),V(t._zod,"optout",()=>e.innerType._zod.optout),V(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,i)=>{if(i.direction==="backward")return e.innerType._zod.run(r,i);let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(s=>Qe(s,i,ye()))},input:r.value}),r.issues=[]),r)):(r.value=n.value,n.issues.length&&(r.value=e.catchValue({...r,error:{issues:n.issues.map(o=>Qe(o,i,ye()))},input:r.value}),r.issues=[]),r)}}),mv=b("$ZodNaN",(t,e)=>{B.init(t,e),t._zod.parse=(r,i)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:t,expected:"nan",code:"invalid_type"}),r)}),pv=b("$ZodPipe",(t,e)=>{B.init(t,e),V(t._zod,"values",()=>e.in._zod.values),V(t._zod,"optin",()=>e.in._zod.optin),V(t._zod,"optout",()=>e.out._zod.optout),V(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,i)=>{if(i.direction==="backward"){let o=e.out._zod.run(r,i);return o instanceof Promise?o.then(s=>_c(s,e.in,i)):_c(o,e.in,i)}let n=e.in._zod.run(r,i);return n instanceof Promise?n.then(o=>_c(o,e.out,i)):_c(n,e.out,i)}});function _c(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues},r)}var ps=b("$ZodCodec",(t,e)=>{B.init(t,e),V(t._zod,"values",()=>e.in._zod.values),V(t._zod,"optin",()=>e.in._zod.optin),V(t._zod,"optout",()=>e.out._zod.optout),V(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,i)=>{if((i.direction||"forward")==="forward"){let o=e.in._zod.run(r,i);return o instanceof Promise?o.then(s=>$c(s,e,i)):$c(o,e,i)}else{let o=e.out._zod.run(r,i);return o instanceof Promise?o.then(s=>$c(s,e,i)):$c(o,e,i)}}});function $c(t,e,r){if(t.issues.length)return t.aborted=!0,t;if((r.direction||"forward")==="forward"){let n=e.transform(t.value,t);return n instanceof Promise?n.then(o=>kc(t,o,e.out,r)):kc(t,n,e.out,r)}else{let n=e.reverseTransform(t.value,t);return n instanceof Promise?n.then(o=>kc(t,o,e.in,r)):kc(t,n,e.in,r)}}function kc(t,e,r,i){return t.issues.length?(t.aborted=!0,t):r._zod.run({value:e,issues:t.issues},i)}var hv=b("$ZodReadonly",(t,e)=>{B.init(t,e),V(t._zod,"propValues",()=>e.innerType._zod.propValues),V(t._zod,"values",()=>e.innerType._zod.values),V(t._zod,"optin",()=>e.innerType?._zod?.optin),V(t._zod,"optout",()=>e.innerType?._zod?.optout),t._zod.parse=(r,i)=>{if(i.direction==="backward")return e.innerType._zod.run(r,i);let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(zP):zP(n)}});function zP(t){return t.value=Object.freeze(t.value),t}var gv=b("$ZodTemplateLiteral",(t,e)=>{B.init(t,e);let r=[];for(let i of e.parts)if(typeof i=="object"&&i!==null){if(!i._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...i._zod.traits].shift()}`);let n=i._zod.pattern instanceof RegExp?i._zod.pattern.source:i._zod.pattern;if(!n)throw new Error(`Invalid template literal part: ${i._zod.traits}`);let o=n.startsWith("^")?1:0,s=n.endsWith("$")?n.length-1:n.length;r.push(n.slice(o,s))}else if(i===null||ug.has(typeof i))r.push(gt(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);t._zod.pattern=new RegExp(`^${r.join("")}$`),t._zod.parse=(i,n)=>typeof i.value!="string"?(i.issues.push({input:i.value,inst:t,expected:"string",code:"invalid_type"}),i):(t._zod.pattern.lastIndex=0,t._zod.pattern.test(i.value)||i.issues.push({input:i.value,inst:t,code:"invalid_format",format:e.format??"template_literal",pattern:t._zod.pattern.source}),i)}),yv=b("$ZodFunction",(t,e)=>(B.init(t,e),t._def=e,t._zod.def=e,t.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...i){let n=t._def.input?lc(t._def.input,i):i,o=Reflect.apply(r,this,n);return t._def.output?lc(t._def.output,o):o}},t.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...i){let n=t._def.input?await cc(t._def.input,i):i,o=await Reflect.apply(r,this,n);return t._def.output?await cc(t._def.output,o):o}},t._zod.parse=(r,i)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:t}),r):(t._def.output&&t._def.output._zod.def.type==="promise"?r.value=t.implementAsync(r.value):r.value=t.implement(r.value),r),t.input=(...r)=>{let i=t.constructor;return Array.isArray(r[0])?new i({type:"function",input:new Cc({type:"tuple",items:r[0],rest:r[1]}),output:t._def.output}):new i({type:"function",input:r[0],output:t._def.output})},t.output=r=>{let i=t.constructor;return new i({type:"function",input:t._def.input,output:r})},t)),vv=b("$ZodPromise",(t,e)=>{B.init(t,e),t._zod.parse=(r,i)=>Promise.resolve(r.value).then(n=>e.innerType._zod.run({value:n,issues:[]},i))}),bv=b("$ZodLazy",(t,e)=>{B.init(t,e),V(t._zod,"innerType",()=>e.getter()),V(t._zod,"pattern",()=>t._zod.innerType?._zod?.pattern),V(t._zod,"propValues",()=>t._zod.innerType?._zod?.propValues),V(t._zod,"optin",()=>t._zod.innerType?._zod?.optin??void 0),V(t._zod,"optout",()=>t._zod.innerType?._zod?.optout??void 0),t._zod.parse=(r,i)=>t._zod.innerType._zod.run(r,i)}),wv=b("$ZodCustom",(t,e)=>{oe.init(t,e),B.init(t,e),t._zod.parse=(r,i)=>r,t._zod.check=r=>{let i=r.value,n=e.fn(i);if(n instanceof Promise)return n.then(o=>jP(o,r,i,t));jP(n,r,i,t)}});function jP(t,e,r,i){if(!t){let n={code:"custom",input:r,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(n.params=i._zod.def.params),e.issues.push(Yn(n))}}var gs={};Pt(gs,{ar:()=>ZP,az:()=>KP,be:()=>GP,bg:()=>QP,ca:()=>JP,cs:()=>WP,da:()=>HP,de:()=>YP,en:()=>Nc,eo:()=>XP,es:()=>eN,fa:()=>tN,fi:()=>rN,fr:()=>nN,frCA:()=>iN,he:()=>oN,hu:()=>sN,hy:()=>lN,id:()=>cN,is:()=>uN,it:()=>dN,ja:()=>fN,ka:()=>mN,kh:()=>pN,km:()=>Oc,ko:()=>hN,lt:()=>yN,mk:()=>vN,ms:()=>bN,nl:()=>wN,no:()=>SN,ota:()=>xN,pl:()=>$N,ps:()=>_N,pt:()=>kN,ru:()=>EN,sl:()=>IN,sv:()=>CN,ta:()=>PN,th:()=>NN,tr:()=>ON,ua:()=>AN,uk:()=>Ac,ur:()=>RN,uz:()=>DN,vi:()=>LN,yo:()=>UN,zhCN:()=>zN,zhTW:()=>jN});var EV=()=>{let t={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 e(n){return t[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"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=P(n.input),a=i[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 ${o}\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 ${C(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: ${x(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(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"} ${o} ${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"} ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(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 ${o} ${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 ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`${r[o.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":""}: ${x(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 ZP(){return{localeError:EV()}}var IV=()=>{let t={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 e(n){return t[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"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=P(n.input),a=i[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 ${o}, daxil olan ${a}`}case"invalid_value":return n.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${C(n.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${x(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${o}${n.maximum.toString()} ${s.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${o}${n.minimum.toString()} ${s.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${o.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:o.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${o.suffix}" il\u0259 bitm\u0259lidir`:o.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${o.includes}" daxil olmal\u0131d\u0131r`:o.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${o.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[o.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":""}: ${x(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 KP(){return{localeError:IV()}}function VP(t,e,r,i){let n=Math.abs(t),o=n%10,s=n%100;return s>=11&&s<=19?i:o===1?e:o>=2&&o<=4?r:i}var CV=()=>{let t={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 e(n){return t[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"},i={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=P(n.input),a=i[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 ${o}, \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 ${C(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 ${x(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);if(s){let a=Number(n.maximum),l=VP(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} ${o}${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 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);if(s){let a=Number(n.minimum),l=VP(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} ${o}${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 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[o.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"}: ${x(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 GP(){return{localeError:CV()}}var PV=()=>{let t={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 e(n){return t[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"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=P(n.input),a=i[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 ${o}, \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 ${C(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 ${x(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(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 ${o}${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 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(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 ${o}${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 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.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 "${o.prefix}"`;if(o.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 "${o.suffix}"`;if(o.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 "${o.includes}"`;if(o.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 ${o.pattern}`;let s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return o.format==="emoji"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="datetime"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="date"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),o.format==="time"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="duration"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${s} ${r[o.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":""}: ${x(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 QP(){return{localeError:PV()}}var NV=()=>{let t={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(n){return t[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"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=P(n.input),a=i[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 ${o}, s'ha rebut ${a}`}case"invalid_value":return n.values.length===1?`Valor inv\xE0lid: s'esperava ${C(n.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${x(n.values," o ")}`;case"too_big":{let o=n.inclusive?"com a m\xE0xim":"menys de",s=e(n.origin);return s?`Massa gran: s'esperava que ${n.origin??"el valor"} contingu\xE9s ${o} ${n.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"com a m\xEDnim":"m\xE9s de",s=e(n.origin);return s?`Massa petit: s'esperava que ${n.origin} contingu\xE9s ${o} ${n.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${o.prefix}"`:o.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${o.suffix}"`:o.format==="includes"?`Format inv\xE0lid: ha d'incloure "${o.includes}"`:o.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${o.pattern}`:`Format inv\xE0lid per a ${r[o.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":""}: ${x(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 JP(){return{localeError:NV()}}var OV=()=>{let t={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 e(n){return t[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"},i={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=P(n.input),a=i[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 ${o}, obdr\u017Eeno ${a}`}case"invalid_value":return n.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${C(n.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${x(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${o}${n.maximum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${o}${n.minimum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${o.prefix}"`:o.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${o.suffix}"`:o.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${o.includes}"`:o.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${o.pattern}`:`Neplatn\xFD form\xE1t ${r[o.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: ${x(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 WP(){return{localeError:OV()}}var AV=()=>{let t={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function e(n){return t[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"},i={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 o=i[n.expected]??n.expected,s=P(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Ugyldigt input: forventede instanceof ${n.expected}, fik ${a}`:`Ugyldigt input: forventede ${o}, fik ${a}`}case"invalid_value":return n.values.length===1?`Ugyldig v\xE6rdi: forventede ${C(n.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${x(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin),a=i[n.origin]??n.origin;return s?`For stor: forventede ${a??"value"} ${s.verb} ${o} ${n.maximum.toString()} ${s.unit??"elementer"}`:`For stor: forventede ${a??"value"} havde ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin),a=i[n.origin]??n.origin;return s?`For lille: forventede ${a} ${s.verb} ${o} ${n.minimum.toString()} ${s.unit}`:`For lille: forventede ${a} havde ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ugyldig streng: skal starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: skal ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: skal indeholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${r[o.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"}: ${x(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 HP(){return{localeError:AV()}}var RV=()=>{let t={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 e(n){return t[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"},i={nan:"NaN",number:"Zahl",array:"Array"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=P(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${n.expected}, erhalten ${a}`:`Ung\xFCltige Eingabe: erwartet ${o}, erhalten ${a}`}case"invalid_value":return n.values.length===1?`Ung\xFCltige Eingabe: erwartet ${C(n.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${x(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ist`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ist`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ung\xFCltiger String: muss mit "${o.prefix}" beginnen`:o.format==="ends_with"?`Ung\xFCltiger String: muss mit "${o.suffix}" enden`:o.format==="includes"?`Ung\xFCltiger String: muss "${o.includes}" enthalten`:o.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${o.pattern} entsprechen`:`Ung\xFCltig: ${r[o.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"}: ${x(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 YP(){return{localeError:RV()}}var DV=()=>{let t={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 e(n){return t[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"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=P(n.input),a=i[s]??s;return`Invalid input: expected ${o}, received ${a}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${C(n.values[0])}`:`Invalid option: expected one of ${x(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Too big: expected ${n.origin??"value"} to have ${o}${n.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Too small: expected ${n.origin} to have ${o}${n.minimum.toString()} ${s.unit}`:`Too small: expected ${n.origin} to be ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${r[o.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":""}: ${x(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}};function Nc(){return{localeError:DV()}}var LV=()=>{let t={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(n){return t[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"},i={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=P(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${n.expected}, ricevi\u011Dis ${a}`:`Nevalida enigo: atendi\u011Dis ${o}, ricevi\u011Dis ${a}`}case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${C(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${x(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${o}${n.minimum.toString()} ${s.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${o.prefix}"`:o.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${o.suffix}"`:o.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${o.includes}"`:o.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`:`Nevalida ${r[o.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":""}: ${x(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 XP(){return{localeError:LV()}}var zV=()=>{let t={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(n){return t[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"},i={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 o=i[n.expected]??n.expected,s=P(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${n.expected}, recibido ${a}`:`Entrada inv\xE1lida: se esperaba ${o}, recibido ${a}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: se esperaba ${C(n.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${x(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin),a=i[n.origin]??n.origin;return s?`Demasiado grande: se esperaba que ${a??"valor"} tuviera ${o}${n.maximum.toString()} ${s.unit??"elementos"}`:`Demasiado grande: se esperaba que ${a??"valor"} fuera ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin),a=i[n.origin]??n.origin;return s?`Demasiado peque\xF1o: se esperaba que ${a} tuviera ${o}${n.minimum.toString()} ${s.unit}`:`Demasiado peque\xF1o: se esperaba que ${a} fuera ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${o.prefix}"`:o.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${o.suffix}"`:o.format==="includes"?`Cadena inv\xE1lida: debe incluir "${o.includes}"`:o.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${o.pattern}`:`Inv\xE1lido ${r[o.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":""}: ${x(n.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${i[n.origin]??n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${i[n.origin]??n.origin}`;default:return"Entrada inv\xE1lida"}}};function eN(){return{localeError:zV()}}var jV=()=>{let t={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 e(n){return t[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"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=P(n.input),a=i[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 ${o} \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 ${C(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 ${x(n.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${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 ${o}${n.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} ${s.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:o.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:o.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${o.includes}" \u0628\u0627\u0634\u062F`:o.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${o.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[o.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: ${x(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 tN(){return{localeError:jV()}}var UV=()=>{let t={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 e(n){return t[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"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=P(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${a}`:`Virheellinen tyyppi: odotettiin ${o}, oli ${a}`}case"invalid_value":return n.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${C(n.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${x(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Liian suuri: ${s.subject} t\xE4ytyy olla ${o}${n.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Liian pieni: ${s.subject} t\xE4ytyy olla ${o}${n.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${o.prefix}"`:o.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${o.suffix}"`:o.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${o.includes}"`:o.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${o.pattern}`:`Virheellinen ${r[o.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"}: ${x(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 rN(){return{localeError:UV()}}var MV=()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(n){return t[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"},i={nan:"NaN",number:"nombre",array:"tableau"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=P(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : instanceof ${n.expected} attendu, ${a} re\xE7u`:`Entr\xE9e invalide : ${o} attendu, ${a} re\xE7u`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : ${C(n.values[0])} attendu`:`Option invalide : une valeur parmi ${x(n.values,"|")} attendue`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Trop grand : ${n.origin??"valeur"} doit ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${n.origin??"valeur"} doit \xEAtre ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Trop petit : ${n.origin} doit ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`Trop petit : ${n.origin} doit \xEAtre ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${o.pattern}`:`${r[o.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":""} : ${x(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 nN(){return{localeError:MV()}}var qV=()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(n){return t[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"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=P(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : attendu instanceof ${n.expected}, re\xE7u ${a}`:`Entr\xE9e invalide : attendu ${o}, re\xE7u ${a}`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : attendu ${C(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${x(n.values,"|")}`;case"too_big":{let o=n.inclusive?"\u2264":"<",s=e(n.origin);return s?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${o}${n.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"\u2265":">",s=e(n.origin);return s?`Trop petit : attendu que ${n.origin} ait ${o}${n.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${n.origin} soit ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${o.pattern}`:`${r[o.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":""} : ${x(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 iN(){return{localeError:qV()}}var FV=()=>{let t={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"}},e={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=c=>c?t[c]:void 0,i=c=>{let u=r(c);return u?u.label:c??t.unknown.label},n=c=>`\u05D4${i(c)}`,o=c=>(r(c)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",s=c=>c?e[c]??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 c=>{switch(c.code){case"invalid_type":{let u=c.expected,d=l[u??""]??i(u),f=P(c.input),m=l[f]??t[f]?.label??f;return/^[A-Z]/.test(c.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${c.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${m}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${d}, \u05D4\u05EA\u05E7\u05D1\u05DC ${m}`}case"invalid_value":{if(c.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 ${C(c.values[0])}`;let u=c.values.map(m=>C(m));if(c.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 ${u[0]} \u05D0\u05D5 ${u[1]}`;let d=u[u.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 ${u.slice(0,-1).join(", ")} \u05D0\u05D5 ${d}`}case"too_big":{let u=s(c.origin),d=n(c.origin??"value");if(c.origin==="string")return`${u?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${c.maximum.toString()} ${u?.unit??""} ${c.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(c.origin==="number"){let y=c.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${c.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${c.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${y}`}if(c.origin==="array"||c.origin==="set"){let y=c.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",h=c.inclusive?`${c.maximum} ${u?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${c.maximum} ${u?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} ${y} \u05DC\u05D4\u05DB\u05D9\u05DC ${h}`.trim()}let f=c.inclusive?"<=":"<",m=o(c.origin??"value");return u?.unit?`${u.longLabel} \u05DE\u05D3\u05D9: ${d} ${m} ${f}${c.maximum.toString()} ${u.unit}`:`${u?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${d} ${m} ${f}${c.maximum.toString()}`}case"too_small":{let u=s(c.origin),d=n(c.origin??"value");if(c.origin==="string")return`${u?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${c.minimum.toString()} ${u?.unit??""} ${c.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(c.origin==="number"){let y=c.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${c.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${c.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${y}`}if(c.origin==="array"||c.origin==="set"){let y=c.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(c.minimum===1&&c.inclusive){let w=(c.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${y} \u05DC\u05D4\u05DB\u05D9\u05DC ${w}`}let h=c.inclusive?`${c.minimum} ${u?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${c.minimum} ${u?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${y} \u05DC\u05D4\u05DB\u05D9\u05DC ${h}`.trim()}let f=c.inclusive?">=":">",m=o(c.origin??"value");return u?.unit?`${u.shortLabel} \u05DE\u05D3\u05D9: ${d} ${m} ${f}${c.minimum.toString()} ${u.unit}`:`${u?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${d} ${m} ${f}${c.minimum.toString()}`}case"invalid_format":{let u=c;if(u.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${u.prefix}"`;if(u.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${u.suffix}"`;if(u.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${u.includes}"`;if(u.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 ${u.pattern}`;let d=a[u.format],f=d?.label??u.format,y=(d?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${f} \u05DC\u05D0 ${y}`}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 ${c.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${c.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${c.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${x(c.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(c.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function oN(){return{localeError:FV()}}var BV=()=>{let t={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(n){return t[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"},i={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=P(n.input),a=i[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 ${o}, a kapott \xE9rt\xE9k ${a}`}case"invalid_value":return n.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${C(n.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${x(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`T\xFAl nagy: ${n.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${o}${n.maximum.toString()} ${s.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${n.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} m\xE9rete t\xFAl kicsi ${o}${n.minimum.toString()} ${s.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} t\xFAl kicsi ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\xC9rv\xE9nytelen string: "${o.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:o.format==="ends_with"?`\xC9rv\xE9nytelen string: "${o.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:o.format==="includes"?`\xC9rv\xE9nytelen string: "${o.includes}" \xE9rt\xE9ket kell tartalmaznia`:o.format==="regex"?`\xC9rv\xE9nytelen string: ${o.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[o.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":""}: ${x(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 sN(){return{localeError:BV()}}function aN(t,e,r){return Math.abs(t)===1?e:r}function ii(t){if(!t)return"";let e=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=t[t.length-1];return t+(e.includes(r)?"\u0576":"\u0568")}var ZV=()=>{let t={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 e(n){return t[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"},i={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=P(n.input),a=i[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 ${o}, \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 ${C(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 ${x(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);if(s){let a=Number(n.maximum),l=aN(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 ${ii(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${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 ${ii(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);if(s){let a=Number(n.minimum),l=aN(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 ${ii(n.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${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 ${ii(n.origin)} \u056C\u056B\u0576\u056B ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${o.prefix}"-\u0578\u057E`:o.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${o.suffix}"-\u0578\u057E`:o.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${o.includes}"`:o.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 ${o.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[o.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":""}. ${x(n.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${ii(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 ${ii(n.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};function lN(){return{localeError:ZV()}}var KV=()=>{let t={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(n){return t[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"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=P(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${a}`:`Input tidak valid: diharapkan ${o}, diterima ${a}`}case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${C(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${x(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${o}${n.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Terlalu kecil: diharapkan ${n.origin} memiliki ${o}${n.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`String tidak valid: harus dimulai dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak valid: harus berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak valid: harus menyertakan "${o.includes}"`:o.format==="regex"?`String tidak valid: harus sesuai pola ${o.pattern}`:`${r[o.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":""}: ${x(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 cN(){return{localeError:KV()}}var VV=()=>{let t={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 e(n){return t[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"},i={nan:"NaN",number:"n\xFAmer",array:"fylki"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=P(n.input),a=i[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 ${o}`}case"invalid_value":return n.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${C(n.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${x(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} hafi ${o}${n.maximum.toString()} ${s.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} s\xE9 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} hafi ${o}${n.minimum.toString()} ${s.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} s\xE9 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${o.prefix}"`:o.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${o.suffix}"`:o.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${o.includes}"`:o.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${o.pattern}`:`Rangt ${r[o.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"}: ${x(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 uN(){return{localeError:VV()}}var GV=()=>{let t={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(n){return t[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"},i={nan:"NaN",number:"numero",array:"vettore"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=P(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Input non valido: atteso instanceof ${n.expected}, ricevuto ${a}`:`Input non valido: atteso ${o}, ricevuto ${a}`}case"invalid_value":return n.values.length===1?`Input non valido: atteso ${C(n.values[0])}`:`Opzione non valida: atteso uno tra ${x(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Troppo grande: ${n.origin??"valore"} deve avere ${o}${n.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Troppo piccolo: ${n.origin} deve avere ${o}${n.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${n.origin} deve essere ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Stringa non valida: deve iniziare con "${o.prefix}"`:o.format==="ends_with"?`Stringa non valida: deve terminare con "${o.suffix}"`:o.format==="includes"?`Stringa non valida: deve includere "${o.includes}"`:o.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${o.pattern}`:`Invalid ${r[o.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"}: ${x(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 dN(){return{localeError:GV()}}var QV=()=>{let t={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 e(n){return t[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"},i={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=P(n.input),a=i[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: ${o}\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: ${C(n.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${x(n.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let o=n.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",s=e(n.origin);return s?`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${s.unit??"\u8981\u7D20"}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let o=n.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",s=e(n.origin);return s?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${s.unit}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${o.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[o.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":""}: ${x(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 fN(){return{localeError:QV()}}var JV=()=>{let t={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 e(n){return t[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 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",json_string:"JSON \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},i={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\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 o=i[n.expected]??n.expected,s=P(n.input),a=i[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 ${o}, \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 ${C(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 ${x(n.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(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} ${o}${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 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(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} ${o}${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 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${o.prefix}"-\u10D8\u10D7`:o.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${o.suffix}"-\u10D8\u10D7`:o.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${o.includes}"-\u10E1`:o.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\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 ${o.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[o.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"}: ${x(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 mN(){return{localeError:JV()}}var WV=()=>{let t={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 e(n){return t[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"},i={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 o=i[n.expected]??n.expected,s=P(n.input),a=i[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 ${o} \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 ${C(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 ${x(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(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"} ${o} ${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"} ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${o} ${n.minimum.toString()} ${s.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[o.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 ${x(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 Oc(){return{localeError:WV()}}function pN(){return Oc()}var HV=()=>{let t={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 e(n){return t[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"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=P(n.input),a=i[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 ${o}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`}case"invalid_value":return n.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${C(n.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${x(n.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let o=n.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",s=o==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=e(n.origin),l=a?.unit??"\uC694\uC18C";return a?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()}${l} ${o}${s}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()} ${o}${s}`}case"too_small":{let o=n.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",s=o==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=e(n.origin),l=a?.unit??"\uC694\uC18C";return a?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()}${l} ${o}${s}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()} ${o}${s}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:o.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${o.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[o.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: ${x(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 hN(){return{localeError:HV()}}var hs=t=>t.charAt(0).toUpperCase()+t.slice(1);function gN(t){let e=Math.abs(t),r=e%10,i=e%100;return i>=11&&i<=19||r===0?"many":r===1?"one":"few"}var YV=()=>{let t={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 e(n,o,s,a){let l=t[n]??null;return l===null?l:{unit:l.unit[o],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"},i={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 o=i[n.expected]??n.expected,s=P(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Gautas tipas ${a}, o tik\u0117tasi - instanceof ${n.expected}`:`Gautas tipas ${a}, o tik\u0117tasi - ${o}`}case"invalid_value":return n.values.length===1?`Privalo b\u016Bti ${C(n.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${x(n.values,"|")} pasirinkim\u0173`;case"too_big":{let o=i[n.origin]??n.origin,s=e(n.origin,gN(Number(n.maximum)),n.inclusive??!1,"smaller");if(s?.verb)return`${hs(o??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`${hs(o??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${n.maximum.toString()} ${s?.unit}`}case"too_small":{let o=i[n.origin]??n.origin,s=e(n.origin,gN(Number(n.minimum)),n.inclusive??!1,"bigger");if(s?.verb)return`${hs(o??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`${hs(o??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${n.minimum.toString()} ${s?.unit}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${o.prefix}"`:o.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${o.suffix}"`:o.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${o.includes}"`:o.format==="regex"?`Eilut\u0117 privalo atitikti ${o.pattern}`:`Neteisingas ${r[o.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"}: ${x(n.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let o=i[n.origin]??n.origin;return`${hs(o??n.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function yN(){return{localeError:YV()}}var XV=()=>{let t={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 e(n){return t[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"},i={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=P(n.input),a=i[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 ${o}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${C(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 ${x(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(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 ${o}${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 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(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 ${o}${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 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`Invalid ${r[o.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"}: ${x(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 vN(){return{localeError:XV()}}var e5=()=>{let t={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(n){return t[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"},i={nan:"NaN",number:"nombor"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=P(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${a}`:`Input tidak sah: dijangka ${o}, diterima ${a}`}case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${C(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${x(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Terlalu besar: dijangka ${n.origin??"nilai"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Terlalu kecil: dijangka ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`String tidak sah: mesti bermula dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak sah: mesti mengandungi "${o.includes}"`:o.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${o.pattern}`:`${r[o.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${x(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 bN(){return{localeError:e5()}}var t5=()=>{let t={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function e(n){return t[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"},i={nan:"NaN",number:"getal"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=P(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${a}`:`Ongeldige invoer: verwacht ${o}, ontving ${a}`}case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${C(n.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${x(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin),a=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";return s?`Te ${a}: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} ${s.unit??"elementen"} ${s.verb}`:`Te ${a}: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} is`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin),a=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";return s?`Te ${a}: verwacht dat ${n.origin} ${o}${n.minimum.toString()} ${s.unit} ${s.verb}`:`Te ${a}: verwacht dat ${n.origin} ${o}${n.minimum.toString()} is`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ongeldige tekst: moet met "${o.prefix}" beginnen`:o.format==="ends_with"?`Ongeldige tekst: moet op "${o.suffix}" eindigen`:o.format==="includes"?`Ongeldige tekst: moet "${o.includes}" bevatten`:o.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${o.pattern}`:`Ongeldig: ${r[o.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":""}: ${x(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 wN(){return{localeError:t5()}}var r5=()=>{let t={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 e(n){return t[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"},i={nan:"NaN",number:"tall",array:"liste"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=P(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Ugyldig input: forventet instanceof ${n.expected}, fikk ${a}`:`Ugyldig input: forventet ${o}, fikk ${a}`}case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${C(n.values[0])}`:`Ugyldig valg: forventet en av ${x(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${o}${n.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`For lite(n): forventet ${n.origin} til \xE5 ha ${o}${n.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${n.origin} til \xE5 ha ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${r[o.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"}: ${x(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 SN(){return{localeError:r5()}}var n5=()=>{let t={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 e(n){return t[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"},i={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=P(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`F\xE2sit giren: umulan instanceof ${n.expected}, al\u0131nan ${a}`:`F\xE2sit giren: umulan ${o}, al\u0131nan ${a}`}case"invalid_value":return n.values.length===1?`F\xE2sit giren: umulan ${C(n.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${x(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${o}${n.maximum.toString()} ${s.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${o}${n.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${o}${n.minimum.toString()} ${s.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${o}${n.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let o=n;return o.format==="starts_with"?`F\xE2sit metin: "${o.prefix}" ile ba\u015Flamal\u0131.`:o.format==="ends_with"?`F\xE2sit metin: "${o.suffix}" ile bitmeli.`:o.format==="includes"?`F\xE2sit metin: "${o.includes}" ihtiv\xE2 etmeli.`:o.format==="regex"?`F\xE2sit metin: ${o.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[o.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":""}: ${x(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 xN(){return{localeError:n5()}}var i5=()=>{let t={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 e(n){return t[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"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=P(n.input),a=i[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 ${o} \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 ${C(n.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${x(n.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${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 ${o}${n.maximum.toString()} \u0648\u064A`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} ${s.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} \u0648\u064A`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:o.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:o.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${o.includes}" \u0648\u0644\u0631\u064A`:o.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${o.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[o.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"}: ${x(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 _N(){return{localeError:i5()}}var o5=()=>{let t={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 e(n){return t[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"},i={nan:"NaN",number:"liczba",array:"tablica"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=P(n.input),a=i[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 ${o}, otrzymano ${a}`}case"invalid_value":return n.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${C(n.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${x(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${n.maximum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${n.minimum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${o.prefix}"`:o.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${o.suffix}"`:o.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${o.includes}"`:o.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${o.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[o.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":""}: ${x(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 $N(){return{localeError:o5()}}var s5=()=>{let t={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(n){return t[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"},i={nan:"NaN",number:"n\xFAmero",null:"nulo"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=P(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Tipo inv\xE1lido: esperado instanceof ${n.expected}, recebido ${a}`:`Tipo inv\xE1lido: esperado ${o}, recebido ${a}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: esperado ${C(n.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${x(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${o}${n.maximum.toString()} ${s.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Muito pequeno: esperado que ${n.origin} tivesse ${o}${n.minimum.toString()} ${s.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${o.prefix}"`:o.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${o.suffix}"`:o.format==="includes"?`Texto inv\xE1lido: deve incluir "${o.includes}"`:o.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${o.pattern}`:`${r[o.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":""}: ${x(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 kN(){return{localeError:s5()}}function TN(t,e,r,i){let n=Math.abs(t),o=n%10,s=n%100;return s>=11&&s<=19?i:o===1?e:o>=2&&o<=4?r:i}var a5=()=>{let t={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 e(n){return t[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"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=P(n.input),a=i[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 ${o}, \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 ${C(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 ${x(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);if(s){let a=Number(n.maximum),l=TN(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 ${o}${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 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);if(s){let a=Number(n.minimum),l=TN(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 ${o}${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 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[o.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":""}: ${x(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 EN(){return{localeError:a5()}}var l5=()=>{let t={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(n){return t[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"},i={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=P(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${n.expected}, prejeto ${a}`:`Neveljaven vnos: pri\u010Dakovano ${o}, prejeto ${a}`}case"invalid_value":return n.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${C(n.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${x(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} imelo ${o}${n.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Premajhno: pri\u010Dakovano, da bo ${n.origin} imelo ${o}${n.minimum.toString()} ${s.unit}`:`Premajhno: pri\u010Dakovano, da bo ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${o.prefix}"`:o.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${o.suffix}"`:o.format==="includes"?`Neveljaven niz: mora vsebovati "${o.includes}"`:o.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${o.pattern}`:`Neveljaven ${r[o.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"}: ${x(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 IN(){return{localeError:l5()}}var c5=()=>{let t={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 e(n){return t[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"},i={nan:"NaN",number:"antal",array:"lista"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=P(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${n.expected}, fick ${a}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${o}, fick ${a}`}case"invalid_value":return n.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${C(n.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${x(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`F\xF6r stor(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.maximum.toString()} ${s.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${n.origin??"v\xE4rdet"} att ha ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.minimum.toString()} ${s.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${o.prefix}"`:o.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${o.suffix}"`:o.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${o.includes}"`:o.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${o.pattern}"`:`Ogiltig(t) ${r[o.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"}: ${x(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 CN(){return{localeError:c5()}}var u5=()=>{let t={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 e(n){return t[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"},i={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 o=i[n.expected]??n.expected,s=P(n.input),a=i[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 ${o}, \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 ${C(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 ${x(n.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(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"} ${o}${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"} ${o}${n.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let o=n.inclusive?">=":">",s=e(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} ${o}${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} ${o}${n.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${o.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[o.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":""}: ${x(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 PN(){return{localeError:u5()}}var d5=()=>{let t={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 e(n){return t[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"},i={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 o=i[n.expected]??n.expected,s=P(n.input),a=i[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 ${o} \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 ${C(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 ${x(n.values,"|")}`;case"too_big":{let o=n.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",s=e(n.origin);return s?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${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${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",s=e(n.origin);return s?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${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${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:o.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 ${o.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[o.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: ${x(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 NN(){return{localeError:d5()}}var f5=()=>{let t={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 e(n){return t[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"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=P(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${n.expected}, al\u0131nan ${a}`:`Ge\xE7ersiz de\u011Fer: beklenen ${o}, al\u0131nan ${a}`}case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${C(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${x(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${o}${n.maximum.toString()} ${s.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${o}${n.minimum.toString()} ${s.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ge\xE7ersiz metin: "${o.prefix}" ile ba\u015Flamal\u0131`:o.format==="ends_with"?`Ge\xE7ersiz metin: "${o.suffix}" ile bitmeli`:o.format==="includes"?`Ge\xE7ersiz metin: "${o.includes}" i\xE7ermeli`:o.format==="regex"?`Ge\xE7ersiz metin: ${o.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[o.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":""}: ${x(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 ON(){return{localeError:f5()}}var m5=()=>{let t={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 e(n){return t[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"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=P(n.input),a=i[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 ${o}, \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 ${C(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 ${x(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(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} ${o}${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 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(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} ${o}${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 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[o.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":""}: ${x(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 Ac(){return{localeError:m5()}}function AN(){return Ac()}var p5=()=>{let t={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 e(n){return t[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"},i={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=P(n.input),a=i[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: ${o} \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: ${C(n.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${x(n.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${o}${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 ${o}${n.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u06D2 ${o}${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 ${o}${n.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${o.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[o.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":""}: ${x(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 RN(){return{localeError:p5()}}var h5=()=>{let t={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"}};function e(n){return t[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"},i={nan:"NaN",number:"raqam",array:"massiv"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=P(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${a}`:`Noto\u2018g\u2018ri kirish: kutilgan ${o}, qabul qilingan ${a}`}case"invalid_value":return n.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${C(n.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${x(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Juda katta: kutilgan ${n.origin??"qiymat"} ${o}${n.maximum.toString()} ${s.unit} ${s.verb}`:`Juda katta: kutilgan ${n.origin??"qiymat"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Juda kichik: kutilgan ${n.origin} ${o}${n.minimum.toString()} ${s.unit} ${s.verb}`:`Juda kichik: kutilgan ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${o.prefix}" bilan boshlanishi kerak`:o.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${o.suffix}" bilan tugashi kerak`:o.format==="includes"?`Noto\u2018g\u2018ri satr: "${o.includes}" ni o\u2018z ichiga olishi kerak`:o.format==="regex"?`Noto\u2018g\u2018ri satr: ${o.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[o.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":""}: ${x(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 DN(){return{localeError:h5()}}var g5=()=>{let t={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 e(n){return t[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"},i={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=P(n.input),a=i[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 ${o}, 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 ${C(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 ${x(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${o.prefix}"`:o.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${o.suffix}"`:o.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${o.includes}"`:o.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${o.pattern}`:`${r[o.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: ${x(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 LN(){return{localeError:g5()}}var y5=()=>{let t={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 e(n){return t[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"},i={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=P(n.input),a=i[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 ${o}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`}case"invalid_value":return n.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${C(n.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${x(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${o}${n.maximum.toString()} ${s.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${o}${n.minimum.toString()} ${s.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.prefix}" \u5F00\u5934`:o.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.suffix}" \u7ED3\u5C3E`:o.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${o.pattern}`:`\u65E0\u6548${r[o.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): ${x(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 zN(){return{localeError:y5()}}var v5=()=>{let t={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 e(n){return t[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"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=P(n.input),a=i[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 ${o}\uFF0C\u4F46\u6536\u5230 ${a}`}case"invalid_value":return n.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${C(n.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${x(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${o}${n.maximum.toString()} ${s.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${o}${n.minimum.toString()} ${s.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.prefix}" \u958B\u982D`:o.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.suffix}" \u7D50\u5C3E`:o.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${o.pattern}`:`\u7121\u6548\u7684 ${r[o.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${x(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 jN(){return{localeError:v5()}}var b5=()=>{let t={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 e(n){return t[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"},i={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=P(n.input),a=i[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 ${o}, \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 ${C(n.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${x(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(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} ${o}${n.maximum} ${s.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${n.maximum}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin} ${s.verb} ${o}${n.minimum} ${s.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${n.minimum}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${o.suffix}"`:o.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${o.includes}"`:o.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${o.pattern}`:`A\u1E63\xEC\u1E63e: ${r[o.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: ${x(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 UN(){return{localeError:b5()}}var MN,Sv=Symbol("ZodOutput"),xv=Symbol("ZodInput"),Rc=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){let i=r[0];return this._map.set(e,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let i={...this.get(r)??{}};delete i.id;let n={...i,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Dc(){return new Rc}(MN=globalThis).__zod_globalRegistry??(MN.__zod_globalRegistry=Dc());var Oe=globalThis.__zod_globalRegistry;function _v(t,e){return new t({type:"string",...O(e)})}function $v(t,e){return new t({type:"string",coerce:!0,...O(e)})}function Lc(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...O(e)})}function ys(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...O(e)})}function zc(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...O(e)})}function jc(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...O(e)})}function Uc(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...O(e)})}function Mc(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...O(e)})}function vs(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...O(e)})}function qc(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...O(e)})}function Fc(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...O(e)})}function Bc(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...O(e)})}function Zc(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...O(e)})}function Kc(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...O(e)})}function Vc(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...O(e)})}function Gc(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...O(e)})}function Qc(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...O(e)})}function Jc(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...O(e)})}function kv(t,e){return new t({type:"string",format:"mac",check:"string_format",abort:!1,...O(e)})}function Wc(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...O(e)})}function Hc(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...O(e)})}function Yc(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...O(e)})}function Xc(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...O(e)})}function eu(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...O(e)})}function tu(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...O(e)})}var Tv={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Ev(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...O(e)})}function Iv(t,e){return new t({type:"string",format:"date",check:"string_format",...O(e)})}function Cv(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...O(e)})}function Pv(t,e){return new t({type:"string",format:"duration",check:"string_format",...O(e)})}function Nv(t,e){return new t({type:"number",checks:[],...O(e)})}function Ov(t,e){return new t({type:"number",coerce:!0,checks:[],...O(e)})}function Av(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...O(e)})}function Rv(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...O(e)})}function Dv(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...O(e)})}function Lv(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...O(e)})}function zv(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...O(e)})}function jv(t,e){return new t({type:"boolean",...O(e)})}function Uv(t,e){return new t({type:"boolean",coerce:!0,...O(e)})}function Mv(t,e){return new t({type:"bigint",...O(e)})}function qv(t,e){return new t({type:"bigint",coerce:!0,...O(e)})}function Fv(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...O(e)})}function Bv(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...O(e)})}function Zv(t,e){return new t({type:"symbol",...O(e)})}function Kv(t,e){return new t({type:"undefined",...O(e)})}function Vv(t,e){return new t({type:"null",...O(e)})}function Gv(t){return new t({type:"any"})}function Qv(t){return new t({type:"unknown"})}function Jv(t,e){return new t({type:"never",...O(e)})}function Wv(t,e){return new t({type:"void",...O(e)})}function Hv(t,e){return new t({type:"date",...O(e)})}function Yv(t,e){return new t({type:"date",coerce:!0,...O(e)})}function Xv(t,e){return new t({type:"nan",...O(e)})}function Rt(t,e){return new wc({check:"less_than",...O(e),value:t,inclusive:!1})}function st(t,e){return new wc({check:"less_than",...O(e),value:t,inclusive:!0})}function Dt(t,e){return new Sc({check:"greater_than",...O(e),value:t,inclusive:!1})}function Me(t,e){return new Sc({check:"greater_than",...O(e),value:t,inclusive:!0})}function ru(t){return Dt(0,t)}function nu(t){return Rt(0,t)}function iu(t){return st(0,t)}function ou(t){return Me(0,t)}function Cr(t,e){return new Vg({check:"multiple_of",...O(e),value:t})}function Pr(t,e){return new Jg({check:"max_size",...O(e),maximum:t})}function Lt(t,e){return new Wg({check:"min_size",...O(e),minimum:t})}function tn(t,e){return new Hg({check:"size_equals",...O(e),size:t})}function rn(t,e){return new Yg({check:"max_length",...O(e),maximum:t})}function Qt(t,e){return new Xg({check:"min_length",...O(e),minimum:t})}function nn(t,e){return new ey({check:"length_equals",...O(e),length:t})}function oi(t,e){return new ty({check:"string_format",format:"regex",...O(e),pattern:t})}function si(t){return new ry({check:"string_format",format:"lowercase",...O(t)})}function ai(t){return new ny({check:"string_format",format:"uppercase",...O(t)})}function li(t,e){return new iy({check:"string_format",format:"includes",...O(e),includes:t})}function ci(t,e){return new oy({check:"string_format",format:"starts_with",...O(e),prefix:t})}function ui(t,e){return new sy({check:"string_format",format:"ends_with",...O(e),suffix:t})}function su(t,e,r){return new ay({check:"property",property:t,schema:e,...O(r)})}function di(t,e){return new ly({check:"mime_type",mime:t,...O(e)})}function Et(t){return new cy({check:"overwrite",tx:t})}function fi(t){return Et(e=>e.normalize(t))}function mi(){return Et(t=>t.trim())}function pi(){return Et(t=>t.toLowerCase())}function hi(){return Et(t=>t.toUpperCase())}function gi(){return Et(t=>ag(t))}function eb(t,e,r){return new t({type:"array",element:e,...O(r)})}function S5(t,e,r){return new t({type:"union",options:e,...O(r)})}function x5(t,e,r){return new t({type:"union",options:e,inclusive:!1,...O(r)})}function _5(t,e,r,i){return new t({type:"union",options:r,discriminator:e,...O(i)})}function $5(t,e,r){return new t({type:"intersection",left:e,right:r})}function k5(t,e,r,i){let n=r instanceof B,o=n?i:r,s=n?r:null;return new t({type:"tuple",items:e,rest:s,...O(o)})}function T5(t,e,r,i){return new t({type:"record",keyType:e,valueType:r,...O(i)})}function E5(t,e,r,i){return new t({type:"map",keyType:e,valueType:r,...O(i)})}function I5(t,e,r){return new t({type:"set",valueType:e,...O(r)})}function C5(t,e,r){let i=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new t({type:"enum",entries:i,...O(r)})}function P5(t,e,r){return new t({type:"enum",entries:e,...O(r)})}function N5(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...O(r)})}function tb(t,e){return new t({type:"file",...O(e)})}function O5(t,e){return new t({type:"transform",transform:e})}function A5(t,e){return new t({type:"optional",innerType:e})}function R5(t,e){return new t({type:"nullable",innerType:e})}function D5(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():cg(r)}})}function L5(t,e,r){return new t({type:"nonoptional",innerType:e,...O(r)})}function z5(t,e){return new t({type:"success",innerType:e})}function j5(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}function U5(t,e,r){return new t({type:"pipe",in:e,out:r})}function M5(t,e){return new t({type:"readonly",innerType:e})}function q5(t,e,r){return new t({type:"template_literal",parts:e,...O(r)})}function F5(t,e){return new t({type:"lazy",getter:e})}function B5(t,e){return new t({type:"promise",innerType:e})}function rb(t,e,r){let i=O(r);return i.abort??(i.abort=!0),new t({type:"custom",check:"custom",fn:e,...i})}function nb(t,e,r){return new t({type:"custom",check:"custom",fn:e,...O(r)})}function ib(t){let e=qN(r=>(r.addIssue=i=>{if(typeof i=="string")r.issues.push(Yn(i,r.value,e._zod.def));else{let n=i;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=r.value),n.inst??(n.inst=e),n.continue??(n.continue=!e._zod.def.abort),r.issues.push(Yn(n))}},t(r.value,r)));return e}function qN(t,e){let r=new oe({check:"custom",...O(e)});return r._zod.check=t,r}function ob(t){let e=new oe({check:"describe"});return e._zod.onattach=[r=>{let i=Oe.get(r)??{};Oe.add(r,{...i,description:t})}],e._zod.check=()=>{},e}function sb(t){let e=new oe({check:"meta"});return e._zod.onattach=[r=>{let i=Oe.get(r)??{};Oe.add(r,{...i,...t})}],e._zod.check=()=>{},e}function ab(t,e){let r=O(e),i=r.truthy??["true","1","yes","on","y","enabled"],n=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(i=i.map(m=>typeof m=="string"?m.toLowerCase():m),n=n.map(m=>typeof m=="string"?m.toLowerCase():m));let o=new Set(i),s=new Set(n),a=t.Codec??ps,l=t.Boolean??fs,c=t.String??en,u=new c({type:"string",error:r.error}),d=new l({type:"boolean",error:r.error}),f=new a({type:"pipe",in:u,out:d,transform:((m,y)=>{let h=m;return r.case!=="sensitive"&&(h=h.toLowerCase()),o.has(h)?!0:s.has(h)?!1:(y.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...s],input:y.value,inst:f,continue:!1}),{})}),reverseTransform:((m,y)=>m===!0?i[0]||"true":n[0]||"false"),error:r.error});return f}function yi(t,e,r,i={}){let n=O(i),o={...O(i),check:"string_format",type:"string",format:e,fn:typeof r=="function"?r:a=>r.test(a),...n};return r instanceof RegExp&&(o.pattern=r),new t(o)}function Nr(t){let e=t?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:t?.metadata??Oe,target:e,unrepresentable:t?.unrepresentable??"throw",override:t?.override??(()=>{}),io:t?.io??"output",counter:0,seen:new Map,cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0}}function te(t,e,r={path:[],schemaPath:[]}){var i;let n=t._zod.def,o=e.seen.get(t);if(o)return o.count++,r.schemaPath.includes(t)&&(o.cycle=r.path),o.schema;let s={schema:{},count:1,cycle:void 0,path:r.path};e.seen.set(t,s);let a=t._zod.toJSONSchema?.();if(a)s.schema=a;else{let u={...r,schemaPath:[...r.schemaPath,t],path:r.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,s.schema,u);else{let f=s.schema,m=e.processors[n.type];if(!m)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);m(t,e,f,u)}let d=t._zod.parent;d&&(s.ref||(s.ref=d),te(d,e,u),e.seen.get(d).isParent=!0)}let l=e.metadataRegistry.get(t);return l&&Object.assign(s.schema,l),e.io==="input"&&qe(t)&&(delete s.schema.examples,delete s.schema.default),e.io==="input"&&s.schema._prefault&&((i=s.schema).default??(i.default=s.schema._prefault)),delete s.schema._prefault,e.seen.get(t).schema}function Or(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=new Map;for(let s of t.seen.entries()){let a=t.metadataRegistry.get(s[0])?.id;if(a){let l=i.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.`);i.set(a,s[0])}}let n=s=>{let a=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){let d=t.external.registry.get(s[0])?.id,f=t.external.uri??(y=>y);if(d)return{ref:f(d)};let m=s[1].defId??s[1].schema.id??`schema${t.counter++}`;return s[1].defId=m,{defId:m,ref:`${f("__shared")}#/${a}/${m}`}}if(s[1]===r)return{ref:"#"};let c=`#/${a}/`,u=s[1].schema.id??`__schema${t.counter++}`;return{defId:u,ref:c+u}},o=s=>{if(s[1].schema.$ref)return;let a=s[1],{ref:l,defId:c}=n(s);a.def={...a.schema},c&&(a.defId=c);let u=a.schema;for(let d in u)delete u[d];u.$ref=l};if(t.cycles==="throw")for(let s of t.seen.entries()){let a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
337
|
-
|
|
338
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of t.seen.entries()){let a=s[1];if(e===s[0]){o(s);continue}if(t.external){let c=t.external.registry.get(s[0])?.id;if(e!==s[0]&&c){o(s);continue}}if(t.metadataRegistry.get(s[0])?.id){o(s);continue}if(a.cycle){o(s);continue}if(a.count>1&&t.reused==="ref"){o(s);continue}}}function Ar(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=s=>{let a=t.seen.get(s);if(a.ref===null)return;let l=a.def??a.schema,c={...l},u=a.ref;if(a.ref=null,u){i(u);let f=t.seen.get(u),m=f.schema;if(m.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(m)):Object.assign(l,m),Object.assign(l,c),s._zod.parent===u)for(let h in l)h==="$ref"||h==="allOf"||h in c||delete l[h];if(m.$ref&&f.def)for(let h in l)h==="$ref"||h==="allOf"||h in f.def&&JSON.stringify(l[h])===JSON.stringify(f.def[h])&&delete l[h]}let d=s._zod.parent;if(d&&d!==u){i(d);let f=t.seen.get(d);if(f?.schema.$ref&&(l.$ref=f.schema.$ref,f.def))for(let m in l)m==="$ref"||m==="allOf"||m in f.def&&JSON.stringify(l[m])===JSON.stringify(f.def[m])&&delete l[m]}t.override({zodSchema:s,jsonSchema:l,path:a.path??[]})};for(let s of[...t.seen.entries()].reverse())i(s[0]);let n={};if(t.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){let s=t.external.registry.get(e)?.id;if(!s)throw new Error("Schema is missing an `id` property");n.$id=t.external.uri(s)}Object.assign(n,r.def??r.schema);let o=t.external?.defs??{};for(let s of t.seen.entries()){let a=s[1];a.def&&a.defId&&(o[a.defId]=a.def)}t.external||Object.keys(o).length>0&&(t.target==="draft-2020-12"?n.$defs=o:n.definitions=o);try{let s=JSON.parse(JSON.stringify(n));return Object.defineProperty(s,"~standard",{value:{...e["~standard"],jsonSchema:{input:vi(e,"input",t.processors),output:vi(e,"output",t.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function qe(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let i=t._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return qe(i.element,r);if(i.type==="set")return qe(i.valueType,r);if(i.type==="lazy")return qe(i.getter(),r);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return qe(i.innerType,r);if(i.type==="intersection")return qe(i.left,r)||qe(i.right,r);if(i.type==="record"||i.type==="map")return qe(i.keyType,r)||qe(i.valueType,r);if(i.type==="pipe")return qe(i.in,r)||qe(i.out,r);if(i.type==="object"){for(let n in i.shape)if(qe(i.shape[n],r))return!0;return!1}if(i.type==="union"){for(let n of i.options)if(qe(n,r))return!0;return!1}if(i.type==="tuple"){for(let n of i.items)if(qe(n,r))return!0;return!!(i.rest&&qe(i.rest,r))}return!1}var lb=(t,e={})=>r=>{let i=Nr({...r,processors:e});return te(t,i),Or(i,t),Ar(i,t)},vi=(t,e,r={})=>i=>{let{libraryOptions:n,target:o}=i??{},s=Nr({...n??{},target:o,io:e,processors:r});return te(t,s),Or(s,t),Ar(s,t)};var Z5={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},cb=(t,e,r,i)=>{let n=r;n.type="string";let{minimum:o,maximum:s,format:a,patterns:l,contentEncoding:c}=t._zod.bag;if(typeof o=="number"&&(n.minLength=o),typeof s=="number"&&(n.maxLength=s),a&&(n.format=Z5[a]??a,n.format===""&&delete n.format,a==="time"&&delete n.format),c&&(n.contentEncoding=c),l&&l.size>0){let u=[...l];u.length===1?n.pattern=u[0].source:u.length>1&&(n.allOf=[...u.map(d=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},ub=(t,e,r,i)=>{let n=r,{minimum:o,maximum:s,format:a,multipleOf:l,exclusiveMaximum:c,exclusiveMinimum:u}=t._zod.bag;typeof a=="string"&&a.includes("int")?n.type="integer":n.type="number",typeof u=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(n.minimum=u,n.exclusiveMinimum=!0):n.exclusiveMinimum=u),typeof o=="number"&&(n.minimum=o,typeof u=="number"&&e.target!=="draft-04"&&(u>=o?delete n.minimum:delete n.exclusiveMinimum)),typeof c=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(n.maximum=c,n.exclusiveMaximum=!0):n.exclusiveMaximum=c),typeof s=="number"&&(n.maximum=s,typeof c=="number"&&e.target!=="draft-04"&&(c<=s?delete n.maximum:delete n.exclusiveMaximum)),typeof l=="number"&&(n.multipleOf=l)},db=(t,e,r,i)=>{r.type="boolean"},fb=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},mb=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},pb=(t,e,r,i)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},hb=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},gb=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},yb=(t,e,r,i)=>{r.not={}},vb=(t,e,r,i)=>{},bb=(t,e,r,i)=>{},wb=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},Sb=(t,e,r,i)=>{let n=t._zod.def,o=ts(n.entries);o.every(s=>typeof s=="number")&&(r.type="number"),o.every(s=>typeof s=="string")&&(r.type="string"),r.enum=o},xb=(t,e,r,i)=>{let n=t._zod.def,o=[];for(let s of n.values)if(s===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(s))}else o.push(s);if(o.length!==0)if(o.length===1){let s=o[0];r.type=s===null?"null":typeof s,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[s]:r.const=s}else o.every(s=>typeof s=="number")&&(r.type="number"),o.every(s=>typeof s=="string")&&(r.type="string"),o.every(s=>typeof s=="boolean")&&(r.type="boolean"),o.every(s=>s===null)&&(r.type="null"),r.enum=o},_b=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},$b=(t,e,r,i)=>{let n=r,o=t._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=o.source},kb=(t,e,r,i)=>{let n=r,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:a,mime:l}=t._zod.bag;s!==void 0&&(o.minLength=s),a!==void 0&&(o.maxLength=a),l?l.length===1?(o.contentMediaType=l[0],Object.assign(n,o)):(Object.assign(n,o),n.anyOf=l.map(c=>({contentMediaType:c}))):Object.assign(n,o)},Tb=(t,e,r,i)=>{r.type="boolean"},Eb=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Ib=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},Cb=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Pb=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Nb=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Ob=(t,e,r,i)=>{let n=r,o=t._zod.def,{minimum:s,maximum:a}=t._zod.bag;typeof s=="number"&&(n.minItems=s),typeof a=="number"&&(n.maxItems=a),n.type="array",n.items=te(o.element,e,{...i,path:[...i.path,"items"]})},Ab=(t,e,r,i)=>{let n=r,o=t._zod.def;n.type="object",n.properties={};let s=o.shape;for(let c in s)n.properties[c]=te(s[c],e,{...i,path:[...i.path,"properties",c]});let a=new Set(Object.keys(s)),l=new Set([...a].filter(c=>{let u=o.shape[c]._zod;return e.io==="input"?u.optin===void 0:u.optout===void 0}));l.size>0&&(n.required=Array.from(l)),o.catchall?._zod.def.type==="never"?n.additionalProperties=!1:o.catchall?o.catchall&&(n.additionalProperties=te(o.catchall,e,{...i,path:[...i.path,"additionalProperties"]})):e.io==="output"&&(n.additionalProperties=!1)},lu=(t,e,r,i)=>{let n=t._zod.def,o=n.inclusive===!1,s=n.options.map((a,l)=>te(a,e,{...i,path:[...i.path,o?"oneOf":"anyOf",l]}));o?r.oneOf=s:r.anyOf=s},Rb=(t,e,r,i)=>{let n=t._zod.def,o=te(n.left,e,{...i,path:[...i.path,"allOf",0]}),s=te(n.right,e,{...i,path:[...i.path,"allOf",1]}),a=c=>"allOf"in c&&Object.keys(c).length===1,l=[...a(o)?o.allOf:[o],...a(s)?s.allOf:[s]];r.allOf=l},Db=(t,e,r,i)=>{let n=r,o=t._zod.def;n.type="array";let s=e.target==="draft-2020-12"?"prefixItems":"items",a=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",l=o.items.map((f,m)=>te(f,e,{...i,path:[...i.path,s,m]})),c=o.rest?te(o.rest,e,{...i,path:[...i.path,a,...e.target==="openapi-3.0"?[o.items.length]:[]]}):null;e.target==="draft-2020-12"?(n.prefixItems=l,c&&(n.items=c)):e.target==="openapi-3.0"?(n.items={anyOf:l},c&&n.items.anyOf.push(c),n.minItems=l.length,c||(n.maxItems=l.length)):(n.items=l,c&&(n.additionalItems=c));let{minimum:u,maximum:d}=t._zod.bag;typeof u=="number"&&(n.minItems=u),typeof d=="number"&&(n.maxItems=d)},Lb=(t,e,r,i)=>{let n=r,o=t._zod.def;n.type="object";let s=o.keyType,l=s._zod.bag?.patterns;if(o.mode==="loose"&&l&&l.size>0){let u=te(o.valueType,e,{...i,path:[...i.path,"patternProperties","*"]});n.patternProperties={};for(let d of l)n.patternProperties[d.source]=u}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(n.propertyNames=te(o.keyType,e,{...i,path:[...i.path,"propertyNames"]})),n.additionalProperties=te(o.valueType,e,{...i,path:[...i.path,"additionalProperties"]});let c=s._zod.values;if(c){let u=[...c].filter(d=>typeof d=="string"||typeof d=="number");u.length>0&&(n.required=u)}},zb=(t,e,r,i)=>{let n=t._zod.def,o=te(n.innerType,e,i),s=e.seen.get(t);e.target==="openapi-3.0"?(s.ref=n.innerType,r.nullable=!0):r.anyOf=[o,{type:"null"}]},jb=(t,e,r,i)=>{let n=t._zod.def;te(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType},Ub=(t,e,r,i)=>{let n=t._zod.def;te(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},Mb=(t,e,r,i)=>{let n=t._zod.def;te(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType,e.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},qb=(t,e,r,i)=>{let n=t._zod.def;te(n.innerType,e,i);let o=e.seen.get(t);o.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},Fb=(t,e,r,i)=>{let n=t._zod.def,o=e.io==="input"?n.in._zod.def.type==="transform"?n.out:n.in:n.out;te(o,e,i);let s=e.seen.get(t);s.ref=o},Bb=(t,e,r,i)=>{let n=t._zod.def;te(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType,r.readOnly=!0},Zb=(t,e,r,i)=>{let n=t._zod.def;te(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType},cu=(t,e,r,i)=>{let n=t._zod.def;te(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType},Kb=(t,e,r,i)=>{let n=t._zod.innerType;te(n,e,i);let o=e.seen.get(t);o.ref=n},au={string:cb,number:ub,boolean:db,bigint:fb,symbol:mb,null:pb,undefined:hb,void:gb,never:yb,any:vb,unknown:bb,date:wb,enum:Sb,literal:xb,nan:_b,template_literal:$b,file:kb,success:Tb,custom:Eb,function:Ib,transform:Cb,map:Pb,set:Nb,array:Ob,object:Ab,union:lu,intersection:Rb,tuple:Db,record:Lb,nullable:zb,nonoptional:jb,default:Ub,prefault:Mb,catch:qb,pipe:Fb,readonly:Bb,promise:Zb,optional:cu,lazy:Kb};function uu(t,e){if("_idmap"in t){let i=t,n=Nr({...e,processors:au}),o={};for(let l of i._idmap.entries()){let[c,u]=l;te(u,n)}let s={},a={registry:i,uri:e?.uri,defs:o};n.external=a;for(let l of i._idmap.entries()){let[c,u]=l;Or(n,u),s[c]=Ar(n,u)}if(Object.keys(o).length>0){let l=n.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[l]:o}}return{schemas:s}}let r=Nr({...e,processors:au});return te(t,r),Or(r,t),Ar(r,t)}var du=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(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let r=e?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=Nr({processors:au,target:r,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,r={path:[],schemaPath:[]}){return te(e,this.ctx,r)}emit(e,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),Or(this.ctx,e);let i=Ar(this.ctx,e),{"~standard":n,...o}=i;return o}};var FN={};var bs={};Pt(bs,{ZodAny:()=>hw,ZodArray:()=>bw,ZodBase64:()=>Ou,ZodBase64URL:()=>Au,ZodBigInt:()=>ki,ZodBigIntFormat:()=>Lu,ZodBoolean:()=>$i,ZodCIDRv4:()=>Pu,ZodCIDRv6:()=>Nu,ZodCUID:()=>_u,ZodCUID2:()=>$u,ZodCatch:()=>qw,ZodCodec:()=>Zu,ZodCustom:()=>Ps,ZodCustomStringFormat:()=>xi,ZodDate:()=>ks,ZodDefault:()=>Dw,ZodDiscriminatedUnion:()=>Sw,ZodE164:()=>Ru,ZodEmail:()=>wu,ZodEmoji:()=>Su,ZodEnum:()=>wi,ZodExactOptional:()=>Ow,ZodFile:()=>Pw,ZodFunction:()=>Ww,ZodGUID:()=>ws,ZodIPv4:()=>Iu,ZodIPv6:()=>Cu,ZodIntersection:()=>xw,ZodJWT:()=>Du,ZodKSUID:()=>Eu,ZodLazy:()=>Gw,ZodLiteral:()=>Cw,ZodMAC:()=>lw,ZodMap:()=>Ew,ZodNaN:()=>Bw,ZodNanoID:()=>xu,ZodNever:()=>yw,ZodNonOptional:()=>Fu,ZodNull:()=>mw,ZodNullable:()=>Rw,ZodNumber:()=>_i,ZodNumberFormat:()=>sn,ZodObject:()=>Es,ZodOptional:()=>qu,ZodPipe:()=>Bu,ZodPrefault:()=>zw,ZodPromise:()=>Jw,ZodReadonly:()=>Zw,ZodRecord:()=>Cs,ZodSet:()=>Iw,ZodString:()=>Si,ZodStringFormat:()=>ie,ZodSuccess:()=>Mw,ZodSymbol:()=>dw,ZodTemplateLiteral:()=>Vw,ZodTransform:()=>Nw,ZodTuple:()=>$w,ZodType:()=>K,ZodULID:()=>ku,ZodURL:()=>$s,ZodUUID:()=>zt,ZodUndefined:()=>fw,ZodUnion:()=>Is,ZodUnknown:()=>gw,ZodVoid:()=>vw,ZodXID:()=>Tu,ZodXor:()=>ww,_ZodString:()=>bu,_default:()=>Lw,_function:()=>JO,any:()=>EO,array:()=>Ts,base64:()=>uO,base64url:()=>dO,bigint:()=>xO,boolean:()=>uw,catch:()=>Fw,check:()=>WO,cidrv4:()=>lO,cidrv6:()=>cO,codec:()=>VO,cuid:()=>eO,cuid2:()=>tO,custom:()=>HO,date:()=>CO,describe:()=>YO,discriminatedUnion:()=>DO,e164:()=>fO,email:()=>ZN,emoji:()=>YN,enum:()=>Uu,exactOptional:()=>Aw,file:()=>FO,float32:()=>vO,float64:()=>bO,function:()=>JO,guid:()=>KN,hash:()=>yO,hex:()=>gO,hostname:()=>hO,httpUrl:()=>HN,instanceof:()=>eA,int:()=>vu,int32:()=>wO,int64:()=>_O,intersection:()=>_w,ipv4:()=>oO,ipv6:()=>aO,json:()=>rA,jwt:()=>mO,keyof:()=>PO,ksuid:()=>iO,lazy:()=>Qw,literal:()=>qO,looseObject:()=>AO,looseRecord:()=>zO,mac:()=>sO,map:()=>jO,meta:()=>XO,nan:()=>KO,nanoid:()=>XN,nativeEnum:()=>MO,never:()=>zu,nonoptional:()=>Uw,null:()=>pw,nullable:()=>xs,nullish:()=>BO,number:()=>cw,object:()=>NO,optional:()=>Ss,partialRecord:()=>LO,pipe:()=>_s,prefault:()=>jw,preprocess:()=>nA,promise:()=>QO,readonly:()=>Kw,record:()=>Tw,refine:()=>Hw,set:()=>UO,strictObject:()=>OO,string:()=>yu,stringFormat:()=>pO,stringbool:()=>tA,success:()=>ZO,superRefine:()=>Yw,symbol:()=>kO,templateLiteral:()=>GO,transform:()=>Mu,tuple:()=>kw,uint32:()=>SO,uint64:()=>$O,ulid:()=>rO,undefined:()=>TO,union:()=>ju,unknown:()=>on,url:()=>WN,uuid:()=>VN,uuidv4:()=>GN,uuidv6:()=>QN,uuidv7:()=>JN,void:()=>IO,xid:()=>nO,xor:()=>RO});var fu={};Pt(fu,{endsWith:()=>ui,gt:()=>Dt,gte:()=>Me,includes:()=>li,length:()=>nn,lowercase:()=>si,lt:()=>Rt,lte:()=>st,maxLength:()=>rn,maxSize:()=>Pr,mime:()=>di,minLength:()=>Qt,minSize:()=>Lt,multipleOf:()=>Cr,negative:()=>nu,nonnegative:()=>ou,nonpositive:()=>iu,normalize:()=>fi,overwrite:()=>Et,positive:()=>ru,property:()=>su,regex:()=>oi,size:()=>tn,slugify:()=>gi,startsWith:()=>ci,toLowerCase:()=>pi,toUpperCase:()=>hi,trim:()=>mi,uppercase:()=>ai});var bi={};Pt(bi,{ZodISODate:()=>pu,ZodISODateTime:()=>mu,ZodISODuration:()=>gu,ZodISOTime:()=>hu,date:()=>Gb,datetime:()=>Vb,duration:()=>Jb,time:()=>Qb});var mu=b("ZodISODateTime",(t,e)=>{_y.init(t,e),ie.init(t,e)});function Vb(t){return Ev(mu,t)}var pu=b("ZodISODate",(t,e)=>{$y.init(t,e),ie.init(t,e)});function Gb(t){return Iv(pu,t)}var hu=b("ZodISOTime",(t,e)=>{ky.init(t,e),ie.init(t,e)});function Qb(t){return Cv(hu,t)}var gu=b("ZodISODuration",(t,e)=>{Ty.init(t,e),ie.init(t,e)});function Jb(t){return Pv(gu,t)}var BN=(t,e)=>{ss.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>ls(t,r)},flatten:{value:r=>as(t,r)},addIssue:{value:r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,Wn,2)}},addIssues:{value:r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,Wn,2)}},isEmpty:{get(){return t.issues.length===0}}})},V5=b("ZodError",BN),We=b("ZodError",BN,{Parent:Error});var Wb=Xn(We),Hb=ei(We),Yb=ti(We),Xb=ri(We),ew=uc(We),tw=dc(We),rw=fc(We),nw=mc(We),iw=pc(We),ow=hc(We),sw=gc(We),aw=yc(We);var K=b("ZodType",(t,e)=>(B.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:vi(t,"input"),output:vi(t,"output")}}),t.toJSONSchema=lb(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.check=(...r)=>t.clone(N.mergeDefs(e,{checks:[...e.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0}),t.with=t.check,t.clone=(r,i)=>Ue(t,r,i),t.brand=()=>t,t.register=((r,i)=>(r.add(t,i),t)),t.parse=(r,i)=>Wb(t,r,i,{callee:t.parse}),t.safeParse=(r,i)=>Yb(t,r,i),t.parseAsync=async(r,i)=>Hb(t,r,i,{callee:t.parseAsync}),t.safeParseAsync=async(r,i)=>Xb(t,r,i),t.spa=t.safeParseAsync,t.encode=(r,i)=>ew(t,r,i),t.decode=(r,i)=>tw(t,r,i),t.encodeAsync=async(r,i)=>rw(t,r,i),t.decodeAsync=async(r,i)=>nw(t,r,i),t.safeEncode=(r,i)=>iw(t,r,i),t.safeDecode=(r,i)=>ow(t,r,i),t.safeEncodeAsync=async(r,i)=>sw(t,r,i),t.safeDecodeAsync=async(r,i)=>aw(t,r,i),t.refine=(r,i)=>t.check(Hw(r,i)),t.superRefine=r=>t.check(Yw(r)),t.overwrite=r=>t.check(Et(r)),t.optional=()=>Ss(t),t.exactOptional=()=>Aw(t),t.nullable=()=>xs(t),t.nullish=()=>Ss(xs(t)),t.nonoptional=r=>Uw(t,r),t.array=()=>Ts(t),t.or=r=>ju([t,r]),t.and=r=>_w(t,r),t.transform=r=>_s(t,Mu(r)),t.default=r=>Lw(t,r),t.prefault=r=>jw(t,r),t.catch=r=>Fw(t,r),t.pipe=r=>_s(t,r),t.readonly=()=>Kw(t),t.describe=r=>{let i=t.clone();return Oe.add(i,{description:r}),i},Object.defineProperty(t,"description",{get(){return Oe.get(t)?.description},configurable:!0}),t.meta=(...r)=>{if(r.length===0)return Oe.get(t);let i=t.clone();return Oe.add(i,r[0]),i},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t.apply=r=>r(t),t)),bu=b("_ZodString",(t,e)=>{en.init(t,e),K.init(t,e),t._zod.processJSONSchema=(i,n,o)=>cb(t,i,n,o);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,t.regex=(...i)=>t.check(oi(...i)),t.includes=(...i)=>t.check(li(...i)),t.startsWith=(...i)=>t.check(ci(...i)),t.endsWith=(...i)=>t.check(ui(...i)),t.min=(...i)=>t.check(Qt(...i)),t.max=(...i)=>t.check(rn(...i)),t.length=(...i)=>t.check(nn(...i)),t.nonempty=(...i)=>t.check(Qt(1,...i)),t.lowercase=i=>t.check(si(i)),t.uppercase=i=>t.check(ai(i)),t.trim=()=>t.check(mi()),t.normalize=(...i)=>t.check(fi(...i)),t.toLowerCase=()=>t.check(pi()),t.toUpperCase=()=>t.check(hi()),t.slugify=()=>t.check(gi())}),Si=b("ZodString",(t,e)=>{en.init(t,e),bu.init(t,e),t.email=r=>t.check(Lc(wu,r)),t.url=r=>t.check(vs($s,r)),t.jwt=r=>t.check(tu(Du,r)),t.emoji=r=>t.check(qc(Su,r)),t.guid=r=>t.check(ys(ws,r)),t.uuid=r=>t.check(zc(zt,r)),t.uuidv4=r=>t.check(jc(zt,r)),t.uuidv6=r=>t.check(Uc(zt,r)),t.uuidv7=r=>t.check(Mc(zt,r)),t.nanoid=r=>t.check(Fc(xu,r)),t.guid=r=>t.check(ys(ws,r)),t.cuid=r=>t.check(Bc(_u,r)),t.cuid2=r=>t.check(Zc($u,r)),t.ulid=r=>t.check(Kc(ku,r)),t.base64=r=>t.check(Yc(Ou,r)),t.base64url=r=>t.check(Xc(Au,r)),t.xid=r=>t.check(Vc(Tu,r)),t.ksuid=r=>t.check(Gc(Eu,r)),t.ipv4=r=>t.check(Qc(Iu,r)),t.ipv6=r=>t.check(Jc(Cu,r)),t.cidrv4=r=>t.check(Wc(Pu,r)),t.cidrv6=r=>t.check(Hc(Nu,r)),t.e164=r=>t.check(eu(Ru,r)),t.datetime=r=>t.check(Vb(r)),t.date=r=>t.check(Gb(r)),t.time=r=>t.check(Qb(r)),t.duration=r=>t.check(Jb(r))});function yu(t){return _v(Si,t)}var ie=b("ZodStringFormat",(t,e)=>{ne.init(t,e),bu.init(t,e)}),wu=b("ZodEmail",(t,e)=>{py.init(t,e),ie.init(t,e)});function ZN(t){return Lc(wu,t)}var ws=b("ZodGUID",(t,e)=>{fy.init(t,e),ie.init(t,e)});function KN(t){return ys(ws,t)}var zt=b("ZodUUID",(t,e)=>{my.init(t,e),ie.init(t,e)});function VN(t){return zc(zt,t)}function GN(t){return jc(zt,t)}function QN(t){return Uc(zt,t)}function JN(t){return Mc(zt,t)}var $s=b("ZodURL",(t,e)=>{hy.init(t,e),ie.init(t,e)});function WN(t){return vs($s,t)}function HN(t){return vs($s,{protocol:/^https?$/,hostname:yt.domain,...N.normalizeParams(t)})}var Su=b("ZodEmoji",(t,e)=>{gy.init(t,e),ie.init(t,e)});function YN(t){return qc(Su,t)}var xu=b("ZodNanoID",(t,e)=>{yy.init(t,e),ie.init(t,e)});function XN(t){return Fc(xu,t)}var _u=b("ZodCUID",(t,e)=>{vy.init(t,e),ie.init(t,e)});function eO(t){return Bc(_u,t)}var $u=b("ZodCUID2",(t,e)=>{by.init(t,e),ie.init(t,e)});function tO(t){return Zc($u,t)}var ku=b("ZodULID",(t,e)=>{wy.init(t,e),ie.init(t,e)});function rO(t){return Kc(ku,t)}var Tu=b("ZodXID",(t,e)=>{Sy.init(t,e),ie.init(t,e)});function nO(t){return Vc(Tu,t)}var Eu=b("ZodKSUID",(t,e)=>{xy.init(t,e),ie.init(t,e)});function iO(t){return Gc(Eu,t)}var Iu=b("ZodIPv4",(t,e)=>{Ey.init(t,e),ie.init(t,e)});function oO(t){return Qc(Iu,t)}var lw=b("ZodMAC",(t,e)=>{Cy.init(t,e),ie.init(t,e)});function sO(t){return kv(lw,t)}var Cu=b("ZodIPv6",(t,e)=>{Iy.init(t,e),ie.init(t,e)});function aO(t){return Jc(Cu,t)}var Pu=b("ZodCIDRv4",(t,e)=>{Py.init(t,e),ie.init(t,e)});function lO(t){return Wc(Pu,t)}var Nu=b("ZodCIDRv6",(t,e)=>{Ny.init(t,e),ie.init(t,e)});function cO(t){return Hc(Nu,t)}var Ou=b("ZodBase64",(t,e)=>{Ay.init(t,e),ie.init(t,e)});function uO(t){return Yc(Ou,t)}var Au=b("ZodBase64URL",(t,e)=>{Ry.init(t,e),ie.init(t,e)});function dO(t){return Xc(Au,t)}var Ru=b("ZodE164",(t,e)=>{Dy.init(t,e),ie.init(t,e)});function fO(t){return eu(Ru,t)}var Du=b("ZodJWT",(t,e)=>{Ly.init(t,e),ie.init(t,e)});function mO(t){return tu(Du,t)}var xi=b("ZodCustomStringFormat",(t,e)=>{zy.init(t,e),ie.init(t,e)});function pO(t,e,r={}){return yi(xi,t,e,r)}function hO(t){return yi(xi,"hostname",yt.hostname,t)}function gO(t){return yi(xi,"hex",yt.hex,t)}function yO(t,e){let r=e?.enc??"hex",i=`${t}_${r}`,n=yt[i];if(!n)throw new Error(`Unrecognized hash format: ${i}`);return yi(xi,i,n,e)}var _i=b("ZodNumber",(t,e)=>{Ec.init(t,e),K.init(t,e),t._zod.processJSONSchema=(i,n,o)=>ub(t,i,n,o),t.gt=(i,n)=>t.check(Dt(i,n)),t.gte=(i,n)=>t.check(Me(i,n)),t.min=(i,n)=>t.check(Me(i,n)),t.lt=(i,n)=>t.check(Rt(i,n)),t.lte=(i,n)=>t.check(st(i,n)),t.max=(i,n)=>t.check(st(i,n)),t.int=i=>t.check(vu(i)),t.safe=i=>t.check(vu(i)),t.positive=i=>t.check(Dt(0,i)),t.nonnegative=i=>t.check(Me(0,i)),t.negative=i=>t.check(Rt(0,i)),t.nonpositive=i=>t.check(st(0,i)),t.multipleOf=(i,n)=>t.check(Cr(i,n)),t.step=(i,n)=>t.check(Cr(i,n)),t.finite=()=>t;let r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});function cw(t){return Nv(_i,t)}var sn=b("ZodNumberFormat",(t,e)=>{jy.init(t,e),_i.init(t,e)});function vu(t){return Av(sn,t)}function vO(t){return Rv(sn,t)}function bO(t){return Dv(sn,t)}function wO(t){return Lv(sn,t)}function SO(t){return zv(sn,t)}var $i=b("ZodBoolean",(t,e)=>{fs.init(t,e),K.init(t,e),t._zod.processJSONSchema=(r,i,n)=>db(t,r,i,n)});function uw(t){return jv($i,t)}var ki=b("ZodBigInt",(t,e)=>{Ic.init(t,e),K.init(t,e),t._zod.processJSONSchema=(i,n,o)=>fb(t,i,n,o),t.gte=(i,n)=>t.check(Me(i,n)),t.min=(i,n)=>t.check(Me(i,n)),t.gt=(i,n)=>t.check(Dt(i,n)),t.gte=(i,n)=>t.check(Me(i,n)),t.min=(i,n)=>t.check(Me(i,n)),t.lt=(i,n)=>t.check(Rt(i,n)),t.lte=(i,n)=>t.check(st(i,n)),t.max=(i,n)=>t.check(st(i,n)),t.positive=i=>t.check(Dt(BigInt(0),i)),t.negative=i=>t.check(Rt(BigInt(0),i)),t.nonpositive=i=>t.check(st(BigInt(0),i)),t.nonnegative=i=>t.check(Me(BigInt(0),i)),t.multipleOf=(i,n)=>t.check(Cr(i,n));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});function xO(t){return Mv(ki,t)}var Lu=b("ZodBigIntFormat",(t,e)=>{Uy.init(t,e),ki.init(t,e)});function _O(t){return Fv(Lu,t)}function $O(t){return Bv(Lu,t)}var dw=b("ZodSymbol",(t,e)=>{My.init(t,e),K.init(t,e),t._zod.processJSONSchema=(r,i,n)=>mb(t,r,i,n)});function kO(t){return Zv(dw,t)}var fw=b("ZodUndefined",(t,e)=>{qy.init(t,e),K.init(t,e),t._zod.processJSONSchema=(r,i,n)=>hb(t,r,i,n)});function TO(t){return Kv(fw,t)}var mw=b("ZodNull",(t,e)=>{Fy.init(t,e),K.init(t,e),t._zod.processJSONSchema=(r,i,n)=>pb(t,r,i,n)});function pw(t){return Vv(mw,t)}var hw=b("ZodAny",(t,e)=>{By.init(t,e),K.init(t,e),t._zod.processJSONSchema=(r,i,n)=>vb(t,r,i,n)});function EO(){return Gv(hw)}var gw=b("ZodUnknown",(t,e)=>{Zy.init(t,e),K.init(t,e),t._zod.processJSONSchema=(r,i,n)=>bb(t,r,i,n)});function on(){return Qv(gw)}var yw=b("ZodNever",(t,e)=>{Ky.init(t,e),K.init(t,e),t._zod.processJSONSchema=(r,i,n)=>yb(t,r,i,n)});function zu(t){return Jv(yw,t)}var vw=b("ZodVoid",(t,e)=>{Vy.init(t,e),K.init(t,e),t._zod.processJSONSchema=(r,i,n)=>gb(t,r,i,n)});function IO(t){return Wv(vw,t)}var ks=b("ZodDate",(t,e)=>{Gy.init(t,e),K.init(t,e),t._zod.processJSONSchema=(i,n,o)=>wb(t,i,n,o),t.min=(i,n)=>t.check(Me(i,n)),t.max=(i,n)=>t.check(st(i,n));let r=t._zod.bag;t.minDate=r.minimum?new Date(r.minimum):null,t.maxDate=r.maximum?new Date(r.maximum):null});function CO(t){return Hv(ks,t)}var bw=b("ZodArray",(t,e)=>{Qy.init(t,e),K.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Ob(t,r,i,n),t.element=e.element,t.min=(r,i)=>t.check(Qt(r,i)),t.nonempty=r=>t.check(Qt(1,r)),t.max=(r,i)=>t.check(rn(r,i)),t.length=(r,i)=>t.check(nn(r,i)),t.unwrap=()=>t.element});function Ts(t,e){return eb(bw,t,e)}function PO(t){let e=t._zod.def.shape;return Uu(Object.keys(e))}var Es=b("ZodObject",(t,e)=>{Jy.init(t,e),K.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Ab(t,r,i,n),N.defineLazy(t,"shape",()=>e.shape),t.keyof=()=>Uu(Object.keys(t._zod.def.shape)),t.catchall=r=>t.clone({...t._zod.def,catchall:r}),t.passthrough=()=>t.clone({...t._zod.def,catchall:on()}),t.loose=()=>t.clone({...t._zod.def,catchall:on()}),t.strict=()=>t.clone({...t._zod.def,catchall:zu()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=r=>N.extend(t,r),t.safeExtend=r=>N.safeExtend(t,r),t.merge=r=>N.merge(t,r),t.pick=r=>N.pick(t,r),t.omit=r=>N.omit(t,r),t.partial=(...r)=>N.partial(qu,t,r[0]),t.required=(...r)=>N.required(Fu,t,r[0])});function NO(t,e){let r={type:"object",shape:t??{},...N.normalizeParams(e)};return new Es(r)}function OO(t,e){return new Es({type:"object",shape:t,catchall:zu(),...N.normalizeParams(e)})}function AO(t,e){return new Es({type:"object",shape:t,catchall:on(),...N.normalizeParams(e)})}var Is=b("ZodUnion",(t,e)=>{ms.init(t,e),K.init(t,e),t._zod.processJSONSchema=(r,i,n)=>lu(t,r,i,n),t.options=e.options});function ju(t,e){return new Is({type:"union",options:t,...N.normalizeParams(e)})}var ww=b("ZodXor",(t,e)=>{Is.init(t,e),Wy.init(t,e),t._zod.processJSONSchema=(r,i,n)=>lu(t,r,i,n),t.options=e.options});function RO(t,e){return new ww({type:"union",options:t,inclusive:!1,...N.normalizeParams(e)})}var Sw=b("ZodDiscriminatedUnion",(t,e)=>{Is.init(t,e),Hy.init(t,e)});function DO(t,e,r){return new Sw({type:"union",options:e,discriminator:t,...N.normalizeParams(r)})}var xw=b("ZodIntersection",(t,e)=>{Yy.init(t,e),K.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Rb(t,r,i,n)});function _w(t,e){return new xw({type:"intersection",left:t,right:e})}var $w=b("ZodTuple",(t,e)=>{Cc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Db(t,r,i,n),t.rest=r=>t.clone({...t._zod.def,rest:r})});function kw(t,e,r){let i=e instanceof B,n=i?r:e,o=i?e:null;return new $w({type:"tuple",items:t,rest:o,...N.normalizeParams(n)})}var Cs=b("ZodRecord",(t,e)=>{Xy.init(t,e),K.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Lb(t,r,i,n),t.keyType=e.keyType,t.valueType=e.valueType});function Tw(t,e,r){return new Cs({type:"record",keyType:t,valueType:e,...N.normalizeParams(r)})}function LO(t,e,r){let i=Ue(t);return i._zod.values=void 0,new Cs({type:"record",keyType:i,valueType:e,...N.normalizeParams(r)})}function zO(t,e,r){return new Cs({type:"record",keyType:t,valueType:e,mode:"loose",...N.normalizeParams(r)})}var Ew=b("ZodMap",(t,e)=>{ev.init(t,e),K.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Pb(t,r,i,n),t.keyType=e.keyType,t.valueType=e.valueType,t.min=(...r)=>t.check(Lt(...r)),t.nonempty=r=>t.check(Lt(1,r)),t.max=(...r)=>t.check(Pr(...r)),t.size=(...r)=>t.check(tn(...r))});function jO(t,e,r){return new Ew({type:"map",keyType:t,valueType:e,...N.normalizeParams(r)})}var Iw=b("ZodSet",(t,e)=>{tv.init(t,e),K.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Nb(t,r,i,n),t.min=(...r)=>t.check(Lt(...r)),t.nonempty=r=>t.check(Lt(1,r)),t.max=(...r)=>t.check(Pr(...r)),t.size=(...r)=>t.check(tn(...r))});function UO(t,e){return new Iw({type:"set",valueType:t,...N.normalizeParams(e)})}var wi=b("ZodEnum",(t,e)=>{rv.init(t,e),K.init(t,e),t._zod.processJSONSchema=(i,n,o)=>Sb(t,i,n,o),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(i,n)=>{let o={};for(let s of i)if(r.has(s))o[s]=e.entries[s];else throw new Error(`Key ${s} not found in enum`);return new wi({...e,checks:[],...N.normalizeParams(n),entries:o})},t.exclude=(i,n)=>{let o={...e.entries};for(let s of i)if(r.has(s))delete o[s];else throw new Error(`Key ${s} not found in enum`);return new wi({...e,checks:[],...N.normalizeParams(n),entries:o})}});function Uu(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(i=>[i,i])):t;return new wi({type:"enum",entries:r,...N.normalizeParams(e)})}function MO(t,e){return new wi({type:"enum",entries:t,...N.normalizeParams(e)})}var Cw=b("ZodLiteral",(t,e)=>{nv.init(t,e),K.init(t,e),t._zod.processJSONSchema=(r,i,n)=>xb(t,r,i,n),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function qO(t,e){return new Cw({type:"literal",values:Array.isArray(t)?t:[t],...N.normalizeParams(e)})}var Pw=b("ZodFile",(t,e)=>{iv.init(t,e),K.init(t,e),t._zod.processJSONSchema=(r,i,n)=>kb(t,r,i,n),t.min=(r,i)=>t.check(Lt(r,i)),t.max=(r,i)=>t.check(Pr(r,i)),t.mime=(r,i)=>t.check(di(Array.isArray(r)?r:[r],i))});function FO(t){return tb(Pw,t)}var Nw=b("ZodTransform",(t,e)=>{ov.init(t,e),K.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Cb(t,r,i,n),t._zod.parse=(r,i)=>{if(i.direction==="backward")throw new $r(t.constructor.name);r.addIssue=o=>{if(typeof o=="string")r.issues.push(N.issue(o,r.value,e));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=t),r.issues.push(N.issue(s))}};let n=e.transform(r.value,r);return n instanceof Promise?n.then(o=>(r.value=o,r)):(r.value=n,r)}});function Mu(t){return new Nw({type:"transform",transform:t})}var qu=b("ZodOptional",(t,e)=>{Pc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(r,i,n)=>cu(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});function Ss(t){return new qu({type:"optional",innerType:t})}var Ow=b("ZodExactOptional",(t,e)=>{sv.init(t,e),K.init(t,e),t._zod.processJSONSchema=(r,i,n)=>cu(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});function Aw(t){return new Ow({type:"optional",innerType:t})}var Rw=b("ZodNullable",(t,e)=>{av.init(t,e),K.init(t,e),t._zod.processJSONSchema=(r,i,n)=>zb(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});function xs(t){return new Rw({type:"nullable",innerType:t})}function BO(t){return Ss(xs(t))}var Dw=b("ZodDefault",(t,e)=>{lv.init(t,e),K.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Ub(t,r,i,n),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function Lw(t,e){return new Dw({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():N.shallowClone(e)}})}var zw=b("ZodPrefault",(t,e)=>{cv.init(t,e),K.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Mb(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});function jw(t,e){return new zw({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():N.shallowClone(e)}})}var Fu=b("ZodNonOptional",(t,e)=>{uv.init(t,e),K.init(t,e),t._zod.processJSONSchema=(r,i,n)=>jb(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});function Uw(t,e){return new Fu({type:"nonoptional",innerType:t,...N.normalizeParams(e)})}var Mw=b("ZodSuccess",(t,e)=>{dv.init(t,e),K.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Tb(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});function ZO(t){return new Mw({type:"success",innerType:t})}var qw=b("ZodCatch",(t,e)=>{fv.init(t,e),K.init(t,e),t._zod.processJSONSchema=(r,i,n)=>qb(t,r,i,n),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function Fw(t,e){return new qw({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}var Bw=b("ZodNaN",(t,e)=>{mv.init(t,e),K.init(t,e),t._zod.processJSONSchema=(r,i,n)=>_b(t,r,i,n)});function KO(t){return Xv(Bw,t)}var Bu=b("ZodPipe",(t,e)=>{pv.init(t,e),K.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Fb(t,r,i,n),t.in=e.in,t.out=e.out});function _s(t,e){return new Bu({type:"pipe",in:t,out:e})}var Zu=b("ZodCodec",(t,e)=>{Bu.init(t,e),ps.init(t,e)});function VO(t,e,r){return new Zu({type:"pipe",in:t,out:e,transform:r.decode,reverseTransform:r.encode})}var Zw=b("ZodReadonly",(t,e)=>{hv.init(t,e),K.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Bb(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});function Kw(t){return new Zw({type:"readonly",innerType:t})}var Vw=b("ZodTemplateLiteral",(t,e)=>{gv.init(t,e),K.init(t,e),t._zod.processJSONSchema=(r,i,n)=>$b(t,r,i,n)});function GO(t,e){return new Vw({type:"template_literal",parts:t,...N.normalizeParams(e)})}var Gw=b("ZodLazy",(t,e)=>{bv.init(t,e),K.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Kb(t,r,i,n),t.unwrap=()=>t._zod.def.getter()});function Qw(t){return new Gw({type:"lazy",getter:t})}var Jw=b("ZodPromise",(t,e)=>{vv.init(t,e),K.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Zb(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});function QO(t){return new Jw({type:"promise",innerType:t})}var Ww=b("ZodFunction",(t,e)=>{yv.init(t,e),K.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Ib(t,r,i,n)});function JO(t){return new Ww({type:"function",input:Array.isArray(t?.input)?kw(t?.input):t?.input??Ts(on()),output:t?.output??on()})}var Ps=b("ZodCustom",(t,e)=>{wv.init(t,e),K.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Eb(t,r,i,n)});function WO(t){let e=new oe({check:"custom"});return e._zod.check=t,e}function HO(t,e){return rb(Ps,t??(()=>!0),e)}function Hw(t,e={}){return nb(Ps,t,e)}function Yw(t){return ib(t)}var YO=ob,XO=sb;function eA(t,e={}){let r=new Ps({type:"custom",check:"custom",fn:i=>i instanceof t,abort:!0,...N.normalizeParams(e)});return r._zod.bag.Class=t,r._zod.check=i=>{i.value instanceof t||i.issues.push({code:"invalid_type",expected:t.name,input:i.value,inst:r,path:[...r._zod.def.path??[]]})},r}var tA=(...t)=>ab({Codec:Zu,Boolean:$i,String:Si},...t);function rA(t){let e=Qw(()=>ju([yu(t),cw(),uw(),pw(),Ts(e),Tw(yu(),e)]));return e}function nA(t,e){return _s(Mu(t),e)}var Q5={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 J5(t){ye({customError:t})}function W5(){return ye().customError}var Xw;Xw||(Xw={});var z={...bs,...fu,iso:bi},H5=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 Y5(t,e){let r=t.$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":e??"draft-2020-12"}function X5(t,e){if(!t.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=t.slice(1).split("/").filter(Boolean);if(r.length===0)return e.rootSchema;let i=e.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===i){let n=r[1];if(!n||!e.defs[n])throw new Error(`Reference not found: ${t}`);return e.defs[n]}throw new Error(`Reference not found: ${t}`)}function iA(t,e){if(t.not!==void 0){if(typeof t.not=="object"&&Object.keys(t.not).length===0)return z.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(t.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(t.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(t.if!==void 0||t.then!==void 0||t.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(t.dependentSchemas!==void 0||t.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(t.$ref){let n=t.$ref;if(e.refs.has(n))return e.refs.get(n);if(e.processing.has(n))return z.lazy(()=>{if(!e.refs.has(n))throw new Error(`Circular reference not resolved: ${n}`);return e.refs.get(n)});e.processing.add(n);let o=X5(n,e),s=De(o,e);return e.refs.set(n,s),e.processing.delete(n),s}if(t.enum!==void 0){let n=t.enum;if(e.version==="openapi-3.0"&&t.nullable===!0&&n.length===1&&n[0]===null)return z.null();if(n.length===0)return z.never();if(n.length===1)return z.literal(n[0]);if(n.every(s=>typeof s=="string"))return z.enum(n);let o=n.map(s=>z.literal(s));return o.length<2?o[0]:z.union([o[0],o[1],...o.slice(2)])}if(t.const!==void 0)return z.literal(t.const);let r=t.type;if(Array.isArray(r)){let n=r.map(o=>{let s={...t,type:o};return iA(s,e)});return n.length===0?z.never():n.length===1?n[0]:z.union(n)}if(!r)return z.any();let i;switch(r){case"string":{let n=z.string();if(t.format){let o=t.format;o==="email"?n=n.check(z.email()):o==="uri"||o==="uri-reference"?n=n.check(z.url()):o==="uuid"||o==="guid"?n=n.check(z.uuid()):o==="date-time"?n=n.check(z.iso.datetime()):o==="date"?n=n.check(z.iso.date()):o==="time"?n=n.check(z.iso.time()):o==="duration"?n=n.check(z.iso.duration()):o==="ipv4"?n=n.check(z.ipv4()):o==="ipv6"?n=n.check(z.ipv6()):o==="mac"?n=n.check(z.mac()):o==="cidr"?n=n.check(z.cidrv4()):o==="cidr-v6"?n=n.check(z.cidrv6()):o==="base64"?n=n.check(z.base64()):o==="base64url"?n=n.check(z.base64url()):o==="e164"?n=n.check(z.e164()):o==="jwt"?n=n.check(z.jwt()):o==="emoji"?n=n.check(z.emoji()):o==="nanoid"?n=n.check(z.nanoid()):o==="cuid"?n=n.check(z.cuid()):o==="cuid2"?n=n.check(z.cuid2()):o==="ulid"?n=n.check(z.ulid()):o==="xid"?n=n.check(z.xid()):o==="ksuid"&&(n=n.check(z.ksuid()))}typeof t.minLength=="number"&&(n=n.min(t.minLength)),typeof t.maxLength=="number"&&(n=n.max(t.maxLength)),t.pattern&&(n=n.regex(new RegExp(t.pattern))),i=n;break}case"number":case"integer":{let n=r==="integer"?z.number().int():z.number();typeof t.minimum=="number"&&(n=n.min(t.minimum)),typeof t.maximum=="number"&&(n=n.max(t.maximum)),typeof t.exclusiveMinimum=="number"?n=n.gt(t.exclusiveMinimum):t.exclusiveMinimum===!0&&typeof t.minimum=="number"&&(n=n.gt(t.minimum)),typeof t.exclusiveMaximum=="number"?n=n.lt(t.exclusiveMaximum):t.exclusiveMaximum===!0&&typeof t.maximum=="number"&&(n=n.lt(t.maximum)),typeof t.multipleOf=="number"&&(n=n.multipleOf(t.multipleOf)),i=n;break}case"boolean":{i=z.boolean();break}case"null":{i=z.null();break}case"object":{let n={},o=t.properties||{},s=new Set(t.required||[]);for(let[l,c]of Object.entries(o)){let u=De(c,e);n[l]=s.has(l)?u:u.optional()}if(t.propertyNames){let l=De(t.propertyNames,e),c=t.additionalProperties&&typeof t.additionalProperties=="object"?De(t.additionalProperties,e):z.any();if(Object.keys(n).length===0){i=z.record(l,c);break}let u=z.object(n).passthrough(),d=z.looseRecord(l,c);i=z.intersection(u,d);break}if(t.patternProperties){let l=t.patternProperties,c=Object.keys(l),u=[];for(let f of c){let m=De(l[f],e),y=z.string().regex(new RegExp(f));u.push(z.looseRecord(y,m))}let d=[];if(Object.keys(n).length>0&&d.push(z.object(n).passthrough()),d.push(...u),d.length===0)i=z.object({}).passthrough();else if(d.length===1)i=d[0];else{let f=z.intersection(d[0],d[1]);for(let m=2;m<d.length;m++)f=z.intersection(f,d[m]);i=f}break}let a=z.object(n);t.additionalProperties===!1?i=a.strict():typeof t.additionalProperties=="object"?i=a.catchall(De(t.additionalProperties,e)):i=a.passthrough();break}case"array":{let n=t.prefixItems,o=t.items;if(n&&Array.isArray(n)){let s=n.map(l=>De(l,e)),a=o&&typeof o=="object"&&!Array.isArray(o)?De(o,e):void 0;a?i=z.tuple(s).rest(a):i=z.tuple(s),typeof t.minItems=="number"&&(i=i.check(z.minLength(t.minItems))),typeof t.maxItems=="number"&&(i=i.check(z.maxLength(t.maxItems)))}else if(Array.isArray(o)){let s=o.map(l=>De(l,e)),a=t.additionalItems&&typeof t.additionalItems=="object"?De(t.additionalItems,e):void 0;a?i=z.tuple(s).rest(a):i=z.tuple(s),typeof t.minItems=="number"&&(i=i.check(z.minLength(t.minItems))),typeof t.maxItems=="number"&&(i=i.check(z.maxLength(t.maxItems)))}else if(o!==void 0){let s=De(o,e),a=z.array(s);typeof t.minItems=="number"&&(a=a.min(t.minItems)),typeof t.maxItems=="number"&&(a=a.max(t.maxItems)),i=a}else i=z.array(z.any());break}default:throw new Error(`Unsupported type: ${r}`)}return t.description&&(i=i.describe(t.description)),t.default!==void 0&&(i=i.default(t.default)),i}function De(t,e){if(typeof t=="boolean")return t?z.any():z.never();let r=iA(t,e),i=t.type||t.enum!==void 0||t.const!==void 0;if(t.anyOf&&Array.isArray(t.anyOf)){let a=t.anyOf.map(c=>De(c,e)),l=z.union(a);r=i?z.intersection(r,l):l}if(t.oneOf&&Array.isArray(t.oneOf)){let a=t.oneOf.map(c=>De(c,e)),l=z.xor(a);r=i?z.intersection(r,l):l}if(t.allOf&&Array.isArray(t.allOf))if(t.allOf.length===0)r=i?r:z.any();else{let a=i?r:De(t.allOf[0],e),l=i?0:1;for(let c=l;c<t.allOf.length;c++)a=z.intersection(a,De(t.allOf[c],e));r=a}t.nullable===!0&&e.version==="openapi-3.0"&&(r=z.nullable(r)),t.readOnly===!0&&(r=z.readonly(r));let n={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let a of o)a in t&&(n[a]=t[a]);let s=["contentEncoding","contentMediaType","contentSchema"];for(let a of s)a in t&&(n[a]=t[a]);for(let a of Object.keys(t))H5.has(a)||(n[a]=t[a]);return Object.keys(n).length>0&&e.registry.add(r,n),r}function oA(t,e){if(typeof t=="boolean")return t?z.any():z.never();let r=Y5(t,e?.defaultTarget),i=t.$defs||t.definitions||{},n={version:r,defs:i,refs:new Map,processing:new Set,rootSchema:t,registry:e?.registry??Oe};return De(t,n)}var eS={};Pt(eS,{bigint:()=>nG,boolean:()=>rG,date:()=>iG,number:()=>tG,string:()=>eG});function eG(t){return $v(Si,t)}function tG(t){return Ov(_i,t)}function rG(t){return Uv($i,t)}function nG(t){return qv(ki,t)}function iG(t){return Yv(ks,t)}ye(Nc());var sA=["ask","ask-check","ask-question","assist-global","backlog-ids","backlog-prs","code-comments","drafting-messages","editing-files","fixing-commands","filename-convention","jira-context","jira-smart-links","link-urls","markdown","refactor","settings-json","show-links","verify"];var aA=["**/.github/workflows/**","**/.github/actions/**","**/package.json","**/Dockerfile","**/Dockerfile.*","**/*.Dockerfile","**/CLAUDE.md"];var oG={s:1e3,m:6e4,h:36e5};function lA(t){let e=/^(\d+)(s|m|h)$/.exec(t.trim());if(!e)throw new Error(`Invalid duration "${t}". Use a whole number followed by s, m, or h (e.g. 30s, 60m, 2h).`);let r=Number(e[1]);if(r===0)throw new Error(`Invalid duration "${t}". Value must be at least 1.`);return r*oG[e[2]]}var cA=p.string().superRefine((t,e)=>{try{lA(t)}catch(r){e.addIssue({code:"custom",message:r.message})}});var sG={"/":"Slash",".":"Period",",":"Comma",";":"Semicolon","'":"Quote","[":"BracketLeft","]":"BracketRight","\\":"Backslash","-":"Minus","=":"Equal","`":"Backquote"},aG=["Enter","Space","Escape","Backspace","Delete","Insert","Home","End","PageUp","PageDown","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"];function uA(t){if(/^[a-z]$/i.test(t)){let i=t.toUpperCase();return{code:`Key${i}`,label:i}}if(/^\d$/.test(t))return{code:`Digit${t}`,label:t};let e=sG[t];if(e)return{code:e,label:t};if(/^F([1-9]|1[0-2])$/i.test(t)){let i=t.toUpperCase();return{code:i,label:i}}let r=aG.find(i=>i.toLowerCase()===t.toLowerCase());return r?{code:r,label:r}:void 0}var lG={mod:"Mod",ctrl:"Ctrl",control:"Ctrl",alt:"Alt",option:"Alt",opt:"Alt",shift:"Shift",meta:"Meta",cmd:"Meta",command:"Meta",win:"Meta"},cG=["Mod","Ctrl","Alt","Shift","Meta"];function dA(t,e){let r=new Set;for(let i of t){let n=lG[i.toLowerCase()];if(!n)return{ok:!1,error:`"${i}" is not a modifier in "${e}"`};if(r.has(n))return{ok:!1,error:`"${i}" is repeated in "${e}"`};r.add(n)}return[...r].some(i=>i!=="Shift")?r.has("Mod")&&(r.has("Ctrl")||r.has("Meta"))?{ok:!1,error:`"${e}" combines Mod with Ctrl or Meta, which Mod already means`}:{ok:!0,modifiers:cG.filter(i=>r.has(i))}:{ok:!1,error:`"${e}" needs at least one of Mod, Ctrl, Alt or Meta`}}function fA(t,{modifiersOnly:e=!1}={}){let r=t.split("+").map(a=>a.trim()),i=e?void 0:r.pop(),n=dA(r,t);if(!n.ok)return n;let{modifiers:o}=n;if(i===void 0)return{ok:!0,chord:{modifiers:o}};let s=uA(i);return s?{ok:!0,chord:{modifiers:o,key:s}}:{ok:!1,error:`"${i}" is not a key in "${t}"`}}function mA(t){return p.string().superRefine((e,r)=>{let i=fA(e,{modifiersOnly:t});i.ok||r.addIssue({code:"custom",message:i.error})})}var Fe=mA(!1).optional(),pA=p.strictObject({navTab:mA(!0).optional(),focusSidebar:Fe,focusTerminal:Fe,toggleDiff:Fe,focusRepoPicker:Fe,openUpdates:Fe,openConfig:Fe,openMenu:Fe,focusAddAgent:Fe,focusVsCode:Fe,focusDone:Fe,nextWaiting:Fe,newSession:Fe,quickOpen:Fe,save:Fe,shortcutsSheet:Fe});var uG=p.strictObject({name:p.string(),required:p.boolean().optional(),default:p.string().optional(),description:p.string().optional()}),hA=p.strictObject({name:p.string(),command:p.string(),args:p.array(p.string()).optional(),params:p.array(uG).optional(),env:p.record(p.string(),p.string()).optional(),filter:p.string().optional(),pre:p.array(p.string()).optional(),cwd:p.string().optional(),quiet:p.boolean().optional(),server:p.union([p.boolean(),p.string().min(1)]).optional(),port:p.number().optional()}),gA=p.strictObject({link:p.string(),prefix:p.string()});var dG="assistSecret";function Ns(t){return t.meta({[dG]:!0})}var fG="ssh links are no longer supported; relink with `assist sessions nodes link <name> --tailscale <host> --port <port>`",yA=p.preprocess((t,e)=>(t&&typeof t=="object"&&"ssh"in t&&e.issues.push({code:"custom",message:fG,input:t}),t),p.strictObject({name:p.string(),url:p.string()}));var mG=p.strictObject({vttDir:p.string(),transcriptsDir:p.string(),summaryDir:p.string()}),pG=p.strictObject({board:p.string().optional(),frame:p.string().optional(),topLeft:p.string(),bottomRight:p.string(),items:p.string(),ignore:p.string().optional(),out:p.string().optional()}),vA="~/.assist/backups",bA="32h",wA="~/git",SA={advice:p.strictObject({sections:p.partialRecord(p.enum(sA),p.boolean()).default({}),extra:p.string().optional(),verify:p.string().optional(),rules:p.array(p.strictObject({title:p.string(),text:p.string()})).optional()}).optional(),backup:p.strictObject({dir:p.string().default(vA),staleAfter:cA.default(bA)}).default({dir:vA,staleAfter:bA}),clone:p.strictObject({baseDir:p.string().default(wA)}).default({baseDir:wA}),commit:p.strictObject({conventional:p.boolean().default(!1),pull:p.boolean().default(!1),push:p.boolean().default(!1),expectedBranch:p.string().optional()}).default({conventional:!1,pull:!1,push:!1}),branch:p.strictObject({prefix:p.string().optional(),defaultBranch:p.string().optional()}).optional(),devlog:p.strictObject({name:p.string().optional(),dir:p.string().optional(),ignore:p.array(p.string()).optional(),skipWeeks:p.array(p.string().regex(/^\d{4}-W\d{2}$/,"Use YYYY-Www")).optional()}).optional(),docs:p.strictObject({refreshAfter:p.number().int().positive().optional()}).optional(),extension:p.strictObject({redirects:p.record(p.string(),p.string()).optional()}).optional(),notify:p.strictObject({enabled:p.boolean().default(!0)}).default({enabled:!0}),complexity:p.strictObject({ignore:p.array(p.string()).default(["**/*test.ts*"])}).default({ignore:["**/*test.ts*"]}),hardcodedColors:p.strictObject({ignore:p.array(p.string()).default([])}).optional(),blockCodeComments:p.strictObject({ignore:p.array(p.string()).default([])}).optional(),verify:p.strictObject({roots:p.array(p.string()).default([])}).optional(),restructure:p.strictObject({ignore:p.array(p.string()).default([]),pin:p.array(p.string()).default([]),maxDepth:p.number().int().positive().default(10),maxPathLength:p.number().int().positive().default(200)}).optional(),jira:p.strictObject({acField:p.string().default("customfield_11937")}).optional(),slack:p.strictObject({channel:p.string().optional()}).optional(),prs:p.strictObject({slack:p.string().optional(),required:p.boolean().default(!0),promptJira:p.boolean().default(!1),promptGithub:p.boolean().default(!1),draft:p.boolean().default(!1),readingWordsPerMinute:p.number().int().positive().optional()}).optional(),review:p.strictObject({codexModel:p.string().optional(),highLevel:p.strictObject({criticalPaths:p.array(p.string()).default(aA),uiPaths:p.array(p.string()).default([]),descriptionWordCap:p.number().int().positive().default(300),testPaths:p.array(p.string()).default(["**/*.{test,spec}.{ts,tsx,js,jsx}"]),collapsedPaths:p.array(p.string()).default(["**/*.test.*","**/generated/**"]),slices:p.boolean().default(!1)}).optional()}).optional(),readTime:p.strictObject({wordsPerMinute:p.number().int().positive().default(200)}).optional(),releases:p.strictObject({streams:p.array(p.strictObject({name:p.string(),repo:p.string(),workflow:p.string(),nodes:p.array(p.strictObject({id:p.string(),environment:p.string().optional(),kind:p.enum(["build","gate"]).optional(),label:p.string().optional()})),edges:p.array(p.tuple([p.string(),p.string()])).default([])})).default([])}).optional(),inbox:p.strictObject({intervalMinutes:p.number().int().positive().optional()}).optional(),autoUpdate:p.strictObject({enabled:p.boolean().default(!0),restart:p.boolean().default(!1)}).optional(),worktree:p.strictObject({enabled:p.boolean().default(!1),trunk:p.boolean().default(!1),root:p.string().optional(),install:p.union([p.boolean(),p.string(),p.array(p.string())]).default(!0),commitBeforeManualChecks:p.boolean().default(!1),commitBeforePhaseEnd:p.boolean().optional(),copy:p.array(p.string()).default([".env","settings.local.json",".claude/settings.local.json"])}).optional(),run:p.array(p.union([hA,gA])).optional(),transcript:mG.optional(),cliHook:p.strictObject({blockNpmRun:p.boolean().default(!0)}).optional(),dotnet:p.strictObject({inspect:p.strictObject({suppress:p.array(p.string()).default([])}).default({suppress:[]})}).optional(),litellm:p.strictObject({baseUrl:p.string().optional(),apiKey:Ns(p.string()).optional()}).optional(),ravendb:p.strictObject({connections:p.array(p.strictObject({name:p.string(),url:p.string(),database:p.string(),apiKeyRef:p.string()})).default([]),defaultConnection:p.string().optional()}).optional(),seq:p.strictObject({connections:p.array(p.strictObject({name:p.string(),url:p.string(),apiToken:Ns(p.string())})).default([]),defaultConnection:p.string().optional()}).optional(),sql:p.strictObject({connections:p.array(p.strictObject({name:p.string(),server:p.string(),port:p.number(),user:p.string(),password:Ns(p.string()),database:p.string()})).default([]),defaultConnection:p.string().optional()}).optional(),screenshot:p.strictObject({outputDir:p.string().default("./screenshots")}).default({outputDir:"./screenshots"}),sessions:p.strictObject({nodeName:p.string().optional(),links:p.array(yA).optional(),linkVersionCheck:p.enum(["block","warn","off"]).default("block"),tailscaleServe:p.boolean().default(!0),includeCommittedChanges:p.boolean().default(!0),maxLive:p.number().default(24),newSessionMode:p.enum(["draft","bug","prompt","design"]).default("draft"),hotkeys:pA.optional(),askQuestion:p.boolean().default(!1),askQuestionAutoSubmit:p.boolean().default(!1)}).optional(),database:p.strictObject({url:Ns(p.string()).optional()}).default({}),mermaid:p.strictObject({krokiUrl:p.string().default("https://kroki.io")}).default({krokiUrl:"https://kroki.io"}),miro:p.strictObject({extracts:p.record(p.string(),pG).optional()}).optional(),news:p.strictObject({showInNav:p.boolean().default(!1),feeds:p.array(p.string()).optional()}).optional(),next:p.strictObject({peers:p.array(p.string()).optional(),repos:p.array(p.string()).optional(),projects:p.array(p.string().regex(/^[^/\s]+\/\d+$/,"Use <owner>/<project number>, e.g. my-org/3")).optional(),pickStatuses:p.array(p.string()).optional(),excludeLabels:p.array(p.string()).optional(),excludeTypes:p.array(p.string()).optional()}).optional(),deny:p.array(p.strictObject({pattern:p.string(),message:p.string()})).optional(),forbiddenStrings:p.array(p.strictObject({file:p.string(),paths:p.array(p.string()),disallowed:p.string()})).optional(),sync:p.strictObject({autoConfirm:p.boolean().default(!1)}).default({autoConfirm:!1}),harness:p.strictObject({engine:p.enum(["claude","codex","pi"]).default("claude"),exposeCodexActions:p.boolean().optional(),exposePiActions:p.boolean().optional(),codexModel:p.string().optional()}).default({engine:"claude"})},hG=p.strictObject(SA).partial(),xA=p.strictObject({...SA,repos:p.record(p.string(),hG).optional()});import{isDeepStrictEqual as gG}from"node:util";var _A=new Set;function $A(t){let e=t?.advice;return Array.isArray(e?.rules)?e.rules:[]}function kA(t,e){if(e===void 0)return;let r=$A(e),i=$A(t).filter(o=>!r.some(s=>gG(s,o))),n=JSON.stringify(i);i.length===0||_A.has(n)||(_A.add(n),console.error(rt.yellow(`advice.rules in ~/.assist.yml has ${i.length} rule(s) not in user (db), so other nodes don't see them. Run 'assist config import-user' to share them.`)))}function tS(t){let e=t;for(;e!==EA(e);){let r=Ku(e,".claude","assist.yml");if(TA(r))return{configPath:r,rootDir:e};let i=Ku(e,"assist.yml");if(TA(i))return{configPath:i,rootDir:e};e=EA(e)}return null}function IA(t){let e=tS(t);return e?e.configPath:Ku(t,"assist.yml")}function Vu(){return Ku(yG(),".assist.yml")}function rS(t){if(tS(t))return IA(t);let e=W1(t)?.clone;return IA(e??t)}function CA(t,e=Vu()){return xA.parse(vG(t,e))}function vG(t,e=Vu()){let r=Jn(e),i=Jn(rS(t)),n=Hh().user;kA(r,n);let o=rc(rc(n??{},r),gP(r,t).override),s=rg(rc(o,i));return delete s.repos,s}function Ti(){return CA(process.cwd())}function PA(t=process.cwd()){return Jn(rS(t))}function NA(t=Vu()){return Jn(t)}var g=Symbol.for("drizzle:entityKind");function $(t,e){if(!t||typeof t!="object")return!1;if(t instanceof e)return!0;if(!Object.prototype.hasOwnProperty.call(e,g))throw new Error(`Class "${e.name??"<unknown>"}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.`);let r=Object.getPrototypeOf(t).constructor;if(r)for(;r;){if(g in r&&r[g]===e[g])return!0;r=Object.getPrototypeOf(r)}return!1}var re=class{constructor(e,r){this.table=e,this.config=r,this.name=r.name,this.keyAsName=r.keyAsName,this.notNull=r.notNull,this.default=r.default,this.defaultFn=r.defaultFn,this.onUpdateFn=r.onUpdateFn,this.hasDefault=r.hasDefault,this.primary=r.primaryKey,this.isUnique=r.isUnique,this.uniqueName=r.uniqueName,this.uniqueType=r.uniqueType,this.dataType=r.dataType,this.columnType=r.columnType,this.generated=r.generated,this.generatedIdentity=r.generatedIdentity}static[g]="Column";name;keyAsName;primary;notNull;default;defaultFn;onUpdateFn;hasDefault;isUnique;uniqueName;uniqueType;dataType;columnType;enumValues=void 0;generated=void 0;generatedIdentity=void 0;config;mapFromDriverValue(e){return e}mapToDriverValue(e){return e}shouldDisableInsert(){return this.config.generated!==void 0&&this.config.generated.type!=="byDefault"}};var Gu=class{static[g]="ColumnBuilder";config;constructor(e,r,i){this.config={name:e,keyAsName:e==="",notNull:!1,default:void 0,hasDefault:!1,primaryKey:!1,isUnique:!1,uniqueName:void 0,uniqueType:void 0,dataType:r,columnType:i,generated:void 0}}$type(){return this}notNull(){return this.config.notNull=!0,this}default(e){return this.config.default=e,this.config.hasDefault=!0,this}$defaultFn(e){return this.config.defaultFn=e,this.config.hasDefault=!0,this}$default=this.$defaultFn;$onUpdateFn(e){return this.config.onUpdateFn=e,this.config.hasDefault=!0,this}$onUpdate=this.$onUpdateFn;primaryKey(){return this.config.primaryKey=!0,this.config.notNull=!0,this}setName(e){this.config.name===""&&(this.config.name=e)}};var It=Symbol.for("drizzle:Name");var Os=class{static[g]="PgForeignKeyBuilder";reference;_onUpdate="no action";_onDelete="no action";constructor(e,r){this.reference=()=>{let{name:i,columns:n,foreignColumns:o}=e();return{name:i,columns:n,foreignTable:o[0].table,foreignColumns:o}},r&&(this._onUpdate=r.onUpdate,this._onDelete=r.onDelete)}onUpdate(e){return this._onUpdate=e===void 0?"no action":e,this}onDelete(e){return this._onDelete=e===void 0?"no action":e,this}build(e){return new nS(e,this)}},nS=class{constructor(e,r){this.table=e,this.reference=r.reference,this.onUpdate=r._onUpdate,this.onDelete=r._onDelete}static[g]="PgForeignKey";reference;onUpdate;onDelete;getName(){let{name:e,columns:r,foreignColumns:i}=this.reference(),n=r.map(a=>a.name),o=i.map(a=>a.name),s=[this.table[It],...n,i[0].table[It],...o];return e??`${s.join("_")}_fk`}};function OA(t){function e(){let{name:r,columns:i,foreignColumns:n}=t;return{name:r,columns:i,foreignColumns:n}}return new Os(e)}function Qu(t,...e){return t(...e)}function sS(t,e){return`${t[It]}_${e.join("_")}_unique`}var iS=class{constructor(e,r){this.name=r,this.columns=e}static[g]="PgUniqueConstraintBuilder";columns;nullsNotDistinctConfig=!1;nullsNotDistinct(){return this.nullsNotDistinctConfig=!0,this}build(e){return new oS(e,this.columns,this.nullsNotDistinctConfig,this.name)}},AA=class{static[g]="PgUniqueOnConstraintBuilder";name;constructor(e){this.name=e}on(...e){return new iS(e,this.name)}},oS=class{constructor(e,r,i,n){this.table=e,this.columns=r,this.name=n??sS(this.table,this.columns.map(o=>o.name)),this.nullsNotDistinct=i}static[g]="PgUniqueConstraint";columns;name;nullsNotDistinct=!1;getName(){return this.name}};function RA(t,e,r){for(let i=e;i<t.length;i++){let n=t[i];if(n==="\\"){i++;continue}if(n==='"')return[t.slice(e,i).replace(/\\/g,""),i+1];if(!r&&(n===","||n==="}"))return[t.slice(e,i).replace(/\\/g,""),i]}return[t.slice(e).replace(/\\/g,""),t.length]}function DA(t,e=0){let r=[],i=e,n=!1;for(;i<t.length;){let o=t[i];if(o===","){(n||i===e)&&r.push(""),n=!0,i++;continue}if(n=!1,o==="\\"){i+=2;continue}if(o==='"'){let[l,c]=RA(t,i+1,!0);r.push(l),i=c;continue}if(o==="}")return[r,i+1];if(o==="{"){let[l,c]=DA(t,i+1);r.push(l),i=c;continue}let[s,a]=RA(t,i,!1);r.push(s),i=a}return[r,i]}function LA(t){let[e]=DA(t,1);return e}function aS(t){return`{${t.map(e=>Array.isArray(e)?aS(e):typeof e=="string"?`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`:`${e}`).join(",")}}`}var M=class extends Gu{foreignKeyConfigs=[];static[g]="PgColumnBuilder";array(e){return new cS(this.config.name,this,e)}references(e,r={}){return this.foreignKeyConfigs.push({ref:e,actions:r}),this}unique(e,r){return this.config.isUnique=!0,this.config.uniqueName=e,this.config.uniqueType=r?.nulls,this}generatedAlwaysAs(e){return this.config.generated={as:e,type:"always",mode:"stored"},this}buildForeignKeys(e,r){return this.foreignKeyConfigs.map(({ref:i,actions:n})=>Qu((o,s)=>{let a=new Os(()=>{let l=o();return{columns:[e],foreignColumns:[l]}});return s.onUpdate&&a.onUpdate(s.onUpdate),s.onDelete&&a.onDelete(s.onDelete),a.build(r)},i,n))}buildExtraConfigColumn(e){return new lS(e,this.config)}},A=class extends re{constructor(e,r){r.uniqueName||(r.uniqueName=sS(e,[r.name])),super(e,r),this.table=e}static[g]="PgColumn"},lS=class extends A{static[g]="ExtraConfigColumn";getSQLType(){return this.getSQLType()}indexConfig={order:this.config.order??"asc",nulls:this.config.nulls??"last",opClass:this.config.opClass};defaultConfig={order:"asc",nulls:"last",opClass:void 0};asc(){return this.indexConfig.order="asc",this}desc(){return this.indexConfig.order="desc",this}nullsFirst(){return this.indexConfig.nulls="first",this}nullsLast(){return this.indexConfig.nulls="last",this}op(e){return this.indexConfig.opClass=e,this}},Ei=class{static[g]="IndexedColumn";constructor(e,r,i,n){this.name=e,this.keyAsName=r,this.type=i,this.indexConfig=n}name;keyAsName;type;indexConfig},cS=class extends M{static[g]="PgArrayBuilder";constructor(e,r,i){super(e,"array","PgArray"),this.config.baseBuilder=r,this.config.size=i}build(e){let r=this.config.baseBuilder.build(e);return new uS(e,this.config,r)}},uS=class t extends A{constructor(e,r,i,n){super(e,r),this.baseColumn=i,this.range=n,this.size=r.size}size;static[g]="PgArray";getSQLType(){return`${this.baseColumn.getSQLType()}[${typeof this.size=="number"?this.size:""}]`}mapFromDriverValue(e){return typeof e=="string"&&(e=LA(e)),e.map(r=>this.baseColumn.mapFromDriverValue(r))}mapToDriverValue(e,r=!1){let i=e.map(n=>n===null?null:$(this.baseColumn,t)?this.baseColumn.mapToDriverValue(n,!0):this.baseColumn.mapToDriverValue(n));return r?i:aS(i)}};var zA=class extends M{static[g]="PgEnumObjectColumnBuilder";constructor(e,r){super(e,"string","PgEnumObjectColumn"),this.config.enum=r}build(e){return new dS(e,this.config)}},dS=class extends A{static[g]="PgEnumObjectColumn";enum;enumValues=this.config.enum.enumValues;constructor(e,r){super(e,r),this.enum=r.enum}getSQLType(){return this.enum.enumName}},jA=Symbol.for("drizzle:isPgEnum");function MA(t){return!!t&&typeof t=="function"&&jA in t&&t[jA]===!0}var UA=class extends M{static[g]="PgEnumColumnBuilder";constructor(e,r){super(e,"string","PgEnumColumn"),this.config.enum=r}build(e){return new fS(e,this.config)}},fS=class extends A{static[g]="PgEnumColumn";enum=this.config.enum;enumValues=this.config.enum.enumValues;constructor(e,r){super(e,r),this.enum=r.enum}getSQLType(){return this.enum.enumName}};var ce=class{static[g]="Subquery";constructor(e,r,i,n=!1,o=[]){this._={brand:"Subquery",sql:e,selectedFields:r,alias:i,isWith:n,usedTables:o}}},Ii=class extends ce{static[g]="WithSubquery"};var qA="0.45.2";var mS,pS,se={startActiveSpan(t,e){return mS?(pS||(pS=mS.trace.getTracer("drizzle-orm",qA)),Qu((r,i)=>i.startActiveSpan(t,n=>{try{return e(n)}catch(o){throw n.setStatus({code:r.SpanStatusCode.ERROR,message:o instanceof Error?o.message:"Unknown error"}),o}finally{n.end()}}),mS,pS)):e()}};var le=Symbol.for("drizzle:ViewBaseConfig");var an=Symbol.for("drizzle:Schema"),Ju=Symbol.for("drizzle:Columns"),FA=Symbol.for("drizzle:ExtraConfigColumns"),hS=Symbol.for("drizzle:OriginalName"),gS=Symbol.for("drizzle:BaseName"),As=Symbol.for("drizzle:IsAlias"),BA=Symbol.for("drizzle:ExtraConfigBuilder"),wG=Symbol.for("drizzle:IsDrizzleTable"),D=class{static[g]="Table";static Symbol={Name:It,Schema:an,OriginalName:hS,Columns:Ju,ExtraConfigColumns:FA,BaseName:gS,IsAlias:As,ExtraConfigBuilder:BA};[It];[hS];[an];[Ju];[FA];[gS];[As]=!1;[wG]=!0;[BA]=void 0;constructor(e,r,i){this[It]=this[hS]=e,this[an]=r,this[gS]=i}};function He(t){return t[It]}function ln(t){return`${t[an]??"public"}.${t[It]}`}var ZA=class{static[g]="FakePrimitiveParam"};function yS(t){return t!=null&&typeof t.getSQL=="function"}function SG(t){let e={sql:"",params:[]};for(let r of t)e.sql+=r.sql,e.params.push(...r.params),r.typings?.length&&(e.typings||(e.typings=[]),e.typings.push(...r.typings));return e}var _e=class{static[g]="StringChunk";value;constructor(e){this.value=Array.isArray(e)?e:[e]}getSQL(){return new j([this])}},j=class t{constructor(e){this.queryChunks=e;for(let r of e)if($(r,D)){let i=r[D.Symbol.Schema];this.usedTables.push(i===void 0?r[D.Symbol.Name]:i+"."+r[D.Symbol.Name])}}static[g]="SQL";decoder=VA;shouldInlineParams=!1;usedTables=[];append(e){return this.queryChunks.push(...e.queryChunks),this}toQuery(e){return se.startActiveSpan("drizzle.buildSQL",r=>{let i=this.buildQueryFromSourceParams(this.queryChunks,e);return r?.setAttributes({"drizzle.query.text":i.sql,"drizzle.query.params":JSON.stringify(i.params)}),i})}buildQueryFromSourceParams(e,r){let i=Object.assign({},r,{inlineParams:r.inlineParams||this.shouldInlineParams,paramStartIndex:r.paramStartIndex||{value:0}}),{casing:n,escapeName:o,escapeParam:s,prepareTyping:a,inlineParams:l,paramStartIndex:c}=i;return SG(e.map(u=>{if($(u,_e))return{sql:u.value.join(""),params:[]};if($(u,Rs))return{sql:o(u.value),params:[]};if(u===void 0)return{sql:"",params:[]};if(Array.isArray(u)){let d=[new _e("(")];for(let[f,m]of u.entries())d.push(m),f<u.length-1&&d.push(new _e(", "));return d.push(new _e(")")),this.buildQueryFromSourceParams(d,i)}if($(u,t))return this.buildQueryFromSourceParams(u.queryChunks,{...i,inlineParams:l||u.shouldInlineParams});if($(u,D)){let d=u[D.Symbol.Schema],f=u[D.Symbol.Name];return{sql:d===void 0||u[As]?o(f):o(d)+"."+o(f),params:[]}}if($(u,re)){let d=n.getColumnCasing(u);if(r.invokeSource==="indexes")return{sql:o(d),params:[]};let f=u.table[D.Symbol.Schema];return{sql:u.table[As]||f===void 0?o(u.table[D.Symbol.Name])+"."+o(d):o(f)+"."+o(u.table[D.Symbol.Name])+"."+o(d),params:[]}}if($(u,Be)){let d=u[le].schema,f=u[le].name;return{sql:d===void 0||u[le].isAlias?o(f):o(d)+"."+o(f),params:[]}}if($(u,Ye)){if($(u.value,Wt))return{sql:s(c.value++,u),params:[u],typings:["none"]};let d=u.value===null?null:u.encoder.mapToDriverValue(u.value);if($(d,t))return this.buildQueryFromSourceParams([d],i);if(l)return{sql:this.mapInlineParam(d,i),params:[]};let f=["none"];return a&&(f=[a(u.encoder)]),{sql:s(c.value++,d),params:[d],typings:f}}return $(u,Wt)?{sql:s(c.value++,u),params:[u],typings:["none"]}:$(u,t.Aliased)&&u.fieldAlias!==void 0?{sql:o(u.fieldAlias),params:[]}:$(u,ce)?u._.isWith?{sql:o(u._.alias),params:[]}:this.buildQueryFromSourceParams([new _e("("),u._.sql,new _e(") "),new Rs(u._.alias)],i):MA(u)?u.schema?{sql:o(u.schema)+"."+o(u.enumName),params:[]}:{sql:o(u.enumName),params:[]}:yS(u)?u.shouldOmitSQLParens?.()?this.buildQueryFromSourceParams([u.getSQL()],i):this.buildQueryFromSourceParams([new _e("("),u.getSQL(),new _e(")")],i):l?{sql:this.mapInlineParam(u,i),params:[]}:{sql:s(c.value++,u),params:[u],typings:["none"]}}))}mapInlineParam(e,{escapeString:r}){if(e===null)return"null";if(typeof e=="number"||typeof e=="boolean")return e.toString();if(typeof e=="string")return r(e);if(typeof e=="object"){let i=e.toString();return r(i==="[object Object]"?JSON.stringify(e):i)}throw new Error("Unexpected param value: "+e)}getSQL(){return this}as(e){return e===void 0?this:new t.Aliased(this,e)}mapWith(e){return this.decoder=typeof e=="function"?{mapFromDriverValue:e}:e,this}inlineParams(){return this.shouldInlineParams=!0,this}if(e){return e?this:void 0}},Rs=class{constructor(e){this.value=e}static[g]="Name";brand;getSQL(){return new j([this])}};function KA(t){return typeof t=="object"&&t!==null&&"mapToDriverValue"in t&&typeof t.mapToDriverValue=="function"}var VA={mapFromDriverValue:t=>t},GA={mapToDriverValue:t=>t},Vse={...VA,...GA},Ye=class{constructor(e,r=GA){this.value=e,this.encoder=r}static[g]="Param";brand;getSQL(){return new j([this])}};function v(t,...e){let r=[];(e.length>0||t.length>0&&t[0]!=="")&&r.push(new _e(t[0]));for(let[i,n]of e.entries())r.push(n,new _e(t[i+1]));return new j(r)}(t=>{function e(){return new j([])}t.empty=e;function r(l){return new j(l)}t.fromList=r;function i(l){return new j([new _e(l)])}t.raw=i;function n(l,c){let u=[];for(let[d,f]of l.entries())d>0&&c!==void 0&&u.push(c),u.push(f);return new j(u)}t.join=n;function o(l){return new Rs(l)}t.identifier=o;function s(l){return new Wt(l)}t.placeholder=s;function a(l,c){return new Ye(l,c)}t.param=a})(v||(v={}));(t=>{class e{constructor(i,n){this.sql=i,this.fieldAlias=n}static[g]="SQL.Aliased";isSelectionField=!1;getSQL(){return this.sql}clone(){return new e(this.sql,this.fieldAlias)}}t.Aliased=e})(j||(j={}));var Wt=class{constructor(e){this.name=e}static[g]="Placeholder";getSQL(){return new j([this])}};function vS(t,e){return t.map(r=>{if($(r,Wt)){if(!(r.name in e))throw new Error(`No value for placeholder "${r.name}" was provided`);return e[r.name]}if($(r,Ye)&&$(r.value,Wt)){if(!(r.value.name in e))throw new Error(`No value for placeholder "${r.value.name}" was provided`);return r.encoder.mapToDriverValue(e[r.value.name])}return r})}var xG=Symbol.for("drizzle:IsDrizzleView"),Be=class{static[g]="View";[le];[xG]=!0;constructor({name:e,schema:r,selectedFields:i,query:n}){this[le]={name:e,originalName:e,schema:r,selectedFields:i,query:n,isExisting:!n,isAlias:!1}}getSQL(){return new j([this])}};re.prototype.getSQL=function(){return new j([this])};D.prototype.getSQL=function(){return new j([this])};ce.prototype.getSQL=function(){return new j([this])};var cn=class{constructor(e){this.table=e}static[g]="ColumnAliasProxyHandler";get(e,r){return r==="table"?this.table:e[r]}},Ci=class{constructor(e,r){this.alias=e,this.replaceOriginalName=r}static[g]="TableAliasProxyHandler";get(e,r){if(r===D.Symbol.IsAlias)return!0;if(r===D.Symbol.Name)return this.alias;if(this.replaceOriginalName&&r===D.Symbol.OriginalName)return this.alias;if(r===le)return{...e[le],name:this.alias,isAlias:!0};if(r===D.Symbol.Columns){let n=e[D.Symbol.Columns];if(!n)return n;let o={};return Object.keys(n).map(s=>{o[s]=new Proxy(n[s],new cn(new Proxy(e,this)))}),o}let i=e[r];return $(i,re)?new Proxy(i,new cn(new Proxy(e,this))):i}},QA=class{constructor(e){this.alias=e}static[g]="RelationTableAliasProxyHandler";get(e,r){return r==="sourceTable"?Ds(e.sourceTable,this.alias):e[r]}};function Ds(t,e){return new Proxy(t,new Ci(e,!1))}function jt(t,e){return new Proxy(t,new cn(new Proxy(t.table,new Ci(e,!1))))}function bS(t,e){return new j.Aliased(Ls(t.sql,e),t.fieldAlias)}function Ls(t,e){return v.join(t.queryChunks.map(r=>$(r,re)?jt(r,e):$(r,j)?Ls(r,e):$(r,j.Aliased)?bS(r,e):r))}function JA(t,e,r){let i={},n=t.reduce((o,{path:s,field:a},l)=>{let c;$(a,re)?c=a:$(a,j)?c=a.decoder:$(a,ce)?c=a._.sql.decoder:c=a.sql.decoder;let u=o;for(let[d,f]of s.entries())if(d<s.length-1)f in u||(u[f]={}),u=u[f];else{let m=e[l],y=u[f]=m===null?null:c.mapFromDriverValue(m);if(r&&$(a,re)&&s.length===2){let h=s[0];h in i?typeof i[h]=="string"&&i[h]!==He(a.table)&&(i[h]=!1):i[h]=y===null?He(a.table):!1}}return o},{});if(r&&Object.keys(i).length>0)for(let[o,s]of Object.entries(i))typeof s=="string"&&!r[s]&&(n[o]=null);return n}function vt(t,e){return Object.entries(t).reduce((r,[i,n])=>{if(typeof i!="string")return r;let o=e?[...e,i]:[i];return $(n,re)||$(n,j)||$(n,j.Aliased)||$(n,ce)?r.push({path:o,field:n}):$(n,D)?r.push(...vt(n[D.Symbol.Columns],o)):r.push(...vt(n,o)),r},[])}function zs(t,e){let r=Object.keys(t),i=Object.keys(e);if(r.length!==i.length)return!1;for(let[n,o]of r.entries())if(o!==i[n])return!1;return!0}function Wu(t,e){let r=Object.entries(e).filter(([,i])=>i!==void 0).map(([i,n])=>$(n,j)||$(n,re)?[i,n]:[i,new Ye(n,t[D.Symbol.Columns][i])]);if(r.length===0)throw new Error("No values to set");return Object.fromEntries(r)}function WA(t,e){for(let r of e)for(let i of Object.getOwnPropertyNames(r.prototype))i!=="constructor"&&Object.defineProperty(t.prototype,i,Object.getOwnPropertyDescriptor(r.prototype,i)||Object.create(null))}function HA(t){return t[D.Symbol.Columns]}function Ht(t){return $(t,ce)?t._.alias:$(t,Be)?t[le].name:$(t,j)?void 0:t[D.Symbol.IsAlias]?t[D.Symbol.Name]:t[D.Symbol.BaseName]}function J(t,e){return{name:typeof t=="string"&&t.length>0?t:"",config:typeof t=="object"?t:e}}function YA(t){if(typeof t!="object"||t===null||t.constructor.name!=="Object")return!1;if("logger"in t){let e=typeof t.logger;return!(e!=="boolean"&&(e!=="object"||typeof t.logger.logQuery!="function")&&e!=="undefined")}if("schema"in t){let e=typeof t.schema;return!(e!=="object"&&e!=="undefined")}if("casing"in t){let e=typeof t.casing;return!(e!=="string"&&e!=="undefined")}if("mode"in t)return!(t.mode!=="default"||t.mode!=="planetscale"||t.mode!==void 0);if("connection"in t){let e=typeof t.connection;return!(e!=="string"&&e!=="object"&&e!=="undefined")}if("client"in t){let e=typeof t.client;return!(e!=="object"&&e!=="function"&&e!=="undefined")}return Object.keys(t).length===0}var sae=typeof TextDecoder>"u"?null:new TextDecoder;var Yt=class extends M{static[g]="PgIntColumnBaseBuilder";generatedAlwaysAsIdentity(e){if(e){let{name:r,...i}=e;this.config.generatedIdentity={type:"always",sequenceName:r,sequenceOptions:i}}else this.config.generatedIdentity={type:"always"};return this.config.hasDefault=!0,this.config.notNull=!0,this}generatedByDefaultAsIdentity(e){if(e){let{name:r,...i}=e;this.config.generatedIdentity={type:"byDefault",sequenceName:r,sequenceOptions:i}}else this.config.generatedIdentity={type:"byDefault"};return this.config.hasDefault=!0,this.config.notNull=!0,this}};var wS=class extends Yt{static[g]="PgBigInt53Builder";constructor(e){super(e,"number","PgBigInt53")}build(e){return new SS(e,this.config)}},SS=class extends A{static[g]="PgBigInt53";getSQLType(){return"bigint"}mapFromDriverValue(e){return typeof e=="number"?e:Number(e)}},xS=class extends Yt{static[g]="PgBigInt64Builder";constructor(e){super(e,"bigint","PgBigInt64")}build(e){return new _S(e,this.config)}},_S=class extends A{static[g]="PgBigInt64";getSQLType(){return"bigint"}mapFromDriverValue(e){return BigInt(e)}};function ve(t,e){let{name:r,config:i}=J(t,e);return i.mode==="number"?new wS(r):new xS(r)}var $S=class extends M{static[g]="PgBigSerial53Builder";constructor(e){super(e,"number","PgBigSerial53"),this.config.hasDefault=!0,this.config.notNull=!0}build(e){return new kS(e,this.config)}},kS=class extends A{static[g]="PgBigSerial53";getSQLType(){return"bigserial"}mapFromDriverValue(e){return typeof e=="number"?e:Number(e)}},TS=class extends M{static[g]="PgBigSerial64Builder";constructor(e){super(e,"bigint","PgBigSerial64"),this.config.hasDefault=!0}build(e){return new ES(e,this.config)}},ES=class extends A{static[g]="PgBigSerial64";getSQLType(){return"bigserial"}mapFromDriverValue(e){return BigInt(e)}};function XA(t,e){let{name:r,config:i}=J(t,e);return i.mode==="number"?new $S(r):new TS(r)}var IS=class extends M{static[g]="PgBooleanBuilder";constructor(e){super(e,"boolean","PgBoolean")}build(e){return new CS(e,this.config)}},CS=class extends A{static[g]="PgBoolean";getSQLType(){return"boolean"}};function Pi(t){return new IS(t??"")}var PS=class extends M{static[g]="PgCharBuilder";constructor(e,r){super(e,"string","PgChar"),this.config.length=r.length,this.config.enumValues=r.enum}build(e){return new NS(e,this.config)}},NS=class extends A{static[g]="PgChar";length=this.config.length;enumValues=this.config.enumValues;getSQLType(){return this.length===void 0?"char":`char(${this.length})`}};function eR(t,e={}){let{name:r,config:i}=J(t,e);return new PS(r,i)}var OS=class extends M{static[g]="PgCidrBuilder";constructor(e){super(e,"string","PgCidr")}build(e){return new AS(e,this.config)}},AS=class extends A{static[g]="PgCidr";getSQLType(){return"cidr"}};function tR(t){return new OS(t??"")}var RS=class extends M{static[g]="PgCustomColumnBuilder";constructor(e,r,i){super(e,"custom","PgCustomColumn"),this.config.fieldConfig=r,this.config.customTypeParams=i}build(e){return new DS(e,this.config)}},DS=class extends A{static[g]="PgCustomColumn";sqlName;mapTo;mapFrom;constructor(e,r){super(e,r),this.sqlName=r.customTypeParams.dataType(r.fieldConfig),this.mapTo=r.customTypeParams.toDriver,this.mapFrom=r.customTypeParams.fromDriver}getSQLType(){return this.sqlName}mapFromDriverValue(e){return typeof this.mapFrom=="function"?this.mapFrom(e):e}mapToDriverValue(e){return typeof this.mapTo=="function"?this.mapTo(e):e}};function rR(t){return(e,r)=>{let{name:i,config:n}=J(e,r);return new RS(i,n,t)}}var Ut=class extends M{static[g]="PgDateColumnBaseBuilder";defaultNow(){return this.default(v`now()`)}};var LS=class extends Ut{static[g]="PgDateBuilder";constructor(e){super(e,"date","PgDate")}build(e){return new js(e,this.config)}},js=class extends A{static[g]="PgDate";getSQLType(){return"date"}mapFromDriverValue(e){return typeof e=="string"?new Date(e):e}mapToDriverValue(e){return e.toISOString()}},zS=class extends Ut{static[g]="PgDateStringBuilder";constructor(e){super(e,"string","PgDateString")}build(e){return new Us(e,this.config)}},Us=class extends A{static[g]="PgDateString";getSQLType(){return"date"}mapFromDriverValue(e){return typeof e=="string"?e:e.toISOString().slice(0,-14)}};function nR(t,e){let{name:r,config:i}=J(t,e);return i?.mode==="date"?new LS(r):new zS(r)}var jS=class extends M{static[g]="PgDoublePrecisionBuilder";constructor(e){super(e,"number","PgDoublePrecision")}build(e){return new US(e,this.config)}},US=class extends A{static[g]="PgDoublePrecision";getSQLType(){return"double precision"}mapFromDriverValue(e){return typeof e=="string"?Number.parseFloat(e):e}};function Mt(t){return new jS(t??"")}var MS=class extends M{static[g]="PgInetBuilder";constructor(e){super(e,"string","PgInet")}build(e){return new qS(e,this.config)}},qS=class extends A{static[g]="PgInet";getSQLType(){return"inet"}};function iR(t){return new MS(t??"")}var FS=class extends Yt{static[g]="PgIntegerBuilder";constructor(e){super(e,"number","PgInteger")}build(e){return new BS(e,this.config)}},BS=class extends A{static[g]="PgInteger";getSQLType(){return"integer"}mapFromDriverValue(e){return typeof e=="string"?Number.parseInt(e):e}};function Z(t){return new FS(t??"")}var ZS=class extends M{static[g]="PgIntervalBuilder";constructor(e,r){super(e,"string","PgInterval"),this.config.intervalConfig=r}build(e){return new KS(e,this.config)}},KS=class extends A{static[g]="PgInterval";fields=this.config.intervalConfig.fields;precision=this.config.intervalConfig.precision;getSQLType(){let e=this.fields?` ${this.fields}`:"",r=this.precision?`(${this.precision})`:"";return`interval${e}${r}`}};function oR(t,e={}){let{name:r,config:i}=J(t,e);return new ZS(r,i)}var VS=class extends M{static[g]="PgJsonBuilder";constructor(e){super(e,"json","PgJson")}build(e){return new Ms(e,this.config)}},Ms=class extends A{static[g]="PgJson";constructor(e,r){super(e,r)}getSQLType(){return"json"}mapToDriverValue(e){return JSON.stringify(e)}mapFromDriverValue(e){if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e}};function sR(t){return new VS(t??"")}var GS=class extends M{static[g]="PgJsonbBuilder";constructor(e){super(e,"json","PgJsonb")}build(e){return new qs(e,this.config)}},qs=class extends A{static[g]="PgJsonb";constructor(e,r){super(e,r)}getSQLType(){return"jsonb"}mapToDriverValue(e){return JSON.stringify(e)}mapFromDriverValue(e){if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e}};function Ni(t){return new GS(t??"")}var QS=class extends M{static[g]="PgLineBuilder";constructor(e){super(e,"array","PgLine")}build(e){return new JS(e,this.config)}},JS=class extends A{static[g]="PgLine";getSQLType(){return"line"}mapFromDriverValue(e){let[r,i,n]=e.slice(1,-1).split(",");return[Number.parseFloat(r),Number.parseFloat(i),Number.parseFloat(n)]}mapToDriverValue(e){return`{${e[0]},${e[1]},${e[2]}}`}},WS=class extends M{static[g]="PgLineABCBuilder";constructor(e){super(e,"json","PgLineABC")}build(e){return new HS(e,this.config)}},HS=class extends A{static[g]="PgLineABC";getSQLType(){return"line"}mapFromDriverValue(e){let[r,i,n]=e.slice(1,-1).split(",");return{a:Number.parseFloat(r),b:Number.parseFloat(i),c:Number.parseFloat(n)}}mapToDriverValue(e){return`{${e.a},${e.b},${e.c}}`}};function aR(t,e){let{name:r,config:i}=J(t,e);return!i?.mode||i.mode==="tuple"?new QS(r):new WS(r)}var YS=class extends M{static[g]="PgMacaddrBuilder";constructor(e){super(e,"string","PgMacaddr")}build(e){return new XS(e,this.config)}},XS=class extends A{static[g]="PgMacaddr";getSQLType(){return"macaddr"}};function lR(t){return new YS(t??"")}var ex=class extends M{static[g]="PgMacaddr8Builder";constructor(e){super(e,"string","PgMacaddr8")}build(e){return new tx(e,this.config)}},tx=class extends A{static[g]="PgMacaddr8";getSQLType(){return"macaddr8"}};function cR(t){return new ex(t??"")}var rx=class extends M{static[g]="PgNumericBuilder";constructor(e,r,i){super(e,"string","PgNumeric"),this.config.precision=r,this.config.scale=i}build(e){return new Fs(e,this.config)}},Fs=class extends A{static[g]="PgNumeric";precision;scale;constructor(e,r){super(e,r),this.precision=r.precision,this.scale=r.scale}mapFromDriverValue(e){return typeof e=="string"?e:String(e)}getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?"numeric":`numeric(${this.precision})`}},nx=class extends M{static[g]="PgNumericNumberBuilder";constructor(e,r,i){super(e,"number","PgNumericNumber"),this.config.precision=r,this.config.scale=i}build(e){return new ix(e,this.config)}},ix=class extends A{static[g]="PgNumericNumber";precision;scale;constructor(e,r){super(e,r),this.precision=r.precision,this.scale=r.scale}mapFromDriverValue(e){return typeof e=="number"?e:Number(e)}mapToDriverValue=String;getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?"numeric":`numeric(${this.precision})`}},ox=class extends M{static[g]="PgNumericBigIntBuilder";constructor(e,r,i){super(e,"bigint","PgNumericBigInt"),this.config.precision=r,this.config.scale=i}build(e){return new sx(e,this.config)}},sx=class extends A{static[g]="PgNumericBigInt";precision;scale;constructor(e,r){super(e,r),this.precision=r.precision,this.scale=r.scale}mapFromDriverValue=BigInt;mapToDriverValue=String;getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?"numeric":`numeric(${this.precision})`}};function uR(t,e){let{name:r,config:i}=J(t,e),n=i?.mode;return n==="number"?new nx(r,i?.precision,i?.scale):n==="bigint"?new ox(r,i?.precision,i?.scale):new rx(r,i?.precision,i?.scale)}var ax=class extends M{static[g]="PgPointTupleBuilder";constructor(e){super(e,"array","PgPointTuple")}build(e){return new lx(e,this.config)}},lx=class extends A{static[g]="PgPointTuple";getSQLType(){return"point"}mapFromDriverValue(e){if(typeof e=="string"){let[r,i]=e.slice(1,-1).split(",");return[Number.parseFloat(r),Number.parseFloat(i)]}return[e.x,e.y]}mapToDriverValue(e){return`(${e[0]},${e[1]})`}},cx=class extends M{static[g]="PgPointObjectBuilder";constructor(e){super(e,"json","PgPointObject")}build(e){return new ux(e,this.config)}},ux=class extends A{static[g]="PgPointObject";getSQLType(){return"point"}mapFromDriverValue(e){if(typeof e=="string"){let[r,i]=e.slice(1,-1).split(",");return{x:Number.parseFloat(r),y:Number.parseFloat(i)}}return e}mapToDriverValue(e){return`(${e.x},${e.y})`}};function dR(t,e){let{name:r,config:i}=J(t,e);return!i?.mode||i.mode==="tuple"?new ax(r):new cx(r)}function _G(t){let e=[];for(let r=0;r<t.length;r+=2)e.push(Number.parseInt(t.slice(r,r+2),16));return new Uint8Array(e)}function fR(t,e){let r=new ArrayBuffer(8),i=new DataView(r);for(let n=0;n<8;n++)i.setUint8(n,t[e+n]);return i.getFloat64(0,!0)}function dx(t){let e=_G(t),r=0,i=e[r];r+=1;let n=new DataView(e.buffer),o=n.getUint32(r,i===1);r+=4;let s;if(o&536870912&&(s=n.getUint32(r,i===1),r+=4),(o&65535)===1){let a=fR(e,r);r+=8;let l=fR(e,r);return r+=8,[a,l]}throw new Error("Unsupported geometry type")}var fx=class extends M{static[g]="PgGeometryBuilder";constructor(e){super(e,"array","PgGeometry")}build(e){return new mx(e,this.config)}},mx=class extends A{static[g]="PgGeometry";getSQLType(){return"geometry(point)"}mapFromDriverValue(e){return dx(e)}mapToDriverValue(e){return`point(${e[0]} ${e[1]})`}},px=class extends M{static[g]="PgGeometryObjectBuilder";constructor(e){super(e,"json","PgGeometryObject")}build(e){return new hx(e,this.config)}},hx=class extends A{static[g]="PgGeometryObject";getSQLType(){return"geometry(point)"}mapFromDriverValue(e){let r=dx(e);return{x:r[0],y:r[1]}}mapToDriverValue(e){return`point(${e.x} ${e.y})`}};function mR(t,e){let{name:r,config:i}=J(t,e);return!i?.mode||i.mode==="tuple"?new fx(r):new px(r)}var gx=class extends M{static[g]="PgRealBuilder";constructor(e,r){super(e,"number","PgReal"),this.config.length=r}build(e){return new yx(e,this.config)}},yx=class extends A{static[g]="PgReal";constructor(e,r){super(e,r)}getSQLType(){return"real"}mapFromDriverValue=e=>typeof e=="string"?Number.parseFloat(e):e};function pR(t){return new gx(t??"")}var vx=class extends M{static[g]="PgSerialBuilder";constructor(e){super(e,"number","PgSerial"),this.config.hasDefault=!0,this.config.notNull=!0}build(e){return new bx(e,this.config)}},bx=class extends A{static[g]="PgSerial";getSQLType(){return"serial"}};function hR(t){return new vx(t??"")}var wx=class extends Yt{static[g]="PgSmallIntBuilder";constructor(e){super(e,"number","PgSmallInt")}build(e){return new Sx(e,this.config)}},Sx=class extends A{static[g]="PgSmallInt";getSQLType(){return"smallint"}mapFromDriverValue=e=>typeof e=="string"?Number(e):e};function Hu(t){return new wx(t??"")}var xx=class extends M{static[g]="PgSmallSerialBuilder";constructor(e){super(e,"number","PgSmallSerial"),this.config.hasDefault=!0,this.config.notNull=!0}build(e){return new _x(e,this.config)}},_x=class extends A{static[g]="PgSmallSerial";getSQLType(){return"smallserial"}};function gR(t){return new xx(t??"")}var $x=class extends M{static[g]="PgTextBuilder";constructor(e,r){super(e,"string","PgText"),this.config.enumValues=r.enum}build(e){return new kx(e,this.config)}},kx=class extends A{static[g]="PgText";enumValues=this.config.enumValues;getSQLType(){return"text"}};function q(t,e={}){let{name:r,config:i}=J(t,e);return new $x(r,i)}var Tx=class extends Ut{constructor(e,r,i){super(e,"string","PgTime"),this.withTimezone=r,this.precision=i,this.config.withTimezone=r,this.config.precision=i}static[g]="PgTimeBuilder";build(e){return new Bs(e,this.config)}},Bs=class extends A{static[g]="PgTime";withTimezone;precision;constructor(e,r){super(e,r),this.withTimezone=r.withTimezone,this.precision=r.precision}getSQLType(){return`time${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}};function yR(t,e={}){let{name:r,config:i}=J(t,e);return new Tx(r,i.withTimezone??!1,i.precision)}var Ex=class extends Ut{static[g]="PgTimestampBuilder";constructor(e,r,i){super(e,"date","PgTimestamp"),this.config.withTimezone=r,this.config.precision=i}build(e){return new Zs(e,this.config)}},Zs=class extends A{static[g]="PgTimestamp";withTimezone;precision;constructor(e,r){super(e,r),this.withTimezone=r.withTimezone,this.precision=r.precision}getSQLType(){return`timestamp${this.precision===void 0?"":` (${this.precision})`}${this.withTimezone?" with time zone":""}`}mapFromDriverValue(e){return typeof e=="string"?new Date(this.withTimezone?e:e+"+0000"):e}mapToDriverValue=e=>e.toISOString()},Ix=class extends Ut{static[g]="PgTimestampStringBuilder";constructor(e,r,i){super(e,"string","PgTimestampString"),this.config.withTimezone=r,this.config.precision=i}build(e){return new Ks(e,this.config)}},Ks=class extends A{static[g]="PgTimestampString";withTimezone;precision;constructor(e,r){super(e,r),this.withTimezone=r.withTimezone,this.precision=r.precision}getSQLType(){return`timestamp${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}mapFromDriverValue(e){if(typeof e=="string")return e;let r=e.toISOString().slice(0,-1).replace("T"," ");if(this.withTimezone){let i=e.getTimezoneOffset(),n=i<=0?"+":"-";return`${r}${n}${Math.floor(Math.abs(i)/60).toString().padStart(2,"0")}`}return r}};function we(t,e={}){let{name:r,config:i}=J(t,e);return i?.mode==="string"?new Ix(r,i.withTimezone??!1,i.precision):new Ex(r,i?.withTimezone??!1,i?.precision)}var Cx=class extends M{static[g]="PgUUIDBuilder";constructor(e){super(e,"string","PgUUID")}defaultRandom(){return this.default(v`gen_random_uuid()`)}build(e){return new Vs(e,this.config)}},Vs=class extends A{static[g]="PgUUID";getSQLType(){return"uuid"}};function vR(t){return new Cx(t??"")}var Px=class extends M{static[g]="PgVarcharBuilder";constructor(e,r){super(e,"string","PgVarchar"),this.config.length=r.length,this.config.enumValues=r.enum}build(e){return new Nx(e,this.config)}},Nx=class extends A{static[g]="PgVarchar";length=this.config.length;enumValues=this.config.enumValues;getSQLType(){return this.length===void 0?"varchar":`varchar(${this.length})`}};function bR(t,e={}){let{name:r,config:i}=J(t,e);return new Px(r,i)}var Ox=class extends M{static[g]="PgBinaryVectorBuilder";constructor(e,r){super(e,"string","PgBinaryVector"),this.config.dimensions=r.dimensions}build(e){return new Ax(e,this.config)}},Ax=class extends A{static[g]="PgBinaryVector";dimensions=this.config.dimensions;getSQLType(){return`bit(${this.dimensions})`}};function wR(t,e){let{name:r,config:i}=J(t,e);return new Ox(r,i)}var Rx=class extends M{static[g]="PgHalfVectorBuilder";constructor(e,r){super(e,"array","PgHalfVector"),this.config.dimensions=r.dimensions}build(e){return new Dx(e,this.config)}},Dx=class extends A{static[g]="PgHalfVector";dimensions=this.config.dimensions;getSQLType(){return`halfvec(${this.dimensions})`}mapToDriverValue(e){return JSON.stringify(e)}mapFromDriverValue(e){return e.slice(1,-1).split(",").map(r=>Number.parseFloat(r))}};function SR(t,e){let{name:r,config:i}=J(t,e);return new Rx(r,i)}var Lx=class extends M{static[g]="PgSparseVectorBuilder";constructor(e,r){super(e,"string","PgSparseVector"),this.config.dimensions=r.dimensions}build(e){return new zx(e,this.config)}},zx=class extends A{static[g]="PgSparseVector";dimensions=this.config.dimensions;getSQLType(){return`sparsevec(${this.dimensions})`}};function xR(t,e){let{name:r,config:i}=J(t,e);return new Lx(r,i)}var jx=class extends M{static[g]="PgVectorBuilder";constructor(e,r){super(e,"array","PgVector"),this.config.dimensions=r.dimensions}build(e){return new Ux(e,this.config)}},Ux=class extends A{static[g]="PgVector";dimensions=this.config.dimensions;getSQLType(){return`vector(${this.dimensions})`}mapToDriverValue(e){return JSON.stringify(e)}mapFromDriverValue(e){return e.slice(1,-1).split(",").map(r=>Number.parseFloat(r))}};function _R(t,e){let{name:r,config:i}=J(t,e);return new jx(r,i)}var Le=class{static[g]="QueryPromise";[Symbol.toStringTag]="QueryPromise";catch(e){return this.then(void 0,e)}finally(e){return this.then(r=>(e?.(),r),r=>{throw e?.(),r})}then(e,r){return this.execute().then(e,r)}};var be=class t{static[g]="SelectionProxyHandler";config;constructor(e){this.config={...e}}get(e,r){if(r==="_")return{...e._,selectedFields:new Proxy(e._.selectedFields,this)};if(r===le)return{...e[le],selectedFields:new Proxy(e[le].selectedFields,this)};if(typeof r=="symbol")return e[r];let n=($(e,ce)?e._.selectedFields:$(e,Be)?e[le].selectedFields:e)[r];if($(n,j.Aliased)){if(this.config.sqlAliasedBehavior==="sql"&&!n.isSelectionField)return n.sql;let o=n.clone();return o.isSelectionField=!0,o}if($(n,j)){if(this.config.sqlBehavior==="sql")return n;throw new Error(`You tried to reference "${r}" field from a subquery, which is a raw SQL field, but it doesn't have an alias declared. Please add an alias to the field using ".as('alias')" method.`)}return $(n,re)?this.config.alias?new Proxy(n,new cn(new Proxy(n.table,new Ci(this.config.alias,this.config.replaceOriginalName??!1)))):n:typeof n!="object"||n===null?n:new Proxy(n,new t(this.config))}};function $R(){return{bigint:ve,bigserial:XA,boolean:Pi,char:eR,cidr:tR,customType:rR,date:nR,doublePrecision:Mt,inet:iR,integer:Z,interval:oR,json:sR,jsonb:Ni,line:aR,macaddr:lR,macaddr8:cR,numeric:uR,point:dR,geometry:mR,real:pR,serial:hR,smallint:Hu,smallserial:gR,text:q,time:yR,timestamp:we,uuid:vR,varchar:bR,bit:wR,halfvec:SR,sparsevec:xR,vector:_R}}var Mx=Symbol.for("drizzle:PgInlineForeignKeys"),kR=Symbol.for("drizzle:EnableRLS"),$e=class extends D{static[g]="PgTable";static Symbol=Object.assign({},D.Symbol,{InlineForeignKeys:Mx,EnableRLS:kR});[Mx]=[];[kR]=!1;[D.Symbol.ExtraConfigBuilder]=void 0;[D.Symbol.ExtraConfigColumns]={}};function $G(t,e,r,i,n=t){let o=new $e(t,i,n),s=typeof e=="function"?e($R()):e,a=Object.fromEntries(Object.entries(s).map(([u,d])=>{let f=d;f.setName(u);let m=f.build(o);return o[Mx].push(...f.buildForeignKeys(m,o)),[u,m]})),l=Object.fromEntries(Object.entries(s).map(([u,d])=>{let f=d;f.setName(u);let m=f.buildExtraConfigColumn(o);return[u,m]})),c=Object.assign(o,a);return c[D.Symbol.Columns]=a,c[D.Symbol.ExtraConfigColumns]=l,r&&(c[$e.Symbol.ExtraConfigBuilder]=r),Object.assign(c,{enableRLS:()=>(c[$e.Symbol.EnableRLS]=!0,c)})}var W=(t,e,r)=>$G(t,e,r,void 0);var qx=class{constructor(e,r){this.unique=e,this.name=r}static[g]="PgIndexBuilderOn";on(...e){return new Gs(e.map(r=>{if($(r,j))return r;r=r;let i=new Ei(r.name,!!r.keyAsName,r.columnType,r.indexConfig);return r.indexConfig=JSON.parse(JSON.stringify(r.defaultConfig)),i}),this.unique,!1,this.name)}onOnly(...e){return new Gs(e.map(r=>{if($(r,j))return r;r=r;let i=new Ei(r.name,!!r.keyAsName,r.columnType,r.indexConfig);return r.indexConfig=r.defaultConfig,i}),this.unique,!0,this.name)}using(e,...r){return new Gs(r.map(i=>{if($(i,j))return i;i=i;let n=new Ei(i.name,!!i.keyAsName,i.columnType,i.indexConfig);return i.indexConfig=JSON.parse(JSON.stringify(i.defaultConfig)),n}),this.unique,!0,this.name,e)}},Gs=class{static[g]="PgIndexBuilder";config;constructor(e,r,i,n,o="btree"){this.config={name:n,columns:e,unique:r,only:i,method:o}}concurrently(){return this.config.concurrently=!0,this}with(e){return this.config.with=e,this}where(e){return this.config.where=e,this}build(e){return new Fx(this.config,e)}},Fx=class{static[g]="PgIndex";config;constructor(e,r){this.config={...e,table:r}}};function Yu(t){return new qx(!1,t)}function ke(...t){return t[0].columns?new Oi(t[0].columns,t[0].name):new Oi(t)}var Oi=class{static[g]="PgPrimaryKeyBuilder";columns;name;constructor(e,r){this.columns=e,this.name=r}build(e){return new Bx(e,this.columns,this.name)}},Bx=class{constructor(e,r,i){this.table=e,this.columns=r,this.name=i}static[g]="PgPrimaryKey";columns;name;getName(){return this.name??`${this.table[$e.Symbol.Name]}_${this.columns.map(e=>e.name).join("_")}_pk`}};function kG(t){return(t.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).map(r=>r.toLowerCase()).join("_")}function TG(t){return(t.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).reduce((r,i,n)=>{let o=n===0?i.toLowerCase():`${i[0].toUpperCase()}${i.slice(1)}`;return r+o},"")}function EG(t){return t}var Xu=class{static[g]="CasingCache";cache={};cachedTables={};convert;constructor(e){this.convert=e==="snake_case"?kG:e==="camelCase"?TG:EG}getColumnCasing(e){if(!e.keyAsName)return e.name;let r=e.table[D.Symbol.Schema]??"public",i=e.table[D.Symbol.OriginalName],n=`${r}.${i}.${e.name}`;return this.cache[n]||this.cacheTable(e.table),this.cache[n]}cacheTable(e){let r=e[D.Symbol.Schema]??"public",i=e[D.Symbol.OriginalName],n=`${r}.${i}`;if(!this.cachedTables[n]){for(let o of Object.values(e[D.Symbol.Columns])){let s=`${n}.${o.name}`;this.cache[s]=this.convert(o.name)}this.cachedTables[n]=!0}}clearCache(){this.cache={},this.cachedTables={}}};var Qs=class extends Error{static[g]="DrizzleError";constructor({message:e,cause:r}){super(e),this.name="DrizzleError",this.cause=r}},Xt=class t extends Error{constructor(e,r,i){super(`Failed query: ${e}
|
|
339
|
-
params: ${r}`),this.query=e,this.params=r,this.cause=i,Error.captureStackTrace(this,t),i&&(this.cause=i)}},ed=class extends Qs{static[g]="TransactionRollbackError";constructor(){super({message:"Rollback"})}};function Xe(t,e){return KA(e)&&!yS(t)&&!$(t,Ye)&&!$(t,Wt)&&!$(t,re)&&!$(t,D)&&!$(t,Be)?new Ye(t,e):t}var Rr=(t,e)=>v`${t} = ${Xe(e,t)}`,TR=(t,e)=>v`${t} <> ${Xe(e,t)}`;function un(...t){let e=t.filter(r=>r!==void 0);if(e.length!==0)return e.length===1?new j(e):new j([new _e("("),v.join(e,new _e(" and ")),new _e(")")])}function ER(...t){let e=t.filter(r=>r!==void 0);if(e.length!==0)return e.length===1?new j(e):new j([new _e("("),v.join(e,new _e(" or ")),new _e(")")])}function IR(t){return v`not ${t}`}var CR=(t,e)=>v`${t} > ${Xe(e,t)}`,PR=(t,e)=>v`${t} >= ${Xe(e,t)}`,NR=(t,e)=>v`${t} < ${Xe(e,t)}`,OR=(t,e)=>v`${t} <= ${Xe(e,t)}`;function AR(t,e){return Array.isArray(e)?e.length===0?v`false`:v`${t} in ${e.map(r=>Xe(r,t))}`:v`${t} in ${Xe(e,t)}`}function RR(t,e){return Array.isArray(e)?e.length===0?v`true`:v`${t} not in ${e.map(r=>Xe(r,t))}`:v`${t} not in ${Xe(e,t)}`}function DR(t){return v`${t} is null`}function LR(t){return v`${t} is not null`}function zR(t){return v`exists ${t}`}function jR(t){return v`not exists ${t}`}function UR(t,e,r){return v`${t} between ${Xe(e,t)} and ${Xe(r,t)}`}function MR(t,e,r){return v`${t} not between ${Xe(e,t)} and ${Xe(r,t)}`}function qR(t,e){return v`${t} like ${e}`}function FR(t,e){return v`${t} not like ${e}`}function BR(t,e){return v`${t} ilike ${e}`}function ZR(t,e){return v`${t} not ilike ${e}`}function td(t){return v`${t} asc`}function KR(t){return v`${t} desc`}var rd=class{constructor(e,r,i){this.sourceTable=e,this.referencedTable=r,this.relationName=i,this.referencedTableName=r[D.Symbol.Name]}static[g]="Relation";referencedTableName;fieldName},Zx=class{constructor(e,r){this.table=e,this.config=r}static[g]="Relations"},Dr=class t extends rd{constructor(e,r,i,n){super(e,r,i?.relationName),this.config=i,this.isNullable=n}static[g]="One";withFieldName(e){let r=new t(this.sourceTable,this.referencedTable,this.config,this.isNullable);return r.fieldName=e,r}},Js=class t extends rd{constructor(e,r,i){super(e,r,i?.relationName),this.config=i}static[g]="Many";withFieldName(e){let r=new t(this.sourceTable,this.referencedTable,this.config);return r.fieldName=e,r}};function VR(){return{and:un,between:UR,eq:Rr,exists:zR,gt:CR,gte:PR,ilike:BR,inArray:AR,isNull:DR,isNotNull:LR,like:qR,lt:NR,lte:OR,ne:TR,not:IR,notBetween:MR,notExists:jR,notLike:FR,notIlike:ZR,notInArray:RR,or:ER,sql:v}}function GR(){return{sql:v,asc:td,desc:KR}}function QR(t,e){Object.keys(t).length===1&&"default"in t&&!$(t.default,D)&&(t=t.default);let r={},i={},n={};for(let[o,s]of Object.entries(t))if($(s,D)){let a=ln(s),l=i[a];r[a]=o,n[o]={tsName:o,dbName:s[D.Symbol.Name],schema:s[D.Symbol.Schema],columns:s[D.Symbol.Columns],relations:l?.relations??{},primaryKey:l?.primaryKey??[]};for(let u of Object.values(s[D.Symbol.Columns]))u.primary&&n[o].primaryKey.push(u);let c=s[D.Symbol.ExtraConfigBuilder]?.(s[D.Symbol.ExtraConfigColumns]);if(c)for(let u of Object.values(c))$(u,Oi)&&n[o].primaryKey.push(...u.columns)}else if($(s,Zx)){let a=ln(s.table),l=r[a],c=s.config(e(s.table)),u;for(let[d,f]of Object.entries(c))if(l){let m=n[l];m.relations[d]=f,u&&m.primaryKey.push(...u)}else a in i||(i[a]={relations:{},primaryKey:u}),i[a].relations[d]=f}return{tables:n,tableNamesMap:r}}function IG(t){return function(r,i){return new Dr(t,r,i,i?.fields.reduce((n,o)=>n&&o.notNull,!0)??!1)}}function CG(t){return function(r,i){return new Js(t,r,i)}}function JR(t,e,r){if($(r,Dr)&&r.config)return{fields:r.config.fields,references:r.config.references};let i=e[ln(r.referencedTable)];if(!i)throw new Error(`Table "${r.referencedTable[D.Symbol.Name]}" not found in schema`);let n=t[i];if(!n)throw new Error(`Table "${i}" not found in schema`);let o=r.sourceTable,s=e[ln(o)];if(!s)throw new Error(`Table "${o[D.Symbol.Name]}" not found in schema`);let a=[];for(let l of Object.values(n.relations))(r.relationName&&r!==l&&l.relationName===r.relationName||!r.relationName&&l.referencedTable===r.sourceTable)&&a.push(l);if(a.length>1)throw r.relationName?new Error(`There are multiple relations with name "${r.relationName}" in table "${i}"`):new Error(`There are multiple relations between "${i}" and "${r.sourceTable[D.Symbol.Name]}". Please specify relation name`);if(a[0]&&$(a[0],Dr)&&a[0].config)return{fields:a[0].config.references,references:a[0].config.fields};throw new Error(`There is not enough information to infer relation "${s}.${r.fieldName}"`)}function WR(t){return{one:IG(t),many:CG(t)}}function nd(t,e,r,i,n=o=>o){let o={};for(let[s,a]of i.entries())if(a.isJson){let l=e.relations[a.tsKey],c=r[s],u=typeof c=="string"?JSON.parse(c):c;o[a.tsKey]=$(l,Dr)?u&&nd(t,t[a.relationTableTsKey],u,a.selection,n):u.map(d=>nd(t,t[a.relationTableTsKey],d,a.selection,n))}else{let l=n(r[s]),c=a.field,u;$(c,re)?u=c:$(c,j)?u=c.decoder:u=c.sql.decoder,o[a.tsKey]=l===null?null:u.mapFromDriverValue(l)}return o}var Ai=class extends Be{static[g]="PgViewBase"};var Lr=class{static[g]="PgDialect";casing;constructor(e){this.casing=new Xu(e?.casing)}async migrate(e,r,i){let n=typeof i=="string"?"__drizzle_migrations":i.migrationsTable??"__drizzle_migrations",o=typeof i=="string"?"drizzle":i.migrationsSchema??"drizzle",s=v`
|
|
340
|
-
CREATE TABLE IF NOT EXISTS ${v.identifier(o)}.${v.identifier(n)} (
|
|
341
|
-
id SERIAL PRIMARY KEY,
|
|
342
|
-
hash text NOT NULL,
|
|
343
|
-
created_at bigint
|
|
344
|
-
)
|
|
345
|
-
`;await r.execute(v`CREATE SCHEMA IF NOT EXISTS ${v.identifier(o)}`),await r.execute(s);let l=(await r.all(v`select id, hash, created_at from ${v.identifier(o)}.${v.identifier(n)} order by created_at desc limit 1`))[0];await r.transaction(async c=>{for await(let u of e)if(!l||Number(l.created_at)<u.folderMillis){for(let d of u.sql)await c.execute(v.raw(d));await c.execute(v`insert into ${v.identifier(o)}.${v.identifier(n)} ("hash", "created_at") values(${u.hash}, ${u.folderMillis})`)}})}escapeName(e){return`"${e.replace(/"/g,'""')}"`}escapeParam(e){return`$${e+1}`}escapeString(e){return`'${e.replace(/'/g,"''")}'`}buildWithCTE(e){if(!e?.length)return;let r=[v`with `];for(let[i,n]of e.entries())r.push(v`${v.identifier(n._.alias)} as (${n._.sql})`),i<e.length-1&&r.push(v`, `);return r.push(v` `),v.join(r)}buildDeleteQuery({table:e,where:r,returning:i,withList:n}){let o=this.buildWithCTE(n),s=i?v` returning ${this.buildSelection(i,{isSingleTable:!0})}`:void 0,a=r?v` where ${r}`:void 0;return v`${o}delete from ${e}${a}${s}`}buildUpdateSet(e,r){let i=e[D.Symbol.Columns],n=Object.keys(i).filter(s=>r[s]!==void 0||i[s]?.onUpdateFn!==void 0),o=n.length;return v.join(n.flatMap((s,a)=>{let l=i[s],c=l.onUpdateFn?.(),u=r[s]??($(c,j)?c:v.param(c,l)),d=v`${v.identifier(this.casing.getColumnCasing(l))} = ${u}`;return a<o-1?[d,v.raw(", ")]:[d]}))}buildUpdateQuery({table:e,set:r,where:i,returning:n,withList:o,from:s,joins:a}){let l=this.buildWithCTE(o),c=e[$e.Symbol.Name],u=e[$e.Symbol.Schema],d=e[$e.Symbol.OriginalName],f=c===d?void 0:c,m=v`${u?v`${v.identifier(u)}.`:void 0}${v.identifier(d)}${f&&v` ${v.identifier(f)}`}`,y=this.buildUpdateSet(e,r),h=s&&v.join([v.raw(" from "),this.buildFromTable(s)]),w=this.buildJoins(a),_=n?v` returning ${this.buildSelection(n,{isSingleTable:!s})}`:void 0,T=i?v` where ${i}`:void 0;return v`${l}update ${m} set ${y}${h}${w}${T}${_}`}buildSelection(e,{isSingleTable:r=!1}={}){let i=e.length,n=e.flatMap(({field:o},s)=>{let a=[];if($(o,j.Aliased)&&o.isSelectionField)a.push(v.identifier(o.fieldAlias));else if($(o,j.Aliased)||$(o,j)){let l=$(o,j.Aliased)?o.sql:o;r?a.push(new j(l.queryChunks.map(c=>$(c,A)?v.identifier(this.casing.getColumnCasing(c)):c))):a.push(l),$(o,j.Aliased)&&a.push(v` as ${v.identifier(o.fieldAlias)}`)}else if($(o,re))r?a.push(v.identifier(this.casing.getColumnCasing(o))):a.push(o);else if($(o,ce)){let l=Object.entries(o._.selectedFields);if(l.length===1){let c=l[0][1],u=$(c,j)?c.decoder:$(c,re)?{mapFromDriverValue:d=>c.mapFromDriverValue(d)}:c.sql.decoder;u&&(o._.sql.decoder=u)}a.push(o)}return s<i-1&&a.push(v`, `),a});return v.join(n)}buildJoins(e){if(!e||e.length===0)return;let r=[];for(let[i,n]of e.entries()){i===0&&r.push(v` `);let o=n.table,s=n.lateral?v` lateral`:void 0,a=n.on?v` on ${n.on}`:void 0;if($(o,$e)){let l=o[$e.Symbol.Name],c=o[$e.Symbol.Schema],u=o[$e.Symbol.OriginalName],d=l===u?void 0:n.alias;r.push(v`${v.raw(n.joinType)} join${s} ${c?v`${v.identifier(c)}.`:void 0}${v.identifier(u)}${d&&v` ${v.identifier(d)}`}${a}`)}else if($(o,Be)){let l=o[le].name,c=o[le].schema,u=o[le].originalName,d=l===u?void 0:n.alias;r.push(v`${v.raw(n.joinType)} join${s} ${c?v`${v.identifier(c)}.`:void 0}${v.identifier(u)}${d&&v` ${v.identifier(d)}`}${a}`)}else r.push(v`${v.raw(n.joinType)} join${s} ${o}${a}`);i<e.length-1&&r.push(v` `)}return v.join(r)}buildFromTable(e){if($(e,D)&&e[D.Symbol.IsAlias]){let r=v`${v.identifier(e[D.Symbol.OriginalName])}`;return e[D.Symbol.Schema]&&(r=v`${v.identifier(e[D.Symbol.Schema])}.${r}`),v`${r} ${v.identifier(e[D.Symbol.Name])}`}return e}buildSelectQuery({withList:e,fields:r,fieldsFlat:i,where:n,having:o,table:s,joins:a,orderBy:l,groupBy:c,limit:u,offset:d,lockingClause:f,distinct:m,setOperators:y}){let h=i??vt(r);for(let tt of h)if($(tt.field,re)&&He(tt.field.table)!==($(s,ce)?s._.alias:$(s,Ai)?s[le].name:$(s,j)?void 0:He(s))&&!(Ft=>a?.some(({alias:zd})=>zd===(Ft[D.Symbol.IsAlias]?He(Ft):Ft[D.Symbol.BaseName])))(tt.field.table)){let Ft=He(tt.field.table);throw new Error(`Your "${tt.path.join("->")}" field references a column "${Ft}"."${tt.field.name}", but the table "${Ft}" is not part of the query! Did you forget to join it?`)}let w=!a||a.length===0,_=this.buildWithCTE(e),T;m&&(T=m===!0?v` distinct`:v` distinct on (${v.join(m.on,v`, `)})`);let k=this.buildSelection(h,{isSingleTable:w}),E=this.buildFromTable(s),R=this.buildJoins(a),L=n?v` where ${n}`:void 0,U=o?v` having ${o}`:void 0,I;l&&l.length>0&&(I=v` order by ${v.join(l,v`, `)}`);let G;c&&c.length>0&&(G=v` group by ${v.join(c,v`, `)}`);let Se=typeof u=="object"||typeof u=="number"&&u>=0?v` limit ${u}`:void 0,ct=d?v` offset ${d}`:void 0,ae=v.empty();if(f){let tt=v` for ${v.raw(f.strength)}`;f.config.of&&tt.append(v` of ${v.join(Array.isArray(f.config.of)?f.config.of:[f.config.of],v`, `)}`),f.config.noWait?tt.append(v` nowait`):f.config.skipLocked&&tt.append(v` skip locked`),ae.append(tt)}let bt=v`${_}select${T} ${k} from ${E}${R}${L}${G}${U}${I}${Se}${ct}${ae}`;return y.length>0?this.buildSetOperations(bt,y):bt}buildSetOperations(e,r){let[i,...n]=r;if(!i)throw new Error("Cannot pass undefined values to any set operator");return n.length===0?this.buildSetOperationQuery({leftSelect:e,setOperator:i}):this.buildSetOperations(this.buildSetOperationQuery({leftSelect:e,setOperator:i}),n)}buildSetOperationQuery({leftSelect:e,setOperator:{type:r,isAll:i,rightSelect:n,limit:o,orderBy:s,offset:a}}){let l=v`(${e.getSQL()}) `,c=v`(${n.getSQL()})`,u;if(s&&s.length>0){let y=[];for(let h of s)if($(h,A))y.push(v.identifier(h.name));else if($(h,j)){for(let w=0;w<h.queryChunks.length;w++){let _=h.queryChunks[w];$(_,A)&&(h.queryChunks[w]=v.identifier(_.name))}y.push(v`${h}`)}else y.push(v`${h}`);u=v` order by ${v.join(y,v`, `)} `}let d=typeof o=="object"||typeof o=="number"&&o>=0?v` limit ${o}`:void 0,f=v.raw(`${r} ${i?"all ":""}`),m=a?v` offset ${a}`:void 0;return v`${l}${f}${c}${u}${d}${m}`}buildInsertQuery({table:e,values:r,onConflict:i,returning:n,withList:o,select:s,overridingSystemValue_:a}){let l=[],c=e[D.Symbol.Columns],u=Object.entries(c).filter(([_,T])=>!T.shouldDisableInsert()),d=u.map(([,_])=>v.identifier(this.casing.getColumnCasing(_)));if(s){let _=r;$(_,j)?l.push(_):l.push(_.getSQL())}else{let _=r;l.push(v.raw("values "));for(let[T,k]of _.entries()){let E=[];for(let[R,L]of u){let U=k[R];if(U===void 0||$(U,Ye)&&U.value===void 0)if(L.defaultFn!==void 0){let I=L.defaultFn(),G=$(I,j)?I:v.param(I,L);E.push(G)}else if(!L.default&&L.onUpdateFn!==void 0){let I=L.onUpdateFn(),G=$(I,j)?I:v.param(I,L);E.push(G)}else E.push(v`default`);else E.push(U)}l.push(E),T<_.length-1&&l.push(v`, `)}}let f=this.buildWithCTE(o),m=v.join(l),y=n?v` returning ${this.buildSelection(n,{isSingleTable:!0})}`:void 0,h=i?v` on conflict ${i}`:void 0,w=a===!0?v`overriding system value `:void 0;return v`${f}insert into ${e} ${d} ${w}${m}${h}${y}`}buildRefreshMaterializedViewQuery({view:e,concurrently:r,withNoData:i}){let n=r?v` concurrently`:void 0,o=i?v` with no data`:void 0;return v`refresh materialized view${n} ${e}${o}`}prepareTyping(e){return $(e,qs)||$(e,Ms)?"json":$(e,Fs)?"decimal":$(e,Bs)?"time":$(e,Zs)||$(e,Ks)?"timestamp":$(e,js)||$(e,Us)?"date":$(e,Vs)?"uuid":"none"}sqlToQuery(e,r){return e.toQuery({casing:this.casing,escapeName:this.escapeName,escapeParam:this.escapeParam,escapeString:this.escapeString,prepareTyping:this.prepareTyping,invokeSource:r})}buildRelationalQueryWithoutPK({fullSchema:e,schema:r,tableNamesMap:i,table:n,tableConfig:o,queryConfig:s,tableAlias:a,nestedQueryRelation:l,joinOn:c}){let u=[],d,f,m=[],y,h=[];if(s===!0)u=Object.entries(o.columns).map(([T,k])=>({dbKey:k.name,tsKey:T,field:jt(k,a),relationTableTsKey:void 0,isJson:!1,selection:[]}));else{let _=Object.fromEntries(Object.entries(o.columns).map(([U,I])=>[U,jt(I,a)]));if(s.where){let U=typeof s.where=="function"?s.where(_,VR()):s.where;y=U&&Ls(U,a)}let T=[],k=[];if(s.columns){let U=!1;for(let[I,G]of Object.entries(s.columns))G!==void 0&&I in o.columns&&(!U&&G===!0&&(U=!0),k.push(I));k.length>0&&(k=U?k.filter(I=>s.columns?.[I]===!0):Object.keys(o.columns).filter(I=>!k.includes(I)))}else k=Object.keys(o.columns);for(let U of k){let I=o.columns[U];T.push({tsKey:U,value:I})}let E=[];s.with&&(E=Object.entries(s.with).filter(U=>!!U[1]).map(([U,I])=>({tsKey:U,queryConfig:I,relation:o.relations[U]})));let R;if(s.extras){R=typeof s.extras=="function"?s.extras(_,{sql:v}):s.extras;for(let[U,I]of Object.entries(R))T.push({tsKey:U,value:bS(I,a)})}for(let{tsKey:U,value:I}of T)u.push({dbKey:$(I,j.Aliased)?I.fieldAlias:o.columns[U].name,tsKey:U,field:$(I,re)?jt(I,a):I,relationTableTsKey:void 0,isJson:!1,selection:[]});let L=typeof s.orderBy=="function"?s.orderBy(_,GR()):s.orderBy??[];Array.isArray(L)||(L=[L]),m=L.map(U=>$(U,re)?jt(U,a):Ls(U,a)),d=s.limit,f=s.offset;for(let{tsKey:U,queryConfig:I,relation:G}of E){let Se=JR(r,i,G),ct=ln(G.referencedTable),ae=i[ct],bt=`${a}_${U}`,tt=un(...Se.fields.map((Az,Rz)=>Rr(jt(Se.references[Rz],bt),jt(Az,a)))),Ft=this.buildRelationalQueryWithoutPK({fullSchema:e,schema:r,tableNamesMap:i,table:e[ae],tableConfig:r[ae],queryConfig:$(G,Dr)?I===!0?{limit:1}:{...I,limit:1}:I,tableAlias:bt,joinOn:tt,nestedQueryRelation:G}),zd=v`${v.identifier(bt)}.${v.identifier("data")}`.as(U);h.push({on:v`true`,table:new ce(Ft.sql,{},bt),alias:bt,joinType:"left",lateral:!0}),u.push({dbKey:U,tsKey:U,field:zd,relationTableTsKey:ae,isJson:!0,selection:Ft.selection})}}if(u.length===0)throw new Qs({message:`No fields selected for table "${o.tsName}" ("${a}")`});let w;if(y=un(c,y),l){let _=v`json_build_array(${v.join(u.map(({field:E,tsKey:R,isJson:L})=>L?v`${v.identifier(`${a}_${R}`)}.${v.identifier("data")}`:$(E,j.Aliased)?E.sql:E),v`, `)})`;$(l,Js)&&(_=v`coalesce(json_agg(${_}${m.length>0?v` order by ${v.join(m,v`, `)}`:void 0}), '[]'::json)`);let T=[{dbKey:"data",tsKey:"data",field:_.as("data"),isJson:!0,relationTableTsKey:o.tsName,selection:u}];d!==void 0||f!==void 0||m.length>0?(w=this.buildSelectQuery({table:Ds(n,a),fields:{},fieldsFlat:[{path:[],field:v.raw("*")}],where:y,limit:d,offset:f,orderBy:m,setOperators:[]}),y=void 0,d=void 0,f=void 0,m=[]):w=Ds(n,a),w=this.buildSelectQuery({table:$(w,$e)?w:new ce(w,{},a),fields:{},fieldsFlat:T.map(({field:E})=>({path:[],field:$(E,re)?jt(E,a):E})),joins:h,where:y,limit:d,offset:f,orderBy:m,setOperators:[]})}else w=this.buildSelectQuery({table:Ds(n,a),fields:{},fieldsFlat:u.map(({field:_})=>({path:[],field:$(_,re)?jt(_,a):_})),joins:h,where:y,limit:d,offset:f,orderBy:m,setOperators:[]});return{tableTsKey:o.tsName,sql:w,selection:u}}};var id=class{static[g]="TypedQueryBuilder";getSelectedFields(){return this._.selectedFields}};var ze=class{static[g]="PgSelectBuilder";fields;session;dialect;withList=[];distinct;constructor(e){this.fields=e.fields,this.session=e.session,this.dialect=e.dialect,e.withList&&(this.withList=e.withList),this.distinct=e.distinct}authToken;setToken(e){return this.authToken=e,this}from(e){let r=!!this.fields,i=e,n;return this.fields?n=this.fields:$(i,ce)?n=Object.fromEntries(Object.keys(i._.selectedFields).map(o=>[o,i[o]])):$(i,Ai)?n=i[le].selectedFields:$(i,j)?n={}:n=HA(i),new od({table:i,fields:n,isPartialSelect:r,session:this.session,dialect:this.dialect,withList:this.withList,distinct:this.distinct}).setToken(this.authToken)}},Kx=class extends id{static[g]="PgSelectQueryBuilder";_;config;joinsNotNullableMap;tableName;isPartialSelect;session;dialect;cacheConfig=void 0;usedTables=new Set;constructor({table:e,fields:r,isPartialSelect:i,session:n,dialect:o,withList:s,distinct:a}){super(),this.config={withList:s,table:e,fields:{...r},distinct:a,setOperators:[]},this.isPartialSelect=i,this.session=n,this.dialect=o,this._={selectedFields:r,config:this.config},this.tableName=Ht(e),this.joinsNotNullableMap=typeof this.tableName=="string"?{[this.tableName]:!0}:{};for(let l of Ct(e))this.usedTables.add(l)}getUsedTables(){return[...this.usedTables]}createJoin(e,r){return(i,n)=>{let o=this.tableName,s=Ht(i);for(let a of Ct(i))this.usedTables.add(a);if(typeof s=="string"&&this.config.joins?.some(a=>a.alias===s))throw new Error(`Alias "${s}" is already used in this query`);if(!this.isPartialSelect&&(Object.keys(this.joinsNotNullableMap).length===1&&typeof o=="string"&&(this.config.fields={[o]:this.config.fields}),typeof s=="string"&&!$(i,j))){let a=$(i,ce)?i._.selectedFields:$(i,Be)?i[le].selectedFields:i[D.Symbol.Columns];this.config.fields[s]=a}if(typeof n=="function"&&(n=n(new Proxy(this.config.fields,new be({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.joins||(this.config.joins=[]),this.config.joins.push({on:n,table:i,joinType:e,alias:s,lateral:r}),typeof s=="string")switch(e){case"left":{this.joinsNotNullableMap[s]=!1;break}case"right":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([a])=>[a,!1])),this.joinsNotNullableMap[s]=!0;break}case"cross":case"inner":{this.joinsNotNullableMap[s]=!0;break}case"full":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([a])=>[a,!1])),this.joinsNotNullableMap[s]=!1;break}}return this}}leftJoin=this.createJoin("left",!1);leftJoinLateral=this.createJoin("left",!0);rightJoin=this.createJoin("right",!1);innerJoin=this.createJoin("inner",!1);innerJoinLateral=this.createJoin("inner",!0);fullJoin=this.createJoin("full",!1);crossJoin=this.createJoin("cross",!1);crossJoinLateral=this.createJoin("cross",!0);createSetOperator(e,r){return i=>{let n=typeof i=="function"?i(PG()):i;if(!zs(this.getSelectedFields(),n.getSelectedFields()))throw new Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");return this.config.setOperators.push({type:e,isAll:r,rightSelect:n}),this}}union=this.createSetOperator("union",!1);unionAll=this.createSetOperator("union",!0);intersect=this.createSetOperator("intersect",!1);intersectAll=this.createSetOperator("intersect",!0);except=this.createSetOperator("except",!1);exceptAll=this.createSetOperator("except",!0);addSetOperators(e){return this.config.setOperators.push(...e),this}where(e){return typeof e=="function"&&(e=e(new Proxy(this.config.fields,new be({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.where=e,this}having(e){return typeof e=="function"&&(e=e(new Proxy(this.config.fields,new be({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.having=e,this}groupBy(...e){if(typeof e[0]=="function"){let r=e[0](new Proxy(this.config.fields,new be({sqlAliasedBehavior:"alias",sqlBehavior:"sql"})));this.config.groupBy=Array.isArray(r)?r:[r]}else this.config.groupBy=e;return this}orderBy(...e){if(typeof e[0]=="function"){let r=e[0](new Proxy(this.config.fields,new be({sqlAliasedBehavior:"alias",sqlBehavior:"sql"}))),i=Array.isArray(r)?r:[r];this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=i:this.config.orderBy=i}else{let r=e;this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=r:this.config.orderBy=r}return this}limit(e){return this.config.setOperators.length>0?this.config.setOperators.at(-1).limit=e:this.config.limit=e,this}offset(e){return this.config.setOperators.length>0?this.config.setOperators.at(-1).offset=e:this.config.offset=e,this}for(e,r={}){return this.config.lockingClause={strength:e,config:r},this}getSQL(){return this.dialect.buildSelectQuery(this.config)}toSQL(){let{typings:e,...r}=this.dialect.sqlToQuery(this.getSQL());return r}as(e){let r=[];if(r.push(...Ct(this.config.table)),this.config.joins)for(let i of this.config.joins)r.push(...Ct(i.table));return new Proxy(new ce(this.getSQL(),this.config.fields,e,!1,[...new Set(r)]),new be({alias:e,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}getSelectedFields(){return new Proxy(this.config.fields,new be({alias:this.tableName,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}$dynamic(){return this}$withCache(e){return this.cacheConfig=e===void 0?{config:{},enable:!0,autoInvalidate:!0}:e===!1?{enable:!1}:{enable:!0,autoInvalidate:!0,...e},this}},od=class extends Kx{static[g]="PgSelect";_prepare(e){let{session:r,config:i,dialect:n,joinsNotNullableMap:o,authToken:s,cacheConfig:a,usedTables:l}=this;if(!r)throw new Error("Cannot execute a query on a query builder. Please use a database instance instead.");let{fields:c}=i;return se.startActiveSpan("drizzle.prepareQuery",()=>{let u=vt(c),d=r.prepareQuery(n.sqlToQuery(this.getSQL()),u,e,!0,void 0,{type:"select",tables:[...l]},a);return d.joinsNotNullableMap=o,d.setToken(s)})}prepare(e){return this._prepare(e)}authToken;setToken(e){return this.authToken=e,this}execute=e=>se.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken))};WA(od,[Le]);function Ri(t,e){return(r,i,...n)=>{let o=[i,...n].map(s=>({type:t,isAll:e,rightSelect:s}));for(let s of o)if(!zs(r.getSelectedFields(),s.rightSelect.getSelectedFields()))throw new Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");return r.addSetOperators(o)}}var PG=()=>({union:NG,unionAll:OG,intersect:AG,intersectAll:RG,except:DG,exceptAll:LG}),NG=Ri("union",!1),OG=Ri("union",!0),AG=Ri("intersect",!1),RG=Ri("intersect",!0),DG=Ri("except",!1),LG=Ri("except",!0);var Di=class{static[g]="PgQueryBuilder";dialect;dialectConfig;constructor(e){this.dialect=$(e,Lr)?e:void 0,this.dialectConfig=$(e,Lr)?void 0:e}$with=(e,r)=>{let i=this;return{as:o=>(typeof o=="function"&&(o=o(i)),new Proxy(new Ii(o.getSQL(),r??("getSelectedFields"in o?o.getSelectedFields()??{}:{}),e,!0),new be({alias:e,sqlAliasedBehavior:"alias",sqlBehavior:"error"})))}};with(...e){let r=this;function i(s){return new ze({fields:s??void 0,session:void 0,dialect:r.getDialect(),withList:e})}function n(s){return new ze({fields:s??void 0,session:void 0,dialect:r.getDialect(),distinct:!0})}function o(s,a){return new ze({fields:a??void 0,session:void 0,dialect:r.getDialect(),distinct:{on:s}})}return{select:i,selectDistinct:n,selectDistinctOn:o}}select(e){return new ze({fields:e??void 0,session:void 0,dialect:this.getDialect()})}selectDistinct(e){return new ze({fields:e??void 0,session:void 0,dialect:this.getDialect(),distinct:!0})}selectDistinctOn(e,r){return new ze({fields:r??void 0,session:void 0,dialect:this.getDialect(),distinct:{on:e}})}getDialect(){return this.dialect||(this.dialect=new Lr(this.dialectConfig)),this.dialect}};function Ct(t){return $(t,$e)?[t[an]?`${t[an]}.${t[D.Symbol.BaseName]}`:t[D.Symbol.BaseName]]:$(t,ce)?t._.usedTables??[]:$(t,j)?t.usedTables??[]:[]}var Ws=class extends Le{constructor(e,r,i,n){super(),this.session=r,this.dialect=i,this.config={table:e,withList:n}}static[g]="PgDelete";config;cacheConfig;where(e){return this.config.where=e,this}returning(e=this.config.table[D.Symbol.Columns]){return this.config.returningFields=e,this.config.returning=vt(e),this}getSQL(){return this.dialect.buildDeleteQuery(this.config)}toSQL(){let{typings:e,...r}=this.dialect.sqlToQuery(this.getSQL());return r}_prepare(e){return se.startActiveSpan("drizzle.prepareQuery",()=>this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e,!0,void 0,{type:"delete",tables:Ct(this.config.table)},this.cacheConfig))}prepare(e){return this._prepare(e)}authToken;setToken(e){return this.authToken=e,this}execute=e=>se.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken));getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new be({alias:He(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}};var Hs=class{constructor(e,r,i,n,o){this.table=e,this.session=r,this.dialect=i,this.withList=n,this.overridingSystemValue_=o}static[g]="PgInsertBuilder";authToken;setToken(e){return this.authToken=e,this}overridingSystemValue(){return this.overridingSystemValue_=!0,this}values(e){if(e=Array.isArray(e)?e:[e],e.length===0)throw new Error("values() must be called with at least one value");let r=e.map(i=>{let n={},o=this.table[D.Symbol.Columns];for(let s of Object.keys(i)){let a=i[s];n[s]=$(a,j)?a:new Ye(a,o[s])}return n});return new sd(this.table,r,this.session,this.dialect,this.withList,!1,this.overridingSystemValue_).setToken(this.authToken)}select(e){let r=typeof e=="function"?e(new Di):e;if(!$(r,j)&&!zs(this.table[Ju],r._.selectedFields))throw new Error("Insert select error: selected fields are not the same or are in a different order compared to the table definition");return new sd(this.table,r,this.session,this.dialect,this.withList,!0)}},sd=class extends Le{constructor(e,r,i,n,o,s,a){super(),this.session=i,this.dialect=n,this.config={table:e,values:r,withList:o,select:s,overridingSystemValue_:a}}static[g]="PgInsert";config;cacheConfig;returning(e=this.config.table[D.Symbol.Columns]){return this.config.returningFields=e,this.config.returning=vt(e),this}onConflictDoNothing(e={}){if(e.target===void 0)this.config.onConflict=v`do nothing`;else{let r="";r=Array.isArray(e.target)?e.target.map(n=>this.dialect.escapeName(this.dialect.casing.getColumnCasing(n))).join(","):this.dialect.escapeName(this.dialect.casing.getColumnCasing(e.target));let i=e.where?v` where ${e.where}`:void 0;this.config.onConflict=v`(${v.raw(r)})${i} do nothing`}return this}onConflictDoUpdate(e){if(e.where&&(e.targetWhere||e.setWhere))throw new Error('You cannot use both "where" and "targetWhere"/"setWhere" at the same time - "where" is deprecated, use "targetWhere" or "setWhere" instead.');let r=e.where?v` where ${e.where}`:void 0,i=e.targetWhere?v` where ${e.targetWhere}`:void 0,n=e.setWhere?v` where ${e.setWhere}`:void 0,o=this.dialect.buildUpdateSet(this.config.table,Wu(this.config.table,e.set)),s="";return s=Array.isArray(e.target)?e.target.map(a=>this.dialect.escapeName(this.dialect.casing.getColumnCasing(a))).join(","):this.dialect.escapeName(this.dialect.casing.getColumnCasing(e.target)),this.config.onConflict=v`(${v.raw(s)})${i} do update set ${o}${r}${n}`,this}getSQL(){return this.dialect.buildInsertQuery(this.config)}toSQL(){let{typings:e,...r}=this.dialect.sqlToQuery(this.getSQL());return r}_prepare(e){return se.startActiveSpan("drizzle.prepareQuery",()=>this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e,!0,void 0,{type:"insert",tables:Ct(this.config.table)},this.cacheConfig))}prepare(e){return this._prepare(e)}authToken;setToken(e){return this.authToken=e,this}execute=e=>se.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken));getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new be({alias:He(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}};var ad=class extends Le{constructor(e,r,i){super(),this.session=r,this.dialect=i,this.config={view:e}}static[g]="PgRefreshMaterializedView";config;concurrently(){if(this.config.withNoData!==void 0)throw new Error("Cannot use concurrently and withNoData together");return this.config.concurrently=!0,this}withNoData(){if(this.config.concurrently!==void 0)throw new Error("Cannot use concurrently and withNoData together");return this.config.withNoData=!0,this}getSQL(){return this.dialect.buildRefreshMaterializedViewQuery(this.config)}toSQL(){let{typings:e,...r}=this.dialect.sqlToQuery(this.getSQL());return r}_prepare(e){return se.startActiveSpan("drizzle.prepareQuery",()=>this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),void 0,e,!0))}prepare(e){return this._prepare(e)}authToken;setToken(e){return this.authToken=e,this}execute=e=>se.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken))};var Ys=class{constructor(e,r,i,n){this.table=e,this.session=r,this.dialect=i,this.withList=n}static[g]="PgUpdateBuilder";authToken;setToken(e){return this.authToken=e,this}set(e){return new Vx(this.table,Wu(this.table,e),this.session,this.dialect,this.withList).setToken(this.authToken)}},Vx=class extends Le{constructor(e,r,i,n,o){super(),this.session=i,this.dialect=n,this.config={set:r,table:e,withList:o,joins:[]},this.tableName=Ht(e),this.joinsNotNullableMap=typeof this.tableName=="string"?{[this.tableName]:!0}:{}}static[g]="PgUpdate";config;tableName;joinsNotNullableMap;cacheConfig;from(e){let r=e,i=Ht(r);return typeof i=="string"&&(this.joinsNotNullableMap[i]=!0),this.config.from=r,this}getTableLikeFields(e){return $(e,$e)?e[D.Symbol.Columns]:$(e,ce)?e._.selectedFields:e[le].selectedFields}createJoin(e){return(r,i)=>{let n=Ht(r);if(typeof n=="string"&&this.config.joins.some(o=>o.alias===n))throw new Error(`Alias "${n}" is already used in this query`);if(typeof i=="function"){let o=this.config.from&&!$(this.config.from,j)?this.getTableLikeFields(this.config.from):void 0;i=i(new Proxy(this.config.table[D.Symbol.Columns],new be({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})),o&&new Proxy(o,new be({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))}if(this.config.joins.push({on:i,table:r,joinType:e,alias:n}),typeof n=="string")switch(e){case"left":{this.joinsNotNullableMap[n]=!1;break}case"right":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([o])=>[o,!1])),this.joinsNotNullableMap[n]=!0;break}case"inner":{this.joinsNotNullableMap[n]=!0;break}case"full":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([o])=>[o,!1])),this.joinsNotNullableMap[n]=!1;break}}return this}}leftJoin=this.createJoin("left");rightJoin=this.createJoin("right");innerJoin=this.createJoin("inner");fullJoin=this.createJoin("full");where(e){return this.config.where=e,this}returning(e){if(!e&&(e=Object.assign({},this.config.table[D.Symbol.Columns]),this.config.from)){let r=Ht(this.config.from);if(typeof r=="string"&&this.config.from&&!$(this.config.from,j)){let i=this.getTableLikeFields(this.config.from);e[r]=i}for(let i of this.config.joins){let n=Ht(i.table);if(typeof n=="string"&&!$(i.table,j)){let o=this.getTableLikeFields(i.table);e[n]=o}}}return this.config.returningFields=e,this.config.returning=vt(e),this}getSQL(){return this.dialect.buildUpdateQuery(this.config)}toSQL(){let{typings:e,...r}=this.dialect.sqlToQuery(this.getSQL());return r}_prepare(e){let r=this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e,!0,void 0,{type:"insert",tables:Ct(this.config.table)},this.cacheConfig);return r.joinsNotNullableMap=this.joinsNotNullableMap,r}prepare(e){return this._prepare(e)}authToken;setToken(e){return this.authToken=e,this}execute=e=>this._prepare().execute(e,this.authToken);getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new be({alias:He(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}};var ld=class t extends j{constructor(e){super(t.buildEmbeddedCount(e.source,e.filters).queryChunks),this.params=e,this.mapWith(Number),this.session=e.session,this.sql=t.buildCount(e.source,e.filters)}sql;token;static[g]="PgCountBuilder";[Symbol.toStringTag]="PgCountBuilder";session;static buildEmbeddedCount(e,r){return v`(select count(*) from ${e}${v.raw(" where ").if(r)}${r})`}static buildCount(e,r){return v`select count(*) as count from ${e}${v.raw(" where ").if(r)}${r};`}setToken(e){return this.token=e,this}then(e,r){return Promise.resolve(this.session.count(this.sql,this.token)).then(e,r)}catch(e){return this.then(void 0,e)}finally(e){return this.then(r=>(e?.(),r),r=>{throw e?.(),r})}};var cd=class{constructor(e,r,i,n,o,s,a){this.fullSchema=e,this.schema=r,this.tableNamesMap=i,this.table=n,this.tableConfig=o,this.dialect=s,this.session=a}static[g]="PgRelationalQueryBuilder";findMany(e){return new ud(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,e||{},"many")}findFirst(e){return new ud(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,e?{...e,limit:1}:{limit:1},"first")}},ud=class extends Le{constructor(e,r,i,n,o,s,a,l,c){super(),this.fullSchema=e,this.schema=r,this.tableNamesMap=i,this.table=n,this.tableConfig=o,this.dialect=s,this.session=a,this.config=l,this.mode=c}static[g]="PgRelationalQuery";_prepare(e){return se.startActiveSpan("drizzle.prepareQuery",()=>{let{query:r,builtQuery:i}=this._toSQL();return this.session.prepareQuery(i,void 0,e,!0,(n,o)=>{let s=n.map(a=>nd(this.schema,this.tableConfig,a,r.selection,o));return this.mode==="first"?s[0]:s})})}prepare(e){return this._prepare(e)}_getQuery(){return this.dialect.buildRelationalQueryWithoutPK({fullSchema:this.fullSchema,schema:this.schema,tableNamesMap:this.tableNamesMap,table:this.table,tableConfig:this.tableConfig,queryConfig:this.config,tableAlias:this.tableConfig.tsName})}getSQL(){return this._getQuery().sql}_toSQL(){let e=this._getQuery(),r=this.dialect.sqlToQuery(e.sql);return{query:e,builtQuery:r}}toSQL(){return this._toSQL().builtQuery}authToken;setToken(e){return this.authToken=e,this}execute(){return se.startActiveSpan("drizzle.operation",()=>this._prepare().execute(void 0,this.authToken))}};var dd=class extends Le{constructor(e,r,i,n){super(),this.execute=e,this.sql=r,this.query=i,this.mapBatchResult=n}static[g]="PgRaw";getSQL(){return this.sql}getQuery(){return this.query}mapResult(e,r){return r?this.mapBatchResult(e):e}_prepare(){return this}isResponseInArrayMode(){return!1}};var Li=class{constructor(e,r,i){if(this.dialect=e,this.session=r,this._=i?{schema:i.schema,fullSchema:i.fullSchema,tableNamesMap:i.tableNamesMap,session:r}:{schema:void 0,fullSchema:{},tableNamesMap:{},session:r},this.query={},this._.schema)for(let[n,o]of Object.entries(this._.schema))this.query[n]=new cd(i.fullSchema,this._.schema,this._.tableNamesMap,i.fullSchema[n],o,e,r);this.$cache={invalidate:async n=>{}}}static[g]="PgDatabase";query;$with=(e,r)=>{let i=this;return{as:o=>(typeof o=="function"&&(o=o(new Di(i.dialect))),new Proxy(new Ii(o.getSQL(),r??("getSelectedFields"in o?o.getSelectedFields()??{}:{}),e,!0),new be({alias:e,sqlAliasedBehavior:"alias",sqlBehavior:"error"})))}};$count(e,r){return new ld({source:e,filters:r,session:this.session})}$cache;with(...e){let r=this;function i(c){return new ze({fields:c??void 0,session:r.session,dialect:r.dialect,withList:e})}function n(c){return new ze({fields:c??void 0,session:r.session,dialect:r.dialect,withList:e,distinct:!0})}function o(c,u){return new ze({fields:u??void 0,session:r.session,dialect:r.dialect,withList:e,distinct:{on:c}})}function s(c){return new Ys(c,r.session,r.dialect,e)}function a(c){return new Hs(c,r.session,r.dialect,e)}function l(c){return new Ws(c,r.session,r.dialect,e)}return{select:i,selectDistinct:n,selectDistinctOn:o,update:s,insert:a,delete:l}}select(e){return new ze({fields:e??void 0,session:this.session,dialect:this.dialect})}selectDistinct(e){return new ze({fields:e??void 0,session:this.session,dialect:this.dialect,distinct:!0})}selectDistinctOn(e,r){return new ze({fields:r??void 0,session:this.session,dialect:this.dialect,distinct:{on:e}})}update(e){return new Ys(e,this.session,this.dialect)}insert(e){return new Hs(e,this.session,this.dialect)}delete(e){return new Ws(e,this.session,this.dialect)}refreshMaterializedView(e){return new ad(e,this.session,this.dialect)}authToken;execute(e){let r=typeof e=="string"?v.raw(e):e.getSQL(),i=this.dialect.sqlToQuery(r),n=this.session.prepareQuery(i,void 0,void 0,!1);return new dd(()=>n.execute(void 0,this.authToken),r,i,o=>n.mapResult(o,!0))}transaction(e,r){return this.session.transaction(e,r)}};var Gx=class{static[g]="Cache"},zi=class extends Gx{strategy(){return"all"}static[g]="NoopCache";async get(e){}async put(e,r,i,n){}async onMutate(e){}};async function Qx(t,e){let r=`${t}-${JSON.stringify(e)}`,n=new TextEncoder().encode(r),o=await crypto.subtle.digest("SHA-256",n);return[...new Uint8Array(o)].map(l=>l.toString(16).padStart(2,"0")).join("")}var fd=class{constructor(e,r,i,n){this.query=e,this.cache=r,this.queryMetadata=i,this.cacheConfig=n,r&&r.strategy()==="all"&&n===void 0&&(this.cacheConfig={enable:!0,autoInvalidate:!0}),this.cacheConfig?.enable||(this.cacheConfig=void 0)}authToken;getQuery(){return this.query}mapResult(e,r){return e}setToken(e){return this.authToken=e,this}static[g]="PgPreparedQuery";joinsNotNullableMap;async queryWithCache(e,r,i){if(this.cache===void 0||$(this.cache,zi)||this.queryMetadata===void 0)try{return await i()}catch(n){throw new Xt(e,r,n)}if(this.cacheConfig&&!this.cacheConfig.enable)try{return await i()}catch(n){throw new Xt(e,r,n)}if((this.queryMetadata.type==="insert"||this.queryMetadata.type==="update"||this.queryMetadata.type==="delete")&&this.queryMetadata.tables.length>0)try{let[n]=await Promise.all([i(),this.cache.onMutate({tables:this.queryMetadata.tables})]);return n}catch(n){throw new Xt(e,r,n)}if(!this.cacheConfig)try{return await i()}catch(n){throw new Xt(e,r,n)}if(this.queryMetadata.type==="select"){let n=await this.cache.get(this.cacheConfig.tag??await Qx(e,r),this.queryMetadata.tables,this.cacheConfig.tag!==void 0,this.cacheConfig.autoInvalidate);if(n===void 0){let o;try{o=await i()}catch(s){throw new Xt(e,r,s)}return await this.cache.put(this.cacheConfig.tag??await Qx(e,r),o,this.cacheConfig.autoInvalidate?this.queryMetadata.tables:[],this.cacheConfig.tag!==void 0,this.cacheConfig.config),o}return n}try{return await i()}catch(n){throw new Xt(e,r,n)}}},md=class{constructor(e){this.dialect=e}static[g]="PgSession";execute(e,r){return se.startActiveSpan("drizzle.operation",()=>se.startActiveSpan("drizzle.prepareQuery",()=>this.prepareQuery(this.dialect.sqlToQuery(e),void 0,void 0,!1)).setToken(r).execute(void 0,r))}all(e){return this.prepareQuery(this.dialect.sqlToQuery(e),void 0,void 0,!1).all()}async count(e,r){let i=await this.execute(e,r);return Number(i[0].count)}},pd=class extends Li{constructor(e,r,i,n=0){super(e,r,i),this.schema=i,this.nestedIndex=n}static[g]="PgTransaction";rollback(){throw new ed}getTransactionConfigSQL(e){let r=[];return e.isolationLevel&&r.push(`isolation level ${e.isolationLevel}`),e.accessMode&&r.push(e.accessMode),typeof e.deferrable=="boolean"&&r.push(e.deferrable?"deferrable":"not deferrable"),v.raw(r.join(" "))}setTransaction(e){return this.session.execute(v`set transaction ${this.getTransactionConfigSQL(e)}`)}};var Jx=W("backups",{id:Z().generatedByDefaultAsIdentity().primaryKey(),createdAt:we("created_at",{withTimezone:!0}).notNull().defaultNow(),filePath:q("file_path").notNull(),sizeBytes:ve("size_bytes",{mode:"number"}).notNull(),durationMs:Z("duration_ms")});var at=W("items",{id:Z().generatedByDefaultAsIdentity().primaryKey(),origin:q().notNull(),type:q().notNull().default("story"),name:q().notNull(),description:q(),acceptanceCriteria:q("acceptance_criteria").notNull().default("[]"),status:q().notNull().default("todo"),currentPhase:Z("current_phase"),starred:Pi().notNull().default(!1),jiraKey:q("jira_key"),githubIssue:q("github_issue")},t=>[Yu("items_origin_idx").on(t.origin)]);var Wx=W("comments",{id:Z().generatedByDefaultAsIdentity().primaryKey(),itemId:Z("item_id").notNull().references(()=>at.id,{onDelete:"cascade"}),idx:Z().notNull(),text:q().notNull(),phase:Z(),timestamp:q().notNull(),type:q().notNull().default("comment")});var HR=W("inbox_messages",{source:q().notNull(),messageId:q("message_id").notNull(),sender:q().notNull(),summary:q().notNull(),link:q().notNull(),receivedAt:we("received_at",{withTimezone:!0}),flaggedAt:we("flagged_at",{withTimezone:!0}).notNull().defaultNow(),dismissedAt:we("dismissed_at",{withTimezone:!0})},t=>[ke({columns:[t.source,t.messageId]})]);var Hx=W("item_git_refs",{itemId:Z("item_id").notNull().references(()=>at.id,{onDelete:"cascade"}),kind:q().notNull(),ref:q().notNull(),title:q(),url:q(),state:q(),createdAt:we("created_at",{withTimezone:!0}).notNull().defaultNow()},t=>[ke({columns:[t.itemId,t.kind,t.ref]})]);var hd=W("job_runs",{id:Z().generatedByDefaultAsIdentity().primaryKey(),kind:q().$type().notNull(),trigger:q().$type().notNull(),model:q(),startedAt:we("started_at",{withTimezone:!0}).notNull().defaultNow(),finishedAt:we("finished_at",{withTimezone:!0}),durationMs:ve("duration_ms",{mode:"number"}),inputTokens:ve("input_tokens",{mode:"number"}).notNull().default(0),outputTokens:ve("output_tokens",{mode:"number"}).notNull().default(0),cacheReadTokens:ve("cache_read_tokens",{mode:"number"}).notNull().default(0),cacheWriteTokens:ve("cache_write_tokens",{mode:"number"}).notNull().default(0),costUsd:Mt("cost_usd"),status:q().$type().notNull().default("running"),detail:q(),repo:q(),prNumber:Z("pr_number"),reviewer:q()},t=>[Yu("job_runs_started_at_idx").on(t.startedAt)]);var Yx=W("links",{itemId:Z("item_id").notNull().references(()=>at.id,{onDelete:"cascade"}),type:q().notNull(),targetId:Z("target_id").notNull()},t=>[ke({columns:[t.itemId,t.type,t.targetId]})]);var Xx=W("phase_cycle_context",{itemId:Z("item_id").notNull(),phaseIdx:Z("phase_idx").notNull(),window:q().$type().notNull(),resetsAt:ve("resets_at",{mode:"number"}).notNull(),peakContextPct:Mt("peak_context_pct").notNull().default(0)},t=>[ke({columns:[t.itemId,t.phaseIdx,t.window,t.resetsAt]})]);var e_=W("phase_sessions",{itemId:Z("item_id").notNull().references(()=>at.id,{onDelete:"cascade"}),phaseIdx:Z("phase_idx").notNull(),claudeSessionId:q("claude_session_id").notNull(),hostname:q().notNull(),osUser:q("os_user").notNull(),createdAt:we("created_at",{withTimezone:!0}).notNull().defaultNow()},t=>[ke({columns:[t.itemId,t.phaseIdx,t.claudeSessionId]})]);var t_=W("phase_usage",{itemId:Z("item_id").notNull(),phaseIdx:Z("phase_idx").notNull(),tokensUp:ve("tokens_up",{mode:"number"}).notNull().default(0),tokensDown:ve("tokens_down",{mode:"number"}).notNull().default(0),activeMs:ve("active_ms",{mode:"number"}).notNull().default(0),peakContextPct:Mt("peak_context_pct").notNull().default(0),lastTotalIn:ve("last_total_in",{mode:"number"}),lastTotalOut:ve("last_total_out",{mode:"number"}),claudeSessionId:q("claude_session_id")},t=>[ke({columns:[t.itemId,t.phaseIdx]})]);var r_=W("phase_usage_messages",{itemId:Z("item_id").notNull(),phaseIdx:Z("phase_idx").notNull(),messageId:q("message_id").notNull()},t=>[ke({columns:[t.itemId,t.phaseIdx,t.messageId]})]);var ji=W("plan_phases",{itemId:Z("item_id").notNull().references(()=>at.id,{onDelete:"cascade"}),idx:Z().notNull(),name:q().notNull(),manualChecks:q("manual_checks")},t=>[ke({columns:[t.itemId,t.idx]})]);var n_=W("plan_tasks",{itemId:Z("item_id").notNull(),phaseIdx:Z("phase_idx").notNull(),idx:Z().notNull(),task:q().notNull()},t=>[ke({columns:[t.itemId,t.phaseIdx,t.idx]}),OA({columns:[t.itemId,t.phaseIdx],foreignColumns:[ji.itemId,ji.idx]}).onDelete("cascade")]);var YR=W("repo_configs",{repoKey:q("repo_key").primaryKey(),config:Ni().$type().notNull(),updatedAt:we("updated_at",{withTimezone:!0}).notNull().defaultNow()});var lt=W("usage_peaks",{window:q().$type().notNull(),resetsAt:ve("resets_at",{mode:"number"}).notNull(),segment:Z().notNull().default(0),usedPercentage:Mt("used_percentage").notNull(),resetDetected:Pi("reset_detected").notNull().default(!1),tokensUp:ve("tokens_up",{mode:"number"}).notNull().default(0),tokensDown:ve("tokens_down",{mode:"number"}).notNull().default(0),createdAt:we("created_at",{withTimezone:!0}).notNull().defaultNow()},t=>[ke({columns:[t.window,t.resetsAt,t.segment]})]);var XR=W("user_config",{id:Hu().primaryKey().default(1),config:Ni().$type().notNull(),updatedAt:we("updated_at",{withTimezone:!0}).notNull().defaultNow()});var Xs=W("metadata",{key:q().primaryKey(),value:q().notNull()}),er=W("feeds",{id:Z().generatedByDefaultAsIdentity().primaryKey(),url:q().notNull().unique()}),eD={items:at,comments:Wx,links:Yx,planPhases:ji,planTasks:n_,itemGitRefs:Hx,metadata:Xs,feeds:er,usagePeaks:lt,backups:Jx,phaseUsage:t_,phaseUsageMessages:r_,phaseCycleContext:Xx,phaseSessions:e_,repoConfigs:YR,inboxMessages:HR,userConfig:XR,jobRuns:hd};async function tD(t,e){return(await t.insert(er).values({url:e}).onConflictDoNothing({target:er.url}).returning({id:er.id})).length>0}var i_=class{static[g]="ConsoleLogWriter";write(e){console.log(e)}},gd=class{static[g]="DefaultLogger";writer;constructor(e){this.writer=e?.writer??new i_}logQuery(e,r){let i=r.map(o=>{try{return JSON.stringify(o)}catch{return String(o)}}),n=i.length?` -- params: [${i.join(", ")}]`:"";this.writer.write(`Query: ${e}${n}`)}},yd=class{static[g]="NoopLogger";logQuery(){}};async function rD(t){return(await t.select({url:er.url}).from(er).orderBy(td(er.id))).map(r=>r.url)}function nD(t){let r=t.news?.feeds;return Array.isArray(r)?r.filter(i=>typeof i=="string"):[]}async function iD(t){if((await rD(t)).length>0)return;let r=nD(PA()),i=r.length>0?r:nD(NA());for(let n of i)await tD(t,n)}var o_=3;var sD="usage_peaks_false_reset_cleanup",zG=(t,e)=>t!==void 0&&e>t-o_;function jG(t,e){for(;zG(t.at(-1),e);)e=Math.max(e,t.pop()??e);return e}function UG(t){let e=[];for(let r of t)e.push(jG(e,r));return e.map((r,i)=>({segment:i,usedPercentage:r,resetDetected:i<e.length-1}))}var oD=t=>`${t.segment}:${t.usedPercentage}:${t.resetDetected}`,MG=(t,e)=>t.length===e.length&&t.every((r,i)=>oD(r)===oD(e[i])),qG=t=>t.reduce((e,r)=>{let i=`${r.window} ${r.resetsAt}`;return e.set(i,[...e.get(i)??[],r])},new Map),FG=t=>t.reduce((e,r)=>r.createdAt<e?r.createdAt:e,t[0].createdAt);async function BG(t,{window:e,resetsAt:r},i,n){await t.delete(lt).where(un(Rr(lt.window,e),Rr(lt.resetsAt,r))),await t.insert(lt).values(n.map(o=>({window:e,resetsAt:r,createdAt:i,...o})))}async function ZG(t,e){let r=UG(e.map(i=>i.usedPercentage));MG(e,r)||await BG(t,e[0],FG(e),r)}var KG=t=>t.select().from(lt).orderBy(lt.window,lt.resetsAt,lt.segment),VG=t=>t.insert(Xs).values({key:sD,value:"done"}).onConflictDoNothing();async function GG(t){return(await t.select().from(Xs).where(Rr(Xs.key,sD))).length>0}async function aD(t){await t.transaction(async e=>{if(!await GG(e)){for(let r of qG(await KG(e)).values())await ZG(e,r);await VG(e)}})}var{Pool:QG,types:qt}=zn,s_=class extends fd{constructor(e,r,i,n,o,s,a,l,c,u,d){super({sql:r,params:i},o,s,a),this.client=e,this.queryString=r,this.params=i,this.logger=n,this.fields=l,this._isResponseInArrayMode=u,this.customResultMapper=d,this.rawQueryConfig={name:c,text:r,types:{getTypeParser:(f,m)=>f===qt.builtins.TIMESTAMPTZ?y=>y:f===qt.builtins.TIMESTAMP?y=>y:f===qt.builtins.DATE?y=>y:f===qt.builtins.INTERVAL?y=>y:f===1231?y=>y:f===1115?y=>y:f===1185?y=>y:f===1187?y=>y:f===1182?y=>y:qt.getTypeParser(f,m)}},this.queryConfig={name:c,text:r,rowMode:"array",types:{getTypeParser:(f,m)=>f===qt.builtins.TIMESTAMPTZ?y=>y:f===qt.builtins.TIMESTAMP?y=>y:f===qt.builtins.DATE?y=>y:f===qt.builtins.INTERVAL?y=>y:f===1231?y=>y:f===1115?y=>y:f===1185?y=>y:f===1187?y=>y:f===1182?y=>y:qt.getTypeParser(f,m)}}}static[g]="NodePgPreparedQuery";rawQueryConfig;queryConfig;async execute(e={}){return se.startActiveSpan("drizzle.execute",async()=>{let r=vS(this.params,e);this.logger.logQuery(this.rawQueryConfig.text,r);let{fields:i,rawQueryConfig:n,client:o,queryConfig:s,joinsNotNullableMap:a,customResultMapper:l}=this;if(!i&&!l)return se.startActiveSpan("drizzle.driver.execute",async u=>(u?.setAttributes({"drizzle.query.name":n.name,"drizzle.query.text":n.text,"drizzle.query.params":JSON.stringify(r)}),this.queryWithCache(n.text,r,async()=>await o.query(n,r))));let c=await se.startActiveSpan("drizzle.driver.execute",u=>(u?.setAttributes({"drizzle.query.name":s.name,"drizzle.query.text":s.text,"drizzle.query.params":JSON.stringify(r)}),this.queryWithCache(s.text,r,async()=>await o.query(s,r))));return se.startActiveSpan("drizzle.mapResponse",()=>l?l(c.rows):c.rows.map(u=>JA(i,u,a)))})}all(e={}){return se.startActiveSpan("drizzle.execute",()=>{let r=vS(this.params,e);return this.logger.logQuery(this.rawQueryConfig.text,r),se.startActiveSpan("drizzle.driver.execute",i=>(i?.setAttributes({"drizzle.query.name":this.rawQueryConfig.name,"drizzle.query.text":this.rawQueryConfig.text,"drizzle.query.params":JSON.stringify(r)}),this.queryWithCache(this.rawQueryConfig.text,r,async()=>this.client.query(this.rawQueryConfig,r)).then(n=>n.rows)))})}isResponseInArrayMode(){return this._isResponseInArrayMode}},vd=class t extends md{constructor(e,r,i,n={}){super(r),this.client=e,this.schema=i,this.options=n,this.logger=n.logger??new yd,this.cache=n.cache??new zi}static[g]="NodePgSession";logger;cache;prepareQuery(e,r,i,n,o,s,a){return new s_(this.client,e.sql,e.params,this.logger,this.cache,s,a,r,i,n,o)}async transaction(e,r){let i=this.client instanceof QG||Object.getPrototypeOf(this.client).constructor.name.includes("Pool"),n=i?new t(await this.client.connect(),this.dialect,this.schema,this.options):this,o=new a_(this.dialect,n,this.schema);await o.execute(v`begin${r?v` ${o.getTransactionConfigSQL(r)}`:void 0}`);try{let s=await e(o);return await o.execute(v`commit`),s}catch(s){throw await o.execute(v`rollback`),s}finally{i&&n.client.release()}}async count(e){let r=await this.execute(e);return Number(r.rows[0].count)}},a_=class t extends pd{static[g]="NodePgTransaction";async transaction(e){let r=`sp${this.nestedIndex+1}`,i=new t(this.dialect,this.session,this.schema,this.nestedIndex+1);await i.execute(v.raw(`savepoint ${r}`));try{let n=await e(i);return await i.execute(v.raw(`release savepoint ${r}`)),n}catch(n){throw await i.execute(v.raw(`rollback to savepoint ${r}`)),n}}};var l_=class{constructor(e,r,i={}){this.client=e,this.dialect=r,this.options=i}static[g]="NodePgDriver";createSession(e){return new vd(this.client,this.dialect,e,{logger:this.options.logger,cache:this.options.cache})}},c_=class extends Li{static[g]="NodePgDatabase"};function ea(t,e={}){let r=new Lr({casing:e.casing}),i;e.logger===!0?i=new gd:e.logger!==!1&&(i=e.logger);let n;if(e.schema){let l=QR(e.schema,WR);n={fullSchema:e.schema,schema:l.tables,tableNamesMap:l.tableNamesMap}}let s=new l_(t,r,{logger:i,cache:e.cache}).createSession(n),a=new c_(r,s,n);return a.$client=t,a.$cache=e.cache,a.$cache&&(a.$cache.invalidate=e.cache?.onMutate),a}function bd(...t){if(typeof t[0]=="string"){let e=new zn.Pool({connectionString:t[0]});return ea(e,t[1])}if(YA(t[0])){let{connection:e,client:r,...i}=t[0];if(r)return ea(r,i);let n=typeof e=="string"?new zn.Pool({connectionString:e}):new zn.Pool(e);return ea(n,i)}return ea(t[0],t[1])}(t=>{function e(r){return ea({},r)}t.mock=e})(bd||(bd={}));function lD(t){return bd(t,{schema:eD})}var JG=`
|
|
346
|
-
CREATE TABLE IF NOT EXISTS items (
|
|
347
|
-
id INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
|
|
348
|
-
origin TEXT NOT NULL,
|
|
349
|
-
type TEXT NOT NULL DEFAULT 'story',
|
|
350
|
-
name TEXT NOT NULL,
|
|
351
|
-
description TEXT,
|
|
352
|
-
acceptance_criteria TEXT NOT NULL DEFAULT '[]',
|
|
353
|
-
status TEXT NOT NULL DEFAULT 'todo',
|
|
354
|
-
current_phase INTEGER,
|
|
355
|
-
starred BOOLEAN NOT NULL DEFAULT false,
|
|
356
|
-
jira_key TEXT
|
|
357
|
-
);
|
|
358
|
-
|
|
359
|
-
-- Backfill the column on databases created before it was introduced.
|
|
360
|
-
ALTER TABLE items ADD COLUMN IF NOT EXISTS starred BOOLEAN NOT NULL DEFAULT false;
|
|
361
|
-
ALTER TABLE items ADD COLUMN IF NOT EXISTS jira_key TEXT;
|
|
362
|
-
|
|
363
|
-
CREATE INDEX IF NOT EXISTS items_origin_idx ON items (origin);
|
|
364
|
-
|
|
365
|
-
CREATE TABLE IF NOT EXISTS comments (
|
|
366
|
-
id INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
|
|
367
|
-
item_id INTEGER NOT NULL REFERENCES items(id) ON DELETE CASCADE,
|
|
368
|
-
idx INTEGER NOT NULL,
|
|
369
|
-
text TEXT NOT NULL,
|
|
370
|
-
phase INTEGER,
|
|
371
|
-
timestamp TEXT NOT NULL,
|
|
372
|
-
type TEXT NOT NULL DEFAULT 'comment'
|
|
373
|
-
);
|
|
374
|
-
|
|
375
|
-
CREATE TABLE IF NOT EXISTS links (
|
|
376
|
-
item_id INTEGER NOT NULL REFERENCES items(id) ON DELETE CASCADE,
|
|
377
|
-
type TEXT NOT NULL,
|
|
378
|
-
target_id INTEGER NOT NULL,
|
|
379
|
-
PRIMARY KEY (item_id, type, target_id)
|
|
380
|
-
);
|
|
381
|
-
|
|
382
|
-
CREATE TABLE IF NOT EXISTS plan_phases (
|
|
383
|
-
item_id INTEGER NOT NULL REFERENCES items(id) ON DELETE CASCADE,
|
|
384
|
-
idx INTEGER NOT NULL,
|
|
385
|
-
name TEXT NOT NULL,
|
|
386
|
-
manual_checks TEXT,
|
|
387
|
-
PRIMARY KEY (item_id, idx)
|
|
388
|
-
);
|
|
389
|
-
|
|
390
|
-
CREATE TABLE IF NOT EXISTS plan_tasks (
|
|
391
|
-
item_id INTEGER NOT NULL,
|
|
392
|
-
phase_idx INTEGER NOT NULL,
|
|
393
|
-
idx INTEGER NOT NULL,
|
|
394
|
-
task TEXT NOT NULL,
|
|
395
|
-
PRIMARY KEY (item_id, phase_idx, idx),
|
|
396
|
-
FOREIGN KEY (item_id, phase_idx) REFERENCES plan_phases(item_id, idx)
|
|
397
|
-
ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED
|
|
398
|
-
);
|
|
399
|
-
|
|
400
|
-
CREATE TABLE IF NOT EXISTS item_subtasks (
|
|
401
|
-
item_id INTEGER NOT NULL REFERENCES items(id) ON DELETE CASCADE,
|
|
402
|
-
idx INTEGER NOT NULL,
|
|
403
|
-
title TEXT NOT NULL,
|
|
404
|
-
description TEXT,
|
|
405
|
-
status TEXT NOT NULL DEFAULT 'todo',
|
|
406
|
-
PRIMARY KEY (item_id, idx)
|
|
407
|
-
);
|
|
408
|
-
|
|
409
|
-
CREATE TABLE IF NOT EXISTS metadata (
|
|
410
|
-
key TEXT PRIMARY KEY,
|
|
411
|
-
value TEXT NOT NULL
|
|
412
|
-
);
|
|
413
|
-
|
|
414
|
-
CREATE TABLE IF NOT EXISTS feeds (
|
|
415
|
-
id INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
|
|
416
|
-
url TEXT NOT NULL UNIQUE
|
|
417
|
-
);
|
|
418
|
-
|
|
419
|
-
CREATE TABLE IF NOT EXISTS handovers (
|
|
420
|
-
id INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
|
|
421
|
-
origin TEXT NOT NULL,
|
|
422
|
-
summary TEXT NOT NULL,
|
|
423
|
-
content TEXT NOT NULL,
|
|
424
|
-
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
|
425
|
-
recalled_at TIMESTAMPTZ
|
|
426
|
-
);
|
|
427
|
-
|
|
428
|
-
CREATE INDEX IF NOT EXISTS handovers_origin_idx ON handovers (origin);
|
|
429
|
-
|
|
430
|
-
CREATE TABLE IF NOT EXISTS usage_peaks (
|
|
431
|
-
"window" TEXT NOT NULL,
|
|
432
|
-
resets_at BIGINT NOT NULL,
|
|
433
|
-
segment INTEGER NOT NULL DEFAULT 0,
|
|
434
|
-
used_percentage DOUBLE PRECISION NOT NULL,
|
|
435
|
-
reset_detected BOOLEAN NOT NULL DEFAULT false,
|
|
436
|
-
tokens_up BIGINT NOT NULL DEFAULT 0,
|
|
437
|
-
tokens_down BIGINT NOT NULL DEFAULT 0,
|
|
438
|
-
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
|
439
|
-
PRIMARY KEY ("window", resets_at, segment)
|
|
440
|
-
);
|
|
441
|
-
|
|
442
|
-
-- Backfill columns on databases created before reset/segment tracking existed.
|
|
443
|
-
ALTER TABLE usage_peaks ADD COLUMN IF NOT EXISTS reset_detected BOOLEAN NOT NULL DEFAULT false;
|
|
444
|
-
ALTER TABLE usage_peaks ADD COLUMN IF NOT EXISTS segment INTEGER NOT NULL DEFAULT 0;
|
|
445
|
-
ALTER TABLE usage_peaks ADD COLUMN IF NOT EXISTS created_at TIMESTAMPTZ NOT NULL DEFAULT now();
|
|
446
|
-
ALTER TABLE usage_peaks ADD COLUMN IF NOT EXISTS tokens_up BIGINT NOT NULL DEFAULT 0;
|
|
447
|
-
ALTER TABLE usage_peaks ADD COLUMN IF NOT EXISTS tokens_down BIGINT NOT NULL DEFAULT 0;
|
|
448
|
-
|
|
449
|
-
-- Widen the primary key to include segment so a cycle can hold both its
|
|
450
|
-
-- pre-reset peak and its post-reset continuation. Idempotent: only fires
|
|
451
|
-
-- while the legacy two-column key is still in place.
|
|
452
|
-
DO $$
|
|
453
|
-
BEGIN
|
|
454
|
-
IF EXISTS (
|
|
455
|
-
SELECT 1 FROM pg_constraint
|
|
456
|
-
WHERE conname = 'usage_peaks_pkey'
|
|
457
|
-
AND conrelid = 'usage_peaks'::regclass
|
|
458
|
-
AND array_length(conkey, 1) = 2
|
|
459
|
-
) THEN
|
|
460
|
-
ALTER TABLE usage_peaks DROP CONSTRAINT usage_peaks_pkey;
|
|
461
|
-
ALTER TABLE usage_peaks ADD CONSTRAINT usage_peaks_pkey
|
|
462
|
-
PRIMARY KEY ("window", resets_at, segment);
|
|
463
|
-
END IF;
|
|
464
|
-
END $$;
|
|
465
|
-
|
|
466
|
-
CREATE TABLE IF NOT EXISTS backups (
|
|
467
|
-
id INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
|
|
468
|
-
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
|
469
|
-
file_path TEXT NOT NULL,
|
|
470
|
-
size_bytes BIGINT NOT NULL,
|
|
471
|
-
duration_ms INTEGER
|
|
472
|
-
);
|
|
473
|
-
|
|
474
|
-
-- Backfill for databases created before backup duration was tracked.
|
|
475
|
-
ALTER TABLE backups ADD COLUMN IF NOT EXISTS duration_ms INTEGER;
|
|
476
|
-
|
|
477
|
-
CREATE TABLE IF NOT EXISTS phase_usage (
|
|
478
|
-
item_id INTEGER NOT NULL REFERENCES items(id) ON DELETE CASCADE,
|
|
479
|
-
phase_idx INTEGER NOT NULL,
|
|
480
|
-
tokens_up BIGINT NOT NULL DEFAULT 0,
|
|
481
|
-
tokens_down BIGINT NOT NULL DEFAULT 0,
|
|
482
|
-
active_ms BIGINT NOT NULL DEFAULT 0,
|
|
483
|
-
peak_context_pct DOUBLE PRECISION NOT NULL DEFAULT 0,
|
|
484
|
-
last_total_in BIGINT,
|
|
485
|
-
last_total_out BIGINT,
|
|
486
|
-
PRIMARY KEY (item_id, phase_idx)
|
|
487
|
-
);
|
|
488
|
-
|
|
489
|
-
ALTER TABLE phase_usage ADD COLUMN IF NOT EXISTS last_total_in BIGINT;
|
|
490
|
-
ALTER TABLE phase_usage ADD COLUMN IF NOT EXISTS last_total_out BIGINT;
|
|
491
|
-
ALTER TABLE phase_usage ADD COLUMN IF NOT EXISTS peak_context_pct DOUBLE PRECISION NOT NULL DEFAULT 0;
|
|
492
|
-
ALTER TABLE phase_usage ADD COLUMN IF NOT EXISTS claude_session_id TEXT;
|
|
493
|
-
|
|
494
|
-
CREATE TABLE IF NOT EXISTS phase_usage_messages (
|
|
495
|
-
item_id INTEGER NOT NULL REFERENCES items(id) ON DELETE CASCADE,
|
|
496
|
-
phase_idx INTEGER NOT NULL,
|
|
497
|
-
message_id TEXT NOT NULL,
|
|
498
|
-
PRIMARY KEY (item_id, phase_idx, message_id)
|
|
499
|
-
);
|
|
500
|
-
|
|
501
|
-
-- Git activity (branch/commit/PR) snapshotted for an item during a run. The
|
|
502
|
-
-- (item_id, kind, ref) primary key makes re-snapshotting the same ref a no-op
|
|
503
|
-
-- upsert rather than a duplicate row.
|
|
504
|
-
CREATE TABLE IF NOT EXISTS item_git_refs (
|
|
505
|
-
item_id INTEGER NOT NULL REFERENCES items(id) ON DELETE CASCADE,
|
|
506
|
-
kind TEXT NOT NULL,
|
|
507
|
-
ref TEXT NOT NULL,
|
|
508
|
-
title TEXT,
|
|
509
|
-
url TEXT,
|
|
510
|
-
state TEXT,
|
|
511
|
-
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
|
512
|
-
PRIMARY KEY (item_id, kind, ref)
|
|
513
|
-
);
|
|
514
|
-
`,cD={id:1,name:"baseline",sql:JG};var WG=`
|
|
515
|
-
ALTER TABLE usage_peaks ADD COLUMN IF NOT EXISTS context_pct_sum DOUBLE PRECISION NOT NULL DEFAULT 0;
|
|
516
|
-
ALTER TABLE usage_peaks ADD COLUMN IF NOT EXISTS context_readings BIGINT NOT NULL DEFAULT 0;
|
|
517
|
-
`,uD={id:2,name:"usage-peaks-context",sql:WG};var HG=`
|
|
518
|
-
CREATE TABLE IF NOT EXISTS phase_cycle_context (
|
|
519
|
-
item_id INTEGER NOT NULL REFERENCES items(id) ON DELETE CASCADE,
|
|
520
|
-
phase_idx INTEGER NOT NULL,
|
|
521
|
-
"window" TEXT NOT NULL,
|
|
522
|
-
resets_at BIGINT NOT NULL,
|
|
523
|
-
peak_context_pct DOUBLE PRECISION NOT NULL DEFAULT 0,
|
|
524
|
-
PRIMARY KEY (item_id, phase_idx, "window", resets_at)
|
|
525
|
-
);
|
|
526
|
-
`,dD={id:3,name:"phase-cycle-context",sql:HG};var YG=`
|
|
527
|
-
-- destructive-ok: the context_pct_sum/context_readings accumulator (added in
|
|
528
|
-
-- migration 2) was superseded by phase_cycle_context (migration 3); no build
|
|
529
|
-
-- reads these columns \u2014 they are unmapped in Drizzle and never selected.
|
|
530
|
-
ALTER TABLE usage_peaks DROP COLUMN IF EXISTS context_pct_sum;
|
|
531
|
-
ALTER TABLE usage_peaks DROP COLUMN IF EXISTS context_readings;
|
|
532
|
-
`,fD={id:4,name:"drop-usage-peaks-context",sql:YG};var XG=`
|
|
533
|
-
CREATE TABLE IF NOT EXISTS phase_sessions (
|
|
534
|
-
item_id INTEGER NOT NULL REFERENCES items(id) ON DELETE CASCADE,
|
|
535
|
-
phase_idx INTEGER NOT NULL,
|
|
536
|
-
claude_session_id TEXT NOT NULL,
|
|
537
|
-
hostname TEXT NOT NULL,
|
|
538
|
-
os_user TEXT NOT NULL,
|
|
539
|
-
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
|
540
|
-
PRIMARY KEY (item_id, phase_idx, claude_session_id)
|
|
541
|
-
);
|
|
542
|
-
`,mD={id:5,name:"phase-sessions",sql:XG};var e7=`
|
|
543
|
-
INSERT INTO phase_sessions (item_id, phase_idx, claude_session_id, hostname, os_user)
|
|
544
|
-
SELECT pu.item_id, pu.phase_idx, pu.claude_session_id, 'unknown', 'unknown'
|
|
545
|
-
FROM phase_usage pu
|
|
546
|
-
WHERE pu.claude_session_id IS NOT NULL
|
|
547
|
-
AND EXISTS (SELECT 1 FROM items i WHERE i.id = pu.item_id)
|
|
548
|
-
ON CONFLICT (item_id, phase_idx, claude_session_id) DO NOTHING;
|
|
549
|
-
`,pD={id:6,name:"backfill-phase-sessions",sql:e7};var t7=`
|
|
550
|
-
ALTER TABLE items ADD COLUMN IF NOT EXISTS github_issue TEXT;
|
|
551
|
-
`,hD={id:7,name:"github-issue",sql:t7};var r7=`
|
|
552
|
-
CREATE TABLE IF NOT EXISTS repo_configs (
|
|
553
|
-
repo_key TEXT PRIMARY KEY,
|
|
554
|
-
config JSONB NOT NULL,
|
|
555
|
-
updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
|
|
556
|
-
);
|
|
557
|
-
`,gD={id:8,name:"repo-configs",sql:r7};var n7=`
|
|
558
|
-
CREATE TABLE IF NOT EXISTS inbox_messages (
|
|
559
|
-
source TEXT NOT NULL,
|
|
560
|
-
message_id TEXT NOT NULL,
|
|
561
|
-
sender TEXT NOT NULL,
|
|
562
|
-
summary TEXT NOT NULL,
|
|
563
|
-
link TEXT NOT NULL,
|
|
564
|
-
received_at TIMESTAMPTZ,
|
|
565
|
-
flagged_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
|
566
|
-
dismissed_at TIMESTAMPTZ,
|
|
567
|
-
PRIMARY KEY (source, message_id)
|
|
568
|
-
);
|
|
569
|
-
`,yD={id:9,name:"inbox-messages",sql:n7};var i7=`
|
|
570
|
-
CREATE TABLE IF NOT EXISTS user_config (
|
|
571
|
-
id SMALLINT PRIMARY KEY DEFAULT 1 CHECK (id = 1),
|
|
572
|
-
config JSONB NOT NULL,
|
|
573
|
-
updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
|
|
574
|
-
);
|
|
575
|
-
`,vD={id:10,name:"user-config",sql:i7};var o7=`
|
|
576
|
-
CREATE TABLE IF NOT EXISTS job_runs (
|
|
577
|
-
id INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
|
|
578
|
-
kind TEXT NOT NULL,
|
|
579
|
-
trigger TEXT NOT NULL,
|
|
580
|
-
model TEXT,
|
|
581
|
-
started_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
|
582
|
-
finished_at TIMESTAMPTZ,
|
|
583
|
-
duration_ms BIGINT,
|
|
584
|
-
input_tokens BIGINT NOT NULL DEFAULT 0,
|
|
585
|
-
output_tokens BIGINT NOT NULL DEFAULT 0,
|
|
586
|
-
cache_read_tokens BIGINT NOT NULL DEFAULT 0,
|
|
587
|
-
cache_write_tokens BIGINT NOT NULL DEFAULT 0,
|
|
588
|
-
cost_usd DOUBLE PRECISION,
|
|
589
|
-
status TEXT NOT NULL DEFAULT 'running',
|
|
590
|
-
detail TEXT,
|
|
591
|
-
repo TEXT,
|
|
592
|
-
pr_number INTEGER,
|
|
593
|
-
reviewer TEXT
|
|
594
|
-
);
|
|
595
|
-
CREATE INDEX IF NOT EXISTS job_runs_started_at_idx ON job_runs (started_at);
|
|
596
|
-
`,bD={id:11,name:"job-runs",sql:o7};var wd=[cD,uD,dD,fD,mD,pD,hD,gD,yD,vD,bD],She=wd.reduce((t,e)=>Math.max(t,e.id),0);var Sd="applied_migrations",$he=`
|
|
597
|
-
CREATE TABLE IF NOT EXISTS ${Sd} (
|
|
598
|
-
id INTEGER PRIMARY KEY,
|
|
599
|
-
name TEXT NOT NULL,
|
|
600
|
-
applied_at TIMESTAMPTZ NOT NULL DEFAULT now()
|
|
601
|
-
);
|
|
602
|
-
`;var wD=t=>t.reduce((e,r)=>Math.max(e,r),0);function s7(t){let e=wd.map(l=>l.id),r=new Set(t),i=new Set(e),n=wD(t),o=wD(e);if(t.filter(l=>!i.has(l)).length>0)return{state:"ahead",applied:n,expected:o};let a=e.filter(l=>!r.has(l));return a.length>0?{state:"behind",applied:n,expected:o,pending:a}:{state:"in-sync",version:o}}async function a7(t){return(await t.query(`SELECT to_regclass('public.${Sd}') AS reg`))[0]?.reg?(await t.query(`SELECT id FROM ${Sd} ORDER BY id`)).map(i=>Number(i.id)):[]}async function SD(t){return s7(await a7(t))}var l7=(t,e)=>`Assist database is behind this build (applied migration ${t}, build expects ${e}).
|
|
603
|
-
Run \`assist db migrate\` to apply the pending migrations.`,c7=(t,e)=>`Assist database is ahead of this build (applied migration ${t}, build knows ${e}).
|
|
604
|
-
Update assist (\`assist update\`) to a build that includes the newer migrations.`;async function xD(t){let e=await SD(t);if(e.state==="behind")throw new Error(l7(e.applied,e.expected));if(e.state==="ahead")throw new Error(c7(e.applied,e.expected))}function _D(t){return{exec:e=>t.query(e),query:async(e,r)=>(await t.query(e,r)).rows}}var u7="ASSIST_DATABASE_URL",d7=`No assist database configured.
|
|
605
|
-
|
|
606
|
-
Assist storage requires a Postgres-compatible connection string. Set one via either:
|
|
607
|
-
\u2022 the ${u7} environment variable, or
|
|
608
|
-
\u2022 database.url in ~/.assist.yml
|
|
609
|
-
|
|
610
|
-
Example:
|
|
611
|
-
database:
|
|
612
|
-
url: postgresql://user:password@host:5432/database
|
|
613
|
-
|
|
614
|
-
Managed Postgres providers such as Supabase or Neon work out of the box.`,xd=class extends Error{constructor(){super(d7),this.name="MissingDatabaseUrlError"}};function $D(){let t=process.env.ASSIST_DATABASE_URL??Ti().database.url;if(!t)throw new xd;return t}async function f7(t){try{await aD(t)}catch(e){console.error(`${new Date().toISOString()} usage-peaks cleanup failed: ${String(e)}`)}}function m7(t){console.error(`${new Date().toISOString()} backlog pool error: ${t.message}`)}function p7(){let t=new sI({connectionString:$D(),max:10,idleTimeoutMillis:3e4,connectionTimeoutMillis:1e4});return t.on("error",m7),t}async function h7(t){await xD(_D(t));let e=lD(t);return await iD(e),await f7(e),e}var Ui,_d,u_;function g7(){_d?.end().catch(()=>{}),Ui=void 0,_d=void 0}function kD(){if(u_)return Promise.resolve(u_);if(Ui)return Ui;try{_d=p7()}catch(t){return Promise.reject(t)}return Ui=h7(_d),Ui.then(t=>u_=t).catch(g7),Ui}async function TD(t,e){await t.insert(hd).values(e)}function y7(t,e,r,i){let n=t.elapsedMs??i.getTime()-r.getTime(),o=t.exitCode!==0;return{kind:"review",trigger:"manual",model:t.model??null,startedAt:r,finishedAt:new Date(r.getTime()+n),durationMs:n,inputTokens:t.usage?.input??0,outputTokens:t.usage?.output??0,cacheReadTokens:t.usage?.cacheRead??0,cacheWriteTokens:t.usage?.cacheWrite??0,costUsd:null,status:o?"failed":"finished",detail:o?`exit ${t.exitCode}`:null,repo:e.repo,prNumber:e.prNumber,reviewer:t.name}}async function ED(t,e,r,i=kD){if(t.length===0)return;let n=new Date;try{let o=await i();for(let s of t)await TD(o,y7(s,e,r,n))}catch(o){let s=o instanceof Error?o.message:String(o);console.error(`Could not record reviewer runs: ${s}`)}}function et(t,e){return e?`${t} (${e})`:t}var ID="ASSIST_LITELLM_API_KEY";function $d(t,e,r){return{args:["-c","model_providers.litellm.name=LiteLLM","-c",`model_providers.litellm.base_url=${t}`,"-c",`model_providers.litellm.env_key=${ID}`,"-c","model_providers.litellm.wire_api=responses","-c","model_provider=litellm","-m",r],env:{[ID]:e},model:r}}function CD(){let t=Ti().litellm,e=t?.baseUrl?.trim(),r=t?.apiKey?.trim(),i=[...e?[]:["litellm.baseUrl"],...r?[]:["litellm.apiKey"]];return!e||!r?{config:null,missing:i}:{config:{baseUrl:e.replace(/\/+$/,""),apiKey:r},missing:i}}function PD(t){let e=t?.trim();if(!e)return{args:[],env:{}};let{config:r}=CD();return r?$d(`${r.baseUrl}/v1`,r.apiKey,e):{args:[],env:{}}}function kd(){return PD(Ti().review?.codexModel)}import{writeFileSync as R7}from"node:fs";function Td(t,e=80){let r=t.replace(/\s+/g," ").trim();return r.length<=e?r:`${r.slice(0,e-1)}\u2026`}function zr(t,e){let r=t[e];return typeof r=="string"?r:null}function ND(t){if(!t||typeof t!="object")return"";let e=t,r=zr(e,"pattern");if(r){let l=zr(e,"path");return l?`${r} in ${l}`:r}let i=zr(e,"file_path")??zr(e,"path");if(i)return i;let n=zr(e,"command");if(n)return Td(n);let o=zr(e,"url");if(o)return o;let s=zr(e,"query");if(s)return Td(s);let a=zr(e,"description");return a?Td(a):""}function OD(t){let e=t.match(/^\/bin\/bash\s+-lc\s+"(.*)"\s*$/s),r=e?e[1].replace(/\\"/g,'"'):t;return Td(r)}function Ed(t){return typeof t=="number"?t:0}function Id(t,e){if(typeof t!="object"||t===null)return;let r=t,i={input:Ed(r.input_tokens),output:Ed(r.output_tokens),cacheRead:Ed(r[e.cacheRead])};return e.cacheWrite&&(i.cacheWrite=Ed(r[e.cacheWrite])),i}function AD(t){return Id(t,{cacheRead:"cache_read_input_tokens",cacheWrite:"cache_creation_input_tokens"})}function v7(t){return typeof t=="object"&&t!==null&&t.type==="assistant"}function b7(t){return typeof t=="object"&&t!==null&&t.type==="result"}function w7(t){let e=t.message?.content??[],r=[];for(let i of e){if(i.type!=="tool_use")continue;let n=i,o=typeof n.name=="string"?n.name:"tool";r.push({tool:o,summary:ND(n.input)})}return r}function RD(t){let e;try{e=JSON.parse(t)}catch{return{kind:"ignore"}}if(v7(e)){let r=w7(e);if(r.length>0)return{kind:"tool_uses",toolUses:r}}if(b7(e)&&typeof e.result=="string"){let r=AD(e.usage);return r?{kind:"final",text:e.result,usage:r}:{kind:"final",text:e.result}}return{kind:"ignore"}}function DD(t,e,r){let i=r?`: ${r}`:"";return`${t} \u2014 ${e}${i}`}function Cd(t,e,r,i){let n=et(t,i);if(r){r.text=DD(n,e.tool,e.summary);return}let o=e.summary?`: ${e.summary}`:"";console.log(`[${n}] ${e.tool}${o}`)}function LD(t,e,r){let i={finalText:""};return{state:i,onLine:o=>{let s=RD(o);if(s.kind==="tool_uses"){for(let a of s.toolUses)Cd(t,a,e,r);return}s.kind==="final"&&(i.finalText=s.text,i.usage=s.usage)}}}var zD=80;function S7(t){let e=t.split(/\r?\n/).find(i=>i.trim().length>0);if(!e)return"";let r=e.trim();return r.length>zD?`${r.slice(0,zD-1)}\u2026`:r}function jD(t,e){let r=et(e.name,e.model),i=Math.round(e.elapsedMs/1e3);if(e.exitCode===0){t.succeed(`${r} \u2014 done in ${i}s`);return}let n=S7(e.stderr??""),o=n?`: ${n}`:"";t.fail(`${r} \u2014 failed in ${i}s (exit ${e.exitCode})${o}`)}function Pd(t,e,r){return e&&jD(e,{name:t.name,model:t.model,exitCode:r.exitCode,elapsedMs:r.elapsedMs,stderr:r.stderr}),{name:t.name,command:t.command,model:t.model,outputPath:t.outputPath,exitCode:r.exitCode,stderr:r.stderr,stdout:r.stdout,elapsedMs:r.elapsedMs}}import{spawn as N7}from"node:child_process";function x7(t,e){let r=t;for(;;){let i=r.indexOf(`
|
|
615
|
-
`);if(i===-1)return r;let n=r.slice(0,i);r=r.slice(i+1),n.trim()&&e(n)}}function UD(t,e){let r="";return t.stdout?.on("data",i=>{r+=i.toString("utf8"),r=x7(r,e)}),()=>{r.trim()&&e(r)}}function MD(t){let e={value:""};return t.stderr?.on("data",r=>{e.value+=r.toString("utf8")}),e}function qD(t,e=8192){let r={value:""};return t.stdout?.on("data",i=>{r.value+=i.toString("utf8"),r.value.length>e&&(r.value=r.value.slice(r.value.length-e))}),r}var _7=1e3,FD=20;function BD(t){return t.split(/\r?\n/).map(e=>` ${e}`)}function $7(t,e){let r=t.split(/\r?\n/);return r.length<=e?t:r.slice(-e).join(`
|
|
616
|
-
`)}function k7(t){return t.exitCode!==0&&t.elapsedMs!==void 0&&t.elapsedMs<_7}function T7(t){return[`${t} exited almost immediately \u2014 it likely failed to start.`,"Common causes: not installed on PATH, not authenticated, or misconfigured.",`Try \`${t} --version\` to confirm install, then \`${t} login\` if authentication may be missing.`]}function E7(t){let e=t.stderr.trim();if(e)return["stderr:",...BD(e)];let r=(t.stdout??"").trim();return r?[`stdout (no stderr was captured \u2014 showing last ${FD} lines):`,...BD($7(r,FD))]:["No stderr or stdout was captured. Check the review folder for partial output, or rerun with --verbose for full streaming output."]}function d_(t){let e=t.command??t.name,r=Math.round((t.elapsedMs??0)/1e3),i=`${et(e,t.model)} CLI exited with code ${t.exitCode} after ${r}s`,n=[];return k7(t)&&n.push(...T7(e)),n.push(...E7(t)),{headerLine:i,detailLines:n}}function ZD(t){if(t.exitCode===0)return;let e=d_(t);console.error(`[${t.name}] ${e.headerLine}`);for(let r of e.detailLines)console.error(r)}function KD(t){let e=Math.round(t.elapsedMs/1e3);if(t.exitCode===0){console.log(`[${t.name}] done in ${e}s`);return}let r=d_({name:t.name,command:t.command,model:t.model,exitCode:t.exitCode,stderr:t.stderr,stdout:t.stdout,elapsedMs:t.elapsedMs});console.error(`[${t.name}] ${r.headerLine}`);for(let i of r.detailLines)console.error(i)}function VD(t){let e=Date.now()-t.startedAt,r=t.code??0;return t.quiet||KD({name:t.name,command:t.command,model:t.model,exitCode:r,elapsedMs:e,stderr:t.stderr,stdout:t.stdout}),{exitCode:r,elapsedMs:e}}function I7(t,e){return t.code==="ENOENT"?`command not found: ${e}`:t.message||String(t)}function GD(t,e){let r=I7(e,t.command),i=t.stderr?`${t.stderr}
|
|
617
|
-
${r}`:r;return t.quiet||console.error(`[${t.name}] failed: ${r}`),{exitCode:127,stderr:i,stdout:t.stdout,elapsedMs:Date.now()-t.startedAt}}function C7(t,e){return t.flushPending(),GD({command:t.command,name:t.name,stderr:t.stderr.value,stdout:t.stdout.value,startedAt:t.startedAt,quiet:t.quiet},e)}function P7(t,e){return t.flushPending(),{...VD({code:e,startedAt:t.startedAt,name:t.name,command:t.command,model:t.model,stderr:t.stderr.value,stdout:t.stdout.value,quiet:t.quiet}),stderr:t.stderr.value,stdout:t.stdout.value}}function QD(t){return new Promise(e=>{let r=!1,i=n=>{r||(r=!0,e(n))};t.child.on("error",n=>i(C7(t,n))),t.child.on("close",n=>i(P7(t,n)))})}function O7(t,e){t.stdin?.on("error",()=>{});try{t.stdin?.write(e),t.stdin?.end()}catch{}}function A7(t){let e=N7(t.command,t.args,{stdio:["pipe","pipe","pipe"],shell:process.platform==="win32",...t.env?{env:{...process.env,...t.env}}:{}}),r=UD(e,t.onLine),i=MD(e),n=qD(e);return O7(e,t.stdin),{child:e,flushPending:r,stderr:i,stdout:n}}function Nd(t){let e=Date.now();t.quiet||console.log(`[${et(t.name,t.model)}] starting`);let{child:r,flushPending:i,stderr:n,stdout:o}=A7(t);return QD({child:r,flushPending:i,stderr:n,stdout:o,name:t.name,command:t.command,model:t.model,startedAt:e,quiet:t.quiet??!1})}async function JD(t){let{spinner:e,override:r}=t,i="claude",{state:n,onLine:o}=LD(t.name,e,r?.model),s=await Nd({name:t.name,command:i,model:r?.model,args:["-p","--add-dir",t.reviewDir,"--output-format","stream-json","--verbose",...r?.args??[]],stdin:t.stdin,quiet:!!e,...r?{env:r.env}:{},onLine:o});s.exitCode===0&&n.finalText&&R7(t.outputPath,n.finalText);let a=Pd({...t,command:i,model:r?.model},e,s);return n.usage?{...a,usage:n.usage}:a}import{existsSync as j7,unlinkSync as U7}from"node:fs";function WD(t){return Id(t,{cacheRead:"cached_input_tokens"})}function D7(t){return typeof t=="object"&&t!==null&&t.type==="item.started"}function L7(t){return typeof t=="object"&&t!==null&&t.type==="turn.completed"}function HD(t){let e;try{e=JSON.parse(t)}catch{return{kind:"ignore"}}if(L7(e)){let i=WD(e.usage);return i?{kind:"usage",usage:i}:{kind:"ignore"}}if(!D7(e))return{kind:"ignore"};let r=e.item;return r?r.type==="command_execution"&&typeof r.command=="string"?{kind:"tool_use",tool:"shell",summary:OD(r.command)}:{kind:"ignore"}:{kind:"ignore"}}function z7(t,e){return t?{input:t.input+e.input,output:t.output+e.output,cacheRead:t.cacheRead+e.cacheRead}:e}function YD(t,e,r){let i={};return{state:i,onLine:o=>{let s=HD(o);s.kind==="tool_use"?Cd(t,s,e,r):s.kind==="usage"&&(i.usage=z7(i.usage,s.usage))}}}function M7(t,e){return["exec",...e,"--sandbox","read-only","--json","--output-last-message",t]}async function XD(t){let{spinner:e,override:r}=t,i="codex",{state:n,onLine:o}=YD(t.name,e,r.model),s=await Nd({name:t.name,command:i,model:r.model,args:M7(t.outputPath,r.args),stdin:t.stdin,quiet:!!e,...r.args.length>0?{env:r.env}:{},onLine:o});s.exitCode!==0&&j7(t.outputPath)&&U7(t.outputPath);let a=Pd({name:t.name,command:i,model:r.model,outputPath:t.outputPath},e,s);return n.usage?{...a,usage:n.usage}:a}function Mi(t,e){return t==="claude"?JD(e):XD({name:e.name,stdin:e.stdin,outputPath:e.outputPath,spinner:e.spinner,override:e.override??kd()})}function eL(t){if(t.cached)return Promise.resolve(t.cached);let e=t.slot?.label??"claude",r=t.slot?.override,i=t.multi?.create(`${et(e,r?.model)} \u2014 starting`);return Mi(t.slot?.harness??"claude",{name:e,reviewDir:t.reviewDir,stdin:t.stdin,outputPath:t.claudePath,spinner:i,override:r})}function tL(t){if(t.plan.kind==="cached")return Promise.resolve(t.plan.cached);if(t.plan.kind==="skipped")return Promise.resolve(hT(t.codexPath));let e=t.slot?.label??"codex",r=t.slot?.override??kd(),i=t.multi?.create(`${et(e,r.model)} \u2014 starting`);return Mi(t.slot?.harness??"codex",{name:e,reviewDir:t.reviewDir,stdin:t.stdin,outputPath:t.codexPath,spinner:i,override:r})}async function rL(t,e,r,i,n){let o=eL({reviewDir:t,claudePath:e,stdin:i,cached:n.cachedClaude,multi:n.multi,slot:n.models.claude}),s=tL({reviewDir:t,codexPath:r,stdin:i,plan:n.codexPlan,multi:n.multi,slot:n.models.codex}),a=await Promise.all([o,s]),l=n.cachedClaude===null||n.codexPlan.kind!=="cached",c=a.filter((u,d)=>d===0?n.cachedClaude===null:n.codexPlan.kind==="run");return{results:a,anyFresh:l,fresh:c}}import{existsSync as B7,unlinkSync as Z7}from"node:fs";import{readFileSync as F7}from"node:fs";var q7=`You are consolidating two independent code reviews of the same change. The original review request is in request.md. The two reviews are in claude.md and codex.md in the current working directory.
|
|
618
|
-
|
|
619
|
-
If codex.md does not exist on disk, the codex reviewer was skipped (CLI unavailable). In that case, work from claude.md alone; treat every finding as 'claude-only', do not mark anything 'confirmed' or 'codex-only', and add a note in the Summary that the codex reviewer was skipped.
|
|
620
|
-
|
|
621
|
-
Read all available review files, deduplicate findings, and produce a single consolidated review in Markdown with this exact structure:
|
|
622
|
-
|
|
623
|
-
# Code review synthesis
|
|
624
|
-
|
|
625
|
-
## Summary
|
|
626
|
-
|
|
627
|
-
A 2-3 sentence overall summary of the change's quality and the most important risks.
|
|
628
|
-
|
|
629
|
-
## Findings
|
|
630
|
-
|
|
631
|
-
For each finding, emit one block in this exact format:
|
|
632
|
-
|
|
633
|
-
### Finding: <short title>
|
|
634
|
-
- Severity: blocker | major | minor | nit
|
|
635
|
-
- Source: confirmed | disputed | claude-only | codex-only | already-raised
|
|
636
|
-
- Location: \`path/to/file.ext:LINE\` or \`n/a\` when not tied to a specific line
|
|
637
|
-
- Impact: one sentence on what could go wrong
|
|
638
|
-
- Recommendation: one or two sentences with a concrete change
|
|
639
|
-
|
|
640
|
-
Severity rubric (recalibrate each finding against this \u2014 reviewers tend to inflate):
|
|
641
|
-
- **blocker** \u2014 ships broken behaviour: crash, data loss, security hole, breaks the build or existing tests, or violates a stated requirement.
|
|
642
|
-
- **major** \u2014 likely bug, missing error handling on a real failure mode, or a regression in existing behaviour. Not "this could be cleaner" or "this might be slow."
|
|
643
|
-
- **minor** \u2014 narrow correctness or clarity issue with limited blast radius; worth fixing but not urgent.
|
|
644
|
-
- **nit** \u2014 style, naming, micro-refactors, comment wording; reviewer would not block on it.
|
|
645
|
-
|
|
646
|
-
Default to the lower tier when uncertain. Code-style preferences, refactor suggestions, and "I would have written it differently" belong in nit \u2014 not major. A finding is only major if you can name a concrete failure mode or regression. If a reviewer marked something major but the impact reads as taste or hypothetical, downgrade it.
|
|
647
|
-
|
|
648
|
-
## Keep tautological-test findings
|
|
649
|
-
|
|
650
|
-
A finding that a test added or changed by this change is tautological or vacuous \u2014 it asserts a mock returns its stub, computes its expected value with the code under test, only checks a mock was called, has no real assertions, snapshots mocked output, or would still pass if the implementation broke \u2014 is a legitimate defect, not taste. Keep it even when only one reviewer raised it, and do not downgrade it below minor. Keep major when the test is the sole coverage of a behaviour the change introduces or modifies.
|
|
651
|
-
|
|
652
|
-
Rules:
|
|
653
|
-
- \`confirmed\` = both reviewers raised it.
|
|
654
|
-
- \`disputed\` = the reviewers disagreed on the diagnosis or fix.
|
|
655
|
-
- \`claude-only\` / \`codex-only\` = only one reviewer raised it.
|
|
656
|
-
- \`already-raised\` = a prior review comment in request.md (under "Prior review comments") substantively covers this finding \u2014 same file, same defect or recommendation. Use this even when the prior thread is resolved or outdated. Cosmetic overlap is not enough; the prior comment must address the same underlying issue. Prefer \`already-raised\` over the other source values when it applies.
|
|
657
|
-
- Order findings by severity (blocker, major, minor, nit), then by source (confirmed first).
|
|
658
|
-
- If a finding has no specific file:line, set Location to \`n/a\` exactly.
|
|
659
|
-
- Do not invent findings beyond what the two reviews support.
|
|
660
|
-
|
|
661
|
-
## Drop comment-adding findings
|
|
662
|
-
|
|
663
|
-
This codebase enforces self-documenting code, so a recommendation to add a code comment cannot be applied. Omit from the consolidated output entirely any finding whose recommendation is to add a code comment \u2014 including a comment that restates what the code does, labels a block, or narrates why the change was made \u2014 and any finding whose defect is that comments are absent. Omit it, do not downgrade it to nit: drop it even when only one reviewer raised it, and even when both reviewers agreed on it.
|
|
664
|
-
|
|
665
|
-
Two cases survive consolidation and must be kept:
|
|
666
|
-
|
|
667
|
-
1. A finding about a comment this change made stale or wrong, where the recommendation is to remove or correct it.
|
|
668
|
-
2. A finding about genuinely misleading code, where the recommendation is a clearer name, a smaller function, or a test. If the recommendation is instead to add a comment, drop it.
|
|
669
|
-
|
|
670
|
-
Output only the consolidated Markdown. No preamble, no commentary about your process.`;function nL(t,e,r){return`${q7}
|
|
671
|
-
|
|
672
|
-
Files:
|
|
673
|
-
- Request: ${t}
|
|
674
|
-
- Claude review: ${e}
|
|
675
|
-
- Codex review: ${r}
|
|
676
|
-
`}function iL(t){let e=F7(t,"utf8");console.log(""),console.log(nr(e)),console.log("")}async function oL(t,e){let r=yn("synthesis",t.synthesisPath);if(r)return iL(t.synthesisPath),r;let{multi:i,slot:n}=e,o=n?.override,s=i?.create(`${et("synthesis",o?.model)} \u2014 starting`),a=await Mi(n?.harness??"claude",{name:"synthesis",reviewDir:t.reviewDir,stdin:nL(t.requestPath,t.claudePath,t.codexPath),outputPath:t.synthesisPath,spinner:s,override:o});return a.exitCode===0&&iL(t.synthesisPath),a}async function sL(t){let{paths:e,failures:r}=t;t.anyFresh&&B7(e.synthesisPath)&&Z7(e.synthesisPath);let i=await oL(e,{multi:t.multi,slot:t.slot});return i.exitCode!==0&&r.push(i),{ok:i.exitCode===0,failures:r,slots:[...t.results,i]}}function aL(t,e,r){if(e.length===t.length)return"Both reviewers failed; skipping synthesis.";if(r&&e.length>0)return"A reviewer failed; skipping synthesis."}function K7(t){return t.filter(e=>e.exitCode!==0)}async function lL(t){let{paths:e,multi:r}=t,i=new Date,{results:n,anyFresh:o,fresh:s}=await rL(e.reviewDir,e.claudePath,e.codexPath,gT(e.requestPath),{multi:r,codexPlan:t.codexPlan,cachedClaude:t.cachedClaude,models:t.models});t.job&&await ED(s,t.job,i);let a=K7(n),l=aL(n,a,t.strict);return l?(console.error(l),{ok:!1,failures:a,slots:n}):sL({paths:e,results:n,failures:a,anyFresh:o,multi:r,slot:t.models.synthesis})}function cL(t){return t?!1:!!process.stdout.isTTY}function uL(t){for(let e of t)ZD(e)}function dL(t,e){t.length!==0&&e&&uL(t)}function V7(t){let e=Date.now();if(!t)return{multi:void 0,elapsed:void 0,startedAt:e};let r=new Ra;return{multi:r,elapsed:r.addElapsed("total"),startedAt:e}}function G7(t,e){if(!t.elapsed)return;let i=`total: ${Math.round((Date.now()-t.startedAt)/1e3)}s`;e?t.elapsed.succeed(i):t.elapsed.fail(i)}async function fL(t,e){let r=yn("claude",t.claudePath),i=await pT(t.codexPath,e.models?.codex!==void 0),n=V7(cL(e.verbose));try{let o=await lL({paths:t,cachedClaude:r,codexPlan:i,multi:n.multi,models:e.models??{},strict:e.strict??!1,job:e.job});return G7(n,o.ok),dL(o.failures,n.multi!==void 0),o}catch(o){throw n.multi?.failRemaining(),o}}var Q7=/^\+\+\+ (?:b\/)?(.+)$/,J7=/^@@ -\d+(?:,\d+)? \+(\d+)(?:,\d+)? @@/;function ta(t){return`${(t===null?"":String(t)).padStart(6," ")} `}function mL(t){let e=!1,r=0;return t.split(`
|
|
677
|
-
`).map(i=>{if(Q7.test(i))return e=!0,ta(null)+i;let n=i.match(J7);if(n)return r=Number(n[1]),ta(null)+i;if(!e)return ta(null)+i;if(i.startsWith("+")||i.startsWith(" ")){let o=ta(r)+i;return r++,o}return ta(null)+i}).join(`
|
|
678
|
-
`)}function W7(t,e){return t.threadId?t.threadId:t.inReplyToId!==null&&e.has(t.inReplyToId)?`root-${t.inReplyToId}`:`root-${t.id}`}function H7(t){let e=new Map(t.map(i=>[i.id,i])),r=new Map;for(let i of t){let n=W7(i,e),o=r.get(n),s=i.inReplyToId!==null?e.get(i.inReplyToId):void 0;o?s&&o.replies.push(i):s?r.set(n,{root:s,replies:[i]}):r.set(n,{root:i,replies:[]})}return[...r.values()]}function Y7(t){let e=t.line!==null?`${t.file}:${t.line}`:t.file,r=[t.resolved&&"resolved",t.outdated&&"outdated"].filter(Boolean).join(", ");return r?`### ${e} [${r}]`:`### ${e}`}function X7(t){return[Y7(t.root),`**${t.root.author}**: ${t.root.body.trim()}`,...t.replies.map(r=>`**${r.author}** (reply): ${r.body.trim()}`)].join(`
|
|
679
|
-
|
|
680
|
-
`)}var eQ="The PR already has the review comments below (including resolved and outdated threads). Avoid re-raising findings that a prior comment substantively covers.";function pL(t){if(t.length===0)return"";let e=H7(t).map(X7);return`## Prior review comments
|
|
681
|
-
|
|
682
|
-
${eQ}
|
|
683
|
-
|
|
684
|
-
${e.join(`
|
|
685
|
-
|
|
686
|
-
`)}`}function tQ(t){return t.length===0?"(none)":t.map(e=>`- ${e}`).join(`
|
|
687
|
-
`)}function hL(t,e=null){let r=e?pL(e):"",i=r?`
|
|
688
|
-
${r}
|
|
689
|
-
`:"";return`# Code review request
|
|
690
|
-
|
|
691
|
-
- PR: #${t.prNumber}
|
|
692
|
-
- Branch: \`${t.branch}\` (head ref: \`${t.headRef}\`)
|
|
693
|
-
- Base ref: \`${t.baseRef}\`
|
|
694
|
-
- Base SHA: \`${t.baseSha}\`
|
|
695
|
-
- Head SHA: \`${t.headSha}\`
|
|
696
|
-
|
|
697
|
-
## Changed files
|
|
698
|
-
|
|
699
|
-
${tQ(t.changedFiles)}
|
|
700
|
-
${i}
|
|
701
|
-
## Diff (PR #${t.prNumber}: ${t.baseSha}..${t.headSha})
|
|
702
|
-
|
|
703
|
-
Each added or context line is prefixed with a left gutter showing its line number in the new file. When citing a finding as \`file:line\`, use that gutter number \u2014 do **not** count lines in this document. Removed lines (\`-\`) and headers have a blank gutter and cannot be commented on.
|
|
704
|
-
|
|
705
|
-
\`\`\`diff
|
|
706
|
-
${mL(t.diff.trimEnd())}
|
|
707
|
-
\`\`\`
|
|
708
|
-
`}import{homedir as rQ}from"node:os";import{basename as nQ,join as ra}from"node:path";function gL(t,e){let r=ra(rQ(),".assist","reviews",nQ(t),e);return{reviewDir:r,requestPath:ra(r,"request.md"),claudePath:ra(r,"claude.md"),codexPath:ra(r,"codex.md"),synthesisPath:ra(r,"synthesis.md")}}import{execSync as sQ}from"node:child_process";import{execFileSync as iQ}from"node:child_process";var oQ="query($owner: String!, $repo: String!, $prNumber: Int!) { repository(owner: $owner, name: $repo) { pullRequest(number: $prNumber) { reviewThreads(first: 100) { nodes { id isResolved comments(first: 100) { nodes { databaseId } } } } } } }";function yL(t,e,r){let i=iQ("gh",["api","graphql","-f",`query=${oQ}`,"-F",`owner=${t}`,"-F",`repo=${e}`,"-F",`prNumber=${r}`],{encoding:"utf8"}),n=JSON.parse(i),o=new Map,s=new Set;for(let a of n.data.repository.pullRequest.reviewThreads.nodes){a.isResolved&&s.add(a.id);for(let l of a.comments.nodes)o.set(l.databaseId,a.id)}return{threadMap:o,resolvedThreadIds:s}}function aQ(t,e,r){let i=sQ(`gh api --paginate repos/${t}/${e}/pulls/${r}/comments`,{encoding:"utf8",maxBuffer:67108864});return i.trim()?JSON.parse(i):[]}function vL(){let t=ca();if(t===null)return null;let{org:e,repo:r}=ir(),i=aQ(e,r,t);if(i.length===0)return[];let n=yL(e,r,t);return i.map(o=>{let s=n.threadMap.get(o.id)??"";return{id:o.id,threadId:s,file:o.path,line:o.line??o.original_line??null,author:o.user.login,body:o.body,inReplyToId:o.in_reply_to_id??null,resolved:s!==""&&n.resolvedThreadIds.has(s),outdated:o.position===null}})}import{existsSync as lQ,mkdirSync as cQ,unlinkSync as uQ,writeFileSync as dQ}from"node:fs";function fQ(t){for(let e of[t.claudePath,t.codexPath,t.synthesisPath])lQ(e)&&uQ(e)}function bL(t,e,r){cQ(t.reviewDir,{recursive:!0}),r&&fQ(t),dQ(t.requestPath,e)}function wL(t,e,r){let i=gL(t,`${e.branch}-${e.shortSha}`),n=vL();return mQ(n?.length??0),bL(i,hL(e,n),r),console.log(`Review folder: ${i.reviewDir}`),i}function mQ(t){t!==0&&console.log(`Including ${t} prior review comment(s) in request.md.`)}import{execSync as m_}from"node:child_process";import{execSync as f_}from"node:child_process";function pQ(){return f_("git rev-parse --abbrev-ref HEAD",{encoding:"utf8"}).trim()}var SL="number,baseRefName,baseRefOid,headRefName,headRefOid";function xL(t){return f_(t,{encoding:"utf8",stdio:["ignore","pipe","pipe"]})}function hQ(t,e,r){let i=$_();return i!==void 0?JSON.parse(xL(`gh pr view ${i} --json ${SL} -R ${t}/${e}`)):JSON.parse(xL(`gh pr list --state open --head ${r} --json ${SL} -R ${t}/${e}`))[0]}function _L(){let{org:t,repo:e}=ir(),r=pQ(),i=hQ(t,e,r);return i||(console.error(`Error: No open pull request found for branch \`${r}\`. Open a PR for this branch before running \`assist review\`.`),process.exit(1)),{prNumber:i.number,baseRef:i.baseRefName,baseSha:i.baseRefOid,headRef:i.headRefName,headSha:i.headRefOid}}function $L(t){let{org:e,repo:r}=ir();return f_(`gh api repos/${e}/${r}/pulls/${t}/files --paginate --jq ".[].filename"`,{encoding:"utf8",maxBuffer:64*1024*1024}).trim().split(`
|
|
709
|
-
`).filter(Boolean)}function kL(){let t=m_("git rev-parse --abbrev-ref HEAD",{encoding:"utf8"}).trim(),e=m_("git rev-parse HEAD",{encoding:"utf8"}).trim(),r=m_("git rev-parse --short=7 HEAD",{encoding:"utf8"}).trim(),i=_L(),n=$L(i.prNumber),o=ua(i.prNumber,i.baseSha,i.headSha);return{branch:t,sha:e,shortSha:r,prNumber:i.prNumber,baseRef:i.baseRef,baseSha:i.baseSha,headRef:i.headRef,headSha:i.headSha,changedFiles:n,diff:o}}function TL(){let t=kL();if(t.changedFiles.length>0)return t;console.error(`Error: PR #${t.prNumber} has no changed files \u2014 nothing to review.`),process.exit(1)}import*as IL from"node:net";import{homedir as EL}from"node:os";import{basename as gQ,join as rr}from"node:path";var tr=rr(EL(),".assist","daemon");function yQ(){let t=gQ(EL()).replace(/[^\w.-]/g,"_");return String.raw`\\.\pipe\assist-sessions-daemon-${t}`}var qi={dir:tr,socket:process.platform==="win32"?yQ():rr(tr,"daemon.sock"),log:rr(tr,"daemon.log"),pid:rr(tr,"daemon.pid"),autoUpdatePaused:rr(tr,"auto-update-paused"),spawnLock:rr(tr,"spawn.lock"),hooksSettings:rr(tr,"hooks-settings.json"),viewerSize:rr(tr,"viewer-size.json"),promptJournal:rr(tr,"prompt-journal.jsonl")};function Fi(){return new Promise((t,e)=>{let r=IL.connect(qi.socket);r.once("connect",()=>t(r)),r.once("error",e)})}function Bi(t,e){let r="";t.on("data",i=>{r+=i.toString("utf8");let n=r.indexOf(`
|
|
710
|
-
`);for(;n!==-1;)e(r.slice(0,n)),r=r.slice(n+1),n=r.indexOf(`
|
|
711
|
-
`)})}function vQ(t,e){try{let r=JSON.parse(t);return r.type==="error"&&(r.message??"").includes(e)?{kind:"error",message:r.message??`${e} failed`}:r.type!=="created"||!r.sessionId?null:{kind:"created",sessionId:r.sessionId}}catch{return null}}function Od(t){return new Promise((e,r)=>{Fi().then(i=>{let n=!1,o=(s,a)=>{n||(n=!0,i.destroy(),s?r(s):e(a))};Bi(i,s=>{let a=vQ(s,t.type);a&&(a.kind==="error"?o(new Error(a.message)):o(void 0,a.sessionId))}),i.on("error",s=>o(s)),i.on("close",()=>o(new Error("daemon closed before the session was created"))),i.write(`${JSON.stringify(t)}
|
|
712
|
-
`)},r)})}function CL(t,e,r){return Od({type:"create",prompt:t,cwd:e,inPlace:r?.inPlace===!0,launchedFrom:r?.launchedFrom??process.env.ASSIST_SESSION_ID})}async function Ad(t,e){if(process.env.ASSIST_SESSION==="1")try{await e(),console.log(`Started ${t}.`)}catch(r){console.error(`Warning: could not start ${t}: ${r instanceof Error?r.message:String(r)}`)}}function Rd(t){return Ad(`a Slack announce session for PR #${t}`,()=>CL(`/prs-slack ${t} --no-confirm`,process.cwd(),{inPlace:!0}))}import{readFileSync as FQ}from"node:fs";function PL(t,e,r){return Od({type:"create-assist",assistArgs:t,cwd:e,inPlace:r?.inPlace===!0,launchedFrom:r?.launchedFrom??process.env.ASSIST_SESSION_ID})}function NL(t,e){let r=["review-pr-comments",String(t)];return e&&r.push("--announce"),Ad(`an Address Comments session for PR #${t}`,()=>PL(r,process.cwd(),{inPlace:!0}))}async function OL(t,e,r){let i=e.posted>0&&e.submitted;if(r.addressComments&&i){await NL(t,r.announce);return}r.announce&&await Rd(t)}import{appendFileSync as bQ}from"node:fs";function p_(t){let e=`${new Date().toISOString()} [${process.pid}] ${t}`;try{bQ(qi.log,`${e}
|
|
713
|
-
`)}catch{}}var wQ=1e3;function AL(t){return new Promise((e,r)=>{Fi().then(i=>{let n=!1,o=a=>{n||(n=!0,clearTimeout(s),i.destroy(),a?r(a):e())},s=setTimeout(()=>o(new Error("timed out awaiting daemon ack")),wQ);Bi(i,a=>{SQ(a)&&o()}),i.on("error",a=>o(a)),i.on("close",()=>o(new Error("daemon closed before acknowledging"))),i.write(`${JSON.stringify(t)}
|
|
714
|
-
`)},r)})}function SQ(t){try{return JSON.parse(t).type==="ack"}catch{return!1}}import*as RL from"node:readline";async function DL(){let t=RL.createInterface({input:process.stdin,output:process.stdout,terminal:!1}),e="";for await(let r of t)e+=r;return e}async function LL(){if(!process.stdin.isTTY)try{return JSON.parse(await DL()).session_id}catch{return}}var xQ=3,_Q=100;async function h_(t,e={}){let r=process.env.ASSIST_SESSION_ID;if(IQ(t,r,e.source),!r)return;let i=$Q(r,t,e.source,await LL());await kQ(r,t,i,e.ack?xQ:1)}function $Q(t,e,r,i){let n={type:"set-status",sessionId:t,status:e};return i&&(n.claudeSessionId=i),r&&(n.source=r),n.ack=!0,n}async function kQ(t,e,r,i){for(let n=1;n<=i;n++)try{await AL(r);return}catch(o){if(n<i){await TQ(_Q);continue}p_(`set-status delivery failed after ${i} attempt${i===1?"":"s"}: id=${t} status=${e}${r.source?` source=${r.source}`:""}: ${EQ(o)}`)}}function TQ(t){return new Promise(e=>setTimeout(e,t))}function EQ(t){return t instanceof Error?t.message:String(t)}function IQ(t,e,r){p_(`set-status hook fired: id=${e??"none"} status=${t}${r?` source=${r}`:""}`)}var CQ="mutation($prId: ID!, $body: String!, $path: String!, $line: Int!) { addPullRequestReviewThread(input: { pullRequestId: $prId, body: $body, path: $path, line: $line, side: RIGHT }) { thread { id } } }",PQ="mutation($prId: ID!, $body: String!, $path: String!, $line: Int!, $startLine: Int!) { addPullRequestReviewThread(input: { pullRequestId: $prId, body: $body, path: $path, line: $line, startLine: $startLine, side: RIGHT, startSide: RIGHT }) { thread { id } } }";function NQ(t){let e;try{e=JSON.parse(t)}catch{throw new Error(`GitHub returned an unparseable response: ${t}`)}let r=e.data?.addPullRequestReviewThread?.thread?.id;if(typeof r!="string"||r.length===0)throw new Error("GitHub did not create a review thread (no thread id returned); the line is likely outside the PR diff.")}function zL(t){let{startLine:e,...r}=t,i=e===void 0?Wi(CQ,r):Wi(PQ,{...r,startLine:e});NQ(i)}import{randomUUID as DQ}from"node:crypto";function jL(t){return t.map((e,r)=>{let i=e.quote.split(`
|
|
715
|
-
`).map(n=>` > ${n}`).join(`
|
|
716
|
-
`);return`${r+1}. On:
|
|
717
|
-
${i}
|
|
718
|
-
Comment: ${e.note}
|
|
719
|
-
`})}function UL(t,e,r){console.error(`${t} rejected${e.reason?`: ${e.reason}`:"."}`);let i=e.comments??[];if(i.length>0){console.error(`
|
|
720
|
-
The reviewer left ${i.length} comment${i.length===1?"":"s"} on the preview. Address each one, then re-run this command:
|
|
721
|
-
`);for(let n of jL(i))console.error(n)}r&&console.error(r),process.exit(1)}function ML(t){if(!(typeof t!="object"||t===null||Array.isArray(t)))return Object.fromEntries(Object.entries(t).filter(e=>typeof e[1]=="string"))}function qL(t){if(Array.isArray(t))return t.flatMap(e=>{let{path:r,alt:i,group:n}=e??{};if(typeof r!="string"||r==="")return[];let o={path:r,alt:typeof i=="string"?i:""};return[typeof n=="string"&&n!==""?{...o,group:n}:o]})}function FL(t){if(Array.isArray(t))return t.flatMap(e=>{let{id:r,ticked:i,comment:n,slice:o}=e??{};return typeof r!="string"?[]:[{id:r,ticked:i===!0,...typeof n=="string"&&n!==""?{comment:n}:{},...typeof o=="number"&&Number.isInteger(o)?{slice:o}:{}}]})}function BL(t){return t==="LEFT"||t==="RIGHT"}function OQ(t){let e=t;return typeof e?.path=="string"&&Number.isInteger(e.startLine)&&Number.isInteger(e.endLine)&&typeof e.quote=="string"&&typeof e.note=="string"&&e.note.trim()!==""}function ZL(t){if(Array.isArray(t))return t.filter(OQ).map(({path:e,startLine:r,endLine:i,quote:n,note:o,startSide:s,side:a})=>({path:e,startLine:r,endLine:i,quote:n,note:o,...BL(s)?{startSide:s}:{},...BL(a)?{side:a}:{}}))}var AQ=["APPROVE","COMMENT","REQUEST_CHANGES"];function RQ(t){let e=t;if(!(typeof e?.topLeft!="string"||typeof e.bottomRight!="string"))return{topLeft:e.topLeft,bottomRight:e.bottomRight}}function KL(t){return t.decision!=="approve"&&t.decision!=="reject"?null:{decision:t.decision,reason:t.reason,comments:Array.isArray(t.comments)?t.comments:void 0,screenshots:qL(t.screenshots),body:typeof t.body=="string"?t.body:void 0,reviewAfter:t.reviewAfter===!0,announceAfter:t.announceAfter===!0,draft:typeof t.draft=="boolean"?t.draft:void 0,autoMerge:t.autoMerge===!0,autostart:t.autostart===!0,selection:RQ(t.selection),checklist:FL(t.checklist),reviewEvent:AQ.find(e=>e===t.reviewEvent),reviewComments:ZL(t.reviewComments),dismissed:t.dismissed===!0,restart:t.restart===!0,answers:ML(t.answers)}}function VL(t,e){try{let r=JSON.parse(t);if(r.type==="error"&&(r.message??"").includes("pr-preview"))return{kind:"error",message:r.message??"pr-preview failed"};if(r.requestId!==e)return null;if(r.type==="pr-superseded")return{kind:"superseded"};if(r.type!=="pr-decision")return null;let i=KL(r);return i?{kind:"decision",decision:i}:null}catch{return null}}function GL(t){return new Promise((e,r)=>{Fi().then(i=>{let n=!1,o=(s,a)=>{n||(n=!0,i.destroy(),s?r(s):e(a))};Bi(i,s=>{let a=VL(s,t.requestId);a&&(a.kind==="error"?o(new Error(a.message)):a.kind==="superseded"?o(void 0,"superseded"):o(void 0,a.decision))}),i.on("error",s=>o(s)),i.on("close",()=>o(new Error("daemon closed before a decision was made"))),i.write(`${JSON.stringify({type:"pr-preview",...t})}
|
|
722
|
-
`)},r)})}async function QL(t,e,r={}){console.log("Awaiting your approval in the assist web UI preview pane\u2026");let i;try{i=await GL(e)}catch(n){console.error(`Error: ${n instanceof Error?n.message:String(n)}`),process.exit(1)}return i==="superseded"&&(console.log("Superseded by a newer preview \u2014 no decision; ignore this result."),process.exit(0)),i.body!==void 0&&r.saveEditedBody?.(i.body),i.decision==="reject"&&!r.rejectIsOutcome&&UL(t,i,r.rejectionAdvice),i}async function JL(t,e,r){let i=process.env.ASSIST_SESSION_ID;process.env.ASSIST_SESSION!=="1"||!i||await QL("PR comment preview",{sessionId:i,requestId:DQ(),title:t,body:e,prNumber:r,kind:"pr-comment"})}function LQ(t){let e=t.toLowerCase();(e.includes("claude")||e.includes("opus"))&&(console.error('Error: Body must not contain "claude" or "opus"'),process.exit(1))}function WL(t){(!Number.isInteger(t)||t<1)&&(console.error("Error: Line must be a positive integer"),process.exit(1))}async function HL(t,e,r,i={}){let{startLine:n,skipPreview:o}=i;LQ(r),WL(e),n!==void 0&&WL(n);let s=n!==void 0?`${n}-${e}`:`${e}`;o||await JL(`Comment on ${t}:${s}`,r,null);try{let a=la();zL({prId:a,body:r,path:t,line:e,startLine:n}),console.log(`Added review comment on ${t}:${s}`)}catch(a){throw aa(a)&&(console.error("Error: GitHub CLI (gh) is not installed."),console.error("Install it from https://cli.github.com/"),process.exit(1)),a}}var YL="the reviewer";function Zi(t){return t.replace(/\bclaude\b/gi,YL).replace(/\bopus\b/gi,YL)}function zQ(t){let e=[],r=t.severity??"finding";return e.push(`**${r}: ${t.title}**`),t.impact&&e.push("",`Impact: ${t.impact}`),t.recommendation&&e.push("",`Recommendation: ${t.recommendation}`),Zi(e.join(`
|
|
723
|
-
`))}async function XL(t){let e=0,r=[];for(let i of t){let n=zQ(i);try{await HL(i.file,i.line,n,{startLine:i.startLine,skipPreview:!0}),e++}catch(o){r.push(i);let s=o instanceof Error?o.message:String(o);console.error(`Failed to post comment on ${i.file}:${i.line}: ${s}`)}}return{posted:e,failed:r}}function ez(t,e,r){return hn(Zi(nr(t,e)),r)}var jQ="mutation($prId: ID!, $body: String) { submitPullRequestReview(input: { pullRequestId: $prId, event: COMMENT, body: $body }) { pullRequestReview { id } } }";function g_(t){return ha(jQ,t)}function tz(t,e){return e.posted>0?g_(t):UQ(t,e)?!0:gn(t)}function UQ(t,e){return e.failed>0&&g_(t)}function rz(t,e){return[...t,...e.map(r=>({...r,reason:"comment-rejected"}))]}async function MQ(t){if(!t.prompt)return t.submit;await h_("waiting");try{return await En("Submit the pending review?",t.submit)}finally{await h_("running")}}async function nz(t,e,r,i){let{posted:n,failed:o}=await XL(t),s=o.length>0?`, ${o.length} failed`:"";console.log(`Posted ${n} comment(s)${s}.`);let a=rz(e,o),l=fn(a);if(n===0&&l.length===0&&!i.ciFooter)return{posted:0,submitted:!1};if(await MQ(i)){let u=tz(ez(r,a,i.ciFooter),{posted:n,failed:o.length});if(!u&&i.ciFooter)throw new Error("the review could not be submitted to the PR");return{posted:n,submitted:u}}return console.log("Leaving the review unsubmitted."),{posted:n,submitted:!1}}function qQ(){try{return ca()}catch(t){return console.error(`Error: could not confirm which PR this tree is on: ${t instanceof Error?t.message:String(t)}`),null}}function iz(t){let e=qQ();return e===t?!0:(console.error(`Error: this tree is now on ${e===null?"a branch with no open PR":`PR #${e}`}, not the reviewed PR #${t}; skipping the post and any chained sessions.`),!1)}function oz(t,e){let r=Zi(`${nr(t)}
|
|
724
|
-
|
|
725
|
-
No findings were raised.`);return gn(hn(r,e))}function sz(t,e){if(!e)return{posted:0,submitted:!1};if(!oz(t,e))throw new Error("the review could not be submitted to the PR");return{posted:0,submitted:!0}}function az(t,e){let r=[];return t>0&&r.push(`${t} line comment(s)`),e>0&&r.push(`${e} finding(s) in the review body`),r.join(" and ")}var BQ={posted:0,submitted:!1};async function ZQ(t,e,r){return r.prompt?En(`Post ${e} to PR #${t}?`,!1):!0}async function KQ(t,e,r){let i=FQ(e,"utf8"),{inDiff:n,unanchored:o}=ma(i,t),s=fn(o);if(n.length===0&&s.length===0)return sz(i,r.ciFooter);let a=az(n.length,s.length);return console.log(`Found PR #${t.prNumber} with ${a} to post.`),await ZQ(t.prNumber,a,r)?nz(n,o,i,r):(console.log("Skipped posting."),BQ)}async function lz(t,e,r){if(!iz(e.prNumber))return;let i=await KQ(e,t,r);await OL(e.prNumber,i,r)}import{mkdirSync as VQ,writeFileSync as GQ}from"node:fs";import{dirname as QQ}from"node:path";var b_="assist sessions set-status";function y_(t){return`${b_} running --source ${t}`}function JQ(t){return`${b_} waiting --source ${t}`}function v_(t){return`${b_} waiting --source ${t} --ack`}function dn(t,e){let r=[{type:"command",command:t}];return[e==null?{hooks:r}:{matcher:e,hooks:r}]}var cz="AskUserQuestion",WQ=`^(?!${cz}$).*`,HQ={theme:"auto",hooks:{UserPromptSubmit:dn(y_("prompt")),PreToolUse:[...dn(JQ("pretool"),cz),...dn(y_("pretool"),WQ)],PostToolUse:dn(y_("posttool")),Stop:dn(v_("stop")),Notification:dn(v_("notification")),PermissionRequest:dn(v_("permission"))}};function uz(){let t=qi.hooksSettings;return VQ(QQ(t),{recursive:!0}),GQ(t,JSON.stringify(HQ,null,2)),t}import{spawn as YQ}from"node:child_process";function dz(t,e,r={}){let{ASSIST_ACTIVITY_ID:i,CLAUDE_CODE_CHILD_SESSION:n,...o}=process.env,s=YQ(t,e,{stdio:"inherit",env:{...o,...r.env},cwd:r.cwd}),a=new Promise((l,c)=>{s.on("close",u=>l(u??0)),s.on("error",c)});return{child:s,done:a}}function Ki(t,e={}){let r=["--settings",uz(),...XQ(t,e)],i=e.permissionMode??(e.allowEdits?"auto":void 0);return i&&r.push("--permission-mode",i),dz("claude",r)}function XQ(t,e){return e.resumeSessionId?t?["--resume",e.resumeSessionId,t]:["--resume",e.resumeSessionId]:e.sessionId?t?["--session-id",e.sessionId,t]:["--session-id",e.sessionId]:t?[t]:[]}function eJ(t){return`You are helping the user apply fixes for a code review with each finding decided one at a time.
|
|
726
|
-
|
|
727
|
-
Read ${t}. It contains a list of findings under the \`## Findings\` heading. Each finding is a block in this exact format:
|
|
728
|
-
|
|
729
|
-
### Finding: <short title>
|
|
730
|
-
- Severity: blocker | major | minor | nit
|
|
731
|
-
- Source: confirmed | disputed | claude-only | codex-only | already-raised
|
|
732
|
-
- Location: \`path/to/file.ext:LINE\` or \`n/a\` when not tied to a specific line
|
|
733
|
-
- Impact: one sentence on what could go wrong
|
|
734
|
-
- Recommendation: one or two sentences with a concrete change
|
|
735
|
-
|
|
736
|
-
For every finding whose Source is NOT \`already-raised\`, walk through it with the user one at a time:
|
|
737
|
-
1. Read the referenced file/lines (use the Location field) and any nearby code needed to understand the impact.
|
|
738
|
-
2. Present a short assessment (one or two sentences) of whether the finding is real and what the right fix is.
|
|
739
|
-
3. Ask the user: apply or skip?
|
|
740
|
-
- On 'apply': edit the relevant file(s) in place to fix the issue, then remove that finding's entire \`### Finding:\` block from ${t} (including any blank line that separated it from the next block).
|
|
741
|
-
- On 'skip': leave the finding block in ${t} unchanged and move on.
|
|
742
|
-
|
|
743
|
-
Skip findings whose Source is \`already-raised\` entirely \u2014 do not present them and do not remove them from ${t}.
|
|
744
|
-
|
|
745
|
-
Important constraints:
|
|
746
|
-
- Do not stage, commit, or push any changes. Leave all code edits unstaged in the working tree.
|
|
747
|
-
- Do not post anything to a PR.
|
|
748
|
-
- Only modify ${t} by removing the blocks for findings the user chose to apply. Do not edit the wording of any remaining finding block.
|
|
749
|
-
- When every non-already-raised finding has been decided, briefly summarise what was applied vs skipped and exit.`}async function fz(t){let{done:e}=Ki(eJ(t),{allowEdits:!0});await e}function tJ(t){return`/bug add each finding in ${t} as a phase
|
|
750
|
-
|
|
751
|
-
Read ${t}. It contains a list of findings under the \`## Findings\` heading, each in a \`### Finding:\` block with Severity, Source, Location, Impact, and Recommendation fields.
|
|
752
|
-
|
|
753
|
-
File ONE bug backlog item covering the review findings:
|
|
754
|
-
- Include EVERY finding in the file as a phase on that single item \u2014 including findings whose Source is \`already-raised\`.
|
|
755
|
-
- Each phase should be named after its finding's title and its tasks should capture the finding's Location, Impact, and Recommendation.
|
|
756
|
-
- File the item with \`assist backlog propose\`, then apply the whole plan with a single \`assist backlog update-plan <id> --json -\` call whose payload lists every finding as a phase. Do not run \`assist backlog add-phase\` per finding \u2014 the plan lands in one preview, or not at all.
|
|
757
|
-
|
|
758
|
-
Important constraints:
|
|
759
|
-
- Do not edit ${t} \u2014 leave it untouched.
|
|
760
|
-
- Do not post anything to a PR.
|
|
761
|
-
- Do not stage, commit, or push any changes.`}async function mz(t){let{done:e}=Ki(tJ(t),{allowEdits:!0});await e}function rJ(t){return`You are refining a code review synthesis with the user.
|
|
762
|
-
|
|
763
|
-
Read ${t} and walk the user through each finding one at a time. Before asking the user what to do with a finding, do some investigation so you can give an informed opinion:
|
|
764
|
-
- Read the referenced file/lines (use the Location field) to confirm the issue is real and current.
|
|
765
|
-
- Check nearby code, callers, or related files when the impact depends on context.
|
|
766
|
-
- Form a view on whether the finding is applicable, whether the stated severity is right, and whether the recommendation actually fixes the problem.
|
|
767
|
-
|
|
768
|
-
Then present your assessment briefly (one or two sentences) and ask the user whether to keep it as-is, edit it (e.g. adjust severity, sharpen the recommendation), or drop it. After all existing findings are reviewed, ask whether to add any new findings.
|
|
769
|
-
|
|
770
|
-
Edit ${t} in place so the resulting file is the user's final list:
|
|
771
|
-
- To drop a finding, remove its entire \`### Finding:\` block.
|
|
772
|
-
- To edit a finding, modify only the fields the user wants changed.
|
|
773
|
-
- To add a new finding, append a block in the exact format below under the \`## Findings\` heading.
|
|
774
|
-
|
|
775
|
-
Each finding block must use this exact format so it parses correctly:
|
|
776
|
-
|
|
777
|
-
### Finding: <short title>
|
|
778
|
-
- Severity: blocker | major | minor | nit
|
|
779
|
-
- Source: confirmed | disputed | claude-only | codex-only | already-raised
|
|
780
|
-
- Location: \`path/to/file.ext:LINE\` or \`n/a\` when not tied to a specific line
|
|
781
|
-
- Impact: one sentence on what could go wrong
|
|
782
|
-
- Recommendation: one or two sentences with a concrete change
|
|
783
|
-
|
|
784
|
-
User-supplied findings should use Source: \`confirmed\`. Use Location \`n/a\` only when the finding is not tied to a specific line.
|
|
785
|
-
|
|
786
|
-
Do not post anything to a PR; only edit ${t}. When the user is done, exit.`}async function pz(t){let{done:e}=Ki(rJ(t),{allowEdits:!0});await e}function nJ(t){return t.backlog?mz:t.apply?fz:t.refine?pz:null}async function hz(t,e,r){let i=nJ(r);if(!i){await lz(t,e,{prompt:r.prompt,submit:r.submit,addressComments:r.addressComments,announce:r.announce,ciFooter:r.ciFooter});return}await i(t),r.announce&&await Rd(e.prNumber)}function gz(t,e,r){return hz(t,e,{refine:r.refine??!1,apply:r.apply??!1,backlog:r.backlog??!1,prompt:r.prompt??!0,submit:r.submit??!1,addressComments:r.addressComments??!1,announce:r.announce??!1,ciFooter:r.ci?.footer})}async function yz(t,e){let r=TL(),i=wL(t,r,e.force??!1);xk(i.reviewDir);let n=await fL(i,{verbose:e.verbose??!1,models:e.ci?.models,strict:e.ci!==void 0,job:e.ci?void 0:{repo:iJ(t),prNumber:r.prNumber}}),o=n.ok;!o&&e.ci&&t$(n.failures,e.ci),o&&e.ci&&Y_(i.synthesisPath,r,e.ci.summaryPath,n.slots),o&&await gz(i.synthesisPath,r,e),console.log(`Done. Review folder: ${i.reviewDir}`)}function w_(t){return`\`${t.harness}:${t.model}\``}function vz(t){return["---","",`Models: reviewer 1 ${w_(t.claude)}, reviewer 2 ${w_(t.codex)}, synthesis ${w_(t.synthesis)}.`,"","To re-run this review, mark the PR as draft and then ready for review again."].join(`
|
|
787
|
-
`)}function bz(t){let{GITHUB_SERVER_URL:e,GITHUB_REPOSITORY:r,GITHUB_RUN_ID:i}=t;if(!(!e||!r||!i))return`${e}/${r}/actions/runs/${i}`}function oJ(t){return{ANTHROPIC_DEFAULT_OPUS_MODEL:t,ANTHROPIC_DEFAULT_SONNET_MODEL:t,ANTHROPIC_DEFAULT_HAIKU_MODEL:t,CLAUDE_CODE_SUBAGENT_MODEL:t}}function sJ(t,e,r){return t.anthropicKind==="foundry"&&e.auth.kind==="key"?{CLAUDE_CODE_USE_FOUNDRY:"1",ANTHROPIC_FOUNDRY_BASE_URL:t.anthropic,ANTHROPIC_FOUNDRY_API_KEY:r}:{ANTHROPIC_BASE_URL:t.anthropic,ANTHROPIC_AUTH_TOKEN:r}}function aJ(t,e,r,i){return t.harness==="codex"?$d(r.responses,i,t.model):{args:["--model",t.model],env:{...sJ(r,e,i),CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC:"1",...oJ(t.model)},model:t.model}}function wz(t,e,r){let i=(n,o)=>({harness:n.harness,label:o,override:aJ(n,t,e,r)});return{claude:i(t.slots.claude,"reviewer-1"),codex:i(t.slots.codex,"reviewer-2"),synthesis:i(t.slots.synthesis,"synthesis")}}var Sz=["REVIEW_CI_PROVIDER","REVIEW_CI_BASE_URL","REVIEW_CI_REVIEWER_1","REVIEW_CI_REVIEWER_2","REVIEW_CI_SYNTHESIS"];var na="REVIEW_CI_API_KEY",xz=["litellm","foundry"],S_=["claude","codex"];function _z(t,e){if(t==="litellm")return{anthropic:e,responses:`${e}/v1`,anthropicKind:"gateway"};if(t==="foundry")return{anthropic:`${e}/anthropic`,responses:`${e}/openai/v1`,anthropicKind:"foundry"};throw new Error(`Unsupported REVIEW_CI_PROVIDER "${t}" (expected one of: ${xz.join(", ")})`)}import{readFileSync as lJ}from"node:fs";function $z(t){let e=t.GITHUB_EVENT_PATH;if(!e)throw new Error("GITHUB_EVENT_PATH is not set; run this from a workflow");let i=JSON.parse(lJ(e,"utf8")).pull_request?.number;if(!i)throw new Error("The workflow event has no pull_request; trigger it on pull_request");return i}function cJ(t){return S_.includes(t)}function kz(t,e){let r=e.indexOf(":"),i=e.slice(0,r).trim(),n=e.slice(r+1).trim();return r===-1||!cJ(i)||!n?`${t} "${e}" must be ${S_.map(o=>`${o}:<model>`).join(" or ")}`:{harness:i,model:n}}function Dd(t,e){return t==="foundry"&&e("REVIEW_CI_AZURE_CLIENT_ID")?["REVIEW_CI_AZURE_CLIENT_ID","REVIEW_CI_AZURE_TENANT_ID"]:[na]}function Tz(t,e){return Dd(t,e).includes(na)?{kind:"key",apiKey:e(na)}:{kind:"entra",clientId:e("REVIEW_CI_AZURE_CLIENT_ID"),tenantId:e("REVIEW_CI_AZURE_TENANT_ID")}}var uJ={claude:"REVIEW_CI_REVIEWER_1",codex:"REVIEW_CI_REVIEWER_2",synthesis:"REVIEW_CI_SYNTHESIS"};function Ez(t){let e=s=>t[s]?.trim()??"",r=e("REVIEW_CI_PROVIDER"),i=[...Sz,...Dd(r,e)].filter(s=>!e(s));if(i.length>0)return{config:null,errors:i.map(s=>`${s} is not set`)};let n=Object.entries(uJ).map(([s,a])=>[s,kz(a,e(a))]),o=n.flatMap(([,s])=>typeof s=="string"?[s]:[]);return o.length>0?{config:null,errors:o}:{config:{provider:r,baseUrl:e("REVIEW_CI_BASE_URL").replace(/\/+$/,""),slots:Object.fromEntries(n),auth:Tz(r,e)},errors:o}}var Ld="https://cognitiveservices.azure.com";var Iz=3e4;async function Cz(t,e){if(!t.ok){let r=(await t.text()).trim().slice(0,300);throw new Error(`${e}: HTTP ${t.status}${r?`: ${r}`:""}`)}return await t.json()}async function dJ(t,e){let r=new URL(t);r.searchParams.set("audience","api://AzureADTokenExchange");let i=await fetch(r,{headers:{Authorization:`bearer ${e}`},signal:AbortSignal.timeout(Iz)}),n=await Cz(i,"GitHub OIDC token request failed");if(!n.value)throw new Error("GitHub OIDC token response had no value");return n.value}async function Pz(t,e,r){let i=await dJ(r.requestUrl,r.requestToken),n=await fetch(`https://login.microsoftonline.com/${encodeURIComponent(e)}/oauth2/v2.0/token`,{method:"POST",body:new URLSearchParams({grant_type:"client_credentials",client_id:t,scope:`${Ld}/.default`,client_assertion_type:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer",client_assertion:i}),signal:AbortSignal.timeout(Iz)}),o=await Cz(n,`Entra token exchange for client ${t} failed`);if(!o.access_token)throw new Error("Entra token response had no access_token");return o.access_token}import{execFileSync as fJ}from"node:child_process";function Nz(t){try{return fJ("az",["account","get-access-token","--resource",Ld,"--tenant",t,"--query","accessToken","-o","tsv"],{encoding:"utf8",stdio:["ignore","pipe","pipe"],shell:process.platform==="win32"}).trim()}catch(e){let r=e.stderr?.trim();throw new Error(`az account get-access-token failed for tenant ${t}${r?`: ${r}`:""}; run az login --tenant ${t}`)}}async function Oz(t,e){if(t.kind==="key")return t.apiKey;let r=e.ACTIONS_ID_TOKEN_REQUEST_URL,i=e.ACTIONS_ID_TOKEN_REQUEST_TOKEN;if(r&&i){let n=await Pz(t.clientId,t.tenantId,{requestUrl:r,requestToken:i});return console.log(`::add-mask::${n}`),n}if(e.GITHUB_ACTIONS)throw new Error("No GitHub OIDC token endpoint; give the job the id-token: write permission");return Nz(t.tenantId)}async function mJ(t){let{config:e,errors:r}=Ez(t);if(!e)throw new Error(r.join("; "));let i=_z(e.provider,e.baseUrl),n=new Set(Object.values(e.slots).map(s=>s.harness));for(let s of n)if(!Vi(s))throw new Error(`${s} is not on PATH`);let o=await Oz(e.auth,t);__($z(t)),await yz(process.cwd(),{prompt:!1,submit:!0,force:!0,verbose:!0,ci:{models:wz(e,i,o),summaryPath:t.GITHUB_STEP_SUMMARY,footer:vz(e.slots),runUrl:bz(t)}})}try{await mJ(process.env)}catch(t){console.error(`review-ci: ${t instanceof Error?t.message:String(t)}`),process.exit(1)}export{mJ as reviewCiReview};
|