@webflow/webflow-cli 2.0.0-next.0 → 2.0.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/index.js
CHANGED
|
@@ -1,68 +1,68 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var
|
|
2
|
+
"use strict";var uh=Object.create;var ps=Object.defineProperty;var ch=Object.getOwnPropertyDescriptor;var fh=Object.getOwnPropertyNames;var dh=Object.getPrototypeOf,ph=Object.prototype.hasOwnProperty;var v=(e,t)=>()=>(e&&(t=e(e=0)),t);var ms=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ru=(e,t)=>{for(var r in t)ps(e,r,{get:t[r],enumerable:!0})},mh=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of fh(t))!ph.call(e,o)&&o!==r&&ps(e,o,{get:()=>t[o],enumerable:!(n=ch(t,o))||n.enumerable});return e};var g=(e,t,r)=>(r=e!=null?uh(dh(e)):{},mh(t||!e||!e.__esModule?ps(r,"default",{value:e,enumerable:!0}):r,e));var ju,ue,gs,bt,ne,_n,B,Y,S,ce=v(()=>{"use strict";ju=e=>`\x1B[1;48;2;20;110;245;97m ${e} \x1B[0m`,ue=e=>`\x1B[38;2;167;209;255m${e}\x1B[0m`,gs=e=>`\x1B[38;2;196;175;255m${e}\x1B[0m`,bt=e=>`\x1B[38;2;255;156;156m${e}\x1B[0m`,ne=e=>`\x1B[38;2;255;209;102m${e}\x1B[0m`,_n=e=>`\x1B[97m${e}\x1B[0m`,B=e=>`\x1B[38;2;121;224;156m${e}\x1B[0m`,Y=e=>`\x1B[1m${e}\x1B[0m`,S=e=>`\x1B[38;2;185;185;185m${e}\x1B[0m`});function Dh(){let e=new Map;for(let[t,r]of Object.entries(ie)){for(let[n,o]of Object.entries(r))ie[n]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},r[n]=ie[n],e.set(o[0],o[1]);Object.defineProperty(ie,t,{value:r,enumerable:!1})}return Object.defineProperty(ie,"codes",{value:e,enumerable:!1}),ie.color.close="\x1B[39m",ie.bgColor.close="\x1B[49m",ie.color.ansi=Nu(),ie.color.ansi256=Bu(),ie.color.ansi16m=Mu(),ie.bgColor.ansi=Nu(10),ie.bgColor.ansi256=Bu(10),ie.bgColor.ansi16m=Mu(10),Object.defineProperties(ie,{rgbToAnsi256:{value(t,r,n){return t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(t){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(i=>i+i).join(""));let o=Number.parseInt(n,16);return[o>>16&255,o>>8&255,o&255]},enumerable:!1},hexToAnsi256:{value:t=>ie.rgbToAnsi256(...ie.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let r,n,o;if(t>=232)r=((t-232)*10+8)/255,n=r,o=r;else{t-=16;let a=t%36;r=Math.floor(t/36)/5,n=Math.floor(a/6)/5,o=a%6/5}let i=Math.max(r,n,o)*2;if(i===0)return 30;let s=30+(Math.round(o)<<2|Math.round(n)<<1|Math.round(r));return i===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(t,r,n)=>ie.ansi256ToAnsi(ie.rgbToAnsi256(t,r,n)),enumerable:!1},hexToAnsi:{value:t=>ie.ansi256ToAnsi(ie.hexToAnsi256(t)),enumerable:!1}}),ie}var Nu,Bu,Mu,ie,Sv,yh,wh,Tv,bh,rt,Lu=v(()=>{"use strict";Nu=(e=0)=>t=>`\x1B[${t+e}m`,Bu=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,Mu=(e=0)=>(t,r,n)=>`\x1B[${38+e};2;${t};${r};${n}m`,ie={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]}},Sv=Object.keys(ie.modifier),yh=Object.keys(ie.color),wh=Object.keys(ie.bgColor),Tv=[...yh,...wh];bh=Dh(),rt=bh});function Ue(e,t=globalThis.Deno?globalThis.Deno.args:ko.default.argv){let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),o=t.indexOf("--");return n!==-1&&(o===-1||n<o)}function vh(){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 Eh(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Fh(e,{streamIsTTY:t,sniffFlags:r=!0}={}){let n=vh();n!==void 0&&(_o=n);let o=r?_o:n;if(o===0)return 0;if(r){if(Ue("color=16m")||Ue("color=full")||Ue("color=truecolor"))return 3;if(Ue("color=256"))return 2}if("TF_BUILD"in de&&"AGENT_NAME"in de)return 1;if(e&&!t&&o===void 0)return 0;let i=o||0;if(de.TERM==="dumb")return i;if(ko.default.platform==="win32"){let s=Uu.default.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:i;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")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:i}function Wu(e,t={}){let r=Fh(e,{streamIsTTY:e&&e.isTTY,...t});return Eh(r)}var ko,Uu,hs,de,_o,xh,Vu,Hu=v(()=>{"use strict";ko=g(require("process"),1),Uu=g(require("os"),1),hs=g(require("tty"),1);({env:de}=ko.default);Ue("no-color")||Ue("no-colors")||Ue("color=false")||Ue("color=never")?_o=0:(Ue("color")||Ue("colors")||Ue("color=true")||Ue("color=always"))&&(_o=1);xh={stdout:Wu({isTTY:hs.default.isatty(1)}),stderr:Wu({isTTY:hs.default.isatty(2)})},Vu=xh});function Ju(e,t,r){let n=e.indexOf(t);if(n===-1)return e;let o=t.length,i=0,s="";do s+=e.slice(i,n)+t+r,i=n+o,n=e.indexOf(t,i);while(n!==-1);return s+=e.slice(i),s}function Gu(e,t,r,n){let o=0,i="";do{let s=e[n-1]==="\r";i+=e.slice(o,s?n-1:n)+t+(s?`\r
|
|
3
3
|
`:`
|
|
4
|
-
`)+r,o=n+1,n=
|
|
5
|
-
`,o)}while(n!==-1);return i+=
|
|
6
|
-
`);return i!==-1&&(
|
|
7
|
-
${e}`,Rh=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Ph=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),jh=(t,e,r)=>{let n=r===""?"":`with ${r.trim()}() `,o=$h.bind(null,n,e.toString());Object.defineProperty(o,"name",Ph);let{writable:i,enumerable:s,configurable:a}=Rh;Object.defineProperty(t,"toString",{value:o,writable:i,enumerable:s,configurable:a})}});var To,qc,Kc,Zc=b(()=>{"use strict";zc();To=new WeakMap,qc=(t,e={})=>{if(typeof t!="function")throw new TypeError("Expected a function");let r,n=0,o=t.displayName||t.name||"<anonymous>",i=function(...s){if(To.set(i,++n),n===1)r=t.apply(this,s),t=void 0;else if(e.throw===!0)throw new Error(`Function \`${o}\` can only be called once`);return r};return Ds(i,t),To.set(i,n),i};qc.callCount=t=>{if(!To.has(t))throw new Error(`The given function \`${t.name}\` is not wrapped by the \`onetime\` package`);return To.get(t)};Kc=qc});var ir,Yc=b(()=>{"use strict";ir=[];ir.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&ir.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&ir.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});var Ao,bs,vs,Nh,Es,Oo,Bh,xs,_s,Cs,Xc,Bv,Mv,Qc=b(()=>{"use strict";Yc();Ao=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",bs=Symbol.for("signal-exit emitter"),vs=globalThis,Nh=Object.defineProperty.bind(Object),Es=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(vs[bs])return vs[bs];Nh(vs,bs,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,r){this.listeners[e].push(r)}removeListener(e,r){let n=this.listeners[e],o=n.indexOf(r);o!==-1&&(o===0&&n.length===1?n.length=0:n.splice(o,1))}emit(e,r,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let o=!1;for(let i of this.listeners[e])o=i(r,n)===!0||o;return e==="exit"&&(o=this.emit("afterExit",r,n)||o),o}},Oo=class{},Bh=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),xs=class extends Oo{onExit(){return()=>{}}load(){}unload(){}},_s=class extends Oo{#s=Cs.platform==="win32"?"SIGINT":"SIGHUP";#r=new Es;#e;#o;#d;#t={};#i=!1;constructor(e){super(),this.#e=e,this.#t={};for(let r of ir)this.#t[r]=()=>{let n=this.#e.listeners(r),{count:o}=this.#r,i=e;if(typeof i.__signal_exit_emitter__=="object"&&typeof i.__signal_exit_emitter__.count=="number"&&(o+=i.__signal_exit_emitter__.count),n.length===o){this.unload();let s=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#s:r;s||e.kill(e.pid,a)}};this.#d=e.reallyExit,this.#o=e.emit}onExit(e,r){if(!Ao(this.#e))return()=>{};this.#i===!1&&this.load();let n=r?.alwaysLast?"afterExit":"exit";return this.#r.on(n,e),()=>{this.#r.removeListener(n,e),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#i){this.#i=!0,this.#r.count+=1;for(let e of ir)try{let r=this.#t[e];r&&this.#e.on(e,r)}catch{}this.#e.emit=(e,...r)=>this.#p(e,...r),this.#e.reallyExit=e=>this.#n(e)}}unload(){this.#i&&(this.#i=!1,ir.forEach(e=>{let r=this.#t[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#e.removeListener(e,r)}catch{}}),this.#e.emit=this.#o,this.#e.reallyExit=this.#d,this.#r.count-=1)}#n(e){return Ao(this.#e)?(this.#e.exitCode=e||0,this.#r.emit("exit",this.#e.exitCode,null),this.#d.call(this.#e,this.#e.exitCode)):0}#p(e,...r){let n=this.#o;if(e==="exit"&&Ao(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let o=n.call(this.#e,e,...r);return this.#r.emit("exit",this.#e.exitCode,null),o}else return n.call(this.#e,e,...r)}},Cs=globalThis.process,{onExit:Xc,load:Bv,unload:Mv}=Bh(Ao(Cs)?new _s(Cs):new xs)});var Tn,eu,Mh,tu,ru=b(()=>{"use strict";Tn=m(require("process"),1);Zc();Qc();eu=Tn.default.stderr.isTTY?Tn.default.stderr:Tn.default.stdout.isTTY?Tn.default.stdout:void 0,Mh=eu?Kc(()=>{Xc(()=>{eu.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},tu=Mh});var Fs,Io,Ur,ks,nu=b(()=>{"use strict";Fs=m(require("process"),1);ru();Io=!1,Ur={};Ur.show=(t=Fs.default.stderr)=>{t.isTTY&&(Io=!1,t.write("\x1B[?25h"))};Ur.hide=(t=Fs.default.stderr)=>{t.isTTY&&(tu(),Io=!0,t.write("\x1B[?25l"))};Ur.toggle=(t,e)=>{t!==void 0&&(Io=t),Io?Ur.show(e):Ur.hide(e)};ks=Ur});var ou=ds((Gv,Lh)=>{Lh.exports={dots:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"]},dots2:{interval:80,frames:["\u28FE","\u28FD","\u28FB","\u28BF","\u287F","\u28DF","\u28EF","\u28F7"]},dots3:{interval:80,frames:["\u280B","\u2819","\u281A","\u281E","\u2816","\u2826","\u2834","\u2832","\u2833","\u2813"]},dots4:{interval:80,frames:["\u2804","\u2806","\u2807","\u280B","\u2819","\u2838","\u2830","\u2820","\u2830","\u2838","\u2819","\u280B","\u2807","\u2806"]},dots5:{interval:80,frames:["\u280B","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B"]},dots6:{interval:80,frames:["\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2834","\u2832","\u2812","\u2802","\u2802","\u2812","\u281A","\u2819","\u2809","\u2801"]},dots7:{interval:80,frames:["\u2808","\u2809","\u280B","\u2813","\u2812","\u2810","\u2810","\u2812","\u2816","\u2826","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808"]},dots8:{interval:80,frames:["\u2801","\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808","\u2808"]},dots9:{interval:80,frames:["\u28B9","\u28BA","\u28BC","\u28F8","\u28C7","\u2867","\u2857","\u284F"]},dots10:{interval:80,frames:["\u2884","\u2882","\u2881","\u2841","\u2848","\u2850","\u2860"]},dots11:{interval:100,frames:["\u2801","\u2802","\u2804","\u2840","\u2880","\u2820","\u2810","\u2808"]},dots12:{interval:80,frames:["\u2880\u2800","\u2840\u2800","\u2804\u2800","\u2882\u2800","\u2842\u2800","\u2805\u2800","\u2883\u2800","\u2843\u2800","\u280D\u2800","\u288B\u2800","\u284B\u2800","\u280D\u2801","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2888\u2829","\u2840\u2899","\u2804\u2859","\u2882\u2829","\u2842\u2898","\u2805\u2858","\u2883\u2828","\u2843\u2890","\u280D\u2850","\u288B\u2820","\u284B\u2880","\u280D\u2841","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2808\u2829","\u2800\u2899","\u2800\u2859","\u2800\u2829","\u2800\u2898","\u2800\u2858","\u2800\u2828","\u2800\u2890","\u2800\u2850","\u2800\u2820","\u2800\u2880","\u2800\u2840"]},dots13:{interval:80,frames:["\u28FC","\u28F9","\u28BB","\u283F","\u285F","\u28CF","\u28E7","\u28F6"]},dots8Bit:{interval:80,frames:["\u2800","\u2801","\u2802","\u2803","\u2804","\u2805","\u2806","\u2807","\u2840","\u2841","\u2842","\u2843","\u2844","\u2845","\u2846","\u2847","\u2808","\u2809","\u280A","\u280B","\u280C","\u280D","\u280E","\u280F","\u2848","\u2849","\u284A","\u284B","\u284C","\u284D","\u284E","\u284F","\u2810","\u2811","\u2812","\u2813","\u2814","\u2815","\u2816","\u2817","\u2850","\u2851","\u2852","\u2853","\u2854","\u2855","\u2856","\u2857","\u2818","\u2819","\u281A","\u281B","\u281C","\u281D","\u281E","\u281F","\u2858","\u2859","\u285A","\u285B","\u285C","\u285D","\u285E","\u285F","\u2820","\u2821","\u2822","\u2823","\u2824","\u2825","\u2826","\u2827","\u2860","\u2861","\u2862","\u2863","\u2864","\u2865","\u2866","\u2867","\u2828","\u2829","\u282A","\u282B","\u282C","\u282D","\u282E","\u282F","\u2868","\u2869","\u286A","\u286B","\u286C","\u286D","\u286E","\u286F","\u2830","\u2831","\u2832","\u2833","\u2834","\u2835","\u2836","\u2837","\u2870","\u2871","\u2872","\u2873","\u2874","\u2875","\u2876","\u2877","\u2838","\u2839","\u283A","\u283B","\u283C","\u283D","\u283E","\u283F","\u2878","\u2879","\u287A","\u287B","\u287C","\u287D","\u287E","\u287F","\u2880","\u2881","\u2882","\u2883","\u2884","\u2885","\u2886","\u2887","\u28C0","\u28C1","\u28C2","\u28C3","\u28C4","\u28C5","\u28C6","\u28C7","\u2888","\u2889","\u288A","\u288B","\u288C","\u288D","\u288E","\u288F","\u28C8","\u28C9","\u28CA","\u28CB","\u28CC","\u28CD","\u28CE","\u28CF","\u2890","\u2891","\u2892","\u2893","\u2894","\u2895","\u2896","\u2897","\u28D0","\u28D1","\u28D2","\u28D3","\u28D4","\u28D5","\u28D6","\u28D7","\u2898","\u2899","\u289A","\u289B","\u289C","\u289D","\u289E","\u289F","\u28D8","\u28D9","\u28DA","\u28DB","\u28DC","\u28DD","\u28DE","\u28DF","\u28A0","\u28A1","\u28A2","\u28A3","\u28A4","\u28A5","\u28A6","\u28A7","\u28E0","\u28E1","\u28E2","\u28E3","\u28E4","\u28E5","\u28E6","\u28E7","\u28A8","\u28A9","\u28AA","\u28AB","\u28AC","\u28AD","\u28AE","\u28AF","\u28E8","\u28E9","\u28EA","\u28EB","\u28EC","\u28ED","\u28EE","\u28EF","\u28B0","\u28B1","\u28B2","\u28B3","\u28B4","\u28B5","\u28B6","\u28B7","\u28F0","\u28F1","\u28F2","\u28F3","\u28F4","\u28F5","\u28F6","\u28F7","\u28B8","\u28B9","\u28BA","\u28BB","\u28BC","\u28BD","\u28BE","\u28BF","\u28F8","\u28F9","\u28FA","\u28FB","\u28FC","\u28FD","\u28FE","\u28FF"]},sand:{interval:80,frames:["\u2801","\u2802","\u2804","\u2840","\u2848","\u2850","\u2860","\u28C0","\u28C1","\u28C2","\u28C4","\u28CC","\u28D4","\u28E4","\u28E5","\u28E6","\u28EE","\u28F6","\u28F7","\u28FF","\u287F","\u283F","\u289F","\u281F","\u285B","\u281B","\u282B","\u288B","\u280B","\u280D","\u2849","\u2809","\u2811","\u2821","\u2881"]},line:{interval:130,frames:["-","\\","|","/"]},line2:{interval:100,frames:["\u2802","-","\u2013","\u2014","\u2013","-"]},pipe:{interval:100,frames:["\u2524","\u2518","\u2534","\u2514","\u251C","\u250C","\u252C","\u2510"]},simpleDots:{interval:400,frames:[". ",".. ","..."," "]},simpleDotsScrolling:{interval:200,frames:[". ",".. ","..."," .."," ."," "]},star:{interval:70,frames:["\u2736","\u2738","\u2739","\u273A","\u2739","\u2737"]},star2:{interval:80,frames:["+","x","*"]},flip:{interval:70,frames:["_","_","_","-","`","`","'","\xB4","-","_","_","_"]},hamburger:{interval:100,frames:["\u2631","\u2632","\u2634"]},growVertical:{interval:120,frames:["\u2581","\u2583","\u2584","\u2585","\u2586","\u2587","\u2586","\u2585","\u2584","\u2583"]},growHorizontal:{interval:120,frames:["\u258F","\u258E","\u258D","\u258C","\u258B","\u258A","\u2589","\u258A","\u258B","\u258C","\u258D","\u258E"]},balloon:{interval:140,frames:[" ",".","o","O","@","*"," "]},balloon2:{interval:120,frames:[".","o","O","\xB0","O","o","."]},noise:{interval:100,frames:["\u2593","\u2592","\u2591"]},bounce:{interval:120,frames:["\u2801","\u2802","\u2804","\u2802"]},boxBounce:{interval:120,frames:["\u2596","\u2598","\u259D","\u2597"]},boxBounce2:{interval:100,frames:["\u258C","\u2580","\u2590","\u2584"]},triangle:{interval:50,frames:["\u25E2","\u25E3","\u25E4","\u25E5"]},binary:{interval:80,frames:["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},arc:{interval:100,frames:["\u25DC","\u25E0","\u25DD","\u25DE","\u25E1","\u25DF"]},circle:{interval:120,frames:["\u25E1","\u2299","\u25E0"]},squareCorners:{interval:180,frames:["\u25F0","\u25F3","\u25F2","\u25F1"]},circleQuarters:{interval:120,frames:["\u25F4","\u25F7","\u25F6","\u25F5"]},circleHalves:{interval:50,frames:["\u25D0","\u25D3","\u25D1","\u25D2"]},squish:{interval:100,frames:["\u256B","\u256A"]},toggle:{interval:250,frames:["\u22B6","\u22B7"]},toggle2:{interval:80,frames:["\u25AB","\u25AA"]},toggle3:{interval:120,frames:["\u25A1","\u25A0"]},toggle4:{interval:100,frames:["\u25A0","\u25A1","\u25AA","\u25AB"]},toggle5:{interval:100,frames:["\u25AE","\u25AF"]},toggle6:{interval:300,frames:["\u101D","\u1040"]},toggle7:{interval:80,frames:["\u29BE","\u29BF"]},toggle8:{interval:100,frames:["\u25CD","\u25CC"]},toggle9:{interval:100,frames:["\u25C9","\u25CE"]},toggle10:{interval:100,frames:["\u3282","\u3280","\u3281"]},toggle11:{interval:50,frames:["\u29C7","\u29C6"]},toggle12:{interval:120,frames:["\u2617","\u2616"]},toggle13:{interval:80,frames:["=","*","-"]},arrow:{interval:100,frames:["\u2190","\u2196","\u2191","\u2197","\u2192","\u2198","\u2193","\u2199"]},arrow2:{interval:80,frames:["\u2B06\uFE0F ","\u2197\uFE0F ","\u27A1\uFE0F ","\u2198\uFE0F ","\u2B07\uFE0F ","\u2199\uFE0F ","\u2B05\uFE0F ","\u2196\uFE0F "]},arrow3:{interval:120,frames:["\u25B9\u25B9\u25B9\u25B9\u25B9","\u25B8\u25B9\u25B9\u25B9\u25B9","\u25B9\u25B8\u25B9\u25B9\u25B9","\u25B9\u25B9\u25B8\u25B9\u25B9","\u25B9\u25B9\u25B9\u25B8\u25B9","\u25B9\u25B9\u25B9\u25B9\u25B8"]},bouncingBar:{interval:80,frames:["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},bouncingBall:{interval:80,frames:["( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF)","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","(\u25CF )"]},smiley:{interval:200,frames:["\u{1F604} ","\u{1F61D} "]},monkey:{interval:300,frames:["\u{1F648} ","\u{1F648} ","\u{1F649} ","\u{1F64A} "]},hearts:{interval:100,frames:["\u{1F49B} ","\u{1F499} ","\u{1F49C} ","\u{1F49A} ","\u2764\uFE0F "]},clock:{interval:100,frames:["\u{1F55B} ","\u{1F550} ","\u{1F551} ","\u{1F552} ","\u{1F553} ","\u{1F554} ","\u{1F555} ","\u{1F556} ","\u{1F557} ","\u{1F558} ","\u{1F559} ","\u{1F55A} "]},earth:{interval:180,frames:["\u{1F30D} ","\u{1F30E} ","\u{1F30F} "]},material:{interval:17,frames:["\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581"]},moon:{interval:80,frames:["\u{1F311} ","\u{1F312} ","\u{1F313} ","\u{1F314} ","\u{1F315} ","\u{1F316} ","\u{1F317} ","\u{1F318} "]},runner:{interval:140,frames:["\u{1F6B6} ","\u{1F3C3} "]},pong:{interval:80,frames:["\u2590\u2802 \u258C","\u2590\u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802\u258C","\u2590 \u2820\u258C","\u2590 \u2840\u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590\u2820 \u258C"]},shark:{interval:120,frames:["\u2590|\\____________\u258C","\u2590_|\\___________\u258C","\u2590__|\\__________\u258C","\u2590___|\\_________\u258C","\u2590____|\\________\u258C","\u2590_____|\\_______\u258C","\u2590______|\\______\u258C","\u2590_______|\\_____\u258C","\u2590________|\\____\u258C","\u2590_________|\\___\u258C","\u2590__________|\\__\u258C","\u2590___________|\\_\u258C","\u2590____________|\\\u258C","\u2590____________/|\u258C","\u2590___________/|_\u258C","\u2590__________/|__\u258C","\u2590_________/|___\u258C","\u2590________/|____\u258C","\u2590_______/|_____\u258C","\u2590______/|______\u258C","\u2590_____/|_______\u258C","\u2590____/|________\u258C","\u2590___/|_________\u258C","\u2590__/|__________\u258C","\u2590_/|___________\u258C","\u2590/|____________\u258C"]},dqpb:{interval:100,frames:["d","q","p","b"]},weather:{interval:100,frames:["\u2600\uFE0F ","\u2600\uFE0F ","\u2600\uFE0F ","\u{1F324} ","\u26C5\uFE0F ","\u{1F325} ","\u2601\uFE0F ","\u{1F327} ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u26C8 ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u2601\uFE0F ","\u{1F325} ","\u26C5\uFE0F ","\u{1F324} ","\u2600\uFE0F ","\u2600\uFE0F "]},christmas:{interval:400,frames:["\u{1F332}","\u{1F384}"]},grenade:{interval:80,frames:["\u060C ","\u2032 "," \xB4 "," \u203E "," \u2E0C"," \u2E0A"," |"," \u204E"," \u2055"," \u0DF4 "," \u2053"," "," "," "]},point:{interval:125,frames:["\u2219\u2219\u2219","\u25CF\u2219\u2219","\u2219\u25CF\u2219","\u2219\u2219\u25CF","\u2219\u2219\u2219"]},layer:{interval:150,frames:["-","=","\u2261"]},betaWave:{interval:80,frames:["\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1"]},fingerDance:{interval:160,frames:["\u{1F918} ","\u{1F91F} ","\u{1F596} ","\u270B ","\u{1F91A} ","\u{1F446} "]},fistBump:{interval:80,frames:["\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u3000\u{1F91C}\u3000\u3000\u{1F91B}\u3000 ","\u3000\u3000\u{1F91C}\u{1F91B}\u3000\u3000 ","\u3000\u{1F91C}\u2728\u{1F91B}\u3000\u3000 ","\u{1F91C}\u3000\u2728\u3000\u{1F91B}\u3000 "]},soccerHeader:{interval:80,frames:[" \u{1F9D1}\u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F\u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} "]},mindblown:{interval:160,frames:["\u{1F610} ","\u{1F610} ","\u{1F62E} ","\u{1F62E} ","\u{1F626} ","\u{1F626} ","\u{1F627} ","\u{1F627} ","\u{1F92F} ","\u{1F4A5} ","\u2728 ","\u3000 ","\u3000 ","\u3000 "]},speaker:{interval:160,frames:["\u{1F508} ","\u{1F509} ","\u{1F50A} ","\u{1F509} "]},orangePulse:{interval:100,frames:["\u{1F538} ","\u{1F536} ","\u{1F7E0} ","\u{1F7E0} ","\u{1F536} "]},bluePulse:{interval:100,frames:["\u{1F539} ","\u{1F537} ","\u{1F535} ","\u{1F535} ","\u{1F537} "]},orangeBluePulse:{interval:100,frames:["\u{1F538} ","\u{1F536} ","\u{1F7E0} ","\u{1F7E0} ","\u{1F536} ","\u{1F539} ","\u{1F537} ","\u{1F535} ","\u{1F535} ","\u{1F537} "]},timeTravel:{interval:100,frames:["\u{1F55B} ","\u{1F55A} ","\u{1F559} ","\u{1F558} ","\u{1F557} ","\u{1F556} ","\u{1F555} ","\u{1F554} ","\u{1F553} ","\u{1F552} ","\u{1F551} ","\u{1F550} "]},aesthetic:{interval:80,frames:["\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0","\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1"]},dwarfFortress:{interval:80,frames:[" \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A \u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A \xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A \xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\u2593\xA3 "," \u263A\u2593\xA3 "," \u263A\u2592\xA3 "," \u263A\u2592\xA3 "," \u263A\u2591\xA3 "," \u263A\u2591\xA3 "," \u263A \xA3 "," \u263A\xA3 "," \u263A\xA3 "," \u263A\u2593 "," \u263A\u2593 "," \u263A\u2592 "," \u263A\u2592 "," \u263A\u2591 "," \u263A\u2591 "," \u263A "," \u263A &"," \u263A \u263C&"," \u263A \u263C &"," \u263A\u263C &"," \u263A\u263C & "," \u203C & "," \u263A & "," \u203C & "," \u263A & "," \u203C & "," \u263A & ","\u203C & "," & "," & "," & \u2591 "," & \u2592 "," & \u2593 "," & \xA3 "," & \u2591\xA3 "," & \u2592\xA3 "," & \u2593\xA3 "," & \xA3\xA3 "," & \u2591\xA3\xA3 "," & \u2592\xA3\xA3 ","& \u2593\xA3\xA3 ","& \xA3\xA3\xA3 "," \u2591\xA3\xA3\xA3 "," \u2592\xA3\xA3\xA3 "," \u2593\xA3\xA3\xA3 "," \u2588\xA3\xA3\xA3 "," \u2591\u2588\xA3\xA3\xA3 "," \u2592\u2588\xA3\xA3\xA3 "," \u2593\u2588\xA3\xA3\xA3 "," \u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "]}}});var Ss=ds((zv,su)=>{"use strict";var $o=Object.assign({},ou()),iu=Object.keys($o);Object.defineProperty($o,"random",{get(){let t=Math.floor(Math.random()*iu.length),e=iu[t];return $o[e]}});su.exports=$o});function Ts(){return Ve.default.platform!=="win32"?Ve.default.env.TERM!=="linux":!!Ve.default.env.CI||!!Ve.default.env.WT_SESSION||!!Ve.default.env.TERMINUS_SUBLIME||Ve.default.env.ConEmuTask==="{cmd::Cmder}"||Ve.default.env.TERM_PROGRAM==="Terminus-Sublime"||Ve.default.env.TERM_PROGRAM==="vscode"||Ve.default.env.TERM==="xterm-256color"||Ve.default.env.TERM==="alacritty"||Ve.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Ve,au=b(()=>{"use strict";Ve=m(require("process"),1)});var Wh,Uh,Vh,An,lu=b(()=>{"use strict";ws();au();Wh={info:nt.blue("\u2139"),success:nt.green("\u2714"),warning:nt.yellow("\u26A0"),error:nt.red("\u2716")},Uh={info:nt.blue("i"),success:nt.green("\u221A"),warning:nt.yellow("\u203C"),error:nt.red("\xD7")},Vh=Ts()?Wh:Uh,An=Vh});function As({onlyFirst:t=!1}={}){let o="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(o,t?void 0:"g")}var cu=b(()=>{"use strict"});function On(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return!t.includes("\x1B")&&!t.includes("\x9B")?t:t.replace(Hh,"")}var Hh,Os=b(()=>{"use strict";cu();Hh=As()});var uu,fu,du,pu,mu,gu,Is,hu=b(()=>{"use strict";uu=[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],fu=12288,du=65510,pu=[12288,12288,65281,65376,65504,65510],mu=4352,gu=262141,Is=[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 Ro,yu=b(()=>{"use strict";Ro=(t,e)=>{let r=0,n=Math.floor(t.length/2)-1;for(;r<=n;){let o=Math.floor((r+n)/2),i=o*2;if(e<t[i])n=o-1;else if(e>t[i+1])r=o+1;else return!0}return!1}});function Kh(t){let e=t[0],r=t[1];for(let n=0;n<t.length;n+=2){let o=t[n],i=t[n+1];if(wu>=o&&wu<=i)return[o,i];i-o>r-e&&(e=o,r=i)}return[e,r]}var wu,zh,qh,Du,bu,vu,Eu=b(()=>{"use strict";hu();yu();wu=19968,[zh,qh]=Kh(Is);Du=t=>t<161||t>1114109?!1:Ro(uu,t),bu=t=>t<fu||t>du?!1:Ro(pu,t),vu=t=>t>=zh&&t<=qh?!0:t<mu||t>gu?!1:Ro(Is,t)});function Zh(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}function xu(t,{ambiguousAsWide:e=!1}={}){return Zh(t),bu(t)||vu(t)||e&&Du(t)?2:1}var _u=b(()=>{"use strict";Eu()});var Cu,Fu=b(()=>{"use strict";Cu=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g});function $s(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:n=!1}=e;if(n||(t=On(t)),t.length===0)return 0;let o=0,i={ambiguousAsWide:!r};for(let{segment:s}of Yh.segment(t)){let a=s.codePointAt(0);if(!(a<=31||a>=127&&a<=159)&&!(a>=8203&&a<=8207||a===65279)&&!(a>=768&&a<=879||a>=6832&&a<=6911||a>=7616&&a<=7679||a>=8400&&a<=8447||a>=65056&&a<=65071)&&!(a>=55296&&a<=57343)&&!(a>=65024&&a<=65039)&&!Xh.test(s)){if(Cu().test(s)){o+=2;continue}o+=xu(a,i)}}return o}var Yh,Xh,ku=b(()=>{"use strict";Os();_u();Fu();Yh=new Intl.Segmenter,Xh=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u")});function Rs({stream:t=process.stdout}={}){return!!(t&&t.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}var Su=b(()=>{"use strict"});function js(){let{env:t}=Ps.default,{TERM:e,TERM_PROGRAM:r}=t;return Ps.default.platform!=="win32"?e!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Ps,Tu=b(()=>{"use strict";Ps=m(require("process"),1)});var ot,Qh,Ns,ey,Bs,Au=b(()=>{"use strict";ot=m(require("process"),1),Qh=3,Ns=class{#s=0;start(){this.#s++,this.#s===1&&this.#r()}stop(){if(this.#s<=0)throw new Error("`stop` called more times than `start`");this.#s--,this.#s===0&&this.#e()}#r(){ot.default.platform==="win32"||!ot.default.stdin.isTTY||(ot.default.stdin.setRawMode(!0),ot.default.stdin.on("data",this.#o),ot.default.stdin.resume())}#e(){ot.default.stdin.isTTY&&(ot.default.stdin.off("data",this.#o),ot.default.stdin.pause(),ot.default.stdin.setRawMode(!1))}#o(e){e[0]===Qh&&ot.default.emit("SIGINT")}},ey=new Ns,Bs=ey});function Ls(t){return new Ms(t)}var In,$n,ty,Ms,Ou=b(()=>{"use strict";In=m(require("process"),1);ws();nu();$n=m(Ss(),1);lu();Os();ku();Su();Tu();Au();ty=m(Ss(),1),Ms=class{#s=0;#r=!1;#e=0;#o=-1;#d=0;#t;#i;#n;#p;#g;#c;#u;#f;#h;#a;#l;color;constructor(e){typeof e=="string"&&(e={text:e}),this.#t={color:"cyan",stream:In.default.stderr,discardStdin:!0,hideCursor:!0,...e},this.color=this.#t.color,this.spinner=this.#t.spinner,this.#g=this.#t.interval,this.#n=this.#t.stream,this.#c=typeof this.#t.isEnabled=="boolean"?this.#t.isEnabled:Rs({stream:this.#n}),this.#u=typeof this.#t.isSilent=="boolean"?this.#t.isSilent:!1,this.text=this.#t.text,this.prefixText=this.#t.prefixText,this.suffixText=this.#t.suffixText,this.indent=this.#t.indent,In.default.env.NODE_ENV==="test"&&(this._stream=this.#n,this._isEnabled=this.#c,Object.defineProperty(this,"_linesToClear",{get(){return this.#s},set(r){this.#s=r}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#o}}),Object.defineProperty(this,"_lineCount",{get(){return this.#e}}))}get indent(){return this.#f}set indent(e=0){if(!(e>=0&&Number.isInteger(e)))throw new Error("The `indent` option must be an integer from 0 and up");this.#f=e,this.#m()}get interval(){return this.#g??this.#i.interval??100}get spinner(){return this.#i}set spinner(e){if(this.#o=-1,this.#g=void 0,typeof e=="object"){if(e.frames===void 0)throw new Error("The given spinner must have a `frames` property");this.#i=e}else if(!js())this.#i=$n.default.line;else if(e===void 0)this.#i=$n.default.dots;else if(e!=="default"&&$n.default[e])this.#i=$n.default[e];else throw new Error(`There is no built-in spinner named '${e}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#h}set text(e=""){this.#h=e,this.#m()}get prefixText(){return this.#a}set prefixText(e=""){this.#a=e,this.#m()}get suffixText(){return this.#l}set suffixText(e=""){this.#l=e,this.#m()}get isSpinning(){return this.#p!==void 0}#y(e=this.#a,r=" "){return typeof e=="string"&&e!==""?e+r:typeof e=="function"?e()+r:""}#w(e=this.#l,r=" "){return typeof e=="string"&&e!==""?r+e:typeof e=="function"?r+e():""}#m(){let e=this.#n.columns??80,r=this.#y(this.#a,"-"),n=this.#w(this.#l,"-"),o=" ".repeat(this.#f)+r+"--"+this.#h+"--"+n;this.#e=0;for(let i of On(o).split(`
|
|
8
|
-
`))this.#e+=Math.max(1,Math.ceil(
|
|
9
|
-
`),this)}stop(){return this.#
|
|
10
|
-
`;return this.stop(),this.#n.write(f),this}}});function Vs(t,{suffix:e="nodejs"}={}){if(typeof t!="string")throw new TypeError(`Expected a string, got ${typeof t}`);return e&&(t+=`-${e}`),Po.default.platform==="darwin"?ry(t):Po.default.platform==="win32"?ny(t):oy(t)}var ae,Ws,Po,Rt,Us,Vr,ry,ny,oy,Iu=b(()=>{"use strict";ae=m(require("path"),1),Ws=m(require("os"),1),Po=m(require("process"),1),Rt=Ws.default.homedir(),Us=Ws.default.tmpdir(),{env:Vr}=Po.default,ry=t=>{let e=ae.default.join(Rt,"Library");return{data:ae.default.join(e,"Application Support",t),config:ae.default.join(e,"Preferences",t),cache:ae.default.join(e,"Caches",t),log:ae.default.join(e,"Logs",t),temp:ae.default.join(Us,t)}},ny=t=>{let e=Vr.APPDATA||ae.default.join(Rt,"AppData","Roaming"),r=Vr.LOCALAPPDATA||ae.default.join(Rt,"AppData","Local");return{data:ae.default.join(r,t,"Data"),config:ae.default.join(e,t,"Config"),cache:ae.default.join(r,t,"Cache"),log:ae.default.join(r,t,"Log"),temp:ae.default.join(Us,t)}},oy=t=>{let e=ae.default.basename(Rt);return{data:ae.default.join(Vr.XDG_DATA_HOME||ae.default.join(Rt,".local","share"),t),config:ae.default.join(Vr.XDG_CONFIG_HOME||ae.default.join(Rt,".config"),t),cache:ae.default.join(Vr.XDG_CACHE_HOME||ae.default.join(Rt,".cache"),t),log:ae.default.join(Vr.XDG_STATE_HOME||ae.default.join(Rt,".local","state"),t),temp:ae.default.join(Us,e,t)}}});function jo(){return/[<>:"/\\|?*\u0000-\u001F]/g}function $u(){return/^(con|prn|aux|nul|com\d|lpt\d)$/i}var Ru=b(()=>{"use strict"});function Rn(t,e={}){let r=/[\u0000-\u001F\u0080-\u009F]/g,n=/([<>:"/\\|?*\u0000-\u001F]){2,}/g;if(typeof t!="string")throw new TypeError("Expected a string");let o=e.replacement===void 0?"!":e.replacement;if(jo().test(o)&&r.test(o))throw new Error("Replacement string cannot contain reserved filename characters");o.length>0&&(t=t.replace(n,"$1")),t=t.normalize("NFD"),t=t.replace(sy,o),t=t.replace(jo(),o),t=t.replace(r,o),t=t.replace(ay,""),o.length>0&&(!(t[0]===".")&&t[0]==="."&&(t=o+t),t[t.length-1]==="."&&(t+=o)),t=$u().test(t)?t+o:t;let i=typeof e.maxLength=="number"?e.maxLength:iy;if(t.length>i){let s=t.lastIndexOf(".");if(s===-1)t=t.slice(0,i);else{let a=t.slice(0,s),l=t.slice(s);t=a.slice(0,Math.max(1,i-l.length))+l}}return t}var iy,sy,ay,Hs=b(()=>{"use strict";Ru();iy=100,sy=/^\.+(\\|\/)|^\.+$/,ay=/\.+$/});var ly,Pu=b(()=>{"use strict";ly=m(require("path"),1);Hs()});var ju=b(()=>{"use strict";Hs();Pu()});var No,Js=b(()=>{"use strict";No="webflow.json"});var sr,Gs=b(()=>{"use strict";sr=class extends Error{constructor(e){super(`Manifest config for key "${e}" not found`),this.name="ManifestConfigKeyNotFoundError"}}});function Bu(t){zs=t}function te(){return zs}function ct(){return!zs}function Mu(t){Nu=t}function Lu(){return Nu}var zs,Nu,Fe=b(()=>{"use strict";zs=!1});function ar(){let t=Lu();if(t){if(t.endsWith(".json"))return{path:t,isUserDefined:!0};try{if((0,Wu.statSync)(t)?.isDirectory())return{path:(0,Uu.join)(t,No),isUserDefined:!0}}catch{if(t.endsWith(".json"))return{path:t,isUserDefined:!0}}throw new Error(`Manifest path must be either a directory or a .json file. Got: ${t}`)}return{path:`./${No}`,isUserDefined:!1}}var Wu,Uu,qs=b(()=>{"use strict";Wu=require("fs"),Uu=require("path");Js();Fe()});var Vu,cy,uy,Ks,Hu=b(()=>{"use strict";Vu=m(require("ajv")),cy=new Vu.default,uy={type:"object",properties:{library:{type:"object",properties:{name:{type:"string",minLength:1},id:{type:"string",minLength:1},components:{type:"array",items:{type:"string"},minItems:1},renderer:{anyOf:[{type:"object",properties:{client:{type:"string",minLength:1},server:{type:"string",minLength:1}}},{type:"string",minLength:1}]},globals:{type:"string",minLength:1}},required:[]},devlink:{type:"object",properties:{rootDir:{type:"string",minLength:1},cssModules:{type:"boolean"},allowTelemetry:{type:"boolean"},overwriteModule:{type:"boolean"},skipTagSelectors:{type:"boolean"},envVariables:{type:"object",additionalProperties:{type:"string"}},components:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},fileExtensions:{type:"object",properties:{js:{type:"string"},css:{type:"string"}}},relativeHrefRoot:{oneOf:[{type:"boolean"},{type:"string"}]}},required:["rootDir"]},"devlink-export":{type:"object",properties:{rootDir:{type:"string",minLength:1},components:{type:"string"},componentGroups:{type:"string"},ts:{type:"boolean"},cssScopes:{type:"boolean"},relativeHrefRoot:{oneOf:[{type:"boolean",const:!1},{type:"string"}]},treeShake:{type:"boolean"}},required:[]}}},Ks=cy.compile(uy)});function Ju(t){return t instanceof Error?t:new Error("Unknown error")}function G(){let{path:t}=ar();if(!(0,Bo.existsSync)(t))return{manifest:{},manifestPath:t};let e;try{e=(0,Bo.readFileSync)(t,"utf8")}catch(o){throw new Error(`Failed to read manifest file: ${Ju(o).message}`)}if(e.trim()==="")return{manifest:{},manifestPath:t};let n;try{n=JSON.parse(e)}catch(o){throw new Error(`Invalid JSON in manifest file: ${Ju(o).message}`)}if(!Ks(n)){let o=Ks.errors?.map(i=>`${i.instancePath} ${i.message}`).join(", ")||"Unknown error";throw new Error(`Invalid manifest: ${o}.`)}return{manifest:n,manifestPath:t}}var Bo,Pn=b(()=>{"use strict";Bo=require("fs");qs();Hu()});function jn(t,e){let r=t[e];if(!r)throw new sr(e);return r}var Gu=b(()=>{"use strict";Gs()});function oe(t){let e=G(),r=e.manifest,n=e.manifestPath,o={...r};for(let i in t){let s=i,a=t[s];if(a!==void 0)if(typeof a=="string"||typeof a=="number"||typeof a=="boolean"||a===null)o[s]=a;else{let l=o[s];o[s]={...typeof l=="object"&&l!==null?l:{},...a}}}return(0,zu.writeFileSync)(n,JSON.stringify(o,null,2),"utf-8"),o}var zu,Zs=b(()=>{"use strict";zu=require("fs");Pn()});var De=b(()=>{"use strict";Js();Gs();Pn();qs();Gu();Zs()});var Mo=ds((cx,fy)=>{fy.exports={name:"@webflow/webflow-cli",version:"2.0.0-next.0",license:"MIT",bin:{webflow:"./dist/index.js"},scripts:{build:"tsup",dev:"tsup",lint:"eslint .",test:"jest --ci","test:unit":"jest --ci --ignoreProjects e2e","test:local":"jest","test:e2e-cache-clear":"bash scripts/clear-e2e-cache.sh"},files:["CHANGELOG.md","dist/**/*"],publishConfig:{access:"public"},dependencies:{"@babel/preset-env":"^7.26.9","@babel/preset-react":"^7.26.3","@babel/preset-typescript":"^7.27.0","@dotenvx/dotenvx":"^1.44.1","@inquirer/prompts":"^7.9.0","@module-federation/enhanced":"0.20.0","@rspack/core":"^1.7.8","@webflow/data-types":"*",ajv:"^8.17.1",archiver:"^5.3.1","babel-loader":"^10.0.0",commander:"^10.0.0",cosmiconfig:"^8.2.0","css-loader":"^7.1.2",dotenv:"^16.0.3","env-paths":"^3.0.0","fast-glob":"^3.3.3",filenamify:"^6.0.0","fork-ts-checker-webpack-plugin":"9.1.0","form-data":"4.0.4","fs-extra":"^11.3.0",jsdom:"^26.0.0","jsonc-parser":"^3.2.0",md5:"^2.2.1",memfs:"4.17.0","mime-types":"^2.1.35","mini-css-extract-plugin":"^2.9.2","node-fetch":"^2.6.7",open:"^8.4.2",ora:"^8.2.0",postcss:"^8.5.6","postcss-loader":"^8.1.1","postcss-selector-parser":"^7.1.0",semver:"^7.7.2","serve-handler":"^6.1.5","source-map-support":"^0.5.21",tar:"^7.4.3","ts-checker-rspack-plugin":"^1.0.0","tsconfig-paths":"^4.2.0","tsconfig-paths-webpack-plugin":"^4.2.0",unionfs:"^4.5.4","webflow-api":"3.3.4",webpack:">=5.99.7 <5.106.0","webpack-merge":"^6.0.1","webpack-node-externals":"^3.0.0",zod:"^3.22.4"},devDependencies:{"@types/archiver":"^5.3.2","@types/express":"^4.17.13","@types/fs-extra":"^11.0.4","@types/jest":"^29.2.3","@types/md5":"^2.3.2","@types/mime-types":"^2.1.4","@types/nock":"^8.0.33","@types/node":"^22.13.0","@types/node-fetch":"2.6.13","@types/serve-handler":"^6.1.1","@types/source-map":"^0.5.2","@types/webpack-node-externals":"^3.0.4",astro:"^5.17.2","eslint-config-custom":"*",express:"^4.18.1",jest:"^29.3.1",nock:"13.3.1",tar:"^7.4.3","ts-jest":"^29.4.9","ts-node":"^10.9.1",tsconfig:"*",tsup:"^8.4.0",typescript:"^5.9.3"},engines:{node:">=22.13.0"}}});function vt(){try{return Mo().version}catch{return"unknown"}}function ut(t=""){if(!t)return"";let e=t;e=e.replace(/\/.*?\/webflow-cli/gi,"/REDACTED_PII/webflow-cli"),e=e.replace(/\/.*?\/node_modules/gi,"/REDACTED_PII/node_modules");let r=Nn.default.homedir();if(r){let o=new RegExp(r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gi");e=e.replace(o,"~/REDACTED_PII")}let n=Nn.default.userInfo().username;if(n){let o=new RegExp(`/Users/${n}`,"gi");e=e.replace(o,"/Users/REDACTED_PII")}return e=e.replace(/\/Users\/[^\/\s]+/gi,"/Users/REDACTED_PII"),e=e.replace(/C:\\Users\\[^\\]+/gi,"C:\\Users\\REDACTED_PII"),e=e.replace(/[a-zA-Z0-9]{32,}/g,"[REDACTED_TOKEN]"),e=e.replace(/Bearer\s+[^\s]+/gi,"Bearer [REDACTED_TOKEN]"),e=e.replace(/token[=:]\s*[^\s]+/gi,"token=[REDACTED_TOKEN]"),e=e.replace(/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b/g,"[REDACTED_EMAIL]"),e=e.replace(/\b(?:[0-9]{1,3}\.){3}[0-9]{1,3}\b/g,"[REDACTED_IP]"),e}function Ys(t){if(t.stack)return ut(t.stack)}function Pt(t){let e=["password","token","secret","key","auth","bearer","authorization","apikey","api_key","access_token","refresh_token","client_secret","private_key"],r={};for(let[n,o]of Object.entries(t)){let i=n.toLowerCase();e.some(s=>i.includes(s))?r[n]="[REDACTED]":typeof o=="string"?r[n]=ut(o):typeof o=="object"&&o!==null&&!Array.isArray(o)?r[n]=Pt(o):Array.isArray(o)?r[n]=o.map(s=>typeof s=="object"&&s!==null?Pt(s):typeof s=="string"?ut(s):s):r[n]=o}return r}function qu(){return{platform:process.platform,nodeVersion:process.version,arch:process.arch,os:`${Nn.default.type()} ${Nn.default.release()}`}}function Xs(){let t=Date.now().toString(36),e=Math.random().toString(36).substring(2,8);return`${t}-${e}`}var Nn,Bn=b(()=>{"use strict";Nn=m(require("os"))});var T,E,ke,Hr,Qs,He,Ee,Lo,ea,H=b(()=>{"use strict";fe();T=M("\u2713"),E=bt("\u2716"),ke=le("\u2139"),Hr=M("\u279C"),Qs=bt("\u279C"),He="\u279C",Ee=ce("\u26A0"),Lo=S("\u2732"),ea=M("\u2732")});var jt,ta=b(()=>{"use strict";De();Bn();_();fe();H();jt=class t{static instance;cache=void 0;static isDoNotTrackEnabled(){let e=process.env.DO_NOT_TRACK;return e==="1"||e?.toLowerCase()==="true"}static getInstance(){return t.instance||(t.instance=new t),t.instance}async getPreference(){if(t.isDoNotTrackEnabled())return!1;if(this.cache!==void 0)return this.cache;try{let{manifest:e}=await G(),r=e?.telemetry?.global?.allowTelemetry;return this.cache=r,r}catch{return}}async setPreference(e){this.cache=e,await this.setGlobalPreference(e)}async promptForConsent(e){return t.isDoNotTrackEnabled()?(c.info(`${ke} Telemetry is disabled because the DO_NOT_TRACK environment variable is set.`),!1):(c.info(`${ea} ${S("Telemetry is enabled. We collect usage data and error reports to improve the Webflow CLI.")}`),c.info(`${ea} ${S("To opt out, run")} ${M("webflow auth telemetry --disable")}`),await this.setPreference(!0),!0)}clearCache(){this.cache=void 0}async getGlobalPreference(){return this.getPreference()}async setGlobalPreference(e){let r={telemetry:{global:{allowTelemetry:e,lastPrompted:Date.now(),version:vt()}}};await oe(r),c.info(`${T} Telemetry configuration updated in webflow.json`),this.cache=e}async hasGlobalPreference(){return await this.getPreference()!==void 0}async getTelemetryStatus(){let e=await this.getPreference();return e!==void 0?{enabled:e,source:"global",hasPreference:!0}:{enabled:!1,source:"none",hasPreference:!1}}setCacheValue(e,r){this.cache=r}}});async function q(t,e){let n={"User-Agent":`webflow-cli@${vt()}`};return(0,Ku.default)(t,{...e,headers:{...e?.headers,...n}})}var Ku,ft=b(()=>{"use strict";Ku=m(require("node-fetch"));ee()});var Zu,Yu=b(()=>{"use strict";Zu=t=>{try{let e=new URL(t);return!(!["http:","https:"].includes(e.protocol)||t.includes("?")||t.includes("#")||e.search||e.hash)}catch{return!1}}});var ra,C,Wo,Jr,Mn,na,Ln,Wn,Gr,ie=b(()=>{"use strict";Yu();ra=(t,e)=>(Zu(e)||(console.error(`Error: Invalid ${t} environment variable. Only valid plain HTTP/HTTPS URLs without query parameters and anchors is allowed.`),process.exit(1)),e),C=process.env.WEBFLOW_API_HOST?ra("WEBFLOW_API_HOST",process.env.WEBFLOW_API_HOST):"https://api.webflow.com",Wo=process.env.WEBFLOW_CDN_API_HOST?ra("WEBFLOW_CDN_API_HOST",process.env.WEBFLOW_CDN_API_HOST):"https://api-cdn.webflow.com",Jr=process.env.WEBFLOW_HOST?ra("WEBFLOW_HOST",process.env.WEBFLOW_HOST):"https://webflow.com",Mn="wf-manifest.json",na="mf-manifest.json",Ln="@webflow_renderer",Wn="ssr-bundle.tar",Gr="index.js"});var A,oa=b(()=>{"use strict";ta();Bn();_();ft();ie();A=class t{config;consentManager;sessionId;platformInfo;constructor(e){this.config=e,this.consentManager=jt.getInstance(),this.sessionId=Xs(),this.platformInfo=qu()}async sendEvent(e){try{if(!await this.isEnabled())return;let r=this.enrichEvent(e),n=this.sanitizeEvent(r);await this.transmitEvent(n)}catch(r){c.debug(`Failed to send telemetry event: ${r}`)}}async sendError(e,r,n){await this.sendEvent({eventType:"error",success:!1,name:e.name,message:e.message,cause:e.cause,stack:Ys(e),context:r,metadata:n?Pt(n):void 0})}async sendUsage(e,r){let{duration:n,...o}=r??{};await this.sendEvent({eventType:"usage",success:!0,feature:e,duration:typeof n=="number"?n:void 0,data:Object.keys(o).length>0?Pt(o):void 0})}async sendPerformance(e,r,n){await this.sendEvent({eventType:"performance",operation:e,duration:r,metrics:n})}async isEnabled(){return await this.consentManager.getPreference()!==!1}async isGloballyEnabled(){return await this.consentManager.getGlobalPreference()!==!1}async updatePreferences(e){await this.consentManager.setPreference(e)}static async promptForConsentIfNeeded(e){let r=jt.getInstance(),n=await r.getPreference();return n!==void 0?n:await r.promptForConsent(e)}enrichEvent(e){return{...{eventType:e.eventType||"usage",timestamp:Date.now(),sessionId:this.sessionId,platform:this.platformInfo.platform,nodeVersion:this.platformInfo.nodeVersion,cliVersion:vt(),command:process.argv.slice(2).join(" ")||void 0,metadata:{...e.metadata,commandType:this.config.commandType,siteId:this.config.siteId,projectId:this.config.projectId,os:this.platformInfo.os,arch:this.platformInfo.arch}},...e}}sanitizeEvent(e){let r=JSON.parse(JSON.stringify(e));return r.message&&(r.message=ut(r.message)),r.stack&&(r.stack=ut(r.stack)),r.context&&(r.context=ut(r.context)),r.metadata&&(r.metadata=Pt(r.metadata)),r.data&&(r.data=Pt(r.data)),r}async transmitEvent(e){let r=this.getEndpoint(),n=process.env.WEBFLOW_TELEMETRY_DEBUG==="true";if(n){console.log(`\u{1F4CA} [Telemetry] Sending to: ${r}`);let i={...e};i.metadata&&(delete i.metadata.authToken,delete i.metadata.apiToken),console.log("\u{1F4CA} [Telemetry] Payload:",JSON.stringify(i,null,2))}let o=await q(r,{method:"POST",headers:{Authorization:`Bearer ${this.config.authToken}`,"Content-Type":"application/json"},body:JSON.stringify(e),timeout:5e3});if(o.ok)n&&console.log(`\u{1F4CA} [Telemetry] Request successful: ${o.status}`);else throw n&&console.error(`\u{1F4CA} [Telemetry] Request failed: ${o.status} ${o.statusText}`),new Error(`Telemetry request failed: ${o.status} ${o.statusText}`)}getEndpoint(){let{host:e,commandType:r}=this.config;return`${e}/webflow-cli/${r}/telemetry`}static forDevlinkSync(e){return new t({host:e.host||C,authToken:e.authToken,siteId:e.siteId,commandType:"devlink"})}static forExport(e){return new t({host:e.host||C,authToken:e.authToken,siteId:e.siteId,commandType:"export"})}static forCloud(e){return new t({host:e.host||C,authToken:e.authToken,siteId:e.siteId,projectId:e.projectId,commandType:"cloud"})}static forExtension(e){return new t({host:e.host||C,authToken:e.authToken,siteId:e.siteId,commandType:"extension"})}static forCodeLibraries(e){return new t({host:e.host||C,authToken:e.authToken,commandType:"library"})}static forCms(e){return new t({host:e.host||C,authToken:e.authToken,siteId:e.siteId,commandType:"cms"})}static forAssets(e){return new t({host:e.host||C,authToken:e.authToken,siteId:e.siteId,commandType:"assets"})}static forSites(e){return new t({host:e.host||C,authToken:e.authToken,commandType:"sites"})}static forForms(e){return new t({host:e.host||C,authToken:e.authToken,commandType:"forms"})}}});var Xu=b(()=>{"use strict"});function Qu(t){return async(e,r,n)=>{let o=Date.now(),i=process.memoryUsage().heapUsed;try{let s=await r(),a=Date.now()-o,l=process.memoryUsage().heapUsed;return await t.sendPerformance(e,a,{memoryDelta:l-i,...n}),s}catch(s){let a=Date.now()-o;throw await t.sendPerformance(e,a,{failed:1,...n}),s}}}var ee=b(()=>{"use strict";oa();ta();Xu();Bn();Bn()});var sa,ia,dy,Et,aa=b(()=>{"use strict";sa=Symbol("webflow-cli-warn"),ia=class{warnings=[];originalConsoleWarn=null;isActive=!1;parseSource(e){let r=e.split(`
|
|
11
|
-
`);for(let n=2;n<r.length;n++){let o=r[n],i=o.match(/at .+? \((.+?):\d+:\d+\)/)||o.match(/at (.+?):\d+:\d+/);if(i){let s=i[1];if(s.includes("node_modules")){let a=s.match(/node_modules\/(@?[^/]+(?:\/[^/]+)?)/);return a?`External: ${a[1]}`:"External Dependencies"}else if(s.includes("webflow-cli"))return s.includes("/metadata/")?"Metadata Collection":s.includes("/bundler/")?"Bundling":s.includes("/commands/")?"CLI Commands":"Webflow CLI"}}return"General"}start(){this.isActive||(this.warnings=[],this.originalConsoleWarn=console.warn,this.isActive=!0,console.warn=(...
|
|
4
|
+
`)+r,o=n+1,n=e.indexOf(`
|
|
5
|
+
`,o)}while(n!==-1);return i+=e.slice(o),i}var zu=v(()=>{"use strict"});function Sn(e){return _h(e)}var qu,Ku,ys,Lr,kn,Zu,Wr,Ch,_h,ws,kh,Sh,Ds,So,Th,Ah,jv,nt,bs=v(()=>{"use strict";Lu();Hu();zu();({stdout:qu,stderr:Ku}=Vu),ys=Symbol("GENERATOR"),Lr=Symbol("STYLER"),kn=Symbol("IS_EMPTY"),Zu=["ansi","ansi","ansi256","ansi16m"],Wr=Object.create(null),Ch=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let r=qu?qu.level:0;e.level=t.level===void 0?r:t.level},_h=e=>{let t=(...r)=>r.join(" ");return Ch(t,e),Object.setPrototypeOf(t,Sn.prototype),t};Object.setPrototypeOf(Sn.prototype,Function.prototype);for(let[e,t]of Object.entries(rt))Wr[e]={get(){let r=So(this,Ds(t.open,t.close,this[Lr]),this[kn]);return Object.defineProperty(this,e,{value:r}),r}};Wr.visible={get(){let e=So(this,this[Lr],!0);return Object.defineProperty(this,"visible",{value:e}),e}};ws=(e,t,r,...n)=>e==="rgb"?t==="ansi16m"?rt[r].ansi16m(...n):t==="ansi256"?rt[r].ansi256(rt.rgbToAnsi256(...n)):rt[r].ansi(rt.rgbToAnsi(...n)):e==="hex"?ws("rgb",t,r,...rt.hexToRgb(...n)):rt[r][e](...n),kh=["rgb","hex","ansi256"];for(let e of kh){Wr[e]={get(){let{level:r}=this;return function(...n){let o=Ds(ws(e,Zu[r],"color",...n),rt.color.close,this[Lr]);return So(this,o,this[kn])}}};let t="bg"+e[0].toUpperCase()+e.slice(1);Wr[t]={get(){let{level:r}=this;return function(...n){let o=Ds(ws(e,Zu[r],"bgColor",...n),rt.bgColor.close,this[Lr]);return So(this,o,this[kn])}}}}Sh=Object.defineProperties(()=>{},{...Wr,level:{enumerable:!0,get(){return this[ys].level},set(e){this[ys].level=e}}}),Ds=(e,t,r)=>{let n,o;return r===void 0?(n=e,o=t):(n=r.openAll+e,o=t+r.closeAll),{open:e,close:t,openAll:n,closeAll:o,parent:r}},So=(e,t,r)=>{let n=(...o)=>Th(n,o.length===1?""+o[0]:o.join(" "));return Object.setPrototypeOf(n,Sh),n[ys]=e,n[Lr]=t,n[kn]=r,n},Th=(e,t)=>{if(e.level<=0||!t)return e[kn]?"":t;let r=e[Lr];if(r===void 0)return t;let{openAll:n,closeAll:o}=r;if(t.includes("\x1B"))for(;r!==void 0;)t=Ju(t,r.close,r.open),r=r.parent;let i=t.indexOf(`
|
|
6
|
+
`);return i!==-1&&(t=Gu(t,o,n,i)),n+t+o};Object.defineProperties(Sn.prototype,Wr);Ah=Sn(),jv=Sn({level:Ku?Ku.level:0}),nt=Ah});function vs(e,t,{ignoreNonConfigurable:r=!1}={}){let{name:n}=e;for(let o of Reflect.ownKeys(t))Oh(e,t,o,r);return $h(e,t),Nh(e,t,n),e}var Oh,Ih,$h,Rh,Ph,jh,Nh,Yu=v(()=>{"use strict";Oh=(e,t,r,n)=>{if(r==="length"||r==="prototype"||r==="arguments"||r==="caller")return;let o=Object.getOwnPropertyDescriptor(e,r),i=Object.getOwnPropertyDescriptor(t,r);!Ih(o,i)&&n||Object.defineProperty(e,r,i)},Ih=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},$h=(e,t)=>{let r=Object.getPrototypeOf(t);r!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,r)},Rh=(e,t)=>`/* Wrapped ${e}*/
|
|
7
|
+
${t}`,Ph=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),jh=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Nh=(e,t,r)=>{let n=r===""?"":`with ${r.trim()}() `,o=Rh.bind(null,n,t.toString());Object.defineProperty(o,"name",jh);let{writable:i,enumerable:s,configurable:a}=Ph;Object.defineProperty(e,"toString",{value:o,writable:i,enumerable:s,configurable:a})}});var To,Xu,Qu,ec=v(()=>{"use strict";Yu();To=new WeakMap,Xu=(e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let r,n=0,o=e.displayName||e.name||"<anonymous>",i=function(...s){if(To.set(i,++n),n===1)r=e.apply(this,s),e=void 0;else if(t.throw===!0)throw new Error(`Function \`${o}\` can only be called once`);return r};return vs(i,e),To.set(i,n),i};Xu.callCount=e=>{if(!To.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return To.get(e)};Qu=Xu});var ir,tc=v(()=>{"use strict";ir=[];ir.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&ir.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&ir.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});var Ao,Es,Fs,Bh,xs,Oo,Mh,Cs,_s,ks,rc,Vv,Hv,nc=v(()=>{"use strict";tc();Ao=e=>!!e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function",Es=Symbol.for("signal-exit emitter"),Fs=globalThis,Bh=Object.defineProperty.bind(Object),xs=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(Fs[Es])return Fs[Es];Bh(Fs,Es,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(t,r){this.listeners[t].push(r)}removeListener(t,r){let n=this.listeners[t],o=n.indexOf(r);o!==-1&&(o===0&&n.length===1?n.length=0:n.splice(o,1))}emit(t,r,n){if(this.emitted[t])return!1;this.emitted[t]=!0;let o=!1;for(let i of this.listeners[t])o=i(r,n)===!0||o;return t==="exit"&&(o=this.emit("afterExit",r,n)||o),o}},Oo=class{},Mh=e=>({onExit(t,r){return e.onExit(t,r)},load(){return e.load()},unload(){return e.unload()}}),Cs=class extends Oo{onExit(){return()=>{}}load(){}unload(){}},_s=class extends Oo{#s=ks.platform==="win32"?"SIGINT":"SIGHUP";#r=new xs;#e;#o;#d;#t={};#i=!1;constructor(t){super(),this.#e=t,this.#t={};for(let r of ir)this.#t[r]=()=>{let n=this.#e.listeners(r),{count:o}=this.#r,i=t;if(typeof i.__signal_exit_emitter__=="object"&&typeof i.__signal_exit_emitter__.count=="number"&&(o+=i.__signal_exit_emitter__.count),n.length===o){this.unload();let s=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#s:r;s||t.kill(t.pid,a)}};this.#d=t.reallyExit,this.#o=t.emit}onExit(t,r){if(!Ao(this.#e))return()=>{};this.#i===!1&&this.load();let n=r?.alwaysLast?"afterExit":"exit";return this.#r.on(n,t),()=>{this.#r.removeListener(n,t),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#i){this.#i=!0,this.#r.count+=1;for(let t of ir)try{let r=this.#t[t];r&&this.#e.on(t,r)}catch{}this.#e.emit=(t,...r)=>this.#p(t,...r),this.#e.reallyExit=t=>this.#n(t)}}unload(){this.#i&&(this.#i=!1,ir.forEach(t=>{let r=this.#t[t];if(!r)throw new Error("Listener not defined for signal: "+t);try{this.#e.removeListener(t,r)}catch{}}),this.#e.emit=this.#o,this.#e.reallyExit=this.#d,this.#r.count-=1)}#n(t){return Ao(this.#e)?(this.#e.exitCode=t||0,this.#r.emit("exit",this.#e.exitCode,null),this.#d.call(this.#e,this.#e.exitCode)):0}#p(t,...r){let n=this.#o;if(t==="exit"&&Ao(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let o=n.call(this.#e,t,...r);return this.#r.emit("exit",this.#e.exitCode,null),o}else return n.call(this.#e,t,...r)}},ks=globalThis.process,{onExit:rc,load:Vv,unload:Hv}=Mh(Ao(ks)?new _s(ks):new Cs)});var Tn,oc,Lh,ic,sc=v(()=>{"use strict";Tn=g(require("process"),1);ec();nc();oc=Tn.default.stderr.isTTY?Tn.default.stderr:Tn.default.stdout.isTTY?Tn.default.stdout:void 0,Lh=oc?Qu(()=>{rc(()=>{oc.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},ic=Lh});var Ss,Io,Ur,Ts,ac=v(()=>{"use strict";Ss=g(require("process"),1);sc();Io=!1,Ur={};Ur.show=(e=Ss.default.stderr)=>{e.isTTY&&(Io=!1,e.write("\x1B[?25h"))};Ur.hide=(e=Ss.default.stderr)=>{e.isTTY&&(ic(),Io=!0,e.write("\x1B[?25l"))};Ur.toggle=(e,t)=>{e!==void 0&&(Io=e),Io?Ur.show(t):Ur.hide(t)};Ts=Ur});var lc=ms((Yv,Wh)=>{Wh.exports={dots:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"]},dots2:{interval:80,frames:["\u28FE","\u28FD","\u28FB","\u28BF","\u287F","\u28DF","\u28EF","\u28F7"]},dots3:{interval:80,frames:["\u280B","\u2819","\u281A","\u281E","\u2816","\u2826","\u2834","\u2832","\u2833","\u2813"]},dots4:{interval:80,frames:["\u2804","\u2806","\u2807","\u280B","\u2819","\u2838","\u2830","\u2820","\u2830","\u2838","\u2819","\u280B","\u2807","\u2806"]},dots5:{interval:80,frames:["\u280B","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B"]},dots6:{interval:80,frames:["\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2834","\u2832","\u2812","\u2802","\u2802","\u2812","\u281A","\u2819","\u2809","\u2801"]},dots7:{interval:80,frames:["\u2808","\u2809","\u280B","\u2813","\u2812","\u2810","\u2810","\u2812","\u2816","\u2826","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808"]},dots8:{interval:80,frames:["\u2801","\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808","\u2808"]},dots9:{interval:80,frames:["\u28B9","\u28BA","\u28BC","\u28F8","\u28C7","\u2867","\u2857","\u284F"]},dots10:{interval:80,frames:["\u2884","\u2882","\u2881","\u2841","\u2848","\u2850","\u2860"]},dots11:{interval:100,frames:["\u2801","\u2802","\u2804","\u2840","\u2880","\u2820","\u2810","\u2808"]},dots12:{interval:80,frames:["\u2880\u2800","\u2840\u2800","\u2804\u2800","\u2882\u2800","\u2842\u2800","\u2805\u2800","\u2883\u2800","\u2843\u2800","\u280D\u2800","\u288B\u2800","\u284B\u2800","\u280D\u2801","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2888\u2829","\u2840\u2899","\u2804\u2859","\u2882\u2829","\u2842\u2898","\u2805\u2858","\u2883\u2828","\u2843\u2890","\u280D\u2850","\u288B\u2820","\u284B\u2880","\u280D\u2841","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2808\u2829","\u2800\u2899","\u2800\u2859","\u2800\u2829","\u2800\u2898","\u2800\u2858","\u2800\u2828","\u2800\u2890","\u2800\u2850","\u2800\u2820","\u2800\u2880","\u2800\u2840"]},dots13:{interval:80,frames:["\u28FC","\u28F9","\u28BB","\u283F","\u285F","\u28CF","\u28E7","\u28F6"]},dots8Bit:{interval:80,frames:["\u2800","\u2801","\u2802","\u2803","\u2804","\u2805","\u2806","\u2807","\u2840","\u2841","\u2842","\u2843","\u2844","\u2845","\u2846","\u2847","\u2808","\u2809","\u280A","\u280B","\u280C","\u280D","\u280E","\u280F","\u2848","\u2849","\u284A","\u284B","\u284C","\u284D","\u284E","\u284F","\u2810","\u2811","\u2812","\u2813","\u2814","\u2815","\u2816","\u2817","\u2850","\u2851","\u2852","\u2853","\u2854","\u2855","\u2856","\u2857","\u2818","\u2819","\u281A","\u281B","\u281C","\u281D","\u281E","\u281F","\u2858","\u2859","\u285A","\u285B","\u285C","\u285D","\u285E","\u285F","\u2820","\u2821","\u2822","\u2823","\u2824","\u2825","\u2826","\u2827","\u2860","\u2861","\u2862","\u2863","\u2864","\u2865","\u2866","\u2867","\u2828","\u2829","\u282A","\u282B","\u282C","\u282D","\u282E","\u282F","\u2868","\u2869","\u286A","\u286B","\u286C","\u286D","\u286E","\u286F","\u2830","\u2831","\u2832","\u2833","\u2834","\u2835","\u2836","\u2837","\u2870","\u2871","\u2872","\u2873","\u2874","\u2875","\u2876","\u2877","\u2838","\u2839","\u283A","\u283B","\u283C","\u283D","\u283E","\u283F","\u2878","\u2879","\u287A","\u287B","\u287C","\u287D","\u287E","\u287F","\u2880","\u2881","\u2882","\u2883","\u2884","\u2885","\u2886","\u2887","\u28C0","\u28C1","\u28C2","\u28C3","\u28C4","\u28C5","\u28C6","\u28C7","\u2888","\u2889","\u288A","\u288B","\u288C","\u288D","\u288E","\u288F","\u28C8","\u28C9","\u28CA","\u28CB","\u28CC","\u28CD","\u28CE","\u28CF","\u2890","\u2891","\u2892","\u2893","\u2894","\u2895","\u2896","\u2897","\u28D0","\u28D1","\u28D2","\u28D3","\u28D4","\u28D5","\u28D6","\u28D7","\u2898","\u2899","\u289A","\u289B","\u289C","\u289D","\u289E","\u289F","\u28D8","\u28D9","\u28DA","\u28DB","\u28DC","\u28DD","\u28DE","\u28DF","\u28A0","\u28A1","\u28A2","\u28A3","\u28A4","\u28A5","\u28A6","\u28A7","\u28E0","\u28E1","\u28E2","\u28E3","\u28E4","\u28E5","\u28E6","\u28E7","\u28A8","\u28A9","\u28AA","\u28AB","\u28AC","\u28AD","\u28AE","\u28AF","\u28E8","\u28E9","\u28EA","\u28EB","\u28EC","\u28ED","\u28EE","\u28EF","\u28B0","\u28B1","\u28B2","\u28B3","\u28B4","\u28B5","\u28B6","\u28B7","\u28F0","\u28F1","\u28F2","\u28F3","\u28F4","\u28F5","\u28F6","\u28F7","\u28B8","\u28B9","\u28BA","\u28BB","\u28BC","\u28BD","\u28BE","\u28BF","\u28F8","\u28F9","\u28FA","\u28FB","\u28FC","\u28FD","\u28FE","\u28FF"]},sand:{interval:80,frames:["\u2801","\u2802","\u2804","\u2840","\u2848","\u2850","\u2860","\u28C0","\u28C1","\u28C2","\u28C4","\u28CC","\u28D4","\u28E4","\u28E5","\u28E6","\u28EE","\u28F6","\u28F7","\u28FF","\u287F","\u283F","\u289F","\u281F","\u285B","\u281B","\u282B","\u288B","\u280B","\u280D","\u2849","\u2809","\u2811","\u2821","\u2881"]},line:{interval:130,frames:["-","\\","|","/"]},line2:{interval:100,frames:["\u2802","-","\u2013","\u2014","\u2013","-"]},pipe:{interval:100,frames:["\u2524","\u2518","\u2534","\u2514","\u251C","\u250C","\u252C","\u2510"]},simpleDots:{interval:400,frames:[". ",".. ","..."," "]},simpleDotsScrolling:{interval:200,frames:[". ",".. ","..."," .."," ."," "]},star:{interval:70,frames:["\u2736","\u2738","\u2739","\u273A","\u2739","\u2737"]},star2:{interval:80,frames:["+","x","*"]},flip:{interval:70,frames:["_","_","_","-","`","`","'","\xB4","-","_","_","_"]},hamburger:{interval:100,frames:["\u2631","\u2632","\u2634"]},growVertical:{interval:120,frames:["\u2581","\u2583","\u2584","\u2585","\u2586","\u2587","\u2586","\u2585","\u2584","\u2583"]},growHorizontal:{interval:120,frames:["\u258F","\u258E","\u258D","\u258C","\u258B","\u258A","\u2589","\u258A","\u258B","\u258C","\u258D","\u258E"]},balloon:{interval:140,frames:[" ",".","o","O","@","*"," "]},balloon2:{interval:120,frames:[".","o","O","\xB0","O","o","."]},noise:{interval:100,frames:["\u2593","\u2592","\u2591"]},bounce:{interval:120,frames:["\u2801","\u2802","\u2804","\u2802"]},boxBounce:{interval:120,frames:["\u2596","\u2598","\u259D","\u2597"]},boxBounce2:{interval:100,frames:["\u258C","\u2580","\u2590","\u2584"]},triangle:{interval:50,frames:["\u25E2","\u25E3","\u25E4","\u25E5"]},binary:{interval:80,frames:["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},arc:{interval:100,frames:["\u25DC","\u25E0","\u25DD","\u25DE","\u25E1","\u25DF"]},circle:{interval:120,frames:["\u25E1","\u2299","\u25E0"]},squareCorners:{interval:180,frames:["\u25F0","\u25F3","\u25F2","\u25F1"]},circleQuarters:{interval:120,frames:["\u25F4","\u25F7","\u25F6","\u25F5"]},circleHalves:{interval:50,frames:["\u25D0","\u25D3","\u25D1","\u25D2"]},squish:{interval:100,frames:["\u256B","\u256A"]},toggle:{interval:250,frames:["\u22B6","\u22B7"]},toggle2:{interval:80,frames:["\u25AB","\u25AA"]},toggle3:{interval:120,frames:["\u25A1","\u25A0"]},toggle4:{interval:100,frames:["\u25A0","\u25A1","\u25AA","\u25AB"]},toggle5:{interval:100,frames:["\u25AE","\u25AF"]},toggle6:{interval:300,frames:["\u101D","\u1040"]},toggle7:{interval:80,frames:["\u29BE","\u29BF"]},toggle8:{interval:100,frames:["\u25CD","\u25CC"]},toggle9:{interval:100,frames:["\u25C9","\u25CE"]},toggle10:{interval:100,frames:["\u3282","\u3280","\u3281"]},toggle11:{interval:50,frames:["\u29C7","\u29C6"]},toggle12:{interval:120,frames:["\u2617","\u2616"]},toggle13:{interval:80,frames:["=","*","-"]},arrow:{interval:100,frames:["\u2190","\u2196","\u2191","\u2197","\u2192","\u2198","\u2193","\u2199"]},arrow2:{interval:80,frames:["\u2B06\uFE0F ","\u2197\uFE0F ","\u27A1\uFE0F ","\u2198\uFE0F ","\u2B07\uFE0F ","\u2199\uFE0F ","\u2B05\uFE0F ","\u2196\uFE0F "]},arrow3:{interval:120,frames:["\u25B9\u25B9\u25B9\u25B9\u25B9","\u25B8\u25B9\u25B9\u25B9\u25B9","\u25B9\u25B8\u25B9\u25B9\u25B9","\u25B9\u25B9\u25B8\u25B9\u25B9","\u25B9\u25B9\u25B9\u25B8\u25B9","\u25B9\u25B9\u25B9\u25B9\u25B8"]},bouncingBar:{interval:80,frames:["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},bouncingBall:{interval:80,frames:["( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF)","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","(\u25CF )"]},smiley:{interval:200,frames:["\u{1F604} ","\u{1F61D} "]},monkey:{interval:300,frames:["\u{1F648} ","\u{1F648} ","\u{1F649} ","\u{1F64A} "]},hearts:{interval:100,frames:["\u{1F49B} ","\u{1F499} ","\u{1F49C} ","\u{1F49A} ","\u2764\uFE0F "]},clock:{interval:100,frames:["\u{1F55B} ","\u{1F550} ","\u{1F551} ","\u{1F552} ","\u{1F553} ","\u{1F554} ","\u{1F555} ","\u{1F556} ","\u{1F557} ","\u{1F558} ","\u{1F559} ","\u{1F55A} "]},earth:{interval:180,frames:["\u{1F30D} ","\u{1F30E} ","\u{1F30F} "]},material:{interval:17,frames:["\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581"]},moon:{interval:80,frames:["\u{1F311} ","\u{1F312} ","\u{1F313} ","\u{1F314} ","\u{1F315} ","\u{1F316} ","\u{1F317} ","\u{1F318} "]},runner:{interval:140,frames:["\u{1F6B6} ","\u{1F3C3} "]},pong:{interval:80,frames:["\u2590\u2802 \u258C","\u2590\u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802\u258C","\u2590 \u2820\u258C","\u2590 \u2840\u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590\u2820 \u258C"]},shark:{interval:120,frames:["\u2590|\\____________\u258C","\u2590_|\\___________\u258C","\u2590__|\\__________\u258C","\u2590___|\\_________\u258C","\u2590____|\\________\u258C","\u2590_____|\\_______\u258C","\u2590______|\\______\u258C","\u2590_______|\\_____\u258C","\u2590________|\\____\u258C","\u2590_________|\\___\u258C","\u2590__________|\\__\u258C","\u2590___________|\\_\u258C","\u2590____________|\\\u258C","\u2590____________/|\u258C","\u2590___________/|_\u258C","\u2590__________/|__\u258C","\u2590_________/|___\u258C","\u2590________/|____\u258C","\u2590_______/|_____\u258C","\u2590______/|______\u258C","\u2590_____/|_______\u258C","\u2590____/|________\u258C","\u2590___/|_________\u258C","\u2590__/|__________\u258C","\u2590_/|___________\u258C","\u2590/|____________\u258C"]},dqpb:{interval:100,frames:["d","q","p","b"]},weather:{interval:100,frames:["\u2600\uFE0F ","\u2600\uFE0F ","\u2600\uFE0F ","\u{1F324} ","\u26C5\uFE0F ","\u{1F325} ","\u2601\uFE0F ","\u{1F327} ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u26C8 ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u2601\uFE0F ","\u{1F325} ","\u26C5\uFE0F ","\u{1F324} ","\u2600\uFE0F ","\u2600\uFE0F "]},christmas:{interval:400,frames:["\u{1F332}","\u{1F384}"]},grenade:{interval:80,frames:["\u060C ","\u2032 "," \xB4 "," \u203E "," \u2E0C"," \u2E0A"," |"," \u204E"," \u2055"," \u0DF4 "," \u2053"," "," "," "]},point:{interval:125,frames:["\u2219\u2219\u2219","\u25CF\u2219\u2219","\u2219\u25CF\u2219","\u2219\u2219\u25CF","\u2219\u2219\u2219"]},layer:{interval:150,frames:["-","=","\u2261"]},betaWave:{interval:80,frames:["\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1"]},fingerDance:{interval:160,frames:["\u{1F918} ","\u{1F91F} ","\u{1F596} ","\u270B ","\u{1F91A} ","\u{1F446} "]},fistBump:{interval:80,frames:["\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u3000\u{1F91C}\u3000\u3000\u{1F91B}\u3000 ","\u3000\u3000\u{1F91C}\u{1F91B}\u3000\u3000 ","\u3000\u{1F91C}\u2728\u{1F91B}\u3000\u3000 ","\u{1F91C}\u3000\u2728\u3000\u{1F91B}\u3000 "]},soccerHeader:{interval:80,frames:[" \u{1F9D1}\u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F\u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} "]},mindblown:{interval:160,frames:["\u{1F610} ","\u{1F610} ","\u{1F62E} ","\u{1F62E} ","\u{1F626} ","\u{1F626} ","\u{1F627} ","\u{1F627} ","\u{1F92F} ","\u{1F4A5} ","\u2728 ","\u3000 ","\u3000 ","\u3000 "]},speaker:{interval:160,frames:["\u{1F508} ","\u{1F509} ","\u{1F50A} ","\u{1F509} "]},orangePulse:{interval:100,frames:["\u{1F538} ","\u{1F536} ","\u{1F7E0} ","\u{1F7E0} ","\u{1F536} "]},bluePulse:{interval:100,frames:["\u{1F539} ","\u{1F537} ","\u{1F535} ","\u{1F535} ","\u{1F537} "]},orangeBluePulse:{interval:100,frames:["\u{1F538} ","\u{1F536} ","\u{1F7E0} ","\u{1F7E0} ","\u{1F536} ","\u{1F539} ","\u{1F537} ","\u{1F535} ","\u{1F535} ","\u{1F537} "]},timeTravel:{interval:100,frames:["\u{1F55B} ","\u{1F55A} ","\u{1F559} ","\u{1F558} ","\u{1F557} ","\u{1F556} ","\u{1F555} ","\u{1F554} ","\u{1F553} ","\u{1F552} ","\u{1F551} ","\u{1F550} "]},aesthetic:{interval:80,frames:["\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0","\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1"]},dwarfFortress:{interval:80,frames:[" \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A \u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A \xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A \xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\u2593\xA3 "," \u263A\u2593\xA3 "," \u263A\u2592\xA3 "," \u263A\u2592\xA3 "," \u263A\u2591\xA3 "," \u263A\u2591\xA3 "," \u263A \xA3 "," \u263A\xA3 "," \u263A\xA3 "," \u263A\u2593 "," \u263A\u2593 "," \u263A\u2592 "," \u263A\u2592 "," \u263A\u2591 "," \u263A\u2591 "," \u263A "," \u263A &"," \u263A \u263C&"," \u263A \u263C &"," \u263A\u263C &"," \u263A\u263C & "," \u203C & "," \u263A & "," \u203C & "," \u263A & "," \u203C & "," \u263A & ","\u203C & "," & "," & "," & \u2591 "," & \u2592 "," & \u2593 "," & \xA3 "," & \u2591\xA3 "," & \u2592\xA3 "," & \u2593\xA3 "," & \xA3\xA3 "," & \u2591\xA3\xA3 "," & \u2592\xA3\xA3 ","& \u2593\xA3\xA3 ","& \xA3\xA3\xA3 "," \u2591\xA3\xA3\xA3 "," \u2592\xA3\xA3\xA3 "," \u2593\xA3\xA3\xA3 "," \u2588\xA3\xA3\xA3 "," \u2591\u2588\xA3\xA3\xA3 "," \u2592\u2588\xA3\xA3\xA3 "," \u2593\u2588\xA3\xA3\xA3 "," \u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "]}}});var As=ms((Xv,cc)=>{"use strict";var $o=Object.assign({},lc()),uc=Object.keys($o);Object.defineProperty($o,"random",{get(){let e=Math.floor(Math.random()*uc.length),t=uc[e];return $o[t]}});cc.exports=$o});function Os(){return Ve.default.platform!=="win32"?Ve.default.env.TERM!=="linux":!!Ve.default.env.CI||!!Ve.default.env.WT_SESSION||!!Ve.default.env.TERMINUS_SUBLIME||Ve.default.env.ConEmuTask==="{cmd::Cmder}"||Ve.default.env.TERM_PROGRAM==="Terminus-Sublime"||Ve.default.env.TERM_PROGRAM==="vscode"||Ve.default.env.TERM==="xterm-256color"||Ve.default.env.TERM==="alacritty"||Ve.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Ve,fc=v(()=>{"use strict";Ve=g(require("process"),1)});var Uh,Vh,Hh,An,dc=v(()=>{"use strict";bs();fc();Uh={info:nt.blue("\u2139"),success:nt.green("\u2714"),warning:nt.yellow("\u26A0"),error:nt.red("\u2716")},Vh={info:nt.blue("i"),success:nt.green("\u221A"),warning:nt.yellow("\u203C"),error:nt.red("\xD7")},Hh=Os()?Uh:Vh,An=Hh});function Is({onlyFirst:e=!1}={}){let o="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(o,e?void 0:"g")}var pc=v(()=>{"use strict"});function $s(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return!e.includes("\x1B")&&!e.includes("\x9B")?e:e.replace(Jh,"")}var Jh,mc=v(()=>{"use strict";pc();Jh=Is()});function Rs({onlyFirst:e=!1}={}){let o="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(o,e?void 0:"g")}var gc=v(()=>{"use strict"});function Ps(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return!e.includes("\x1B")&&!e.includes("\x9B")?e:e.replace(Gh,"")}var Gh,hc=v(()=>{"use strict";gc();Gh=Rs()});var Ro,Po,js,Ns,On,yc=v(()=>{"use strict";Ro=[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],Po=[12288,12288,65281,65376,65504,65510],js=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],Ns=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],On=[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 jo,wc=v(()=>{"use strict";jo=(e,t)=>{let r=0,n=Math.floor(e.length/2)-1;for(;r<=n;){let o=Math.floor((r+n)/2),i=o*2;if(t<e[i])n=o-1;else if(t>e[i+1])r=o+1;else return!0}return!1}});function ty(e){let t=e[0],r=e[1];for(let n=0;n<e.length;n+=2){let o=e[n],i=e[n+1];if(Dc>=o&&Dc<=i)return[o,i];i-o>r-t&&(t=o,r=i)}return[t,r]}var zh,qh,Kh,Zh,pE,mE,gE,hE,Yh,Xh,Dc,Qh,ey,bc,vc,Ec,Fc=v(()=>{"use strict";yc();wc();zh=Ro[0],qh=Ro.at(-1),Kh=Po[0],Zh=Po.at(-1),pE=js[0],mE=js.at(-1),gE=Ns[0],hE=Ns.at(-1),Yh=On[0],Xh=On.at(-1),Dc=19968,[Qh,ey]=ty(On);bc=e=>e<zh||e>qh?!1:jo(Ro,e),vc=e=>e<Kh||e>Zh?!1:jo(Po,e),Ec=e=>e>=Qh&&e<=ey?!0:e<Yh||e>Xh?!1:jo(On,e)});function ry(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}function xc(e,{ambiguousAsWide:t=!1}={}){return ry(e),vc(e)||Ec(e)||t&&bc(e)?2:1}var Cc=v(()=>{"use strict";Fc()});var _c,kc=v(()=>{"use strict";_c=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g});function Bs(e,t={}){if(typeof e!="string"||e.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:n=!1}=t;if(n||(e=Ps(e)),e.length===0)return 0;let o=0,i={ambiguousAsWide:!r};for(let{segment:s}of ny.segment(e)){let a=s.codePointAt(0);if(!(a<=31||a>=127&&a<=159)&&!(a>=8203&&a<=8207||a===65279)&&!(a>=768&&a<=879||a>=6832&&a<=6911||a>=7616&&a<=7679||a>=8400&&a<=8447||a>=65056&&a<=65071)&&!(a>=55296&&a<=57343)&&!(a>=65024&&a<=65039)&&!oy.test(s)){if(_c().test(s)){o+=2;continue}o+=xc(a,i)}}return o}var ny,oy,Sc=v(()=>{"use strict";hc();Cc();kc();ny=new Intl.Segmenter,oy=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u")});function Ms({stream:e=process.stdout}={}){return!!(e&&e.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}var Tc=v(()=>{"use strict"});function Ws(){let{env:e}=Ls.default,{TERM:t,TERM_PROGRAM:r}=e;return Ls.default.platform!=="win32"?t!=="linux":!!e.WT_SESSION||!!e.TERMINUS_SUBLIME||e.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||t==="xterm-256color"||t==="alacritty"||t==="rxvt-unicode"||t==="rxvt-unicode-256color"||e.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Ls,Ac=v(()=>{"use strict";Ls=g(require("process"),1)});var ot,iy,Us,sy,Vs,Oc=v(()=>{"use strict";ot=g(require("process"),1),iy=3,Us=class{#s=0;start(){this.#s++,this.#s===1&&this.#r()}stop(){if(this.#s<=0)throw new Error("`stop` called more times than `start`");this.#s--,this.#s===0&&this.#e()}#r(){ot.default.platform==="win32"||!ot.default.stdin.isTTY||(ot.default.stdin.setRawMode(!0),ot.default.stdin.on("data",this.#o),ot.default.stdin.resume())}#e(){ot.default.stdin.isTTY&&(ot.default.stdin.off("data",this.#o),ot.default.stdin.pause(),ot.default.stdin.setRawMode(!1))}#o(t){t[0]===iy&&ot.default.emit("SIGINT")}},sy=new Us,Vs=sy});function Js(e){return new Hs(e)}var In,$n,ay,Hs,Ic=v(()=>{"use strict";In=g(require("process"),1);bs();ac();$n=g(As(),1);dc();mc();Sc();Tc();Ac();Oc();ay=g(As(),1),Hs=class{#s=0;#r=!1;#e=0;#o=-1;#d=0;#t;#i;#n;#p;#g;#u;#c;#f;#h;#a;#l;color;constructor(t){typeof t=="string"&&(t={text:t}),this.#t={color:"cyan",stream:In.default.stderr,discardStdin:!0,hideCursor:!0,...t},this.color=this.#t.color,this.spinner=this.#t.spinner,this.#g=this.#t.interval,this.#n=this.#t.stream,this.#u=typeof this.#t.isEnabled=="boolean"?this.#t.isEnabled:Ms({stream:this.#n}),this.#c=typeof this.#t.isSilent=="boolean"?this.#t.isSilent:!1,this.text=this.#t.text,this.prefixText=this.#t.prefixText,this.suffixText=this.#t.suffixText,this.indent=this.#t.indent,In.default.env.NODE_ENV==="test"&&(this._stream=this.#n,this._isEnabled=this.#u,Object.defineProperty(this,"_linesToClear",{get(){return this.#s},set(r){this.#s=r}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#o}}),Object.defineProperty(this,"_lineCount",{get(){return this.#e}}))}get indent(){return this.#f}set indent(t=0){if(!(t>=0&&Number.isInteger(t)))throw new Error("The `indent` option must be an integer from 0 and up");this.#f=t,this.#m()}get interval(){return this.#g??this.#i.interval??100}get spinner(){return this.#i}set spinner(t){if(this.#o=-1,this.#g=void 0,typeof t=="object"){if(t.frames===void 0)throw new Error("The given spinner must have a `frames` property");this.#i=t}else if(!Ws())this.#i=$n.default.line;else if(t===void 0)this.#i=$n.default.dots;else if(t!=="default"&&$n.default[t])this.#i=$n.default[t];else throw new Error(`There is no built-in spinner named '${t}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#h}set text(t=""){this.#h=t,this.#m()}get prefixText(){return this.#a}set prefixText(t=""){this.#a=t,this.#m()}get suffixText(){return this.#l}set suffixText(t=""){this.#l=t,this.#m()}get isSpinning(){return this.#p!==void 0}#y(t=this.#a,r=" "){return typeof t=="string"&&t!==""?t+r:typeof t=="function"?t()+r:""}#w(t=this.#l,r=" "){return typeof t=="string"&&t!==""?r+t:typeof t=="function"?r+t():""}#m(){let t=this.#n.columns??80,r=this.#y(this.#a,"-"),n=this.#w(this.#l,"-"),o=" ".repeat(this.#f)+r+"--"+this.#h+"--"+n;this.#e=0;for(let i of $s(o).split(`
|
|
8
|
+
`))this.#e+=Math.max(1,Math.ceil(Bs(i,{countAnsiEscapeCodes:!0})/t))}get isEnabled(){return this.#u&&!this.#c}set isEnabled(t){if(typeof t!="boolean")throw new TypeError("The `isEnabled` option must be a boolean");this.#u=t}get isSilent(){return this.#c}set isSilent(t){if(typeof t!="boolean")throw new TypeError("The `isSilent` option must be a boolean");this.#c=t}frame(){let t=Date.now();(this.#o===-1||t-this.#d>=this.interval)&&(this.#o=++this.#o%this.#i.frames.length,this.#d=t);let{frames:r}=this.#i,n=r[this.#o];this.color&&(n=nt[this.color](n));let o=typeof this.#a=="string"&&this.#a!==""?this.#a+" ":"",i=typeof this.text=="string"?" "+this.text:"",s=typeof this.#l=="string"&&this.#l!==""?" "+this.#l:"";return o+n+i+s}clear(){if(!this.#u||!this.#n.isTTY)return this;this.#n.cursorTo(0);for(let t=0;t<this.#s;t++)t>0&&this.#n.moveCursor(0,-1),this.#n.clearLine(1);return(this.#f||this.lastIndent!==this.#f)&&this.#n.cursorTo(this.#f),this.lastIndent=this.#f,this.#s=0,this}render(){return this.#c?this:(this.clear(),this.#n.write(this.frame()),this.#s=this.#e,this)}start(t){return t&&(this.text=t),this.#c?this:this.#u?this.isSpinning?this:(this.#t.hideCursor&&Ts.hide(this.#n),this.#t.discardStdin&&In.default.stdin.isTTY&&(this.#r=!0,Vs.start()),this.render(),this.#p=setInterval(this.render.bind(this),this.interval),this):(this.text&&this.#n.write(`- ${this.text}
|
|
9
|
+
`),this)}stop(){return this.#u?(clearInterval(this.#p),this.#p=void 0,this.#o=0,this.clear(),this.#t.hideCursor&&Ts.show(this.#n),this.#t.discardStdin&&In.default.stdin.isTTY&&this.#r&&(Vs.stop(),this.#r=!1),this):this}succeed(t){return this.stopAndPersist({symbol:An.success,text:t})}fail(t){return this.stopAndPersist({symbol:An.error,text:t})}warn(t){return this.stopAndPersist({symbol:An.warning,text:t})}info(t){return this.stopAndPersist({symbol:An.info,text:t})}stopAndPersist(t={}){if(this.#c)return this;let r=t.prefixText??this.#a,n=this.#y(r," "),o=t.symbol??" ",i=t.text??this.text,a=typeof i=="string"?(o?" ":"")+i:"",l=t.suffixText??this.#l,c=this.#w(l," "),f=n+o+a+c+`
|
|
10
|
+
`;return this.stop(),this.#n.write(f),this}}});function qs(e,{suffix:t="nodejs"}={}){if(typeof e!="string")throw new TypeError(`Expected a string, got ${typeof e}`);return t&&(e+=`-${t}`),No.default.platform==="darwin"?ly(e):No.default.platform==="win32"?uy(e):cy(e)}var se,Gs,No,Rt,zs,Vr,ly,uy,cy,$c=v(()=>{"use strict";se=g(require("path"),1),Gs=g(require("os"),1),No=g(require("process"),1),Rt=Gs.default.homedir(),zs=Gs.default.tmpdir(),{env:Vr}=No.default,ly=e=>{let t=se.default.join(Rt,"Library");return{data:se.default.join(t,"Application Support",e),config:se.default.join(t,"Preferences",e),cache:se.default.join(t,"Caches",e),log:se.default.join(t,"Logs",e),temp:se.default.join(zs,e)}},uy=e=>{let t=Vr.APPDATA||se.default.join(Rt,"AppData","Roaming"),r=Vr.LOCALAPPDATA||se.default.join(Rt,"AppData","Local");return{data:se.default.join(r,e,"Data"),config:se.default.join(t,e,"Config"),cache:se.default.join(r,e,"Cache"),log:se.default.join(r,e,"Log"),temp:se.default.join(zs,e)}},cy=e=>{let t=se.default.basename(Rt);return{data:se.default.join(Vr.XDG_DATA_HOME||se.default.join(Rt,".local","share"),e),config:se.default.join(Vr.XDG_CONFIG_HOME||se.default.join(Rt,".config"),e),cache:se.default.join(Vr.XDG_CACHE_HOME||se.default.join(Rt,".cache"),e),log:se.default.join(Vr.XDG_STATE_HOME||se.default.join(Rt,".local","state"),e),temp:se.default.join(zs,t,e)}}});function Bo(){return/[<>:"/\\|?*\u0000-\u001F]/g}function Rc(){return/^(con|prn|aux|nul|com\d|lpt\d)$/i}var Pc=v(()=>{"use strict"});function Rn(e,t={}){let r=/[\u0000-\u001F\u0080-\u009F]/g,n=/([<>:"/\\|?*\u0000-\u001F]){2,}/g;if(typeof e!="string")throw new TypeError("Expected a string");let o=t.replacement===void 0?"!":t.replacement;if(Bo().test(o)&&r.test(o))throw new Error("Replacement string cannot contain reserved filename characters");o.length>0&&(e=e.replace(n,"$1")),e=e.normalize("NFD"),e=e.replace(dy,o),e=e.replace(Bo(),o),e=e.replace(r,o),e=e.replace(py,""),o.length>0&&(!(e[0]===".")&&e[0]==="."&&(e=o+e),e[e.length-1]==="."&&(e+=o)),e=Rc().test(e)?e+o:e;let i=typeof t.maxLength=="number"?t.maxLength:fy;if(e.length>i){let s=e.lastIndexOf(".");if(s===-1)e=e.slice(0,i);else{let a=e.slice(0,s),l=e.slice(s);e=a.slice(0,Math.max(1,i-l.length))+l}}return e}var fy,dy,py,Ks=v(()=>{"use strict";Pc();fy=100,dy=/^\.+(\\|\/)|^\.+$/,py=/\.+$/});var my,jc=v(()=>{"use strict";my=g(require("path"),1);Ks()});var Nc=v(()=>{"use strict";Ks();jc()});var Mo,Zs=v(()=>{"use strict";Mo="webflow.json"});var sr,Ys=v(()=>{"use strict";sr=class extends Error{constructor(t){super(`Manifest config for key "${t}" not found`),this.name="ManifestConfigKeyNotFoundError"}}});function Mc(e){Xs=e}function te(){return Xs}function ut(){return!Xs}function Lc(e){Bc=e}function Wc(){return Bc}var Xs,Bc,_e=v(()=>{"use strict";Xs=!1});function ar(){let e=Wc();if(e){if(e.endsWith(".json"))return{path:e,isUserDefined:!0};try{if((0,Uc.statSync)(e)?.isDirectory())return{path:(0,Vc.join)(e,Mo),isUserDefined:!0}}catch{if(e.endsWith(".json"))return{path:e,isUserDefined:!0}}throw new Error(`Manifest path must be either a directory or a .json file. Got: ${e}`)}return{path:`./${Mo}`,isUserDefined:!1}}var Uc,Vc,Qs=v(()=>{"use strict";Uc=require("fs"),Vc=require("path");Zs();_e()});var Hc,gy,hy,ea,Jc=v(()=>{"use strict";Hc=g(require("ajv")),gy=new Hc.default,hy={type:"object",properties:{library:{type:"object",properties:{name:{type:"string",minLength:1},id:{type:"string",minLength:1},components:{type:"array",items:{type:"string"},minItems:1},renderer:{anyOf:[{type:"object",properties:{client:{type:"string",minLength:1},server:{type:"string",minLength:1}}},{type:"string",minLength:1}]},globals:{type:"string",minLength:1}},required:[]},devlink:{type:"object",properties:{rootDir:{type:"string",minLength:1},cssModules:{type:"boolean"},allowTelemetry:{type:"boolean"},overwriteModule:{type:"boolean"},skipTagSelectors:{type:"boolean"},envVariables:{type:"object",additionalProperties:{type:"string"}},components:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},fileExtensions:{type:"object",properties:{js:{type:"string"},css:{type:"string"}}},relativeHrefRoot:{oneOf:[{type:"boolean"},{type:"string"}]}},required:["rootDir"]},"devlink-export":{type:"object",properties:{rootDir:{type:"string",minLength:1},components:{type:"string"},componentGroups:{type:"string"},ts:{type:"boolean"},cssScopes:{type:"boolean"},relativeHrefRoot:{oneOf:[{type:"boolean",const:!1},{type:"string"}]},treeShake:{type:"boolean"}},required:[]}}},ea=gy.compile(hy)});function Gc(e){return e instanceof Error?e:new Error("Unknown error")}function G(){let{path:e}=ar();if(!(0,Lo.existsSync)(e))return{manifest:{},manifestPath:e};let t;try{t=(0,Lo.readFileSync)(e,"utf8")}catch(o){throw new Error(`Failed to read manifest file: ${Gc(o).message}`)}if(t.trim()==="")return{manifest:{},manifestPath:e};let n;try{n=JSON.parse(t)}catch(o){throw new Error(`Invalid JSON in manifest file: ${Gc(o).message}`)}if(!ea(n)){let o=ea.errors?.map(i=>`${i.instancePath} ${i.message}`).join(", ")||"Unknown error";throw new Error(`Invalid manifest: ${o}.`)}return{manifest:n,manifestPath:e}}var Lo,Pn=v(()=>{"use strict";Lo=require("fs");Qs();Jc()});function jn(e,t){let r=e[t];if(!r)throw new sr(t);return r}var zc=v(()=>{"use strict";Ys()});function ae(e){let t=G(),r=t.manifest,n=t.manifestPath,o={...r};for(let i in e){let s=i,a=e[s];if(a!==void 0)if(typeof a=="string"||typeof a=="number"||typeof a=="boolean"||a===null)o[s]=a;else{let l=o[s];o[s]={...typeof l=="object"&&l!==null?l:{},...a}}}return(0,qc.writeFileSync)(n,JSON.stringify(o,null,2),"utf-8"),o}var qc,ta=v(()=>{"use strict";qc=require("fs");Pn()});var we=v(()=>{"use strict";Zs();Ys();Pn();Qs();zc();ta()});var Wo=ms((gF,yy)=>{yy.exports={name:"@webflow/webflow-cli",version:"2.0.0",license:"MIT",bin:{webflow:"./dist/index.js"},scripts:{build:"tsup",dev:"tsup",lint:"eslint .",test:"jest --ci","test:unit":"jest --ci --ignoreProjects e2e","test:local":"jest","test:e2e-cache-clear":"bash scripts/clear-e2e-cache.sh"},files:["CHANGELOG.md","dist/**/*"],publishConfig:{access:"public"},dependencies:{"@babel/preset-env":"^7.26.9","@babel/preset-react":"^7.26.3","@babel/preset-typescript":"^7.27.0","@dotenvx/dotenvx":"^1.44.1","@inquirer/prompts":"^7.9.0","@module-federation/enhanced":"0.20.0","@rspack/core":"^1.7.8","@webflow/data-types":"*",ajv:"^8.17.1",archiver:"^5.3.1","babel-loader":"^10.0.0",commander:"^10.0.0",cosmiconfig:"^8.2.0","css-loader":"^7.1.2",dotenv:"^16.0.3","env-paths":"^3.0.0","fast-glob":"^3.3.3",filenamify:"^6.0.0","fork-ts-checker-webpack-plugin":"9.1.0","form-data":"4.0.4","fs-extra":"^11.3.0",jsdom:"^26.0.0","jsonc-parser":"^3.2.0",md5:"^2.2.1",memfs:"4.17.0","mime-types":"^2.1.35","mini-css-extract-plugin":"^2.9.2","node-fetch":"^2.6.7",open:"^8.4.2",ora:"^8.2.0",postcss:"^8.5.6","postcss-loader":"^8.1.1","postcss-selector-parser":"^7.1.0",semver:"^7.7.2","serve-handler":"^6.1.5","source-map-support":"^0.5.21",tar:"^7.4.3","ts-checker-rspack-plugin":"^1.0.0","tsconfig-paths":"^4.2.0","tsconfig-paths-webpack-plugin":"^4.2.0",unionfs:"^4.5.4","webflow-api":"3.3.4",webpack:">=5.99.7 <5.106.0","webpack-merge":"^6.0.1","webpack-node-externals":"^3.0.0",zod:"^3.22.4"},devDependencies:{"@types/archiver":"^5.3.2","@types/express":"^4.17.13","@types/fs-extra":"^11.0.4","@types/jest":"^29.2.3","@types/md5":"^2.3.2","@types/mime-types":"^2.1.4","@types/nock":"^8.0.33","@types/node":"^22.13.0","@types/node-fetch":"2.6.13","@types/serve-handler":"^6.1.1","@types/source-map":"^0.5.2","@types/webpack-node-externals":"^3.0.4",astro:"^5.17.2","eslint-config-custom":"*",express:"^4.18.1",jest:"^29.3.1",nock:"13.3.1",tar:"^7.4.3","ts-jest":"^29.4.9","ts-node":"^10.9.1",tsconfig:"*",tsup:"^8.4.0",typescript:"^5.9.3"},engines:{node:">=22.13.0"}}});function vt(){try{return Wo().version}catch{return"unknown"}}function ct(e=""){if(!e)return"";let t=e;t=t.replace(/\/.*?\/webflow-cli/gi,"/REDACTED_PII/webflow-cli"),t=t.replace(/\/.*?\/node_modules/gi,"/REDACTED_PII/node_modules");let r=Nn.default.homedir();if(r){let o=new RegExp(r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gi");t=t.replace(o,"~/REDACTED_PII")}let n=Nn.default.userInfo().username;if(n){let o=new RegExp(`/Users/${n}`,"gi");t=t.replace(o,"/Users/REDACTED_PII")}return t=t.replace(/\/Users\/[^\/\s]+/gi,"/Users/REDACTED_PII"),t=t.replace(/C:\\Users\\[^\\]+/gi,"C:\\Users\\REDACTED_PII"),t=t.replace(/[a-zA-Z0-9]{32,}/g,"[REDACTED_TOKEN]"),t=t.replace(/Bearer\s+[^\s]+/gi,"Bearer [REDACTED_TOKEN]"),t=t.replace(/token[=:]\s*[^\s]+/gi,"token=[REDACTED_TOKEN]"),t=t.replace(/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b/g,"[REDACTED_EMAIL]"),t=t.replace(/\b(?:[0-9]{1,3}\.){3}[0-9]{1,3}\b/g,"[REDACTED_IP]"),t}function ra(e){if(e.stack)return ct(e.stack)}function Pt(e){let t=["password","token","secret","key","auth","bearer","authorization","apikey","api_key","access_token","refresh_token","client_secret","private_key"],r={};for(let[n,o]of Object.entries(e)){let i=n.toLowerCase();t.some(s=>i.includes(s))?r[n]="[REDACTED]":typeof o=="string"?r[n]=ct(o):typeof o=="object"&&o!==null&&!Array.isArray(o)?r[n]=Pt(o):Array.isArray(o)?r[n]=o.map(s=>typeof s=="object"&&s!==null?Pt(s):typeof s=="string"?ct(s):s):r[n]=o}return r}function Kc(){return{platform:process.platform,nodeVersion:process.version,arch:process.arch,os:`${Nn.default.type()} ${Nn.default.release()}`}}function na(){let e=Date.now().toString(36),t=Math.random().toString(36).substring(2,8);return`${e}-${t}`}var Nn,Bn=v(()=>{"use strict";Nn=g(require("os"))});var A,F,ke,Hr,oa,He,Ee,Uo,ia,H=v(()=>{"use strict";ce();A=B("\u2713"),F=bt("\u2716"),ke=ue("\u2139"),Hr=B("\u279C"),oa=bt("\u279C"),He="\u279C",Ee=ne("\u26A0"),Uo=S("\u2732"),ia=B("\u2732")});var jt,sa=v(()=>{"use strict";we();Bn();x();ce();H();jt=class e{static instance;cache=void 0;static isDoNotTrackEnabled(){let t=process.env.DO_NOT_TRACK;return t==="1"||t?.toLowerCase()==="true"}static getInstance(){return e.instance||(e.instance=new e),e.instance}async getPreference(){if(e.isDoNotTrackEnabled())return!1;if(this.cache!==void 0)return this.cache;try{let{manifest:t}=await G(),r=t?.telemetry?.global?.allowTelemetry;return this.cache=r,r}catch{return}}async setPreference(t){this.cache=t,await this.setGlobalPreference(t)}async promptForConsent(t){return e.isDoNotTrackEnabled()?(u.info(`${ke} Telemetry is disabled because the DO_NOT_TRACK environment variable is set.`),!1):(u.info(`${ia} ${S("Telemetry is enabled. We collect usage data and error reports to improve the Webflow CLI.")}`),u.info(`${ia} ${S("To opt out, run")} ${B("webflow auth telemetry --disable")}`),await this.setPreference(!0),!0)}clearCache(){this.cache=void 0}async getGlobalPreference(){return this.getPreference()}async setGlobalPreference(t){let r={telemetry:{global:{allowTelemetry:t,lastPrompted:Date.now(),version:vt()}}};await ae(r),u.info(`${A} Telemetry configuration updated in webflow.json`),this.cache=t}async hasGlobalPreference(){return await this.getPreference()!==void 0}async getTelemetryStatus(){let t=await this.getPreference();return t!==void 0?{enabled:t,source:"global",hasPreference:!0}:{enabled:!1,source:"none",hasPreference:!1}}setCacheValue(t,r){this.cache=r}}});async function q(e,t){let n={"User-Agent":`webflow-cli@${vt()}`};return(0,Zc.default)(e,{...t,headers:{...t?.headers,...n}})}var Zc,ft=v(()=>{"use strict";Zc=g(require("node-fetch"));ee()});var Yc,Xc=v(()=>{"use strict";Yc=e=>{try{let t=new URL(e);return!(!["http:","https:"].includes(t.protocol)||e.includes("?")||e.includes("#")||t.search||t.hash)}catch{return!1}}});var aa,C,Vo,Jr,Mn,la,Ln,Wn,Gr,oe=v(()=>{"use strict";Xc();aa=(e,t)=>(Yc(t)||(console.error(`Error: Invalid ${e} environment variable. Only valid plain HTTP/HTTPS URLs without query parameters and anchors is allowed.`),process.exit(1)),t),C=process.env.WEBFLOW_API_HOST?aa("WEBFLOW_API_HOST",process.env.WEBFLOW_API_HOST):"https://api.webflow.com",Vo=process.env.WEBFLOW_CDN_API_HOST?aa("WEBFLOW_CDN_API_HOST",process.env.WEBFLOW_CDN_API_HOST):"https://api-cdn.webflow.com",Jr=process.env.WEBFLOW_HOST?aa("WEBFLOW_HOST",process.env.WEBFLOW_HOST):"https://webflow.com",Mn="wf-manifest.json",la="mf-manifest.json",Ln="@webflow_renderer",Wn="ssr-bundle.tar",Gr="index.js"});var T,ua=v(()=>{"use strict";sa();Bn();x();ft();oe();T=class e{config;consentManager;sessionId;platformInfo;constructor(t){this.config=t,this.consentManager=jt.getInstance(),this.sessionId=na(),this.platformInfo=Kc()}async sendEvent(t){try{if(!await this.isEnabled())return;let r=this.enrichEvent(t),n=this.sanitizeEvent(r);await this.transmitEvent(n)}catch(r){u.debug(`Failed to send telemetry event: ${r}`)}}async sendError(t,r,n){await this.sendEvent({eventType:"error",success:!1,name:t.name,message:t.message,cause:t.cause,stack:ra(t),context:r,metadata:n?Pt(n):void 0})}async sendUsage(t,r){let{duration:n,...o}=r??{};await this.sendEvent({eventType:"usage",success:!0,feature:t,duration:typeof n=="number"?n:void 0,data:Object.keys(o).length>0?Pt(o):void 0})}async sendPerformance(t,r,n){await this.sendEvent({eventType:"performance",operation:t,duration:r,metrics:n})}async isEnabled(){return await this.consentManager.getPreference()!==!1}async isGloballyEnabled(){return await this.consentManager.getGlobalPreference()!==!1}async updatePreferences(t){await this.consentManager.setPreference(t)}static async promptForConsentIfNeeded(t){let r=jt.getInstance(),n=await r.getPreference();return n!==void 0?n:await r.promptForConsent(t)}enrichEvent(t){return{...{eventType:t.eventType||"usage",timestamp:Date.now(),sessionId:this.sessionId,platform:this.platformInfo.platform,nodeVersion:this.platformInfo.nodeVersion,cliVersion:vt(),command:process.argv.slice(2).join(" ")||void 0,metadata:{...t.metadata,commandType:this.config.commandType,siteId:this.config.siteId,projectId:this.config.projectId,os:this.platformInfo.os,arch:this.platformInfo.arch}},...t}}sanitizeEvent(t){let r=JSON.parse(JSON.stringify(t));return r.message&&(r.message=ct(r.message)),r.stack&&(r.stack=ct(r.stack)),r.context&&(r.context=ct(r.context)),r.metadata&&(r.metadata=Pt(r.metadata)),r.data&&(r.data=Pt(r.data)),r}async transmitEvent(t){let r=this.getEndpoint(),n=process.env.WEBFLOW_TELEMETRY_DEBUG==="true";if(n){console.log(`\u{1F4CA} [Telemetry] Sending to: ${r}`);let i={...t};i.metadata&&(delete i.metadata.authToken,delete i.metadata.apiToken),console.log("\u{1F4CA} [Telemetry] Payload:",JSON.stringify(i,null,2))}let o=await q(r,{method:"POST",headers:{Authorization:`Bearer ${this.config.authToken}`,"Content-Type":"application/json"},body:JSON.stringify(t),timeout:5e3});if(o.ok)n&&console.log(`\u{1F4CA} [Telemetry] Request successful: ${o.status}`);else throw n&&console.error(`\u{1F4CA} [Telemetry] Request failed: ${o.status} ${o.statusText}`),new Error(`Telemetry request failed: ${o.status} ${o.statusText}`)}getEndpoint(){let{host:t,commandType:r}=this.config;return`${t}/webflow-cli/${r}/telemetry`}static forDevlinkSync(t){return new e({host:t.host||C,authToken:t.authToken,siteId:t.siteId,commandType:"devlink"})}static forExport(t){return new e({host:t.host||C,authToken:t.authToken,siteId:t.siteId,commandType:"export"})}static forCloud(t){return new e({host:t.host||C,authToken:t.authToken,siteId:t.siteId,projectId:t.projectId,commandType:"cloud"})}static forExtension(t){return new e({host:t.host||C,authToken:t.authToken,siteId:t.siteId,commandType:"extension"})}static forCodeLibraries(t){return new e({host:t.host||C,authToken:t.authToken,commandType:"library"})}static forCms(t){return new e({host:t.host||C,authToken:t.authToken,siteId:t.siteId,commandType:"cms"})}static forAssets(t){return new e({host:t.host||C,authToken:t.authToken,siteId:t.siteId,commandType:"assets"})}static forSites(t){return new e({host:t.host||C,authToken:t.authToken,commandType:"sites"})}static forForms(t){return new e({host:t.host||C,authToken:t.authToken,commandType:"forms"})}}});var Qc=v(()=>{"use strict"});function ef(e){return async(t,r,n)=>{let o=Date.now(),i=process.memoryUsage().heapUsed;try{let s=await r(),a=Date.now()-o,l=process.memoryUsage().heapUsed;return await e.sendPerformance(t,a,{memoryDelta:l-i,...n}),s}catch(s){let a=Date.now()-o;throw await e.sendPerformance(t,a,{failed:1,...n}),s}}}var ee=v(()=>{"use strict";ua();sa();Qc();Bn();Bn()});var fa,ca,wy,Et,da=v(()=>{"use strict";fa=Symbol("webflow-cli-warn"),ca=class{warnings=[];originalConsoleWarn=null;isActive=!1;parseSource(t){let r=t.split(`
|
|
11
|
+
`);for(let n=2;n<r.length;n++){let o=r[n],i=o.match(/at .+? \((.+?):\d+:\d+\)/)||o.match(/at (.+?):\d+:\d+/);if(i){let s=i[1];if(s.includes("node_modules")){let a=s.match(/node_modules\/(@?[^/]+(?:\/[^/]+)?)/);return a?`External: ${a[1]}`:"External Dependencies"}else if(s.includes("webflow-cli"))return s.includes("/metadata/")?"Metadata Collection":s.includes("/bundler/")?"Bundling":s.includes("/commands/")?"CLI Commands":"Webflow CLI"}}return"General"}start(){this.isActive||(this.warnings=[],this.originalConsoleWarn=console.warn,this.isActive=!0,console.warn=(...t)=>{if(t.length>1&&t[t.length-1]===fa){let i=t.slice(0,-1);this.originalConsoleWarn&&this.originalConsoleWarn(...i);return}let r=t.map(i=>{if(typeof i=="string")return i;if(i instanceof Error)return i.message;try{return String(i)}catch{return"[Object]"}}).join(" "),n=new Error().stack||"",o=this.parseSource(n);this.warnings.push({message:r,timestamp:Date.now(),source:o,stackTrace:n})})}stop(){this.isActive&&(this.originalConsoleWarn&&(console.warn=this.originalConsoleWarn,this.originalConsoleWarn=null),this.isActive=!1)}displayGrouped(){if(this.warnings.length===0)return;console.log(`
|
|
12
12
|
\u26A0\uFE0F Warnings:
|
|
13
|
-
`);let
|
|
13
|
+
`);let t=this.warnings.reduce((r,n)=>{let o=n.source||"General";return r[o]||(r[o]=[]),r[o].push(n),r},{});Object.entries(t).forEach(([r,n])=>{r!=="General"&&console.log(` ${r}:`),n.forEach((o,i)=>{let s=r!=="General"?" ":" ",a=o.message||"[Empty warning message]";console.log(`${s}${i+1}. ${a}`)}),r!=="General"&&console.log("")}),t.General&&console.log("")}debug(){console.log(`
|
|
14
14
|
\u{1F41B} Debug: Captured Warnings
|
|
15
|
-
`),this.warnings.forEach((
|
|
16
|
-
`).slice(0,3).forEach(n=>{console.log(` ${n}`)})),console.log("")})}},
|
|
17
|
-
`)),
|
|
18
|
-
${
|
|
19
|
-
${
|
|
15
|
+
`),this.warnings.forEach((t,r)=>{console.log(`Warning ${r+1}:`),console.log(` Source: ${t.source}`),console.log(` Message: ${t.message}`),console.log(` Message length: ${t.message.length}`),console.log(` Timestamp: ${new Date(t.timestamp).toISOString()}`),t.stackTrace&&(console.log(" Stack (first 3 lines):"),t.stackTrace.split(`
|
|
16
|
+
`).slice(0,3).forEach(n=>{console.log(` ${n}`)})),console.log("")})}},wy=new ca,Et=wy});function Je(e){return e.replace(/\x1b\[[0-9;]*[a-zA-Z]/g,"")}function nf(e,t){if(!e)return t;let r=parseInt(e,10);return isNaN(r)||r<=0?t:r}function Nt(e){Vn.push(ct(e)),Vn.length>vy&&Vn.shift()}function of(e){ma=e}function tf(e){return Nt(`DEBUG: ${e}`),e}function Fy(e){return Nt(`INFO: ${e}`),e}function xy(e){return Nt(`WARN: ${e}`),e}function Cy(e,t){let r=e instanceof Error?e.stack||e.message:e,n=t?.prefix?`${t.prefix} `:"";Nt(`ERROR: ${n}${r}`),ga=!0;let o=e instanceof Error?e.message:String(e);return bt(`${n}${o}`)}function _y(e){return Nt(`SUCCESS: ${e}`),B(e)}function Ty(e){let t=Js({text:`${e}...`,indent:1}).start(),r=!1,n=o=>i=>{if(Nt(`${ky[o]||"INFO"}: ${i||e}`),o==="fail"&&(ga=!0),o==="update"){t.text=i||e;return}r||(r=!0,t.stopAndPersist({symbol:Sy[o],text:S(i||e)}))};return{succeed:n("succeed"),fail:n("fail"),warn:n("warn"),info:n("info"),neutral:n("neutral"),update:n("update")}}function Ay(){let e=zr.default.readdirSync(je).filter(t=>t.endsWith(".log")).map(t=>({name:t,time:zr.default.statSync(Ho.default.join(je,t)).mtime.getTime()})).sort((t,r)=>r.time-t.time);for(;e.length>=by;)try{let t=e.pop();if(!t)break;zr.default.removeSync(Ho.default.join(je,t.name))}catch{}}function ha(e){try{let t=process.argv.slice(2).join(" ");if(/^(log|library\s+log)(\s|$)/.test(t))return;zr.default.ensureDirSync(je),Ay(),Vn.unshift(`CLI Version: ${vt()}`,`Node Version: ${process.version}`,`Platform: ${process.platform}`,`Architecture: ${process.arch}`,`Command: ${t||"N/A"}`,`Exit Code: ${e??0}`,`Memory Usage: ${Math.round(process.memoryUsage().heapUsed/1024/1024)}MB`,`Timestamp: ${new Date().toISOString()}`,...ma?[`Sync ID: ${ma}`]:[],"");let r=Vn.map(Je);zr.default.writeFileSync(pa,r.join(`
|
|
17
|
+
`)),ga&&(console.info(`
|
|
18
|
+
${F} ${S("An error occurred. See logs for more information:")}`),console.info(` ${oa} Latest log: ${pa}`),console.info(` ${oa} All logs: ${je}`)),(process.env.DEBUG||process.argv.includes("--verbose"))&&(console.info(`
|
|
19
|
+
${A} Command completed successfully. Logs written to:`),console.info(` ${Hr} Latest log: ${pa}`),console.info(` ${Hr} All logs: ${je}`))}catch(t){console.error("Failed to write logs:",t)}}var zr,Ho,JF,Dy,je,by,vy,Ey,pa,Vn,ga,ma,ky,Sy,qr,rf,Un,Oy,u,x=v(()=>{"use strict";zr=g(require("fs-extra")),Ho=g(require("path")),JF=require("source-map-support/register");Ic();$c();Nc();ee();ce();da();H();Dy=qs("webflow-cli"),je=Dy.log;by=nf(process.env.MAX_PERSISTED_LOGS,50),vy=nf(process.env.MAX_IN_MEMORY_LOGS,1e3),Ey=`${Rn(new Date().toISOString(),{replacement:"_"}).replace(/\./g,"_")}-debug.log`,pa=Ho.default.join(je,Ey);Vn=[],ga=!1;ky={succeed:"INFO",fail:"ERROR",warn:"WARN",info:"INFO",neutral:"INFO",update:"INFO"},Sy={succeed:A,fail:F,warn:Ee,info:ke,neutral:" ",update:void 0};qr=!1;process.on("uncaughtException",e=>{qr||(qr=!0,Nt(`UNCAUGHT EXCEPTION: ${e?.stack}`),ha(1)),Et.displayGrouped(),Et.stop(),process.exit(1)});process.on("unhandledRejection",e=>{qr||(qr=!0,Nt(`UNHANDLED REJECTION: ${e instanceof Error?e.stack:String(e)}`),ha(1)),Et.displayGrouped(),Et.stop(),process.exit(1)});process.on("exit",e=>{qr||(qr=!0,ha(e))});rf=!0,Un=e=>{let t=e.split(`
|
|
20
20
|
`).map(r=>r.length?` ${r}`:r).join(`
|
|
21
|
-
`);return
|
|
22
|
-
`+
|
|
23
|
-
`);try{return await
|
|
24
|
-
`:`${
|
|
25
|
-
`,answer:
|
|
26
|
-
`,answer:
|
|
27
|
-
`:
|
|
21
|
+
`);return rf?(rf=!1,`
|
|
22
|
+
`+t):t},Oy={debug:e=>{let t=tf(e);process.env.DEBUG&&console.debug(Un(t))},trace:e=>{let t=tf(e);process.env.DEBUG&&console.debug(t)},dir:e=>console.dir(e,{depth:100}),info:e=>console.info(Un(Fy(e))),warn:e=>console.warn(Un(xy(e)),fa),error:(e,t)=>{console.error(Un(Cy(e,t)))},success:e=>console.log(Un(_y(e))),spinner:Ty},u=Oy});async function Jn(e){process.stdout.write(`
|
|
23
|
+
`);try{return await e()}catch(t){throw t instanceof Error&&My.test(t.message)&&(u.debug(t.message),process.stdin.isTTY&&typeof process.stdin.setRawMode=="function"&&process.stdin.setRawMode(!1),process.exit(130)),t}}async function Te(e){return te()?e.default??!1:Jn(()=>Se.confirm({...e,theme:$y}))}async function Ne(e){if(te())return"default"in e?e.default:null;let t=e.choices.map(r=>{if(!r||typeof r!="object"||Se.Separator.isSeparator(r)||r.type==="separator")return r;let n=r.name??String(r.value??"");return{...r,name:` ${S(n)}`}});return Jn(()=>Se.select({...e,choices:t,theme:jy}))}async function Ce(e){return te()?e.default!==void 0?await e.validate?.(e.default)!==!0?null:e.default:null:Jn(()=>Se.input({...e,theme:Ry}))}async function Go(e){if(te()){let r=[];return await e.validate?.(r)!==!0?null:r}let t=e.choices.map(r=>{if(!r||typeof r!="object"||r.type==="separator"||Se.Separator.isSeparator(r))return r;let n=r.name??String(r.value??"");return{...r,name:` ${S(n)}`}});return Jn(()=>Se.checkbox({...e,choices:t,theme:Ny}))}async function zo(e){if(te())return"default"in e?e.default:null;let t=(async(r,n)=>(await e.source(r,n)).map(i=>!i||typeof i!="object"||Se.Separator.isSeparator(i)?i:{...i,name:` ${S(i.name??"")}`}));return Jn(()=>Se.search({...e,source:t,theme:By}))}var Se,$y,Ry,Hn,lf,Da,ba,uf,Py,jy,Ny,By,My,Be=v(()=>{"use strict";Se=g(require("@inquirer/prompts"));_e();x();ce();$y={prefix:` ${ue("?")}`,style:{message:(e,t)=>t==="done"?`${Y(e)}
|
|
24
|
+
`:`${Y(e)}
|
|
25
|
+
`,answer:e=>` ${S(e)}`}},Ry={prefix:` ${ue("?")}`,style:{message:e=>`${Y(e)}
|
|
26
|
+
`,answer:e=>S(e)}},Hn=2,lf=1,Da=(e,t)=>t==="done"?`${Y(e)}
|
|
27
|
+
`:Y(e),ba=e=>` ${S(Je(e).trim())}`,uf=e=>{let t=Je(e),r=t.slice(0,Hn),n=t.slice(Hn+1+lf);return ue(`${r} ${n}`)},Py=e=>{let t=Je(e),r=t.slice(0,Hn),n=t[Hn+2],o=t.slice(Hn+3+lf);return ue(`${r} ${n} ${o}`)},jy={prefix:` ${ue("?")}`,style:{message:Da,answer:ba,highlight:uf,keysHelpTip:e=>` ${e.map(([t,r])=>`${S(t)} ${S(r)}`).join(" ")}`},icon:{cursor:` ${ue("\u23F5")}`}},Ny={prefix:` ${ue("?")}`,style:{message:Da,answer:ba,highlight:Py,keysHelpTip:e=>` ${e.map(([t,r])=>`${S(t)} ${S(r)}`).join(" ")}`},icon:{cursor:` ${ue("\u23F5")}`,checked:` ${B("\u25C9")}`,unchecked:` ${S("\u25EF")}`}},By={prefix:` ${ue("?")}`,style:{message:Da,answer:ba,highlight:uf,searchTerm:e=>ue(e)},icon:{cursor:` ${ue("\u23F5")}`}},My=/SIGINT/i});function Ft({apiToken:e,siteId:t,directory:r}){let n=zn.resolve(r?zn.join(r,".env"):zn.join(process.cwd(),".env"));r&&!fr.existsSync(r)&&fr.mkdirSync(r,{recursive:!0}),fr.existsSync(n)||fr.writeFileSync(n,`# automatically generated at ${new Date().toISOString()}`,{encoding:"utf8"}),qo.default.config({path:n,quiet:!0}),e&&qo.default.set("WEBFLOW_API_TOKEN",e,{path:n,encrypt:!1}),t&&qo.default.set("WEBFLOW_SITE_ID",t,{path:n,encrypt:!1})}var fr,zn,qo,gf=v(()=>{"use strict";fr=g(require("fs")),zn=g(require("path")),qo=g(require("@dotenvx/dotenvx"))});var d,O=v(()=>{"use strict";d=class e extends Error{prefix;skipLogging;isUserError;constructor(t,r){let n=t instanceof Error?t.message:String(t);super(n),this.name="CLIError",this.prefix=r?.prefix,this.skipLogging=r?.skipLogging??!1,this.isUserError=r?.isUserError??(t instanceof e?t.isUserError:!1),t instanceof Error?(this.cause=t,this.stack=t.stack):Error.captureStackTrace&&Error.captureStackTrace(this,e)}}});function Lt(){let e=Vy();return dr.default.join(e,Uy)}function Vy(){if(process.platform==="win32"){let r=process.env.APPDATA??dr.default.join(Ea.default.homedir(),"AppData","Roaming");return dr.default.join(r,"webflow")}let t=process.env.XDG_CONFIG_HOME??dr.default.join(Ea.default.homedir(),".config");return dr.default.join(t,"webflow")}function qn(){let e=Lt();try{if(!Mt.default.existsSync(e))return null;let t=Mt.default.readFileSync(e,"utf8");return JSON.parse(t)}catch{return null}}function Fa(e){let t=Lt(),r=dr.default.dirname(t);Mt.default.existsSync(r)||Mt.default.mkdirSync(r,{recursive:!0,mode:448}),Mt.default.writeFileSync(t,JSON.stringify(e,null,2),{encoding:"utf8",mode:384})}function xa(){let e=Lt();try{Mt.default.existsSync(e)&&Mt.default.unlinkSync(e)}catch{}}var Mt,Ea,dr,Uy,Ca=v(()=>{"use strict";Mt=g(require("fs")),Ea=g(require("os")),dr=g(require("path")),Uy="auth.json"});var Kn,_a=v(()=>{"use strict";oe();Kn={serverUrl:Jr,timeoutMs:300*1e3}});var hf,yf,wf,Df,Hy,bf,Jy,vf,Ef=v(()=>{"use strict";hf=require("crypto"),yf=g(require("open"));_a();x();ft();wf=e=>{let t=new Uint8Array(e);return hf.webcrypto.getRandomValues(t),Array.from(t,r=>r.toString(16).padStart(2,"0")).join("")},Df=({pollId:e,clientId:t,scope:r})=>`${Kn.serverUrl}/oauth/webflow/initiate?pollId=${e}&clientId=${t}&scope=${encodeURIComponent(r.join(" "))}`,Hy=e=>`${Kn.serverUrl}/oauth/webflow/poll?pollId=${e}`,bf=async e=>{let t=u.spinner("Browser opened for authentication");try{await new Promise(r=>setTimeout(r,3e3)),await(0,yf.default)(e),t.succeed()}catch{t.fail(),u.warn(`Could not automatically open browser. Please open this URL manually: ${e}`)}},Jy=async e=>{let t=Hy(e),r=await q(t);if(!r.ok){let n=`Failed to poll for authentication status (${r.status})`;try{let o=await r.json();o&&o.error&&(n+=`: ${o.error}`)}catch{}throw new Error(n)}return r.json()},vf=(e,t)=>{let r=u.spinner("Waiting");return new Promise((n,o)=>{let i=setTimeout(()=>{clearTimeout(i),clearInterval(s),o(new Error("Authentication timed out. Please try again."))},t),s=setInterval(async()=>{try{let a=await Jy(e);a.status==="success"&&a.accessToken?(clearTimeout(i),clearInterval(s),r.succeed("Authentication successful! You can close the browser window."),n(a.accessToken)):a.status==="error"&&(clearTimeout(i),clearInterval(s),r.fail("Authentication failed"),o(new Error(a.error||"Authentication failed")))}catch(a){clearTimeout(i),clearInterval(s),r.fail("Authentication failed"),o(a instanceof Error?a:new Error(String(a)))}},2e3)})}});function Zn(){if(process.env.WEBFLOW_API_TOKEN)return process.env.WEBFLOW_API_TOKEN;let e=qn();if(e?.accessToken)return e.accessToken;let t=process.env.WEBFLOW_WORKSPACE_API_TOKEN??process.env.WEBFLOW_SITE_API_TOKEN??null;return t&&!Ff&&(Ff=!0,u.warn(`${Ee} WEBFLOW_SITE_API_TOKEN / WEBFLOW_WORKSPACE_API_TOKEN are deprecated. Please use WEBFLOW_API_TOKEN instead. Run ${B("webflow auth login --force")} to update your .env file.`)),t}async function I(e){if(e?.apiToken&&!e.force)return e.apiToken;if(!e?.force){let n=Zn();if(n)return n}if(te())throw new d(`No API token found. To authenticate in CI/CD environments:
|
|
28
28
|
1. Generate a Workspace API token in your Webflow Dashboard > Apps & Integrations > Manage > Workspace API Token
|
|
29
|
-
2. Set it as the WEBFLOW_API_TOKEN environment variable in your CI/CD pipeline`);let
|
|
30
|
-
`})}}async function
|
|
31
|
-
Run ${
|
|
32
|
-
or provide --site and --api-token when running a CLI command`);let n=await
|
|
33
|
-
${n} ${
|
|
34
|
-
`+
|
|
35
|
-
${He} To update, run:`),o.length>0&&
|
|
36
|
-
`);return}let{code:l}=await Bt("npm ls @webflow/webflow-cli --json"),
|
|
37
|
-
Would you like to update it?`,default:!1})){r=
|
|
38
|
-
Use --force flag to reauthenticate anyway`);return}try{let o=await
|
|
39
|
-
You can now use other Webflow CLI commands that require authentication`)}catch(o){throw new d(o,{prefix:`${
|
|
40
|
-
\u2502 `+
|
|
41
|
-
\u2570`+
|
|
42
|
-
`)},
|
|
29
|
+
2. Set it as the WEBFLOW_API_TOKEN environment variable in your CI/CD pipeline`);let t=wf(16),r=Gy();try{let n=Df({pollId:t,clientId:r,scope:ka});await bf(n);let o=await vf(t,Kn.timeoutMs);return Fa({accessToken:o,scopes:ka,createdAt:new Date().toISOString()}),u.info(`${A} Credentials saved: ${Lt()}`),o}catch(n){throw new d(n)}}function Gy(){return"fbab9abdbeeb35bb2554a1b83b8bd060d719f22eca26ff9119b87608c87c0074"}var ka,Ff,Sa=v(()=>{"use strict";_e();x();H();O();Ca();_a();Ef();ce();ka=["assets:read","assets:write","authorized_user:read","cloud_apps:write","cms:read","cms:write","code_components:read","code_components:write","devlink_export:read","forms:read","sites:read","sites:write","workspace:read"],Ff=!1});function Yn(e){return e.siteId?e.siteId:process.env.WEBFLOW_SITE_ID??null}async function Ta(e){try{let r=await new xf.WebflowClient({accessToken:e,environment:{base:`${C}/v2`,dataApi:`${C}/v2`,contentDeliveryApi:`${Vo}/v2`}}).sites.list();if(!r||typeof r!="object"||!r.sites||!Array.isArray(r.sites))throw new d("Invalid response from Webflow API");let n=r.sites.map(o=>({id:o.id,displayName:o.displayName??"",shortName:o.shortName||(o.displayName??"").toLowerCase().replace(/\s+/g,"-"),lastUpdated:o.lastUpdated??null}));return n.sort((o,i)=>o.displayName.localeCompare(i.displayName)),n}catch(t){throw new d(t,{prefix:`Failed to fetch Webflow sites. Please check your authorization.
|
|
30
|
+
`})}}async function Aa(e){let t=e.map(n=>({name:`${n.displayName} (${n.shortName})`,value:n})),r=await zo({message:"Search for a Webflow site:",source:n=>{if(!n)return t;let o=n.toLowerCase();return t.filter(i=>i.value.displayName.toLowerCase().includes(o)||i.value.shortName.toLowerCase().includes(o))},pageSize:15});if(!r){if(e.length===0)throw new d("No sites available for selection");return u.warn(`Auto fallback to first site: ${e[0].displayName}`),e[0]}return r}var xf,Ko=v(()=>{"use strict";xf=require("webflow-api");Be();x();oe();oe();O()});async function ge(e,t){let r=t?.site??Yn(e);if(te()&&!r)throw new d(`No site ID configured for this project.
|
|
31
|
+
Run ${B("webflow auth login")} locally to authenticate and associate this project with a Webflow site,
|
|
32
|
+
or provide --site and --api-token when running a CLI command`);let n=await I({apiToken:t?.apiToken,force:t?.force});if(!r||t?.force){let o=await Ta(n);if(o.length===0)throw new d("No Webflow sites found in your account. Please make sure you have at least one authorized site in your Webflow account");let i=o.length>1?await Aa(o):o[0];r=i.id;let s=ae({siteId:r});return e.siteId=s.siteId,u.info(`${A} Site ID updated in webflow.json`),{siteId:r,siteName:i.displayName,accessToken:n}}return{siteId:r,accessToken:n}}var Cf=v(()=>{"use strict";we();_e();Sa();Ko();O();H();ce();x()});async function Oa(e){let t=new _f.WebflowClient({accessToken:e,environment:{base:`${C}/v2`,dataApi:`${C}/v2`}});try{return await t.token.authorizedBy()}catch{return null}}var _f,kf=v(()=>{"use strict";_f=require("webflow-api");oe()});var re=v(()=>{"use strict";gf();Sa();Cf();Ko();Ko();Ca();kf()});function iw(e,t){if(e.includes("..")||it.isAbsolute(e))throw new Error(`Invalid file path: "${e}" - path traversal not allowed`);let r=it.resolve(t,e),n=it.resolve(t);if(!r.startsWith(n+it.sep)&&r!==n)throw new Error(`Invalid file path: "${e}" - resolves outside root directory`)}async function ai(e,t,r){let n=it.join(process.cwd(),t);r&&(0,Ut.existsSync)(n)&&await(0,si.rm)(n,{recursive:!0,force:!0}),(0,Ut.existsSync)(n)||await(0,si.mkdir)(n);for(let o of e){iw(o.path,n);let i=sw(n,o.path);if(o.path.includes("/")){let s=o.path.substring(0,o.path.lastIndexOf("/"));aw(n,s)}(0,Ut.writeFileSync)(i,o.content,{flag:"w+"})}}function sw(e,t){return it.join(e,...t.split("/"))}function aw(e,t){let r=t.split("/"),n=e;for(let o of r)n=it.join(n,o),(0,Ut.existsSync)(n)||(0,Ut.mkdirSync)(n)}var Ut,si,it,Ua=v(()=>{"use strict";Ut=require("fs"),si=require("fs/promises"),it=g(require("path"))});function ui(e){for(let t of e??[]){let r=u[t.status]??u.info,n=fw[t.status]??ke;r(`
|
|
33
|
+
${n} ${t.content}`)}}var fw,Ja=v(()=>{"use strict";x();H();fw={info:ke,warn:Ee,success:A}});function za(e){let{manifestPath:t}=G();return(0,cd.writeFileSync)(t,JSON.stringify(e,null,2),"utf-8"),e}var cd,fd=v(()=>{"use strict";cd=require("fs");Pn()});function ci(e,t){try{let r=qa(),n=Ka(Object.values(e)),o=t?.force;return n&&r&&!o}catch{return!1}}var dd,pd,qa,Ka,fi=v(()=>{"use strict";dd=require("path"),pd=require("fs-extra");qa=()=>{try{return(0,pd.existsSync)((0,dd.join)(process.cwd(),"tsconfig.json"))}catch{return!1}},Ka=e=>e.some(t=>t.endsWith(".ts")||t.endsWith(".tsx"))});function dw(e){let{export:t,...r}=e;return t?r["devlink-export"]!=null?(za(r),r):(u.warn(`${Ee} The 'export' key in webflow.json is deprecated. Use 'devlink-export' instead. Your configuration will be migrated automatically.`),r["devlink-export"]={...t},za(r),r):r}function hd(e,t){try{new RegExp(e)}catch{throw new d(`Invalid '${t}' regex '${e}' in webflow.json. Fix the value and re-run the export.`,{isUserError:!0})}}async function wd(e){e=dw(e);let t=e["devlink-export"]||{},r=!1,n=t.rootDir;n||(te()?n=md:(r=!0,n=await Ce({message:"Enter the root directory for exported components:",default:md,validate:f=>!f||f.trim()===""?"Root directory is required":!0})));let o=t.ts;o===void 0&&(gw()?o=!0:te()?o=!1:(r=!0,o=await Te({message:"Use TypeScript?",default:!0})));let i=t.cssScopes;i===void 0&&(te()?i=gd:(r=!0,i=await Te({message:"Use DevLink style isolation (scoped wrapper + @scope)?",default:gd}))),t.components&&hd(t.components,"components"),t.componentGroups&&hd(t.componentGroups,"componentGroups");let s=t.components,a=t.componentGroups;!s&&!a&&(te()?(s=di,a=pi):(r=!0,await Te({message:"Do you want to export all components?",default:!0})?(s=di,a=pi):(s=await Ce({message:"Enter regex pattern to filter components (e.g., 'Button|Card' for specific):",default:di,validate:p=>{try{return new RegExp(p),!0}catch{return"Invalid regex pattern. Please enter a valid regular expression."}}}),a=await Ce({message:"Enter regex pattern to filter component groups (e.g., 'mygroup'):",default:pi,validate:p=>{try{return new RegExp(p),!0}catch{return"Invalid regex pattern. Please enter a valid regular expression."}}})))),s=s||di,a=a||pi;let l=t.relativeHrefRoot;l===void 0&&(l=pw);let c={...t,rootDir:n,components:s,componentGroups:a,ts:o,cssScopes:i,relativeHrefRoot:l};return(!t.rootDir||t.ts===void 0||t.cssScopes===void 0||!t.components||!t.componentGroups||t.relativeHrefRoot===void 0)&&mw(c),{config:c,wasPrompted:r}}function mw(e){ae({"devlink-export":{...e}}),u.info(`${A} Devlink Export configuration updated in webflow.json`)}function gw(){try{let e=process.cwd();if(qa())return!0;let t=["src","app","pages","components"];for(let r of t){let n=yd.join(e,r);if(mi.existsSync(n)&&Ka(mi.readdirSync(n)))return!0}}catch{}return!1}var mi,yd,md,di,pi,gd,pw,Dd=v(()=>{"use strict";mi=g(require("fs")),yd=g(require("path"));Be();_e();x();H();O();ta();fd();fi();md="./webflow",di=".*",pi=".*",gd=!0,pw="/"});async function Ed(e){if(e.ok)return;let t=await e.text().catch(()=>"");u.debug(`Server error response (HTTP ${e.status}): ${t||"<empty>"}`);let r;try{r=JSON.parse(t).message}catch{}throw new eo(r||`Request failed (HTTP ${e.status}).`)}async function Ya(e,t,r,n){let o=await hw(r,n,t,e);if(!o.files||!Array.isArray(o.files))throw new d("Invalid response format from V2 API: expected 'files' array");return{files:o.files,messages:o.messages,metadata:o.metadata}}async function hw(e,t,r,n){let{taskId:o,polling:i}=await yw(e,t,r,n);return ww(e,t,r,o,i)}async function yw(e,t,r,n){let o=await(0,Za.default)(`${C}/v2/devlink/${e}/export`,{method:"POST",headers:{Authorization:`Bearer ${r}`,"Content-Type":"application/json",[vd]:t},body:JSON.stringify(n),timeout:6e4});return o.ok||await Ed(o),await o.json()}async function ww(e,t,r,n,o){let{initialDelayMs:i,maxBackoffMs:s,backoffMultiplier:a,timeoutMs:l}=o,c=Date.now()+l,f=i;do{let p=await(0,Za.default)(`${C}/v2/devlink/${e}/export/${n}`,{headers:{Authorization:`Bearer ${r}`,[vd]:t},timeout:6e4});p.ok||await Ed(p);let m=await p.json();if(m.status==="finished")return m.result;if(m.status==="failed")throw new eo("The export task failed. Please try again or report a bug.");await(0,bd.setTimeout)(f),f=Math.min(f*a,s)}while(Date.now()<c);throw new eo(`Export task timed out after ${l}ms. Please try again.`)}var Za,bd,vd,eo,Fd=v(()=>{"use strict";Za=g(require("node-fetch")),bd=require("timers/promises");x();oe();O();vd="X-WF-Sync-Id",eo=class extends Error{}});var xd,Cd=v(()=>{"use strict";Be();x();xd=async(e,t)=>{if(!t)return;await Te({message:`Ready to export components to ${e.rootDir}?`,default:!0})||(u.info("Export cancelled."),process.exit(0))}});function _d(e,t,r){let i=new Intl.PluralRules("en-US").select(e)==="one"&&e===1?t:r||`${t}s`;return`${e} ${i}`}var kd=v(()=>{"use strict"});async function gi(e){let t=Date.now(),r;try{let{manifest:n}=G(),{siteId:o,accessToken:i}=await ge(n,e),s=(0,Sd.randomUUID)();of(s);let{config:a,wasPrompted:l}=await wd(n);u.info(`${A} Export configuration loaded!`),await xd(a,l);let c=T.forExport({authToken:i,siteId:o});r=u.spinner("Exporting components"),await c.sendUsage("devlink_export_start",{cssScopes:a.cssScopes,ts:a.ts,relativeHrefRoot:a.relativeHrefRoot});try{let{files:f,messages:p,metadata:m}=await Ya(a,i,o,s),h=m.exportCoverage==="full";await ai(f,a.rootDir,h),r.succeed(`${_d(m.componentCount,"component")} exported to ${a.rootDir}`),ui(p);let w=Date.now()-t;await c.sendUsage("devlink_export_success",{duration:w,cssScopes:a.cssScopes,ts:a.ts,relativeHrefRoot:a.relativeHrefRoot})}catch(f){let p=f instanceof Error?f.message:String(f);throw r.fail(`Components export failed: ${p}`),await c.sendError(f instanceof Error?f:new Error(String(f)),"devlink_export_failure",{cssScopes:a.cssScopes,ts:a.ts}),f}}catch(n){let o="Export failed: "+(n instanceof Error?n.message:n);throw r?r.fail(o):u.error(o,{prefix:`
|
|
34
|
+
`+F}),new d(n,{skipLogging:!0})}}var Sd,Td=v(()=>{"use strict";Sd=require("crypto");Dd();Fd();Cd();ee();re();we();kd();x();O();Ua();H();Ja()});var Ad={};Ru(Ad,{exportComponents:()=>gi});var Xa=v(()=>{"use strict";Td()});var Pu=Symbol.for("@webflow/webflow-cli/suppress-deprecation");function gh(e){if(typeof e!="object"||e===null)return!1;let t=e;return t.code==="DEP0040"&&typeof t.message=="string"&&t.message.includes("punycode")}function hh(e=process){if(e[Pu])return;e[Pu]=!0;let t=e.emit;e.emit=function(n,...o){return n==="warning"&&gh(o[0])?!1:t.call(this,n,...o)}}hh();var ih=require("commander");var rh=require("commander");ce();x();var sf=require("child_process"),af=require("fs"),ya=g(require("semver"));x();var wa="@webflow/webflow-cli",lr="@webflow/data-types",Jo="@webflow/react",Iy=[wa,lr,Jo],ur=class{getInstalledDependencies(){try{let t=(0,sf.execSync)(`npm ls ${Iy.join(" ")} --depth=0 --json --silent`,{encoding:"utf-8"}),r=JSON.parse(t);return r.dependencies?Object.entries(r.dependencies).reduce((n,[o,{version:i}])=>(n[o]=i,n),{}):{}}catch(t){return u.debug(`Failed to get installed dependencies: ${t}`),{}}}getRequiredDependencies(t){let r=JSON.parse((0,af.readFileSync)(require.resolve(`${t}/package.json`),"utf8"));return{...r.dependencies,...r.devDependencies}}checkCLIAndDataTypes(t){let r=t[lr];if(!r)return;let o=this.getRequiredDependencies(wa)[lr];if(!ya.default.satisfies(r,o))throw new Error(`Version mismatch: ${wa} requires ${lr} v${o} but found v${r}`)}checkReactAndDataTypes(t){let r=t[lr],n=t[Jo];if(!(!r||!n)&&!ya.default.eq(r,n))throw new Error(`Version mismatch: ${Jo} and ${lr} must be on the same version. Found ${Jo}@${n} and ${lr}@${r}`)}run(){let t=this.getInstalledDependencies();this.checkCLIAndDataTypes(t),this.checkReactAndDataTypes(t)}};var pf=require("fs-extra");Be();var mf=require("@dotenvx/dotenvx"),cr=g(require("semver"));x();var cf=require("child_process"),ff=require("util"),Ly=(0,ff.promisify)(cf.exec);async function Bt(e,t){try{let{stdout:r,stderr:n}=await Ly(e,t);return{stdout:r.toString().trim(),stderr:n.toString().trim(),code:0}}catch(r){let n=r;return{stdout:n.stdout??"",stderr:n.stderr??String(n.message??""),code:n.code??1}}}_e();var va=g(Wo());H();ce();(0,mf.config)({quiet:!0,ignore:["MISSING_ENV_FILE"]});var df={npm:{updateCommand:"npm install",update:async e=>await Bt(`npm install ${e}`),getOutdated:async e=>{let{stdout:t}=await Bt(`npm outdated --json ${e}`);return JSON.parse(t)},lockFile:"package-lock.json",globalFlag:"--global",supported:!0},pnpm:{updateCommand:"pnpm add",update:async e=>await Bt(`pnpm add ${e}`),getOutdated:async e=>{let{stdout:t}=await Bt(`pnpm outdated --json ${e}`);return JSON.parse(t)},lockFile:"pnpm-lock.yaml",globalFlag:"--global",supported:!0},yarn:{lockFile:"yarn.lock",globalFlag:"",updateCommand:"",getOutdated:async()=>({}),update:async()=>({stdout:"",stderr:"",code:0}),supported:!1}},Wy=["@webflow/webflow-cli","@webflow/data-types","@webflow/react","@webflow/emotion-utils","@webflow/styled-components-utils"],Gn=class{packageManager;constructor(){this.packageManager=this.getPackagerManagerInfo()}getPackagerManagerInfo(){for(let[,t]of Object.entries(df))if((0,pf.existsSync)(t.lockFile))return t;return df.npm}async listOutdatedPackages(t="local",r=Wy){let{getOutdated:n,globalFlag:o}=this.packageManager,i=await n(`${t==="global"?o:""} ${r?.join(" ")}`);return Object.fromEntries(Object.entries(i).map(([s,a])=>Array.isArray(a)?[s,{current:a[0].current,latest:a[0].latest,installationType:t}]:[s,{current:a.current,latest:a.latest,installationType:t}]))}async getOutdatedPackages(){let t=await this.listOutdatedPackages();if(t["@webflow/webflow-cli"])return t;let r=await this.listOutdatedPackages("global",["@webflow/webflow-cli"]);return{...t,...r}}async showUpdatePrompt(t){let r={name:"Update all packages",value:"update-all"},n=Object.entries(t).map(([i,{current:s,latest:a}])=>({name:`${i} (${s} ${He} ${a})`,value:i})),o=await Go({message:`New versions of the following ${ue("@webflow")} packages are available. Would you like to update them?`,choices:[r,...n]});return o==null?[]:o.includes("update-all")?Object.keys(t):o}showUpdateSuggestions(t){let{updateCommand:r,globalFlag:n}=this.packageManager;u.info(`${ke} New versions of the following ${ue("@webflow")} packages are available:`),Object.entries(t).forEach(([s,{current:a,latest:l}])=>{u.info(S(` ${Uo} ${s} (${a} ${He} ${l})`))});let o=Object.entries(t).filter(([,{installationType:s}])=>s==="local").map(([s])=>`${s}@latest`),i=Object.entries(t).filter(([,{installationType:s}])=>s==="global").map(([s])=>`${s}@latest`);u.info(`
|
|
35
|
+
${He} To update, run:`),o.length>0&&u.info(B(` ${r} ${o.join(" ")}`)),i.length>0&&u.info(B(` ${r} ${n} ${i.join(" ")}`)),u.info("")}shouldSkipUpdateChecks(){return!this.packageManager.supported||process.env.WEBFLOW_SKIP_UPDATE_CHECKS==="true"}getDistTag(){let t=cr.prerelease(va.default.version);return t&&t.length>0&&typeof t[0]=="string"?t[0]:"latest"}async promptPrerelease(t){let r;try{r=u.spinner("Checking for updates (to disable, use --skip-update-check)");let{stdout:n,code:o}=await Bt(`npm view @webflow/webflow-cli@${t} version`);if(o!==0||!n.trim()){r.succeed("Up to date");return}let i=n.trim(),s=va.default.version;if(!cr.valid(i)||!cr.valid(s)){r.succeed("Up to date");return}if(!cr.gt(i,s)){r.succeed("All @webflow packages are up to date");return}if(r.succeed(),!process.stdin.isTTY||te()){u.info(`${ke} A new version of @webflow/webflow-cli@${t} is available.`);let{code:p}=await Bt("npm ls @webflow/webflow-cli --json"),h=(p===0?"local":"global")==="global"?" --global":"";u.info(`${He} To update, run: `+B(`${this.packageManager.updateCommand}${h} @webflow/webflow-cli@${t}`)+`
|
|
36
|
+
`);return}let{code:l}=await Bt("npm ls @webflow/webflow-cli --json"),c=l===0?"local":"global";if(await Te({message:`A new version of @webflow/webflow-cli@${t} is available.
|
|
37
|
+
Would you like to update it?`,default:!1})){r=u.spinner("Updating");let p=c==="global"?` ${this.packageManager.globalFlag}`:"";try{await this.packageManager.update(`${p} @webflow/webflow-cli@${t}`),r.succeed("Updated successfully")}catch{let h=c==="global"?` ${this.packageManager.globalFlag}`:"";r.fail("Update failed. Manually run: "+B(`${this.packageManager.updateCommand}${h} @webflow/webflow-cli@${t}`))}}}catch(n){r?.fail("Failed to check for updates"),u.debug(String(n))}}async prompt(){if(this.shouldSkipUpdateChecks())return;let t=this.getDistTag();if(t!=="latest")return this.promptPrerelease(t);let r;try{r=u.spinner("Checking for updates (to disable, use --skip-update-check)");let n=await this.getOutdatedPackages();if(!(Object.keys(n).length>0)){r.succeed("All @webflow packages are up to date");return}if(r.succeed(),!process.stdin.isTTY||te()){this.showUpdateSuggestions(n);return}let s=await this.showUpdatePrompt(n);if(s.length>0){r=u.spinner("Updating");let{local:a,global:l}=s.reduce((m,h)=>(m[n[h].installationType==="global"?"global":"local"].push(h),m),{local:[],global:[]}),{update:c,globalFlag:f,updateCommand:p}=this.packageManager;try{a.length>0&&await c(`${a.map(m=>`${m}@latest`).join(" ")}`),l.length>0&&await c(`${f} ${l.map(m=>`${m}@latest`).join(" ")}`),r.succeed("Updated successfully")}catch{r.fail("Update failed. Manually run: "+B(`${p} ${s.map(h=>`${h}@latest`).join(" ")}`))}}}catch(n){r?.fail("Failed to check for updates"),u.debug(String(n))}}};_e();da();ua();Be();ee();re();_e();we();x();O();H();ce();var Tf=e=>{let t=e.command("auth").description("Authentication and configuration commands");t.command("login").description("Authenticate with Webflow and save credentials to .env file").option("-f, --force","Force reauthentication even if credentials exist").action(async r=>{if(te()){u.info(`${F} No-input mode enabled. Aborting OAuth authentication`);return}let{manifest:n}=G();if(!r.force&&Zn()){let i=Yn(n);u.info(`${A} Webflow credentials already exist:`),i&&u.info(` Site ID: ${i}`),u.info(" API Token: [hidden]"),u.info(`
|
|
38
|
+
Use --force flag to reauthenticate anyway`);return}try{let o=await I({force:r.force});Ft({apiToken:o}),u.info(`
|
|
39
|
+
You can now use other Webflow CLI commands that require authentication`)}catch(o){throw new d(o,{prefix:`${F} Authentication failed:`})}}),t.command("status").description("Show current authentication status").action(async()=>{let r=qn(),n=r?.accessToken??Zn();if(!n){u.info(`${F} Not logged in. Run ${B("webflow auth login")} to authenticate.`),process.exitCode=1;return}try{let o=await Oa(n);if(!o){u.info(`${F} Token is invalid or expired. Run ${B("webflow auth login --force")} to reauthenticate.`),process.exitCode=1;return}u.info(`${A} Logged in as ${o.firstName} ${o.lastName} (${o.email})`),r?.scopes?.length&&u.info(` Scopes: ${r.scopes.join(", ")}`),u.info(` Session: ${Lt()}`)}catch(o){throw new d(o,{prefix:`${F} Failed to fetch auth status:`})}}),t.command("logout").description("Log out and remove stored credentials").action(async()=>{xa(),u.info(`${A} Logged out. Session file removed.`),u.info(`${He} Run ${B("webflow auth login")} to authenticate again.`)}),t.command("telemetry").description("Manage telemetry settings for all Webflow CLI commands").option("--enable","Enable telemetry for all commands").option("--disable","Disable telemetry for all commands").option("--status","Show current telemetry status").action(async r=>{let n=jt.getInstance();if(r.status){let s=await n.getTelemetryStatus();u.info(Sf(s.enabled));return}if(r.enable){await n.setGlobalPreference(!0),u.info(Ia(!0));return}if(r.disable){await n.setGlobalPreference(!1),u.info(Ia(!1));return}let o=await n.getTelemetryStatus();if(u.info(Sf(o.enabled)),te()){u.info("\u{1F4A1} When --no-input mode is enabled please provide --enable or --disable option");return}let i=await Ne({message:"What would you like to do?",choices:[{name:"Enable telemetry for all commands",value:"enable"},{name:"Disable telemetry for all commands",value:"disable"},{name:"Cancel",value:"cancel"}]});if(i==="enable"||i==="disable"){let s=i==="enable";await n.setGlobalPreference(s),u.info(Ia(s))}})},Ia=e=>`${A} Telemetry ${e?"enabled":"disabled"} for all Webflow CLI commands`,Sf=e=>`${ke} Telemetry status: ${e?`enabled ${A}`:`disabled ${F}`}`;var Kf=g(require("http")),Zf=g(require("node-fetch")),Yf=g(require("serve-handler")),Xf=require("fs"),Qf=g(require("path")),ed=require("commander");var Of=g(require("archiver")),Ra=require("commander"),Xo=require("fs");var Af=require("cosmiconfig"),$a=require("commander"),Zo=async(e,t)=>{let r=await zy(t),n=r.config.apiVersion;return n&&typeof n!="string"&&$a.program.error('Error: The apiVersion field in webflow.json must be a string (i.e. "apiVersion": "2").'),{filepath:r.filepath,config:{publicDir:e,...r.config}}},zy=async e=>{let r=await(0,Af.cosmiconfig)("webflow",{searchPlaces:[e]}).search();return r||$a.program.error(`No ${e} file was found. Run this command within your extension folder.`),r};var If=g(require("mime-types")),Yo=g(require("path")),qy=5*1024*1024,Ky=new Set(["application/javascript","application/json","application/xml","image/png","image/jpeg","image/gif","image/svg+xml","image/webp","image/vnd.microsoft.icon","image/x-icon","video/webm","font/ttf","font/otf","font/woff","font/woff2","text/plain","text/markdown","text/html","text/css"]),$f=async(e,t,r)=>{let{config:n,filepath:o}=await Zo(e,t),i=Yo.join(o,".."),s=!0,a=!1,l=f=>{let p=f.name,m=If.default.lookup(p);return p==="index.html"&&(a=!0),p&&p.endsWith(".DS_Store")||!m?!1:Ky.has(m)?f:(console.log(`Invalid file type: ${m} for file: ${p}`),s=!1,!1)},c=f=>{(0,Xo.unlink)(r,p=>{p&&console.error(`Failed to delete file: ${p}`),Ra.program.error(f)})};return console.log(`Packaging the contents of the ${n.publicDir} folder into ${r}...`),new Promise(f=>{let p=(0,Of.default)("zip",{zlib:{level:9}}),m=(0,Xo.createWriteStream)(Yo.join(i,r));m.on("close",()=>{f(void 0)}),p.directory(Yo.join(i,n.publicDir),!1,l),p.file(o,{name:t}),p.pipe(m),p.finalize(),p.on("warning",h=>{console.log(h)}),p.on("error",h=>{Ra.program.error(h.message)}),p.on("finish",()=>{if(!a){c("Could not find index.html in your `publicDir`, all Designer Extension code needs to be inside of `publicDir`");return}if(!s){c("Bundling failed due to invalid file types");return}if(!p.pointer()||p.pointer()===0){c("Bundling failed with no output");return}if(p.pointer()>=qy){c("Bundling failed due to the bundle exceeding 5MB");return}console.log(`${p.pointer()} total bytes written`),console.log(`Done! ${r} is ready for you to upload to your Webflow app.`)})})};var Xn=g(require("path")),dt=g(require("fs/promises")),ti=g(require("fs")),Pf=require("url"),b0=require("dotenv/config"),jf=["js","cjs","json"],Na=process.cwd(),Nf=".webflowrc",Ct=Xn.extname(ti.readdirSync(Na).find(e=>e.includes(Nf))??"").replace(/\./g,""),xt=Xn.join(Na,`${Nf}${Ct&&`.${Ct}`}`),Bf=ti.existsSync(xt),Pa=class extends Error{constructor(){super(`Missing extension for .webflowrc file. The supported extensions are: ${jf.join(", ")}`)}},Qo=class extends Error{constructor(){super(`Unsupported extension for .webflowrc: ${Ct}. The supported extensions are: ${jf.join(", ")}`)}},ei=class extends Error{constructor(t){let r=t.includes(".webflowrc"),n=t.includes("webflow.json"),o;r?o=`It seems like you don't have a .webflowrc file in your project (${t}). Make sure there is a .webflowrc file in your project root.`:n?o=`It seems like you don't have a webflow.json file in your project (${t}). Make sure there is a webflow.json file in your project root.`:o=`It seems like you don't have a config file in your project (${t}). Make sure there is a config file in your project root.`,super(o)}},ja=class extends Error{constructor(t){super(`The following required fields are missing or undefined in your .webflowrc file: ${t}. If you're using process.env variables, make sure they're set up correctly.`)}};async function Zy(e){return(await import(process.platform==="win32"&&e?.match(/[a-zA-Z]:[\\\/]/)?(0,Pf.pathToFileURL)(e).href:e)).default}function Rf(e,t){let r=t.filter(n=>!e[n]);if(r.length)throw new ja(r.join(", "))}async function Kr(e=[],t=!1){if(!Bf){if(t)return{};throw new ei(xt)}if(!Ct)throw new Pa;switch(Ct){case"js":case"cjs":{await dt.access(xt);let r=await Zy(xt);return Rf(r,e),r}case"json":{let r=JSON.parse(await dt.readFile(xt,"utf8"));return Rf(r,e),r}default:throw new Qo}}function Yy(e,t){if(Ct==="js"||Ct==="cjs"){let n=new RegExp(`${t}: process.env.([\\w]+),`,"gi").exec(e);if(n)return n[1]}}function Xy(e,t,r){let n=Yy(t,r);if(n){let o=new RegExp(`${r}: ".*?",`,"g");return e.replace(o,`${r}: process.env.${n},`)}return e}async function Qy(e){let t=["authToken","host","siteId"],r=await dt.readFile(xt,"utf-8");for(let n of t)e=Xy(e,r,n);return e}async function ew(){try{let e=Xn.join(Na,"package.json");return await dt.access(e),JSON.parse(await dt.readFile(e,"utf-8"))?.type==="module"}catch{return!1}}async function Mf(e){if(!Bf)throw new ei(xt);let t=JSON.stringify(e,null,2);switch(Ct){case"js":case"cjs":{let r=await Qy(t.replace(/"([^"]+)":/g,"$1:")),n=await ew()&&Ct==="js"?"export default ":"module.exports = ";return dt.writeFile(xt,n+r)}case"json":return dt.writeFile(xt,t);default:throw new Qo}}var Wt=g(require("fs")),Ge=g(require("path"));var Qn="webflow.json",Lf="index.html",Wf="bundle.zip",Ba="public",Ma="extension-scaffolds",ri="default";var Uf="package.json",Vf="wf-placeholder-name",La=e=>JSON.stringify(e,null,2),Hf=e=>{let t="\u2500".repeat(e.length+2);return"\u256D"+t+`\u256E
|
|
40
|
+
\u2502 `+e+` \u2502
|
|
41
|
+
\u2570`+t+"\u256F"};var Jf=async(e,t="./",r=ri,n)=>{let o=n[r];try{for(let i of o){let s=Ge.join(t,i),a=nw(s,r,e);if(i.includes(Uf)||i.includes(Qn))await rw(i,a,e);else{let l=await Wt.promises.readFile(i);await qf(a,l)}}}catch(i){console.error("Error writing file, ",i)}},Gf=async()=>{let e={},t=Ge.resolve(__dirname),r=Ge.join(t,Ma),n=await Wt.promises.readdir(r);for(let o of n){let i=Ge.join(r,o),s=await zf(i);e[o]=s}return e},zf=async e=>{let t=[];try{let r=await Wt.promises.readdir(e);for(let n of r){let o=Ge.join(e,n);if((await Wt.promises.stat(o)).isDirectory()){let s=await zf(o);t.push(...s)}else t.push(o)}}catch(r){console.error(`Error reading ${Ge}, `,r)}return t},qf=async(e,t)=>{try{await Wt.promises.mkdir(Ge.dirname(e),{recursive:!0}),await Wt.promises.writeFile(e,t)}catch(r){console.error("Error writing file ",r)}},rw=async(e,t,r)=>Wt.promises.readFile(e,"utf8").then(async n=>{let o=n.replace(Vf,r);await qf(t,o)}),nw=(e,t,r)=>{let n=Ge.join(Ma,t),o=e.indexOf(n);if(o!==-1){let i=e.substring(o+n.length+1);return Ge.join(r,i)}return""};var ni=async()=>await Gf(),td=async()=>{let e=await ni(),t=Object.keys(e).join(", ");console.log(`Your available templates are: ${t}`),console.log('\u{1F4A1} Syntax: "webflow extension init projectName templateName"'),console.log('\u{1F31F} Example: "webflow extension init my-first-extension react"')},rd=async(e,t=ri)=>{let r=`./${e}`;console.log(`Scaffolding your new extension named: ${e}...`);let n=await ni();await Jf(e,r,t,n),console.log(`Done! Check out ${r}/README.md for steps on how to develop your extension.`)},nd=()=>$f(Ba,Qn,Wf),od=async e=>{let{config:t,filepath:r}=await Zo(Ba,Qn),n=Qf.join(r,"..",t.publicDir,Lf),i=(await Kr([],!0)).extensionTemplateDomain||"webflow-ext.com",s=t.apiVersion==="2"?"template/v2":"template",a=Object.keys(t.featureFlags||{}).map(h=>t.featureFlags?.[h]===!0?`ff_on=${h}`:`ff_off=${h}`).join("&"),l=a?`&${a}`:"",f=await(await(0,Zf.default)(`https://${i}/${s}?name=${t.name}${l}`)).text(),p=new Kf.Server((h,w)=>{if(h.url==="/"){Xf.promises.readFile(n,{encoding:"utf-8"}).catch(k=>{ed.program.error(k.message)}).then(k=>{let P=f.replace("{{ui}}",k);return w.writeHead(200,{"Content-Length":Buffer.byteLength(P),"Content-Type":"text/html"}),w.end(P)});return}if(h.url==="/__webflow")return w.writeHead(200,{"Content-Length":Buffer.byteLength(La(t)),"Content-Type":"application/json","Access-Control-Allow-Origin":"*","Access-Control-Allow-Headers":"*"}),w.end(La(t));(0,Yf.default)(h,w,{public:t.publicDir,cleanUrls:!1,directoryListing:!1})}),m=ow(e);p.listen(m),console.log(Hf(`Serving your extension at http://localhost:${m}`)+`
|
|
42
|
+
`)},ow=e=>{if(e){let t=parseInt(e,10);return isNaN(t)?(console.log("Invalid port number provided. Using the default port "+1337),1337):t}return 1337};Be();O();var id=e=>{let t=e.command("extension").description("CLI for developing Designer Extensions.");t.command("list").description("Get list of project templates that can be used for `init`").action(td),t.command("init").description("Bootstrap a Designer Extension.").argument("[projectName]","What is your Designer Extension's name?").argument("[scaffoldName]","Which project template do you want to use?").action(async(r,n)=>{let o=await ni(),i=Object.keys(o),s=await Ce({message:"What would you like to name your Designer Extension?",default:r,validate:l=>l.trim()===""?"The Designer Extension name cannot be empty.":!0});if(s===null)throw new d("When --no-input mode is enabled please provide the [projectName] argument.");let a=await Ne({message:"Which project template would you like to use?",choices:i.map(l=>({name:l,value:l})),default:n||"default"});await rd(s,a)}),t.command("bundle").description("Prepare package that can be uploaded to Webflow.").action(nd),t.command("serve").description("Serve your extension locally.").argument("[port]","The port to serve your extension on").action(od)};var Ga=g(require("process"));x();oe();we();var ad=g(require("fs"));O();async function ii(e){let{authToken:t,siteId:r}=e||{},{path:n,isUserDefined:o}=ar(),i=ad.existsSync(n),s=!1;try{let{manifest:a}=G();s=!0,o&&u.info(`Using manifest file: ${n}`);try{let l=jn(a,"devlink");if(!t||!r)throw new Error(`Missing Site ID or API token. Make sure you have WEBFLOW_API_TOKEN and WEBFLOW_SITE_ID set in your environment variables, or pass them as arguments --site and --api-token.
|
|
43
43
|
|
|
44
44
|
To set up your credentials, run:
|
|
45
|
-
webflow auth login`);return sd(l?.relativeHrefRoot),{...l,host:C,authToken:
|
|
45
|
+
webflow auth login`);return sd(l?.relativeHrefRoot),{...l,host:C,authToken:t,siteId:r,cssModules:!!l?.cssModules,components:oi(l?.components),fileExtensions:l?.fileExtensions,...e}}catch(l){throw new d(l,{prefix:`Failed to read devlink config from manifest file: ${n}
|
|
46
46
|
`})}}catch(a){if(o||i||s){let l=o?`The manifest file specified via --manifest flag was not found or is invalid: ${n}
|
|
47
47
|
`:`Your manifest file exists but is invalid or missing required properties: ${n}
|
|
48
|
-
`;throw new d(a,{prefix:l})}}try{let a=[];
|
|
48
|
+
`;throw new d(a,{prefix:l})}}try{let a=[];t||a.push("authToken"),r||a.push("siteId");let l=await Kr(a);return sd(l?.relativeHrefRoot),{...l,host:l.host||C,cssModules:!!l?.cssModules,components:oi(l?.components),fileExtensions:l?.fileExtensions,...e}}catch(a){throw a instanceof Error&&a.message.includes(".webflowrc")&&(a.message=`No configuration file found. Please create either:
|
|
49
49
|
- webflow.json with a "devlink" section, or
|
|
50
50
|
- .webflowrc file
|
|
51
|
-
in your project root.`),new d(a)}}function sd(
|
|
52
|
-
`),n=
|
|
51
|
+
in your project root.`),new d(a)}}function sd(e){if(!(e===void 0||e===!1)){if(typeof e=="string"){if(e==="/"||e.startsWith("http://")||e.startsWith("https://"))return;throw new Error(`Invalid relativeHrefRoot value "${e}". Must be false, "/" or an absolute URL starting with http:// or https://`)}throw new Error(`Invalid relativeHrefRoot type. Must be false, "/" or an absolute URL string, got: ${typeof e}`)}}function oi(e){if(typeof e=="string")return e;if(Array.isArray(e))return e.map(t=>`^${t}$`).join("|")}Ua();ft();O();var Zr=class extends Error{};function lw(e){try{let t=JSON.parse(e);if(t.msg&&typeof t.msg=="string")return t.msg}catch{}return null}async function uw(e){switch(e.status){case 400:{let t=await e.text(),r=lw(t);throw new Zr(r||"Bad request: The server rejected the request due to invalid input. Please check your configuration and try again.")}case 401:throw new Zr("Your access token is invalid for the provided siteId. Double check your configs in your .webflowrc configuration file.");case 404:throw new Zr("You're not currently enrolled in the DevLink beta. You can apply for access here: https://webflow.com/devlink");default:throw new Zr(`Something went wrong (HTTP ${e.status}).`)}}async function cw(e){try{let{siteId:t,host:r,authToken:n,...o}=e,i=await q(`${r}/devlink/${t}`,{method:"POST",headers:{Authorization:`Bearer ${n}`,"Content-Type":"application/json"},body:JSON.stringify(o),timeout:6e4});return i.ok?await i.json():uw(i)}catch(t){throw new d(t,{skipLogging:!0})}}async function Va(e){try{let t=await cw(e);if(!t.files||!Array.isArray(t.files))throw new d("Invalid response format from V1 API: expected 'files' array");let r=t.metadata?.exportCoverage==="full";return await ai(t.files,e.rootDir,r),{messages:t.messages}}catch(t){throw t instanceof d?t:new d(t,{skipLogging:!0})}}var pr=g(require("process"));x();we();ft();var Ha=class{config;error;constructor(t,r){this.config=t,this.error=r}stripPII(t=""){return t.replace(/\/(.*)webflow-cli/gi,"/REDACTED_PII/webflow-cli/").replace(/\/(.*)node_modules/gi,"/REDACTED_PII/node_modules")}sendTelemetry(){let t=this.config,r=this.error;q(`${t.host}/devlink/${t.siteId}/telemetry`,{headers:{Authorization:`Bearer ${t.authToken}`,"Content-Type":"application/json"},method:"post",body:JSON.stringify({cause:r.cause,message:r.message,name:r.name,stack:this.stripPII(r.stack),platform:pr.default.platform,node:pr.default.version})})}async storeChoice(t){try{return ae({devlink:{allowTelemetry:t}})}catch{let n=await Kr();await Mf({...n,allowTelemetry:t})}}async prompt(){let t=this.config;u.error(this.error),t.allowTelemetry===!0?this.sendTelemetry():t.allowTelemetry===void 0&&(await this.storeChoice(!0),this.sendTelemetry())}};function li(e){return async function(r){pr.default.removeListener("uncaughtException",li),pr.default.removeListener("unhandledRejection",li);let n=await ii(e);if(!n)return;await new Ha(n,r).prompt()}}function ld(e){pr.default.on("uncaughtException",li(e)),pr.default.on("unhandledRejection",li(e))}ee();x();re();we();Ja();async function ud(e,t){let r=Date.now(),{manifest:n}=G(),{accessToken:o,siteId:i}=await ge(n,{site:t?.site,apiToken:t?.apiToken}),s={...o?{authToken:o}:{},...i?{siteId:i}:{},...e&&e.length>0?{components:oi(e),overwriteModule:!1}:{overwriteModule:!0}};ld(s);let a=await ii(s);if(!a)return Ga.default.exit();let l;try{l=T.forDevlinkSync(a)}catch(f){u.debug(`Failed to initialize telemetry: ${f}`)}await l?.sendUsage("devlink_sync_start",{specificComponents:e&&e.length>0,componentCount:e?.length||0,cssModules:a.cssModules,overwriteModule:a.overwriteModule,relativeHrefRoot:a.relativeHrefRoot});let c=u.spinner(`Exporting components into ${a.rootDir}`);try{let{messages:f}=await Va(a);c.succeed(`Successfully exported components into ${a.rootDir} folder`),ui(f);let p=Date.now()-r;await l?.sendUsage("devlink_sync_success",{duration:p,specificComponents:e&&e.length>0,componentCount:e?.length||0,cssModules:a.cssModules,overwriteModule:a.overwriteModule,relativeHrefRoot:a.relativeHrefRoot})}catch(f){let p=f instanceof Error?f.message:String(f);c.fail(`Failed to export components: ${p}`);let m=Date.now()-r;throw await l?.sendError(f instanceof Error?f:new Error(String(f)),"devlink_sync_failure",{duration:m,specificComponents:e&&e.length>0,componentCount:e?.length||0,cssModules:a.cssModules,overwriteModule:a.overwriteModule,relativeHrefRoot:a.relativeHrefRoot,configOverrides:Object.keys(s),argv:Ga.default.argv.slice(2)}),f}}Xa();var Gt=require("commander");var $i=require("path"),on=require("@webflow/data-types");oe();var hi=require("fs"),Qa=g(require("md5"));function to(e,t){try{let r=(0,hi.statSync)(e),n=(0,hi.readFileSync)(e);return{value:n,meta:{title:e.replace(/^.*[\\\/]/,""),fileHash:(0,Qa.default)(n),size:r.size,...t||{}}}}catch{throw new Error(`File '${e}' not found`)}}function ro(e,t,r){try{let n=new Blob([e]).size,o=Buffer.from(e,"utf-8");return{value:o,meta:{title:t.replace(/^.*[\\\/]/,""),fileHash:(0,Qa.default)(o),size:n,...r}}}catch{throw new Error(`Error parsing '${t}' inline file`)}}var Od=g(require("node-fetch")),Id=g(require("form-data"));async function no(e,t){let r={...t.fields,file:e.value},n=new Id.default;Object.entries(r).forEach(([i,s])=>{n.append(i,s)});let o=await(0,Od.default)("https://"+t.fields.bucket+".s3.amazonaws.com",{method:"POST",body:n});Dw(o)}function Dw(e){switch(e.status){case 200:case 201:return;case 403:throw new Error("Unauthorized. Please check your AWS access key");default:throw new Error(`Something went wrong when uploading the file: ${e.statusText}`)}}x();we();ee();oe();ft();ce();function bw({apiToken:e=process.env.WEBFLOW_API_TOKEN??process.env.WEBFLOW_WORKSPACE_API_TOKEN??process.env.WEBFLOW_SITE_API_TOKEN,siteId:t=process.env.WEBFLOW_SITE_ID,libraryTarget:r=process.env.WEBFLOW_LIBRARY_TARGET}){if(!e)throw new Error("No API token provided");if(r==="site"){if(!t)throw new Error("No site provided");return{baseUrl:`${C}/v2/sites/${t}`,authToken:e}}return{baseUrl:`${C}/v2/workspaces`,authToken:e}}function vw(e){if(e)return JSON.stringify(Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0)))}async function Ew(e){if(e.ok)return;if(e.status===401||e.status===403)throw new Error(`Your API token is invalid or not authorized to perform this action. Run ${B("webflow auth login --force")} to generate a new token.`);if(e.status===404)throw new Error("Code components are rolling out in phases. Check back soon for access.");let t=await e.json();throw new Error(t.message||e.statusText)}async function Vt({endpoint:e,method:t="GET",body:r,options:n}){let{baseUrl:o,authToken:i}=bw(n),s=`${o.replace(/\/+$/,"")}/${e.replace(/^\/+/,"")}`,a=await q(s,{method:t,headers:{"Content-Type":"application/json",Authorization:`Bearer ${i}`},body:vw(r)});return await Ew(a),a.json()}async function el({options:e}){return(await Vt({endpoint:"/code_libraries",options:e})).payload.workspaces[0]}async function tl({name:e,description:t,slug:r,options:n}){return(await Vt({method:"POST",endpoint:"/code_library/init",body:{name:e,description:t,slug:r},options:n})).payload}async function rl({resourceId:e,files:t,options:r}){return(await Vt({method:"POST",endpoint:`/code_library/${e}/files`,body:{files:t},options:r})).payload}async function nl({resourceId:e,codeModule:t,components:r,options:n}){return(await Vt({method:"POST",endpoint:`/code_library/${e}/share`,body:{codeModule:t,components:r},options:n})).payload}var Fp=require("path"),xp=g(require("webpack-merge")),mr=require("@webflow/data-types");oe();x();var Pd=require("memfs/lib/volume"),oo=require("@webflow/data-types");var pt="./tmp_entry",$d="components";function yi(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]+|[^\p{L}\p{N}]/gu," ").toLowerCase().replace(new RegExp("(?:^|\\s)(\\p{L})","gu"),(t,r)=>r.toUpperCase()).replace(/\s+/g,"")}function Fw(e){let t=yi(e);return/^[a-zA-Z]/.test(t.charAt(0))?t:"_"+t}function Rd(e,t){let r=e.map(({name:l,path:c,isDefaultExport:f})=>f?`import ${l} from "${c}";`:`import { ${l} } from "${c}";`).join(`
|
|
52
|
+
`),n=e.filter(l=>l.type==="internal").map(({name:l,exportKey:c})=>`${c}: ${l}`).join(", "),o=e.filter(l=>l.type==="component").map(({name:l,exportKey:c})=>`"${c}": ${l}`).join(", "),i=`env: "${t}"`,s=n,a=o?`components: { ${o} }`:void 0;return`${r}
|
|
53
53
|
|
|
54
|
-
export default { ${[i,s,a].filter(Boolean).join(", ")} };`}function jd(t,e,r){let n={},o=`${pt}/Client.js`,i=`${pt}/Server.js`;n[o]=Rd([{name:"ClientRenderer",path:t.client,exportKey:"Renderer",type:"internal"}],oo.Environment.Client);let s={},a=u=>{let f=yw(u);return s[f]?(s[f]+=1,`${f}${s[f]}`):(s[f]=1,f)};n[i]=Rd([{name:"ServerRenderer",path:t.server,exportKey:"Renderer",type:"internal"},...Object.entries(e).filter(([u])=>r[u]?.ssr??!0).map(([u,f])=>{let p=a(u),g=f.startsWith(pt)?f.replace(`${pt}/`,"./"):f;return{name:p,path:g,exportKey:u,isDefaultExport:!0,type:"component"}})],oo.Environment.Server);let l={[oo.Environment.Client]:o,[oo.Environment.Server]:i};return{entryPointsVolume:Pd.Volume.fromJSON(n),paths:l}}var Cp=require("memfs/lib/volume");var Wd=m(require("archiver")),Yr=require("path");ie();var io=require("@webflow/data-types");ie();_();var Ht=t=>t.endsWith("/")||/%2F$/i.test(t)?t:`${t}/`;var Nd=2;function Bd(t){let e={type:io.ModuleLoader.FEDERATION,version:Nd,entry:na,renderer:Ln,components:t};return{title:Mn,content:JSON.stringify(e)}}function Md(t){let e={type:io.ModuleLoader.SSR,version:Nd,entry:Gr,components:t};return{title:Mn,content:JSON.stringify(e)}}function Ld(t){let e=`/${io.Environment.Client}/${na}`;try{if(t.existsSync(e)){let r=t.readFileSync(e,"utf8"),n=JSON.parse(r.toString()),o="publicPath"in n.metaData?n.metaData.publicPath:null;if(!o)throw new Error("Public path not found in module federation manifest");return n.exposes.reduce((i,s)=>{let a=s.name;return a===Ln||(i[a]={css:[]},s.assets.css.sync.forEach(l=>{i[a].css.push(`${Ht(o)}${l}`)})),i},{})}}catch(r){c.error(r,{prefix:"Failed to extract components metadata from MF manifest:"})}return{}}var hi=require("@webflow/data-types"),ww=/\.css$/i;async function Ud(t,e,r){let n=!1;return new Promise(async(o,i)=>{t.length===0&&i(new Error("No assets to bundle"));let s=`/${hi.Environment.Server}/${Wn}`,a=(0,Wd.default)("tar",{gzip:!1}),l=e.createWriteStream(s);a.on("error",p=>(n=!0,i(p))),l.on("close",()=>{if(!n)try{let p={type:"asset",name:Wn,info:{},size:a.pointer(),emitted:!0,comparedForEmit:!1,cached:!1};return t.forEach(g=>{let h=(0,Yr.resolve)((0,Yr.join)(`/${hi.Environment.Server}`,g.name));e.existsSync(h)&&e.rmSync(h)}),o([p])}catch(p){return i(p)}finally{n=!0}}),a.pipe(l);let{title:u,content:f}=Md(r);a.append(f,{name:u}),t.forEach(p=>{if(!ww.test(p.name))try{let g=(0,Yr.resolve)((0,Yr.join)(`/${hi.Environment.Server}`,p.name)),h=e.readFileSync(g,"utf8");a.append(h,{name:p.name})}catch(g){return n=!0,i(g)}}),await a.finalize()})}var Vd=require("@webflow/data-types");async function Hd(t,e,r){let{title:n,content:o}=Bd(r);await e.promises.writeFile(`/${Vd.Environment.Client}/${n}`,o);let i={type:"asset",name:n,info:{},size:o.length,emitted:!0,comparedForEmit:!1,cached:!1};return t.filter(s=>s.name!=="mf-stats.json").concat([i])}var hp=require("@rspack/core"),yp=m(require("fork-ts-checker-webpack-plugin")),wp=require("ts-checker-rspack-plugin"),Dp=m(require("mini-css-extract-plugin")),bp=require("@webflow/data-types");var Gd=require("webpack"),el=m(require("mini-css-extract-plugin")),zd=m(require("tsconfig-paths-webpack-plugin")),qd=require("tsconfig-paths"),tl=require("@webflow/data-types"),Kd=require("path");ie();var Jd=m(require("postcss-selector-parser")),Qa=()=>({postcssPlugin:"CSSinShadowDOM",Once(t){t.walkRules(e=>{e.selector=(0,Jd.default)(r=>{r.walkPseudos(n=>{n.value===":root"&&(n.value=":host")})}).processSync(e.selector)})}});Qa.postcss=!0;Qa.postcssPlugin="CSSinShadowDOM";var yi=Qa;function Dw(){return(0,qd.loadConfig)(process.cwd()).resultType==="success"}function Zd({entry:t,env:e,mode:r="production",publicPath:n,libraryName:o,outputPath:i}){let s={mode:r,module:{rules:[{test:/\.css$/i,use:[{ident:"mini-css-extract-loader",loader:el.default.loader},{ident:"css-loader",loader:require.resolve("css-loader"),options:{importLoaders:1}},{ident:"postcss-loader",loader:require.resolve("postcss-loader"),options:{postcssOptions:{plugins:[yi]}}}]},{test:/\.(png|svg|jpg|jpeg|gif|woff|woff2|eot|ttf|otf)$/i,type:"asset/resource",generator:{filename:"[hash]-[name][ext]"}}]},plugins:[new el.default({filename:"[contenthash].css",chunkFilename:"[contenthash].css",runtime:!1})],resolve:{plugins:[Dw()?new zd.default:null].filter(Boolean)},performance:{hints:!1}};if(e===tl.Environment.Client)return{...s,entry:()=>({}),output:{path:i?(0,Kd.join)(process.cwd(),i,e):"/",publicPath:n,clean:!0,uniqueName:o},target:"web"};if(e===tl.Environment.Server)return{...s,plugins:[...s.plugins||[],new Gd.optimize.LimitChunkCountPlugin({maxChunks:1})],entry:t,output:{filename:Gr,library:{type:"commonjs2"}},optimization:{splitChunks:!1},target:"async-node"};throw new Error(`Unknown environment ${e}`)}var Yd=require("@module-federation/enhanced"),rl=require("@webflow/data-types");function Xd({libraryName:t,env:e,exposes:r}){if(e===rl.Environment.Client)return{plugins:[new Yd.ModuleFederationPlugin({name:t,filename:"remoteEntry.js",exposes:r,dts:!1,experiments:{optimization:{disableSnapshot:!0}}})]};if(e===rl.Environment.Server)return{};throw new Error(`Unknown environment ${e}`)}function Qd(){return{module:{rules:[{test:/\.(js|ts)x?$/,exclude:/node_modules/,use:[{ident:"babel-loader",loader:require.resolve("babel-loader"),options:{presets:[require.resolve("@babel/preset-env"),[require.resolve("@babel/preset-react"),{runtime:"automatic"}],require.resolve("@babel/preset-typescript")]}}]}]},resolve:{extensions:[".tsx",".ts",".jsx",".js",".json"]}}}function wi(){return{module:{rules:[{test:/\.(js|ts)x?$/,exclude:/node_modules/,loader:"builtin:swc-loader",options:{jsc:{parser:{syntax:"typescript",tsx:!0},transform:{react:{runtime:"automatic",development:!1,refresh:!1}}}}}]},resolve:{extensions:[".tsx",".ts",".jsx",".js",".json"]}}}var Di=require("@rspack/core"),ep=require("tsconfig-paths"),nl=require("@webflow/data-types"),tp=require("path");ie();function bw(){let t=(0,ep.loadConfig)(process.cwd());if(t.resultType==="success")return t.configFileAbsolutePath}function rp({entry:t,env:e,mode:r="production",publicPath:n,libraryName:o,outputPath:i}){let s={mode:r,module:{rules:[{test:/\.css$/i,use:[{ident:"mini-css-extract-loader",loader:Di.rspack.CssExtractRspackPlugin.loader},{ident:"css-loader",loader:require.resolve("css-loader"),options:{importLoaders:1}},{ident:"postcss-loader",loader:require.resolve("postcss-loader"),options:{postcssOptions:{plugins:[yi]}}}],type:"javascript/auto"},{test:/\.(png|svg|jpg|jpeg|gif|woff|woff2|eot|ttf|otf)$/i,type:"asset/resource",generator:{filename:"[hash]-[name][ext]"}}]},plugins:[new Di.rspack.CssExtractRspackPlugin({filename:"[contenthash].css",chunkFilename:"[contenthash].css",runtime:!1})],resolve:(()=>{let a=bw();return a?{tsConfig:{configFile:a}}:{}})(),performance:{hints:!1}};if(e===nl.Environment.Client)return{...s,entry:()=>({}),output:{path:i?(0,tp.join)(process.cwd(),i,e):"/",publicPath:n,clean:!0,uniqueName:o},target:"web"};if(e===nl.Environment.Server)return{...s,plugins:[...Array.isArray(s.plugins)?s.plugins:[],new Di.rspack.optimize.LimitChunkCountPlugin({maxChunks:1})],entry:t,output:{filename:Gr,library:{type:"commonjs2"}},optimization:{splitChunks:!1},target:"async-node"};throw new Error(`Unknown environment ${e}`)}var np=require("@module-federation/enhanced/rspack"),ol=require("@webflow/data-types");function op({libraryName:t,env:e,exposes:r}){if(e===ol.Environment.Client)return{plugins:[new np.ModuleFederationPlugin({name:t,filename:"remoteEntry.js",exposes:r,dts:!1,experiments:{optimization:{disableSnapshot:!0}}})]};if(e===ol.Environment.Server)return{};throw new Error(`Unknown environment ${e}`)}var Ew=m(require("fs")),ip=require("unionfs"),sp=require("webpack");function vw(t){return{name:t.name,size:t.size,emitted:t.emitted,info:t.info}}function bi(t){let e=t.toJson();return{hasErrors:()=>t.hasErrors(),hasWarnings:()=>t.hasWarnings(),toString:r=>t.toString(r),toJson:()=>({...e,assets:(e.assets??[]).map(vw)})}}async function ap({config:t,sourceVolumes:e=[],outputVolume:r,outputPath:n,failOnWarnings:o=!0}){let i=e.reduce((s,a)=>(s.use(a),s),new ip.Union().use(Ew));return new Promise((s,a)=>{let l=(0,sp.webpack)(t);l.inputFileSystem=i,r&&(l.outputFileSystem=r),n&&(l.outputPath=n),l.run((u,f)=>{l.close(p=>{u||p?a(u||p):f?f.hasErrors()||o&&f.hasWarnings()?a(new Error(f.toString("errors-warnings"))):s(bi(f)):a(new Error("Webpack stats are undefined"))})})})}var xw=m(require("fs")),il=m(require("webpack-merge")),lp=require("memfs"),cp=require("unionfs"),up=require("@rspack/core");async function vi({config:t,sourceVolumes:e=[],outputVolume:r,outputPath:n,failOnWarnings:o=!0}){let i=e.reduce((a,l)=>(a.use(l),a),new cp.Union().use(xw)),s=t;return e.length>0&&(s=(0,il.default)(s,{experiments:{...t.experiments,useInputFileSystem:[/./]}})),r&&(s=(0,il.default)(s,{output:{clean:!1,...n&&{path:n}}})),new Promise((a,l)=>{let u=(0,up.rspack)(s);u.inputFileSystem=i,r&&(u.outputFileSystem=(0,lp.createFsFromVolume)(r)),n&&(u.outputPath=n),u.run((f,p)=>{u.close(g=>{f||g?l(f||g):p?p.hasErrors()||o&&p.hasWarnings()?l(new Error(p.toString("errors-warnings"))):a(bi(p)):l(new Error("Rspack stats are undefined"))})})})}var dp=require("@module-federation/enhanced");var Xr=m(require("webpack-merge"));_();function Jt(t){return t!==null&&typeof t=="object"&&"constructor"in t?t.constructor.name??"":""}function fp(t,e){let r=Object.entries(t).filter(([n])=>!e.includes(n));return Object.fromEntries(r)}function xi(t){let{deduplicatePluginNames:e,ModuleFederationPluginClass:r,getPluginOptions:n,filterOverridePlugins:o}=t;return function(s,a,l){let u=["entry","output","target"],f=_w(s),p=Array.isArray(l)?Ei(...l.map(f)):Ei(f(l));Object.keys(p).some(j=>u.includes(j))&&c.warn(`Cannot override blocked properties: ${u.join(", ")}`);let h={...fp(p,[...u,"ModuleFederationPlugin","module","plugins"]),module:fp(p.module??{},["rules"])},w=(0,Xr.default)(a,h),F=p.plugins??[];o&&(F=F.filter(o));let O=a.plugins??[],K=(0,Xr.mergeWithCustomize)({customizeArray:(0,Xr.unique)("plugins",e,j=>Jt(j))})({plugins:F},{plugins:O}).plugins,x=p?.ModuleFederationPlugin?.shared,B=K?.map(j=>{if(Jt(j)==="ModuleFederationPlugin"){let I=n(j);return new r({...I,...x?{shared:x}:{}})}return j});w.plugins=B;let Q=p.module?.rules;if(Q&&typeof Q=="function"){let j=a.module?.rules??[];w.module={...w.module??{},rules:Q(j)}}return w}}function Ei(...t){if(t.length===0)return{};if(t.length===1)return t[0];let e={};for(let r of t){let{module:n,ModuleFederationPlugin:o,plugins:i,...s}=r;if(e={...e,...s},n){let{rules:a,...l}=n;if(e.module={...e.module,...l},a){let u=e.module?.rules;u?e.module.rules=f=>{let p=u(f);return a(p)}:e.module.rules=a}}o?.shared&&(e.ModuleFederationPlugin={shared:{...e.ModuleFederationPlugin?.shared,...o.shared}}),i&&(e.plugins=[...e.plugins??[],...i])}return e}function _w(t){return e=>typeof e=="function"?e(t):e}var Cw=xi({deduplicatePluginNames:["ModuleFederationPlugin","MiniCssExtractPlugin"],ModuleFederationPluginClass:dp.ModuleFederationPlugin,getPluginOptions:t=>t._options??{}});function pp(t,e,r){return Cw(t,e,r)}var mp=require("@module-federation/enhanced/rspack");var Fw=xi({deduplicatePluginNames:["ModuleFederationPlugin","CssExtractRspackPlugin"],ModuleFederationPluginClass:mp.ModuleFederationPlugin,getPluginOptions:t=>t._options??{},filterOverridePlugins:t=>Jt(t)!=="MiniCssExtractPlugin"});function gp(t,e,r){return Fw(t,e,r)}var sl={[bp.Framework.React]:{generateWebpackBundlerConfig:Qd,generateRspackBundlerConfig:wi}},kw={webpack:{generateBaseConfig:Zd,getFrameworkConfig:(t,e)=>sl[t].generateWebpackBundlerConfig(e),generateFederationConfig:Xd,mergeConfigs:(t,e,r)=>pp(t,e,r),bundle:t=>ap({...t,config:t.config}),typeCheckerPlugin:yp.default,hashFunction:"md5",replaceCssPlugin:t=>({...t,plugins:t.plugins?.map(e=>Jt(e)==="MiniCssExtractPlugin"?new Dp.default({filename:"[name].[contenthash].css"}):e)})},rspack:{generateBaseConfig:rp,getFrameworkConfig:(t,e)=>sl[t].generateRspackBundlerConfig(e),generateFederationConfig:op,mergeConfigs:(t,e,r)=>gp(t,e,r),bundle:t=>vi({...t,config:t.config}),typeCheckerPlugin:wp.TsCheckerRspackPlugin,hashFunction:"md4",replaceCssPlugin:t=>({...t,plugins:t.plugins?.map(e=>Jt(e)==="CssExtractRspackPlugin"?new hp.CssExtractRspackPlugin({filename:"[name].[contenthash].css"}):e)})}},Qr=t=>kw[t],vp=t=>!!sl[t];var Ep={colors:!0,chunks:!1,modules:!1,chunkModules:!1,reasons:!1,errorDetails:!1,assetsSpace:1/0,warnings:!1,assets:!0,entrypoints:!0,performance:!0};async function _i(t){let e=t.bundler??"webpack";c.debug("Generating entry points...");let{entryPointsVolume:r,paths:n}=jd(t.renderer,t.componentsFiles,t.componentsOptions),o=Cp.Volume.fromJSON({"/Server":null,"/Client":null});c.debug("Generating bundling config...");let i=t.overrideConfig??{};Object.keys(i).length&&c.debug("Found bundle config overrides. Merging...");let s=Qr(e),a=O=>{let ne=Sw({env:O,mode:t.dev?"development":"production",framework:t.framework,publicPath:t.publicPath,components:t.componentsFiles,entryPaths:n,libraryName:t.libraryIdentifier,bundler:e}),K=s.mergeConfigs(O,ne,i);return t?.debugBundler&&(c.info(`${e} config for env ${O}:`),c.dir(K)),K},l={sourceVolumes:[...t.sourceVolumes,r],outputVolume:o,failOnWarnings:t.failOnWarnings},[u,f]=await Promise.all([s.bundle({...l,config:a(mr.Environment.Server),outputPath:`/${mr.Environment.Server}`}),s.bundle({...l,config:a(mr.Environment.Client),outputPath:`/${mr.Environment.Client}`})]);t?.debugBundler&&(c.debug(o.toTree()),c.debug(`Server Bundler Stats: ${u.toString(Ep)}`),c.debug(`Client Bundler Stats: ${f.toString(Ep)}`));let p=Ld(o);c.debug("Packaging server bundle...");let g=await Ud(u.toJson().assets||[],o,p);c.debug("Packaging client bundle...");let h=await Hd(f.toJson().assets||[],o,p),w=O=>ne=>[ne,O];return{outputFiles:[...g.map(w(mr.Environment.Server)),...h.map(w(mr.Environment.Client))],outputVolume:o}}function Sw({env:t,mode:e="production",framework:r,publicPath:n,components:o,entryPaths:i,libraryName:s,outputPath:a,bundler:l="webpack"}){if(!vp(r))throw new Error(`Unknown framework: ${r}`);let u=Object.entries({[Ln]:i[t],...o}).reduce((w,[F,O])=>({...w,[`./${F}`]:`./${(0,xp.relative)(process.cwd(),O)}`}),{}),f=Qr(l),p=f.generateBaseConfig({entry:i[t],env:t,mode:e,libraryName:s,publicPath:n,outputPath:a}),g=f.getFrameworkConfig(r,t),h=f.generateFederationConfig({exposes:u,env:t,libraryName:s});return(0,_p.default)(p,g,h)}var Sp=m(require("path")),ll=require("memfs/lib/volume"),cl=m(require("webpack-merge")),Tp=m(require("webpack-node-externals")),ze=require("@webflow/data-types");var Tw=m(require("fs")),en=require("path"),tn=require("webpack");function Aw(t,e=Tw){let r=(0,en.join)(process.cwd(),"node_modules",t);for(;r!==(0,en.dirname)(r)&&r!=="node_modules";){let n=(0,en.join)(r,"package.json");if(e.existsSync(n))try{let{name:o,version:i}=JSON.parse(e.readFileSync(n,"utf8"));return`${o}@${i}`}catch{return null}r=(0,en.dirname)(r)}return null}var Ci=class{apply(e){e.hooks.compilation.tap("ProcessSourceMapsPlugin",function(r){r.hooks.processAssets.tap({name:"ProcessSourceMapsPlugin",stage:tn.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_INLINE},function(){try{let n=r.getAssets(),o={};Object.values(n).forEach(({name:i,source:s})=>{if(!i.endsWith(".map"))return;let[a,l,u]=i.split("."),f=o[a]?.sources??{},p=o[a]?.dependencies??new Set;JSON.parse(s.source().toString()).sources.forEach(h=>{if(h.startsWith("external")){let w=h.match(/^external \S+ "(.+)"$/)?.[1];if(!w)throw new Error(`Could not extract package name from ${h}`);let F=Aw(w,r.inputFileSystem);if(!F)throw new Error(`Could not find package information for ${w}`);F&&p.add(F)}}),o[a]={sources:{...f,[`./${a}.${u}`]:l},dependencies:p},r.deleteAsset(i)}),Object.entries(o).forEach(([i,{sources:s,dependencies:a}])=>{r.emitAsset(`${i}.js.map`,new tn.sources.RawSource(JSON.stringify({sources:s,dependencies:[...a]})))})}catch(n){r.errors.push(new tn.WebpackError(`[ProcessSourceMapsPlugin] Could not process source maps: ${n instanceof Error?n.stack:String(n)}`))}})})}};var Fp=m(require("module")),kp=require("jsdom"),al="__webflowCliImportModuleWindow__";function Ow(t){let r=/^(?:\ufeff?\s*)(?:'use strict'|"use strict");?\s*(?:\r?\n|\r)?/.exec(t),n=!!r,o=`module[${JSON.stringify(al)}]`,i=[];n||i.push('"use strict";'),i.push(`var __wfW = ${o};`,'if (__wfW == null) { throw new ReferenceError("Webflow CLI internal: missing JSDOM window on module"); }',"var window = __wfW;","var document = __wfW.document;","var navigator = __wfW.navigator;","var HTMLElement = __wfW.HTMLElement;","var localStorage = __wfW.localStorage;","var sessionStorage = __wfW.sessionStorage;","var requestAnimationFrame = __wfW.requestAnimationFrame.bind(__wfW);","var cancelAnimationFrame = __wfW.cancelAnimationFrame.bind(__wfW);","var getComputedStyle = __wfW.getComputedStyle.bind(__wfW);","var performance = __wfW.performance;","");let s=i.join(`
|
|
54
|
+
export default { ${[i,s,a].filter(Boolean).join(", ")} };`}function jd(e,t,r){let n={},o=`${pt}/Client.js`,i=`${pt}/Server.js`;n[o]=Rd([{name:"ClientRenderer",path:e.client,exportKey:"Renderer",type:"internal"}],oo.Environment.Client);let s={},a=c=>{let f=Fw(c);return s[f]?(s[f]+=1,`${f}${s[f]}`):(s[f]=1,f)};n[i]=Rd([{name:"ServerRenderer",path:e.server,exportKey:"Renderer",type:"internal"},...Object.entries(t).filter(([c])=>r[c]?.ssr??!0).map(([c,f])=>{let p=a(c),m=f.startsWith(pt)?f.replace(`${pt}/`,"./"):f;return{name:p,path:m,exportKey:c,isDefaultExport:!0,type:"component"}})],oo.Environment.Server);let l={[oo.Environment.Client]:o,[oo.Environment.Server]:i};return{entryPointsVolume:Pd.Volume.fromJSON(n),paths:l}}var Cp=require("memfs/lib/volume");var Wd=g(require("archiver")),Yr=require("path");oe();var io=require("@webflow/data-types");oe();x();var Ht=e=>e.endsWith("/")||/%2F$/i.test(e)?e:`${e}/`;var Nd=2;function Bd(e){let t={type:io.ModuleLoader.FEDERATION,version:Nd,entry:la,renderer:Ln,components:e};return{title:Mn,content:JSON.stringify(t)}}function Md(e){let t={type:io.ModuleLoader.SSR,version:Nd,entry:Gr,components:e};return{title:Mn,content:JSON.stringify(t)}}function Ld(e){let t=`/${io.Environment.Client}/${la}`;try{if(e.existsSync(t)){let r=e.readFileSync(t,"utf8"),n=JSON.parse(r.toString()),o="publicPath"in n.metaData?n.metaData.publicPath:null;if(!o)throw new Error("Public path not found in module federation manifest");return n.exposes.reduce((i,s)=>{let a=s.name;return a===Ln||(i[a]={css:[]},s.assets.css.sync.forEach(l=>{i[a].css.push(`${Ht(o)}${l}`)})),i},{})}}catch(r){u.error(r,{prefix:"Failed to extract components metadata from MF manifest:"})}return{}}var wi=require("@webflow/data-types"),xw=/\.css$/i;async function Ud(e,t,r){let n=!1;return new Promise(async(o,i)=>{e.length===0&&i(new Error("No assets to bundle"));let s=`/${wi.Environment.Server}/${Wn}`,a=(0,Wd.default)("tar",{gzip:!1}),l=t.createWriteStream(s);a.on("error",p=>(n=!0,i(p))),l.on("close",()=>{if(!n)try{let p={type:"asset",name:Wn,info:{},size:a.pointer(),emitted:!0,comparedForEmit:!1,cached:!1};return e.forEach(m=>{let h=(0,Yr.resolve)((0,Yr.join)(`/${wi.Environment.Server}`,m.name));t.existsSync(h)&&t.rmSync(h)}),o([p])}catch(p){return i(p)}finally{n=!0}}),a.pipe(l);let{title:c,content:f}=Md(r);a.append(f,{name:c}),e.forEach(p=>{if(!xw.test(p.name))try{let m=(0,Yr.resolve)((0,Yr.join)(`/${wi.Environment.Server}`,p.name)),h=t.readFileSync(m,"utf8");a.append(h,{name:p.name})}catch(m){return n=!0,i(m)}}),await a.finalize()})}var Vd=require("@webflow/data-types");async function Hd(e,t,r){let{title:n,content:o}=Bd(r);await t.promises.writeFile(`/${Vd.Environment.Client}/${n}`,o);let i={type:"asset",name:n,info:{},size:o.length,emitted:!0,comparedForEmit:!1,cached:!1};return e.filter(s=>s.name!=="mf-stats.json").concat([i])}var hp=require("@rspack/core"),yp=g(require("fork-ts-checker-webpack-plugin")),wp=require("ts-checker-rspack-plugin"),Dp=g(require("mini-css-extract-plugin")),bp=require("@webflow/data-types");var Gd=require("webpack"),il=g(require("mini-css-extract-plugin")),zd=g(require("tsconfig-paths-webpack-plugin")),qd=require("tsconfig-paths"),sl=require("@webflow/data-types"),Kd=require("path");oe();var Jd=g(require("postcss-selector-parser")),ol=()=>({postcssPlugin:"CSSinShadowDOM",Once(e){e.walkRules(t=>{t.selector=(0,Jd.default)(r=>{r.walkPseudos(n=>{n.value===":root"&&(n.value=":host")})}).processSync(t.selector)})}});ol.postcss=!0;ol.postcssPlugin="CSSinShadowDOM";var Di=ol;function Cw(){return(0,qd.loadConfig)(process.cwd()).resultType==="success"}function Zd({entry:e,env:t,mode:r="production",publicPath:n,libraryName:o,outputPath:i}){let s={mode:r,module:{rules:[{test:/\.css$/i,use:[{ident:"mini-css-extract-loader",loader:il.default.loader},{ident:"css-loader",loader:require.resolve("css-loader"),options:{importLoaders:1}},{ident:"postcss-loader",loader:require.resolve("postcss-loader"),options:{postcssOptions:{plugins:[Di]}}}]},{test:/\.(png|svg|jpg|jpeg|gif|woff|woff2|eot|ttf|otf)$/i,type:"asset/resource",generator:{filename:"[hash]-[name][ext]"}}]},plugins:[new il.default({filename:"[contenthash].css",chunkFilename:"[contenthash].css",runtime:!1})],resolve:{plugins:[Cw()?new zd.default:null].filter(Boolean)},performance:{hints:!1}};if(t===sl.Environment.Client)return{...s,entry:()=>({}),output:{path:i?(0,Kd.join)(process.cwd(),i,t):"/",publicPath:n,clean:!0,uniqueName:o},target:"web"};if(t===sl.Environment.Server)return{...s,plugins:[...s.plugins||[],new Gd.optimize.LimitChunkCountPlugin({maxChunks:1})],entry:e,output:{filename:Gr,library:{type:"commonjs2"}},optimization:{splitChunks:!1},target:"async-node"};throw new Error(`Unknown environment ${t}`)}var Yd=require("@module-federation/enhanced"),al=require("@webflow/data-types");function Xd({libraryName:e,env:t,exposes:r}){if(t===al.Environment.Client)return{plugins:[new Yd.ModuleFederationPlugin({name:e,filename:"remoteEntry.js",exposes:r,dts:!1,experiments:{optimization:{disableSnapshot:!0}}})]};if(t===al.Environment.Server)return{};throw new Error(`Unknown environment ${t}`)}function Qd(){return{module:{rules:[{test:/\.(js|ts)x?$/,exclude:/node_modules/,use:[{ident:"babel-loader",loader:require.resolve("babel-loader"),options:{presets:[require.resolve("@babel/preset-env"),[require.resolve("@babel/preset-react"),{runtime:"automatic"}],require.resolve("@babel/preset-typescript")]}}]}]},resolve:{extensions:[".tsx",".ts",".jsx",".js",".json"]}}}function bi(){return{module:{rules:[{test:/\.(js|ts)x?$/,exclude:/node_modules/,loader:"builtin:swc-loader",options:{jsc:{parser:{syntax:"typescript",tsx:!0},transform:{react:{runtime:"automatic",development:!1,refresh:!1}}}}}]},resolve:{extensions:[".tsx",".ts",".jsx",".js",".json"]}}}var vi=require("@rspack/core"),ep=require("tsconfig-paths"),ll=require("@webflow/data-types"),tp=require("path");oe();function _w(){let e=(0,ep.loadConfig)(process.cwd());if(e.resultType==="success")return e.configFileAbsolutePath}function rp({entry:e,env:t,mode:r="production",publicPath:n,libraryName:o,outputPath:i}){let s={mode:r,module:{rules:[{test:/\.css$/i,use:[{ident:"mini-css-extract-loader",loader:vi.rspack.CssExtractRspackPlugin.loader},{ident:"css-loader",loader:require.resolve("css-loader"),options:{importLoaders:1}},{ident:"postcss-loader",loader:require.resolve("postcss-loader"),options:{postcssOptions:{plugins:[Di]}}}],type:"javascript/auto"},{test:/\.(png|svg|jpg|jpeg|gif|woff|woff2|eot|ttf|otf)$/i,type:"asset/resource",generator:{filename:"[hash]-[name][ext]"}}]},plugins:[new vi.rspack.CssExtractRspackPlugin({filename:"[contenthash].css",chunkFilename:"[contenthash].css",runtime:!1})],resolve:(()=>{let a=_w();return a?{tsConfig:{configFile:a}}:{}})(),performance:{hints:!1}};if(t===ll.Environment.Client)return{...s,entry:()=>({}),output:{path:i?(0,tp.join)(process.cwd(),i,t):"/",publicPath:n,clean:!0,uniqueName:o},target:"web"};if(t===ll.Environment.Server)return{...s,plugins:[...Array.isArray(s.plugins)?s.plugins:[],new vi.rspack.optimize.LimitChunkCountPlugin({maxChunks:1})],entry:e,output:{filename:Gr,library:{type:"commonjs2"}},optimization:{splitChunks:!1},target:"async-node"};throw new Error(`Unknown environment ${t}`)}var np=require("@module-federation/enhanced/rspack"),ul=require("@webflow/data-types");function op({libraryName:e,env:t,exposes:r}){if(t===ul.Environment.Client)return{plugins:[new np.ModuleFederationPlugin({name:e,filename:"remoteEntry.js",exposes:r,dts:!1,experiments:{optimization:{disableSnapshot:!0}}})]};if(t===ul.Environment.Server)return{};throw new Error(`Unknown environment ${t}`)}var Sw=g(require("fs")),ip=require("unionfs"),sp=require("webpack");function kw(e){return{name:e.name,size:e.size,emitted:e.emitted,info:e.info}}function Ei(e){let t=e.toJson();return{hasErrors:()=>e.hasErrors(),hasWarnings:()=>e.hasWarnings(),toString:r=>e.toString(r),toJson:()=>({...t,assets:(t.assets??[]).map(kw)})}}async function ap({config:e,sourceVolumes:t=[],outputVolume:r,outputPath:n,failOnWarnings:o=!0}){let i=t.reduce((s,a)=>(s.use(a),s),new ip.Union().use(Sw));return new Promise((s,a)=>{let l=(0,sp.webpack)(e);l.inputFileSystem=i,r&&(l.outputFileSystem=r),n&&(l.outputPath=n),l.run((c,f)=>{l.close(p=>{c||p?a(c||p):f?f.hasErrors()||o&&f.hasWarnings()?a(new Error(f.toString("errors-warnings"))):s(Ei(f)):a(new Error("Webpack stats are undefined"))})})})}var Tw=g(require("fs")),cl=g(require("webpack-merge")),lp=require("memfs"),up=require("unionfs"),cp=require("@rspack/core");async function Fi({config:e,sourceVolumes:t=[],outputVolume:r,outputPath:n,failOnWarnings:o=!0}){let i=t.reduce((a,l)=>(a.use(l),a),new up.Union().use(Tw)),s=e;return t.length>0&&(s=(0,cl.default)(s,{experiments:{...e.experiments,useInputFileSystem:[/./]}})),r&&(s=(0,cl.default)(s,{output:{clean:!1,...n&&{path:n}}})),new Promise((a,l)=>{let c=(0,cp.rspack)(s);c.inputFileSystem=i,r&&(c.outputFileSystem=(0,lp.createFsFromVolume)(r)),n&&(c.outputPath=n),c.run((f,p)=>{c.close(m=>{f||m?l(f||m):p?p.hasErrors()||o&&p.hasWarnings()?l(new Error(p.toString("errors-warnings"))):a(Ei(p)):l(new Error("Rspack stats are undefined"))})})})}var dp=require("@module-federation/enhanced");var Xr=g(require("webpack-merge"));x();function Jt(e){return e!==null&&typeof e=="object"&&"constructor"in e?e.constructor.name??"":""}function fp(e,t){let r=Object.entries(e).filter(([n])=>!t.includes(n));return Object.fromEntries(r)}function Ci(e){let{deduplicatePluginNames:t,ModuleFederationPluginClass:r,getPluginOptions:n,filterOverridePlugins:o}=e;return function(s,a,l){let c=["entry","output","target"],f=Aw(s),p=Array.isArray(l)?xi(...l.map(f)):xi(f(l));Object.keys(p).some(j=>c.includes(j))&&u.warn(`Cannot override blocked properties: ${c.join(", ")}`);let h={...fp(p,[...c,"ModuleFederationPlugin","module","plugins"]),module:fp(p.module??{},["rules"])},w=(0,Xr.default)(a,h),k=p.plugins??[];o&&(k=k.filter(o));let P=a.plugins??[],le=(0,Xr.mergeWithCustomize)({customizeArray:(0,Xr.unique)("plugins",t,j=>Jt(j))})({plugins:k},{plugins:P}).plugins,D=p?.ModuleFederationPlugin?.shared,K=le?.map(j=>{if(Jt(j)==="ModuleFederationPlugin"){let N=n(j);return new r({...N,...D?{shared:D}:{}})}return j});w.plugins=K;let Z=p.module?.rules;if(Z&&typeof Z=="function"){let j=a.module?.rules??[];w.module={...w.module??{},rules:Z(j)}}return w}}function xi(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={};for(let r of e){let{module:n,ModuleFederationPlugin:o,plugins:i,...s}=r;if(t={...t,...s},n){let{rules:a,...l}=n;if(t.module={...t.module,...l},a){let c=t.module?.rules;c?t.module.rules=f=>{let p=c(f);return a(p)}:t.module.rules=a}}o?.shared&&(t.ModuleFederationPlugin={shared:{...t.ModuleFederationPlugin?.shared,...o.shared}}),i&&(t.plugins=[...t.plugins??[],...i])}return t}function Aw(e){return t=>typeof t=="function"?t(e):t}var Ow=Ci({deduplicatePluginNames:["ModuleFederationPlugin","MiniCssExtractPlugin"],ModuleFederationPluginClass:dp.ModuleFederationPlugin,getPluginOptions:e=>e._options??{}});function pp(e,t,r){return Ow(e,t,r)}var mp=require("@module-federation/enhanced/rspack");var Iw=Ci({deduplicatePluginNames:["ModuleFederationPlugin","CssExtractRspackPlugin"],ModuleFederationPluginClass:mp.ModuleFederationPlugin,getPluginOptions:e=>e._options??{},filterOverridePlugins:e=>Jt(e)!=="MiniCssExtractPlugin"});function gp(e,t,r){return Iw(e,t,r)}var fl={[bp.Framework.React]:{generateWebpackBundlerConfig:Qd,generateRspackBundlerConfig:bi}},$w={webpack:{generateBaseConfig:Zd,getFrameworkConfig:(e,t)=>fl[e].generateWebpackBundlerConfig(t),generateFederationConfig:Xd,mergeConfigs:(e,t,r)=>pp(e,t,r),bundle:e=>ap({...e,config:e.config}),typeCheckerPlugin:yp.default,hashFunction:"md5",replaceCssPlugin:e=>({...e,plugins:e.plugins?.map(t=>Jt(t)==="MiniCssExtractPlugin"?new Dp.default({filename:"[name].[contenthash].css"}):t)})},rspack:{generateBaseConfig:rp,getFrameworkConfig:(e,t)=>fl[e].generateRspackBundlerConfig(t),generateFederationConfig:op,mergeConfigs:(e,t,r)=>gp(e,t,r),bundle:e=>Fi({...e,config:e.config}),typeCheckerPlugin:wp.TsCheckerRspackPlugin,hashFunction:"md4",replaceCssPlugin:e=>({...e,plugins:e.plugins?.map(t=>Jt(t)==="CssExtractRspackPlugin"?new hp.CssExtractRspackPlugin({filename:"[name].[contenthash].css"}):t)})}},Qr=e=>$w[e],vp=e=>!!fl[e];var Ep={colors:!0,chunks:!1,modules:!1,chunkModules:!1,reasons:!1,errorDetails:!1,assetsSpace:1/0,warnings:!1,assets:!0,entrypoints:!0,performance:!0};async function _i(e){let t=e.bundler??"webpack";u.debug("Generating entry points...");let{entryPointsVolume:r,paths:n}=jd(e.renderer,e.componentsFiles,e.componentsOptions),o=Cp.Volume.fromJSON({"/Server":null,"/Client":null});u.debug("Generating bundling config...");let i=e.overrideConfig??{};Object.keys(i).length&&u.debug("Found bundle config overrides. Merging...");let s=Qr(t),a=P=>{let V=Rw({env:P,mode:e.dev?"development":"production",framework:e.framework,publicPath:e.publicPath,components:e.componentsFiles,entryPaths:n,libraryName:e.libraryIdentifier,bundler:t}),le=s.mergeConfigs(P,V,i);return e?.debugBundler&&(u.info(`${t} config for env ${P}:`),u.dir(le)),le},l={sourceVolumes:[...e.sourceVolumes,r],outputVolume:o,failOnWarnings:e.failOnWarnings},[c,f]=await Promise.all([s.bundle({...l,config:a(mr.Environment.Server),outputPath:`/${mr.Environment.Server}`}),s.bundle({...l,config:a(mr.Environment.Client),outputPath:`/${mr.Environment.Client}`})]);e?.debugBundler&&(u.debug(o.toTree()),u.debug(`Server Bundler Stats: ${c.toString(Ep)}`),u.debug(`Client Bundler Stats: ${f.toString(Ep)}`));let p=Ld(o);u.debug("Packaging server bundle...");let m=await Ud(c.toJson().assets||[],o,p);u.debug("Packaging client bundle...");let h=await Hd(f.toJson().assets||[],o,p),w=P=>V=>[V,P];return{outputFiles:[...m.map(w(mr.Environment.Server)),...h.map(w(mr.Environment.Client))],outputVolume:o}}function Rw({env:e,mode:t="production",framework:r,publicPath:n,components:o,entryPaths:i,libraryName:s,outputPath:a,bundler:l="webpack"}){if(!vp(r))throw new Error(`Unknown framework: ${r}`);let c=Object.entries({[Ln]:i[e],...o}).reduce((w,[k,P])=>({...w,[`./${k}`]:`./${(0,Fp.relative)(process.cwd(),P)}`}),{}),f=Qr(l),p=f.generateBaseConfig({entry:i[e],env:e,mode:t,libraryName:s,publicPath:n,outputPath:a}),m=f.getFrameworkConfig(r,e),h=f.generateFederationConfig({exposes:c,env:e,libraryName:s});return(0,xp.default)(p,m,h)}var Sp=g(require("path")),pl=require("memfs/lib/volume"),ml=g(require("webpack-merge")),Tp=g(require("webpack-node-externals")),ze=require("@webflow/data-types");var Pw=g(require("fs")),en=require("path"),tn=require("webpack");function jw(e,t=Pw){let r=(0,en.join)(process.cwd(),"node_modules",e);for(;r!==(0,en.dirname)(r)&&r!=="node_modules";){let n=(0,en.join)(r,"package.json");if(t.existsSync(n))try{let{name:o,version:i}=JSON.parse(t.readFileSync(n,"utf8"));return`${o}@${i}`}catch{return null}r=(0,en.dirname)(r)}return null}var ki=class{apply(t){t.hooks.compilation.tap("ProcessSourceMapsPlugin",function(r){r.hooks.processAssets.tap({name:"ProcessSourceMapsPlugin",stage:tn.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_INLINE},function(){try{let n=r.getAssets(),o={};Object.values(n).forEach(({name:i,source:s})=>{if(!i.endsWith(".map"))return;let[a,l,c]=i.split("."),f=o[a]?.sources??{},p=o[a]?.dependencies??new Set;JSON.parse(s.source().toString()).sources.forEach(h=>{if(h.startsWith("external")){let w=h.match(/^external \S+ "(.+)"$/)?.[1];if(!w)throw new Error(`Could not extract package name from ${h}`);let k=jw(w,r.inputFileSystem);if(!k)throw new Error(`Could not find package information for ${w}`);k&&p.add(k)}}),o[a]={sources:{...f,[`./${a}.${c}`]:l},dependencies:p},r.deleteAsset(i)}),Object.entries(o).forEach(([i,{sources:s,dependencies:a}])=>{r.emitAsset(`${i}.js.map`,new tn.sources.RawSource(JSON.stringify({sources:s,dependencies:[...a]})))})}catch(n){r.errors.push(new tn.WebpackError(`[ProcessSourceMapsPlugin] Could not process source maps: ${n instanceof Error?n.stack:String(n)}`))}})})}};var _p=g(require("module")),kp=require("jsdom"),dl="__webflowCliImportModuleWindow__";function Nw(e){let r=/^(?:\ufeff?\s*)(?:'use strict'|"use strict");?\s*(?:\r?\n|\r)?/.exec(e),n=!!r,o=`module[${JSON.stringify(dl)}]`,i=[];n||i.push('"use strict";'),i.push(`var __wfW = ${o};`,'if (__wfW == null) { throw new ReferenceError("Webflow CLI internal: missing JSDOM window on module"); }',"var window = __wfW;","var document = __wfW.document;","var navigator = __wfW.navigator;","var HTMLElement = __wfW.HTMLElement;","var localStorage = __wfW.localStorage;","var sessionStorage = __wfW.sessionStorage;","var requestAnimationFrame = __wfW.requestAnimationFrame.bind(__wfW);","var cancelAnimationFrame = __wfW.cancelAnimationFrame.bind(__wfW);","var getComputedStyle = __wfW.getComputedStyle.bind(__wfW);","var performance = __wfW.performance;","");let s=i.join(`
|
|
55
55
|
`)+`
|
|
56
|
-
`;return r?
|
|
57
|
-
`)}function
|
|
58
|
-
`)}async function Rp({libraryConfig:
|
|
56
|
+
`;return r?e.slice(0,r[0].length)+s+e.slice(r[0].length):s+e}function so(e,t){let r=e.readFileSync(t,"utf-8"),o=new kp.JSDOM("<!DOCTYPE html><html><body></body></html>",{url:"http://localhost/",pretendToBeVisual:!0}).window,i=Nw(r),s=new _p.default(t,module);Object.defineProperty(s,dl,{value:o,enumerable:!1,configurable:!0,writable:!1});try{return s._compile(i,t),s}finally{Reflect.deleteProperty(s,dl),o.close()}}function Bw(e,t){let r=`/${t}.js`,n=so(e,r),o=n.exports.default||n.exports;if(o&&typeof o=="object")try{return(0,ze.parseComponentMetadata)(o)}catch(i){let s=i instanceof Error?i.stack:String(i);throw new Error(`Error parsing component data for '${t}': ${s}`)}throw new Error(`Could not get declaration for '${t}'`)}async function Mw({declarations:e,sources:t,overrideConfig:r={},performTypeCheck:n,bundler:o="webpack"}){let i=new pl.Volume,s=Qr(o),a=(0,ml.default)(s.generateBaseConfig({entry:e,env:ze.Environment.Client,publicPath:"/",libraryName:"metadata"}),s.getFrameworkConfig(ze.Framework.React,ze.Environment.Client),{entry:e,mode:"development",output:{path:"/",library:{type:"commonjs2"}},target:"node",plugins:n?[new s.typeCheckerPlugin]:[]}),l=s.mergeConfigs(ze.Environment.Client,a,r);return await s.bundle({outputPath:"/",config:l,sourceVolumes:t?[t]:[],outputVolume:i,failOnWarnings:!1}),i}async function Lw({declarations:e,sources:t,overrideConfig:r={},bundler:n}){let o=new pl.Volume,i=Qr(n),s=(0,ml.default)(i.generateBaseConfig({entry:e,env:ze.Environment.Client,publicPath:"/",libraryName:"source-maps"}),i.getFrameworkConfig(ze.Framework.React,ze.Environment.Client),{entry:e,mode:"production",optimization:{mangleExports:"deterministic",moduleIds:"deterministic",chunkIds:"deterministic"},output:{filename:"[name].[contenthash].js",path:"/",library:{type:"commonjs2"},devtoolModuleFilenameTemplate:"[resource-path]",hashFunction:i.hashFunction},externalsPresets:{node:!0},devtool:"source-map",plugins:[new ki],externals:[(0,Tp.default)()]}),a=i.mergeConfigs(ze.Environment.Client,s,r);return a=i.replaceCssPlugin(a),await i.bundle({outputPath:"/",config:a,sourceVolumes:t?[t]:[],outputVolume:o,failOnWarnings:!1}),o}function Ww(e){return Object.entries(e.toJSON()).reduce((t,[r,n])=>{if(r.endsWith(".map")&&n?.length){let o=Sp.default.basename(r).split(".")[0];t[o]=n}return t},{})}async function Si({declarations:e,sources:t,overrideConfig:r,performTypeCheck:n=!1,skipSourceMaps:o=!1,bundler:i="webpack"}){let[s,a]=await Promise.all([Mw({declarations:e,sources:t,overrideConfig:r,performTypeCheck:n,bundler:i}),o||i==="rspack"?Promise.resolve(null):Lw({declarations:e,sources:t,overrideConfig:r,bundler:i})]),{metadata:l,options:c}=Object.keys(e).reduce((p,m)=>{let h=Bw(s,m);return p.metadata[m]=h,p.options[m]=h.options||{},p},{metadata:{},options:{}});return{sourceMaps:a?Ww(a):{},metadata:l,options:c}}function Ap(e,{framework:t,sourceMaps:r}){return Object.fromEntries(Object.keys(e).map(n=>[n,{...e[n],id:n,framework:t,exportPath:"default",hash:r[n]}]))}Be();var Ip=g(require("md5"));_e();ce();H();var gl=" ",$p=`${gl}${Uo} `;function Uw(e){return e==="added"?` ${B("(Added)")}`:e==="removed"?` ${ne("(Removed)")}`:e==="changed"?` ${ue("(Changed)")}`:""}function Op(e){if(!e)return"";let t=JSON.parse(e);return(0,Ip.default)(JSON.stringify([...Object.values(t.sources),...t.dependencies.filter(r=>!r.includes("@webflow/data-types")&&!r.includes("@webflow/react"))].sort()))}function Vw({componentsMetadata:e,latestVersion:t,sourceMaps:r}){let n=t.resource.codeLibraryResource.manifest.components.reduce((s,a)=>(s[a.id]=a,s),{}),o={};return Object.entries(n).forEach(([s,a])=>{if(!e[s])o[s]={component:a,status:"removed"};else{let l=e[s],c=Op(r[s]),f=a.displayName&&l.displayName!==a.displayName,p=c&&a.hash&&c!==Op(a.hash),m=f||p;o[s]={component:l,status:m?"changed":"unchanged",previousName:f?a.displayName:void 0}}}),Object.entries(e).forEach(([s,a])=>{n[s]||(o[s]={component:a,status:"added"})}),Object.values(o).map(({component:s,status:a,previousName:l})=>{let c=s.displayName??"Unknown Component",f=l?`${l} ${He} ${c}`:c;return`${S(`${$p}${f}`)}${Uw(a)}`}).sort().join(`
|
|
57
|
+
`)}function Hw({componentsMetadata:e}){return Object.values(e).map(r=>`${S($p+(r.displayName??"Unknown Component"))}`).sort().join(`
|
|
58
|
+
`)}async function Rp({libraryConfig:e,componentsMetadata:t,existingCodeLibraries:r,sourceMaps:n,workspaceInfo:o}){if(te())return Promise.resolve(!0);let i=e.id?r.find(({profile:f})=>f.slug===e.id):null,s=i&&i.profile.status==="ACTIVE",a=s?Vw({componentsMetadata:t,latestVersion:i,sourceMaps:n}):Hw({componentsMetadata:t}),l=s?`Ready to update ${ue(e.name)} on ${gs(o.name)}?`:`Ready to share ${ue(e.name)} with ${gs(o.name)}?`;return await Te({message:`${l}
|
|
59
59
|
|
|
60
|
-
${
|
|
60
|
+
${gl}${S("Code components:")}
|
|
61
61
|
${a}
|
|
62
62
|
|
|
63
|
-
${
|
|
64
|
-
import { applyDecorators } from "${
|
|
65
|
-
import componentDefinition from "${
|
|
63
|
+
${gl}Confirm to proceed`})}var Ti=require("path"),Np=require("memfs/lib/volume");var Pp=g(require("fast-glob")),Jw=e=>{let t=e.split("/");return t[t.length-1]},Gw=e=>Jw(e).split(".")[0];async function jp(e,t){return(await Pp.default.glob(e,{absolute:!0,...t||{}})).reduce((n,o)=>{let i=Gw(o);if(n[i])throw new Error(`Duplicate component '${i}' found. Already declared at ${n[i]}, but also found at ${o}.`);return{...n,[i]:o}},{})}async function Ai(e){let t=await jp(e.components,{cwd:(0,Ti.dirname)(e.manifestPath),ignore:["**/dist/**","**/node_modules/**",e.globals,e.bundleConfig].filter(o=>o!=null)});if(!Object.keys(t).length)throw new Error("No declaration files found");let{componentsFiles:r,componentsVolume:n}=zw(t,e.renderer.client,e.globals);return{componentsFiles:r,componentsVolume:n}}function zw(e,t,r){let n={},o={};return Object.entries(e).forEach(([i,s])=>{let a=(0,Ti.extname)(s),l=`${pt}/${$d}/${i}${a}`;n[i]=l,o[l]=qw(t,s,r)}),{componentsFiles:n,componentsVolume:Np.Volume.fromJSON(o)}}function qw(e,t,r){return r?`
|
|
64
|
+
import { applyDecorators } from "${e}";
|
|
65
|
+
import componentDefinition from "${t}";
|
|
66
66
|
const globals = require("${r}") || {};
|
|
67
67
|
|
|
68
68
|
const globalDecorators = globals?.decorators || [];
|
|
@@ -80,52 +80,52 @@ if (componentDefinition?.component) {
|
|
|
80
80
|
|
|
81
81
|
export default decoratedDefinition;
|
|
82
82
|
`.trim():`
|
|
83
|
-
import componentDefinition from "${
|
|
83
|
+
import componentDefinition from "${t}";
|
|
84
84
|
export default {...componentDefinition};
|
|
85
|
-
`.trim()}re();
|
|
85
|
+
`.trim()}re();fi();var Bp=require("@webflow/data-types"),Oi={renderer:{client:"@webflow/react",server:"@webflow/react/server"},components:["**/*.webflow.@(js|jsx|mjs|ts|tsx)"],framework:Bp.Framework.React};var rn=require("path"),nn=require("fs");Be();x();we();function _t(e){return e.replace(/\\/g,"/")}_e();O();ce();H();function Mp(e){let t={...e};if(e.globals){let r=(0,rn.resolve)(process.cwd(),e.globals);if(!(0,nn.existsSync)(r))throw new Error(`Globals file not found: ${e.globals}
|
|
86
86
|
Resolved path: ${r}
|
|
87
|
-
Please ensure the file exists or remove the 'globals' field from your manifest.`);
|
|
87
|
+
Please ensure the file exists or remove the 'globals' field from your manifest.`);t.globals=_t(r)}if(e.bundleConfig){let r=(0,rn.resolve)(process.cwd(),e.bundleConfig);if(!(0,nn.existsSync)(r))throw new Error(`Bundle config file not found: ${e.bundleConfig}
|
|
88
88
|
Resolved path: ${r}
|
|
89
|
-
Please ensure the file exists or remove the 'bundleConfig' field from your manifest.`);
|
|
89
|
+
Please ensure the file exists or remove the 'bundleConfig' field from your manifest.`);t.bundleConfig=_t(r)}if(typeof e.renderer=="string"){let r=(0,rn.resolve)(process.cwd(),e.renderer);(0,nn.existsSync)(r)&&(t.renderer=_t(r))}else if(typeof e.renderer=="object"&&typeof t.renderer=="object"){if(typeof e.renderer.client=="string"){let r=(0,rn.resolve)(process.cwd(),e.renderer.client);(0,nn.existsSync)(r)&&(t.renderer={...t.renderer,client:_t(r)})}if(typeof e.renderer.server=="string"){let r=(0,rn.resolve)(process.cwd(),e.renderer.server);(0,nn.existsSync)(r)&&(t.renderer={...t.renderer,server:_t(r)})}}return t}async function Kw({initialData:e}){let t=await Ce({message:"Enter a name for your code library",validate:o=>o.trim()===""?"The library name cannot be empty.":!0,default:e?.name});if(t==null)throw new d("When --no-input mode is enabled please provide a name in your library manifest");let r=await Ce({message:"Enter a description for your code library",default:e?.description??""});if(!await Te({message:"Is the code (including 3rd party packages) you are uploading to Webflow trusted and secure?"}))throw new Error("Code library is not trusted and secure");return{name:t,description:r}}async function Zw({existingCodeLibraries:e}){let t={name:"[Create new code library]",value:null},n=[...e].sort((i,s)=>{let a=i.resource.codeLibraryResource.manifest.name??"",l=s.resource.codeLibraryResource.manifest.name??"",c=a.localeCompare(l,void 0,{sensitivity:"base"});return c!==0?c:i.profile.slug.localeCompare(s.profile.slug,void 0,{sensitivity:"base"})}).map(({resource:i,profile:s})=>{let a=`${i.codeLibraryResource.manifest.name} (${s.slug})`;s.status==="ARCHIVED"&&(a+=` ${ne("(Unshared)")}`);let l={id:s.slug,name:i.codeLibraryResource.manifest.name,description:i.codeLibraryResource.manifest.description};return{name:a,value:l}});return await zo({message:"Select an existing code library (or create new):",source:i=>{if(!i)return[t,...n];let s=i.toLowerCase(),a=n.filter(l=>{let c=l.value?.id??"",f=l.value?.name??"",p=l.value?.description??"";return c.toLowerCase().includes(s)||f.toLowerCase().includes(s)||p.toLowerCase().includes(s)});return[t,...a]},pageSize:15})}async function hl({initialData:e,existingCodeLibraries:t}){let r,n={components:Oi.components},o=t.length>0?await Zw({existingCodeLibraries:t}):null;if(o)r={...n,...o,...e,id:o.id};else{let a=await Kw({initialData:e});r={...n,...e,...a}}let i=Mp(r);ae({library:i}),u.info(`${A} Library configuration updated in webflow.json`);let{path:s}=ar();return{libraryManifest:i,manifestPath:s}}async function Lp({existingCodeLibraries:e}){let t=u.spinner("Looking for webflow.json manifest");try{let{manifest:r,manifestPath:n}=G(),o=jn(r,"library");if(!o.id){if(ut())return t.succeed(),hl({initialData:o,existingCodeLibraries:e});throw new Error("Library manifest does not have an id")}let i=o.name??e.find(({profile:a})=>a.slug===o.id)?.resource.codeLibraryResource.manifest.name;if(!i&&ut())return t.succeed(),hl({initialData:o,existingCodeLibraries:e});i||(i=o.id),t.succeed();let s=Mp({...o,name:i});return Promise.resolve({libraryManifest:s,manifestPath:n})}catch(r){if(r instanceof sr&&ut())return t.info(r.message),hl({existingCodeLibraries:e});throw t.fail(),r}}var yl=require("memfs/lib/volume"),Vp=g(require("webpack-merge"));var Hp="/client-renderer.js",Jp="/server-renderer.js",Wp=`${pt}/test-renderers${Hp}`,Up=`${pt}/test-renderers${Jp}`,Yw=new Set(["@webflow/react"]),Xw=new Set(["@webflow/react/server","@webflow/emotion-utils/server","@webflow/styled-components-utils/server"]);async function Gp(e){if(!e.client||!e.server)throw new Error("Invalid renderer configuration. Both client and server renderers must be specified.");if(Yw.has(e.client)&&Xw.has(e.server))return;let t=await tD(e);Qw(e.client,t),eD(e.server,t)}function Qw(e,t){let r=so(t,Hp);if(typeof r.exports.ClientRenderer!="function")throw new Error(`Invalid client renderer: ${e} does not have a valid 'ClientRenderer' export.`);if(typeof r.exports.applyDecorators!="function")throw new Error(`Invalid client renderer: ${e} does not have a valid 'applyDecorators' export.`);let n=()=>null,o=r.exports.ClientRenderer(n),i=["mount","hydrate","render","createSlot"];for(let s of i)if(typeof o[s]!="function")throw new Error(`Invalid client renderer: ${e} ClientRenderer must return an object with a '${s}' function.`)}function eD(e,t){let r=so(t,Jp);if(typeof r.exports.ServerRenderer!="function")throw new Error(`Invalid server renderer: ${e} does not have a valid 'ServerRenderer' export.`);let n=()=>null,o=r.exports.ServerRenderer(n),i=["renderToStream","renderToString","prerenderToString","createSlot"];for(let s of i)if(typeof o[s]!="function")throw new Error(`Invalid server renderer: ${e} ServerRenderer must return an object with a '${s}' function.`)}async function tD(e){let t=new yl.Volume,r=_t(e.client),n=_t(e.server),o={[Wp]:`
|
|
90
90
|
export * from "${r}";
|
|
91
91
|
`,[Up]:`
|
|
92
92
|
export * from "${n}";
|
|
93
|
-
`},i=(0,Vp.default)(
|
|
93
|
+
`},i=(0,Vp.default)(bi(),{entry:{"client-renderer":Wp,"server-renderer":Up},mode:"development",output:{path:"/",filename:"[name].js",library:{type:"commonjs2"}},target:"node"});return await Fi({config:i,sourceVolumes:[yl.Volume.fromJSON(o)],outputVolume:t,failOnWarnings:!1}),t}async function Ii({existingCodeLibraries:e}){let{libraryManifest:t,manifestPath:r}=await Lp({existingCodeLibraries:e}),{renderer:n,...o}=Oi,i=typeof t.renderer=="string"?{client:t.renderer,server:t.renderer}:{client:t.renderer?.client??n.client,server:t.renderer?.server??n.server};return i.server==="@webflow/react"&&(i.server="@webflow/react/server"),await Gp(i),{...o,...t,renderer:i,manifestPath:r}}O();H();async function rD(e,t){let{trackPerformance:r,libraryConfig:n}=e;return await r("collect_metadata",async()=>{let{componentsFiles:o,componentsVolume:i}=await Ai(n);u.debug(`Components: ${JSON.stringify(o,null,2)}`);let{sourceMaps:s,metadata:a,options:l}=await Si({declarations:o,sources:i,overrideConfig:e.overrideConfig,performTypeCheck:ci(o,t),bundler:t?.bundler});return u.debug(`Metadata: ${JSON.stringify(a,null,2)}`),u.debug(`Source Maps:
|
|
94
94
|
|
|
95
|
-
${Object.entries(s).reduce((
|
|
95
|
+
${Object.entries(s).reduce((c,[f,p])=>(c+=`${f}: ${JSON.stringify(JSON.parse(p),null,2)}
|
|
96
96
|
|
|
97
|
-
`,
|
|
97
|
+
`,c),"")}`),{componentsFiles:o,componentsVolume:i,componentsMetadata:a,componentsOptions:l,sourceMaps:s}})}async function nD(e,t,r,n,o,i,s){let{trackPerformance:a,libraryConfig:l}=e;return await a("generate_library_bundle",async()=>await _i({libraryIdentifier:`_${o}`,renderer:l.renderer,framework:l.framework,publicPath:Ht(i[on.Environment.Client]),sourceVolumes:[r],componentsFiles:t,componentsOptions:n,debugBundler:s?.debugBundler,dev:s?.dev,overrideConfig:e.overrideConfig,failOnWarnings:!s?.force,bundler:s?.bundler}))}async function oD(e,t,r,n){let{trackPerformance:o,apiOptions:i}=e;return await o("upload_files",async()=>{let s=t.map(([l,c])=>{let f=(0,$i.resolve)((0,$i.join)(`/${c}`,`${l.name}`));return ro(r.readFileSync(f,"utf8").toString(),f,{bundleEnvironment:c})}),{signatures:a}=await rl({resourceId:n,files:s.map(({meta:l})=>l),options:i});await Promise.all(a.map(async l=>{let c=s.find(f=>f.meta.fileHash===l.hash);if(!c)throw new Error(`File not found: ${l.hash}`);await no(c,l.value)}))})}async function iD(e,t,r,n,o){let{trackPerformance:i,libraryConfig:s,apiOptions:a}=e;return await i("share_library",async()=>{let l={clientModule:{bundleUrl:Ht(o[on.Environment.Client])+Mn,loaderType:on.ModuleLoader.FEDERATION},serverModule:{bundleUrl:Ht(o[on.Environment.Server])+Wn}},c=Ap(t,{framework:s.framework,sourceMaps:r}),{taskId:f}=await nl({resourceId:n,codeModule:l,components:Object.values(c),options:a});u.debug(JSON.stringify({taskId:f},null,2))})}async function wl(e){e?.verbose&&(process.env.DEBUG="true");let t,r=Date.now(),n=await I({apiToken:e?.apiToken});u.debug("Initializing telemetry service...");let o=T.forCodeLibraries({authToken:n}),i=ef(o);try{u.debug("Checking dependencies versions..."),new ur().run();let s={apiToken:n};t=u.spinner("Initializing");let a=await i("get_code_libraries",async()=>await el({options:s})),{workspace:l,libraries:c}=a;t.succeed(),u.debug("Parsing library config...");let f=await Ii({existingCodeLibraries:c}),p=f.bundleConfig?require(f.bundleConfig):{},m={trackPerformance:i,apiOptions:s,libraryConfig:f,overrideConfig:p};t=u.spinner("Collecting metadata");let{componentsFiles:h,componentsVolume:w,componentsMetadata:k,componentsOptions:P,sourceMaps:V}=await rD(m,e);if(t.succeed(),!await Rp({libraryConfig:f,componentsMetadata:k,existingCodeLibraries:c,sourceMaps:V,workspaceInfo:l}))return;t=u.spinner("Creating code library");let{resourceId:D,profileSlug:K,workspace:Z,s3Urls:j,cdnUrls:N}=await i("init_code_library",async()=>await tl({name:f.name,slug:f.id,description:f.description,options:s}));t.succeed(),u.debug(JSON.stringify({resourceId:D,profileSlug:K,s3Urls:j,cdnUrls:N},null,2)),await o.sendUsage("library_initialized",{libraryName:f.name,framework:f.framework,resourceId:D,profileSlug:K}),f.id||(ae({library:{id:K}}),u.info(`${A} Library ID updated in webflow.json`)),t=u.spinner("Compiling code components");let{outputFiles:Cn,outputVolume:cs}=await nD(m,h,w,P,D,N,e);t.succeed(),await o.sendUsage("bundle_generated",{libraryName:f.name,componentCount:Object.keys(h).length,resourceId:D,profileSlug:K}),t=u.spinner("Uploading files"),await oD(m,Cn,cs,D),t.succeed(),await o.sendUsage("files_uploaded",{libraryName:f.name,fileCount:Cn.length,resourceId:D,profileSlug:K}),t=u.spinner("Sharing library"),await iD(m,k,V,D,N),t.succeed(),u.success(`Code library shared successfully${Z?.slug?`: ${Jr}/dashboard/workspace/${Z?.slug}/shared-libraries-and-templates`:"!"}`);let fs=Date.now()-r;await o.sendUsage("share_library",{duration:fs,componentCount:Object.keys(h).length,libraryName:f.name,framework:f.framework,resourceId:D,profileSlug:K})}catch(s){t?.fail();let a=Date.now()-r;throw await o.sendError(s instanceof Error?s:new Error(String(s)),"share_library",{duration:a}),new d(s)}}var Ri=g(require("fs")),sn=require("path");x();fi();O();var sD="CodeLibrary",aD="dist",lD="http://localhost/";async function Dl(e){e.verbose&&(process.env.DEBUG="true");let t;try{u.debug("Checking dependencies versions..."),new ur().run(),u.debug("Looking for manifest...");let r=await Ii({existingCodeLibraries:[]}),n=yi(r.name)||sD,o=`_${e.libraryId||n}`;e?.debugBundler&&u.debug(`Library Config: ${JSON.stringify(r,null,2)}`),t=u.spinner("Collecting metadata");let{componentsFiles:i,componentsVolume:s}=await Ai(r);e?.debugBundler&&u.debug(`Components: ${JSON.stringify(i,null,2)}`);let a=r.bundleConfig?require(r.bundleConfig):{},{sourceMaps:l,metadata:c,options:f}=await Si({declarations:i,sources:s,overrideConfig:a,performTypeCheck:ci(i,e),skipSourceMaps:!e?.debugBundler,bundler:e.bundler});e?.debugBundler&&(u.debug(`Metadata: ${JSON.stringify(c,null,2)}`),u.debug(`Source Maps:
|
|
98
98
|
|
|
99
|
-
${Object.entries(l).reduce((h,[w,
|
|
99
|
+
${Object.entries(l).reduce((h,[w,k])=>(h+=`${w}: ${JSON.stringify(JSON.parse(k),null,2)}
|
|
100
100
|
|
|
101
|
-
`,h),"")}`)),
|
|
102
|
-
Use ${
|
|
103
|
-
`)},
|
|
104
|
-
Use ${
|
|
105
|
-
`)},
|
|
106
|
-
Use ${
|
|
107
|
-
`)},lD="Import a library of Code Components into your Webflow Workspace.",cD="Bundle a library of Code Components for local development.",qp=()=>new Gt.Option("-f, --force","Force the bundler to finish compiling, even if there are warnings or type errors."),Kp=()=>new Gt.Option("--debug-bundler","Display final bundler configurations for debugging purposes."),Zp=()=>new Gt.Option("--dev","Bundle in development mode for debugging purposes."),Yp=()=>new Gt.Option("--bundler <engine>","Bundler to use: webpack or rspack (experimental). Default: webpack").choices(["webpack","rspack"]).default("webpack").hideHelp(),uD=()=>new Gt.Option("--library-id <id>","Set the library identifier to use for the bundle.").hideHelp(),fD=()=>new Gt.Option("--public-path <path>","Set the public path for the bundle."),dD=()=>new Gt.Option("--output-path <path>","Override the output path for the bundle. Default is './dist'");function vl(t,e){return t.command(e).description(lD).addOption(lo()).addOption(qp()).addOption(Kp()).addOption(Zp()).addOption(Yp()).action(co(pl))}function El(t,e){return t.command(e).description(cD).addOption(uD()).addOption(fD()).addOption(dD()).addOption(qp()).addOption(Kp()).addOption(Zp()).addOption(Yp()).action(co(ml))}var Xp=t=>{let e=t.command("library").description(oD);vl(e,"share").description(`${ce("[Deprecated]")} Use 'webflow devlink import' instead.`).hook("preAction",iD),El(e,"bundle").description(`${ce("[Deprecated]")} Use 'webflow devlink bundle' instead.`).hook("preAction",sD),e.command("log").description(`${ce("[Deprecated]")} Use 'webflow log' instead.`).hook("preAction",aD).action(hl)};var Qp=t=>{let e=t.command("devlink").description("CLI for managing your Webflow Components.");e.command("sync").description("Sync your Webflow components to your filesystem.").argument("[components...]","A list of components to sync. If none is provided, all components will be synced.").addOption(lo()).addOption(Me()).action(cd),vl(e,"import"),El(e,"bundle"),e.command("export").description("Export Webflow Components from your Webflow Site.").addOption(lo()).addOption(Me()).action(co(pi))};var hg=m(require("path"));var St=m(require("fs")),Ke=m(require("path"));_();re();var he={New:"new",Existing:"existing"},em="cli",zt=3,qt=39,Ni="astro",tm="cloud-scaffolds";var rm="package.json",gr="webflow.json",Bi="wf-placeholder-name",nm="CLOUD_MOUNT_PATH",om="gitignore";function xl(t){return!t.siteId}var uo=async(t,e,r=Ni,n,o,i)=>{try{let s,a;if("content"in n){let l=n.content;s=l.files,a=u=>Ke.relative(l.extractionRoot,u).replace(/\\/g,"/")}else{let u=n[r];if(!u)throw new Error(`Scaffold "${r}" not found`);s=u;let f=Ke.join(tm,r);a=p=>p.split(f)[1]?.substring(1).replace(/\\/g,"/")??""}for(let l of s)try{let u=Ke.join(t,a(l)),f=l.includes("next.config.ts"),p=l.includes("astro.config.mjs"),g=f||p;if(l.includes(gr)&&St.existsSync(u))continue;if(l.includes(rm)||l.includes(gr)){let w=(await St.promises.readFile(l,"utf8")).replace(Bi,t);await Mi(u,w)}else if(g){let h=await St.promises.readFile(l,"utf8");await Mi(u,h.replace(nm,e))}else if(Ke.basename(u).toLowerCase()===om){let h=await St.promises.readFile(l,"utf8"),w=Ke.join(Ke.dirname(u),".gitignore");await Mi(w,h)}else{let h=await St.promises.readFile(l);await Mi(u,h)}}catch(u){c.error(`Error processing file ${l}: ${u}`)}if(o&&i)try{xt({siteId:o,apiToken:i,directory:t})}catch(l){c.error(`Error creating .env file: ${l}`)}}catch(s){throw c.error(`Error applying scaffold: ${s}`),s}};var Mi=async(t,e)=>{try{await St.promises.mkdir(Ke.dirname(t),{recursive:!0}),await St.promises.writeFile(t,e)}catch(r){throw c.error(`Error writing file ${t}: ${r}`),r}};var Kt=m(require("fs")),im=m(require("fs-extra")),Zt=m(require("path")),Sl=m(require("os")),sm=m(require("tar"));var be=class extends Error{constructor(r,n,o){super(r);this.scaffoldId=n;this.supportedIds=o;this.name="ScaffoldError"}};var fo={"astro-minimal":{id:"astro-minimal",name:"Astro",source:{type:"github",repo:"Webflow-Examples/hello-world-astro",ref:"v2"}},"nextjs-minimal":{id:"nextjs-minimal",name:"Next.js",source:{type:"github",repo:"Webflow-Examples/hello-world-nextjs",ref:"v1"}},astro:{id:"astro",name:"Astro (site-attached)",source:{type:"github",repo:"Webflow-Examples/hello-world-astro-devlink",ref:"v2"}},nextjs:{id:"nextjs",name:"Next.js (site-attached)",source:{type:"github",repo:"Webflow-Examples/hello-world-nextjs-devlink",ref:"v1"}}};function po(t){let e=fo[t];if(!e){let r=Object.keys(fo);throw new be(`Unsupported framework: "${t}". Supported: ${r.join(", ")}`,t,r)}return e}function _l(){return Object.keys(fo)}function Cl(){return[...new Set(_l().map(t=>t.replace(/-minimal$/,"")))]}function Fl(){return["astro","nextjs"]}function kl(t){let r=`${t.replace(/-minimal$/,"")}-minimal`;if(!fo[r]){let n=_l();throw new be(`No minimal scaffold for "${t}". Supported: ${n.join(", ")}`,r,n)}return r}_();var pD="https://github.com";async function Tl(t){let e=t.endsWith("-minimal")?t:kl(t);return Li(e)}async function Li(t){return po(t).source.type==="github"?mD(t):am(t)}async function am(t){let e=po(t);if(e.source.type!=="local")throw new be(`Scaffold "${t}" does not have a local source`,t);let r=Zt.isAbsolute(e.source.path)?e.source.path:Zt.join(__dirname,e.source.path);if(!Kt.existsSync(r))throw new be(`Scaffold directory not found: ${r}`,t);let n=await Al(r);return{scaffoldId:t,files:n,extractionRoot:r}}async function mD(t){let e=po(t);if(e.source.type!=="github")throw new be(`Scaffold "${t}" does not have a GitHub source`,t);let r=e.source.ref??"main",n=`${pD}/${e.source.repo}/archive/${r}.tar.gz`,o=await Kt.promises.mkdtemp(Zt.join(Sl.tmpdir(),`webflow-scaffold-${t}-`)),i=c.spinner(`Downloading scaffold (${e.source.repo}@${r})`);try{let s;try{s=await fetch(n,{redirect:"follow",headers:{"User-Agent":"webflow-cli"}})}catch(h){throw i.fail("Download failed"),new be(`Failed to fetch scaffold from GitHub: ${h instanceof Error?h.message:String(h)}. Repo: ${e.source.repo}, ref: ${r}`,t)}if(!s.ok)throw i.fail(`GitHub returned ${s.status} ${s.statusText}`),new be(`Failed to fetch scaffold from GitHub: ${s.status} ${s.statusText}. Repo: ${e.source.repo}, ref: ${r}`,t);let a=Buffer.from(await s.arrayBuffer());i.succeed("Downloaded scaffold");let l=c.spinner("Unpacking scaffold");try{await gD(a,o),l.succeed("Scaffold ready")}catch(h){throw l.fail("Unpack failed"),h}let u=await Kt.promises.readdir(o),f=u[0];if(!f||u.length!==1)throw new be(`Unexpected tarball structure for ${e.source.repo}`,t);let p=Zt.join(o,f),g=await Al(p);return{scaffoldId:t,files:g,extractionRoot:p}}catch(s){try{im.default.removeSync(o)}catch{}throw s instanceof be?s:new be(`Failed to fetch scaffold "${t}": ${s instanceof Error?s.message:String(s)}`,t)}}async function gD(t,e){let r=Zt.join(Sl.tmpdir(),`webflow-scaffold-${Date.now()}.tar.gz`);await Kt.promises.writeFile(r,new Uint8Array(t.buffer,t.byteOffset,t.byteLength));try{await sm.extract({file:r,cwd:e})}finally{await Kt.promises.unlink(r).catch(()=>{})}}async function Al(t){let e=[],r=await Kt.promises.readdir(t,{withFileTypes:!0});for(let n of r){let o=Zt.join(t,n.name);n.isDirectory()?e.push(...await Al(o)):e.push(o)}return e}var Kl=m(require("fs-extra"));re();ee();var W=m(require("fs")),Y=m(require("path")),Eo=require("child_process"),Wm=m(require("tar"));var _e=m(require("fs")),lt=m(require("path"));var L={};Ac(L,{BRAND:()=>WD,DIRTY:()=>hr,EMPTY_PATH:()=>DD,INVALID:()=>P,NEVER:()=>Cb,OK:()=>xe,ParseStatus:()=>ve,Schema:()=>J,ZodAny:()=>Qt,ZodArray:()=>It,ZodBigInt:()=>wr,ZodBoolean:()=>Dr,ZodBranded:()=>go,ZodCatch:()=>Ar,ZodDate:()=>br,ZodDefault:()=>Tr,ZodDiscriminatedUnion:()=>Vi,ZodEffects:()=>Xe,ZodEnum:()=>kr,ZodError:()=>Oe,ZodFirstPartyTypeKind:()=>N,ZodFunction:()=>Ji,ZodIntersection:()=>_r,ZodIssueCode:()=>y,ZodLazy:()=>Cr,ZodLiteral:()=>Fr,ZodMap:()=>dn,ZodNaN:()=>mn,ZodNativeEnum:()=>Sr,ZodNever:()=>st,ZodNull:()=>Er,ZodNullable:()=>ht,ZodNumber:()=>yr,ZodObject:()=>Ie,ZodOptional:()=>Ze,ZodParsedType:()=>v,ZodPipeline:()=>ho,ZodPromise:()=>er,ZodReadonly:()=>Or,ZodRecord:()=>Hi,ZodSchema:()=>J,ZodSet:()=>pn,ZodString:()=>Xt,ZodSymbol:()=>un,ZodTransformer:()=>Xe,ZodTuple:()=>gt,ZodType:()=>J,ZodUndefined:()=>vr,ZodUnion:()=>xr,ZodUnknown:()=>Ot,ZodVoid:()=>fn,addIssueToContext:()=>D,any:()=>ZD,array:()=>eb,bigint:()=>JD,boolean:()=>wm,coerce:()=>_b,custom:()=>gm,date:()=>GD,datetimeRegex:()=>pm,defaultErrorMap:()=>Tt,discriminatedUnion:()=>ob,effect:()=>hb,enum:()=>pb,function:()=>ub,getErrorMap:()=>an,getParsedType:()=>mt,instanceof:()=>VD,intersection:()=>ib,isAborted:()=>Wi,isAsync:()=>ln,isDirty:()=>Ui,isValid:()=>Yt,late:()=>UD,lazy:()=>fb,literal:()=>db,makeIssue:()=>mo,map:()=>lb,nan:()=>HD,nativeEnum:()=>mb,never:()=>XD,null:()=>KD,nullable:()=>wb,number:()=>ym,object:()=>tb,objectUtil:()=>Ol,oboolean:()=>xb,onumber:()=>Eb,optional:()=>yb,ostring:()=>vb,pipeline:()=>bb,preprocess:()=>Db,promise:()=>gb,quotelessJson:()=>hD,record:()=>ab,set:()=>cb,setErrorMap:()=>wD,strictObject:()=>rb,string:()=>hm,symbol:()=>zD,transformer:()=>hb,tuple:()=>sb,undefined:()=>qD,union:()=>nb,unknown:()=>YD,util:()=>z,void:()=>QD});var z;(function(t){t.assertEqual=o=>{};function e(o){}t.assertIs=e;function r(o){throw new Error}t.assertNever=r,t.arrayToEnum=o=>{let i={};for(let s of o)i[s]=s;return i},t.getValidEnumValues=o=>{let i=t.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),s={};for(let a of i)s[a]=o[a];return t.objectValues(s)},t.objectValues=o=>t.objectKeys(o).map(function(i){return o[i]}),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let i=[];for(let s in o)Object.prototype.hasOwnProperty.call(o,s)&&i.push(s);return i},t.find=(o,i)=>{for(let s of o)if(i(s))return s},t.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,i=" | "){return o.map(s=>typeof s=="string"?`'${s}'`:s).join(i)}t.joinValues=n,t.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(z||(z={}));var Ol;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Ol||(Ol={}));var v=z.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),mt=t=>{switch(typeof t){case"undefined":return v.undefined;case"string":return v.string;case"number":return Number.isNaN(t)?v.nan:v.number;case"boolean":return v.boolean;case"function":return v.function;case"bigint":return v.bigint;case"symbol":return v.symbol;case"object":return Array.isArray(t)?v.array:t===null?v.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?v.promise:typeof Map<"u"&&t instanceof Map?v.map:typeof Set<"u"&&t instanceof Set?v.set:typeof Date<"u"&&t instanceof Date?v.date:v.object;default:return v.unknown}};var y=z.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),hD=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Oe=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(i){return i.message},n={_errors:[]},o=i=>{for(let s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(o);else if(s.code==="invalid_return_type")o(s.returnTypeError);else if(s.code==="invalid_arguments")o(s.argumentsError);else if(s.path.length===0)n._errors.push(r(s));else{let a=n,l=0;for(;l<s.path.length;){let u=s.path[l];l===s.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(r(s))):a[u]=a[u]||{_errors:[]},a=a[u],l++}}};return o(this),n}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,z.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let o of this.issues)if(o.path.length>0){let i=o.path[0];r[i]=r[i]||[],r[i].push(e(o))}else n.push(e(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Oe.create=t=>new Oe(t);var yD=(t,e)=>{let r;switch(t.code){case y.invalid_type:t.received===v.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case y.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,z.jsonStringifyReplacer)}`;break;case y.unrecognized_keys:r=`Unrecognized key(s) in object: ${z.joinValues(t.keys,", ")}`;break;case y.invalid_union:r="Invalid input";break;case y.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${z.joinValues(t.options)}`;break;case y.invalid_enum_value:r=`Invalid enum value. Expected ${z.joinValues(t.options)}, received '${t.received}'`;break;case y.invalid_arguments:r="Invalid function arguments";break;case y.invalid_return_type:r="Invalid function return type";break;case y.invalid_date:r="Invalid date";break;case y.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:z.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case y.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case y.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case y.custom:r="Invalid input";break;case y.invalid_intersection_types:r="Intersection results could not be merged";break;case y.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case y.not_finite:r="Number must be finite";break;default:r=e.defaultError,z.assertNever(t)}return{message:r}},Tt=yD;var lm=Tt;function wD(t){lm=t}function an(){return lm}var mo=t=>{let{data:e,path:r,errorMaps:n,issueData:o}=t,i=[...r,...o.path||[]],s={...o,path:i};if(o.message!==void 0)return{...o,path:i,message:o.message};let a="",l=n.filter(u=>!!u).slice().reverse();for(let u of l)a=u(s,{data:e,defaultError:a}).message;return{...o,path:i,message:a}},DD=[];function D(t,e){let r=an(),n=mo({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===Tt?void 0:Tt].filter(o=>!!o)});t.common.issues.push(n)}var ve=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let o of r){if(o.status==="aborted")return P;o.status==="dirty"&&e.dirty(),n.push(o.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let o of r){let i=await o.key,s=await o.value;n.push({key:i,value:s})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let o of r){let{key:i,value:s}=o;if(i.status==="aborted"||s.status==="aborted")return P;i.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof s.value<"u"||o.alwaysSet)&&(n[i.value]=s.value)}return{status:e.value,value:n}}},P=Object.freeze({status:"aborted"}),hr=t=>({status:"dirty",value:t}),xe=t=>({status:"valid",value:t}),Wi=t=>t.status==="aborted",Ui=t=>t.status==="dirty",Yt=t=>t.status==="valid",ln=t=>typeof Promise<"u"&&t instanceof Promise;var k;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(k||(k={}));var Ye=class{constructor(e,r,n,o){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},cm=(t,e)=>{if(Yt(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Oe(t.common.issues);return this._error=r,this._error}}};function U(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:o}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o}:{errorMap:(s,a)=>{let{message:l}=t;return s.code==="invalid_enum_value"?{message:l??a.defaultError}:typeof a.data>"u"?{message:l??n??a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:l??r??a.defaultError}},description:o}}var J=class{get description(){return this._def.description}_getType(e){return mt(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:mt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ve,ctx:{common:e.parent.common,data:e.data,parsedType:mt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(ln(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:mt(e)},o=this._parseSync({data:e,path:n.path,parent:n});return cm(n,o)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:mt(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:r});return Yt(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(n=>Yt(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:mt(e)},o=this._parse({data:e,path:n.path,parent:n}),i=await(ln(o)?o:Promise.resolve(o));return cm(n,i)}refine(e,r){let n=o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,i)=>{let s=e(o),a=()=>i.addIssue({code:y.custom,...n(o)});return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(e,r){return this._refinement((n,o)=>e(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(e){return new Xe({schema:this,typeName:N.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Ze.create(this,this._def)}nullable(){return ht.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return It.create(this)}promise(){return er.create(this,this._def)}or(e){return xr.create([this,e],this._def)}and(e){return _r.create(this,e,this._def)}transform(e){return new Xe({...U(this._def),schema:this,typeName:N.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Tr({...U(this._def),innerType:this,defaultValue:r,typeName:N.ZodDefault})}brand(){return new go({typeName:N.ZodBranded,type:this,...U(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new Ar({...U(this._def),innerType:this,catchValue:r,typeName:N.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return ho.create(this,e)}readonly(){return Or.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},bD=/^c[^\s-]{8,}$/i,vD=/^[0-9a-z]+$/,ED=/^[0-9A-HJKMNP-TV-Z]{26}$/i,xD=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,_D=/^[a-z0-9_-]{21}$/i,CD=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,FD=/^[-+]?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)?)??$/,kD=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,SD="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Il,TD=/^(?:(?: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])$/,AD=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,OD=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ID=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,$D=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,RD=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,fm="((\\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])))",PD=new RegExp(`^${fm}$`);function dm(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function jD(t){return new RegExp(`^${dm(t)}$`)}function pm(t){let e=`${fm}T${dm(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function ND(t,e){return!!((e==="v4"||!e)&&TD.test(t)||(e==="v6"||!e)&&OD.test(t))}function BD(t,e){if(!CD.test(t))return!1;try{let[r]=t.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||e&&o.alg!==e)}catch{return!1}}function MD(t,e){return!!((e==="v4"||!e)&&AD.test(t)||(e==="v6"||!e)&&ID.test(t))}var Xt=class t extends J{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==v.string){let i=this._getOrReturnCtx(e);return D(i,{code:y.invalid_type,expected:v.string,received:i.parsedType}),P}let n=new ve,o;for(let i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(o=this._getOrReturnCtx(e,o),D(o,{code:y.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")e.data.length>i.value&&(o=this._getOrReturnCtx(e,o),D(o,{code:y.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){let s=e.data.length>i.value,a=e.data.length<i.value;(s||a)&&(o=this._getOrReturnCtx(e,o),s?D(o,{code:y.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&D(o,{code:y.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")kD.test(e.data)||(o=this._getOrReturnCtx(e,o),D(o,{validation:"email",code:y.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")Il||(Il=new RegExp(SD,"u")),Il.test(e.data)||(o=this._getOrReturnCtx(e,o),D(o,{validation:"emoji",code:y.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")xD.test(e.data)||(o=this._getOrReturnCtx(e,o),D(o,{validation:"uuid",code:y.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")_D.test(e.data)||(o=this._getOrReturnCtx(e,o),D(o,{validation:"nanoid",code:y.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")bD.test(e.data)||(o=this._getOrReturnCtx(e,o),D(o,{validation:"cuid",code:y.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")vD.test(e.data)||(o=this._getOrReturnCtx(e,o),D(o,{validation:"cuid2",code:y.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")ED.test(e.data)||(o=this._getOrReturnCtx(e,o),D(o,{validation:"ulid",code:y.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),D(o,{validation:"url",code:y.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),D(o,{validation:"regex",code:y.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(o=this._getOrReturnCtx(e,o),D(o,{code:y.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(o=this._getOrReturnCtx(e,o),D(o,{code:y.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(o=this._getOrReturnCtx(e,o),D(o,{code:y.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?pm(i).test(e.data)||(o=this._getOrReturnCtx(e,o),D(o,{code:y.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?PD.test(e.data)||(o=this._getOrReturnCtx(e,o),D(o,{code:y.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?jD(i).test(e.data)||(o=this._getOrReturnCtx(e,o),D(o,{code:y.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?FD.test(e.data)||(o=this._getOrReturnCtx(e,o),D(o,{validation:"duration",code:y.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?ND(e.data,i.version)||(o=this._getOrReturnCtx(e,o),D(o,{validation:"ip",code:y.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?BD(e.data,i.alg)||(o=this._getOrReturnCtx(e,o),D(o,{validation:"jwt",code:y.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?MD(e.data,i.version)||(o=this._getOrReturnCtx(e,o),D(o,{validation:"cidr",code:y.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?$D.test(e.data)||(o=this._getOrReturnCtx(e,o),D(o,{validation:"base64",code:y.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?RD.test(e.data)||(o=this._getOrReturnCtx(e,o),D(o,{validation:"base64url",code:y.invalid_string,message:i.message}),n.dirty()):z.assertNever(i);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(o=>e.test(o),{validation:r,code:y.invalid_string,...k.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...k.errToObj(e)})}url(e){return this._addCheck({kind:"url",...k.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...k.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...k.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...k.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...k.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...k.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...k.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...k.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...k.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...k.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...k.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...k.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...k.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...k.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...k.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...k.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...k.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...k.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...k.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...k.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...k.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...k.errToObj(r)})}nonempty(e){return this.min(1,k.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Xt.create=t=>new Xt({checks:[],typeName:N.ZodString,coerce:t?.coerce??!1,...U(t)});function LD(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,o=r>n?r:n,i=Number.parseInt(t.toFixed(o).replace(".","")),s=Number.parseInt(e.toFixed(o).replace(".",""));return i%s/10**o}var yr=class t extends J{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==v.number){let i=this._getOrReturnCtx(e);return D(i,{code:y.invalid_type,expected:v.number,received:i.parsedType}),P}let n,o=new ve;for(let i of this._def.checks)i.kind==="int"?z.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),D(n,{code:y.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),D(n,{code:y.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),D(n,{code:y.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?LD(e.data,i.value)!==0&&(n=this._getOrReturnCtx(e,n),D(n,{code:y.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),D(n,{code:y.not_finite,message:i.message}),o.dirty()):z.assertNever(i);return{status:o.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,k.toString(r))}gt(e,r){return this.setLimit("min",e,!1,k.toString(r))}lte(e,r){return this.setLimit("max",e,!0,k.toString(r))}lt(e,r){return this.setLimit("max",e,!1,k.toString(r))}setLimit(e,r,n,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:k.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:k.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:k.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:k.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:k.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:k.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:k.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:k.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:k.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:k.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&z.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};yr.create=t=>new yr({checks:[],typeName:N.ZodNumber,coerce:t?.coerce||!1,...U(t)});var wr=class t extends J{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==v.bigint)return this._getInvalidInput(e);let n,o=new ve;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),D(n,{code:y.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),D(n,{code:y.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),D(n,{code:y.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):z.assertNever(i);return{status:o.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return D(r,{code:y.invalid_type,expected:v.bigint,received:r.parsedType}),P}gte(e,r){return this.setLimit("min",e,!0,k.toString(r))}gt(e,r){return this.setLimit("min",e,!1,k.toString(r))}lte(e,r){return this.setLimit("max",e,!0,k.toString(r))}lt(e,r){return this.setLimit("max",e,!1,k.toString(r))}setLimit(e,r,n,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:k.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:k.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:k.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:k.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:k.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:k.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};wr.create=t=>new wr({checks:[],typeName:N.ZodBigInt,coerce:t?.coerce??!1,...U(t)});var Dr=class extends J{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==v.boolean){let n=this._getOrReturnCtx(e);return D(n,{code:y.invalid_type,expected:v.boolean,received:n.parsedType}),P}return xe(e.data)}};Dr.create=t=>new Dr({typeName:N.ZodBoolean,coerce:t?.coerce||!1,...U(t)});var br=class t extends J{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==v.date){let i=this._getOrReturnCtx(e);return D(i,{code:y.invalid_type,expected:v.date,received:i.parsedType}),P}if(Number.isNaN(e.data.getTime())){let i=this._getOrReturnCtx(e);return D(i,{code:y.invalid_date}),P}let n=new ve,o;for(let i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(o=this._getOrReturnCtx(e,o),D(o,{code:y.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(o=this._getOrReturnCtx(e,o),D(o,{code:y.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):z.assertNever(i);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:k.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:k.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};br.create=t=>new br({checks:[],coerce:t?.coerce||!1,typeName:N.ZodDate,...U(t)});var un=class extends J{_parse(e){if(this._getType(e)!==v.symbol){let n=this._getOrReturnCtx(e);return D(n,{code:y.invalid_type,expected:v.symbol,received:n.parsedType}),P}return xe(e.data)}};un.create=t=>new un({typeName:N.ZodSymbol,...U(t)});var vr=class extends J{_parse(e){if(this._getType(e)!==v.undefined){let n=this._getOrReturnCtx(e);return D(n,{code:y.invalid_type,expected:v.undefined,received:n.parsedType}),P}return xe(e.data)}};vr.create=t=>new vr({typeName:N.ZodUndefined,...U(t)});var Er=class extends J{_parse(e){if(this._getType(e)!==v.null){let n=this._getOrReturnCtx(e);return D(n,{code:y.invalid_type,expected:v.null,received:n.parsedType}),P}return xe(e.data)}};Er.create=t=>new Er({typeName:N.ZodNull,...U(t)});var Qt=class extends J{constructor(){super(...arguments),this._any=!0}_parse(e){return xe(e.data)}};Qt.create=t=>new Qt({typeName:N.ZodAny,...U(t)});var Ot=class extends J{constructor(){super(...arguments),this._unknown=!0}_parse(e){return xe(e.data)}};Ot.create=t=>new Ot({typeName:N.ZodUnknown,...U(t)});var st=class extends J{_parse(e){let r=this._getOrReturnCtx(e);return D(r,{code:y.invalid_type,expected:v.never,received:r.parsedType}),P}};st.create=t=>new st({typeName:N.ZodNever,...U(t)});var fn=class extends J{_parse(e){if(this._getType(e)!==v.undefined){let n=this._getOrReturnCtx(e);return D(n,{code:y.invalid_type,expected:v.void,received:n.parsedType}),P}return xe(e.data)}};fn.create=t=>new fn({typeName:N.ZodVoid,...U(t)});var It=class t extends J{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),o=this._def;if(r.parsedType!==v.array)return D(r,{code:y.invalid_type,expected:v.array,received:r.parsedType}),P;if(o.exactLength!==null){let s=r.data.length>o.exactLength.value,a=r.data.length<o.exactLength.value;(s||a)&&(D(r,{code:s?y.too_big:y.too_small,minimum:a?o.exactLength.value:void 0,maximum:s?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),n.dirty())}if(o.minLength!==null&&r.data.length<o.minLength.value&&(D(r,{code:y.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),n.dirty()),o.maxLength!==null&&r.data.length>o.maxLength.value&&(D(r,{code:y.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((s,a)=>o.type._parseAsync(new Ye(r,s,r.path,a)))).then(s=>ve.mergeArray(n,s));let i=[...r.data].map((s,a)=>o.type._parseSync(new Ye(r,s,r.path,a)));return ve.mergeArray(n,i)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:k.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:k.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:k.toString(r)}})}nonempty(e){return this.min(1,e)}};It.create=(t,e)=>new It({type:t,minLength:null,maxLength:null,exactLength:null,typeName:N.ZodArray,...U(e)});function cn(t){if(t instanceof Ie){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=Ze.create(cn(n))}return new Ie({...t._def,shape:()=>e})}else return t instanceof It?new It({...t._def,type:cn(t.element)}):t instanceof Ze?Ze.create(cn(t.unwrap())):t instanceof ht?ht.create(cn(t.unwrap())):t instanceof gt?gt.create(t.items.map(e=>cn(e))):t}var Ie=class t extends J{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=z.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==v.object){let u=this._getOrReturnCtx(e);return D(u,{code:y.invalid_type,expected:v.object,received:u.parsedType}),P}let{status:n,ctx:o}=this._processInputParams(e),{shape:i,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof st&&this._def.unknownKeys==="strip"))for(let u in o.data)s.includes(u)||a.push(u);let l=[];for(let u of s){let f=i[u],p=o.data[u];l.push({key:{status:"valid",value:u},value:f._parse(new Ye(o,p,o.path,u)),alwaysSet:u in o.data})}if(this._def.catchall instanceof st){let u=this._def.unknownKeys;if(u==="passthrough")for(let f of a)l.push({key:{status:"valid",value:f},value:{status:"valid",value:o.data[f]}});else if(u==="strict")a.length>0&&(D(o,{code:y.unrecognized_keys,keys:a}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let f of a){let p=o.data[f];l.push({key:{status:"valid",value:f},value:u._parse(new Ye(o,p,o.path,f)),alwaysSet:f in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let u=[];for(let f of l){let p=await f.key,g=await f.value;u.push({key:p,value:g,alwaysSet:f.alwaysSet})}return u}).then(u=>ve.mergeObjectSync(n,u)):ve.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(e){return k.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{let o=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:k.errToObj(e).message??o}:{message:o}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:N.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};for(let n of z.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}omit(e){let r={};for(let n of z.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}deepPartial(){return cn(this)}partial(e){let r={};for(let n of z.objectKeys(this.shape)){let o=this.shape[n];e&&!e[n]?r[n]=o:r[n]=o.optional()}return new t({...this._def,shape:()=>r})}required(e){let r={};for(let n of z.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof Ze;)i=i._def.innerType;r[n]=i}return new t({...this._def,shape:()=>r})}keyof(){return mm(z.objectKeys(this.shape))}};Ie.create=(t,e)=>new Ie({shape:()=>t,unknownKeys:"strip",catchall:st.create(),typeName:N.ZodObject,...U(e)});Ie.strictCreate=(t,e)=>new Ie({shape:()=>t,unknownKeys:"strict",catchall:st.create(),typeName:N.ZodObject,...U(e)});Ie.lazycreate=(t,e)=>new Ie({shape:t,unknownKeys:"strip",catchall:st.create(),typeName:N.ZodObject,...U(e)});var xr=class extends J{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function o(i){for(let a of i)if(a.result.status==="valid")return a.result;for(let a of i)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let s=i.map(a=>new Oe(a.ctx.common.issues));return D(r,{code:y.invalid_union,unionErrors:s}),P}if(r.common.async)return Promise.all(n.map(async i=>{let s={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:s}),ctx:s}})).then(o);{let i,s=[];for(let l of n){let u={...r,common:{...r.common,issues:[]},parent:null},f=l._parseSync({data:r.data,path:r.path,parent:u});if(f.status==="valid")return f;f.status==="dirty"&&!i&&(i={result:f,ctx:u}),u.common.issues.length&&s.push(u.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;let a=s.map(l=>new Oe(l));return D(r,{code:y.invalid_union,unionErrors:a}),P}}get options(){return this._def.options}};xr.create=(t,e)=>new xr({options:t,typeName:N.ZodUnion,...U(e)});var At=t=>t instanceof Cr?At(t.schema):t instanceof Xe?At(t.innerType()):t instanceof Fr?[t.value]:t instanceof kr?t.options:t instanceof Sr?z.objectValues(t.enum):t instanceof Tr?At(t._def.innerType):t instanceof vr?[void 0]:t instanceof Er?[null]:t instanceof Ze?[void 0,...At(t.unwrap())]:t instanceof ht?[null,...At(t.unwrap())]:t instanceof go||t instanceof Or?At(t.unwrap()):t instanceof Ar?At(t._def.innerType):[],Vi=class t extends J{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==v.object)return D(r,{code:y.invalid_type,expected:v.object,received:r.parsedType}),P;let n=this.discriminator,o=r.data[n],i=this.optionsMap.get(o);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(D(r,{code:y.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),P)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let o=new Map;for(let i of r){let s=At(i.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of s){if(o.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);o.set(a,i)}}return new t({typeName:N.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:o,...U(n)})}};function $l(t,e){let r=mt(t),n=mt(e);if(t===e)return{valid:!0,data:t};if(r===v.object&&n===v.object){let o=z.objectKeys(e),i=z.objectKeys(t).filter(a=>o.indexOf(a)!==-1),s={...t,...e};for(let a of i){let l=$l(t[a],e[a]);if(!l.valid)return{valid:!1};s[a]=l.data}return{valid:!0,data:s}}else if(r===v.array&&n===v.array){if(t.length!==e.length)return{valid:!1};let o=[];for(let i=0;i<t.length;i++){let s=t[i],a=e[i],l=$l(s,a);if(!l.valid)return{valid:!1};o.push(l.data)}return{valid:!0,data:o}}else return r===v.date&&n===v.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var _r=class extends J{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),o=(i,s)=>{if(Wi(i)||Wi(s))return P;let a=$l(i.value,s.value);return a.valid?((Ui(i)||Ui(s))&&r.dirty(),{status:r.value,value:a.data}):(D(n,{code:y.invalid_intersection_types}),P)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,s])=>o(i,s)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};_r.create=(t,e,r)=>new _r({left:t,right:e,typeName:N.ZodIntersection,...U(r)});var gt=class t extends J{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==v.array)return D(n,{code:y.invalid_type,expected:v.array,received:n.parsedType}),P;if(n.data.length<this._def.items.length)return D(n,{code:y.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),P;!this._def.rest&&n.data.length>this._def.items.length&&(D(n,{code:y.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...n.data].map((s,a)=>{let l=this._def.items[a]||this._def.rest;return l?l._parse(new Ye(n,s,n.path,a)):null}).filter(s=>!!s);return n.common.async?Promise.all(i).then(s=>ve.mergeArray(r,s)):ve.mergeArray(r,i)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};gt.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new gt({items:t,typeName:N.ZodTuple,rest:null,...U(e)})};var Hi=class t extends J{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==v.object)return D(n,{code:y.invalid_type,expected:v.object,received:n.parsedType}),P;let o=[],i=this._def.keyType,s=this._def.valueType;for(let a in n.data)o.push({key:i._parse(new Ye(n,a,n.path,a)),value:s._parse(new Ye(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?ve.mergeObjectAsync(r,o):ve.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof J?new t({keyType:e,valueType:r,typeName:N.ZodRecord,...U(n)}):new t({keyType:Xt.create(),valueType:e,typeName:N.ZodRecord,...U(r)})}},dn=class extends J{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==v.map)return D(n,{code:y.invalid_type,expected:v.map,received:n.parsedType}),P;let o=this._def.keyType,i=this._def.valueType,s=[...n.data.entries()].map(([a,l],u)=>({key:o._parse(new Ye(n,a,n.path,[u,"key"])),value:i._parse(new Ye(n,l,n.path,[u,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let l of s){let u=await l.key,f=await l.value;if(u.status==="aborted"||f.status==="aborted")return P;(u.status==="dirty"||f.status==="dirty")&&r.dirty(),a.set(u.value,f.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let l of s){let u=l.key,f=l.value;if(u.status==="aborted"||f.status==="aborted")return P;(u.status==="dirty"||f.status==="dirty")&&r.dirty(),a.set(u.value,f.value)}return{status:r.value,value:a}}}};dn.create=(t,e,r)=>new dn({valueType:e,keyType:t,typeName:N.ZodMap,...U(r)});var pn=class t extends J{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==v.set)return D(n,{code:y.invalid_type,expected:v.set,received:n.parsedType}),P;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(D(n,{code:y.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),r.dirty()),o.maxSize!==null&&n.data.size>o.maxSize.value&&(D(n,{code:y.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let i=this._def.valueType;function s(l){let u=new Set;for(let f of l){if(f.status==="aborted")return P;f.status==="dirty"&&r.dirty(),u.add(f.value)}return{status:r.value,value:u}}let a=[...n.data.values()].map((l,u)=>i._parse(new Ye(n,l,n.path,u)));return n.common.async?Promise.all(a).then(l=>s(l)):s(a)}min(e,r){return new t({...this._def,minSize:{value:e,message:k.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:k.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};pn.create=(t,e)=>new pn({valueType:t,minSize:null,maxSize:null,typeName:N.ZodSet,...U(e)});var Ji=class t extends J{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==v.function)return D(r,{code:y.invalid_type,expected:v.function,received:r.parsedType}),P;function n(a,l){return mo({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,an(),Tt].filter(u=>!!u),issueData:{code:y.invalid_arguments,argumentsError:l}})}function o(a,l){return mo({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,an(),Tt].filter(u=>!!u),issueData:{code:y.invalid_return_type,returnTypeError:l}})}let i={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof er){let a=this;return xe(async function(...l){let u=new Oe([]),f=await a._def.args.parseAsync(l,i).catch(h=>{throw u.addIssue(n(l,h)),u}),p=await Reflect.apply(s,this,f);return await a._def.returns._def.type.parseAsync(p,i).catch(h=>{throw u.addIssue(o(p,h)),u})})}else{let a=this;return xe(function(...l){let u=a._def.args.safeParse(l,i);if(!u.success)throw new Oe([n(l,u.error)]);let f=Reflect.apply(s,this,u.data),p=a._def.returns.safeParse(f,i);if(!p.success)throw new Oe([o(f,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:gt.create(e).rest(Ot.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new t({args:e||gt.create([]).rest(Ot.create()),returns:r||Ot.create(),typeName:N.ZodFunction,...U(n)})}},Cr=class extends J{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Cr.create=(t,e)=>new Cr({getter:t,typeName:N.ZodLazy,...U(e)});var Fr=class extends J{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return D(r,{received:r.data,code:y.invalid_literal,expected:this._def.value}),P}return{status:"valid",value:e.data}}get value(){return this._def.value}};Fr.create=(t,e)=>new Fr({value:t,typeName:N.ZodLiteral,...U(e)});function mm(t,e){return new kr({values:t,typeName:N.ZodEnum,...U(e)})}var kr=class t extends J{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return D(r,{expected:z.joinValues(n),received:r.parsedType,code:y.invalid_type}),P}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return D(r,{received:r.data,code:y.invalid_enum_value,options:n}),P}return xe(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};kr.create=mm;var Sr=class extends J{_parse(e){let r=z.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==v.string&&n.parsedType!==v.number){let o=z.objectValues(r);return D(n,{expected:z.joinValues(o),received:n.parsedType,code:y.invalid_type}),P}if(this._cache||(this._cache=new Set(z.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let o=z.objectValues(r);return D(n,{received:n.data,code:y.invalid_enum_value,options:o}),P}return xe(e.data)}get enum(){return this._def.values}};Sr.create=(t,e)=>new Sr({values:t,typeName:N.ZodNativeEnum,...U(e)});var er=class extends J{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==v.promise&&r.common.async===!1)return D(r,{code:y.invalid_type,expected:v.promise,received:r.parsedType}),P;let n=r.parsedType===v.promise?r.data:Promise.resolve(r.data);return xe(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};er.create=(t,e)=>new er({type:t,typeName:N.ZodPromise,...U(e)});var Xe=class extends J{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===N.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),o=this._def.effect||null,i={addIssue:s=>{D(n,s),s.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){let s=o.transform(n.data,i);if(n.common.async)return Promise.resolve(s).then(async a=>{if(r.value==="aborted")return P;let l=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return l.status==="aborted"?P:l.status==="dirty"?hr(l.value):r.value==="dirty"?hr(l.value):l});{if(r.value==="aborted")return P;let a=this._def.schema._parseSync({data:s,path:n.path,parent:n});return a.status==="aborted"?P:a.status==="dirty"?hr(a.value):r.value==="dirty"?hr(a.value):a}}if(o.type==="refinement"){let s=a=>{let l=o.refinement(a,i);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?P:(a.status==="dirty"&&r.dirty(),s(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?P:(a.status==="dirty"&&r.dirty(),s(a.value).then(()=>({status:r.value,value:a.value}))))}if(o.type==="transform")if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Yt(s))return P;let a=o.transform(s.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>Yt(s)?Promise.resolve(o.transform(s.value,i)).then(a=>({status:r.value,value:a})):P);z.assertNever(o)}};Xe.create=(t,e,r)=>new Xe({schema:t,typeName:N.ZodEffects,effect:e,...U(r)});Xe.createWithPreprocess=(t,e,r)=>new Xe({schema:e,effect:{type:"preprocess",transform:t},typeName:N.ZodEffects,...U(r)});var Ze=class extends J{_parse(e){return this._getType(e)===v.undefined?xe(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ze.create=(t,e)=>new Ze({innerType:t,typeName:N.ZodOptional,...U(e)});var ht=class extends J{_parse(e){return this._getType(e)===v.null?xe(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ht.create=(t,e)=>new ht({innerType:t,typeName:N.ZodNullable,...U(e)});var Tr=class extends J{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===v.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Tr.create=(t,e)=>new Tr({innerType:t,typeName:N.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...U(e)});var Ar=class extends J{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return ln(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Oe(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Oe(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Ar.create=(t,e)=>new Ar({innerType:t,typeName:N.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...U(e)});var mn=class extends J{_parse(e){if(this._getType(e)!==v.nan){let n=this._getOrReturnCtx(e);return D(n,{code:y.invalid_type,expected:v.nan,received:n.parsedType}),P}return{status:"valid",value:e.data}}};mn.create=t=>new mn({typeName:N.ZodNaN,...U(t)});var WD=Symbol("zod_brand"),go=class extends J{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},ho=class t extends J{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?P:i.status==="dirty"?(r.dirty(),hr(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?P:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:N.ZodPipeline})}},Or=class extends J{_parse(e){let r=this._def.innerType._parse(e),n=o=>(Yt(o)&&(o.value=Object.freeze(o.value)),o);return ln(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};Or.create=(t,e)=>new Or({innerType:t,typeName:N.ZodReadonly,...U(e)});function um(t,e){let r=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof r=="string"?{message:r}:r}function gm(t,e={},r){return t?Qt.create().superRefine((n,o)=>{let i=t(n);if(i instanceof Promise)return i.then(s=>{if(!s){let a=um(e,n),l=a.fatal??r??!0;o.addIssue({code:"custom",...a,fatal:l})}});if(!i){let s=um(e,n),a=s.fatal??r??!0;o.addIssue({code:"custom",...s,fatal:a})}}):Qt.create()}var UD={object:Ie.lazycreate},N;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(N||(N={}));var VD=(t,e={message:`Input not instance of ${t.name}`})=>gm(r=>r instanceof t,e),hm=Xt.create,ym=yr.create,HD=mn.create,JD=wr.create,wm=Dr.create,GD=br.create,zD=un.create,qD=vr.create,KD=Er.create,ZD=Qt.create,YD=Ot.create,XD=st.create,QD=fn.create,eb=It.create,tb=Ie.create,rb=Ie.strictCreate,nb=xr.create,ob=Vi.create,ib=_r.create,sb=gt.create,ab=Hi.create,lb=dn.create,cb=pn.create,ub=Ji.create,fb=Cr.create,db=Fr.create,pb=kr.create,mb=Sr.create,gb=er.create,hb=Xe.create,yb=Ze.create,wb=ht.create,Db=Xe.createWithPreprocess,bb=ho.create,vb=()=>hm().optional(),Eb=()=>ym().optional(),xb=()=>wm().optional(),_b={string:t=>Xt.create({...t,coerce:!0}),number:t=>yr.create({...t,coerce:!0}),boolean:t=>Dr.create({...t,coerce:!0}),bigint:t=>wr.create({...t,coerce:!0}),date:t=>br.create({...t,coerce:!0})};var Cb=P;function Gi(t,e=!1){let r=t.length,n=0,o="",i=0,s=16,a=0,l=0,u=0,f=0,p=0;function g(x,B){let Q=0,j=0;for(;Q<x||!B;){let I=t.charCodeAt(n);if(I>=48&&I<=57)j=j*16+I-48;else if(I>=65&&I<=70)j=j*16+I-65+10;else if(I>=97&&I<=102)j=j*16+I-97+10;else break;n++,Q++}return Q<x&&(j=-1),j}function h(x){n=x,o="",i=0,s=16,p=0}function w(){let x=n;if(t.charCodeAt(n)===48)n++;else for(n++;n<t.length&&gn(t.charCodeAt(n));)n++;if(n<t.length&&t.charCodeAt(n)===46)if(n++,n<t.length&&gn(t.charCodeAt(n)))for(n++;n<t.length&&gn(t.charCodeAt(n));)n++;else return p=3,t.substring(x,n);let B=n;if(n<t.length&&(t.charCodeAt(n)===69||t.charCodeAt(n)===101))if(n++,(n<t.length&&t.charCodeAt(n)===43||t.charCodeAt(n)===45)&&n++,n<t.length&&gn(t.charCodeAt(n))){for(n++;n<t.length&&gn(t.charCodeAt(n));)n++;B=n}else p=3;return t.substring(x,B)}function F(){let x="",B=n;for(;;){if(n>=r){x+=t.substring(B,n),p=2;break}let Q=t.charCodeAt(n);if(Q===34){x+=t.substring(B,n),n++;break}if(Q===92){if(x+=t.substring(B,n),n++,n>=r){p=2;break}switch(t.charCodeAt(n++)){case 34:x+='"';break;case 92:x+="\\";break;case 47:x+="/";break;case 98:x+="\b";break;case 102:x+="\f";break;case 110:x+=`
|
|
108
|
-
`;break;case 114:
|
|
109
|
-
`),a++,
|
|
110
|
-
`+" ".repeat(
|
|
111
|
-
`+" ".repeat(
|
|
112
|
-
`+" ".repeat(
|
|
113
|
-
`+" ".repeat(
|
|
101
|
+
`,h),"")}`)),t.succeed(),t=u.spinner("Generating library bundle");let{outputFiles:p,outputVolume:m}=await _i({libraryIdentifier:o,renderer:r.renderer,framework:r.framework,publicPath:Ht(e.publicPath||lD),sourceVolumes:[s],componentsFiles:i,componentsOptions:f,debugBundler:e?.debugBundler,dev:e?.dev,overrideConfig:a,failOnWarnings:!e.force,bundler:e.bundler});t.succeed(),t=u.spinner("Writing to disk"),p.forEach(([h,w])=>{let k=(0,sn.join)(`/${w}`,`${h.name}`),P=ro(m.readFileSync(k,"utf8").toString(),k,{bundleEnvironment:w}),V=(0,sn.join)(process.cwd(),e.outputPath||aD);Ri.default.existsSync((0,sn.join)(V,`${w}`))||Ri.default.mkdirSync((0,sn.join)(V,`${w}`),{recursive:!0}),Ri.default.writeFileSync((0,sn.join)(V,w,h.name),P.value.toString())}),t.succeed(),u.success("Code Library bundled successfully!")}catch(r){throw t?.fail(),new d(r)}}x();H();var ao=g(require("fs-extra")),bl=g(require("path"));x();H();function uD(){try{if(!ao.default.existsSync(je))return null;let e=ao.default.readdirSync(je).filter(t=>t.endsWith(".log")).map(t=>({name:t,path:bl.default.join(je,t),time:ao.default.statSync(bl.default.join(je,t)).mtime.getTime()})).sort((t,r)=>r.time-t.time);if(e.length===0)return null;for(let t of e)try{let n=ao.default.readFileSync(t.path,"utf8").match(/Command: (.+)/);if(n){let o=n[1];if(!/^(log|library\s+log)(\s|$)/.test(o))return t.path}}catch{continue}return null}catch{return null}}async function vl(){let e=uD();e&&u.info(`${Hr} Latest log: ${e}`),u.info(`${Hr} All logs: ${je}`)}async function zp(e){e.command("log").description("Display the logs directory and path to the latest log file, if available.").action(vl)}var Ae=require("commander"),El=()=>new Ae.Option("--no-input","Avoid prompting or doing anything interactive. Use this for CI/CD pipelines."),Fl=()=>new Ae.Option("--manifest <path>","Path to a manifest.json file or directory containing webflow.json. Default: ./webflow.json"),xl=()=>new Ae.Option("--skip-update-check","Skip checking for @webflow packages updates"),Cl=()=>new Ae.Option("--verbose","Display more information for debugging purposes."),lo=()=>new Ae.Option("--api-token <token>","API token. Default: value set in WEBFLOW_API_TOKEN env variable."),Me=()=>new Ae.Option("-s, --site <site-id>","Site ID. Default: value set in webflow.json config."),fe=()=>new Ae.Option("--json","Output as JSON"),qe=()=>new Ae.Option("--dry-run","Preview without executing"),Pi=()=>new Ae.Option("--order <dir>","Sort direction: asc or desc").default("asc"),kt=e=>new Ae.Option("--fields <fields>",`Comma-separated fields to display (${e.join(", ")})`),ji=e=>new Ae.Option("--sort-by <field>",`Sort by: ${e.join(", ")}`),Ni=()=>new Ae.Option("--limit <n>","Maximum number of items to return (default 100)").default("100").argParser(parseInt),Bi=()=>new Ae.Option("--offset <n>","Number of items to skip (default 0)").default("0").argParser(parseInt),uo=e=>async(t,r)=>{let o={...r.parent?.opts()||{},...t};await e(o)};ce();var cD=`${ne("[Deprecated]")} The 'library' commands will be removed in the next major release.`,fD=()=>{u.warn(`${Ee} ${ne("webflow library share")} is deprecated and will be removed in the next major release.
|
|
102
|
+
Use ${B("webflow devlink import")} instead.
|
|
103
|
+
`)},dD=()=>{u.warn(`${Ee} ${ne("webflow library bundle")} is deprecated and will be removed in the next major release.
|
|
104
|
+
Use ${B("webflow devlink bundle")} instead.
|
|
105
|
+
`)},pD=()=>{u.warn(`${Ee} ${ne("webflow library log")} is deprecated and will be removed in the next major release.
|
|
106
|
+
Use ${B("webflow log")} instead.
|
|
107
|
+
`)},mD="Import a library of Code Components into your Webflow Workspace.",gD="Bundle a library of Code Components for local development.",qp=()=>new Gt.Option("-f, --force","Force the bundler to finish compiling, even if there are warnings or type errors."),Kp=()=>new Gt.Option("--debug-bundler","Display final bundler configurations for debugging purposes."),Zp=()=>new Gt.Option("--dev","Bundle in development mode for debugging purposes."),Yp=()=>new Gt.Option("--bundler <engine>","Bundler to use: webpack or rspack (experimental). Default: webpack").choices(["webpack","rspack"]).default("webpack").hideHelp(),hD=()=>new Gt.Option("--library-id <id>","Set the library identifier to use for the bundle.").hideHelp(),yD=()=>new Gt.Option("--public-path <path>","Set the public path for the bundle."),wD=()=>new Gt.Option("--output-path <path>","Override the output path for the bundle. Default is './dist'");function _l(e,t){return e.command(t).description(mD).addOption(lo()).addOption(qp()).addOption(Kp()).addOption(Zp()).addOption(Yp()).action(uo(wl))}function kl(e,t){return e.command(t).description(gD).addOption(hD()).addOption(yD()).addOption(wD()).addOption(qp()).addOption(Kp()).addOption(Zp()).addOption(Yp()).action(uo(Dl))}var Xp=e=>{let t=e.command("library").description(cD);_l(t,"share").description(`${ne("[Deprecated]")} Use 'webflow devlink import' instead.`).hook("preAction",fD),kl(t,"bundle").description(`${ne("[Deprecated]")} Use 'webflow devlink bundle' instead.`).hook("preAction",dD),t.command("log").description(`${ne("[Deprecated]")} Use 'webflow log' instead.`).hook("preAction",pD).action(vl)};ce();var Qp=e=>{let t=e.command("devlink").description("CLI for managing your Webflow Components.");t.command("sync").description(`${ne("[Deprecated]")} Use 'webflow devlink export' instead. Sync your Webflow components to your filesystem.`).argument("[components...]","A list of components to sync. If none is provided, all components will be synced.").addOption(lo()).addOption(Me()).action(ud),_l(t,"import"),kl(t,"bundle"),t.command("export").description("Export Webflow Components from your Webflow Site.").addOption(lo()).addOption(Me()).action(uo(gi))};var yg=g(require("path"));var St=g(require("fs")),Ke=g(require("path"));x();re();var De={New:"new",Existing:"existing"},em="cli",zt=3,qt=39,Mi="astro",tm="cloud-scaffolds";var rm="package.json",gr="webflow.json",Li="wf-placeholder-name",nm="CLOUD_MOUNT_PATH",om="gitignore";function Sl(e){return!e.siteId}var co=async(e,t,r=Mi,n,o,i)=>{try{let s,a;if("content"in n){let l=n.content;s=l.files,a=c=>Ke.relative(l.extractionRoot,c).replace(/\\/g,"/")}else{let c=n[r];if(!c)throw new Error(`Scaffold "${r}" not found`);s=c;let f=Ke.join(tm,r);a=p=>p.split(f)[1]?.substring(1).replace(/\\/g,"/")??""}for(let l of s)try{let c=Ke.join(e,a(l)),f=l.includes("next.config.ts"),p=l.includes("astro.config.mjs"),m=f||p;if(l.includes(gr)&&St.existsSync(c))continue;if(l.includes(rm)||l.includes(gr)){let w=(await St.promises.readFile(l,"utf8")).replace(Li,e);await Wi(c,w)}else if(m){let h=await St.promises.readFile(l,"utf8");await Wi(c,h.replace(nm,t))}else if(Ke.basename(c).toLowerCase()===om){let h=await St.promises.readFile(l,"utf8"),w=Ke.join(Ke.dirname(c),".gitignore");await Wi(w,h)}else{let h=await St.promises.readFile(l);await Wi(c,h)}}catch(c){u.error(`Error processing file ${l}: ${c}`)}if(o&&i)try{Ft({siteId:o,apiToken:i,directory:e})}catch(l){u.error(`Error creating .env file: ${l}`)}}catch(s){throw u.error(`Error applying scaffold: ${s}`),s}};var Wi=async(e,t)=>{try{await St.promises.mkdir(Ke.dirname(e),{recursive:!0}),await St.promises.writeFile(e,t)}catch(r){throw u.error(`Error writing file ${e}: ${r}`),r}};var Kt=g(require("fs")),im=g(require("fs-extra")),Zt=g(require("path")),$l=g(require("os")),sm=g(require("tar"));var be=class extends Error{constructor(r,n,o){super(r);this.scaffoldId=n;this.supportedIds=o;this.name="ScaffoldError"}};var fo={"astro-minimal":{id:"astro-minimal",name:"Astro",source:{type:"github",repo:"Webflow-Examples/hello-world-astro",ref:"v2"}},"nextjs-minimal":{id:"nextjs-minimal",name:"Next.js",source:{type:"github",repo:"Webflow-Examples/hello-world-nextjs",ref:"v1"}},astro:{id:"astro",name:"Astro (site-attached)",source:{type:"github",repo:"Webflow-Examples/hello-world-astro-devlink",ref:"v2"}},nextjs:{id:"nextjs",name:"Next.js (site-attached)",source:{type:"github",repo:"Webflow-Examples/hello-world-nextjs-devlink",ref:"v1"}}};function po(e){let t=fo[e];if(!t){let r=Object.keys(fo);throw new be(`Unsupported framework: "${e}". Supported: ${r.join(", ")}`,e,r)}return t}function Tl(){return Object.keys(fo)}function Al(){return[...new Set(Tl().map(e=>e.replace(/-minimal$/,"")))]}function Ol(){return["astro","nextjs"]}function Il(e){let r=`${e.replace(/-minimal$/,"")}-minimal`;if(!fo[r]){let n=Tl();throw new be(`No minimal scaffold for "${e}". Supported: ${n.join(", ")}`,r,n)}return r}x();var DD="https://github.com";async function Rl(e){let t=e.endsWith("-minimal")?e:Il(e);return Ui(t)}async function Ui(e){return po(e).source.type==="github"?bD(e):am(e)}async function am(e){let t=po(e);if(t.source.type!=="local")throw new be(`Scaffold "${e}" does not have a local source`,e);let r=Zt.isAbsolute(t.source.path)?t.source.path:Zt.join(__dirname,t.source.path);if(!Kt.existsSync(r))throw new be(`Scaffold directory not found: ${r}`,e);let n=await Pl(r);return{scaffoldId:e,files:n,extractionRoot:r}}async function bD(e){let t=po(e);if(t.source.type!=="github")throw new be(`Scaffold "${e}" does not have a GitHub source`,e);let r=t.source.ref??"main",n=`${DD}/${t.source.repo}/archive/${r}.tar.gz`,o=await Kt.promises.mkdtemp(Zt.join($l.tmpdir(),`webflow-scaffold-${e}-`)),i=u.spinner(`Downloading scaffold (${t.source.repo}@${r})`);try{let s;try{s=await fetch(n,{redirect:"follow",headers:{"User-Agent":"webflow-cli"}})}catch(h){throw i.fail("Download failed"),new be(`Failed to fetch scaffold from GitHub: ${h instanceof Error?h.message:String(h)}. Repo: ${t.source.repo}, ref: ${r}`,e)}if(!s.ok)throw i.fail(`GitHub returned ${s.status} ${s.statusText}`),new be(`Failed to fetch scaffold from GitHub: ${s.status} ${s.statusText}. Repo: ${t.source.repo}, ref: ${r}`,e);let a=Buffer.from(await s.arrayBuffer());i.succeed("Downloaded scaffold");let l=u.spinner("Unpacking scaffold");try{await vD(a,o),l.succeed("Scaffold ready")}catch(h){throw l.fail("Unpack failed"),h}let c=await Kt.promises.readdir(o),f=c[0];if(!f||c.length!==1)throw new be(`Unexpected tarball structure for ${t.source.repo}`,e);let p=Zt.join(o,f),m=await Pl(p);return{scaffoldId:e,files:m,extractionRoot:p}}catch(s){try{im.default.removeSync(o)}catch{}throw s instanceof be?s:new be(`Failed to fetch scaffold "${e}": ${s instanceof Error?s.message:String(s)}`,e)}}async function vD(e,t){let r=Zt.join($l.tmpdir(),`webflow-scaffold-${Date.now()}.tar.gz`);await Kt.promises.writeFile(r,new Uint8Array(e.buffer,e.byteOffset,e.byteLength));try{await sm.extract({file:r,cwd:t})}finally{await Kt.promises.unlink(r).catch(()=>{})}}async function Pl(e){let t=[],r=await Kt.promises.readdir(e,{withFileTypes:!0});for(let n of r){let o=Zt.join(e,n.name);n.isDirectory()?t.push(...await Pl(o)):t.push(o)}return t}var eu=g(require("fs-extra"));re();ee();var L=g(require("fs")),X=g(require("path")),Eo=require("child_process"),Wm=g(require("tar"));var xe=g(require("fs")),lt=g(require("path"));var M={};Ru(M,{BRAND:()=>zD,DIRTY:()=>hr,EMPTY_PATH:()=>CD,INVALID:()=>$,NEVER:()=>Ob,OK:()=>Fe,ParseStatus:()=>ve,Schema:()=>J,ZodAny:()=>Qt,ZodArray:()=>It,ZodBigInt:()=>wr,ZodBoolean:()=>Dr,ZodBranded:()=>go,ZodCatch:()=>Ar,ZodDate:()=>br,ZodDefault:()=>Tr,ZodDiscriminatedUnion:()=>Ji,ZodEffects:()=>Xe,ZodEnum:()=>kr,ZodError:()=>Oe,ZodFirstPartyTypeKind:()=>R,ZodFunction:()=>zi,ZodIntersection:()=>xr,ZodIssueCode:()=>y,ZodLazy:()=>Cr,ZodLiteral:()=>_r,ZodMap:()=>dn,ZodNaN:()=>mn,ZodNativeEnum:()=>Sr,ZodNever:()=>st,ZodNull:()=>Er,ZodNullable:()=>ht,ZodNumber:()=>yr,ZodObject:()=>Ie,ZodOptional:()=>Ze,ZodParsedType:()=>E,ZodPipeline:()=>ho,ZodPromise:()=>er,ZodReadonly:()=>Or,ZodRecord:()=>Gi,ZodSchema:()=>J,ZodSet:()=>pn,ZodString:()=>Xt,ZodSymbol:()=>cn,ZodTransformer:()=>Xe,ZodTuple:()=>gt,ZodType:()=>J,ZodUndefined:()=>vr,ZodUnion:()=>Fr,ZodUnknown:()=>Ot,ZodVoid:()=>fn,addIssueToContext:()=>b,any:()=>rb,array:()=>sb,bigint:()=>YD,boolean:()=>wm,coerce:()=>Ab,custom:()=>gm,date:()=>XD,datetimeRegex:()=>pm,defaultErrorMap:()=>Tt,discriminatedUnion:()=>cb,effect:()=>Eb,enum:()=>Db,function:()=>hb,getErrorMap:()=>an,getParsedType:()=>mt,instanceof:()=>KD,intersection:()=>fb,isAborted:()=>Vi,isAsync:()=>ln,isDirty:()=>Hi,isValid:()=>Yt,late:()=>qD,lazy:()=>yb,literal:()=>wb,makeIssue:()=>mo,map:()=>mb,nan:()=>ZD,nativeEnum:()=>bb,never:()=>ob,null:()=>tb,nullable:()=>xb,number:()=>ym,object:()=>ab,objectUtil:()=>jl,oboolean:()=>Tb,onumber:()=>Sb,optional:()=>Fb,ostring:()=>kb,pipeline:()=>_b,preprocess:()=>Cb,promise:()=>vb,quotelessJson:()=>ED,record:()=>pb,set:()=>gb,setErrorMap:()=>xD,strictObject:()=>lb,string:()=>hm,symbol:()=>QD,transformer:()=>Eb,tuple:()=>db,undefined:()=>eb,union:()=>ub,unknown:()=>nb,util:()=>z,void:()=>ib});var z;(function(e){e.assertEqual=o=>{};function t(o){}e.assertIs=t;function r(o){throw new Error}e.assertNever=r,e.arrayToEnum=o=>{let i={};for(let s of o)i[s]=s;return i},e.getValidEnumValues=o=>{let i=e.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),s={};for(let a of i)s[a]=o[a];return e.objectValues(s)},e.objectValues=o=>e.objectKeys(o).map(function(i){return o[i]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let i=[];for(let s in o)Object.prototype.hasOwnProperty.call(o,s)&&i.push(s);return i},e.find=(o,i)=>{for(let s of o)if(i(s))return s},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,i=" | "){return o.map(s=>typeof s=="string"?`'${s}'`:s).join(i)}e.joinValues=n,e.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(z||(z={}));var jl;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(jl||(jl={}));var E=z.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),mt=e=>{switch(typeof e){case"undefined":return E.undefined;case"string":return E.string;case"number":return Number.isNaN(e)?E.nan:E.number;case"boolean":return E.boolean;case"function":return E.function;case"bigint":return E.bigint;case"symbol":return E.symbol;case"object":return Array.isArray(e)?E.array:e===null?E.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?E.promise:typeof Map<"u"&&e instanceof Map?E.map:typeof Set<"u"&&e instanceof Set?E.set:typeof Date<"u"&&e instanceof Date?E.date:E.object;default:return E.unknown}};var y=z.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),ED=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),Oe=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(i){return i.message},n={_errors:[]},o=i=>{for(let s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(o);else if(s.code==="invalid_return_type")o(s.returnTypeError);else if(s.code==="invalid_arguments")o(s.argumentsError);else if(s.path.length===0)n._errors.push(r(s));else{let a=n,l=0;for(;l<s.path.length;){let c=s.path[l];l===s.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(r(s))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return o(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,z.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let o of this.issues)if(o.path.length>0){let i=o.path[0];r[i]=r[i]||[],r[i].push(t(o))}else n.push(t(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Oe.create=e=>new Oe(e);var FD=(e,t)=>{let r;switch(e.code){case y.invalid_type:e.received===E.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case y.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,z.jsonStringifyReplacer)}`;break;case y.unrecognized_keys:r=`Unrecognized key(s) in object: ${z.joinValues(e.keys,", ")}`;break;case y.invalid_union:r="Invalid input";break;case y.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${z.joinValues(e.options)}`;break;case y.invalid_enum_value:r=`Invalid enum value. Expected ${z.joinValues(e.options)}, received '${e.received}'`;break;case y.invalid_arguments:r="Invalid function arguments";break;case y.invalid_return_type:r="Invalid function return type";break;case y.invalid_date:r="Invalid date";break;case y.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:z.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case y.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case y.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case y.custom:r="Invalid input";break;case y.invalid_intersection_types:r="Intersection results could not be merged";break;case y.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case y.not_finite:r="Number must be finite";break;default:r=t.defaultError,z.assertNever(e)}return{message:r}},Tt=FD;var lm=Tt;function xD(e){lm=e}function an(){return lm}var mo=e=>{let{data:t,path:r,errorMaps:n,issueData:o}=e,i=[...r,...o.path||[]],s={...o,path:i};if(o.message!==void 0)return{...o,path:i,message:o.message};let a="",l=n.filter(c=>!!c).slice().reverse();for(let c of l)a=c(s,{data:t,defaultError:a}).message;return{...o,path:i,message:a}},CD=[];function b(e,t){let r=an(),n=mo({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Tt?void 0:Tt].filter(o=>!!o)});e.common.issues.push(n)}var ve=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let o of r){if(o.status==="aborted")return $;o.status==="dirty"&&t.dirty(),n.push(o.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let o of r){let i=await o.key,s=await o.value;n.push({key:i,value:s})}return e.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let o of r){let{key:i,value:s}=o;if(i.status==="aborted"||s.status==="aborted")return $;i.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof s.value<"u"||o.alwaysSet)&&(n[i.value]=s.value)}return{status:t.value,value:n}}},$=Object.freeze({status:"aborted"}),hr=e=>({status:"dirty",value:e}),Fe=e=>({status:"valid",value:e}),Vi=e=>e.status==="aborted",Hi=e=>e.status==="dirty",Yt=e=>e.status==="valid",ln=e=>typeof Promise<"u"&&e instanceof Promise;var _;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(_||(_={}));var Ye=class{constructor(t,r,n,o){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},um=(e,t)=>{if(Yt(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Oe(e.common.issues);return this._error=r,this._error}}};function W(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:o}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(s,a)=>{let{message:l}=e;return s.code==="invalid_enum_value"?{message:l??a.defaultError}:typeof a.data>"u"?{message:l??n??a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:l??r??a.defaultError}},description:o}}var J=class{get description(){return this._def.description}_getType(t){return mt(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:mt(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new ve,ctx:{common:t.parent.common,data:t.data,parsedType:mt(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(ln(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:mt(t)},o=this._parseSync({data:t,path:n.path,parent:n});return um(n,o)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:mt(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return Yt(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(n=>Yt(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(t,r){let n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:mt(t)},o=this._parse({data:t,path:n.path,parent:n}),i=await(ln(o)?o:Promise.resolve(o));return um(n,i)}refine(t,r){let n=o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,i)=>{let s=t(o),a=()=>i.addIssue({code:y.custom,...n(o)});return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(t,r){return this._refinement((n,o)=>t(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(t){return new Xe({schema:this,typeName:R.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Ze.create(this,this._def)}nullable(){return ht.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return It.create(this)}promise(){return er.create(this,this._def)}or(t){return Fr.create([this,t],this._def)}and(t){return xr.create(this,t,this._def)}transform(t){return new Xe({...W(this._def),schema:this,typeName:R.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new Tr({...W(this._def),innerType:this,defaultValue:r,typeName:R.ZodDefault})}brand(){return new go({typeName:R.ZodBranded,type:this,...W(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new Ar({...W(this._def),innerType:this,catchValue:r,typeName:R.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return ho.create(this,t)}readonly(){return Or.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},_D=/^c[^\s-]{8,}$/i,kD=/^[0-9a-z]+$/,SD=/^[0-9A-HJKMNP-TV-Z]{26}$/i,TD=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,AD=/^[a-z0-9_-]{21}$/i,OD=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,ID=/^[-+]?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)?)??$/,$D=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,RD="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Nl,PD=/^(?:(?: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])$/,jD=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,ND=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,BD=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,MD=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,LD=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,fm="((\\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])))",WD=new RegExp(`^${fm}$`);function dm(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function UD(e){return new RegExp(`^${dm(e)}$`)}function pm(e){let t=`${fm}T${dm(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function VD(e,t){return!!((t==="v4"||!t)&&PD.test(e)||(t==="v6"||!t)&&ND.test(e))}function HD(e,t){if(!OD.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||t&&o.alg!==t)}catch{return!1}}function JD(e,t){return!!((t==="v4"||!t)&&jD.test(e)||(t==="v6"||!t)&&BD.test(e))}var Xt=class e extends J{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==E.string){let i=this._getOrReturnCtx(t);return b(i,{code:y.invalid_type,expected:E.string,received:i.parsedType}),$}let n=new ve,o;for(let i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(o=this._getOrReturnCtx(t,o),b(o,{code:y.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")t.data.length>i.value&&(o=this._getOrReturnCtx(t,o),b(o,{code:y.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){let s=t.data.length>i.value,a=t.data.length<i.value;(s||a)&&(o=this._getOrReturnCtx(t,o),s?b(o,{code:y.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&b(o,{code:y.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")$D.test(t.data)||(o=this._getOrReturnCtx(t,o),b(o,{validation:"email",code:y.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")Nl||(Nl=new RegExp(RD,"u")),Nl.test(t.data)||(o=this._getOrReturnCtx(t,o),b(o,{validation:"emoji",code:y.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")TD.test(t.data)||(o=this._getOrReturnCtx(t,o),b(o,{validation:"uuid",code:y.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")AD.test(t.data)||(o=this._getOrReturnCtx(t,o),b(o,{validation:"nanoid",code:y.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")_D.test(t.data)||(o=this._getOrReturnCtx(t,o),b(o,{validation:"cuid",code:y.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")kD.test(t.data)||(o=this._getOrReturnCtx(t,o),b(o,{validation:"cuid2",code:y.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")SD.test(t.data)||(o=this._getOrReturnCtx(t,o),b(o,{validation:"ulid",code:y.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),b(o,{validation:"url",code:y.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),b(o,{validation:"regex",code:y.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(o=this._getOrReturnCtx(t,o),b(o,{code:y.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(o=this._getOrReturnCtx(t,o),b(o,{code:y.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(o=this._getOrReturnCtx(t,o),b(o,{code:y.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?pm(i).test(t.data)||(o=this._getOrReturnCtx(t,o),b(o,{code:y.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?WD.test(t.data)||(o=this._getOrReturnCtx(t,o),b(o,{code:y.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?UD(i).test(t.data)||(o=this._getOrReturnCtx(t,o),b(o,{code:y.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?ID.test(t.data)||(o=this._getOrReturnCtx(t,o),b(o,{validation:"duration",code:y.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?VD(t.data,i.version)||(o=this._getOrReturnCtx(t,o),b(o,{validation:"ip",code:y.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?HD(t.data,i.alg)||(o=this._getOrReturnCtx(t,o),b(o,{validation:"jwt",code:y.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?JD(t.data,i.version)||(o=this._getOrReturnCtx(t,o),b(o,{validation:"cidr",code:y.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?MD.test(t.data)||(o=this._getOrReturnCtx(t,o),b(o,{validation:"base64",code:y.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?LD.test(t.data)||(o=this._getOrReturnCtx(t,o),b(o,{validation:"base64url",code:y.invalid_string,message:i.message}),n.dirty()):z.assertNever(i);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(o=>t.test(o),{validation:r,code:y.invalid_string,..._.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",..._.errToObj(t)})}url(t){return this._addCheck({kind:"url",..._.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",..._.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",..._.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",..._.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",..._.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",..._.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",..._.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",..._.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",..._.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",..._.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",..._.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",..._.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,..._.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,..._.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",..._.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,..._.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,..._.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,..._.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,..._.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,..._.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,..._.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,..._.errToObj(r)})}nonempty(t){return this.min(1,_.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Xt.create=e=>new Xt({checks:[],typeName:R.ZodString,coerce:e?.coerce??!1,...W(e)});function GD(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,i=Number.parseInt(e.toFixed(o).replace(".","")),s=Number.parseInt(t.toFixed(o).replace(".",""));return i%s/10**o}var yr=class e extends J{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==E.number){let i=this._getOrReturnCtx(t);return b(i,{code:y.invalid_type,expected:E.number,received:i.parsedType}),$}let n,o=new ve;for(let i of this._def.checks)i.kind==="int"?z.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),b(n,{code:y.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),b(n,{code:y.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),b(n,{code:y.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?GD(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),b(n,{code:y.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),b(n,{code:y.not_finite,message:i.message}),o.dirty()):z.assertNever(i);return{status:o.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,_.toString(r))}gt(t,r){return this.setLimit("min",t,!1,_.toString(r))}lte(t,r){return this.setLimit("max",t,!0,_.toString(r))}lt(t,r){return this.setLimit("max",t,!1,_.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:_.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:_.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:_.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:_.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:_.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:_.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:_.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:_.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:_.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:_.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&z.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};yr.create=e=>new yr({checks:[],typeName:R.ZodNumber,coerce:e?.coerce||!1,...W(e)});var wr=class e extends J{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==E.bigint)return this._getInvalidInput(t);let n,o=new ve;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),b(n,{code:y.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),b(n,{code:y.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),b(n,{code:y.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):z.assertNever(i);return{status:o.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return b(r,{code:y.invalid_type,expected:E.bigint,received:r.parsedType}),$}gte(t,r){return this.setLimit("min",t,!0,_.toString(r))}gt(t,r){return this.setLimit("min",t,!1,_.toString(r))}lte(t,r){return this.setLimit("max",t,!0,_.toString(r))}lt(t,r){return this.setLimit("max",t,!1,_.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:_.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:_.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:_.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:_.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:_.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:_.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};wr.create=e=>new wr({checks:[],typeName:R.ZodBigInt,coerce:e?.coerce??!1,...W(e)});var Dr=class extends J{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==E.boolean){let n=this._getOrReturnCtx(t);return b(n,{code:y.invalid_type,expected:E.boolean,received:n.parsedType}),$}return Fe(t.data)}};Dr.create=e=>new Dr({typeName:R.ZodBoolean,coerce:e?.coerce||!1,...W(e)});var br=class e extends J{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==E.date){let i=this._getOrReturnCtx(t);return b(i,{code:y.invalid_type,expected:E.date,received:i.parsedType}),$}if(Number.isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return b(i,{code:y.invalid_date}),$}let n=new ve,o;for(let i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(o=this._getOrReturnCtx(t,o),b(o,{code:y.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(o=this._getOrReturnCtx(t,o),b(o,{code:y.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):z.assertNever(i);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:_.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:_.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};br.create=e=>new br({checks:[],coerce:e?.coerce||!1,typeName:R.ZodDate,...W(e)});var cn=class extends J{_parse(t){if(this._getType(t)!==E.symbol){let n=this._getOrReturnCtx(t);return b(n,{code:y.invalid_type,expected:E.symbol,received:n.parsedType}),$}return Fe(t.data)}};cn.create=e=>new cn({typeName:R.ZodSymbol,...W(e)});var vr=class extends J{_parse(t){if(this._getType(t)!==E.undefined){let n=this._getOrReturnCtx(t);return b(n,{code:y.invalid_type,expected:E.undefined,received:n.parsedType}),$}return Fe(t.data)}};vr.create=e=>new vr({typeName:R.ZodUndefined,...W(e)});var Er=class extends J{_parse(t){if(this._getType(t)!==E.null){let n=this._getOrReturnCtx(t);return b(n,{code:y.invalid_type,expected:E.null,received:n.parsedType}),$}return Fe(t.data)}};Er.create=e=>new Er({typeName:R.ZodNull,...W(e)});var Qt=class extends J{constructor(){super(...arguments),this._any=!0}_parse(t){return Fe(t.data)}};Qt.create=e=>new Qt({typeName:R.ZodAny,...W(e)});var Ot=class extends J{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Fe(t.data)}};Ot.create=e=>new Ot({typeName:R.ZodUnknown,...W(e)});var st=class extends J{_parse(t){let r=this._getOrReturnCtx(t);return b(r,{code:y.invalid_type,expected:E.never,received:r.parsedType}),$}};st.create=e=>new st({typeName:R.ZodNever,...W(e)});var fn=class extends J{_parse(t){if(this._getType(t)!==E.undefined){let n=this._getOrReturnCtx(t);return b(n,{code:y.invalid_type,expected:E.void,received:n.parsedType}),$}return Fe(t.data)}};fn.create=e=>new fn({typeName:R.ZodVoid,...W(e)});var It=class e extends J{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),o=this._def;if(r.parsedType!==E.array)return b(r,{code:y.invalid_type,expected:E.array,received:r.parsedType}),$;if(o.exactLength!==null){let s=r.data.length>o.exactLength.value,a=r.data.length<o.exactLength.value;(s||a)&&(b(r,{code:s?y.too_big:y.too_small,minimum:a?o.exactLength.value:void 0,maximum:s?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),n.dirty())}if(o.minLength!==null&&r.data.length<o.minLength.value&&(b(r,{code:y.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),n.dirty()),o.maxLength!==null&&r.data.length>o.maxLength.value&&(b(r,{code:y.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((s,a)=>o.type._parseAsync(new Ye(r,s,r.path,a)))).then(s=>ve.mergeArray(n,s));let i=[...r.data].map((s,a)=>o.type._parseSync(new Ye(r,s,r.path,a)));return ve.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:_.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:_.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:_.toString(r)}})}nonempty(t){return this.min(1,t)}};It.create=(e,t)=>new It({type:e,minLength:null,maxLength:null,exactLength:null,typeName:R.ZodArray,...W(t)});function un(e){if(e instanceof Ie){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=Ze.create(un(n))}return new Ie({...e._def,shape:()=>t})}else return e instanceof It?new It({...e._def,type:un(e.element)}):e instanceof Ze?Ze.create(un(e.unwrap())):e instanceof ht?ht.create(un(e.unwrap())):e instanceof gt?gt.create(e.items.map(t=>un(t))):e}var Ie=class e extends J{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=z.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==E.object){let c=this._getOrReturnCtx(t);return b(c,{code:y.invalid_type,expected:E.object,received:c.parsedType}),$}let{status:n,ctx:o}=this._processInputParams(t),{shape:i,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof st&&this._def.unknownKeys==="strip"))for(let c in o.data)s.includes(c)||a.push(c);let l=[];for(let c of s){let f=i[c],p=o.data[c];l.push({key:{status:"valid",value:c},value:f._parse(new Ye(o,p,o.path,c)),alwaysSet:c in o.data})}if(this._def.catchall instanceof st){let c=this._def.unknownKeys;if(c==="passthrough")for(let f of a)l.push({key:{status:"valid",value:f},value:{status:"valid",value:o.data[f]}});else if(c==="strict")a.length>0&&(b(o,{code:y.unrecognized_keys,keys:a}),n.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let f of a){let p=o.data[f];l.push({key:{status:"valid",value:f},value:c._parse(new Ye(o,p,o.path,f)),alwaysSet:f in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let c=[];for(let f of l){let p=await f.key,m=await f.value;c.push({key:p,value:m,alwaysSet:f.alwaysSet})}return c}).then(c=>ve.mergeObjectSync(n,c)):ve.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(t){return _.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{let o=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:_.errToObj(t).message??o}:{message:o}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:R.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};for(let n of z.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}omit(t){let r={};for(let n of z.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return un(this)}partial(t){let r={};for(let n of z.objectKeys(this.shape)){let o=this.shape[n];t&&!t[n]?r[n]=o:r[n]=o.optional()}return new e({...this._def,shape:()=>r})}required(t){let r={};for(let n of z.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof Ze;)i=i._def.innerType;r[n]=i}return new e({...this._def,shape:()=>r})}keyof(){return mm(z.objectKeys(this.shape))}};Ie.create=(e,t)=>new Ie({shape:()=>e,unknownKeys:"strip",catchall:st.create(),typeName:R.ZodObject,...W(t)});Ie.strictCreate=(e,t)=>new Ie({shape:()=>e,unknownKeys:"strict",catchall:st.create(),typeName:R.ZodObject,...W(t)});Ie.lazycreate=(e,t)=>new Ie({shape:e,unknownKeys:"strip",catchall:st.create(),typeName:R.ZodObject,...W(t)});var Fr=class extends J{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function o(i){for(let a of i)if(a.result.status==="valid")return a.result;for(let a of i)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let s=i.map(a=>new Oe(a.ctx.common.issues));return b(r,{code:y.invalid_union,unionErrors:s}),$}if(r.common.async)return Promise.all(n.map(async i=>{let s={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:s}),ctx:s}})).then(o);{let i,s=[];for(let l of n){let c={...r,common:{...r.common,issues:[]},parent:null},f=l._parseSync({data:r.data,path:r.path,parent:c});if(f.status==="valid")return f;f.status==="dirty"&&!i&&(i={result:f,ctx:c}),c.common.issues.length&&s.push(c.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;let a=s.map(l=>new Oe(l));return b(r,{code:y.invalid_union,unionErrors:a}),$}}get options(){return this._def.options}};Fr.create=(e,t)=>new Fr({options:e,typeName:R.ZodUnion,...W(t)});var At=e=>e instanceof Cr?At(e.schema):e instanceof Xe?At(e.innerType()):e instanceof _r?[e.value]:e instanceof kr?e.options:e instanceof Sr?z.objectValues(e.enum):e instanceof Tr?At(e._def.innerType):e instanceof vr?[void 0]:e instanceof Er?[null]:e instanceof Ze?[void 0,...At(e.unwrap())]:e instanceof ht?[null,...At(e.unwrap())]:e instanceof go||e instanceof Or?At(e.unwrap()):e instanceof Ar?At(e._def.innerType):[],Ji=class e extends J{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==E.object)return b(r,{code:y.invalid_type,expected:E.object,received:r.parsedType}),$;let n=this.discriminator,o=r.data[n],i=this.optionsMap.get(o);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(b(r,{code:y.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),$)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let o=new Map;for(let i of r){let s=At(i.shape[t]);if(!s.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let a of s){if(o.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);o.set(a,i)}}return new e({typeName:R.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:o,...W(n)})}};function Bl(e,t){let r=mt(e),n=mt(t);if(e===t)return{valid:!0,data:e};if(r===E.object&&n===E.object){let o=z.objectKeys(t),i=z.objectKeys(e).filter(a=>o.indexOf(a)!==-1),s={...e,...t};for(let a of i){let l=Bl(e[a],t[a]);if(!l.valid)return{valid:!1};s[a]=l.data}return{valid:!0,data:s}}else if(r===E.array&&n===E.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let i=0;i<e.length;i++){let s=e[i],a=t[i],l=Bl(s,a);if(!l.valid)return{valid:!1};o.push(l.data)}return{valid:!0,data:o}}else return r===E.date&&n===E.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var xr=class extends J{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=(i,s)=>{if(Vi(i)||Vi(s))return $;let a=Bl(i.value,s.value);return a.valid?((Hi(i)||Hi(s))&&r.dirty(),{status:r.value,value:a.data}):(b(n,{code:y.invalid_intersection_types}),$)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,s])=>o(i,s)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};xr.create=(e,t,r)=>new xr({left:e,right:t,typeName:R.ZodIntersection,...W(r)});var gt=class e extends J{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==E.array)return b(n,{code:y.invalid_type,expected:E.array,received:n.parsedType}),$;if(n.data.length<this._def.items.length)return b(n,{code:y.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),$;!this._def.rest&&n.data.length>this._def.items.length&&(b(n,{code:y.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...n.data].map((s,a)=>{let l=this._def.items[a]||this._def.rest;return l?l._parse(new Ye(n,s,n.path,a)):null}).filter(s=>!!s);return n.common.async?Promise.all(i).then(s=>ve.mergeArray(r,s)):ve.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};gt.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new gt({items:e,typeName:R.ZodTuple,rest:null,...W(t)})};var Gi=class e extends J{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==E.object)return b(n,{code:y.invalid_type,expected:E.object,received:n.parsedType}),$;let o=[],i=this._def.keyType,s=this._def.valueType;for(let a in n.data)o.push({key:i._parse(new Ye(n,a,n.path,a)),value:s._parse(new Ye(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?ve.mergeObjectAsync(r,o):ve.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof J?new e({keyType:t,valueType:r,typeName:R.ZodRecord,...W(n)}):new e({keyType:Xt.create(),valueType:t,typeName:R.ZodRecord,...W(r)})}},dn=class extends J{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==E.map)return b(n,{code:y.invalid_type,expected:E.map,received:n.parsedType}),$;let o=this._def.keyType,i=this._def.valueType,s=[...n.data.entries()].map(([a,l],c)=>({key:o._parse(new Ye(n,a,n.path,[c,"key"])),value:i._parse(new Ye(n,l,n.path,[c,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let l of s){let c=await l.key,f=await l.value;if(c.status==="aborted"||f.status==="aborted")return $;(c.status==="dirty"||f.status==="dirty")&&r.dirty(),a.set(c.value,f.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let l of s){let c=l.key,f=l.value;if(c.status==="aborted"||f.status==="aborted")return $;(c.status==="dirty"||f.status==="dirty")&&r.dirty(),a.set(c.value,f.value)}return{status:r.value,value:a}}}};dn.create=(e,t,r)=>new dn({valueType:t,keyType:e,typeName:R.ZodMap,...W(r)});var pn=class e extends J{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==E.set)return b(n,{code:y.invalid_type,expected:E.set,received:n.parsedType}),$;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(b(n,{code:y.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),r.dirty()),o.maxSize!==null&&n.data.size>o.maxSize.value&&(b(n,{code:y.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let i=this._def.valueType;function s(l){let c=new Set;for(let f of l){if(f.status==="aborted")return $;f.status==="dirty"&&r.dirty(),c.add(f.value)}return{status:r.value,value:c}}let a=[...n.data.values()].map((l,c)=>i._parse(new Ye(n,l,n.path,c)));return n.common.async?Promise.all(a).then(l=>s(l)):s(a)}min(t,r){return new e({...this._def,minSize:{value:t,message:_.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:_.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};pn.create=(e,t)=>new pn({valueType:e,minSize:null,maxSize:null,typeName:R.ZodSet,...W(t)});var zi=class e extends J{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==E.function)return b(r,{code:y.invalid_type,expected:E.function,received:r.parsedType}),$;function n(a,l){return mo({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,an(),Tt].filter(c=>!!c),issueData:{code:y.invalid_arguments,argumentsError:l}})}function o(a,l){return mo({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,an(),Tt].filter(c=>!!c),issueData:{code:y.invalid_return_type,returnTypeError:l}})}let i={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof er){let a=this;return Fe(async function(...l){let c=new Oe([]),f=await a._def.args.parseAsync(l,i).catch(h=>{throw c.addIssue(n(l,h)),c}),p=await Reflect.apply(s,this,f);return await a._def.returns._def.type.parseAsync(p,i).catch(h=>{throw c.addIssue(o(p,h)),c})})}else{let a=this;return Fe(function(...l){let c=a._def.args.safeParse(l,i);if(!c.success)throw new Oe([n(l,c.error)]);let f=Reflect.apply(s,this,c.data),p=a._def.returns.safeParse(f,i);if(!p.success)throw new Oe([o(f,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:gt.create(t).rest(Ot.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new e({args:t||gt.create([]).rest(Ot.create()),returns:r||Ot.create(),typeName:R.ZodFunction,...W(n)})}},Cr=class extends J{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Cr.create=(e,t)=>new Cr({getter:e,typeName:R.ZodLazy,...W(t)});var _r=class extends J{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return b(r,{received:r.data,code:y.invalid_literal,expected:this._def.value}),$}return{status:"valid",value:t.data}}get value(){return this._def.value}};_r.create=(e,t)=>new _r({value:e,typeName:R.ZodLiteral,...W(t)});function mm(e,t){return new kr({values:e,typeName:R.ZodEnum,...W(t)})}var kr=class e extends J{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return b(r,{expected:z.joinValues(n),received:r.parsedType,code:y.invalid_type}),$}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return b(r,{received:r.data,code:y.invalid_enum_value,options:n}),$}return Fe(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};kr.create=mm;var Sr=class extends J{_parse(t){let r=z.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==E.string&&n.parsedType!==E.number){let o=z.objectValues(r);return b(n,{expected:z.joinValues(o),received:n.parsedType,code:y.invalid_type}),$}if(this._cache||(this._cache=new Set(z.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let o=z.objectValues(r);return b(n,{received:n.data,code:y.invalid_enum_value,options:o}),$}return Fe(t.data)}get enum(){return this._def.values}};Sr.create=(e,t)=>new Sr({values:e,typeName:R.ZodNativeEnum,...W(t)});var er=class extends J{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==E.promise&&r.common.async===!1)return b(r,{code:y.invalid_type,expected:E.promise,received:r.parsedType}),$;let n=r.parsedType===E.promise?r.data:Promise.resolve(r.data);return Fe(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};er.create=(e,t)=>new er({type:e,typeName:R.ZodPromise,...W(t)});var Xe=class extends J{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===R.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=this._def.effect||null,i={addIssue:s=>{b(n,s),s.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){let s=o.transform(n.data,i);if(n.common.async)return Promise.resolve(s).then(async a=>{if(r.value==="aborted")return $;let l=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return l.status==="aborted"?$:l.status==="dirty"?hr(l.value):r.value==="dirty"?hr(l.value):l});{if(r.value==="aborted")return $;let a=this._def.schema._parseSync({data:s,path:n.path,parent:n});return a.status==="aborted"?$:a.status==="dirty"?hr(a.value):r.value==="dirty"?hr(a.value):a}}if(o.type==="refinement"){let s=a=>{let l=o.refinement(a,i);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?$:(a.status==="dirty"&&r.dirty(),s(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?$:(a.status==="dirty"&&r.dirty(),s(a.value).then(()=>({status:r.value,value:a.value}))))}if(o.type==="transform")if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Yt(s))return $;let a=o.transform(s.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>Yt(s)?Promise.resolve(o.transform(s.value,i)).then(a=>({status:r.value,value:a})):$);z.assertNever(o)}};Xe.create=(e,t,r)=>new Xe({schema:e,typeName:R.ZodEffects,effect:t,...W(r)});Xe.createWithPreprocess=(e,t,r)=>new Xe({schema:t,effect:{type:"preprocess",transform:e},typeName:R.ZodEffects,...W(r)});var Ze=class extends J{_parse(t){return this._getType(t)===E.undefined?Fe(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Ze.create=(e,t)=>new Ze({innerType:e,typeName:R.ZodOptional,...W(t)});var ht=class extends J{_parse(t){return this._getType(t)===E.null?Fe(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};ht.create=(e,t)=>new ht({innerType:e,typeName:R.ZodNullable,...W(t)});var Tr=class extends J{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===E.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Tr.create=(e,t)=>new Tr({innerType:e,typeName:R.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...W(t)});var Ar=class extends J{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return ln(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Oe(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Oe(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Ar.create=(e,t)=>new Ar({innerType:e,typeName:R.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...W(t)});var mn=class extends J{_parse(t){if(this._getType(t)!==E.nan){let n=this._getOrReturnCtx(t);return b(n,{code:y.invalid_type,expected:E.nan,received:n.parsedType}),$}return{status:"valid",value:t.data}}};mn.create=e=>new mn({typeName:R.ZodNaN,...W(e)});var zD=Symbol("zod_brand"),go=class extends J{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},ho=class e extends J{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?$:i.status==="dirty"?(r.dirty(),hr(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?$:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(t,r){return new e({in:t,out:r,typeName:R.ZodPipeline})}},Or=class extends J{_parse(t){let r=this._def.innerType._parse(t),n=o=>(Yt(o)&&(o.value=Object.freeze(o.value)),o);return ln(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};Or.create=(e,t)=>new Or({innerType:e,typeName:R.ZodReadonly,...W(t)});function cm(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function gm(e,t={},r){return e?Qt.create().superRefine((n,o)=>{let i=e(n);if(i instanceof Promise)return i.then(s=>{if(!s){let a=cm(t,n),l=a.fatal??r??!0;o.addIssue({code:"custom",...a,fatal:l})}});if(!i){let s=cm(t,n),a=s.fatal??r??!0;o.addIssue({code:"custom",...s,fatal:a})}}):Qt.create()}var qD={object:Ie.lazycreate},R;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(R||(R={}));var KD=(e,t={message:`Input not instance of ${e.name}`})=>gm(r=>r instanceof e,t),hm=Xt.create,ym=yr.create,ZD=mn.create,YD=wr.create,wm=Dr.create,XD=br.create,QD=cn.create,eb=vr.create,tb=Er.create,rb=Qt.create,nb=Ot.create,ob=st.create,ib=fn.create,sb=It.create,ab=Ie.create,lb=Ie.strictCreate,ub=Fr.create,cb=Ji.create,fb=xr.create,db=gt.create,pb=Gi.create,mb=dn.create,gb=pn.create,hb=zi.create,yb=Cr.create,wb=_r.create,Db=kr.create,bb=Sr.create,vb=er.create,Eb=Xe.create,Fb=Ze.create,xb=ht.create,Cb=Xe.createWithPreprocess,_b=ho.create,kb=()=>hm().optional(),Sb=()=>ym().optional(),Tb=()=>wm().optional(),Ab={string:(e=>Xt.create({...e,coerce:!0})),number:(e=>yr.create({...e,coerce:!0})),boolean:(e=>Dr.create({...e,coerce:!0})),bigint:(e=>wr.create({...e,coerce:!0})),date:(e=>br.create({...e,coerce:!0}))};var Ob=$;function qi(e,t=!1){let r=e.length,n=0,o="",i=0,s=16,a=0,l=0,c=0,f=0,p=0;function m(D,K){let Z=0,j=0;for(;Z<D||!K;){let N=e.charCodeAt(n);if(N>=48&&N<=57)j=j*16+N-48;else if(N>=65&&N<=70)j=j*16+N-65+10;else if(N>=97&&N<=102)j=j*16+N-97+10;else break;n++,Z++}return Z<D&&(j=-1),j}function h(D){n=D,o="",i=0,s=16,p=0}function w(){let D=n;if(e.charCodeAt(n)===48)n++;else for(n++;n<e.length&&gn(e.charCodeAt(n));)n++;if(n<e.length&&e.charCodeAt(n)===46)if(n++,n<e.length&&gn(e.charCodeAt(n)))for(n++;n<e.length&&gn(e.charCodeAt(n));)n++;else return p=3,e.substring(D,n);let K=n;if(n<e.length&&(e.charCodeAt(n)===69||e.charCodeAt(n)===101))if(n++,(n<e.length&&e.charCodeAt(n)===43||e.charCodeAt(n)===45)&&n++,n<e.length&&gn(e.charCodeAt(n))){for(n++;n<e.length&&gn(e.charCodeAt(n));)n++;K=n}else p=3;return e.substring(D,K)}function k(){let D="",K=n;for(;;){if(n>=r){D+=e.substring(K,n),p=2;break}let Z=e.charCodeAt(n);if(Z===34){D+=e.substring(K,n),n++;break}if(Z===92){if(D+=e.substring(K,n),n++,n>=r){p=2;break}switch(e.charCodeAt(n++)){case 34:D+='"';break;case 92:D+="\\";break;case 47:D+="/";break;case 98:D+="\b";break;case 102:D+="\f";break;case 110:D+=`
|
|
108
|
+
`;break;case 114:D+="\r";break;case 116:D+=" ";break;case 117:let N=m(4,!0);N>=0?D+=String.fromCharCode(N):p=4;break;default:p=5}K=n;continue}if(Z>=0&&Z<=31)if(yo(Z)){D+=e.substring(K,n),p=2;break}else p=6;n++}return D}function P(){if(o="",p=0,i=n,l=a,f=c,n>=r)return i=r,s=17;let D=e.charCodeAt(n);if(Ml(D)){do n++,o+=String.fromCharCode(D),D=e.charCodeAt(n);while(Ml(D));return s=15}if(yo(D))return n++,o+=String.fromCharCode(D),D===13&&e.charCodeAt(n)===10&&(n++,o+=`
|
|
109
|
+
`),a++,c=n,s=14;switch(D){case 123:return n++,s=1;case 125:return n++,s=2;case 91:return n++,s=3;case 93:return n++,s=4;case 58:return n++,s=6;case 44:return n++,s=5;case 34:return n++,o=k(),s=10;case 47:let K=n-1;if(e.charCodeAt(n+1)===47){for(n+=2;n<r&&!yo(e.charCodeAt(n));)n++;return o=e.substring(K,n),s=12}if(e.charCodeAt(n+1)===42){n+=2;let Z=r-1,j=!1;for(;n<Z;){let N=e.charCodeAt(n);if(N===42&&e.charCodeAt(n+1)===47){n+=2,j=!0;break}n++,yo(N)&&(N===13&&e.charCodeAt(n)===10&&n++,a++,c=n)}return j||(n++,p=1),o=e.substring(K,n),s=13}return o+=String.fromCharCode(D),n++,s=16;case 45:if(o+=String.fromCharCode(D),n++,n===r||!gn(e.charCodeAt(n)))return s=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return o+=w(),s=11;default:for(;n<r&&V(D);)n++,D=e.charCodeAt(n);if(i!==n){switch(o=e.substring(i,n),o){case"true":return s=8;case"false":return s=9;case"null":return s=7}return s=16}return o+=String.fromCharCode(D),n++,s=16}}function V(D){if(Ml(D)||yo(D))return!1;switch(D){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function le(){let D;do D=P();while(D>=12&&D<=15);return D}return{setPosition:h,getPosition:()=>n,scan:t?le:P,getToken:()=>s,getTokenValue:()=>o,getTokenOffset:()=>i,getTokenLength:()=>n-i,getTokenStartLine:()=>l,getTokenStartCharacter:()=>i-f,getTokenError:()=>p}}function Ml(e){return e===32||e===9}function yo(e){return e===10||e===13}function gn(e){return e>=48&&e<=57}var Dm;(function(e){e[e.lineFeed=10]="lineFeed",e[e.carriageReturn=13]="carriageReturn",e[e.space=32]="space",e[e._0=48]="_0",e[e._1=49]="_1",e[e._2=50]="_2",e[e._3=51]="_3",e[e._4=52]="_4",e[e._5=53]="_5",e[e._6=54]="_6",e[e._7=55]="_7",e[e._8=56]="_8",e[e._9=57]="_9",e[e.a=97]="a",e[e.b=98]="b",e[e.c=99]="c",e[e.d=100]="d",e[e.e=101]="e",e[e.f=102]="f",e[e.g=103]="g",e[e.h=104]="h",e[e.i=105]="i",e[e.j=106]="j",e[e.k=107]="k",e[e.l=108]="l",e[e.m=109]="m",e[e.n=110]="n",e[e.o=111]="o",e[e.p=112]="p",e[e.q=113]="q",e[e.r=114]="r",e[e.s=115]="s",e[e.t=116]="t",e[e.u=117]="u",e[e.v=118]="v",e[e.w=119]="w",e[e.x=120]="x",e[e.y=121]="y",e[e.z=122]="z",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.asterisk=42]="asterisk",e[e.backslash=92]="backslash",e[e.closeBrace=125]="closeBrace",e[e.closeBracket=93]="closeBracket",e[e.colon=58]="colon",e[e.comma=44]="comma",e[e.dot=46]="dot",e[e.doubleQuote=34]="doubleQuote",e[e.minus=45]="minus",e[e.openBrace=123]="openBrace",e[e.openBracket=91]="openBracket",e[e.plus=43]="plus",e[e.slash=47]="slash",e[e.formFeed=12]="formFeed",e[e.tab=9]="tab"})(Dm||(Dm={}));var $b=new Array(20).fill(0).map((e,t)=>" ".repeat(t)),hn=200,Rb={" ":{"\n":new Array(hn).fill(0).map((e,t)=>`
|
|
110
|
+
`+" ".repeat(t)),"\r":new Array(hn).fill(0).map((e,t)=>"\r"+" ".repeat(t)),"\r\n":new Array(hn).fill(0).map((e,t)=>`\r
|
|
111
|
+
`+" ".repeat(t))}," ":{"\n":new Array(hn).fill(0).map((e,t)=>`
|
|
112
|
+
`+" ".repeat(t)),"\r":new Array(hn).fill(0).map((e,t)=>"\r"+" ".repeat(t)),"\r\n":new Array(hn).fill(0).map((e,t)=>`\r
|
|
113
|
+
`+" ".repeat(t))}};var Ki;(function(e){e.DEFAULT={allowTrailingComma:!1}})(Ki||(Ki={}));function bm(e,t=[],r=Ki.DEFAULT){let n=null,o=[],i=[];function s(l){Array.isArray(o)?o.push(l):n!==null&&(o[n]=l)}return vm(e,{onObjectBegin:()=>{let l={};s(l),i.push(o),o=l,n=null},onObjectProperty:l=>{n=l},onObjectEnd:()=>{o=i.pop()},onArrayBegin:()=>{let l=[];s(l),i.push(o),o=l,n=null},onArrayEnd:()=>{o=i.pop()},onLiteralValue:s,onError:(l,c,f)=>{t.push({error:l,offset:c,length:f})}},r),o[0]}function vm(e,t,r=Ki.DEFAULT){let n=qi(e,!1),o=[],i=0;function s(Q){return Q?()=>i===0&&Q(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}function a(Q){return Q?ye=>i===0&&Q(ye,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}function l(Q){return Q?ye=>i===0&&Q(ye,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>o.slice()):()=>!0}function c(Q){return Q?()=>{i>0?i++:Q(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>o.slice())===!1&&(i=1)}:()=>!0}function f(Q){return Q?()=>{i>0&&i--,i===0&&Q(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter())}:()=>!0}let p=c(t.onObjectBegin),m=l(t.onObjectProperty),h=f(t.onObjectEnd),w=c(t.onArrayBegin),k=f(t.onArrayEnd),P=l(t.onLiteralValue),V=a(t.onSeparator),le=s(t.onComment),D=a(t.onError),K=r&&r.disallowComments,Z=r&&r.allowTrailingComma;function j(){for(;;){let Q=n.scan();switch(n.getTokenError()){case 4:N(14);break;case 5:N(15);break;case 3:N(13);break;case 1:K||N(11);break;case 2:N(12);break;case 6:N(16);break}switch(Q){case 12:case 13:K?N(10):le();break;case 16:N(1);break;case 15:case 14:break;default:return Q}}}function N(Q,ye=[],$u=[]){if(D(Q),ye.length+$u.length>0){let Co=n.getToken();for(;Co!==17;){if(ye.indexOf(Co)!==-1){j();break}else if($u.indexOf(Co)!==-1)break;Co=j()}}}function Cn(Q){let ye=n.getTokenValue();return Q?P(ye):(m(ye),o.push(ye)),j(),!0}function cs(){switch(n.getToken()){case 11:let Q=n.getTokenValue(),ye=Number(Q);isNaN(ye)&&(N(2),ye=0),P(ye);break;case 7:P(null);break;case 8:P(!0);break;case 9:P(!1);break;default:return!1}return j(),!0}function fs(){return n.getToken()!==10?(N(3,[],[2,5]),!1):(Cn(!1),n.getToken()===6?(V(":"),j(),ds()||N(4,[],[2,5])):N(5,[],[2,5]),o.pop(),!0)}function ah(){p(),j();let Q=!1;for(;n.getToken()!==2&&n.getToken()!==17;){if(n.getToken()===5){if(Q||N(4,[],[]),V(","),j(),n.getToken()===2&&Z)break}else Q&&N(6,[],[]);fs()||N(4,[],[2,5]),Q=!0}return h(),n.getToken()!==2?N(7,[2],[]):j(),!0}function lh(){w(),j();let Q=!0,ye=!1;for(;n.getToken()!==4&&n.getToken()!==17;){if(n.getToken()===5){if(ye||N(4,[],[]),V(","),j(),n.getToken()===4&&Z)break}else ye&&N(6,[],[]);Q?(o.push(0),Q=!1):o[o.length-1]++,ds()||N(4,[],[4,5]),ye=!0}return k(),Q||o.pop(),n.getToken()!==4?N(8,[4],[]):j(),!0}function ds(){switch(n.getToken()){case 3:return lh();case 1:return ah();case 10:return Cn(!0);default:return cs()}}return j(),n.getToken()===17?r.allowEmptyContent?!0:(N(4,[],[]),!1):ds()?(n.getToken()!==17&&N(9,[],[]),!0):(N(4,[],[]),!1)}var Em;(function(e){e[e.None=0]="None",e[e.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=2]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",e[e.InvalidUnicode=4]="InvalidUnicode",e[e.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",e[e.InvalidCharacter=6]="InvalidCharacter"})(Em||(Em={}));var Fm;(function(e){e[e.OpenBraceToken=1]="OpenBraceToken",e[e.CloseBraceToken=2]="CloseBraceToken",e[e.OpenBracketToken=3]="OpenBracketToken",e[e.CloseBracketToken=4]="CloseBracketToken",e[e.CommaToken=5]="CommaToken",e[e.ColonToken=6]="ColonToken",e[e.NullKeyword=7]="NullKeyword",e[e.TrueKeyword=8]="TrueKeyword",e[e.FalseKeyword=9]="FalseKeyword",e[e.StringLiteral=10]="StringLiteral",e[e.NumericLiteral=11]="NumericLiteral",e[e.LineCommentTrivia=12]="LineCommentTrivia",e[e.BlockCommentTrivia=13]="BlockCommentTrivia",e[e.LineBreakTrivia=14]="LineBreakTrivia",e[e.Trivia=15]="Trivia",e[e.Unknown=16]="Unknown",e[e.EOF=17]="EOF"})(Fm||(Fm={}));var Ir=bm;var xm;(function(e){e[e.InvalidSymbol=1]="InvalidSymbol",e[e.InvalidNumberFormat=2]="InvalidNumberFormat",e[e.PropertyNameExpected=3]="PropertyNameExpected",e[e.ValueExpected=4]="ValueExpected",e[e.ColonExpected=5]="ColonExpected",e[e.CommaExpected=6]="CommaExpected",e[e.CloseBraceExpected=7]="CloseBraceExpected",e[e.CloseBracketExpected=8]="CloseBracketExpected",e[e.EndOfFileExpected=9]="EndOfFileExpected",e[e.InvalidCommentToken=10]="InvalidCommentToken",e[e.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=12]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",e[e.InvalidUnicode=14]="InvalidUnicode",e[e.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",e[e.InvalidCharacter=16]="InvalidCharacter"})(xm||(xm={}));var Fn=g(require("fs")),Rm=g(require("path"));var yn=class extends Error{remediation;documentationUrl;cause;constructor(t,r){super(t),this.name="FrameworkError",this.cause=r?.cause,this.remediation=r?.remediation,this.documentationUrl=r?.documentationUrl,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}toDisplayString(){let t=this.message;return this.remediation&&(t+=`
|
|
114
114
|
|
|
115
|
-
How to fix: ${this.remediation}`),this.documentationUrl&&(
|
|
115
|
+
How to fix: ${this.remediation}`),this.documentationUrl&&(t+=`
|
|
116
116
|
|
|
117
|
-
Documentation: ${this.documentationUrl}`),
|
|
117
|
+
Documentation: ${this.documentationUrl}`),t}},he=class extends yn{constructor(t,r){super(t,r),this.name="FrameworkValidationError"}};var $r=class extends yn{configFile;constructor(t,r){super(t,r),this.name="FrameworkConfigError",this.configFile=r?.configFile}toDisplayString(){let t=super.toDisplayString();return this.configFile&&(t+=`
|
|
118
118
|
|
|
119
|
-
Config file: ${this.configFile}`),
|
|
119
|
+
Config file: ${this.configFile}`),t}},tr=class extends yn{constructor(t,r){super(t,r),this.name="FrameworkDetectionError"}};var Re=g(require("path")),Do=g(require("fs"));var Qe=class{static frameworkName="";ctx;constructor(t){this.ctx=t}static detect(t,r){return{detected:!1}}static detectFromBuiltOutput(t){return!1}static getOutputDeployMetadata(){throw new Error("getOutputDeployMetadata must be implemented by the framework subclass")}getOutputDeployMetadata(){return this.constructor.getOutputDeployMetadata()}async postBuild(){}getAdditionalConfigFiles(){return[]}getUserConfigPatterns(){return[]}hasDependency(t){let{packageJson:r}=this.ctx;return t in(r.dependencies||{})||t in(r.devDependencies||{})}getDependencyVersion(t){let{packageJson:r}=this.ctx;return r.dependencies?.[t]||r.devDependencies?.[t]}get log(){return this.ctx.log}get cwd(){return this.ctx.cwd}};var Am=g(require("semver")),pe=g(require("fs")),yt=g(require("path"));var Rr=g(require("semver"));function Wb(){return process.version.slice(1)}function Ub(e){let t=Rr.coerce(e);return t?t.major:null}function Vb(e,t){let r=Rr.coerce(e),n=Rr.coerce(t);return!r||!n?!1:Rr.gte(r,n)}function wn(e,t,r){let n=Wb(),o=t.minimum;if(Vb(n,o))e.debug(`Node.js version ${n} meets requirement ${o}`);else{let i=Ub(o),s=`${r} requires Node.js ${o} or higher. Current version: ${n}`;if(t.severity==="error")throw new he(s,{remediation:`Please upgrade Node.js to ${o} or higher. You can use nvm, fnm, or similar tools to manage Node.js versions.
|
|
120
120
|
|
|
121
121
|
nvm install ${i}
|
|
122
|
-
nvm use ${i}`,documentationUrl:"https://nodejs.org/en/download/"});
|
|
123
|
-
`));let i=Re.join(Om,"astro.config.webflow.ts");at(i)&&(
|
|
124
|
-
`));let i=Pe.join(Im,"astro.config.webflow.ts");at(i)&&(
|
|
125
|
-
`)):me.extname(o)!==".ts"&&(
|
|
122
|
+
nvm use ${i}`,documentationUrl:"https://nodejs.org/en/download/"});e.warn(`${s}. Build may fail or behave unexpectedly.`)}}var Zi=g(require("fs")),Cm=g(require("path"));var _m=M.object({name:M.string().optional(),version:M.string().optional(),dependencies:M.record(M.string()).optional(),devDependencies:M.record(M.string()).optional()});function wo(e){let t=Cm.default.join(e,"package.json");if(!Zi.statSync(t,{throwIfNoEntry:!1}))return;let r=Zi.readFileSync(t).toString("utf8"),n;try{n=JSON.parse(r)}catch(o){throw new he("package.json was not valid JSON",{cause:o})}try{return _m.parse(n)}catch(o){throw new he("package.json schema validation failed",{cause:o})}}var Yi=g(require("fs")),km=g(require("path"));var Xi=M.object({cloud:M.object({framework:M.string().optional(),assets_path_prefix:M.string().optional(),entrypoint_path:M.string().optional(),deployment_type:M.enum(["spa","ssg","ssr","ssr-spa-combo"]).optional(),skip_no_bundle:M.boolean().optional(),assets_source_skip_mount_path:M.boolean().optional()}).passthrough().optional()}).passthrough();function Dn(e,t,r="webflow.json"){let n=km.default.join(t,r);if(!Yi.statSync(n,{throwIfNoEntry:!1}))return r.endsWith(".json")?Dn(e,t,r+"c"):void 0;let o=Yi.readFileSync(n).toString("utf8"),i;try{i=Ir(o)}catch(s){e?.error(`loaded but could not parse as JSONC ${n} ${JSON.stringify(o)}: ${s}`);return}try{let s=Xi.parse(i);return e.debug(`loaded ${n}: ${JSON.stringify(s)}`),s}catch(s){e?.error(`${n} was valid JSON but schema validation failed: ${s}`);return}}var Sm=require("child_process"),Tm=["--no-update-notifier","--no-progress","--no-audit","--no-fund"];async function $e(e){let{log:t,cwd:r,args:n}=e,o={...process.env,...e.env||{},WRANGLER_SEND_METRICS:"false",NEXT_TELEMETRY_DISABLED:"1"},i=[...Tm,...n];t.debug(`npm ${i.join(" ")} (in ${r})`),(0,Sm.execSync)(`npm ${i.map(s=>JSON.stringify(s)).join(" ")}`,{cwd:r,env:o,stdio:"inherit"})}function rr(e){if(!e)return null;let t=Am.coerce(e);return t?t.major:null}function Pr(e,t,r,n){let o=n?.exclude?Array.isArray(n.exclude)?n.exclude:[n.exclude]:[],i=yt.basename(t);if(o.some(l=>i===l))return e.trace(`Skipping excluded: ${t}`),0;let s=pe.statSync(t,{throwIfNoEntry:!1});if(!s)return e.trace(`Source does not exist: ${t}`),0;if(s.isDirectory()){e.trace(`Copying directory: ${t} -> ${r}`);let l=pe.readdirSync(t),c=0;for(let f of l)c+=Pr(e,yt.join(t,f),yt.join(r,f),n);return c}let a=yt.dirname(r);return pe.existsSync(a)||pe.mkdirSync(a,{recursive:!0}),e.trace(`Copying file: ${t} -> ${r}`),pe.copyFileSync(t,r),1}function at(e){return pe.existsSync(e)}function wt(...e){for(let t of e)if(pe.existsSync(t))return t;return e[0]??""}async function nr(e,t,r,n){if(!pe.existsSync(t))throw new $r(`Template not found: ${t}`,{configFile:t});let o=pe.readFileSync(t,"utf8");e.debug(`envsubst: ${t} -> ${r}`);let i=n||process.env,s=o.replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g,(l,c)=>i[c]??"").replace(/\$([A-Za-z_][A-Za-z0-9_]*)/g,(l,c)=>i[c]??""),a=yt.dirname(r);pe.existsSync(a)||pe.mkdirSync(a,{recursive:!0}),pe.writeFileSync(r,s)}function or(e,t,r,n){for(let o of n){let i=yt.join(t,`${r}.${o}`);if(pe.existsSync(i)){let s=yt.join(t,`clouduser.${r}.${o}`);return e.info(`Renaming user config: ${r}.${o} -> clouduser.${r}.${o}`),pe.renameSync(i,s),s}}return null}var Wl=wt(Re.join(__dirname,"templates","astro","v5"),Re.join(__dirname,"templates","v5")),Om=wt(Re.join(__dirname,"templates","astro"),Re.join(__dirname,"templates")),jr=class extends Qe{static frameworkName="astro";get info(){return{name:"astro",version:"5.x",displayName:"Astro 5"}}static detect(t,r){let n=r?.cloud?.framework;if(n&&n!=="astro")return{detected:!1};let o=t.dependencies?.astro||t.devDependencies?.astro;if(!o)return n==="astro"?{detected:!0,reason:"Specified as astro in webflow.json"}:{detected:!1};let i=rr(o);return i!==null&&i>=6?{detected:!1}:{detected:!0,reason:`Found astro@${o}`}}async validate(){let{log:t,packageJson:r}=this.ctx,n=this.getNodeVersionRequirement();n&&wn(t,n,this.info.displayName);let o=r.dependencies?.astro||r.devDependencies?.astro;if(!o)throw new he("Astro is not installed in this project.",{remediation:"Install Astro by running: npm install astro@^5.0.0",documentationUrl:"https://docs.astro.build/en/install/"});if(o==="latest")throw new he('Astro version "latest" is not supported by Webflow Cloud.',{remediation:"Please specify a version, e.g.: npm install astro@^5.0.0"});let i=rr(o);if(i!==null&&i>=6)throw new he(`Astro ${i}.x detected but was routed to the Astro 5 builder. This is an internal error.`,{remediation:"Ensure your package.json has astro@^6.0.0 - the Astro 6 builder will be used automatically. If this persists, please report the issue."});t.info(`Validated Astro project: astro@${o}`)}getCloudflareAdapter(){return{name:"@astrojs/cloudflare",version:"^12.0.0"}}getRequiredIntegrations(){return[{name:"@astrojs/react",version:"^4.0.0",reason:"Required for Webflow React components"}]}async installDependencies(){let{log:t,cwd:r}=this.ctx,n=this.getCloudflareAdapter();this.hasDependency(n.name)||(t.warn(`Installing ${n.name}@${n.version} (required for Cloudflare deployment)...`),await $e({log:t,cwd:r,args:["install","--save",`${n.name}@${n.version}`]}));for(let o of this.getRequiredIntegrations())this.hasDependency(o.name)||(t.warn(`Installing ${o.name}@${o.version} (${o.reason})...`),await $e({log:t,cwd:r,args:["install","--save",`${o.name}@${o.version}`]}))}getWebflowLoader(){return{templatePath:Re.join(Wl,"webflow-loader.ts"),destinationName:"webflow-loader.ts",configPath:"./webflow-loader.ts"}}getUserConfigPatterns(){return["astro.config.mjs","astro.config.cjs","astro.config.js","astro.config.ts"]}getWranglerTemplatePath(){return Re.join(Wl,"wrangler.json")}getAdditionalConfigFiles(){return[this.getWebflowLoader().templatePath,Re.join(Om,"astro.config.webflow.ts")]}async prepareConfig(){let{log:t,cwd:r,userEnv:n}=this.ctx;or(t,r,"astro.config",["mjs","cjs","js","ts"])===null&&(t.info("no user astro.config.{mjs,cjs,js,ts} found \u2014 writing empty clouduser.astro.config.mjs stub"),Do.writeFileSync(Re.join(r,"clouduser.astro.config.mjs"),`export default {};
|
|
123
|
+
`));let i=Re.join(Om,"astro.config.webflow.ts");at(i)&&(t.info("Copying astro.config.webflow.ts..."),Do.copyFileSync(i,Re.join(r,"astro.config.webflow.ts")));let s=Re.join(Wl,"astro.config.mjs.template"),a=Re.join(r,"astro.config.mjs");t.info("Generating astro.config.mjs from template..."),await nr(t,s,a,{...process.env,...n});let l=this.getWebflowLoader();at(l.templatePath)&&(t.info(`Copying ${l.destinationName}...`),Do.copyFileSync(l.templatePath,Re.join(r,l.destinationName)))}getBuildCommand(){return"astro build"}getNodeVersionRequirement(){return{minimum:"18.0.0",severity:"error"}}static getOutputDeployMetadata(){return{staticAssetsPath:"dist",staticAssetsExclude:["_worker.js"],workerEntryPath:"dist/_worker.js/index.js",deploymentType:"ssr",dryRunEntryPath:"./index.js"}}};var Pe=g(require("path")),bo=g(require("fs"));var Ul=wt(Pe.join(__dirname,"templates","astro","v6"),Pe.join(__dirname,"templates","v6")),Im=wt(Pe.join(__dirname,"templates","astro"),Pe.join(__dirname,"templates")),Nr=class extends Qe{static frameworkName="astro";get info(){return{name:"astro",version:"6.x",displayName:"Astro 6"}}static detect(t,r){let n=r?.cloud?.framework;if(n&&n!=="astro")return{detected:!1};let o=t.dependencies?.astro||t.devDependencies?.astro;if(!o)return{detected:!1};let i=rr(o);return i!==null&&i>=6?{detected:!0,reason:`Found astro@${o} (Astro ${i}.x)`}:{detected:!1}}async validate(){let{log:t,packageJson:r}=this.ctx,n=this.getNodeVersionRequirement();n&&wn(t,n,this.info.displayName);let o=r.dependencies?.astro||r.devDependencies?.astro;if(!o)throw new he("Astro is not installed in this project.",{remediation:"Install Astro by running: npm install astro@^6.0.0",documentationUrl:"https://docs.astro.build/en/install/"});if(o==="latest")throw new he('Astro version "latest" is not supported by Webflow Cloud.',{remediation:"Please specify a version, e.g.: npm install astro@^6.0.0"});let i=rr(o);if(i!==null&&i<6)throw new he(`Astro ${i}.x detected but Astro6Builder was selected. This is likely a configuration error.`,{remediation:"Use Astro5Builder for Astro 5.x, or upgrade: npm install astro@^6.0.0"});t.info(`Validated Astro 6 project: astro@${o}`)}getCloudflareAdapter(){return{name:"@astrojs/cloudflare",version:"^13.0.0",peerDependencies:["@cloudflare/vite-plugin"]}}getRequiredIntegrations(){return[{name:"@astrojs/react",version:"^5.0.0",reason:"Required for Webflow React components"}]}async installDependencies(){let{log:t,cwd:r}=this.ctx,n=this.getCloudflareAdapter();if(this.hasDependency(n.name)||(t.warn(`Installing ${n.name}@${n.version} (required for Cloudflare deployment)...`),await $e({log:t,cwd:r,args:["install","--save",`${n.name}@${n.version}`]})),n.peerDependencies)for(let o of n.peerDependencies)this.hasDependency(o)||(t.warn(`Installing ${o} (peer dependency of ${n.name})...`),await $e({log:t,cwd:r,args:["install","--save",o]}));for(let o of this.getRequiredIntegrations())this.hasDependency(o.name)||(t.warn(`Installing ${o.name}@${o.version} (${o.reason})...`),await $e({log:t,cwd:r,args:["install","--save",`${o.name}@${o.version}`]}))}getWebflowLoader(){return{templatePath:Pe.join(Ul,"webflow-loader.ts"),destinationName:"webflow-loader.ts",configPath:"./webflow-loader.ts"}}getUserConfigPatterns(){return["astro.config.mjs","astro.config.cjs","astro.config.js","astro.config.ts"]}getWranglerTemplatePath(){return Pe.join(Ul,"wrangler.json")}getAdditionalConfigFiles(){return[this.getWebflowLoader().templatePath,Pe.join(Im,"astro.config.webflow.ts")]}async prepareConfig(){let{log:t,cwd:r,userEnv:n}=this.ctx;or(t,r,"astro.config",["mjs","cjs","js","ts"])===null&&(t.info("no user astro.config.{mjs,cjs,js,ts} found \u2014 writing empty clouduser.astro.config.mjs stub"),bo.writeFileSync(Pe.join(r,"clouduser.astro.config.mjs"),`export default {};
|
|
124
|
+
`));let i=Pe.join(Im,"astro.config.webflow.ts");at(i)&&(t.info("Copying astro.config.webflow.ts..."),bo.copyFileSync(i,Pe.join(r,"astro.config.webflow.ts")));let s=Pe.join(Ul,"astro.config.mjs.template"),a=Pe.join(r,"astro.config.mjs");t.info("Generating astro.config.mjs from template (Astro 6)..."),await nr(t,s,a,{...process.env,...n});let l=this.getWebflowLoader();at(l.templatePath)&&(t.info(`Copying ${l.destinationName}...`),bo.copyFileSync(l.templatePath,Pe.join(r,l.destinationName)))}getBuildCommand(){return"astro build"}getNodeVersionRequirement(){return{minimum:"22.12.0",severity:"error"}}static getOutputDeployMetadata(){return{staticAssetsPath:"dist/client",workerEntryPath:"dist/server/entry.mjs",wranglerMainOverride:"@astrojs/cloudflare/entrypoints/server",deploymentType:"ssr",usesAssetsBinding:!0,skipNoBundle:!0,assetsSourceSkipMountPath:!0,dryRunEntryPath:"./entry.mjs"}}};var me=g(require("path")),et=g(require("fs"));var bn=wt(me.join(__dirname,"templates","nextjs"),me.join(__dirname,"templates")),vn=class extends Qe{static frameworkName="nextjs";get info(){return{name:"nextjs",version:"*",displayName:"Next.js"}}static detect(t,r){let n=r?.cloud?.framework;return n==="nextjs"?{detected:!0,reason:"Specified as nextjs in webflow.json"}:n&&n!=="nextjs"?{detected:!1}:t.dependencies?.next!==void 0||t.devDependencies?.next!==void 0?{detected:!0,reason:'Found "next" in package.json'}:{detected:!1}}async validate(){let{log:t,packageJson:r}=this.ctx,n=r.dependencies?.next||r.devDependencies?.next;if(!n)throw new he("Next.js is not installed in this project.",{remediation:"Install Next.js by running: npm install next",documentationUrl:"https://nextjs.org/docs/getting-started/installation"});t.info(`Validated Next.js project: next@${n}`)}getCloudflareAdapter(){return{name:"@opennextjs/cloudflare",version:"*"}}getRequiredIntegrations(){return[]}async installDependencies(){let{log:t,cwd:r}=this.ctx,n=this.getCloudflareAdapter();this.hasDependency(n.name)||(t.warn("nextjs integration requires @opennextjs/cloudflare and this project doesn't have it. installing now..."),await $e({log:t,cwd:r,args:["install","--save",n.name]}))}getWebflowLoader(){return{templatePath:me.join(bn,"webflow-loader.ts"),destinationName:"webflow-loader.ts",configPath:"./webflow-loader.ts"}}getUserConfigPatterns(){return["next.config.mjs","next.config.cjs","next.config.js","next.config.ts"]}getWranglerTemplatePath(){return me.join(bn,"wrangler.json")}getAdditionalConfigFiles(){return[this.getWebflowLoader().templatePath,me.join(bn,"open-next.config.ts")]}findOpenNextConfig(){let t="open-next.config.ts";if(et.existsSync(me.join(this.cwd,t)))return t}ensureOpenNextConfig(t){let{log:r,cwd:n}=this.ctx,o=this.findOpenNextConfig();if(o){r.info(`${o} found, skipping creation (opennextjs-cloudflare will validate)`);return}if(r.info("open-next.config not found, creating open-next.config.ts with default Webflow Cloud configuration..."),!et.existsSync(t))throw new $r(`open-next.config.ts template not found at ${t}. This is a Webflow Cloud build system error.`,{configFile:t});let i=me.join(n,"open-next.config.ts");et.copyFileSync(t,i),r.info("open-next.config.ts created successfully")}async prepareConfig(){let{log:t,cwd:r,userEnv:n}=this.ctx,o=or(t,r,"next.config",["mjs","cjs","js","ts"]);o===null?(t.info("no user next.config.{mjs,cjs,js,ts} found \u2014 writing empty clouduser.next.config.ts stub"),et.writeFileSync(me.join(r,"clouduser.next.config.ts"),`export default {};
|
|
125
|
+
`)):me.extname(o)!==".ts"&&(t.info(`writing clouduser.next.config.d.ts shim for ${me.basename(o)}`),et.writeFileSync(me.join(r,"clouduser.next.config.d.ts"),`import type { UserNextConfig } from './next.config.webflow';
|
|
126
126
|
declare const config: UserNextConfig;
|
|
127
127
|
export default config;
|
|
128
|
-
`));let i=me.join(bn,"next.config.webflow.ts");at(i)&&(
|
|
128
|
+
`));let i=me.join(bn,"next.config.webflow.ts");at(i)&&(t.info("Copying next.config.webflow.ts..."),et.copyFileSync(i,me.join(r,"next.config.webflow.ts")));let s=me.join(bn,"next.config.ts.template"),a=me.join(r,"next.config.ts");t.info("Generating next.config.ts from template..."),await nr(t,s,a,{...process.env,...n});let l=this.getWebflowLoader();at(l.templatePath)&&(t.info(`Copying ${l.destinationName}...`),et.copyFileSync(l.templatePath,me.join(r,l.destinationName)));let c=me.join(bn,"open-next.config.ts");this.ensureOpenNextConfig(c)}getBuildCommand(){return"opennextjs-cloudflare build"}getNodeVersionRequirement(){return{minimum:"18.0.0",severity:"error"}}static getOutputDeployMetadata(){return{staticAssetsPath:".open-next/assets",workerEntryPath:".open-next/worker.js",deploymentType:"ssr",dryRunEntryPath:"./worker.js"}}static detectFromBuiltOutput(t){return et.statSync(me.join(t,"./worker.js"),{throwIfNoEntry:!1})?.isFile()??!1}};var Le=g(require("path")),tt=g(require("fs"));var Qi=wt(Le.join(__dirname,"templates","vite"),Le.join(__dirname,"templates")),En=class extends Qe{static frameworkName="vite";get info(){return{name:"vite",version:"6.x",displayName:"Vite"}}static detect(t,r){let n=r?.cloud?.framework;return n==="vite"?{detected:!0,reason:"Specified as vite in webflow.json"}:n&&n!=="vite"?{detected:!1}:t.dependencies?.vite!==void 0||t.devDependencies?.vite!==void 0?{detected:!0,reason:'Found "vite" in package.json'}:{detected:!1}}async validate(){let{log:t,packageJson:r}=this.ctx,n=r.dependencies?.vite||r.devDependencies?.vite;if(!n)throw new he("Vite is not installed in this project.",{remediation:"Install Vite by running: npm install vite",documentationUrl:"https://vitejs.dev/guide/"});t.info(`Validated Vite project: vite@${n}`)}getCloudflareAdapter(){return{name:"@cloudflare/vite-plugin",version:"*"}}getRequiredIntegrations(){return[{name:"@cloudflare/workers-types",version:"*",dev:!0}]}async installDependencies(){let{log:t,cwd:r,packageJson:n}=this.ctx,o=n.devDependencies?.vite||n.dependencies?.vite||"",i=rr(o);i!==null&&i<6&&(t.warn("Upgrading vite to ^6.1.0 (required by @cloudflare/vite-plugin)..."),await $e({log:t,cwd:r,args:["install","--save-dev","vite@^6.1.0"]}));let s=this.getCloudflareAdapter();this.hasDependency(s.name)||(t.warn("Vite integration requires @cloudflare/vite-plugin, installing now..."),await $e({log:t,cwd:r,args:["install","--save",s.name]}));let a=this.getRequiredIntegrations();for(let l of a)if(!this.hasDependency(l.name)){t.info(`Installing ${l.name}...`);let c=l.dev?["install","--save-dev",l.name]:["install","--save",l.name];await $e({log:t,cwd:r,args:c})}}getWebflowLoader(){return null}getUserConfigPatterns(){return["vite.config.mjs","vite.config.cjs","vite.config.js","vite.config.ts"]}getWranglerTemplatePath(){return Le.join(Qi,"wrangler.json")}getAdditionalConfigFiles(){return[Le.join(Qi,"vite.config.webflow.ts")]}hasCustomWorkerEntry(){let{log:t,cwd:r}=this.ctx;for(let n of["wrangler.json","wrangler.jsonc"]){let o=Le.join(r,n);if(tt.existsSync(o)){try{let i=tt.readFileSync(o,"utf8"),s=Ir(i);if(s?.main&&s.main!=="./src/worker.ts")return t.info(`user-provided ${n} has custom main entrypoint "${s.main}", will preserve user's worker`),!0}catch(i){t.warn(`failed to parse ${n}: ${i}`)}break}}return!1}ensureWorkerEntry(){let{log:t,cwd:r}=this.ctx,n=Le.join(r,"src","worker.ts");if(tt.existsSync(n)){t.info("src/worker.ts already exists, skipping creation");return}t.warn("src/worker.ts does not exist, creating a minimal worker..."),tt.mkdirSync(Le.join(r,"src"),{recursive:!0}),tt.writeFileSync(n,`/// <reference types="@cloudflare/workers-types" />
|
|
129
129
|
|
|
130
130
|
interface Env {
|
|
131
131
|
ASSETS: Fetcher;
|
|
@@ -136,55 +136,54 @@ export default {
|
|
|
136
136
|
return env.ASSETS.fetch(request);
|
|
137
137
|
},
|
|
138
138
|
} satisfies ExportedHandler<Env>;
|
|
139
|
-
`)}async prepareConfig(){let{log:
|
|
140
|
-
`));let s=Le.join(
|
|
141
|
-
`)}function Bm(t
|
|
142
|
-
${Nm(i.error)}`);return}return
|
|
143
|
-
${Nm(o.error)}`);let i=o.data;if(i.d1_databases&&i.d1_databases.length>0&&i.d1_databases.length>5)throw new Error(`Too many D1 databases configured: ${i.d1_databases.length}. Maximum allowed is 5.`);if(i.kv_namespaces&&i.kv_namespaces.length>0&&i.kv_namespaces.length>5)throw new Error(`Too many KV namespaces configured: ${i.kv_namespaces.length}. Maximum allowed is 5.`);if(i.r2_buckets&&i.r2_buckets.length>0){if(i.r2_buckets.length>5)throw new Error(`Too many R2 buckets configured: ${i.r2_buckets.length}. Maximum allowed is 5.`);
|
|
144
|
-
${
|
|
145
|
-
${Z(Fn(`${n}${o}`))}`)}async function Um(t=process.cwd(),e,r,n){let o=wo(t);if(!o)throw new Error("No package.json file found");let i=Dn(c,t),s={...n?{COSMIC_MOUNT_PATH:n}:{},...e?{COSMIC_DEPLOY_URL:e}:{},...r&&!e?{COSMIC_DEPLOY_URL:Wb(r)}:{}};return Bl({cwd:t,log:c,packageJson:o,userEnv:s},i)}async function Vm(t,e={}){let r=e.projectPath||process.cwd(),n=Date.now(),o=Y.join(r,".tmp",`webflow-build-${n}`),i=e.outputDir||Y.join(o,"output"),s=e.mountPath||"/app",a=Date.now(),l=Wl(r),u=e.telemetry,f=t.getBuildCommand(),p=t.getOutputDeployMetadata();await u?.sendUsage("cloud_build_start",{framework:t.info.name,buildCommand:f,deploymentType:p.deploymentType,mountPath:s,cloudflareBindings:l}),W.mkdirSync(o,{recursive:!0});try{$t("\u{1F527}","Configure framework"),c.info(`Framework: ${t.info.displayName}`),c.info(`Mount path: ${s}`),c.info(`Deployment type: ${p.deploymentType}`);let g=t.getNodeVersionRequirement();g&&wn(c,g,t.info.displayName),c.info("Validating framework requirements..."),await t.validate(),c.info("Installing framework dependencies..."),await t.installDependencies(),$t("\u2699\uFE0F ","Configure wrangler"),await Mm(t,r),c.info("Preparing framework configuration..."),await t.prepareConfig(),Ml(c,r,t.info.name,t),$t("\u{1F4E6}","Install dependencies"),await Lb(r,t.info.name,e.telemetry),Lm(r),$t("\u{1F3D7}\uFE0F ","Build app"),c.info(`running ${f}...`),await Ub(r,f,e.telemetry),await t.postBuild(),$t("\u{1F9EA}","Wrangler dry-run"),await Vb(r,i),$t("\u{1F4C1}","Copy assets"),await Hb(r,i,t,s),$t("\u{1F381}","Create tarball");let h=await Jb(i),w=Date.now()-a;return c.info(`${T} Build completed in ${(w/1e3).toFixed(1)}s`),await u?.sendUsage("cloud_build_success",{duration:w,framework:t.info.name,buildCommand:f,deploymentType:p.deploymentType,mountPath:s,cloudflareBindings:l}),h}catch(g){let h=Date.now()-a;throw await u?.sendError(g instanceof Error?g:new Error(String(g)),"cloud_build_failure",{duration:h,framework:t.info.name,buildCommand:f,deploymentType:p.deploymentType,mountPath:s,cloudflareBindings:l}),g}}function Wl(t){let e=Y.join(t,"wrangler.json");if(!W.existsSync(e))return{hasKV:!1,hasD1:!1,hasR2:!1,hasVars:!1,kvCount:0,d1Count:0,r2Count:0,varCount:0};try{let r=JSON.parse(W.readFileSync(e,"utf8")),n=r.kv_namespaces||[],o=r.d1_databases||[],i=r.r2_buckets||[],s=r.vars||{};return{hasKV:n.length>0,hasD1:o.length>0,hasR2:i.length>0,hasVars:Object.keys(s).length>0,kvCount:n.length,d1Count:o.length,r2Count:i.length,varCount:Object.keys(s).length}}catch(r){return console.debug("Failed to parse wrangler.json for bindings detection:",r),{hasKV:!1,hasD1:!1,hasR2:!1,hasVars:!1,kvCount:0,d1Count:0,r2Count:0,varCount:0}}}function Hm(t){try{let e=Y.dirname(t);e.includes(".tmp/webflow-build-")&&($t("\u{1F9F9}","Clean up build artifacts"),W.rmSync(e,{recursive:!0,force:!0}))}catch(e){c.warn(`Warning: Failed to clean up build artifacts: ${e}`)}}function Jm(t,e){try{$t("\u{1F9F9}","Revert framework configuration");let r=e.getUserConfigPatterns(),n=new Set;for(let s of r){let a=Y.extname(s).slice(1),l=Y.basename(s,`.${a}`);if(!n.has(l)){n.add(l);for(let u of["mjs","cjs","js","ts"]){let f=Y.join(t,`clouduser.${l}.${u}`),p=Y.join(t,`${l}.${u}`);if(W.existsSync(f)){c.info(`restoring /${l}.${u} from /clouduser.${l}.${u}...`),W.existsSync(p)&&W.unlinkSync(p),W.renameSync(f,p);break}}}}for(let s of[".jsonc",".json"]){let a=Y.join(t,`clouduser.wrangler${s}`);if(W.existsSync(a)){c.info(`restoring user wrangler${s} from backup...`);let l=Y.join(t,"wrangler.json");W.existsSync(l)&&W.unlinkSync(l);let u=Y.join(t,`wrangler${s}`);W.renameSync(a,u);break}}let o=Y.join(t,"clouduser");W.existsSync(o)&&(c.info("cleaning up clouduser directory..."),W.rmSync(o,{recursive:!0,force:!0}));for(let s of e.getAdditionalConfigFiles()){let a=Y.join(t,Y.basename(s));W.existsSync(a)&&(c.info(`cleaning up additional config file ${a}...`),W.unlinkSync(a))}let i=e.getWebflowLoader();if(i){let s=Y.join(t,i.destinationName);W.existsSync(s)&&(c.info(`cleaning up ${i.destinationName}...`),W.unlinkSync(s))}}catch(r){c.warn(`Warning: Failed to cleanup framework configuration: ${r}`)}}async function Lb(t,e,r){let n=Date.now(),o=["--no-update-notifier","--no-progress"],i=Y.join(t,"package-lock.json");try{W.existsSync(i)?(c.info("Running npm ci --include=dev..."),(0,Eo.execSync)(`npm ci --include=dev ${o.join(" ")}`,{cwd:t,stdio:"inherit"})):(c.info("Warning: No package-lock.json found, installing dependencies with npm install --include=dev"),(0,Eo.execSync)(`npm install --include=dev ${o.join(" ")}`,{cwd:t,stdio:"inherit"}));let s=Date.now()-n;await r?.sendUsage("cloud_install_dependencies_success",{duration:s,framework:e,hasPackageLock:W.existsSync(i)})}catch(s){let a=Date.now()-n;throw await r?.sendError(s instanceof Error?s:new Error(String(s)),"cloud_install_dependencies_failure",{duration:a,framework:e,hasPackageLock:W.existsSync(i)}),s}}function Wb(t){let e="production",r;switch(e){case"development":r="wf-app-dev";break;case"acceptance":r="wf-app-acceptance";break;default:r="wf-app-prod"}return`https://${t}.${r}.cosmic.webflow.services`}async function Ub(t,e,r){let n=Date.now();try{(0,Eo.execSync)(`npm exec -- ${e}`,{cwd:t,stdio:"inherit"});let o=Date.now()-n;await r?.sendUsage("cloud_build_command_success",{duration:o,buildCommand:e})}catch(o){let i=Date.now()-n;throw await r?.sendError(o instanceof Error?o:new Error(String(o)),"cloud_build_command_failure",{duration:i,buildCommand:e}),new Error(`Build command failed: ${e}`)}}async function Vb(t,e){W.mkdirSync(e,{recursive:!0});let r=Y.join(t,"wrangler.json"),n=Y.join(t,"wrangler.jsonc");if(!W.existsSync(r)&&!W.existsSync(n))throw new Error("Missing wrangler configuration: wrangler.json or wrangler.jsonc file is required");(0,Eo.execSync)(`npx wrangler@${Mb} deploy --dry-run --outdir="${e}"`,{cwd:t,stdio:"inherit"})}async function Hb(t,e,r,n){let o=r.getOutputDeployMetadata(),i=o.staticAssetsPath,s=o.staticAssetsExclude?.[0],a=o.assetsSourceSkipMountPath===!0,l=n.replace(/\/+$/,"").replace(/^\/+/,"");if(!a&&l&&(r.info.name==="nextjs"||r.info.name==="astro")){let h=Y.join(t,i);if(W.existsSync(h)&&W.statSync(h).isDirectory()){let F=W.readdirSync(h,{withFileTypes:!0}).find(O=>!(!O.isDirectory()||s&&O.name===s||r.info.name==="astro"&&(O.name==="_routes.json"||O.name==="_worker.js")));F&&(i=`${i}/${F.name}`)}}let u=Y.join(e,"assets",l||"");W.mkdirSync(u,{recursive:!0});let f=Y.join(t,i);if(W.existsSync(f)&&W.statSync(f).isDirectory()){c.info(`copying assets from /${i} to output/assets...`);try{s?(c.info(`excluding ${s}`),Pr(c,f,u,{exclude:s})):Pr(c,f,u)}catch(h){c.error(h,{prefix:"Failed to copy assets:"})}}else c.info("No assets to copy or assets directory not found");let p=Y.join(t,"webflow.json");W.existsSync(p)?(c.info("including webflow.json in output..."),W.copyFileSync(p,Y.join(e,"webflow.json"))):c.warn("webflow.json not found at project root; deploy may fail framework detection");let g=null;for(let h of[".json",".jsonc"]){let w=Y.join(t,`clouduser.wrangler${h}`);if(W.existsSync(w)){g=w;break}}if(g){c.info("including user wrangler config in output..."),W.copyFileSync(g,Y.join(e,"clouduser.wrangler.json"));let h=Y.join(t,"clouduser","migrations");if(W.existsSync(h)){c.info("copying migrations from clouduser/migrations to output/migrations...");let w=Y.join(e,"migrations");Pr(c,h,w)}}}async function Jb(t){let e=`${t}.tar.gz`;try{return await Wm.create({gzip:!0,file:e,cwd:Y.dirname(t)},[Y.basename(t)]),c.info(`Tarball created: ${e}`),e}catch(r){throw new d(r,{prefix:"Failed to create tarball:"})}}De();ie();_();var Gb="DUPLICATE_ENVIRONMENT_MOUNT",zb="ENVIRONMENT_MOUNT_MISMATCH",qb="DUPLICATE_ENVIRONMENT_BRANCH",Kb="INVALID_MOUNT_PATH_FORMAT",Zb="INVALID_PROJECT_ID",Gm={[Gb]:"An environment with this mount path already exists for this site. Please choose a different mount path.",[zb]:"This environment already exists with a different mount path. Please create a new environment or use the existing environment's mount path.",[qb]:"An environment with this branch already exists for this project.",[Kb]:"Mount path format is invalid. It must start with a / and be followed by at least one character (e.g., /app).",[Zb]:"Invalid project ID. This project may have been deleted or belongs to a different site. Please remove the 'project_id' from your webflow.json file and redeploy to create a new project."};function zm(t){let e={timestamp:new Date().toISOString()};if(t instanceof Error)e.code=t.name,e.msg=t.message,e.stack=t.stack;else if(typeof t=="object"&&t!==null){let i=t;e.code=typeof i.code=="string"?i.code:void 0,e.msg=typeof i.msg=="string"?i.msg:void 0,e.status=typeof i.status=="number"?i.status:void 0}let r=e.msg||"",n=e.status??e.code,o=typeof n=="number"?n:typeof n=="string"&&/^\d+$/.test(n)?Number(n):void 0;if(c.error(`Error Details: ${JSON.stringify({timestamp:e.timestamp,code:e.code,message:e.msg,status:e.status,stack:e.stack},null,2)}`),o===401)return"Your access token is expired or invalid. Run 'webflow auth login' to re-authenticate.";if(o===403)return"Your access token is missing required permissions. Run 'webflow auth login' to re-authenticate with the necessary scopes.";for(let i in Gm)if(r.includes(i))return Gm[i];return`An unknown error occurred. Error code: ${e.code||"N/A"}, Message: ${e.msg||"No message provided"}`}var _n=m(require("fs")),Ul=require("child_process");_();$();H();var qm=104857600;function Km(t){if(t===0)return"0 B";let e=1024,r=["B","KB","MB","GB"],n=Math.floor(Math.log(t)/Math.log(e));return`${parseFloat((t/Math.pow(e,n)).toFixed(1))} ${r[n]}`}function Yb(){try{let t=(0,Ul.execSync)("git rev-parse HEAD",{encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim();if(!/^[0-9a-f]{40}$/.test(t))throw new Error("Invalid commit hash format");try{return(0,Ul.execSync)("git status --porcelain --untracked-files=no",{encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim().length>0?`git@${t}+dirty`:`git@${t}`}catch{return`git@${t}`}}catch{return`noversion@${new Date().toISOString()}`}}async function Vl(t,e,r){let n=await fetch(`${C}${e}`,{method:r.method,headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json"},body:r.body?JSON.stringify(r.body):void 0});if(!n.ok){let o=await n.text(),i;try{i=JSON.parse(o)}catch{i={msg:o}}let s=zm(i);throw new Error(s)}return n.json()}async function Zm(t,e,r,n){let{manifest:o}=G(),i=o.cloud||{},s=i.project_id,a=i.framework;if(!a)throw new d("No framework specified in webflow.json. Please ensure your webflow.json has a cloud.framework property");let l=await Xb({siteId:t.siteId,apiToken:t.accessToken,framework:a,mountPath:r,environment:e,projectId:s,projectName:n?.projectName,description:n?.description,directory:n?.directory,version:Yb()});return!s&&l.project_id&&(oe({cloud:{...i,project_id:l.project_id}}),c.info(`${T} Project ID updated in webflow.json`)),l}async function Xb(t){let{siteId:e,framework:r,mountPath:n,environment:o,version:i,projectId:s,projectName:a,description:l,directory:u}=t,f={framework:r,mount_path:n,environment:o,version:i};s&&(f.project_id=s),a&&(f.project_name=a),l&&(f.description=l),u&&(f.app_path=u);let p=e?`/cosmic/${e}/cli-deploy-init`:"/cosmic/cli-deploy-init";return Vl(t.apiToken,p,{method:"POST",body:f})}async function Ym(t,e){let{siteId:r,accessToken:n}=t,o=r?`/cosmic/${r}/cli-project-environments/${e}`:`/cosmic/cli-project-environments/${e}`;return Vl(n,o,{method:"GET"})}async function Xm(t){let{siteId:e,accessToken:r}=t,n=e?`/cosmic/${e}/cli-projects`:"/cosmic/cli-projects";return Vl(r,n,{method:"GET"})}async function Qm(t,e){if(!_n.existsSync(t))throw new Error(`Tarball not found at ${t}`);let r=_n.statSync(t);if(r.size>qm)throw new Error(`Build output is too large (${Km(r.size)}). Maximum allowed size is ${Km(qm)}.`);let n=_n.readFileSync(t),o=JSON.parse(e);if(!o.fields)throw new Error("Upload URL is missing fields property");let i=new FormData;Object.entries(o.fields).forEach(([l,u])=>{i.append(l,u)});let s=new Blob([n],{type:"application/gzip"});i.append("file",s,"output.tar.gz");let a=await fetch(o.url,{method:"POST",body:i});if(!a.ok){let l=await a.text();throw new d(l,{prefix:`${E} Upload failed with response:`})}}async function eg(t,e){if(!t||t==="undefined")throw new d("Completion URL is undefined or invalid");let r=new URL(t);e&&r.searchParams.set("failed","true");let n=await fetch(r.toString(),{method:"GET"});if(!n.ok)throw new d(`Failed to trigger deployment: ${n.status} ${n.statusText}`)}var tg=require("webflow-api");ie();ie();$();function Hl(t){return new tg.WebflowClient({accessToken:t,environment:{base:`${C}/v2`,dataApi:`${C}/v2`,contentDeliveryApi:`${Wo}/v2`}})}async function xo(t,e){try{let n=await Hl(t).sites.get(e);return{id:n.id||e,displayName:n.displayName||"Unknown Site",shortName:n.shortName||"unknown-site",customDomains:n.customDomains?.map(o=>({id:o.id||"",url:o.url||""}))||[]}}catch(r){throw new d(r,{prefix:"Error fetching site details:"})}}async function Jl(t,e){try{return{customDomains:(await Hl(t).sites.getCustomDomain(e)).customDomains?.map(o=>({id:o.id||"",url:o.url||""}))||[]}}catch(r){throw new d(r,{prefix:"Error fetching custom domains:"})}}async function Gl(t){try{let e=await fetch(`https://${t}/manifest.json`);if(!e.ok)throw new Error(`HTTP ${e.status}: ${e.statusText}`);return await e.json()}catch(e){throw new d(e,{prefix:`Failed to fetch manifest from ${t}:`})}}function zl(t,e,r){return t.cosmic&&Array.isArray(t.cosmic)?t.cosmic.some(n=>{if(n.mountPath!==e)return!1;if(!r)return!0;if(n.workerUrl)try{return new URL(n.workerUrl).hostname.split(".")[0]===r}catch{return!1}return!1}):!1}async function rg(t,e,r){try{let n=Hl(t),o=await xo(t,e),i=[];if(r?.domains&&r.domains.length>0)for(let s of r.domains){let a=o.customDomains?.find(l=>l.url===s);a?.id&&i.push(a.id)}await n.sites.publish(e,{customDomains:i,publishToWebflowSubdomain:r?.publishToWebflowSubdomain??!0})}catch(n){throw new d(n,{prefix:"Error publishing site:"})}}Be();_();async function ng(t,e,r){let{siteId:n,accessToken:o}=t;if(!n)throw new Error("Site ID is required for mount path validation. Standalone apps skip this step.");let i=c.spinner("Validating mount path configuration");try{let s=await xo(o,n),a=await Jl(o,n),l=[`${s.shortName}.webflow.io`,...a.customDomains?.map(w=>w.url)||[]],u=0;i.update(`Validating ${l.length} domain(s) for mount path: ${e}... (0/${l.length})`);let f=l.map(async w=>{try{let F=await Gl(w),O=Array.isArray(F.cosmic)?F.cosmic.map(K=>K.mountPath).filter(K=>typeof K=="string"):[],ne=zl(F,e,r);return{domain:w,mountPaths:O,isValid:ne===!0}}catch(F){return{domain:w,mountPaths:[],isValid:!1,error:F instanceof Error?F.message:String(F)}}finally{u++,i.update(`Validating ${l.length} domain(s) for mount path: ${e}... (${u}/${l.length})`)}}),p=await Promise.all(f),g=p.some(w=>!w.isValid),h=p.every(w=>w.isValid);return i.succeed("Mount path validation completed"),{isValid:h,domains:p,needsPublishing:g}}catch(s){throw i.fail("Mount path validation failed"),s}}async function og(t,e,r){let{siteId:n,accessToken:o}=t;if(!n)return[];try{let i=await xo(o,n),s=await Jl(o,n),l=[`${i.shortName}.webflow.io`,...s.customDomains?.map(f=>f.url)||[]].map(async f=>{try{let p=await Gl(f),g=zl(p,e,r);return{domain:f,isValid:g}}catch(p){return c.debug(`Could not verify mount path for ${f}: ${p}`),{domain:f,isValid:!1}}});return(await Promise.all(l)).filter(f=>f.isValid).map(f=>f.domain)}catch(i){return c.debug(`Error getting valid domains: ${i}`),[]}}function ig(t,e){return t.map(r=>`${r.startsWith("localhost")||r.startsWith("127.0.0.1")?"http":"https"}://${r}${e}`)}async function sg(t){let e=t.map(n=>({name:n,value:n,checked:!0})),r=await Ho({message:"Select which domains you want to publish to update the mount path configuration:",choices:e,validate:n=>n.length===0?"Please select at least one domain to publish to.":!0});return r??[]}async function ag(){return await Te({message:"The mount path doesn't match on some domains. Would you like to publish the site to update the configuration?",default:!0})}async function ql(t,e){let{siteId:r,accessToken:n}=t;if(!r)throw new Error("Site ID is required to publish. Standalone apps do not use this.");let o=c.spinner(`Publishing site to ${e.length} domain(s)`);try{let s=`${(await xo(n,r)).shortName}.webflow.io`,a=e.includes(s),l=e.filter(u=>u!==s);await rg(n,r,{domains:l,publishToWebflowSubdomain:a}),o.succeed(`Site published successfully to selected domains: ${e.join(", ")}`)}catch{throw o.fail("Failed to publish site"),new Error("Failed to publish site")}}_();fe();var Br=m(require("path"));De();ie();Fe();var rs=m(require("fs"));$();ie();Be();$();_();async function es(t){let e=await fetch(`${C}/v2/workspaces`,{method:"GET",headers:{Authorization:`Bearer ${t}`}});if(!e.ok){let n=await e.text(),o={};try{o=JSON.parse(n)}catch{}throw e.status===403&&o.code==="missing_scopes"?new d(`Missing required scopes for workspace access.
|
|
139
|
+
`)}async prepareConfig(){let{log:t,cwd:r,userEnv:n}=this.ctx,o=this.hasCustomWorkerEntry();or(t,r,"vite.config",["mjs","cjs","js","ts"])===null&&(t.info("no user vite.config.{mjs,cjs,js,ts} found \u2014 writing empty clouduser.vite.config.ts stub"),tt.writeFileSync(Le.join(r,"clouduser.vite.config.ts"),`export default {};
|
|
140
|
+
`));let s=Le.join(Qi,"vite.config.webflow.ts");at(s)&&(t.info("Copying vite.config.webflow.ts..."),tt.copyFileSync(s,Le.join(r,"vite.config.webflow.ts")));let a=Le.join(Qi,"vite.config.ts.template"),l=Le.join(r,"vite.config.ts");t.info("Generating vite.config.ts from template..."),await nr(t,a,l,{...process.env,...n}),o||this.ensureWorkerEntry()}getBuildCommand(){return"vite build"}getNodeVersionRequirement(){return{minimum:"18.0.0",severity:"error"}}static getOutputDeployMetadata(){return{staticAssetsPath:"dist/client",workerEntryPath:"./src/worker.ts",deploymentType:"ssr-spa-combo",usesAssetsBinding:!0}}};var $m=[Nr,jr,vn,En],vo=["astro","nextjs","vite"];function es(e,t){for(let r of $m){let n=r.detect(e,t);if(n.detected)return{Builder:r,result:n}}return null}function Vl(e,t){let r=es(e.packageJson,t);if(!r)throw new tr("Could not detect framework from package.json or webflow.json",{remediation:`Create a webflow.json file with: { "cloud": { "framework": "astro" } } (or one of: ${vo.join(", ")})`});return e.log.info(`Detected framework: ${r.result.reason}`),new r.Builder(e)}function Hl(e,t,r,n){let o=Rm.join(t,"webflow.json"),i={cloud:{}};if(Fn.existsSync(o))try{let a=Fn.readFileSync(o,"utf8"),l=JSON.parse(a),c=Xi.safeParse(l);if(c.success)i=c.data;else{let f=c.error.issues.map(p=>`${p.path.join(".")}: ${p.message}`).join(", ");e.warn(`webflow.json has schema issues (will be corrected): ${f}`),i=l}i.cloud||(e.warn('webflow.json is missing "cloud" property, adding it'),i.cloud={})}catch(a){e.warn(`Failed to parse existing webflow.json, overwriting: ${a}`)}let s=i.cloud;if(s.framework=r,n){let a=n.getOutputDeployMetadata();s.deployment_type=a.deploymentType,a.dryRunEntryPath?s.entrypoint_path=a.dryRunEntryPath:s.entrypoint_path="./index.js",a.skipNoBundle&&(s.skip_no_bundle=!0),a.assetsSourceSkipMountPath&&(s.assets_source_skip_mount_path=!0)}e.info(`Creating webflow.json with framework: ${r}`),Fn.writeFileSync(o,JSON.stringify(i,null,2))}function Pm(e,t){let r=Dn(e,t);if(r?.cloud?.framework)return r.cloud.framework;let n=wo(t);if(!n)throw new tr("Cannot detect framework: no package.json found",{remediation:'Run this command from your project root, or add a webflow.json with: { "cloud": { "framework": "<name>" } }'});e.info("webflow.json has no framework \u2014 detecting from package.json...");let o=es(n,r);if(!o)throw new tr("Could not detect framework from package.json or webflow.json",{remediation:'Add a webflow.json with: { "cloud": { "framework": "<name>" } } (supported: astro, nextjs, vite)'});let i=o.Builder.frameworkName;return e.info(`Detected framework: ${o.result.reason}`),Hl(e,t,i),i}x();var jm=M.object({name:M.string(),main:M.string().optional(),compatibility_date:M.string(),compatibility_flags:M.array(M.string()).optional(),placement:M.object({mode:M.string()}).passthrough().optional(),assets:M.object({directory:M.string(),binding:M.string().optional()}).passthrough().optional(),d1_databases:M.array(M.object({database_name:M.string(),database_id:M.string(),binding:M.string(),migrations_dir:M.string().optional()}).passthrough()).default([]),kv_namespaces:M.array(M.object({binding:M.string(),id:M.string()}).passthrough()).default([]),r2_buckets:M.array(M.object({binding:M.string(),bucket_name:M.string()}).passthrough()).default([])}).passthrough();function Nm(e){return e.issues.map(t=>` - ${t.path.length>0?t.path.join("."):"<root>"}: ${t.message}`).join(`
|
|
141
|
+
`)}function Bm(e,t="wrangler.json"){let r=lt.join(e,t);if(!xe.existsSync(r)){if(t.endsWith(".json"))return u.warn(`/${t} not found, checking for /${t}c`),Bm(e,t+"c");u.warn(`/${t} not found`);return}let n=xe.readFileSync(r,"utf8");u.info(`reading /${t}...`);let o;try{o=Ir(n)}catch(s){u.error(`/${t} loaded but could not parse as JSONC: ${s}`);return}let i=jm.safeParse(o);if(!i.success){u.error(`/${t} loaded but schema validation failed:
|
|
142
|
+
${Nm(i.error)}`);return}return u.info(`successfully loaded /${t}`),i.data}async function Mm(e,t){let r=null,n=null,o=lt.join(t,"wrangler.json"),i=lt.join(t,"wrangler.jsonc");xe.existsSync(o)?(r=o,n=".json"):xe.existsSync(i)&&(r=i,n=".jsonc"),r&&n&&(u.info(`saving user-provided wrangler JSON as /clouduser.wrangler${n}...`),xe.copyFileSync(r,lt.join(t,`clouduser.wrangler${n}`)));let s=r?Bm(t,lt.basename(r)):null,a=e.getWranglerTemplatePath(),l=lt.join(t,"wrangler.json");if(!xe.existsSync(a))throw new Error(`Wrangler template not found at ${a}. Make sure the template is properly copied during build.`);if(u.info(`copying wrangler template for ${e.info.name} to /wrangler.json`),xe.copyFileSync(a,l),!s)return;let c=JSON.parse(xe.readFileSync(l,"utf8"));if(s.kv_namespaces&&s.kv_namespaces.length>0&&(c.kv_namespaces=s.kv_namespaces,u.info(`merged ${s.kv_namespaces.length} KV namespace(s) into template`)),s.r2_buckets&&s.r2_buckets.length>0&&(c.r2_buckets=s.r2_buckets,u.info(`merged ${s.r2_buckets.length} R2 bucket(s) into template`)),s.d1_databases&&s.d1_databases.length>0&&(c.d1_databases=s.d1_databases,u.info(`merged ${s.d1_databases.length} D1 database(s) into template`)),xe.writeFileSync(l,JSON.stringify(c,null,2)),s.d1_databases.length!==0)for(let f in s.d1_databases){let p=s.d1_databases[f];if(!p.migrations_dir){u.info(`skipping migrations for database ${f} in wrangler.json; migrations dir is not defined`);continue}let m=p.migrations_dir,h=lt.join(t,m);if(!xe.existsSync(h)){u.info(`skipping migrations for database ${f} in wrangler.json; migrations dir (/${m}) does not exist`);continue}let w=lt.join(t,"clouduser","migrations",m),k=Pr(u,h,w);k>0?u.info(`copied ${k} migrations to /clouduser/migrations/${m}`):u.info(`skipping migrations for database ${f} in wrangler.json; migrations dir (/${m}) is empty`)}}function Hb(e){if(!/^[a-z0-9-]+$/.test(e))throw new Error(`Invalid object storage bucket name ${JSON.stringify(e)}: Only lowercase letters, numbers, and hyphens are allowed.`);if(e.startsWith("-")||e.endsWith("-"))throw new Error(`Invalid object storage bucket name "${e}": Cannot begin or end with a hyphen.`);if(e.length>27)throw new Error(`Invalid object storage bucket name "${e}": Must be 27 characters or fewer (currently ${e.length} characters).`)}function Lm(e){let t=null;for(let s of[".json",".jsonc"]){let a=lt.join(e,`clouduser.wrangler${s}`);if(xe.existsSync(a)){t=a;break}}if(!t)return;let r=xe.readFileSync(t,"utf8"),n;try{n=Ir(r)}catch(s){throw new Error(`Failed to parse wrangler config at ${t} as JSONC: ${s}`)}let o=jm.safeParse(n);if(!o.success)throw new Error(`Invalid wrangler config at ${t}:
|
|
143
|
+
${Nm(o.error)}`);let i=o.data;if(i.d1_databases&&i.d1_databases.length>0&&i.d1_databases.length>5)throw new Error(`Too many D1 databases configured: ${i.d1_databases.length}. Maximum allowed is 5.`);if(i.kv_namespaces&&i.kv_namespaces.length>0&&i.kv_namespaces.length>5)throw new Error(`Too many KV namespaces configured: ${i.kv_namespaces.length}. Maximum allowed is 5.`);if(i.r2_buckets&&i.r2_buckets.length>0){if(i.r2_buckets.length>5)throw new Error(`Too many R2 buckets configured: ${i.r2_buckets.length}. Maximum allowed is 5.`);u.info(`validating ${i.r2_buckets.length} object storage bucket name(s)...`);for(let s of i.r2_buckets)Hb(s.bucket_name)}}x();O();H();ce();var Jb="4.82.1",ts=60;function $t(e,t){let r=Math.min(ts,process.stdout.columns??ts),n=`\u2500\u2500\u2500 ${e} ${t} `,o="\u2500".repeat(Math.max(0,r-n.length));u.info(`
|
|
144
|
+
${Y(`${n}${o}`)}`)}function Jl(e,t){let r=Math.min(ts,process.stdout.columns??ts),n=`\u2550\u2550\u2550 ${e} ${t} `,o="\u2550".repeat(Math.max(0,r-n.length));u.info(`
|
|
145
|
+
${Y(_n(`${n}${o}`))}`)}async function Um(e=process.cwd(),t,r,n){let o=wo(e);if(!o)throw new Error("No package.json file found");let i=Dn(u,e),s={...n?{COSMIC_MOUNT_PATH:n}:{},...t?{COSMIC_DEPLOY_URL:t}:{},...r&&!t?{COSMIC_DEPLOY_URL:zb(r)}:{}};return Vl({cwd:e,log:u,packageJson:o,userEnv:s},i)}async function Vm(e,t={}){let r=t.projectPath||process.cwd(),n=Date.now(),o=X.join(r,".tmp",`webflow-build-${n}`),i=t.outputDir||X.join(o,"output"),s=t.mountPath||"/app",a=Date.now(),l=Gl(r),c=t.telemetry,f=e.getBuildCommand(),p=e.getOutputDeployMetadata();await c?.sendUsage("cloud_build_start",{framework:e.info.name,buildCommand:f,deploymentType:p.deploymentType,mountPath:s,cloudflareBindings:l}),L.mkdirSync(o,{recursive:!0});try{$t("\u{1F527}","Configure framework"),u.info(`Framework: ${e.info.displayName}`),u.info(`Mount path: ${s}`),u.info(`Deployment type: ${p.deploymentType}`);let m=e.getNodeVersionRequirement();m&&wn(u,m,e.info.displayName),u.info("Validating framework requirements..."),await e.validate(),u.info("Installing framework dependencies..."),await e.installDependencies(),$t("\u2699\uFE0F ","Configure wrangler"),await Mm(e,r),u.info("Preparing framework configuration..."),await e.prepareConfig(),Hl(u,r,e.info.name,e),$t("\u{1F4E6}","Install dependencies"),await Gb(r,e.info.name,t.telemetry),Lm(r),$t("\u{1F3D7}\uFE0F ","Build app"),u.info(`running ${f}...`),await qb(r,f,t.telemetry),await e.postBuild(),$t("\u{1F9EA}","Wrangler dry-run"),await Kb(r,i),$t("\u{1F4C1}","Copy assets"),await Zb(r,i,e,s),$t("\u{1F381}","Create tarball");let h=await Yb(i),w=Date.now()-a;return u.info(`${A} Build completed in ${(w/1e3).toFixed(1)}s`),await c?.sendUsage("cloud_build_success",{duration:w,framework:e.info.name,buildCommand:f,deploymentType:p.deploymentType,mountPath:s,cloudflareBindings:l}),h}catch(m){let h=Date.now()-a;throw await c?.sendError(m instanceof Error?m:new Error(String(m)),"cloud_build_failure",{duration:h,framework:e.info.name,buildCommand:f,deploymentType:p.deploymentType,mountPath:s,cloudflareBindings:l}),m}}function Gl(e){let t=X.join(e,"wrangler.json");if(!L.existsSync(t))return{hasKV:!1,hasD1:!1,hasR2:!1,hasVars:!1,kvCount:0,d1Count:0,r2Count:0,varCount:0};try{let r=JSON.parse(L.readFileSync(t,"utf8")),n=r.kv_namespaces||[],o=r.d1_databases||[],i=r.r2_buckets||[],s=r.vars||{};return{hasKV:n.length>0,hasD1:o.length>0,hasR2:i.length>0,hasVars:Object.keys(s).length>0,kvCount:n.length,d1Count:o.length,r2Count:i.length,varCount:Object.keys(s).length}}catch(r){return console.debug("Failed to parse wrangler.json for bindings detection:",r),{hasKV:!1,hasD1:!1,hasR2:!1,hasVars:!1,kvCount:0,d1Count:0,r2Count:0,varCount:0}}}function Hm(e){try{let t=X.dirname(e);t.includes(".tmp/webflow-build-")&&($t("\u{1F9F9}","Clean up build artifacts"),L.rmSync(t,{recursive:!0,force:!0}))}catch(t){u.warn(`Warning: Failed to clean up build artifacts: ${t}`)}}function Jm(e,t){try{$t("\u{1F9F9}","Revert framework configuration");let r=t.getUserConfigPatterns(),n=new Set;for(let s of r){let a=X.extname(s).slice(1),l=X.basename(s,`.${a}`);if(!n.has(l)){n.add(l);for(let c of["mjs","cjs","js","ts"]){let f=X.join(e,`clouduser.${l}.${c}`),p=X.join(e,`${l}.${c}`);if(L.existsSync(f)){u.info(`restoring /${l}.${c} from /clouduser.${l}.${c}...`),L.existsSync(p)&&L.unlinkSync(p),L.renameSync(f,p);break}}}}for(let s of[".jsonc",".json"]){let a=X.join(e,`clouduser.wrangler${s}`);if(L.existsSync(a)){u.info(`restoring user wrangler${s} from backup...`);let l=X.join(e,"wrangler.json");L.existsSync(l)&&L.unlinkSync(l);let c=X.join(e,`wrangler${s}`);L.renameSync(a,c);break}}let o=X.join(e,"clouduser");L.existsSync(o)&&(u.info("cleaning up clouduser directory..."),L.rmSync(o,{recursive:!0,force:!0}));for(let s of t.getAdditionalConfigFiles()){let a=X.join(e,X.basename(s));L.existsSync(a)&&(u.info(`cleaning up additional config file ${a}...`),L.unlinkSync(a))}let i=t.getWebflowLoader();if(i){let s=X.join(e,i.destinationName);L.existsSync(s)&&(u.info(`cleaning up ${i.destinationName}...`),L.unlinkSync(s))}}catch(r){u.warn(`Warning: Failed to cleanup framework configuration: ${r}`)}}async function Gb(e,t,r){let n=Date.now(),o=["--no-update-notifier","--no-progress"],i=X.join(e,"package-lock.json");try{L.existsSync(i)?(u.info("Running npm ci --include=dev..."),(0,Eo.execSync)(`npm ci --include=dev ${o.join(" ")}`,{cwd:e,stdio:"inherit"})):(u.info("Warning: No package-lock.json found, installing dependencies with npm install --include=dev"),(0,Eo.execSync)(`npm install --include=dev ${o.join(" ")}`,{cwd:e,stdio:"inherit"}));let s=Date.now()-n;await r?.sendUsage("cloud_install_dependencies_success",{duration:s,framework:t,hasPackageLock:L.existsSync(i)})}catch(s){let a=Date.now()-n;throw await r?.sendError(s instanceof Error?s:new Error(String(s)),"cloud_install_dependencies_failure",{duration:a,framework:t,hasPackageLock:L.existsSync(i)}),s}}function zb(e){let t="production",r;switch(t){case"development":r="wf-app-dev";break;case"acceptance":r="wf-app-acceptance";break;default:r="wf-app-prod"}return`https://${e}.${r}.cosmic.webflow.services`}async function qb(e,t,r){let n=Date.now();try{(0,Eo.execSync)(`npm exec -- ${t}`,{cwd:e,stdio:"inherit"});let o=Date.now()-n;await r?.sendUsage("cloud_build_command_success",{duration:o,buildCommand:t})}catch(o){let i=Date.now()-n;throw await r?.sendError(o instanceof Error?o:new Error(String(o)),"cloud_build_command_failure",{duration:i,buildCommand:t}),new Error(`Build command failed: ${t}`)}}async function Kb(e,t){L.mkdirSync(t,{recursive:!0});let r=X.join(e,"wrangler.json"),n=X.join(e,"wrangler.jsonc");if(!L.existsSync(r)&&!L.existsSync(n))throw new Error("Missing wrangler configuration: wrangler.json or wrangler.jsonc file is required");(0,Eo.execSync)(`npx wrangler@${Jb} deploy --dry-run --outdir="${t}"`,{cwd:e,stdio:"inherit"})}async function Zb(e,t,r,n){let o=r.getOutputDeployMetadata(),i=o.staticAssetsPath,s=o.staticAssetsExclude?.[0],a=o.assetsSourceSkipMountPath===!0,l=n.replace(/\/+$/,"").replace(/^\/+/,"");if(!a&&l&&(r.info.name==="nextjs"||r.info.name==="astro")){let h=X.join(e,i);if(L.existsSync(h)&&L.statSync(h).isDirectory()){let k=L.readdirSync(h,{withFileTypes:!0}).find(P=>!(!P.isDirectory()||s&&P.name===s||r.info.name==="astro"&&(P.name==="_routes.json"||P.name==="_worker.js")));k&&(i=`${i}/${k.name}`)}}let c=X.join(t,"assets",l||"");L.mkdirSync(c,{recursive:!0});let f=X.join(e,i);if(L.existsSync(f)&&L.statSync(f).isDirectory()){u.info(`copying assets from /${i} to output/assets...`);try{s?(u.info(`excluding ${s}`),Pr(u,f,c,{exclude:s})):Pr(u,f,c)}catch(h){u.error(h,{prefix:"Failed to copy assets:"})}}else u.info("No assets to copy or assets directory not found");let p=X.join(e,"webflow.json");L.existsSync(p)?(u.info("including webflow.json in output..."),L.copyFileSync(p,X.join(t,"webflow.json"))):u.warn("webflow.json not found at project root; deploy may fail framework detection");let m=null;for(let h of[".json",".jsonc"]){let w=X.join(e,`clouduser.wrangler${h}`);if(L.existsSync(w)){m=w;break}}if(m){u.info("including user wrangler config in output..."),L.copyFileSync(m,X.join(t,"clouduser.wrangler.json"));let h=X.join(e,"clouduser","migrations");if(L.existsSync(h)){u.info("copying migrations from clouduser/migrations to output/migrations...");let w=X.join(t,"migrations");Pr(u,h,w)}}}async function Yb(e){let t=`${e}.tar.gz`;try{return await Wm.create({gzip:!0,file:t,cwd:X.dirname(e)},[X.basename(e)]),u.info(`Tarball created: ${t}`),t}catch(r){throw new d(r,{prefix:"Failed to create tarball:"})}}we();oe();x();var Xb="DUPLICATE_ENVIRONMENT_MOUNT",Qb="ENVIRONMENT_MOUNT_MISMATCH",ev="DUPLICATE_ENVIRONMENT_BRANCH",tv="INVALID_MOUNT_PATH_FORMAT",rv="INVALID_PROJECT_ID",Gm={[Xb]:"An environment with this mount path already exists for this site. Please choose a different mount path.",[Qb]:"This environment already exists with a different mount path. Please create a new environment or use the existing environment's mount path.",[ev]:"An environment with this branch already exists for this app.",[tv]:"Mount path format is invalid. It must start with a / and be followed by at least one character (e.g., /app).",[rv]:"Invalid app ID. This app may have been deleted or belongs to a different site. Please remove the 'project_id' field from your webflow.json and redeploy to create a new app."};function zm(e){let t={timestamp:new Date().toISOString()};if(e instanceof Error)t.code=e.name,t.msg=e.message,t.stack=e.stack;else if(typeof e=="object"&&e!==null){let i=e;t.code=typeof i.code=="string"?i.code:void 0,t.msg=typeof i.msg=="string"?i.msg:void 0,t.status=typeof i.status=="number"?i.status:void 0}let r=t.msg||"",n=t.status??t.code,o=typeof n=="number"?n:typeof n=="string"&&/^\d+$/.test(n)?Number(n):void 0;if(u.error(`Error Details: ${JSON.stringify({timestamp:t.timestamp,code:t.code,message:t.msg,status:t.status,stack:t.stack},null,2)}`),o===401)return"Your access token is expired or invalid. Run 'webflow auth login' to re-authenticate.";if(o===403)return"Your access token is missing required permissions. Run 'webflow auth login' to re-authenticate with the necessary scopes.";for(let i in Gm)if(r.includes(i))return Gm[i];return`An unknown error occurred. Error code: ${t.code||"N/A"}, Message: ${t.msg||"No message provided"}`}var xn=g(require("fs")),zl=require("child_process");x();O();H();var qm=104857600;function Km(e){if(e===0)return"0 B";let t=1024,r=["B","KB","MB","GB"],n=Math.floor(Math.log(e)/Math.log(t));return`${parseFloat((e/Math.pow(t,n)).toFixed(1))} ${r[n]}`}function nv(){try{let e=(0,zl.execSync)("git rev-parse HEAD",{encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim();if(!/^[0-9a-f]{40}$/.test(e))throw new Error("Invalid commit hash format");try{return(0,zl.execSync)("git status --porcelain --untracked-files=no",{encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim().length>0?`git@${e}+dirty`:`git@${e}`}catch{return`git@${e}`}}catch{return`noversion@${new Date().toISOString()}`}}async function ql(e,t,r){let n=await fetch(`${C}${t}`,{method:r.method,headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"},body:r.body?JSON.stringify(r.body):void 0});if(!n.ok){let o=await n.text(),i;try{i=JSON.parse(o)}catch{i={msg:o}}let s=zm(i);throw new Error(s)}return n.json()}async function Zm(e,t,r,n){let{manifest:o}=G(),i=o.cloud||{},s=i.project_id,a=i.framework;if(!a)throw new d("No framework specified in webflow.json. Please ensure your webflow.json has a cloud.framework property");let l=await ov({siteId:e.siteId,apiToken:e.accessToken,framework:a,mountPath:r,environment:t,projectId:s,projectName:n?.projectName,description:n?.description,directory:n?.directory,version:nv()});return!s&&l.project_id&&(ae({cloud:{...i,project_id:l.project_id}}),u.info(`${A} App ID updated in webflow.json`)),l}async function ov(e){let{siteId:t,framework:r,mountPath:n,environment:o,version:i,projectId:s,projectName:a,description:l,directory:c}=e,f={framework:r,mount_path:n,environment:o,version:i};s&&(f.project_id=s),a&&(f.project_name=a),l&&(f.description=l),c&&(f.app_path=c);let p=t?`/cosmic/${t}/cli-deploy-init`:"/cosmic/cli-deploy-init";return ql(e.apiToken,p,{method:"POST",body:f})}async function Ym(e,t){let{siteId:r,accessToken:n}=e,o=r?`/cosmic/${r}/cli-project-environments/${t}`:`/cosmic/cli-project-environments/${t}`;return ql(n,o,{method:"GET"})}async function Xm(e){let{siteId:t,accessToken:r}=e,n=t?`/cosmic/${t}/cli-projects`:"/cosmic/cli-projects";return ql(r,n,{method:"GET"})}async function Qm(e,t){if(!xn.existsSync(e))throw new Error(`Tarball not found at ${e}`);let r=xn.statSync(e);if(r.size>qm)throw new Error(`Build output is too large (${Km(r.size)}). Maximum allowed size is ${Km(qm)}.`);let n=xn.readFileSync(e),o=JSON.parse(t);if(!o.fields)throw new Error("Upload URL is missing fields property");let i=new FormData;Object.entries(o.fields).forEach(([l,c])=>{i.append(l,c)});let s=new Blob([n],{type:"application/gzip"});i.append("file",s,"output.tar.gz");let a=await fetch(o.url,{method:"POST",body:i});if(!a.ok){let l=await a.text();throw new d(l,{prefix:`${F} Upload failed with response:`})}}async function eg(e,t){if(!e||e==="undefined")throw new d("Completion URL is undefined or invalid");let r=new URL(e);t&&r.searchParams.set("failed","true");let n=await fetch(r.toString(),{method:"GET"});if(!n.ok)throw new d(`Failed to trigger deployment: ${n.status} ${n.statusText}`)}var tg=require("webflow-api");oe();oe();O();function Kl(e){return new tg.WebflowClient({accessToken:e,environment:{base:`${C}/v2`,dataApi:`${C}/v2`,contentDeliveryApi:`${Vo}/v2`}})}async function Fo(e,t){try{let n=await Kl(e).sites.get(t);return{id:n.id||t,displayName:n.displayName||"Unknown Site",shortName:n.shortName||"unknown-site",customDomains:n.customDomains?.map(o=>({id:o.id||"",url:o.url||""}))||[]}}catch(r){throw new d(r,{prefix:"Error fetching site details:"})}}async function Zl(e,t){try{return{customDomains:(await Kl(e).sites.getCustomDomain(t)).customDomains?.map(o=>({id:o.id||"",url:o.url||""}))||[]}}catch(r){throw new d(r,{prefix:"Error fetching custom domains:"})}}async function Yl(e){try{let t=await fetch(`https://${e}/manifest.json`);if(!t.ok)throw new Error(`HTTP ${t.status}: ${t.statusText}`);return await t.json()}catch(t){throw new d(t,{prefix:`Failed to fetch manifest from ${e}:`})}}function Xl(e,t,r){return e.cosmic&&Array.isArray(e.cosmic)?e.cosmic.some(n=>{if(n.mountPath!==t)return!1;if(!r)return!0;if(n.workerUrl)try{return new URL(n.workerUrl).hostname.split(".")[0]===r}catch{return!1}return!1}):!1}async function rg(e,t,r){try{let n=Kl(e),o=await Fo(e,t),i=[];if(r?.domains&&r.domains.length>0)for(let s of r.domains){let a=o.customDomains?.find(l=>l.url===s);a?.id&&i.push(a.id)}await n.sites.publish(t,{customDomains:i,publishToWebflowSubdomain:r?.publishToWebflowSubdomain??!0})}catch(n){throw new d(n,{prefix:"Error publishing site:"})}}Be();x();async function ng(e,t,r){let{siteId:n,accessToken:o}=e;if(!n)throw new Error("Site ID is required for mount path validation. Apps without a connected site skip this step.");let i=u.spinner("Validating mount path configuration");try{let s=await Fo(o,n),a=await Zl(o,n),l=[`${s.shortName}.webflow.io`,...a.customDomains?.map(w=>w.url)||[]],c=0;i.update(`Validating ${l.length} domain(s) for mount path: ${t}... (0/${l.length})`);let f=l.map(async w=>{try{let k=await Yl(w),P=Array.isArray(k.cosmic)?k.cosmic.map(le=>le.mountPath).filter(le=>typeof le=="string"):[],V=Xl(k,t,r);return{domain:w,mountPaths:P,isValid:V===!0}}catch(k){return{domain:w,mountPaths:[],isValid:!1,error:k instanceof Error?k.message:String(k)}}finally{c++,i.update(`Validating ${l.length} domain(s) for mount path: ${t}... (${c}/${l.length})`)}}),p=await Promise.all(f),m=p.some(w=>!w.isValid),h=p.every(w=>w.isValid);return i.succeed("Mount path validation completed"),{isValid:h,domains:p,needsPublishing:m}}catch(s){throw i.fail("Mount path validation failed"),s}}async function og(e,t,r){let{siteId:n,accessToken:o}=e;if(!n)return[];try{let i=await Fo(o,n),s=await Zl(o,n),l=[`${i.shortName}.webflow.io`,...s.customDomains?.map(f=>f.url)||[]].map(async f=>{try{let p=await Yl(f),m=Xl(p,t,r);return{domain:f,isValid:m}}catch(p){return u.debug(`Could not verify mount path for ${f}: ${p}`),{domain:f,isValid:!1}}});return(await Promise.all(l)).filter(f=>f.isValid).map(f=>f.domain)}catch(i){return u.debug(`Error getting valid domains: ${i}`),[]}}function ig(e,t){return e.map(r=>`${r.startsWith("localhost")||r.startsWith("127.0.0.1")?"http":"https"}://${r}${t}`)}async function sg(e){let t=e.map(n=>({name:n,value:n,checked:!0})),r=await Go({message:"Select which domains you want to publish to update the mount path configuration:",choices:t,validate:n=>n.length===0?"Please select at least one domain to publish to.":!0});return r??[]}async function ag(){return await Te({message:"The mount path doesn't match on some domains. Would you like to publish the site to update the configuration?",default:!0})}async function Ql(e,t){let{siteId:r,accessToken:n}=e;if(!r)throw new Error("Site ID is required to publish. Apps without a connected site do not use this.");let o=u.spinner(`Publishing site to ${t.length} domain(s)`);try{let s=`${(await Fo(n,r)).shortName}.webflow.io`,a=t.includes(s),l=t.filter(c=>c!==s);await rg(n,r,{domains:l,publishToWebflowSubdomain:a}),o.succeed(`Site published successfully to selected domains: ${t.join(", ")}`)}catch{throw o.fail("Failed to publish site"),new Error("Failed to publish site")}}x();ce();var Br=g(require("path"));we();oe();_e();var os=g(require("fs"));O();oe();Be();O();x();async function rs(e){let t=await fetch(`${C}/v2/workspaces`,{method:"GET",headers:{Authorization:`Bearer ${e}`}});if(!t.ok){let n=await t.text(),o={};try{o=JSON.parse(n)}catch{}throw t.status===403&&o.code==="missing_scopes"?new d(`Missing required scopes for workspace access.
|
|
146
146
|
${o.message??""}
|
|
147
|
-
Re-run 'webflow auth login' to grant the necessary permissions.`):new d(`Failed to fetch workspaces: ${
|
|
148
|
-
${o.message}`:""))}return(await
|
|
149
|
-
Available frameworks: ${
|
|
150
|
-
Available frameworks: ${
|
|
151
|
-
Mount path validation results:`)),o.domains.forEach(i=>{let s=i.isValid?
|
|
152
|
-
\u{1F310} Your cloud app will soon be available at:`);try{let o=n?.domainsOverride??await og(t,
|
|
153
|
-
|
|
154
|
-
${Jr}/dashboard/sites/${
|
|
155
|
-
Visit the webflow Cloud dashboard to view your deployment: https://webflow.com/dashboard/sites`)},
|
|
156
|
-
${
|
|
157
|
-
${
|
|
158
|
-
`))};
|
|
147
|
+
Re-run 'webflow auth login' to grant the necessary permissions.`):new d(`Failed to fetch workspaces: ${t.status} ${t.statusText}`+(o.message?`
|
|
148
|
+
${o.message}`:""))}return(await t.json()).workspaces}async function ns(e){if(e.length===1)return e[0];let t=await Ne({message:"Select the workspace for this app:",choices:e.map(r=>({name:r.name,value:r}))});return t||(u.warn(`Auto fallback to first workspace: ${e[0].name}`),e[0])}H();var tu=null;process.once("exit",()=>tu?.());var is=async()=>{try{let e=Al(),t=Ol();return[...new Set([...e,...t])]}catch(e){return u.error(e,{prefix:"Failed to get available scaffolds:"}),[]}},iv=async(e,t,r)=>{let n;if("content"in r)n=r.content.files;else{let l=r[t];if(!l)throw new Error(`Scaffold "${t}" not found`);n=l}let o=n.find(l=>l.includes(gr));if(!o)throw new Error(`No ${gr} found in scaffold "${t}"`);await os.promises.mkdir(e,{recursive:!0});let s=(await os.promises.readFile(o,"utf8")).replace(Li,e),a=Br.join(e,gr);await os.promises.writeFile(a,s,"utf8")},ru=async(e,t,r=Mi,n,o=De.Existing,i)=>{if(o===De.New){try{let s=await Rl(r);await sv(e,t,s.scaffoldId,{content:s},r,i)}catch(s){if(s instanceof be){let a=s.message;throw s.supportedIds?.length&&(a+=`
|
|
149
|
+
Available frameworks: ${s.supportedIds.join(", ")}`),new d(a)}throw s}return}try{let s=await Ui(r);await av(e,t,r,{content:s},n)}catch(s){if(s instanceof be){let a=s.message;throw s.supportedIds?.length&&(a+=`
|
|
150
|
+
Available frameworks: ${s.supportedIds.join(", ")}`),new d(a)}throw s}},sv=async(e,t,r,n,o,i)=>{let s=`./${e}`,a="content"in n&&typeof n.content=="object"&&"extractionRoot"in n.content?n.content:null,l=a?Br.dirname(a.extractionRoot):null;try{let c=Date.now(),f=await I(),p;if(i)p={id:i};else{let w=await rs(f);if(w.length===0)throw new d("No workspaces found in your account. Please make sure you have at least one workspace.");p=await ns(w)}await co(e,t,r,n,void 0,void 0),process.chdir(s);let m=o??r;ae({cloud:{framework:m,workspace_id:p.id}}),Ft({apiToken:f,directory:"."}),process.env.WEBFLOW_API_TOKEN=f;let h=Date.now()-c;try{await T.forCloud({authToken:f}).sendUsage("project_init",{scaffold:m,scaffoldName:m,initMode:De.New,workspaceId:p.id,totalDuration:h,mountPath:t})}catch{}}catch(c){if(c instanceof d||c instanceof Error&&c.message.includes("OAuth")){try{await co(e,t,r,n),process.chdir(s),ae({cloud:{framework:o??r}}),Ft({directory:"."})}catch{}throw u.error("App scaffold was created, but authentication failed."),u.error(`To set up Webflow credentials later, run ${B("webflow auth login")}`),new d(c,{skipLogging:!0})}throw c}finally{if(l)try{eu.default.removeSync(l)}catch{}tu=ug(e,De.New)}},av=async(e,t,r,n,o)=>{let i=`./${e}`,s=null,a=!1,l="content"in n&&typeof n.content=="object"&&"extractionRoot"in n.content?n.content:null,c=l?Br.dirname(l.extractionRoot):null;try{let f=Date.now();await iv(e,r,n),process.chdir(i);let{manifest:p}=G(),m=await ge(p,{site:o}),h=m.accessToken,w=m.siteId;if(s=T.forCloud({authToken:h,siteId:w}),await co(".",t,r,n,w,h),w){u.info(`${ke} Running devlink export to fetch your Webflow components`);try{await lv({site:w,apiToken:h}),a=!0}catch(P){u.error(P,{prefix:"Failed to run devlink export:"})}}let k=Date.now()-f;await s?.sendUsage("project_init",{scaffold:r,scaffoldName:r,devlinkSyncStatus:a,totalDuration:k,mountPath:t})}catch(f){throw u.error(f,{prefix:"Error during Webflow authentication:"}),await co(".",t,r,n),u.error("App scaffold was created, but authentication failed."),u.error("To set up Webflow credentials later, run:"),u.error(" webflow auth login"),new d(f,{skipLogging:!0})}finally{if(c)try{eu.default.removeSync(c)}catch{}tu=ug(e,De.Existing)}},lv=async e=>{let{exportComponents:t}=await Promise.resolve().then(()=>(Xa(),Ad));await t({site:e.site,apiToken:e.apiToken})},uv=e=>{if(e?.skipMountPathCheck!==void 0)return e.skipMountPathCheck;try{let{manifest:t}=G();return Sl(t)?!0:t.cloud?.skipMountPathCheck===!0}catch{return!1}},cv=async(e,t,r,n)=>{u.info(ue("Validating mount path configuration..."));let o=await ng(e,t,r);if(o.isValid)u.info(B("Mount path validation passed"));else if(u.info(S(`
|
|
151
|
+
Mount path validation results:`)),o.domains.forEach(i=>{let s=i.isValid?A:Ee,a=i.isValid?B(`${i.domain} (mountPath: ${i.mountPaths[0]})`):ne(`${i.domain} (no matching mountPath)`);u.info(`${s} ${a}`),i.error&&u.debug(` Error: ${i.error}`)}),o.needsPublishing)if(n){u.info("\u{1F680} Auto-publishing site to update mount path configuration...");let i=o.domains.filter(s=>!s.isValid).map(s=>s.domain);await Ql(e,i)}else if(await ag()&&ut()){let s=o.domains.filter(l=>!l.isValid).map(l=>l.domain),a=await sg(s);await Ql(e,a)}else u.warn("\u26A0\uFE0F Continuing with deployment without publishing...")},fv=async(e,t,r,n)=>{Jl("\u{1F3D7}\uFE0F ","Building app");let o=await Vm(e,{mountPath:r,telemetry:n?.telemetry,deployUrl:t.deploy_url,environmentId:t.environment_id});Jl("\u{1F4E4}","Uploading build artifacts");let i=Date.now();await Qm(o,t.upload_url);let s=Date.now()-i;return u.info(`${A} Upload completed in ${(s/1e3).toFixed(1)}s`),o},dv=async(e,t,r,n)=>{u.success(`
|
|
152
|
+
\u{1F310} Your cloud app will soon be available at:`);try{let o=n?.domainsOverride??await og(e,t,r),i=ig(o??[],t);i?.length>0?i.forEach(s=>{u.info(` ${s}`)}):u.warn(" No domains found with the correct mount path configuration yet.")}catch(o){u.warn(` Could not determine deployment links: ${o instanceof Error?o.message:o}`)}},pv=e=>{e.site_slug?u.success(`Visit your deployment:
|
|
153
|
+
|
|
154
|
+
${Jr}/dashboard/sites/${e.site_slug}/webflow-cloud/projects/${e.project_id}/environments/${e.environment_id}/deployments/${e.deployment_id}`):u.info(`
|
|
155
|
+
Visit the webflow Cloud dashboard to view your deployment: https://webflow.com/dashboard/sites`)},mv=async(e,t,r,n,o)=>{try{if(await eg(t.completion_url,!!n),n)u.error(`
|
|
156
|
+
${F} Deployment failed due to build error.`);else{u.success(`
|
|
157
|
+
${A} Deployment triggered successfully!`);let i;try{let{manifest:s}=G();Sl(s)&&(i=[`${o?.projectName??Br.basename(process.cwd())}.webflow.io`])}catch(s){u.debug(`Could not read manifest for standalone deploy link hint: ${s instanceof Error?s.message:String(s)}`)}await dv(e,r,t.environment_id,i!==void 0?{domainsOverride:i}:void 0),pv(t)}}catch(i){throw new d(i,{prefix:"Failed to trigger deployment:"})}},gv=(e,t)=>{e&&Jm(process.cwd(),e),t&&Hm(t)},lg=async(e,t,r,n)=>{let o=null,i=null,s=Date.now(),a=null,l=null,c=Gl(process.cwd()),f=n?.telemetry;await f?.sendUsage("cloud_deploy_start",{environment:t,mountPath:r,projectName:n?.projectName,hasDescription:!!n?.description,hasDirectory:!!n?.directory,cloudflareBindings:c});try{Pm(u,process.cwd()),o=await Zm(e,t,r,n),u.info("\u{1F527} Detecting framework..."),a=await Um(process.cwd(),o.deploy_url,o.environment_id,r),u.info(`Framework: ${a.info.displayName}`),u.info(`Build command: ${a.getBuildCommand()}`),uv(n)?u.info("\u23ED\uFE0F Skipping mount path validation..."):await cv(e,r,o.environment_id,n?.autoPublish),i=await fv(a,o,r,n),u.info(`Starting deployment process for environment: ${t} at mount path: ${r}`);let p=Date.now()-s;await f?.sendUsage("cloud_deploy_success",{duration:p,environment:t,mountPath:r,projectName:n?.projectName,hasDescription:!!n?.description,hasDirectory:!!n?.directory,framework:a.info.name,buildCommand:a.getBuildCommand(),cloudflareBindings:c})}catch(p){l=p instanceof Error?p:new Error(String(p)),u.error(l,{prefix:"Error during deployment initialization:"});let m=Date.now()-s;await f?.sendError(l,"cloud_deploy_failure",{duration:m,environment:t,mountPath:r,projectName:n?.projectName,cloudflareBindings:c,argv:process.argv.slice(2)})}finally{if(gv(a,i),o&&await mv(e,o,r,l,{projectName:n?.projectName}),l)throw new d(l,{skipLogging:!0})}},ug=(e,t)=>()=>{let r=[_n(`${He} Get started with the following commands:`),B(`cd ${e}`),B("npm install"),B("npm run dev"),B("webflow cloud deploy")];t!==De.New&&(r.push(""),r.push(_n(`${He} Run the following command to export Webflow components when they update:`)),r.push(B("webflow devlink export")));let n=Math.max(...r.map(a=>Je(a).length)),o=S(`\u250C${"\u2500".repeat(n+2)}\u2510`),i=S(`\u2514${"\u2500".repeat(n+2)}\u2518`),s=r.map(a=>{let l=" ".repeat(n-Je(a).length);return`${S("\u2502")} ${a}${l} ${S("\u2502")}`});u.info([o,...s,i].join(`
|
|
158
|
+
`))};we();Be();ee();x();_e();var cg=g(require("path"));function Mr(e){if(!e||e.trim()==="")return"/";let t=cg.posix.normalize(e);return t.startsWith("/")||(t="/"+t),t.length>1&&t.endsWith("/")&&(t=t.slice(0,-1)),t=t.split("/").map((n,o)=>o===0?n:encodeURIComponent(n)).join("/"),t}function ss(e){return!(!e||e.trim()===""||!e.startsWith("/")||e.includes(".."))}O();H();var fg=require("crypto");oe();O();async function dg(e){let{accessToken:t,workspaceId:r,displayName:n,description:o,appPath:i}=e,a={requestId:(0,fg.randomUUID)(),cloudApp:{displayName:n,description:o,appPath:i,source:{type:"CLI",cli:{sourceUrl:em}}}},l=`${C}/cosmic/workspaces/${r}/cloudApps`,c=await fetch(l,{method:"POST",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json","Accept-Version":"1.0.0"},body:JSON.stringify(a)});if(!c.ok){let f=await c.text();throw hv(c.status,c.statusText,f)}return c.json()}function hv(e,t,r){let n={};try{n=JSON.parse(r)}catch{}return e===403?n.publicErrorCode==="missing_scopes"?new d(`Missing required scopes to create a Cloud app.
|
|
159
159
|
${n.msg??""}
|
|
160
|
-
Re-run 'webflow auth login' to grant the necessary permissions.`):new d(n.msg??"You don't have permission to create apps in this workspace."):
|
|
161
|
-
Upgrade your plan or remove unused apps to create a new one.`):new d(n.msg??"A Cloud app creation request is already being processed. Please wait and try again."):new d(`Failed to create app: ${
|
|
162
|
-
${n.msg}`:""))}re();
|
|
160
|
+
Re-run 'webflow auth login' to grant the necessary permissions.`):new d(n.msg??"You don't have permission to create apps in this workspace."):e===404?new d("Cloud app creation is not available. The workspace may not exist or the feature is not enabled for your account."):e===409?n.msg?.includes("No new sites can be created")?new d(`Failed to create app: your workspace has reached its app limit.
|
|
161
|
+
Upgrade your plan or remove unused apps to create a new one.`):new d(n.msg??"A Cloud app creation request is already being processed. Please wait and try again."):new d(`Failed to create app: ${e} ${t}`+(n.msg?`
|
|
162
|
+
${n.msg}`:""))}re();we();O();_e();Be();x();re();async function gg(e={}){yv(e);let t=await wv(e,G().manifest);return{credentials:t.credentials,workspaceId:t.workspaceId,manifest:G().manifest}}function yv(e){if(e.siteId&&e.workspaceId)throw new d("--site-id and --workspace-id are mutually exclusive. Pass exactly one.")}async function wv(e,t){if(e.siteId)return pg(t,e.siteId);if(e.workspaceId)return mg(e.workspaceId);if(t.siteId)return pg(t,t.siteId);if(t.cloud?.workspace_id)return mg(t.cloud.workspace_id);if(process.env.WEBFLOW_SITE_ID)return u.info("Using site from WEBFLOW_SITE_ID env var. Pass --site-id explicitly or unset to see the deploy mode picker."),hg(t);if(te()||!ut())throw new d(`No identity configured for this app.
|
|
163
163
|
Pass one of:
|
|
164
164
|
--site-id <id> (deploy to an existing Webflow site)
|
|
165
|
-
--workspace-id <id> (create a new
|
|
166
|
-
Or run 'webflow cloud init' to scaffold a new
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
- `);throw new d(`--framework "${f}" not found
|
|
165
|
+
--workspace-id <id> (create a new Cloud app)
|
|
166
|
+
Or run 'webflow cloud init' to scaffold a new app.`);return bv(t)}async function pg(e,t){return{credentials:await ge(e,{site:t})}}async function hg(e){return{credentials:await ge(e,{})}}async function mg(e){let t=await I();return{workspaceId:e,credentials:{accessToken:t,siteId:""}}}async function Dv(){let e=await I(),t=await rs(e);if(t.length===0)throw new d("No workspaces found in your account. Please make sure you have at least one workspace.");let r=await ns(t);return ae({cloud:{workspace_id:r.id}}),{workspaceId:r.id,credentials:{accessToken:e,siteId:""}}}async function bv(e){let t=await Ne({message:"This app isn't initialized for Webflow Cloud. How would you like to deploy?",choices:[{name:"Create a new app",value:"standalone"},{name:"Attach to an existing Webflow site",value:"site-attached"},{name:"Cancel",value:"cancel"}]});if(t==="cancel"||!t)throw new d("Deploy cancelled.",{skipLogging:!0});return t==="standalone"?Dv():hg(e)}ce();var wg=e=>{let t=e.command("cloud").description("Create and manage Webflow Cloud apps");t.command("create").description(`${ne("[Deprecated]")} Use 'webflow cloud init' instead. Quick non-interactive scaffold for site-attached apps (hardcoded to /app).`).argument("<name>","App name").option("-f, --framework <framework>","Framework to use","nextjs").action(async(o,i)=>{u.warn(`${Ee} ${ne("webflow cloud create")} is deprecated and will be removed in the next major release.
|
|
167
|
+
Use ${B("webflow cloud init")} instead.
|
|
168
|
+
`);let{framework:s}=i;if(!(await is()).find(c=>c===s)){u.error(`Framework ${s} not found`);return}await ru(o,"/app",s,void 0,De.Existing,void 0)}),t.command("list").description("Get list of app templates that can be used for `init`").action(async()=>{let o=await is();u.info("Available app templates:"),o.length>0?o.forEach(i=>u.info(`- ${i}`)):u.info("No templates found.")}),t.command("init").description("Bootstrap a new Webflow Cloud app").option("-n, --project-name <name>","App name").option("-f, --framework <framework>","Framework to use (e.g., astro, nextjs)").option("-m, --mount <mount>","Mount path (default: '/' for new domain, '/app' for existing site)").option("-s, --site-id <siteId>","Webflow site ID to connect to").option("--new","Create an app without connecting to an existing site").option("-w, --workspace-id <workspaceId>","Workspace ID where the app should be deployed (skips workspace picker)").action(async o=>{if(o.workspaceId&&o.siteId)throw new d("--workspace-id and --site-id are mutually exclusive. Pass exactly one.");let i=process.stdin.isTTY,s=await is(),a={};if(i&&ut()){if(o?.new!==!0&&(a.initMode=await Ne({message:"Where do you want to deploy this app?",choices:[{name:"New domain",value:De.New},{name:"Existing site",value:De.Existing}],default:De.New})),o?.framework||(a.scaffoldName=await Ne({message:"Which framework would you like to use?",choices:s.map(k=>({name:k,value:k})),default:"astro"})),!o.projectName){let k=await Ce({message:"What would you like to name your app?",validate:P=>{let V=P.trim();return V===""?"App name cannot be empty":V.length<zt||V.length>qt?`App name must be between ${zt} and ${qt} characters`:!0}});if(k==null)throw new d("When --no-input mode is enabled please provide the --project-name option or the cloud.project_id manifest field.");a.projectName=k}let w=o.new===!0||a.initMode===De.New;if(!o.mount&&!w){let k=await Ce({message:"What path do you want to use locally? (e.g., /app)",default:"/app"});a.mountPath=Mr(k)}}let l=o.projectName||a.projectName,c=o.framework||a.scaffoldName,f=o.new?De.New:a.initMode??(te()?De.New:De.Existing),p=f===De.New?o.mount||a.mountPath||"/":o.mount||a.mountPath||"/app",m=o.siteId,h=Mr(p);if(!l||typeof l!="string"||l.trim()==="")throw new d("--project-name cannot be empty");if(l.length<zt||l.length>qt)throw new d(`--project-name must be between ${zt} and ${qt} characters`);if(!c)throw new d("--framework is required");if(!s.includes(c)){let w=s.join(`
|
|
169
|
+
- `);throw new d(`--framework "${c}" not found
|
|
171
170
|
|
|
172
171
|
Available frameworks:
|
|
173
|
-
- ${
|
|
174
|
-
Use --project-name to provide a valid name.`);let
|
|
175
|
-
No existing apps found. A new app will be created during deployment.`)}catch(
|
|
172
|
+
- ${w}`)}if(typeof h!="string"||!ss(h))throw new d("Invalid mount path: "+h);if(f===De.Existing&&!m&&(!i||te()))throw new d("--site-id is required when connecting to an existing site in non-interactive mode.");await ru(l,h,c,m,f,o.workspaceId)}),t.command("deploy").description("Deploy your Webflow Cloud app").option("-e, --environment <environment>","Environment name").option("-m, --mount <mount>","Mount path (e.g., /app)").option("-n, --project-name <name>","App name (for new apps)").option("-d, --directory <path>","App directory path (for new apps)").option("--description <description>","App description (for new apps)").option("--skip-mount-path-check","Skip mount path checking").option("--auto-publish","Automatically publish site for mount path updates").option("-s, --site-id <siteId>","Webflow site ID for site-attached deploys (skips site picker)").option("-p, --project-id <projectId>","App ID (skips app picker)").option("-f, --framework <framework>","Override framework detection (e.g., nextjs, astro)").option("-w, --workspace-id <workspaceId>","Workspace ID where the app will be deployed (skips workspace picker)").action(async o=>{try{if(o.directory)try{process.chdir(o.directory),u.info(`Changed directory to: ${o.directory}`)}catch(V){throw u.error(`Error: Could not change to directory ${o.directory}`),new d(V)}if(o.framework){if(!vo.includes(o.framework))throw new d(`Framework "${o.framework}" is not supported. Allowed: ${vo.join(", ")}.`);ae({cloud:{framework:o.framework}})}let i=await gg({siteId:o.siteId,workspaceId:o.workspaceId}),{workspaceId:s}=i,{credentials:a,manifest:l}=i,c=!!s;if(s){let V=yg.default.basename(process.cwd()).trim(),le=V.length>=zt&&V.length<=qt,D=o.projectName??(le?V:"Cloud App");if(D.length<zt||D.length>qt)throw new d(`App name must be between ${zt} and ${qt} characters (got ${D.length}).
|
|
173
|
+
Use --project-name to provide a valid name.`);let K=u.spinner("Creating Cloud app...");try{let j=await dg({accessToken:a.accessToken,workspaceId:s,displayName:D});K.succeed(`Cloud app created: ${j.cloudApp.displayName}`),ae({siteId:j.cloudApp.siteId,cloud:{...l.cloud,project_id:j.cloudApp.project.id,environment_id:j.cloudApp.environment.id}}),Ft({siteId:j.cloudApp.siteId,directory:"."}),process.env.WEBFLOW_SITE_ID=j.cloudApp.siteId,{manifest:l}=G()}catch(j){throw K.fail("Failed to create app"),new d(j,{prefix:"Could not create app:"})}let Z=l.siteId;if(!Z)throw new d("Expected siteId in manifest after Cloud app creation.");a={accessToken:a.accessToken,siteId:Z}}let f;try{f=T.forCloud({authToken:a.accessToken,siteId:a.siteId})}catch(V){u.debug(`Failed to initialize telemetry: ${V}`)}let p=l.cloud||{},m=o.projectId??p.project_id,h,w,k=o.projectName,P=o.description;if(o.environment&&o.mount){if(h=o.environment,w=Mr(o.mount),!ss(w))throw new d("Invalid mount path: "+w)}else{let V=[];if(!m){if(!k&&te())throw new d("When --no-input mode is enabled please provide the --project-name option or the cloud.project_id manifest field.");try{let D=await Xm(a);if(D.projects.length>0){let K=await Ne({message:"Select an app to deploy to:",choices:[...D.projects.map(Z=>({name:`${Z.name} (${Z.description||"No description"})`,value:Z.id})),{name:"Create new app",value:null}]});K?(m=K,ae({cloud:{project_id:K}}),u.info(`${A} App ID updated in webflow.json`)):u.info("Creating a new app will be handled during deployment.")}else u.info(`
|
|
174
|
+
No existing apps found. A new app will be created during deployment.`)}catch(D){u.warn("Could not fetch existing apps. A new app will be created during deployment."),u.warn(D instanceof Error?D.message:String(D))}}if(!m&&!k&&(k=await Ce({message:"What would you like to name your new app?",default:"New Webflow Cloud App",validate:D=>D.trim()===""?"App name cannot be empty":!0})),m)try{let K=(await Ym(a,m)).environments.map(Z=>({name:`${Z.branch} (${Z.mount})`,value:{branch:Z.branch,mount:Z.mount}}));V.push(...K)}catch(D){throw new d(D,{prefix:"Error fetching app environments:"})}V.push({name:"Create new environment",value:null});let le=await Ne({message:"Select an environment to deploy to:",choices:V});if(le)h=le.branch,w=Mr(le.mount);else if(o.environment?h=o.environment:h=await Ce({message:"What environment would you like to deploy to?",default:"main",validate:D=>D.trim()===""?"Environment cannot be empty":!0}),o.mount)w=Mr(o.mount);else{let D=await Ce({message:"What path should this environment be mounted at? (e.g., /app)",default:"/app"});w=Mr(D)}}if(!ss(w))throw new d("Invalid mount path: "+w);await lg(a,h,w,{projectName:k,description:P,directory:o.directory,skipMountPathCheck:c||o.skipMountPathCheck,autoPublish:o.autoPublish,telemetry:f})}catch(i){throw new d(i,{prefix:"Error during deployment setup:"})}})};oe();O();ft();O();function U(e,t){if(!/^[a-f0-9]{24}$/.test(e))throw new d(`Invalid ${t}: "${e}" is not a valid resource ID.`,{isUserError:!0})}async function Dt(e){try{let t=await e.json();return t.message??t.error??`${e.status} ${e.statusText}`}catch{return`${e.status} ${e.statusText}`}}async function Dg(e,t){U(t,"siteId");let r=await q(`${C}/v2/sites/${t}/collections`,{headers:{Authorization:`Bearer ${e}`,Accept:"application/json"}});if(!r.ok){let o=await Dt(r);throw r.status>=400&&r.status<500?new d(o,{isUserError:!0}):new d(`Failed to list collections: ${o}`)}return(await r.json()).collections??[]}async function bg(e,t){U(t,"collectionId");let r=await q(`${C}/v2/collections/${t}`,{headers:{Authorization:`Bearer ${e}`,Accept:"application/json"}});if(r.status===404)throw new d(`Collection "${t}" not found`,{isUserError:!0});if(!r.ok)throw new d(`Failed to get collection: ${await Dt(r)}`);let n=await r.json();return{...n,fields:n.fields??[]}}async function vg(e,t,r){U(t,"siteId");let n={displayName:r.displayName,singularName:r.singularName};r.slug&&(n.slug=r.slug);let o=await q(`${C}/v2/sites/${t}/collections`,{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(n)});if(!o.ok){let i=await Dt(o);throw o.status>=400&&o.status<500?new d(i,{isUserError:!0}):new d(`Failed to create collection: ${i}`)}return await o.json()}async function Eg(e,t,r){U(t,"collectionId");let n=await q(`${C}/v2/collections/${t}/fields`,{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({displayName:r.displayName,type:r.type,isRequired:r.isRequired??!1})});if(!n.ok){let o=await Dt(n);throw n.status===404?new d(`Collection "${t}" not found`,{isUserError:!0}):n.status>=400&&n.status<500?new d(o,{isUserError:!0}):new d(`Failed to create field: ${o}`)}return await n.json()}async function nu(e,t,r={}){U(t,"collectionId");let n=new URLSearchParams;r.limit!=null&&n.set("limit",String(r.limit)),r.offset!=null&&n.set("offset",String(r.offset)),r.cmsLocaleId&&n.set("cmsLocaleId",r.cmsLocaleId);let o=n.toString()?`?${n.toString()}`:"",i=await q(`${C}/v2/collections/${t}/items${o}`,{headers:{Authorization:`Bearer ${e}`,Accept:"application/json"}});if(i.status===404)throw new d(`Collection "${t}" not found`,{isUserError:!0});if(!i.ok)throw new d(`Failed to list items: ${await Dt(i)}`);let s=await i.json();return{items:s.items??[],total:s.total??0,count:s.count??s.items?.length??0,limit:s.limit??r.limit??100,offset:s.offset??r.offset??0}}async function Fg(e,t,r,n){U(t,"collectionId"),U(r,"itemId");let o=n?`?cmsLocaleId=${encodeURIComponent(n)}`:"",i=await q(`${C}/v2/collections/${t}/items/${r}${o}`,{headers:{Authorization:`Bearer ${e}`,Accept:"application/json"}});if(i.status===404)throw new d(`Item "${r}" not found`,{isUserError:!0});if(!i.ok)throw new d(`Failed to get item: ${await Dt(i)}`);return await i.json()}async function ou(e,t,r,n=!1){U(t,"collectionId");let o=await q(`${C}/v2/collections/${t}/items`,{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({fieldData:r,isDraft:n})});if(!o.ok){let i=await Dt(o);throw o.status>=400&&o.status<500?new d(i,{isUserError:!0}):new d(`Failed to create item: ${i}`)}return await o.json()}async function iu(e,t,r,n){U(t,"collectionId"),U(r,"itemId");let o=await q(`${C}/v2/collections/${t}/items/${r}`,{method:"PATCH",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({fieldData:n})});if(o.status===404)throw new d(`Item "${r}" not found`,{isUserError:!0});if(!o.ok)throw new d(`Failed to update item: ${await Dt(o)}`);return await o.json()}async function xg(e,t,r){U(t,"collectionId"),U(r,"itemId");let n=await q(`${C}/v2/collections/${t}/items/${r}`,{method:"DELETE",headers:{Authorization:`Bearer ${e}`,Accept:"application/json"}});if(n.status===404)throw new d(`Item "${r}" not found`,{isUserError:!0});if(!n.ok)throw new d(`Failed to delete item: ${await Dt(n)}`)}async function Cg(e,t,r){U(t,"collectionId"),r.forEach(o=>U(o,"itemId"));let n=await q(`${C}/v2/collections/${t}/items/publish`,{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({itemIds:r})});if(!n.ok){let o=await Dt(n);throw n.status>=400&&n.status<500?new d(o,{isUserError:!0}):new d(`Failed to publish items: ${o}`)}return await n.json()}ce();x();var _g=(e,t)=>e+" ".repeat(Math.max(0,t-Je(e).length));function We(e,t){let r=e.map((s,a)=>Math.max(Je(s).length,...t.map(l=>Je(String(l[a])).length))),n=r.map(s=>"\u2500".repeat(s+2)).join("\u2500"),o=e.map((s,a)=>_g(s,r[a]+2)).join(""),i=t.map(s=>s.map((a,l)=>_g(String(a),r[l]+2)).join("")).join(`
|
|
176
175
|
`);return`${o}
|
|
177
176
|
${n}
|
|
178
|
-
${i}`}re();
|
|
179
|
-
`);let r=["NAME","SLUG","TYPE","REQUIRED"].map(o=>
|
|
180
|
-
`)}function
|
|
181
|
-
Next: add fields with "webflow cms fields create --collection ${a.id} --name <name> --type <type>"`)}catch(a){if(a instanceof d&&a.isUserError){
|
|
182
|
-
Showing ${l}\u2013${
|
|
183
|
-
`):"",s=n.map(l=>
|
|
184
|
-
Supported types: png, jpg, jpeg, gif, svg, webp, avif (\u22644 MB); pdf, doc, docx, xls, xlsx, ppt, pptx, txt, csv, odt, ods, odp, json, lottie (\u226410 MB)`).argument("<file>","Path to the file to upload (see supported types above)").addOption(Me()).option("--name <displayName>","Display name for the asset (defaults to filename)").option("--folder <folderId>","Upload into a folder").addOption(qe()).addOption(
|
|
185
|
-
`)?`"${s.replace(/"/g,'""')}"`:s};return[r.join(","),...
|
|
186
|
-
`)}async function
|
|
187
|
-
`).flatMap(o=>o.startsWith("Usage:")?["",
|
|
177
|
+
${i}`}re();we();async function as(e){if(e.site)return{token:await I(),siteId:e.site};let{manifest:t}=G(),r=await ge(t);return{token:r.accessToken,siteId:r.siteId}}function kg(e,t=["id","displayName","slug"]){if(e.length===0)return S("No collections found.");let r=["id","displayName","singularName","slug","lastUpdated"],n=Object.fromEntries(r.map(a=>[a.toLowerCase(),a])),o=t.map(a=>n[a.toLowerCase()]).filter(a=>a!=null);if(o.length===0)return bt(`Invalid fields. Available: ${r.join(", ")}`);let i=o.map(a=>Y(a)),s=e.map(a=>o.map(l=>{let c=a[l];return c?l==="lastUpdated"?new Date(c).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):c:S("\u2014")}));return We(i,s)}function Sg(e){let t=[`${Y("Collection:")} ${e.displayName}`,`${Y("ID:")} ${e.id}`,`${Y("Slug:")} ${e.slug}`,`${Y("Singular:")} ${e.singularName}`,`${Y("Updated:")} ${new Date(e.lastUpdated).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}`,"",Y("Fields:")];if(e.fields.length===0)return t.push(S(" No fields defined.")),t.join(`
|
|
178
|
+
`);let r=["NAME","SLUG","TYPE","REQUIRED"].map(o=>Y(o)),n=e.fields.map(o=>[o.displayName,o.slug,o.type,o.isRequired?"yes":"no"]);return t.push(We(r,n)),t.join(`
|
|
179
|
+
`)}function Tg(e,t=["id","isDraft","lastUpdated"]){if(e.length===0)return S("No items found.");let r=t.map(o=>Y(o)),n=e.map(o=>t.map(i=>{if(i==="fieldData")return JSON.stringify(o.fieldData);if(i==="isDraft")return o.isDraft?ne("draft"):B("live");if(i==="isArchived")return o.isArchived?S("archived"):"";if(i==="lastUpdated"||i==="lastPublished"||i==="createdOn"){let a=o[i];return a?new Date(a).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):S("\u2014")}let s=o[i];return s==null?S("\u2014"):String(s)}));return We(r,n)}O();x();H();function ls(e,t,r="asc"){return[...e].sort((n,o)=>{let i=n[t],s=o[t];if(i==null&&s==null)return 0;if(i==null)return 1;if(s==null)return-1;let a=0;return typeof i=="string"&&typeof s=="string"?a=i.localeCompare(s):typeof i=="number"&&typeof s=="number"?a=i-s:a=String(i).localeCompare(String(s)),r==="desc"?-a:a})}ee();async function su(e){let{token:t,siteId:r}=await as(e),n=T.forCms({authToken:t,siteId:r}),o=Date.now();try{let i=await Dg(t,r);if(await n.sendUsage("cms_collections_list",{duration:Date.now()-o,count:i.length}),i.length===0){u.info("No collections found.");return}let s=["displayName","slug","lastUpdated"];if(s.includes(e.sortBy)||(u.warn(`Unknown --sort-by "${e.sortBy}". Valid fields: ${s.join(", ")}. Defaulting to displayName.`),e.sortBy="displayName"),!["asc","desc"].includes(e.order))throw new d(`Invalid --order "${e.order}". Valid values: asc, desc`,{isUserError:!0});let a=ls(i,e.sortBy,e.order);if(e.json){u.info(JSON.stringify(a,null,2));return}let l=e.fields.split(",").map(c=>c.trim());u.info(kg(a,l))}catch(i){if(i instanceof d&&i.isUserError){u.info(`${F} ${i.message}`),process.exitCode=1;return}throw await n.sendError(i instanceof Error?i:new Error(String(i)),"cms_collections_list",{duration:Date.now()-o}),new d(i,{prefix:`${F} Failed to list collections:`})}}re();O();x();H();ee();async function au(e,t){let r=await I(),n=T.forCms({authToken:r}),o=Date.now();try{let i=await bg(r,e);if(await n.sendUsage("cms_collections_get",{duration:Date.now()-o}),t.json){u.info(JSON.stringify(i,null,2));return}u.info(Sg(i))}catch(i){if(i instanceof d&&i.isUserError){u.info(`${F} ${i.message}`),process.exitCode=1;return}throw await n.sendError(i instanceof Error?i:new Error(String(i)),"cms_collections_get",{duration:Date.now()-o}),new d(i,{prefix:`${F} Failed to get collection:`})}}O();x();H();ee();async function lu(e){let t=e.singularName??e.name,r=e.slug??e.name.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"");if(e.dryRun){u.info("Dry run \u2014 would create collection:"),u.info(JSON.stringify({displayName:e.name,singularName:t,slug:r},null,2)),u.info("Dry run complete \u2014 no changes made.");return}let{token:n,siteId:o}=await as(e),i=T.forCms({authToken:n,siteId:o}),s=Date.now();try{let a=await vg(n,o,{displayName:e.name,singularName:t,slug:r});if(await i.sendUsage("cms_collections_create",{duration:Date.now()-s}),e.json){u.info(JSON.stringify(a,null,2));return}u.info(`${A} Collection created: ${a.id}`),u.info(` Name: ${a.displayName}`),u.info(` Slug: ${a.slug}`),u.info(`
|
|
180
|
+
Next: add fields with "webflow cms fields create --collection ${a.id} --name <name> --type <type>"`)}catch(a){if(a instanceof d&&a.isUserError){u.info(`${F} ${a.message}`),process.exitCode=1;return}throw await i.sendError(a instanceof Error?a:new Error(String(a)),"cms_collections_create",{duration:Date.now()-s}),new d(a,{prefix:`${F} Failed to create collection:`})}}re();O();x();H();ee();async function uu(e){if(e.dryRun){u.info("Dry run \u2014 would create field:"),u.info(JSON.stringify({collectionId:e.collection,displayName:e.name,type:e.type,isRequired:e.required??!1},null,2)),u.info("Dry run complete \u2014 no changes made.");return}let t=await I(),r=T.forCms({authToken:t}),n=Date.now();try{let o=await Eg(t,e.collection,{displayName:e.name,type:e.type,isRequired:e.required??!1});if(await r.sendUsage("cms_fields_create",{duration:Date.now()-n}),e.json){u.info(JSON.stringify(o,null,2));return}u.info(`${A} Field created: ${o.id}`),u.info(` Name: ${o.displayName}`),u.info(` Type: ${o.type}`),u.info(` Slug: ${o.slug}`)}catch(o){if(o instanceof d&&o.isUserError){u.info(`${F} ${o.message}`),process.exitCode=1;return}throw await r.sendError(o instanceof Error?o:new Error(String(o)),"cms_fields_create",{duration:Date.now()-n}),new d(o,{prefix:`${F} Failed to create field:`})}}re();O();x();H();ee();async function cu(e){let t=await I(),r=T.forCms({authToken:t}),n=Date.now(),o=e.limit??100,i=e.offset??0;try{let s=await nu(t,e.collection,{limit:o,offset:i,cmsLocaleId:e.locale});if(await r.sendUsage("cms_items_list",{duration:Date.now()-n,count:s.items.length}),s.items.length===0){u.info("No items found.");return}if(e.json){u.info(JSON.stringify(s,null,2));return}let a=e.fields.split(",").map(p=>p.trim());u.info(Tg(s.items,a));let l=i+1,c=i+s.items.length;if(s.items.length>=o||i>0){let p=s.total>0?` of ${s.total}`:"";u.info(`
|
|
181
|
+
Showing ${l}\u2013${c}${p} items. Use --offset ${c} to load next page.`)}}catch(s){if(s instanceof d&&s.isUserError){u.info(`${F} ${s.message}`),process.exitCode=1;return}throw await r.sendError(s instanceof Error?s:new Error(String(s)),"cms_items_list",{duration:Date.now()-n}),new d(s,{prefix:`${F} Failed to list items:`})}}re();O();x();H();ee();async function fu(e){let t=await I(),r=T.forCms({authToken:t}),n=Date.now();try{let o=await Fg(t,e.collection,e.item,e.locale);if(await r.sendUsage("cms_items_get",{duration:Date.now()-n}),e.json){u.info(JSON.stringify(o,null,2));return}let i=o.isArchived?"archived":o.isDraft?"draft":"live";u.info(`${o.id} [${i}]`),u.info(` Last updated: ${new Date(o.lastUpdated).toLocaleString()}`),o.lastPublished&&u.info(` Last published: ${new Date(o.lastPublished).toLocaleString()}`),u.info(" Fields:"),u.info(JSON.stringify(o.fieldData,null,4).replace(/^/gm," "))}catch(o){if(o instanceof d&&o.isUserError){u.info(`${F} ${o.message}`),process.exitCode=1;return}throw await r.sendError(o instanceof Error?o:new Error(String(o)),"cms_items_get",{duration:Date.now()-n}),new d(o,{prefix:`${F} Failed to get item:`})}}re();O();x();H();ee();async function du(e){let t;try{t=JSON.parse(e.data)}catch{throw new d(`Invalid JSON for --data: ${e.data}`)}if(e.dryRun){u.info("Dry run \u2014 would create item:"),u.info(JSON.stringify({fieldData:t,isDraft:e.draft??!1},null,2)),u.info("Dry run complete \u2014 no changes made.");return}let r=await I(),n=T.forCms({authToken:r}),o=Date.now();try{let i=await ou(r,e.collection,t,e.draft??!1);if(await n.sendUsage("cms_items_create",{duration:Date.now()-o,dryRun:!1}),e.json){u.info(JSON.stringify(i,null,2));return}u.info(`${A} Item created: ${i.id}`)}catch(i){if(i instanceof d&&i.isUserError){u.info(`${F} ${i.message}`),process.exitCode=1;return}throw await n.sendError(i instanceof Error?i:new Error(String(i)),"cms_items_create",{duration:Date.now()-o}),new d(i,{prefix:`${F} Failed to create item:`})}}re();O();x();H();ee();async function pu(e){let t;try{t=JSON.parse(e.data)}catch{throw new d(`Invalid JSON for --data: ${e.data}`)}if(e.dryRun){u.info("Dry run \u2014 would update item:"),u.info(JSON.stringify({collectionId:e.collection,itemId:e.item,fieldData:t},null,2)),u.info("Dry run complete \u2014 no changes made.");return}let r=await I(),n=T.forCms({authToken:r}),o=Date.now();try{let i=await iu(r,e.collection,e.item,t);if(await n.sendUsage("cms_items_update",{duration:Date.now()-o,dryRun:!1}),e.json){u.info(JSON.stringify(i,null,2));return}u.info(`${A} Item updated: ${i.id}`)}catch(i){if(i instanceof d&&i.isUserError){u.info(`${F} ${i.message}`),process.exitCode=1;return}throw await n.sendError(i instanceof Error?i:new Error(String(i)),"cms_items_update",{duration:Date.now()-o}),new d(i,{prefix:`${F} Failed to update item:`})}}re();O();x();H();ee();async function mu(e){if(e.dryRun){u.info(`Dry run \u2014 would delete item ${e.item} from collection ${e.collection}`),u.info("Dry run complete \u2014 no changes made.");return}let t=await I(),r=T.forCms({authToken:t}),n=Date.now();try{await xg(t,e.collection,e.item),await r.sendUsage("cms_items_delete",{duration:Date.now()-n,dryRun:!1}),u.info(`${A} Item deleted: ${e.item}`)}catch(o){if(o instanceof d&&o.isUserError){u.info(`${F} ${o.message}`),process.exitCode=1;return}throw await r.sendError(o instanceof Error?o:new Error(String(o)),"cms_items_delete",{duration:Date.now()-n}),new d(o,{prefix:`${F} Failed to delete item:`})}}re();O();x();H();ee();async function gu(e){let t=e.items.split(",").map(i=>i.trim());if(e.dryRun){u.info(`Dry run \u2014 would publish ${t.length} item(s) in collection ${e.collection}:`),t.forEach(i=>u.info(` ${i}`)),u.info("Dry run complete \u2014 no changes made.");return}let r=await I(),n=T.forCms({authToken:r}),o=Date.now();try{let i=await Cg(r,e.collection,t);if(await n.sendUsage("cms_items_publish",{duration:Date.now()-o,itemCount:t.length,dryRun:!1}),e.json){u.info(JSON.stringify(i,null,2));return}let s=i.publishedItemIds?.length??0;u.info(`${A} Published ${s} item(s)`),i.errors?.length&&i.errors.forEach(a=>u.warn(` ${a.itemId}: ${a.message}`))}catch(i){if(i instanceof d&&i.isUserError){u.info(`${F} ${i.message}`),process.exitCode=1;return}throw await n.sendError(i instanceof Error?i:new Error(String(i)),"cms_items_publish",{duration:Date.now()-o}),new d(i,{prefix:`${F} Failed to publish items:`})}}var Ag=e=>{let t=e.command("cms").description("Manage Webflow CMS content"),r=t.command("collections").description("Manage CMS collections");r.command("list").description("List all CMS collections for a site").addOption(Me()).addOption(fe()).addOption(kt(["id","displayName","singularName","slug","lastUpdated"]).default("id,displayName,slug")).addOption(ji(["displayName","slug","lastUpdated"]).default("displayName")).addOption(Pi()).action(su),r.command("get").description("Get details and field schema for a CMS collection").argument("<collectionId>","Collection ID").addOption(fe()).action(au),r.command("create").description("Create a new CMS collection on a site. Use --dry-run to preview.").addOption(Me()).requiredOption("--name <displayName>","Collection display name").option("--singular-name <singularName>","Singular name (defaults to --name)").option("--slug <slug>","URL slug for the collection (auto-derived from --name if omitted)").addOption(qe()).addOption(fe()).action(lu),t.command("fields").description("Manage CMS collection fields").command("create").description("Add a field to a CMS collection. Use --dry-run to preview.").requiredOption("--collection <collectionId>","Collection ID").requiredOption("--name <displayName>","Field display name").requiredOption("--type <type>","Field type (e.g. PlainText, RichText, Number, DateTime, Link, Image, Video, Color, Bool, Option, ItemRef, ItemRefSet)").option("--required","Mark field as required").addOption(qe()).addOption(fe()).action(uu);let o=t.command("items").description("Manage CMS items");o.command("list").description("List items in a CMS collection").requiredOption("--collection <collectionId>","Collection ID").option("--locale <cmsLocaleId>","CMS locale ID to filter by").addOption(Ni()).addOption(Bi()).addOption(fe()).addOption(kt(["id","isDraft","isArchived","lastUpdated","fieldData"]).default("id,isDraft,lastUpdated")).action(cu),o.command("get").description("Get a single CMS item by ID").requiredOption("--collection <collectionId>","Collection ID").requiredOption("--item <itemId>","Item ID").option("--locale <cmsLocaleId>","CMS locale ID to retrieve content for").addOption(fe()).action(fu),o.command("create").description("Create a new CMS item. Use --dry-run to preview before executing.").requiredOption("--collection <collectionId>","Collection ID").requiredOption("--data <json>","Item field data as a JSON string").option("--draft","Create as draft (not published)").addOption(qe()).addOption(fe()).action(du),o.command("update").description("Update an existing CMS item. Use --dry-run to preview before executing.").requiredOption("--collection <collectionId>","Collection ID").requiredOption("--item <itemId>","Item ID").requiredOption("--data <json>","Updated field data as a JSON string").addOption(qe()).addOption(fe()).action(pu),o.command("delete").description("Delete a CMS item. Use --dry-run to preview before executing.").requiredOption("--collection <collectionId>","Collection ID").requiredOption("--item <itemId>","Item ID").addOption(qe()).action(mu),o.command("publish").description("Publish one or more CMS items. Use --dry-run to preview before executing.").requiredOption("--collection <collectionId>","Collection ID").requiredOption("--items <itemIds>","Comma-separated item IDs to publish").addOption(qe()).addOption(fe()).action(gu)};re();ce();O();x();H();we();ee();oe();ft();O();O();ce();var Og={png:{category:"image",maxBytes:4*1024*1024},jpeg:{category:"image",maxBytes:4*1024*1024},jpg:{category:"image",maxBytes:4*1024*1024},gif:{category:"image",maxBytes:4*1024*1024},svg:{category:"image",maxBytes:4*1024*1024},webp:{category:"image",maxBytes:4*1024*1024},avif:{category:"image",maxBytes:4*1024*1024},pdf:{category:"document",maxBytes:10*1024*1024},doc:{category:"document",maxBytes:10*1024*1024},docx:{category:"document",maxBytes:10*1024*1024},xls:{category:"document",maxBytes:10*1024*1024},xlsx:{category:"document",maxBytes:10*1024*1024},ppt:{category:"document",maxBytes:10*1024*1024},pptx:{category:"document",maxBytes:10*1024*1024},txt:{category:"document",maxBytes:10*1024*1024},csv:{category:"document",maxBytes:10*1024*1024},odt:{category:"document",maxBytes:10*1024*1024},ods:{category:"document",maxBytes:10*1024*1024},odp:{category:"document",maxBytes:10*1024*1024},json:{category:"lottie",maxBytes:10*1024*1024},lottie:{category:"lottie",maxBytes:10*1024*1024}};function us(e,t){let r=e.split(".").pop()?.toLowerCase()??"",n=Og[r];if(!n){let o=Object.keys(Og).join(", ");throw new d(`Unsupported file type ".${r}". Allowed types: ${o}`,{isUserError:!0})}if(t>n.maxBytes){let o=n.maxBytes/1048576,i=(t/(1024*1024)).toFixed(1);throw new d(`File too large: ${i} MB exceeds the ${o} MB limit for ${n.category} files.`,{isUserError:!0})}}var hu=["id","displayName","originalFileName","contentType","size","lastUpdated"];function Ig(e,t=["id","displayName","lastUpdated","size"]){if(e.length===0)return S("No assets found.");let r=Object.fromEntries(hu.map(l=>[l.toLowerCase(),l])),n=t.map(l=>r[l.toLowerCase()]).filter(l=>l!=null);if(n.length===0)return bt(`Invalid fields. Available: ${hu.join(", ")}`);let o=t.filter(l=>r[l.toLowerCase()]==null),i=o.length>0?ne(`Warning: unknown field(s) ignored: ${o.join(", ")}. Available: ${hu.join(", ")}
|
|
182
|
+
`):"",s=n.map(l=>Y(l)),a=e.map(l=>n.map(c=>{let f=l[c];if(f==null||c==="size"&&f===0)return S("\u2014");if(c==="size")return vv(Number(f));if(c==="lastUpdated"){let m=new Date(String(f)),h=String(m.getMonth()+1).padStart(2,"0"),w=String(m.getDate()).padStart(2,"0"),k=String(m.getFullYear()).slice(-2),P=String(m.getHours()).padStart(2,"0"),V=String(m.getMinutes()).padStart(2,"0");return`${h}/${w}/${k} ${P}:${V}`}let p=String(f);return c==="displayName"&&p.length>40?S("\u2026")+p.slice(-39):p}));return i+We(s,a)}function vv(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function $g(e){if(e.length===0)return S("No folders found.");let t=[...e].sort((o,i)=>o.displayName.localeCompare(i.displayName)),r=["id","displayName","assets","lastUpdated"].map(o=>Y(o)),n=t.map(o=>[o.id,o.displayName,String(o.assets.length),new Date(o.lastUpdated).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1})]);return We(r,n)}async function Rg(e,t,r={}){if(U(t,"siteId"),r.folderId){U(r.folderId,"folderId");let a=await Ev(e,r.folderId),l=new Set(a.assets);if(l.size===0)return{assets:[],pagination:{total:0,limit:0,offset:0}};let c=[],f=0,p=100;for(;;){let P=await q(`${C}/v2/sites/${t}/assets?limit=${p}&offset=${f}`,{headers:{Authorization:`Bearer ${e}`,Accept:"application/json"}});if(!P.ok)throw new d(`Failed to list assets: ${P.status} ${P.statusText}`);let V=await P.json(),le=V.assets??[];c.push(...le);let D=V.pagination?.total??0;if(f+=le.length,f>=D||le.length===0)break}let m=c.filter(P=>l.has(P.id)),h=r.offset??0,w=r.limit??m.length,k=m.slice(h,h+w);return{assets:k,pagination:{total:m.length,limit:k.length,offset:h}}}let n=new URLSearchParams;r.limit!=null&&n.set("limit",String(r.limit)),r.offset!=null&&n.set("offset",String(r.offset));let o=n.toString(),i=await q(`${C}/v2/sites/${t}/assets${o?`?${o}`:""}`,{headers:{Authorization:`Bearer ${e}`,Accept:"application/json"}});if(!i.ok)throw new d(`Failed to list assets: ${i.status} ${i.statusText}`);let s=await i.json();return{assets:s.assets??[],pagination:s.pagination??{total:0,limit:100,offset:0}}}async function Pg(e,t,r,n,o){U(t,"siteId"),o&&U(o,"folderId");let i=to(r);us(i.meta.title,i.meta.size);let s=n??i.meta.title,a={fileName:i.meta.title,fileHash:i.meta.fileHash,displayName:s};o&&(a.parentFolder=o);let l=await q(`${C}/v2/sites/${t}/assets`,{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(a)});if(!l.ok)throw new d(`Failed to initiate asset upload: ${l.status} ${l.statusText}`);let c=await l.json(),f={fields:c.uploadDetails,_id:c.id,s3Url:c.hostedUrl??"",url:c.uploadUrl??"",contentType:c.contentType??"",origFileName:c.originalFileName??i.meta.title,success_action_redirect:"",createdOn:"",updatedOn:""};try{await no(i,f)}catch(p){throw await q(`${C}/v2/assets/${f._id}`,{method:"DELETE",headers:{Authorization:`Bearer ${e}`,Accept:"application/json"}}).catch(()=>{}),p}return{id:f._id,hostedUrl:f.s3Url,displayName:s,originalFileName:i.meta.title}}async function jg(e,t,r){U(t,"assetId");let n=await q(`${C}/v2/assets/${t}`,{method:"PATCH",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(r)});if(!n.ok)throw new d(`Failed to update asset: ${n.status} ${n.statusText}`);return await n.json()}async function Ev(e,t){U(t,"folderId");let r=await q(`${C}/v2/asset_folders/${t}`,{headers:{Authorization:`Bearer ${e}`,Accept:"application/json"}});if(!r.ok)throw new d(`Failed to get folder: ${r.status} ${r.statusText}`);return await r.json()}async function Ng(e,t){U(t,"siteId");let r=await q(`${C}/v2/sites/${t}/asset_folders`,{headers:{Authorization:`Bearer ${e}`,Accept:"application/json"}});if(!r.ok)throw new d(`Failed to list folders: ${r.status} ${r.statusText}`);return(await r.json()).assetFolders??[]}async function Bg(e,t,r,n){U(t,"siteId"),n&&U(n,"parentFolderId");let o={displayName:r};n&&(o.parentFolder=n);let i=await q(`${C}/v2/sites/${t}/asset_folders`,{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(o)});if(!i.ok)throw new d(`Failed to create folder: ${i.status} ${i.statusText}`);return await i.json()}async function yu(e){let t,r;if(e.site)t=await I(),r=e.site;else{let{manifest:i}=G(),s=await ge(i);t=s.accessToken,r=s.siteId}let n=T.forAssets({authToken:t,siteId:r}),o=Date.now();try{let{assets:i,pagination:s}=await Rg(t,r,{limit:e.limit,offset:e.offset,folderId:e.folder});if(await n.sendUsage("assets_list",{duration:Date.now()-o,count:i.length}),i.length===0){u.info("No assets found.");return}let a=["displayName","originalFileName","contentType","size","lastUpdated"],l=e.sortBy;a.includes(l)||(u.warn(`Unknown --sort-by "${e.sortBy}". Valid fields: ${a.join(", ")}. Defaulting to displayName.`),l="displayName");let c=e.order;["asc","desc"].includes(e.order)||(u.warn(`Unknown --order "${e.order}". Valid values: asc, desc. Defaulting to asc.`),c="asc");let f=ls(i,l,c);if(e.json){u.info(JSON.stringify({assets:f,pagination:s},null,2));return}let p=e.fields.split(",").map(h=>h.trim());u.info(Ig(f,p));let m=(e.offset??0)+i.length;m<s.total&&u.info(S(`Showing ${m} of ${s.total} assets. Use --offset ${m} to see more.`))}catch(i){throw await n.sendError(i instanceof Error?i:new Error(String(i)),"assets_list",{duration:Date.now()-o}),new d(i,{prefix:`${F} Failed to list assets:`})}}re();O();x();H();we();ee();async function wu(e,t){let r=to(e);if(us(r.meta.title,r.meta.size),t.dryRun){u.info(`Dry run \u2014 would upload: ${e} (validated)`),t.name&&u.info(` Display name: ${t.name}`),t.folder&&u.info(` Folder: ${t.folder}`),u.info("Dry run complete \u2014 no changes made.");return}let n,o;if(t.site)n=await I(),o=t.site;else{let{manifest:a}=G(),l=await ge(a);n=l.accessToken,o=l.siteId}let i=T.forAssets({authToken:n,siteId:o}),s=Date.now();try{let a=await Pg(n,o,e,t.name,t.folder);if(await i.sendUsage("assets_upload",{duration:Date.now()-s,dryRun:!1}),t.json){u.info(JSON.stringify(a,null,2));return}u.info(`${A} Asset uploaded: ${a.id}`),a.hostedUrl&&u.info(` URL: ${a.hostedUrl}`)}catch(a){throw await i.sendError(a instanceof Error?a:new Error(String(a)),"assets_upload",{duration:Date.now()-s}),new d(a,{prefix:`${F} Failed to upload asset:`})}}re();O();x();H();ee();async function Du(e,t){if(!t.altText&&!t.displayName)throw new d("Provide at least one of --alt-text or --display-name.",{isUserError:!0});if(t.dryRun){u.info(`Dry run \u2014 would update asset: ${e}`),t.altText&&u.info(` Alt text: ${t.altText}`),t.displayName&&u.info(` Display name: ${t.displayName}`),u.info("Dry run complete \u2014 no changes made.");return}let r=await I(),n=T.forAssets({authToken:r}),o=Date.now();try{let i=await jg(r,e,{altText:t.altText,displayName:t.displayName});if(await n.sendUsage("assets_update",{duration:Date.now()-o,dryRun:!1}),t.json){u.info(JSON.stringify(i,null,2));return}u.info(`${A} Asset updated: ${i.id}`),i.displayName&&u.info(` Display name: ${i.displayName}`),i.altText&&u.info(` Alt text: ${i.altText}`)}catch(i){throw await n.sendError(i instanceof Error?i:new Error(String(i)),"assets_update",{duration:Date.now()-o}),new d(i,{prefix:`${F} Failed to update asset:`})}}re();O();x();H();we();ee();async function bu(e){let t,r;if(e.site)t=await I(),r=e.site;else{let{manifest:i}=G(),s=await ge(i);t=s.accessToken,r=s.siteId}let n=T.forAssets({authToken:t,siteId:r}),o=Date.now();try{let i=await Ng(t,r);if(await n.sendUsage("assets_folders_list",{duration:Date.now()-o,count:i.length}),e.json){u.info(JSON.stringify(i,null,2));return}u.info($g(i))}catch(i){throw await n.sendError(i instanceof Error?i:new Error(String(i)),"assets_folders_list",{duration:Date.now()-o}),new d(i,{prefix:`${F} Failed to list folders:`})}}re();O();x();H();Pn();ee();async function vu(e,t){let r,n;if(t.site)r=await I(),n=t.site;else{let{manifest:s}=G(),a=await ge(s);r=a.accessToken,n=a.siteId}let o=T.forAssets({authToken:r,siteId:n}),i=Date.now();try{let s=await Bg(r,n,e,t.parent);if(await o.sendUsage("assets_folders_create",{duration:Date.now()-i}),t.json){u.info(JSON.stringify(s,null,2));return}u.info(`${A} Folder created: ${s.id}`),u.info(` Name: ${s.displayName}`),s.parentFolder&&u.info(` Parent: ${s.parentFolder}`)}catch(s){throw await o.sendError(s instanceof Error?s:new Error(String(s)),"assets_folders_create",{duration:Date.now()-i}),new d(s,{prefix:`${F} Failed to create folder:`})}}var Mg=e=>{let t=e.command("assets").description("Manage Webflow site assets");t.command("list").description("List all assets for a site").addOption(Me()).option("--folder <folderId>","Filter by folder ID").addOption(fe()).addOption(kt(["id","displayName","originalFileName","contentType","size","lastUpdated"]).default("id,displayName,lastUpdated,size")).addOption(Ni()).addOption(Bi()).addOption(ji(["displayName","originalFileName","contentType","size","lastUpdated"]).default("displayName")).addOption(Pi()).action(yu),t.command("upload").description(`Upload a file as an asset. Use --dry-run to preview before uploading.
|
|
183
|
+
Supported types: png, jpg, jpeg, gif, svg, webp, avif (\u22644 MB); pdf, doc, docx, xls, xlsx, ppt, pptx, txt, csv, odt, ods, odp, json, lottie (\u226410 MB)`).argument("<file>","Path to the file to upload (see supported types above)").addOption(Me()).option("--name <displayName>","Display name for the asset (defaults to filename)").option("--folder <folderId>","Upload into a folder").addOption(qe()).addOption(fe()).action(wu),t.command("update").description("Update an asset's metadata. Use --dry-run to preview.").argument("<assetId>","Asset ID to update").option("--alt-text <text>","Alt text for the asset").option("--display-name <name>","New display name for the asset").addOption(qe()).addOption(fe()).action(Du);let r=t.command("folders").description("Manage asset folders");r.command("list").description("List all asset folders for a site").addOption(Me()).addOption(fe()).action(bu),r.command("create").description("Create a new asset folder").argument("<name>","Display name for the folder").addOption(Me()).option("--parent <folderId>","Parent folder ID (creates a nested folder)").addOption(fe()).action(vu)};re();O();x();H();ee();oe();O();ft();ft();O();async function xo(e,t,r,n){let o=[],i=0,s=100;for(;;){let a=new URL(e);a.searchParams.set("limit",String(s)),a.searchParams.set("offset",String(i));let l=await q(a.toString(),{headers:{Authorization:`Bearer ${t}`,Accept:"application/json"}});if(!l.ok)throw new d(`${n}: ${l.status} ${l.statusText}`);let c=await l.json(),f=c[r]??[];o.push(...f);let p=c.pagination?.total??f.length;if(i+=f.length,i>=p||f.length<s)break}return o}async function Lg(e,t){U(t,"siteId");let r=await q(`${C}/v2/sites/${t}`,{headers:{Authorization:`Bearer ${e}`,Accept:"application/json"}});if(!r.ok)throw new d(`Failed to get site: ${r.status} ${r.statusText}`);return await r.json()}async function Wg(e){return xo(`${C}/v2/sites`,e,"sites","Failed to list sites")}async function Ug(e,t){U(t,"siteId");let r=await q(`${C}/v2/sites/${t}/custom_domains`,{headers:{Authorization:`Bearer ${e}`,Accept:"application/json"}});if(!r.ok)throw new d(`Failed to get custom domains: ${r.status} ${r.statusText}`);return(await r.json()).customDomains??[]}async function Vg(e,t,r=[],n){U(t,"siteId"),n&&U(n,"pageId");let o=r.length>0?{customDomains:r}:{publishToWebflowSubdomain:!0};n&&(o.pageId=n);let i=await q(`${C}/v2/sites/${t}/publish`,{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(o)});if(!i.ok)throw new d(`Failed to publish site: ${i.status} ${i.statusText}`);return await i.json()}O();ce();var Eu=["id","displayName","shortName","lastPublished","lastUpdated","timeZone"],Fv=Object.fromEntries(Eu.map(e=>[e.toLowerCase(),e]));function Hg(e){let t=[],r=[];for(let n of e){let o=Fv[n.toLowerCase()];o?t.push(o):r.push(n)}return{valid:t,invalid:r}}function Fu(){return Eu}function Jg(e,t=["id","displayName","lastPublished"]){if(e.length===0)return S("No sites found.");if(t.length===0)throw new d(`No valid fields specified. Available: ${Eu.join(", ")}`,{isUserError:!0});let r=t.map(o=>Y(o)),n=e.map(o=>t.map(i=>{let s=o[i];return s?i==="lastPublished"||i==="lastUpdated"?new Date(s).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):s:S("\u2014")}));return We(r,n)}function Gg(e){if(e.length===0)return S("No custom domains configured.");let t=[Y("id"),Y("url"),Y("lastPublished")],r=e.map(n=>[n.id,n.url,n.lastPublished?new Date(n.lastPublished).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):S("\u2014")]);return We(t,r)}async function xu(e){let t=await I(),r=T.forSites({authToken:t}),n=Date.now();try{let o=await Wg(t);if(await r.sendUsage("sites_list",{duration:Date.now()-n,count:o.length}),e.json){u.info(JSON.stringify(o,null,2));return}if(o.length===0){u.info("No sites found.");return}let i=e.fields.split(",").map(l=>l.trim()),{valid:s,invalid:a}=Hg(i);if(s.length===0)throw new d(`No valid fields specified. Available: ${Fu().join(", ")}`,{isUserError:!0});a.length>0&&u.warn(`Unknown field(s): ${a.join(", ")}. Available: ${Fu().join(", ")}`),u.info(Jg(o,s))}catch(o){throw o instanceof d&&o.isUserError?o:(await r.sendError(o instanceof Error?o:new Error(String(o)),"sites_list",{duration:Date.now()-n}),new d(o,{prefix:`${F} Failed to list sites:`}))}}re();O();x();H();ee();async function Cu(e,t){let r=await I(),n=T.forSites({authToken:r}),o=Date.now();try{let i=await Lg(r,e);if(await n.sendUsage("sites_get",{duration:Date.now()-o}),t.json){u.info(JSON.stringify(i,null,2));return}u.info(`${i.displayName} (${i.id})`),u.info(` Short name: ${i.shortName}`),u.info(` Time zone: ${i.timeZone}`),i.lastPublished&&u.info(` Published: ${new Date(i.lastPublished).toLocaleString()}`),i.previewUrl&&u.info(` Preview: ${i.previewUrl}`)}catch(i){throw i instanceof d&&i.isUserError?i:(await n.sendError(i instanceof Error?i:new Error(String(i)),"sites_get",{duration:Date.now()-o}),new d(i,{prefix:`${F} Failed to get site:`}))}}re();O();x();H();ee();async function _u(e){let t=await I(),r=T.forSites({authToken:t}),n=Date.now();try{let o=await Ug(t,e.site);if(await r.sendUsage("sites_domains",{duration:Date.now()-n,count:o.length}),e.json){u.info(JSON.stringify(o,null,2));return}u.info(Gg(o))}catch(o){throw o instanceof d&&o.isUserError?o:(await r.sendError(o instanceof Error?o:new Error(String(o)),"sites_domains",{duration:Date.now()-n}),new d(o,{prefix:`${F} Failed to get custom domains:`}))}}re();O();x();H();ee();async function ku(e){if(U(e.site,"siteId"),e.dryRun){u.info(`Would publish ${e.page?`page ${e.page} on`:"site"} ${e.site}`),e.domains?u.info(` Custom domains: ${e.domains}`):u.info(" Domains: Webflow subdomain");return}let t=await I(),r=T.forSites({authToken:t}),n=Date.now();try{let o=e.domains?e.domains.split(",").map(l=>l.trim()):[],i=await Vg(t,e.site,o,e.page);if(await r.sendUsage("sites_publish",{duration:Date.now()-n,dryRun:!1,publishScope:i.publishScope}),e.json){u.info(JSON.stringify(i,null,2));return}let s=i.publishScope==="page"?"Page":"Site";u.info(`${A} ${s} published successfully`);let a=i.customDomains??[];a.length>0?a.forEach(l=>{let c=l.lastPublished?` (${new Date(l.lastPublished).toLocaleString()})`:"";u.info(` Live at: https://${l.url}${c}`)}):i.publishToWebflowSubdomain&&u.info(" Published to Webflow subdomain")}catch(o){throw o instanceof d&&o.isUserError?o:(await r.sendError(o instanceof Error?o:new Error(String(o)),"sites_publish",{duration:Date.now()-n}),new d(o,{prefix:`${F} Failed to publish site:`}))}}var zg=e=>{let t=e.command("sites").description("Manage Webflow sites");t.command("list").description("List all sites in your Webflow workspace").addOption(fe()).addOption(kt(["id","displayName","shortName","lastPublished","lastUpdated","timeZone"]).default("id,displayName,lastPublished")).action(xu),t.command("get").description("Get details for a specific site").argument("<siteId>","Site ID").addOption(fe()).action(Cu),t.command("domains").description("List custom domains configured for a site").requiredOption("--site <siteId>","Site ID").addOption(fe()).action(_u),t.command("publish").description("Publish a Webflow site (defaults to Webflow subdomain)").requiredOption("--site <siteId>","Site ID to publish").option("--domains <domains>","Comma-separated custom domain IDs to publish to").option("--page <pageId>","Publish a single page instead of the whole site").addOption(qe()).addOption(fe()).action(ku)};re();O();x();H();ee();oe();async function qg(e,t){return U(t,"siteId"),xo(`${C}/v2/sites/${t}/forms`,e,"forms","Failed to list forms")}async function Kg(e,t,r){return U(t,"siteId"),U(r,"formId"),xo(`${C}/v2/sites/${t}/forms/${r}/submissions`,e,"formSubmissions","Failed to list submissions")}O();ce();var Su=["id","displayName","name","slug","createdOn","lastUpdated"],xv=Object.fromEntries(Su.map(e=>[e.toLowerCase(),e]));function Zg(e){let t=[],r=[];for(let n of e){let o=xv[n.toLowerCase()];o?t.push(o):r.push(n)}return{valid:t,invalid:r}}function Tu(){return Su}function Yg(e,t=["id","displayName","slug"]){if(e.length===0)return S("No forms found.");if(t.length===0)throw new d(`No valid fields specified. Available: ${Su.join(", ")}`,{isUserError:!0});let r=t.map(o=>Y(o)),n=e.map(o=>t.map(i=>{let s=o[i];return s?i==="createdOn"||i==="lastUpdated"?new Date(s).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):s:S("\u2014")}));return We(r,n)}function Xg(e){if(e.length===0)return S("No submissions found.");let t=Array.from(new Set(e.flatMap(o=>Object.keys(o.formResponse)))),r=["id","dateSubmitted",...t].map(o=>Y(o)),n=e.map(o=>[o.id,new Date(o.dateSubmitted).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),...t.map(i=>{let s=o.formResponse[i];return s==null?S("\u2014"):typeof s=="object"?JSON.stringify(s):String(s)})]);return We(r,n)}function Qg(e){if(e.length===0)return"";let r=["id","formId","displayName","dateSubmitted",...Array.from(new Set(e.flatMap(i=>Object.keys(i.formResponse))))],n=i=>{let s=i==null?"":typeof i=="object"?JSON.stringify(i):String(i);return s.includes(",")||s.includes('"')||s.includes(`
|
|
184
|
+
`)?`"${s.replace(/"/g,'""')}"`:s};return[r.join(","),...e.map(i=>r.map(s=>n(s==="id"?i.id:s==="formId"?i.formId:s==="displayName"?i.displayName:s==="dateSubmitted"?i.dateSubmitted:i.formResponse[s])).join(","))].join(`
|
|
185
|
+
`)}async function Au(e){U(e.site,"siteId");let t=await I(),r=T.forForms({authToken:t}),n=Date.now();try{let o=await qg(t,e.site);if(await r.sendUsage("forms_list",{duration:Date.now()-n,count:o.length}),e.json){u.info(JSON.stringify(o,null,2));return}if(o.length===0){u.info("No forms found.");return}let i=e.fields.split(",").map(l=>l.trim()),{valid:s,invalid:a}=Zg(i);if(s.length===0)throw new d(`No valid fields specified. Available: ${Tu().join(", ")}`,{isUserError:!0});a.length>0&&u.warn(`Unknown field(s): ${a.join(", ")}. Available: ${Tu().join(", ")}`),u.info(Yg(o,s))}catch(o){throw o instanceof d&&o.isUserError?o:(await r.sendError(o instanceof Error?o:new Error(String(o)),"forms_list",{duration:Date.now()-n}),new d(o,{prefix:`${F} Failed to list forms:`}))}}var eh=g(require("fs"));re();O();x();H();ee();async function Ou(e){U(e.site,"siteId"),U(e.form,"formId"),e.output&&e.json&&u.warn("--json is ignored when --output is set.");let t=await I(),r=T.forForms({authToken:t}),n=Date.now();try{let o=await Kg(t,e.site,e.form);if(await r.sendUsage("forms_submissions",{duration:Date.now()-n,count:o.length}),o.length===0){u.info("No submissions found.");return}if(e.output){let i=Qg(o);eh.default.writeFileSync(e.output,i,"utf8"),u.info(`${A} ${o.length} submission${o.length===1?"":"s"} written to ${e.output}`);return}if(e.json){u.info(JSON.stringify(o,null,2));return}u.info(Xg(o))}catch(o){throw await r.sendError(o instanceof Error?o:new Error(String(o)),"forms_submissions",{duration:Date.now()-n}),new d(o,{prefix:`${F} Failed to fetch submissions:`})}}var th=e=>{let t=e.command("forms").description("Manage Webflow forms");t.command("list").description("List all forms for a site").addOption(Me()).addOption(fe()).addOption(kt(["id","displayName","name","slug","createdOn","lastUpdated"]).default("id,displayName,slug")).action(Au),t.command("submissions").description("List or export form submissions").requiredOption("--site <siteId>","Site ID").requiredOption("--form <formId>","Form ID").option("--json","Output as JSON").option("--output <file>","Save submissions as CSV to a file").action(Ou)};var nh=g(Wo());function Iu(e,t){t.forEach(r=>{e.addOption(r())}),e.commands.forEach(r=>Iu(r,t))}function oh(e){let t=nh.default.version;e.name("webflow").description("Webflow CLI").version(t,"-v, --version").configureHelp({formatHelp(r,n){return rh.Help.prototype.formatHelp.call(this,r,n).split(`
|
|
186
|
+
`).flatMap(o=>o.startsWith("Usage:")?["",Y(o)]:/^(Options:|Commands:|Arguments:)/.test(o)?[Y(o)]:/^Webflow CLI$/.test(o)?[ju(o)]:o.trim()===""?[o]:[S(o)]).map(o=>o.trim()===""?o:` ${o}`).join(`
|
|
188
187
|
`)+`
|
|
189
|
-
`}}).addOption(
|
|
188
|
+
`}}).addOption(El()).addOption(Fl()).addOption(xl()).addOption(Cl()).showHelpAfterError(),e.hook("preAction",async r=>{let n=r.opts();n.input||Mc(!0),Et.start(),n.manifest&&Lc(n.manifest);try{await T.promptForConsentIfNeeded()}catch(o){u.debug(`Failed to check telemetry preference: ${o}`)}try{n.skipUpdateCheck||await new Gn().prompt()}catch(o){u.debug(`Failed to check for package updates: ${o}`)}}),e.hook("postAction",async()=>{Et.displayGrouped(),Et.stop()}),Tf(e),Ag(e),id(e),Qp(e),wg(e),Xp(e),Mg(e),zg(e),th(e),zp(e),e.commands.forEach(r=>{Iu(r,[El,Fl,xl,Cl])})}x();O();var sh=new ih.Command;oh(sh);sh.parseAsync().catch(e=>{if(e instanceof d){if(!e.skipLogging)if(e.isUserError){let t=e.prefix?`${e.prefix} `:"";console.error(`${t}${e.message}`)}else u.error(e,{prefix:e.prefix})}else u.error(e);process.exit(1)});
|
|
190
189
|
//# sourceMappingURL=index.js.map
|